extern void __VERIFIER_error() __attribute__ ((__noreturn__)); /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ typedef unsigned char __u8; typedef short __s16; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef unsigned long long __u64; typedef signed char s8; typedef unsigned char u8; typedef 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 long long __kernel_loff_t; typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef __u16 __le16; typedef __u16 __be16; typedef __u32 __le32; typedef __u32 __be32; typedef __u64 __be64; typedef __u16 __sum16; typedef __u32 __wsum; struct kernel_symbol { unsigned long value ; char const *name ; }; struct module; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef unsigned short umode_t; typedef __kernel_pid_t pid_t; typedef __kernel_clockid_t clockid_t; typedef _Bool bool; typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_loff_t loff_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef __kernel_time_t time_t; typedef __s32 int32_t; typedef __u8 uint8_t; typedef __u32 uint32_t; typedef __u64 uint64_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef u64 dma_addr_t; typedef unsigned int gfp_t; typedef unsigned int fmode_t; typedef unsigned int oom_flags_t; typedef u64 phys_addr_t; typedef phys_addr_t resource_size_t; struct __anonstruct_atomic_t_6 { int counter ; }; typedef struct __anonstruct_atomic_t_6 atomic_t; struct __anonstruct_atomic64_t_7 { long counter ; }; typedef struct __anonstruct_atomic64_t_7 atomic64_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct hlist_node; struct hlist_head { struct hlist_node *first ; }; struct hlist_node { struct hlist_node *next ; struct hlist_node **pprev ; }; struct callback_head { struct callback_head *next ; void (*func)(struct callback_head * ) ; }; struct pt_regs { unsigned long r15 ; unsigned long r14 ; unsigned long r13 ; unsigned long r12 ; unsigned long bp ; unsigned long bx ; unsigned long r11 ; unsigned long r10 ; unsigned long r9 ; unsigned long r8 ; unsigned long ax ; unsigned long cx ; unsigned long dx ; unsigned long si ; unsigned long di ; unsigned long orig_ax ; unsigned long ip ; unsigned long cs ; unsigned long flags ; unsigned long sp ; unsigned long ss ; }; struct __anonstruct____missing_field_name_9 { unsigned int a ; unsigned int b ; }; struct __anonstruct____missing_field_name_10 { u16 limit0 ; u16 base0 ; unsigned char base1 ; unsigned char type : 4 ; unsigned char s : 1 ; unsigned char dpl : 2 ; unsigned char p : 1 ; unsigned char limit : 4 ; unsigned char avl : 1 ; unsigned char l : 1 ; unsigned char d : 1 ; unsigned char g : 1 ; unsigned char base2 ; }; union __anonunion____missing_field_name_8 { struct __anonstruct____missing_field_name_9 __annonCompField4 ; struct __anonstruct____missing_field_name_10 __annonCompField5 ; }; struct desc_struct { union __anonunion____missing_field_name_8 __annonCompField6 ; }; typedef unsigned long pteval_t; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct __anonstruct_pte_t_11 { pteval_t pte ; }; typedef struct __anonstruct_pte_t_11 pte_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_12 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_12 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct mm_struct; struct task_struct; struct cpumask; struct qspinlock { atomic_t val ; }; typedef struct qspinlock arch_spinlock_t; struct qrwlock { atomic_t cnts ; arch_spinlock_t lock ; }; typedef struct qrwlock arch_rwlock_t; typedef void (*ctor_fn_t)(void); struct device; struct net_device; struct file_operations; struct completion; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct timespec; struct compat_timespec; struct __anonstruct_futex_16 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_17 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_18 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion____missing_field_name_15 { struct __anonstruct_futex_16 futex ; struct __anonstruct_nanosleep_17 nanosleep ; struct __anonstruct_poll_18 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion____missing_field_name_15 __annonCompField7 ; }; struct kernel_vm86_regs { struct pt_regs pt ; unsigned short es ; unsigned short __esh ; unsigned short ds ; unsigned short __dsh ; unsigned short fs ; unsigned short __fsh ; unsigned short gs ; unsigned short __gsh ; }; union __anonunion____missing_field_name_19 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion____missing_field_name_19 __annonCompField8 ; }; struct cpumask { unsigned long bits[128U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct fregs_state { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct____missing_field_name_29 { u64 rip ; u64 rdp ; }; struct __anonstruct____missing_field_name_30 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion____missing_field_name_28 { struct __anonstruct____missing_field_name_29 __annonCompField12 ; struct __anonstruct____missing_field_name_30 __annonCompField13 ; }; union __anonunion____missing_field_name_31 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct fxregs_state { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion____missing_field_name_28 __annonCompField14 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion____missing_field_name_31 __annonCompField15 ; }; struct swregs_state { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct xstate_header { u64 xfeatures ; u64 xcomp_bv ; u64 reserved[6U] ; }; struct xregs_state { struct fxregs_state i387 ; struct xstate_header header ; u8 __reserved[464U] ; }; union fpregs_state { struct fregs_state fsave ; struct fxregs_state fxsave ; struct swregs_state soft ; struct xregs_state xsave ; }; struct fpu { union fpregs_state state ; unsigned int last_cpu ; unsigned char fpstate_active ; unsigned char fpregs_active ; unsigned char counter ; }; struct seq_operations; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct fpu fpu ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_nr ; unsigned long error_code ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; }; typedef atomic64_t atomic_long_t; struct lockdep_map; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; }; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; struct lock_class { struct list_head hash_entry ; struct list_head lock_entry ; struct lockdep_subclass_key *key ; unsigned int subclass ; unsigned int dep_gen_id ; unsigned long usage_mask ; struct stack_trace usage_traces[13U] ; struct list_head locks_after ; struct list_head locks_before ; unsigned int version ; unsigned long ops ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache[2U] ; char const *name ; int cpu ; unsigned long ip ; }; struct held_lock { u64 prev_chain_key ; unsigned long acquire_ip ; struct lockdep_map *instance ; struct lockdep_map *nest_lock ; u64 waittime_stamp ; u64 holdtime_stamp ; unsigned short class_idx : 13 ; unsigned char irq_context : 2 ; unsigned char trylock : 1 ; unsigned char read : 2 ; unsigned char check : 1 ; unsigned char hardirqs_off : 1 ; unsigned short references : 12 ; unsigned int pin_count ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct____missing_field_name_35 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion____missing_field_name_34 { struct raw_spinlock rlock ; struct __anonstruct____missing_field_name_35 __annonCompField17 ; }; struct spinlock { union __anonunion____missing_field_name_34 __annonCompField18 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_36 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_36 rwlock_t; struct seqcount { unsigned int sequence ; struct lockdep_map dep_map ; }; typedef struct seqcount seqcount_t; struct __anonstruct_seqlock_t_45 { struct seqcount seqcount ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_45 seqlock_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct timeval { __kernel_time_t tv_sec ; __kernel_suseconds_t tv_usec ; }; struct user_namespace; struct __anonstruct_kuid_t_46 { uid_t val ; }; typedef struct __anonstruct_kuid_t_46 kuid_t; struct __anonstruct_kgid_t_47 { gid_t val ; }; typedef struct __anonstruct_kgid_t_47 kgid_t; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; kuid_t uid ; kgid_t gid ; dev_t rdev ; loff_t size ; struct timespec atime ; struct timespec mtime ; struct timespec ctime ; unsigned long blksize ; unsigned long long blocks ; }; struct vm_area_struct; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct __anonstruct_nodemask_t_48 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_48 nodemask_t; struct optimistic_spin_queue { atomic_t tail ; }; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct rw_semaphore; struct rw_semaphore { long count ; struct list_head wait_list ; raw_spinlock_t wait_lock ; struct optimistic_spin_queue osq ; struct task_struct *owner ; struct lockdep_map dep_map ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct notifier_block; struct timer_list { struct hlist_node entry ; unsigned long expires ; void (*function)(unsigned long ) ; unsigned long data ; u32 flags ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; struct rb_node { unsigned long __rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; }; struct rb_root { struct rb_node *rb_node ; }; struct ctl_table; struct nsproxy; struct ctl_table_root; struct ctl_table_header; struct ctl_dir; typedef int proc_handler(struct ctl_table * , int , void * , size_t * , loff_t * ); struct ctl_table_poll { atomic_t event ; wait_queue_head_t wait ; }; struct ctl_table { char const *procname ; void *data ; int maxlen ; umode_t mode ; struct ctl_table *child ; proc_handler *proc_handler ; struct ctl_table_poll *poll ; void *extra1 ; void *extra2 ; }; struct ctl_node { struct rb_node node ; struct ctl_table_header *header ; }; struct __anonstruct____missing_field_name_50 { struct ctl_table *ctl_table ; int used ; int count ; int nreg ; }; union __anonunion____missing_field_name_49 { struct __anonstruct____missing_field_name_50 __annonCompField19 ; struct callback_head rcu ; }; struct ctl_table_set; struct ctl_table_header { union __anonunion____missing_field_name_49 __annonCompField20 ; struct completion *unregistering ; struct ctl_table *ctl_table_arg ; struct ctl_table_root *root ; struct ctl_table_set *set ; struct ctl_dir *parent ; struct ctl_node *node ; }; struct ctl_dir { struct ctl_table_header header ; struct rb_root root ; }; struct ctl_table_set { int (*is_seen)(struct ctl_table_set * ) ; struct ctl_dir dir ; }; struct ctl_table_root { struct ctl_table_set default_set ; struct ctl_table_set *(*lookup)(struct ctl_table_root * , struct nsproxy * ) ; int (*permissions)(struct ctl_table_header * , struct ctl_table * ) ; }; struct workqueue_struct; struct work_struct; struct work_struct { atomic_long_t data ; struct list_head entry ; void (*func)(struct work_struct * ) ; struct lockdep_map lockdep_map ; }; struct delayed_work { struct work_struct work ; struct timer_list timer ; struct workqueue_struct *wq ; int cpu ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct resource { resource_size_t start ; resource_size_t end ; char const *name ; unsigned long flags ; struct resource *parent ; struct resource *sibling ; struct resource *child ; }; struct pci_dev; struct pm_message { int event ; }; typedef struct pm_message pm_message_t; struct dev_pm_ops { int (*prepare)(struct device * ) ; void (*complete)(struct device * ) ; int (*suspend)(struct device * ) ; int (*resume)(struct device * ) ; int (*freeze)(struct device * ) ; int (*thaw)(struct device * ) ; int (*poweroff)(struct device * ) ; int (*restore)(struct device * ) ; int (*suspend_late)(struct device * ) ; int (*resume_early)(struct device * ) ; int (*freeze_late)(struct device * ) ; int (*thaw_early)(struct device * ) ; int (*poweroff_late)(struct device * ) ; int (*restore_early)(struct device * ) ; int (*suspend_noirq)(struct device * ) ; int (*resume_noirq)(struct device * ) ; int (*freeze_noirq)(struct device * ) ; int (*thaw_noirq)(struct device * ) ; int (*poweroff_noirq)(struct device * ) ; int (*restore_noirq)(struct device * ) ; int (*runtime_suspend)(struct device * ) ; int (*runtime_resume)(struct device * ) ; int (*runtime_idle)(struct device * ) ; }; enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ; enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ; struct wakeup_source; struct wake_irq; struct pm_subsys_data { spinlock_t lock ; unsigned int refcount ; struct list_head clock_list ; }; struct dev_pm_qos; struct dev_pm_info { pm_message_t power_state ; unsigned char can_wakeup : 1 ; unsigned char async_suspend : 1 ; bool is_prepared ; bool is_suspended ; bool is_noirq_suspended ; bool is_late_suspended ; bool ignore_children ; bool early_init ; bool direct_complete ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; bool wakeup_path ; bool syscore ; struct timer_list suspend_timer ; unsigned long timer_expires ; struct work_struct work ; wait_queue_head_t wait_queue ; struct wake_irq *wakeirq ; atomic_t usage_count ; atomic_t child_count ; unsigned char disable_depth : 3 ; unsigned char idle_notification : 1 ; unsigned char request_pending : 1 ; unsigned char deferred_resume : 1 ; unsigned char run_wake : 1 ; unsigned char runtime_auto : 1 ; unsigned char no_callbacks : 1 ; unsigned char irq_safe : 1 ; unsigned char use_autosuspend : 1 ; unsigned char timer_autosuspends : 1 ; unsigned char memalloc_noio : 1 ; enum rpm_request request ; enum rpm_status runtime_status ; int runtime_error ; int autosuspend_delay ; unsigned long last_busy ; unsigned long active_jiffies ; unsigned long suspended_jiffies ; unsigned long accounting_timestamp ; struct pm_subsys_data *subsys_data ; void (*set_latency_tolerance)(struct device * , s32 ) ; struct dev_pm_qos *qos ; }; struct dev_pm_domain { struct dev_pm_ops ops ; void (*detach)(struct device * , bool ) ; int (*activate)(struct device * ) ; void (*sync)(struct device * ) ; void (*dismiss)(struct device * ) ; }; struct pci_bus; struct __anonstruct_mm_context_t_115 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; atomic_t perf_rdpmc_allowed ; }; typedef struct __anonstruct_mm_context_t_115 mm_context_t; struct bio_vec; struct llist_node; struct llist_node { struct llist_node *next ; }; struct cred; struct inode; struct arch_uprobe_task { unsigned long saved_scratch_register ; unsigned int saved_trap_nr ; unsigned int saved_tf ; }; enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ; struct __anonstruct____missing_field_name_148 { struct arch_uprobe_task autask ; unsigned long vaddr ; }; struct __anonstruct____missing_field_name_149 { struct callback_head dup_xol_work ; unsigned long dup_xol_addr ; }; union __anonunion____missing_field_name_147 { struct __anonstruct____missing_field_name_148 __annonCompField33 ; struct __anonstruct____missing_field_name_149 __annonCompField34 ; }; struct uprobe; struct return_instance; struct uprobe_task { enum uprobe_task_state state ; union __anonunion____missing_field_name_147 __annonCompField35 ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; struct return_instance *return_instances ; unsigned int depth ; }; struct xol_area; struct uprobes_state { struct xol_area *xol_area ; }; struct address_space; struct mem_cgroup; typedef void compound_page_dtor(struct page * ); union __anonunion____missing_field_name_150 { struct address_space *mapping ; void *s_mem ; }; union __anonunion____missing_field_name_152 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct____missing_field_name_156 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion____missing_field_name_155 { atomic_t _mapcount ; struct __anonstruct____missing_field_name_156 __annonCompField38 ; int units ; }; struct __anonstruct____missing_field_name_154 { union __anonunion____missing_field_name_155 __annonCompField39 ; atomic_t _count ; }; union __anonunion____missing_field_name_153 { unsigned long counters ; struct __anonstruct____missing_field_name_154 __annonCompField40 ; unsigned int active ; }; struct __anonstruct____missing_field_name_151 { union __anonunion____missing_field_name_152 __annonCompField37 ; union __anonunion____missing_field_name_153 __annonCompField41 ; }; struct __anonstruct____missing_field_name_158 { struct page *next ; int pages ; int pobjects ; }; struct slab; struct __anonstruct____missing_field_name_159 { compound_page_dtor *compound_dtor ; unsigned long compound_order ; }; union __anonunion____missing_field_name_157 { struct list_head lru ; struct __anonstruct____missing_field_name_158 __annonCompField43 ; struct slab *slab_page ; struct callback_head callback_head ; struct __anonstruct____missing_field_name_159 __annonCompField44 ; pgtable_t pmd_huge_pte ; }; struct kmem_cache; union __anonunion____missing_field_name_160 { unsigned long private ; spinlock_t *ptl ; struct kmem_cache *slab_cache ; struct page *first_page ; }; struct page { unsigned long flags ; union __anonunion____missing_field_name_150 __annonCompField36 ; struct __anonstruct____missing_field_name_151 __annonCompField42 ; union __anonunion____missing_field_name_157 __annonCompField45 ; union __anonunion____missing_field_name_160 __annonCompField46 ; struct mem_cgroup *mem_cgroup ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_shared_161 { struct rb_node rb ; unsigned long rb_subtree_last ; }; struct anon_vma; struct vm_operations_struct; struct mempolicy; struct vm_area_struct { unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; struct rb_node vm_rb ; unsigned long rb_subtree_gap ; struct mm_struct *vm_mm ; pgprot_t vm_page_prot ; unsigned long vm_flags ; struct __anonstruct_shared_161 shared ; struct list_head anon_vma_chain ; struct anon_vma *anon_vma ; struct vm_operations_struct const *vm_ops ; unsigned long vm_pgoff ; struct file *vm_file ; void *vm_private_data ; struct mempolicy *vm_policy ; }; struct core_thread { struct task_struct *task ; struct core_thread *next ; }; struct core_state { atomic_t nr_threads ; struct core_thread dumper ; struct completion startup ; }; struct task_rss_stat { int events ; int count[3U] ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct kioctx_table; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; u32 vmacache_seqnum ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; unsigned long mmap_base ; unsigned long mmap_legacy_base ; unsigned long task_size ; unsigned long highest_vm_end ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; atomic_long_t nr_ptes ; atomic_long_t nr_pmds ; int map_count ; spinlock_t page_table_lock ; struct rw_semaphore mmap_sem ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long pinned_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long def_flags ; unsigned long start_code ; unsigned long end_code ; unsigned long start_data ; unsigned long end_data ; unsigned long start_brk ; unsigned long brk ; unsigned long start_stack ; unsigned long arg_start ; unsigned long arg_end ; unsigned long env_start ; unsigned long env_end ; unsigned long saved_auxv[46U] ; struct mm_rss_stat rss_stat ; struct linux_binfmt *binfmt ; cpumask_var_t cpu_vm_mask_var ; mm_context_t context ; unsigned long flags ; struct core_state *core_state ; spinlock_t ioctx_lock ; struct kioctx_table *ioctx_table ; struct task_struct *owner ; struct file *exe_file ; struct mmu_notifier_mm *mmu_notifier_mm ; struct cpumask cpumask_allocation ; unsigned long numa_next_scan ; unsigned long numa_scan_offset ; int numa_scan_seq ; bool tlb_flush_pending ; struct uprobes_state uprobes_state ; void *bd_addr ; }; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; struct elf64_sym { Elf64_Word st_name ; unsigned char st_info ; unsigned char st_other ; Elf64_Half st_shndx ; Elf64_Addr st_value ; Elf64_Xword st_size ; }; typedef struct elf64_sym Elf64_Sym; union __anonunion____missing_field_name_166 { unsigned long bitmap[4U] ; struct callback_head callback_head ; }; struct idr_layer { int prefix ; int layer ; struct idr_layer *ary[256U] ; int count ; union __anonunion____missing_field_name_166 __annonCompField47 ; }; struct idr { struct idr_layer *hint ; struct idr_layer *top ; int layers ; int cur ; spinlock_t lock ; int id_free_cnt ; struct idr_layer *id_free ; }; struct ida_bitmap { long nr_busy ; unsigned long bitmap[15U] ; }; struct ida { struct idr idr ; struct ida_bitmap *free_bitmap ; }; struct dentry; struct iattr; struct super_block; struct file_system_type; struct kernfs_open_node; struct kernfs_iattrs; struct kernfs_root; struct kernfs_elem_dir { unsigned long subdirs ; struct rb_root children ; struct kernfs_root *root ; }; struct kernfs_node; struct kernfs_elem_symlink { struct kernfs_node *target_kn ; }; struct kernfs_ops; struct kernfs_elem_attr { struct kernfs_ops const *ops ; struct kernfs_open_node *open ; loff_t size ; struct kernfs_node *notify_next ; }; union __anonunion____missing_field_name_171 { struct kernfs_elem_dir dir ; struct kernfs_elem_symlink symlink ; struct kernfs_elem_attr attr ; }; struct kernfs_node { atomic_t count ; atomic_t active ; struct lockdep_map dep_map ; struct kernfs_node *parent ; char const *name ; struct rb_node rb ; void const *ns ; unsigned int hash ; union __anonunion____missing_field_name_171 __annonCompField48 ; void *priv ; unsigned short flags ; umode_t mode ; unsigned int ino ; struct kernfs_iattrs *iattr ; }; struct kernfs_syscall_ops { int (*remount_fs)(struct kernfs_root * , int * , char * ) ; int (*show_options)(struct seq_file * , struct kernfs_root * ) ; int (*mkdir)(struct kernfs_node * , char const * , umode_t ) ; int (*rmdir)(struct kernfs_node * ) ; int (*rename)(struct kernfs_node * , struct kernfs_node * , char const * ) ; }; struct kernfs_root { struct kernfs_node *kn ; unsigned int flags ; struct ida ino_ida ; struct kernfs_syscall_ops *syscall_ops ; struct list_head supers ; wait_queue_head_t deactivate_waitq ; }; struct kernfs_open_file { struct kernfs_node *kn ; struct file *file ; void *priv ; struct mutex mutex ; int event ; struct list_head list ; char *prealloc_buf ; size_t atomic_write_len ; bool mmapped ; struct vm_operations_struct const *vm_ops ; }; struct kernfs_ops { int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; ssize_t (*read)(struct kernfs_open_file * , char * , size_t , loff_t ) ; size_t atomic_write_len ; bool prealloc ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; int (*mmap)(struct kernfs_open_file * , struct vm_area_struct * ) ; struct lock_class_key lockdep_key ; }; struct sock; struct kobject; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; bool (*current_may_mount)(void) ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct bin_attribute; struct attribute { char const *name ; umode_t mode ; bool ignore_lockdep ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct attribute_group { char const *name ; umode_t (*is_visible)(struct kobject * , struct attribute * , int ) ; struct attribute **attrs ; struct bin_attribute **bin_attrs ; }; struct bin_attribute { struct attribute attr ; size_t size ; void *private ; ssize_t (*read)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; ssize_t (*write)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; int (*mmap)(struct file * , struct kobject * , struct bin_attribute * , struct vm_area_struct * ) ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; }; struct kref { atomic_t refcount ; }; struct kset; struct kobj_type; struct kobject { char const *name ; struct list_head entry ; struct kobject *parent ; struct kset *kset ; struct kobj_type *ktype ; struct kernfs_node *sd ; struct kref kref ; struct delayed_work release ; unsigned char state_initialized : 1 ; unsigned char state_in_sysfs : 1 ; unsigned char state_add_uevent_sent : 1 ; unsigned char state_remove_uevent_sent : 1 ; unsigned char uevent_suppress : 1 ; }; struct kobj_type { void (*release)(struct kobject * ) ; struct sysfs_ops const *sysfs_ops ; struct attribute **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject * ) ; void const *(*namespace)(struct kobject * ) ; }; struct kobj_uevent_env { char *argv[3U] ; char *envp[32U] ; int envp_idx ; char buf[2048U] ; int buflen ; }; struct kset_uevent_ops { int (* const filter)(struct kset * , struct kobject * ) ; char const *(* const name)(struct kset * , struct kobject * ) ; int (* const uevent)(struct kset * , struct kobject * , struct kobj_uevent_env * ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops const *uevent_ops ; }; struct kernel_param; struct kernel_param_ops { unsigned int flags ; int (*set)(char const * , struct kernel_param const * ) ; int (*get)(char * , struct kernel_param const * ) ; void (*free)(void * ) ; }; struct kparam_string; struct kparam_array; union __anonunion____missing_field_name_172 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct module *mod ; struct kernel_param_ops const *ops ; u16 const perm ; s8 level ; u8 flags ; union __anonunion____missing_field_name_172 __annonCompField49 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int elemsize ; unsigned int *num ; struct kernel_param_ops const *ops ; void *elem ; }; struct latch_tree_node { struct rb_node node[2U] ; }; struct mod_arch_specific { }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; struct completion *kobj_completion ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module_kobject * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module_kobject * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ; struct mod_tree_node { struct module *mod ; struct latch_tree_node node ; }; struct module_sect_attrs; struct module_notes_attrs; struct tracepoint; struct trace_event_call; struct trace_enum_map; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct mutex param_lock ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; bool sig_ok ; bool async_probe_requested ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; struct mod_tree_node mtn_core ; struct mod_tree_node mtn_init ; unsigned int init_ro_size ; unsigned int core_ro_size ; struct mod_arch_specific arch ; unsigned int taints ; unsigned int num_bugs ; struct list_head bug_list ; struct bug_entry *bug_table ; Elf64_Sym *symtab ; Elf64_Sym *core_symtab ; unsigned int num_symtab ; unsigned int core_num_syms ; char *strtab ; char *core_strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; char *args ; void *percpu ; unsigned int percpu_size ; unsigned int num_tracepoints ; struct tracepoint * const *tracepoints_ptrs ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct trace_event_call **trace_events ; unsigned int num_trace_events ; struct trace_enum_map **trace_enums ; unsigned int num_trace_enums ; unsigned int num_ftrace_callsites ; unsigned long *ftrace_callsites ; bool klp_alive ; struct list_head source_list ; struct list_head target_list ; void (*exit)(void) ; atomic_t refcnt ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; typedef unsigned long cputime_t; struct sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; struct user_struct; struct sysv_shm { struct list_head shm_clist ; }; struct __anonstruct_sigset_t_180 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_180 sigset_t; struct siginfo; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_182 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_183 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_184 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_185 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__addr_bnd_187 { void *_lower ; void *_upper ; }; struct __anonstruct__sigfault_186 { void *_addr ; short _addr_lsb ; struct __anonstruct__addr_bnd_187 _addr_bnd ; }; struct __anonstruct__sigpoll_188 { long _band ; int _fd ; }; struct __anonstruct__sigsys_189 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_181 { int _pad[28U] ; struct __anonstruct__kill_182 _kill ; struct __anonstruct__timer_183 _timer ; struct __anonstruct__rt_184 _rt ; struct __anonstruct__sigchld_185 _sigchld ; struct __anonstruct__sigfault_186 _sigfault ; struct __anonstruct__sigpoll_188 _sigpoll ; struct __anonstruct__sigsys_189 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_181 _sifields ; }; typedef struct siginfo siginfo_t; struct sigpending { struct list_head list ; sigset_t signal ; }; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct callback_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; struct rt_mutex_waiter; struct rlimit { __kernel_ulong_t rlim_cur ; __kernel_ulong_t rlim_max ; }; struct timerqueue_node { struct rb_node node ; ktime_t expires ; }; struct timerqueue_head { struct rb_root head ; struct timerqueue_node *next ; }; struct hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; struct hrtimer { struct timerqueue_node node ; ktime_t _softexpires ; enum hrtimer_restart (*function)(struct hrtimer * ) ; struct hrtimer_clock_base *base ; unsigned long state ; int start_pid ; void *start_site ; char start_comm[16U] ; }; struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base ; int index ; clockid_t clockid ; struct timerqueue_head active ; ktime_t (*get_time)(void) ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; seqcount_t seq ; struct hrtimer *running ; unsigned int cpu ; unsigned int active_bases ; unsigned int clock_was_set_seq ; bool migration_enabled ; bool nohz_active ; unsigned char in_hrtirq : 1 ; unsigned char hres_active : 1 ; unsigned char hang_detected : 1 ; ktime_t expires_next ; struct hrtimer *next_timer ; unsigned int nr_events ; unsigned int nr_retries ; unsigned int nr_hangs ; unsigned int max_hang_time ; struct hrtimer_clock_base clock_base[4U] ; }; struct task_io_accounting { u64 rchar ; u64 wchar ; u64 syscr ; u64 syscw ; u64 read_bytes ; u64 write_bytes ; u64 cancelled_write_bytes ; }; struct latency_record { unsigned long backtrace[12U] ; unsigned int count ; unsigned long time ; unsigned long max ; }; struct assoc_array_ptr; struct assoc_array { struct assoc_array_ptr *root ; unsigned long nr_leaves_on_tree ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_index_key { struct key_type *type ; char const *description ; size_t desc_len ; }; union __anonunion____missing_field_name_196 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion____missing_field_name_197 { time_t expiry ; time_t revoked_at ; }; struct __anonstruct____missing_field_name_199 { struct key_type *type ; char *description ; }; union __anonunion____missing_field_name_198 { struct keyring_index_key index_key ; struct __anonstruct____missing_field_name_199 __annonCompField52 ; }; union __anonunion_type_data_200 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_202 { unsigned long value ; void *rcudata ; void *data ; void *data2[2U] ; }; union __anonunion____missing_field_name_201 { union __anonunion_payload_202 payload ; struct assoc_array keys ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion____missing_field_name_196 __annonCompField50 ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion____missing_field_name_197 __annonCompField51 ; time_t last_used_at ; kuid_t uid ; kgid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; union __anonunion____missing_field_name_198 __annonCompField53 ; union __anonunion_type_data_200 type_data ; union __anonunion____missing_field_name_201 __annonCompField54 ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_t *blocks[0U] ; }; struct cred { atomic_t usage ; atomic_t subscribers ; void *put_addr ; unsigned int magic ; kuid_t uid ; kgid_t gid ; kuid_t suid ; kgid_t sgid ; kuid_t euid ; kgid_t egid ; kuid_t fsuid ; kgid_t fsgid ; unsigned int securebits ; kernel_cap_t cap_inheritable ; kernel_cap_t cap_permitted ; kernel_cap_t cap_effective ; kernel_cap_t cap_bset ; unsigned char jit_keyring ; struct key *session_keyring ; struct key *process_keyring ; struct key *thread_keyring ; struct key *request_key_auth ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct callback_head rcu ; }; struct percpu_ref; typedef void percpu_ref_func_t(struct percpu_ref * ); struct percpu_ref { atomic_long_t count ; unsigned long percpu_count_ptr ; percpu_ref_func_t *release ; percpu_ref_func_t *confirm_switch ; bool force_atomic ; struct callback_head rcu ; }; struct cgroup; struct cgroup_root; struct cgroup_subsys; struct cgroup_taskset; struct cgroup_subsys_state { struct cgroup *cgroup ; struct cgroup_subsys *ss ; struct percpu_ref refcnt ; struct cgroup_subsys_state *parent ; struct list_head sibling ; struct list_head children ; int id ; unsigned int flags ; u64 serial_nr ; struct callback_head callback_head ; struct work_struct destroy_work ; }; struct css_set { atomic_t refcount ; struct hlist_node hlist ; struct list_head tasks ; struct list_head mg_tasks ; struct list_head cgrp_links ; struct cgroup *dfl_cgrp ; struct cgroup_subsys_state *subsys[12U] ; struct list_head mg_preload_node ; struct list_head mg_node ; struct cgroup *mg_src_cgrp ; struct css_set *mg_dst_cset ; struct list_head e_cset_node[12U] ; struct callback_head callback_head ; }; struct cgroup { struct cgroup_subsys_state self ; unsigned long flags ; int id ; int populated_cnt ; struct kernfs_node *kn ; struct kernfs_node *procs_kn ; struct kernfs_node *populated_kn ; unsigned int subtree_control ; unsigned int child_subsys_mask ; struct cgroup_subsys_state *subsys[12U] ; struct cgroup_root *root ; struct list_head cset_links ; struct list_head e_csets[12U] ; struct list_head pidlists ; struct mutex pidlist_mutex ; wait_queue_head_t offline_waitq ; struct work_struct release_agent_work ; }; struct cgroup_root { struct kernfs_root *kf_root ; unsigned int subsys_mask ; int hierarchy_id ; struct cgroup cgrp ; atomic_t nr_cgrps ; struct list_head root_list ; unsigned int flags ; struct idr cgroup_idr ; char release_agent_path[4096U] ; char name[64U] ; }; struct cftype { char name[64U] ; int private ; umode_t mode ; size_t max_write_len ; unsigned int flags ; struct cgroup_subsys *ss ; struct list_head node ; struct kernfs_ops *kf_ops ; u64 (*read_u64)(struct cgroup_subsys_state * , struct cftype * ) ; s64 (*read_s64)(struct cgroup_subsys_state * , struct cftype * ) ; int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; int (*write_u64)(struct cgroup_subsys_state * , struct cftype * , u64 ) ; int (*write_s64)(struct cgroup_subsys_state * , struct cftype * , s64 ) ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; struct lock_class_key lockdep_key ; }; struct cgroup_subsys { struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state * ) ; int (*css_online)(struct cgroup_subsys_state * ) ; void (*css_offline)(struct cgroup_subsys_state * ) ; void (*css_released)(struct cgroup_subsys_state * ) ; void (*css_free)(struct cgroup_subsys_state * ) ; void (*css_reset)(struct cgroup_subsys_state * ) ; void (*css_e_css_changed)(struct cgroup_subsys_state * ) ; int (*can_attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*cancel_attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*fork)(struct task_struct * ) ; void (*exit)(struct cgroup_subsys_state * , struct cgroup_subsys_state * , struct task_struct * ) ; void (*bind)(struct cgroup_subsys_state * ) ; int disabled ; int early_init ; bool broken_hierarchy ; bool warned_broken_hierarchy ; int id ; char const *name ; struct cgroup_root *root ; struct idr css_idr ; struct list_head cfts ; struct cftype *dfl_cftypes ; struct cftype *legacy_cftypes ; unsigned int depends_on ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct nameidata; struct cfs_rq; struct task_group; struct sighand_struct { atomic_t count ; struct k_sigaction action[64U] ; spinlock_t siglock ; wait_queue_head_t signalfd_wqh ; }; struct pacct_struct { int ac_flag ; long ac_exitcode ; unsigned long ac_mem ; cputime_t ac_utime ; cputime_t ac_stime ; unsigned long ac_minflt ; unsigned long ac_majflt ; }; struct cpu_itimer { cputime_t expires ; cputime_t incr ; u32 error ; u32 incr_error ; }; struct cputime { cputime_t utime ; cputime_t stime ; }; struct task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct task_cputime_atomic { atomic64_t utime ; atomic64_t stime ; atomic64_t sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime_atomic cputime_atomic ; int running ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; struct list_head thread_head ; wait_queue_head_t wait_chldexit ; struct task_struct *curr_target ; struct sigpending shared_pending ; int group_exit_code ; int notify_count ; struct task_struct *group_exit_task ; int group_stop_count ; unsigned int flags ; unsigned char is_child_subreaper : 1 ; unsigned char has_child_subreaper : 1 ; int posix_timer_id ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; seqlock_t stats_lock ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; unsigned long cnvcsw ; unsigned long cnivcsw ; unsigned long min_flt ; unsigned long maj_flt ; unsigned long cmin_flt ; unsigned long cmaj_flt ; unsigned long inblock ; unsigned long oublock ; unsigned long cinblock ; unsigned long coublock ; unsigned long maxrss ; unsigned long cmaxrss ; struct task_io_accounting ioac ; unsigned long long sum_sched_runtime ; struct rlimit rlim[16U] ; struct pacct_struct pacct ; struct taskstats *stats ; unsigned int audit_tty ; unsigned int audit_tty_log_passwd ; struct tty_audit_buf *tty_audit_buf ; oom_flags_t oom_flags ; short oom_score_adj ; short oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; atomic_t sigpending ; atomic_t inotify_watches ; atomic_t inotify_devs ; atomic_t fanotify_listeners ; atomic_long_t epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; kuid_t uid ; atomic_long_t locked_vm ; }; struct backing_dev_info; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; struct task_delay_info { spinlock_t lock ; unsigned int flags ; u64 blkio_start ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; u64 freepages_start ; u64 freepages_delay ; u32 freepages_count ; }; struct wake_q_node { struct wake_q_node *next ; }; struct io_context; struct pipe_inode_info; struct uts_namespace; struct load_weight { unsigned long weight ; u32 inv_weight ; }; struct sched_avg { u64 last_runnable_update ; s64 decay_count ; unsigned long load_avg_contrib ; unsigned long utilization_avg_contrib ; u32 runnable_avg_sum ; u32 avg_period ; u32 running_avg_sum ; }; struct sched_statistics { u64 wait_start ; u64 wait_max ; u64 wait_count ; u64 wait_sum ; u64 iowait_count ; u64 iowait_sum ; u64 sleep_start ; u64 sleep_max ; s64 sum_sleep_runtime ; u64 block_start ; u64 block_max ; u64 exec_max ; u64 slice_max ; u64 nr_migrations_cold ; u64 nr_failed_migrations_affine ; u64 nr_failed_migrations_running ; u64 nr_failed_migrations_hot ; u64 nr_forced_migrations ; u64 nr_wakeups ; u64 nr_wakeups_sync ; u64 nr_wakeups_migrate ; u64 nr_wakeups_local ; u64 nr_wakeups_remote ; u64 nr_wakeups_affine ; u64 nr_wakeups_affine_attempts ; u64 nr_wakeups_passive ; u64 nr_wakeups_idle ; }; struct sched_entity { struct load_weight load ; struct rb_node run_node ; struct list_head group_node ; unsigned int on_rq ; u64 exec_start ; u64 sum_exec_runtime ; u64 vruntime ; u64 prev_sum_exec_runtime ; u64 nr_migrations ; struct sched_statistics statistics ; int depth ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; struct sched_avg avg ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned long watchdog_stamp ; unsigned int time_slice ; struct sched_rt_entity *back ; struct sched_rt_entity *parent ; struct rt_rq *rt_rq ; struct rt_rq *my_q ; }; struct sched_dl_entity { struct rb_node rb_node ; u64 dl_runtime ; u64 dl_deadline ; u64 dl_period ; u64 dl_bw ; s64 runtime ; u64 deadline ; unsigned int flags ; int dl_throttled ; int dl_new ; int dl_boosted ; int dl_yielded ; struct hrtimer dl_timer ; }; struct memcg_oom_info { struct mem_cgroup *memcg ; gfp_t gfp_mask ; int order ; unsigned char may_oom : 1 ; }; struct sched_class; struct files_struct; struct compat_robust_list_head; struct numa_group; struct ftrace_ret_stack; struct task_struct { long volatile state ; void *stack ; atomic_t usage ; unsigned int flags ; unsigned int ptrace ; struct llist_node wake_entry ; int on_cpu ; struct task_struct *last_wakee ; unsigned long wakee_flips ; unsigned long wakee_flip_decay_ts ; int wake_cpu ; int on_rq ; int prio ; int static_prio ; int normal_prio ; unsigned int rt_priority ; struct sched_class const *sched_class ; struct sched_entity se ; struct sched_rt_entity rt ; struct task_group *sched_task_group ; struct sched_dl_entity dl ; struct hlist_head preempt_notifiers ; unsigned int btrace_seq ; unsigned int policy ; int nr_cpus_allowed ; cpumask_t cpus_allowed ; unsigned long rcu_tasks_nvcsw ; bool rcu_tasks_holdout ; struct list_head rcu_tasks_holdout_list ; int rcu_tasks_idle_cpu ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct rb_node pushable_dl_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; u32 vmacache_seqnum ; struct vm_area_struct *vmacache[4U] ; struct task_rss_stat rss_stat ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned long jobctl ; unsigned int personality ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; unsigned char sched_migrated : 1 ; unsigned char memcg_kmem_skip_account : 1 ; unsigned char brk_randomized : 1 ; unsigned long atomic_flags ; struct restart_block restart_block ; pid_t pid ; pid_t tgid ; struct task_struct *real_parent ; struct task_struct *parent ; struct list_head children ; struct list_head sibling ; struct task_struct *group_leader ; struct list_head ptraced ; struct list_head ptrace_entry ; struct pid_link pids[3U] ; struct list_head thread_group ; struct list_head thread_node ; struct completion *vfork_done ; int *set_child_tid ; int *clear_child_tid ; cputime_t utime ; cputime_t stime ; cputime_t utimescaled ; cputime_t stimescaled ; cputime_t gtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; u64 start_time ; u64 real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; char comm[16U] ; struct nameidata *nameidata ; struct sysv_sem sysvsem ; struct sysv_shm sysvshm ; unsigned long last_switch_count ; struct thread_struct thread ; struct fs_struct *fs ; struct files_struct *files ; struct nsproxy *nsproxy ; struct signal_struct *signal ; struct sighand_struct *sighand ; sigset_t blocked ; sigset_t real_blocked ; sigset_t saved_sigmask ; struct sigpending pending ; unsigned long sas_ss_sp ; size_t sas_ss_size ; int (*notifier)(void * ) ; void *notifier_data ; sigset_t *notifier_mask ; struct callback_head *task_works ; struct audit_context *audit_context ; kuid_t loginuid ; unsigned int sessionid ; struct seccomp seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; raw_spinlock_t pi_lock ; struct wake_q_node wake_q ; struct rb_root pi_waiters ; struct rb_node *pi_waiters_leftmost ; struct rt_mutex_waiter *pi_blocked_on ; struct mutex_waiter *blocked_on ; unsigned int irq_events ; unsigned long hardirq_enable_ip ; unsigned long hardirq_disable_ip ; unsigned int hardirq_enable_event ; unsigned int hardirq_disable_event ; int hardirqs_enabled ; int hardirq_context ; unsigned long softirq_disable_ip ; unsigned long softirq_enable_ip ; unsigned int softirq_disable_event ; unsigned int softirq_enable_event ; int softirqs_enabled ; int softirq_context ; u64 curr_chain_key ; int lockdep_depth ; unsigned int lockdep_recursion ; struct held_lock held_locks[48U] ; gfp_t lockdep_reclaim_gfp ; void *journal_info ; struct bio_list *bio_list ; struct blk_plug *plug ; struct reclaim_state *reclaim_state ; struct backing_dev_info *backing_dev_info ; struct io_context *io_context ; unsigned long ptrace_message ; siginfo_t *last_siginfo ; struct task_io_accounting ioac ; u64 acct_rss_mem1 ; u64 acct_vm_mem1 ; cputime_t acct_timexpd ; nodemask_t mems_allowed ; seqcount_t mems_allowed_seq ; int cpuset_mem_spread_rotor ; int cpuset_slab_spread_rotor ; struct css_set *cgroups ; struct list_head cg_list ; struct robust_list_head *robust_list ; struct compat_robust_list_head *compat_robust_list ; struct list_head pi_state_list ; struct futex_pi_state *pi_state_cache ; struct perf_event_context *perf_event_ctxp[2U] ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; short pref_node_fork ; int numa_scan_seq ; unsigned int numa_scan_period ; unsigned int numa_scan_period_max ; int numa_preferred_nid ; unsigned long numa_migrate_retry ; u64 node_stamp ; u64 last_task_numa_placement ; u64 last_sum_exec_runtime ; struct callback_head numa_work ; struct list_head numa_entry ; struct numa_group *numa_group ; unsigned long *numa_faults ; unsigned long total_numa_faults ; unsigned long numa_faults_locality[3U] ; unsigned long numa_pages_migrated ; struct callback_head rcu ; struct pipe_inode_info *splice_pipe ; struct page_frag task_frag ; struct task_delay_info *delays ; int make_it_fail ; int nr_dirtied ; int nr_dirtied_pause ; unsigned long dirty_paused_when ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; unsigned int kasan_depth ; int curr_ret_stack ; struct ftrace_ret_stack *ret_stack ; unsigned long long ftrace_timestamp ; atomic_t trace_overrun ; atomic_t tracing_graph_pause ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_oom_info memcg_oom ; struct uprobe_task *utask ; unsigned int sequential_io ; unsigned int sequential_io_avg ; unsigned long task_state_change ; int pagefault_disabled ; }; enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ; typedef enum irqreturn irqreturn_t; struct ethtool_cmd; struct device_driver; struct nes_cm_core; struct nes_cm_info; struct ethtool_pauseparam; struct nes_vnic; struct ethtool_coalesce; struct nes_cm_node; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct path; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; size_t pad_until ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; struct user_namespace *user_ns ; void *private ; }; struct seq_operations { void *(*start)(struct seq_file * , loff_t * ) ; void (*stop)(struct seq_file * , void * ) ; void *(*next)(struct seq_file * , void * , loff_t * ) ; int (*show)(struct seq_file * , void * ) ; }; struct pinctrl; struct pinctrl_state; struct dev_pin_info { struct pinctrl *p ; struct pinctrl_state *default_state ; struct pinctrl_state *sleep_state ; struct pinctrl_state *idle_state ; }; struct dma_map_ops; struct dev_archdata { struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct fwnode_handle; struct iommu_ops; struct iommu_group; struct device_attribute; struct bus_type { char const *name ; char const *dev_name ; struct device *dev_root ; struct device_attribute *dev_attrs ; struct attribute_group const **bus_groups ; struct attribute_group const **dev_groups ; struct attribute_group const **drv_groups ; int (*match)(struct device * , struct device_driver * ) ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*online)(struct device * ) ; int (*offline)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct dev_pm_ops const *pm ; struct iommu_ops const *iommu_ops ; struct subsys_private *p ; struct lock_class_key lock_key ; }; struct device_type; enum probe_type { PROBE_DEFAULT_STRATEGY = 0, PROBE_PREFER_ASYNCHRONOUS = 1, PROBE_FORCE_SYNCHRONOUS = 2 } ; struct of_device_id; struct acpi_device_id; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; enum probe_type probe_type ; struct of_device_id const *of_match_table ; struct acpi_device_id const *acpi_match_table ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct attribute_group const **groups ; struct dev_pm_ops const *pm ; struct driver_private *p ; }; struct 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 attribute_group const **dev_groups ; struct kobject *dev_kobj ; int (*dev_uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * ) ; void (*class_release)(struct class * ) ; void (*dev_release)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct kobj_ns_type_operations const *ns_type ; void const *(*namespace)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class * , struct class_attribute * , char * ) ; ssize_t (*store)(struct class * , struct class_attribute * , char const * , size_t ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * , kuid_t * , kgid_t * ) ; void (*release)(struct device * ) ; struct dev_pm_ops const *pm ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device * , struct device_attribute * , char * ) ; ssize_t (*store)(struct device * , struct device_attribute * , char const * , size_t ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct dma_coherent_mem; struct cma; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; void *driver_data ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; struct dev_pin_info *pins ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; unsigned long dma_pfn_offset ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct cma *cma_area ; struct dev_archdata archdata ; struct device_node *of_node ; struct fwnode_handle *fwnode ; dev_t devt ; u32 id ; spinlock_t devres_lock ; struct list_head devres_head ; struct klist_node knode_class ; struct class *class ; struct attribute_group const **groups ; void (*release)(struct device * ) ; struct iommu_group *iommu_group ; bool offline_disabled ; bool offline ; }; struct wakeup_source { char const *name ; struct list_head entry ; spinlock_t lock ; struct wake_irq *wakeirq ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active ; bool autosleep_enabled ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct kvec { void *iov_base ; size_t iov_len ; }; union __anonunion____missing_field_name_217 { struct iovec const *iov ; struct kvec const *kvec ; struct bio_vec const *bvec ; }; struct iov_iter { int type ; size_t iov_offset ; size_t count ; union __anonunion____missing_field_name_217 __annonCompField58 ; unsigned long nr_segs ; }; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; int nid ; struct mem_cgroup *memcg ; }; struct shrinker { unsigned long (*count_objects)(struct shrinker * , struct shrink_control * ) ; unsigned long (*scan_objects)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; unsigned long flags ; struct list_head list ; atomic_long_t *nr_deferred ; }; struct file_ra_state; struct writeback_control; struct bdi_writeback; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *cow_page ; struct page *page ; unsigned long max_pgoff ; pte_t *pte ; }; struct vm_operations_struct { void (*open)(struct vm_area_struct * ) ; void (*close)(struct vm_area_struct * ) ; int (*fault)(struct vm_area_struct * , struct vm_fault * ) ; void (*map_pages)(struct vm_area_struct * , struct vm_fault * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*pfn_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; char const *(*name)(struct vm_area_struct * ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; struct page *(*find_special_page)(struct vm_area_struct * , unsigned long ) ; }; struct scatterlist { unsigned long sg_magic ; unsigned long page_link ; unsigned int offset ; unsigned int length ; dma_addr_t dma_address ; unsigned int dma_length ; }; struct sg_table { struct scatterlist *sgl ; unsigned int nents ; unsigned int orig_nents ; }; struct 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 ; }; typedef unsigned short __kernel_sa_family_t; struct __kernel_sockaddr_storage { __kernel_sa_family_t ss_family ; char __data[126U] ; }; typedef __kernel_sa_family_t sa_family_t; struct sockaddr { sa_family_t sa_family ; char sa_data[14U] ; }; struct kiocb; struct msghdr { void *msg_name ; int msg_namelen ; struct iov_iter msg_iter ; void *msg_control ; __kernel_size_t msg_controllen ; unsigned int msg_flags ; struct kiocb *msg_iocb ; }; struct __anonstruct_sync_serial_settings_219 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_219 sync_serial_settings; struct __anonstruct_te1_settings_220 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_220 te1_settings; struct __anonstruct_raw_hdlc_proto_221 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_221 raw_hdlc_proto; struct __anonstruct_fr_proto_222 { 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_222 fr_proto; struct __anonstruct_fr_proto_pvc_223 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_223 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_224 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_224 fr_proto_pvc_info; struct __anonstruct_cisco_proto_225 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_225 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_226 { 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_226 ifs_ifsu ; }; union __anonunion_ifr_ifrn_227 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_228 { 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_227 ifr_ifrn ; union __anonunion_ifr_ifru_228 ifr_ifru ; }; struct hlist_bl_node; struct hlist_bl_head { struct hlist_bl_node *first ; }; struct hlist_bl_node { struct hlist_bl_node *next ; struct hlist_bl_node **pprev ; }; struct __anonstruct____missing_field_name_233 { spinlock_t lock ; int count ; }; union __anonunion____missing_field_name_232 { struct __anonstruct____missing_field_name_233 __annonCompField59 ; }; struct lockref { union __anonunion____missing_field_name_232 __annonCompField60 ; }; struct vfsmount; struct __anonstruct____missing_field_name_235 { u32 hash ; u32 len ; }; union __anonunion____missing_field_name_234 { struct __anonstruct____missing_field_name_235 __annonCompField61 ; u64 hash_len ; }; struct qstr { union __anonunion____missing_field_name_234 __annonCompField62 ; unsigned char const *name ; }; struct dentry_operations; union __anonunion_d_u_236 { struct hlist_node d_alias ; struct callback_head d_rcu ; }; struct dentry { unsigned int d_flags ; seqcount_t d_seq ; struct hlist_bl_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct inode *d_inode ; unsigned char d_iname[32U] ; struct lockref d_lockref ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; struct list_head d_child ; struct list_head d_subdirs ; union __anonunion_d_u_236 d_u ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , unsigned int ) ; int (*d_weak_revalidate)(struct dentry * , unsigned int ) ; int (*d_hash)(struct dentry const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct dentry const * , unsigned int , char const * , struct qstr const * ) ; int (*d_delete)(struct dentry const * ) ; void (*d_release)(struct dentry * ) ; void (*d_prune)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; struct vfsmount *(*d_automount)(struct path * ) ; int (*d_manage)(struct dentry * , bool ) ; struct inode *(*d_select_inode)(struct dentry * , unsigned int ) ; }; struct path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct list_lru_one { struct list_head list ; long nr_items ; }; struct list_lru_memcg { struct list_lru_one *lru[0U] ; }; struct list_lru_node { spinlock_t lock ; struct list_lru_one lru ; struct list_lru_memcg *memcg_lrus ; }; struct list_lru { struct list_lru_node *node ; struct list_head list ; }; struct __anonstruct____missing_field_name_240 { struct radix_tree_node *parent ; void *private_data ; }; union __anonunion____missing_field_name_239 { struct __anonstruct____missing_field_name_240 __annonCompField63 ; struct callback_head callback_head ; }; struct radix_tree_node { unsigned int path ; unsigned int count ; union __anonunion____missing_field_name_239 __annonCompField64 ; struct list_head private_list ; void *slots[64U] ; unsigned long tags[3U][1U] ; }; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct block_device; struct bio_vec { struct page *bv_page ; unsigned int bv_len ; unsigned int bv_offset ; }; struct export_operations; struct 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 dquot; typedef __kernel_uid32_t projid_t; struct __anonstruct_kprojid_t_244 { projid_t val ; }; typedef struct __anonstruct_kprojid_t_244 kprojid_t; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion____missing_field_name_245 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion____missing_field_name_245 __annonCompField66 ; enum quota_type type ; }; struct mem_dqblk { qsize_t dqb_bhardlimit ; qsize_t dqb_bsoftlimit ; qsize_t dqb_curspace ; qsize_t dqb_rsvspace ; qsize_t dqb_ihardlimit ; qsize_t dqb_isoftlimit ; qsize_t dqb_curinodes ; time_t dqb_btime ; time_t dqb_itime ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_max_spc_limit ; qsize_t dqi_max_ino_limit ; void *dqi_priv ; }; struct dquot { struct hlist_node dq_hash ; struct list_head dq_inuse ; struct list_head dq_free ; struct list_head dq_dirty ; struct mutex dq_lock ; atomic_t dq_count ; wait_queue_head_t dq_wait_unused ; struct super_block *dq_sb ; struct kqid dq_id ; loff_t dq_off ; unsigned long dq_flags ; struct mem_dqblk dq_dqb ; }; struct quota_format_ops { int (*check_quota_file)(struct super_block * , int ) ; int (*read_file_info)(struct super_block * , int ) ; int (*write_file_info)(struct super_block * , int ) ; int (*free_file_info)(struct super_block * , int ) ; int (*read_dqblk)(struct dquot * ) ; int (*commit_dqblk)(struct dquot * ) ; int (*release_dqblk)(struct dquot * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; int (*get_projid)(struct inode * , kprojid_t * ) ; }; struct qc_dqblk { int d_fieldmask ; u64 d_spc_hardlimit ; u64 d_spc_softlimit ; u64 d_ino_hardlimit ; u64 d_ino_softlimit ; u64 d_space ; u64 d_ino_count ; s64 d_ino_timer ; s64 d_spc_timer ; int d_ino_warns ; int d_spc_warns ; u64 d_rt_spc_hardlimit ; u64 d_rt_spc_softlimit ; u64 d_rt_space ; s64 d_rt_spc_timer ; int d_rt_spc_warns ; }; struct qc_type_state { unsigned int flags ; unsigned int spc_timelimit ; unsigned int ino_timelimit ; unsigned int rt_spc_timelimit ; unsigned int spc_warnlimit ; unsigned int ino_warnlimit ; unsigned int rt_spc_warnlimit ; unsigned long long ino ; blkcnt_t blocks ; blkcnt_t nextents ; }; struct qc_state { unsigned int s_incoredqs ; struct qc_type_state s_state[3U] ; }; struct qc_info { int i_fieldmask ; unsigned int i_flags ; unsigned int i_spc_timelimit ; unsigned int i_ino_timelimit ; unsigned int i_rt_spc_timelimit ; unsigned int i_spc_warnlimit ; unsigned int i_ino_warnlimit ; unsigned int i_rt_spc_warnlimit ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_enable)(struct super_block * , unsigned int ) ; int (*quota_disable)(struct super_block * , unsigned int ) ; int (*quota_sync)(struct super_block * , int ) ; int (*set_info)(struct super_block * , int , struct qc_info * ) ; int (*get_dqblk)(struct super_block * , struct kqid , struct qc_dqblk * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct qc_dqblk * ) ; int (*get_state)(struct super_block * , struct qc_state * ) ; int (*rm_xquota)(struct super_block * , unsigned int ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct inode *files[3U] ; struct mem_dqinfo info[3U] ; struct quota_format_ops const *ops[3U] ; }; struct kiocb { struct file *ki_filp ; loff_t ki_pos ; void (*ki_complete)(struct kiocb * , long , long ) ; void *private ; int ki_flags ; }; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned int , unsigned int ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(struct kiocb * , struct iov_iter * , loff_t ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , unsigned long , unsigned long ) ; void (*is_dirty_writeback)(struct page * , bool * , bool * ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; int (*swap_activate)(struct swap_info_struct * , struct file * , sector_t * ) ; void (*swap_deactivate)(struct file * ) ; }; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; atomic_t i_mmap_writable ; struct rb_root i_mmap ; struct rw_semaphore i_mmap_rwsem ; unsigned long nrpages ; unsigned long nrshadows ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; spinlock_t private_lock ; struct list_head private_list ; void *private_data ; }; struct request_queue; struct hd_struct; struct gendisk; struct block_device { dev_t bd_dev ; int bd_openers ; struct inode *bd_inode ; struct super_block *bd_super ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; bool bd_write_holder ; struct list_head bd_holder_disks ; struct block_device *bd_contains ; unsigned int bd_block_size ; struct hd_struct *bd_part ; unsigned int bd_part_count ; int bd_invalidated ; struct gendisk *bd_disk ; struct request_queue *bd_queue ; struct list_head bd_list ; unsigned long bd_private ; int bd_fsfreeze_count ; struct mutex bd_fsfreeze_mutex ; }; struct posix_acl; struct inode_operations; union __anonunion____missing_field_name_248 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion____missing_field_name_249 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock_context; struct cdev; union __anonunion____missing_field_name_250 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; char *i_link ; }; struct inode { umode_t i_mode ; unsigned short i_opflags ; kuid_t i_uid ; kgid_t i_gid ; unsigned int i_flags ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; struct inode_operations const *i_op ; struct super_block *i_sb ; struct address_space *i_mapping ; void *i_security ; unsigned long i_ino ; union __anonunion____missing_field_name_248 __annonCompField67 ; dev_t i_rdev ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; unsigned int i_blkbits ; blkcnt_t i_blocks ; unsigned long i_state ; struct mutex i_mutex ; unsigned long dirtied_when ; unsigned long dirtied_time_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct bdi_writeback *i_wb ; int i_wb_frn_winner ; u16 i_wb_frn_avg_time ; u16 i_wb_frn_history ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion____missing_field_name_249 __annonCompField68 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; atomic_t i_readcount ; struct file_operations const *i_fop ; struct file_lock_context *i_flctx ; struct address_space i_data ; struct list_head i_devices ; union __anonunion____missing_field_name_250 __annonCompField69 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; kuid_t uid ; kuid_t euid ; int signum ; }; struct file_ra_state { unsigned long start ; unsigned int size ; unsigned int async_size ; unsigned int ra_pages ; unsigned int mmap_miss ; loff_t prev_pos ; }; union __anonunion_f_u_251 { struct llist_node fu_llist ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_251 f_u ; struct path f_path ; struct inode *f_inode ; struct file_operations const *f_op ; spinlock_t f_lock ; atomic_long_t f_count ; unsigned int f_flags ; fmode_t f_mode ; struct mutex f_pos_lock ; loff_t f_pos ; struct fown_struct f_owner ; struct cred const *f_cred ; struct file_ra_state f_ra ; u64 f_version ; void *f_security ; void *private_data ; struct list_head f_ep_links ; struct list_head f_tfile_llink ; struct address_space *f_mapping ; }; typedef void *fl_owner_t; struct file_lock; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; }; struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock * , struct file_lock * ) ; unsigned long (*lm_owner_key)(struct file_lock * ) ; fl_owner_t (*lm_get_owner)(fl_owner_t ) ; void (*lm_put_owner)(fl_owner_t ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , int ) ; bool (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock * , int , struct list_head * ) ; void (*lm_setup)(struct file_lock * , void ** ) ; }; struct 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_253 { struct list_head link ; int state ; }; union __anonunion_fl_u_252 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_253 afs ; }; struct file_lock { struct file_lock *fl_next ; struct list_head fl_list ; struct hlist_node fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned int fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; int fl_link_cpu ; struct pid *fl_nspid ; wait_queue_head_t fl_wait ; struct file *fl_file ; loff_t fl_start ; loff_t fl_end ; struct fasync_struct *fl_fasync ; unsigned long fl_break_time ; unsigned long fl_downgrade_time ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_252 fl_u ; }; struct file_lock_context { spinlock_t flc_lock ; struct list_head flc_flock ; struct list_head flc_posix ; struct list_head flc_lease ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct callback_head fa_rcu ; }; struct sb_writers { struct percpu_counter counter[3U] ; wait_queue_head_t wait ; int frozen ; wait_queue_head_t wait_unfrozen ; struct lockdep_map lock_map[3U] ; }; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; unsigned char s_blocksize_bits ; unsigned long s_blocksize ; loff_t s_maxbytes ; struct file_system_type *s_type ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_iflags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head s_mounts ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; unsigned int s_quota_types ; struct quota_info s_dquot ; struct sb_writers s_writers ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; struct shrinker s_shrink ; atomic_long_t s_remove_count ; int s_readonly_remount ; struct workqueue_struct *s_dio_done_wq ; struct hlist_head s_pins ; struct list_lru s_dentry_lru ; struct list_lru s_inode_lru ; struct callback_head rcu ; int s_stack_depth ; }; struct fiemap_extent_info { unsigned int fi_flags ; unsigned int fi_extents_mapped ; unsigned int fi_extents_max ; struct fiemap_extent *fi_extents_start ; }; struct dir_context; struct dir_context { int (*actor)(struct dir_context * , char const * , int , loff_t , u64 , unsigned int ) ; loff_t pos ; }; struct file_operations { struct module *owner ; loff_t (*llseek)(struct file * , loff_t , int ) ; ssize_t (*read)(struct file * , char * , size_t , loff_t * ) ; ssize_t (*write)(struct file * , char const * , size_t , loff_t * ) ; ssize_t (*read_iter)(struct kiocb * , struct iov_iter * ) ; ssize_t (*write_iter)(struct kiocb * , struct iov_iter * ) ; int (*iterate)(struct file * , struct dir_context * ) ; unsigned int (*poll)(struct file * , struct poll_table_struct * ) ; long (*unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; long (*compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*mmap)(struct file * , struct vm_area_struct * ) ; int (*mremap)(struct file * , struct vm_area_struct * ) ; int (*open)(struct inode * , struct file * ) ; int (*flush)(struct file * , fl_owner_t ) ; int (*release)(struct inode * , struct file * ) ; int (*fsync)(struct file * , loff_t , loff_t , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** , void ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; void (*show_fdinfo)(struct seq_file * , struct file * ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; char const *(*follow_link)(struct dentry * , void ** ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct inode * , void * ) ; int (*create)(struct inode * , struct dentry * , umode_t , bool ) ; int (*link)(struct dentry * , struct inode * , struct dentry * ) ; int (*unlink)(struct inode * , struct dentry * ) ; int (*symlink)(struct inode * , struct dentry * , char const * ) ; int (*mkdir)(struct inode * , struct dentry * , umode_t ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , umode_t , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; int (*rename2)(struct inode * , struct dentry * , struct inode * , struct dentry * , unsigned int ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; int (*update_time)(struct inode * , struct timespec * , int ) ; int (*atomic_open)(struct inode * , struct dentry * , struct file * , unsigned int , umode_t , int * ) ; int (*tmpfile)(struct inode * , struct dentry * , umode_t ) ; int (*set_acl)(struct inode * , struct posix_acl * , int ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_super)(struct super_block * ) ; int (*freeze_fs)(struct super_block * ) ; int (*thaw_super)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; struct dquot **(*get_dquots)(struct inode * ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; long (*nr_cached_objects)(struct super_block * , struct shrink_control * ) ; long (*free_cached_objects)(struct super_block * , struct shrink_control * ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , void * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct hlist_head fs_supers ; struct lock_class_key s_lock_key ; struct lock_class_key s_umount_key ; struct lock_class_key s_vfs_rename_key ; struct lock_class_key s_writers_key[3U] ; struct lock_class_key i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; }; typedef s32 compat_time_t; typedef s32 compat_long_t; typedef u32 compat_uptr_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; struct compat_robust_list { compat_uptr_t next ; }; struct compat_robust_list_head { struct compat_robust_list list ; compat_long_t futex_offset ; compat_uptr_t list_op_pending ; }; enum ldv_23644 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_23644 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 socket * , struct msghdr * , size_t ) ; int (*recvmsg)(struct socket * , struct msghdr * , size_t , int ) ; int (*mmap)(struct file * , struct socket * , struct vm_area_struct * ) ; ssize_t (*sendpage)(struct socket * , struct page * , int , size_t , int ) ; ssize_t (*splice_read)(struct socket * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*set_peek_off)(struct sock * , int ) ; }; struct exception_table_entry { int insn ; int fixup ; }; struct in6_addr; struct sk_buff; struct 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; union __anonunion_in6_u_268 { __u8 u6_addr8[16U] ; __be16 u6_addr16[8U] ; __be32 u6_addr32[4U] ; }; struct in6_addr { union __anonunion_in6_u_268 in6_u ; }; struct ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_proto ; }; struct pipe_buf_operations; struct pipe_buffer { struct page *page ; unsigned int offset ; unsigned int len ; struct pipe_buf_operations const *ops ; unsigned int flags ; unsigned long private ; }; struct pipe_inode_info { struct mutex mutex ; wait_queue_head_t wait ; unsigned int nrbufs ; unsigned int curbuf ; unsigned int buffers ; unsigned int readers ; unsigned int writers ; unsigned int files ; unsigned int waiting_writers ; unsigned int r_counter ; unsigned int w_counter ; struct page *tmp_page ; struct fasync_struct *fasync_readers ; struct fasync_struct *fasync_writers ; struct pipe_buffer *bufs ; }; struct pipe_buf_operations { int can_merge ; int (*confirm)(struct pipe_inode_info * , struct pipe_buffer * ) ; void (*release)(struct pipe_inode_info * , struct pipe_buffer * ) ; int (*steal)(struct pipe_inode_info * , struct pipe_buffer * ) ; void (*get)(struct pipe_inode_info * , struct pipe_buffer * ) ; }; struct napi_struct; struct nf_conntrack { atomic_t use ; }; union __anonunion____missing_field_name_273 { struct net_device *physoutdev ; char neigh_header[8U] ; }; union __anonunion____missing_field_name_274 { __be32 ipv4_daddr ; struct in6_addr ipv6_daddr ; }; struct nf_bridge_info { atomic_t use ; unsigned char orig_proto ; bool pkt_otherhost ; __u16 frag_max_size ; unsigned int mask ; struct net_device *physindev ; union __anonunion____missing_field_name_273 __annonCompField73 ; union __anonunion____missing_field_name_274 __annonCompField74 ; }; struct sk_buff_head { struct sk_buff *next ; struct sk_buff *prev ; __u32 qlen ; spinlock_t lock ; }; struct skb_frag_struct; struct __anonstruct_page_275 { struct page *p ; }; struct skb_frag_struct { struct __anonstruct_page_275 page ; __u32 page_offset ; __u32 size ; }; typedef unsigned int sk_buff_data_t; struct __anonstruct____missing_field_name_277 { u32 stamp_us ; u32 stamp_jiffies ; }; union __anonunion____missing_field_name_276 { u64 v64 ; struct __anonstruct____missing_field_name_277 __annonCompField75 ; }; struct skb_mstamp { union __anonunion____missing_field_name_276 __annonCompField76 ; }; union __anonunion____missing_field_name_280 { ktime_t tstamp ; struct skb_mstamp skb_mstamp ; }; struct __anonstruct____missing_field_name_279 { struct sk_buff *next ; struct sk_buff *prev ; union __anonunion____missing_field_name_280 __annonCompField77 ; }; union __anonunion____missing_field_name_278 { struct __anonstruct____missing_field_name_279 __annonCompField78 ; struct rb_node rbnode ; }; struct sec_path; struct __anonstruct____missing_field_name_282 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion____missing_field_name_281 { __wsum csum ; struct __anonstruct____missing_field_name_282 __annonCompField80 ; }; union __anonunion____missing_field_name_283 { unsigned int napi_id ; unsigned int sender_cpu ; }; union __anonunion____missing_field_name_284 { __u32 mark ; __u32 reserved_tailroom ; }; union __anonunion____missing_field_name_285 { __be16 inner_protocol ; __u8 inner_ipproto ; }; struct sk_buff { union __anonunion____missing_field_name_278 __annonCompField79 ; struct sock *sk ; struct net_device *dev ; char cb[48U] ; unsigned long _skb_refdst ; void (*destructor)(struct sk_buff * ) ; struct sec_path *sp ; struct nf_conntrack *nfct ; struct nf_bridge_info *nf_bridge ; unsigned int len ; unsigned int data_len ; __u16 mac_len ; __u16 hdr_len ; __u16 queue_mapping ; unsigned char cloned : 1 ; unsigned char nohdr : 1 ; unsigned char fclone : 2 ; unsigned char peeked : 1 ; unsigned char head_frag : 1 ; unsigned char xmit_more : 1 ; __u32 headers_start[0U] ; __u8 __pkt_type_offset[0U] ; unsigned char pkt_type : 3 ; unsigned char pfmemalloc : 1 ; unsigned char ignore_df : 1 ; unsigned char nfctinfo : 3 ; unsigned char nf_trace : 1 ; unsigned char ip_summed : 2 ; unsigned char ooo_okay : 1 ; unsigned char l4_hash : 1 ; unsigned char sw_hash : 1 ; unsigned char wifi_acked_valid : 1 ; unsigned char wifi_acked : 1 ; unsigned char no_fcs : 1 ; unsigned char encapsulation : 1 ; unsigned char encap_hdr_csum : 1 ; unsigned char csum_valid : 1 ; unsigned char csum_complete_sw : 1 ; unsigned char csum_level : 2 ; unsigned char csum_bad : 1 ; unsigned char ndisc_nodetype : 2 ; unsigned char ipvs_property : 1 ; unsigned char inner_protocol_type : 1 ; unsigned char remcsum_offload : 1 ; __u16 tc_index ; __u16 tc_verd ; union __anonunion____missing_field_name_281 __annonCompField81 ; __u32 priority ; int skb_iif ; __u32 hash ; __be16 vlan_proto ; __u16 vlan_tci ; union __anonunion____missing_field_name_283 __annonCompField82 ; __u32 secmark ; union __anonunion____missing_field_name_284 __annonCompField83 ; union __anonunion____missing_field_name_285 __annonCompField84 ; __u16 inner_transport_header ; __u16 inner_network_header ; __u16 inner_mac_header ; __be16 protocol ; __u16 transport_header ; __u16 network_header ; __u16 mac_header ; __u32 headers_end[0U] ; sk_buff_data_t tail ; sk_buff_data_t end ; unsigned char *head ; unsigned char *data ; unsigned int truesize ; atomic_t users ; }; struct dst_entry; struct rtable; struct ethtool_cmd { __u32 cmd ; __u32 supported ; __u32 advertising ; __u16 speed ; __u8 duplex ; __u8 port ; __u8 phy_address ; __u8 transceiver ; __u8 autoneg ; __u8 mdio_support ; __u32 maxtxpkt ; __u32 maxrxpkt ; __u16 speed_hi ; __u8 eth_tp_mdix ; __u8 eth_tp_mdix_ctrl ; __u32 lp_advertising ; __u32 reserved[2U] ; }; struct ethtool_drvinfo { __u32 cmd ; char driver[32U] ; char version[32U] ; char fw_version[32U] ; char bus_info[32U] ; char erom_version[32U] ; char reserved2[12U] ; __u32 n_priv_flags ; __u32 n_stats ; __u32 testinfo_len ; __u32 eedump_len ; __u32 regdump_len ; }; struct ethtool_wolinfo { __u32 cmd ; __u32 supported ; __u32 wolopts ; __u8 sopass[6U] ; }; struct ethtool_tunable { __u32 cmd ; __u32 id ; __u32 type_id ; __u32 len ; void *data[0U] ; }; struct ethtool_regs { __u32 cmd ; __u32 version ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eeprom { __u32 cmd ; __u32 magic ; __u32 offset ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eee { __u32 cmd ; __u32 supported ; __u32 advertised ; __u32 lp_advertised ; __u32 eee_active ; __u32 eee_enabled ; __u32 tx_lpi_enabled ; __u32 tx_lpi_timer ; __u32 reserved[2U] ; }; struct ethtool_modinfo { __u32 cmd ; __u32 type ; __u32 eeprom_len ; __u32 reserved[8U] ; }; struct ethtool_coalesce { __u32 cmd ; __u32 rx_coalesce_usecs ; __u32 rx_max_coalesced_frames ; __u32 rx_coalesce_usecs_irq ; __u32 rx_max_coalesced_frames_irq ; __u32 tx_coalesce_usecs ; __u32 tx_max_coalesced_frames ; __u32 tx_coalesce_usecs_irq ; __u32 tx_max_coalesced_frames_irq ; __u32 stats_block_coalesce_usecs ; __u32 use_adaptive_rx_coalesce ; __u32 use_adaptive_tx_coalesce ; __u32 pkt_rate_low ; __u32 rx_coalesce_usecs_low ; __u32 rx_max_coalesced_frames_low ; __u32 tx_coalesce_usecs_low ; __u32 tx_max_coalesced_frames_low ; __u32 pkt_rate_high ; __u32 rx_coalesce_usecs_high ; __u32 rx_max_coalesced_frames_high ; __u32 tx_coalesce_usecs_high ; __u32 tx_max_coalesced_frames_high ; __u32 rate_sample_interval ; }; struct ethtool_ringparam { __u32 cmd ; __u32 rx_max_pending ; __u32 rx_mini_max_pending ; __u32 rx_jumbo_max_pending ; __u32 tx_max_pending ; __u32 rx_pending ; __u32 rx_mini_pending ; __u32 rx_jumbo_pending ; __u32 tx_pending ; }; struct ethtool_channels { __u32 cmd ; __u32 max_rx ; __u32 max_tx ; __u32 max_other ; __u32 max_combined ; __u32 rx_count ; __u32 tx_count ; __u32 other_count ; __u32 combined_count ; }; struct ethtool_pauseparam { __u32 cmd ; __u32 autoneg ; __u32 rx_pause ; __u32 tx_pause ; }; struct ethtool_test { __u32 cmd ; __u32 flags ; __u32 reserved ; __u32 len ; __u64 data[0U] ; }; struct ethtool_stats { __u32 cmd ; __u32 n_stats ; __u64 data[0U] ; }; struct ethtool_tcpip4_spec { __be32 ip4src ; __be32 ip4dst ; __be16 psrc ; __be16 pdst ; __u8 tos ; }; struct ethtool_ah_espip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 spi ; __u8 tos ; }; struct ethtool_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union ethtool_flow_union { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[52U] ; }; struct ethtool_flow_ext { __u8 padding[2U] ; unsigned char h_dest[6U] ; __be16 vlan_etype ; __be16 vlan_tci ; __be32 data[2U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union ethtool_flow_union h_u ; struct ethtool_flow_ext h_ext ; union ethtool_flow_union m_u ; struct ethtool_flow_ext m_ext ; __u64 ring_cookie ; __u32 location ; }; struct ethtool_rxnfc { __u32 cmd ; __u32 flow_type ; __u64 data ; struct ethtool_rx_flow_spec fs ; __u32 rule_cnt ; __u32 rule_locs[0U] ; }; struct ethtool_flash { __u32 cmd ; __u32 region ; char data[128U] ; }; struct ethtool_dump { __u32 cmd ; __u32 version ; __u32 flag ; __u32 len ; __u8 data[0U] ; }; struct ethtool_ts_info { __u32 cmd ; __u32 so_timestamping ; __s32 phc_index ; __u32 tx_types ; __u32 tx_reserved[3U] ; __u32 rx_filters ; __u32 rx_reserved[3U] ; }; enum ethtool_phys_id_state { ETHTOOL_ID_INACTIVE = 0, ETHTOOL_ID_ACTIVE = 1, ETHTOOL_ID_ON = 2, ETHTOOL_ID_OFF = 3 } ; struct ethtool_ops { int (*get_settings)(struct net_device * , struct ethtool_cmd * ) ; int (*set_settings)(struct net_device * , struct ethtool_cmd * ) ; void (*get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) ; int (*get_regs_len)(struct net_device * ) ; void (*get_regs)(struct net_device * , struct ethtool_regs * , void * ) ; void (*get_wol)(struct net_device * , struct ethtool_wolinfo * ) ; int (*set_wol)(struct net_device * , struct ethtool_wolinfo * ) ; u32 (*get_msglevel)(struct net_device * ) ; void (*set_msglevel)(struct net_device * , u32 ) ; int (*nway_reset)(struct net_device * ) ; u32 (*get_link)(struct net_device * ) ; int (*get_eeprom_len)(struct net_device * ) ; int (*get_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; int (*set_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*get_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*set_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; void (*get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; int (*set_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; void (*self_test)(struct net_device * , struct ethtool_test * , u64 * ) ; void (*get_strings)(struct net_device * , u32 , u8 * ) ; int (*set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) ; void (*get_ethtool_stats)(struct net_device * , struct ethtool_stats * , u64 * ) ; int (*begin)(struct net_device * ) ; void (*complete)(struct net_device * ) ; u32 (*get_priv_flags)(struct net_device * ) ; int (*set_priv_flags)(struct net_device * , u32 ) ; int (*get_sset_count)(struct net_device * , int ) ; int (*get_rxnfc)(struct net_device * , struct ethtool_rxnfc * , u32 * ) ; int (*set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*flash_device)(struct net_device * , struct ethtool_flash * ) ; int (*reset)(struct net_device * , u32 * ) ; u32 (*get_rxfh_key_size)(struct net_device * ) ; u32 (*get_rxfh_indir_size)(struct net_device * ) ; int (*get_rxfh)(struct net_device * , u32 * , u8 * , u8 * ) ; int (*set_rxfh)(struct net_device * , u32 const * , u8 const * , u8 const ) ; void (*get_channels)(struct net_device * , struct ethtool_channels * ) ; int (*set_channels)(struct net_device * , struct ethtool_channels * ) ; int (*get_dump_flag)(struct net_device * , struct ethtool_dump * ) ; int (*get_dump_data)(struct net_device * , struct ethtool_dump * , void * ) ; int (*set_dump)(struct net_device * , struct ethtool_dump * ) ; int (*get_ts_info)(struct net_device * , struct ethtool_ts_info * ) ; int (*get_module_info)(struct net_device * , struct ethtool_modinfo * ) ; int (*get_module_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_eee)(struct net_device * , struct ethtool_eee * ) ; int (*set_eee)(struct net_device * , struct ethtool_eee * ) ; int (*get_tunable)(struct net_device * , struct ethtool_tunable const * , void * ) ; int (*set_tunable)(struct net_device * , struct ethtool_tunable const * , void const * ) ; }; struct flowi_common { int flowic_oif ; int flowic_iif ; __u32 flowic_mark ; __u8 flowic_tos ; __u8 flowic_scope ; __u8 flowic_proto ; __u8 flowic_flags ; __u32 flowic_secid ; }; struct __anonstruct_ports_288 { __be16 dport ; __be16 sport ; }; struct __anonstruct_icmpt_289 { __u8 type ; __u8 code ; }; struct __anonstruct_dnports_290 { __le16 dport ; __le16 sport ; }; struct __anonstruct_mht_291 { __u8 type ; }; union flowi_uli { struct __anonstruct_ports_288 ports ; struct __anonstruct_icmpt_289 icmpt ; struct __anonstruct_dnports_290 dnports ; __be32 spi ; __be32 gre_key ; struct __anonstruct_mht_291 mht ; }; struct flowi4 { struct flowi_common __fl_common ; __be32 saddr ; __be32 daddr ; union flowi_uli uli ; }; struct flowi6 { struct flowi_common __fl_common ; struct in6_addr daddr ; struct in6_addr saddr ; __be32 flowlabel ; union flowi_uli uli ; }; struct flowidn { struct flowi_common __fl_common ; __le16 daddr ; __le16 saddr ; union flowi_uli uli ; }; union __anonunion_u_292 { struct flowi_common __fl_common ; struct flowi4 ip4 ; struct flowi6 ip6 ; struct flowidn dn ; }; struct flowi { union __anonunion_u_292 u ; }; struct prot_inuse; struct netns_core { struct ctl_table_header *sysctl_hdr ; int sysctl_somaxconn ; struct prot_inuse *inuse ; }; struct u64_stats_sync { }; struct ipstats_mib { u64 mibs[36U] ; struct u64_stats_sync syncp ; }; struct icmp_mib { unsigned long mibs[28U] ; }; struct icmpmsg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[6U] ; }; struct icmpv6_mib_device { atomic_long_t mibs[6U] ; }; struct icmpv6msg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6msg_mib_device { atomic_long_t mibs[512U] ; }; struct tcp_mib { unsigned long mibs[16U] ; }; struct udp_mib { unsigned long mibs[9U] ; }; struct linux_mib { unsigned long mibs[115U] ; }; struct linux_xfrm_mib { unsigned long mibs[29U] ; }; struct proc_dir_entry; struct netns_mib { struct tcp_mib *tcp_statistics ; struct ipstats_mib *ip_statistics ; struct linux_mib *net_statistics ; struct udp_mib *udp_statistics ; struct udp_mib *udplite_statistics ; struct icmp_mib *icmp_statistics ; struct icmpmsg_mib *icmpmsg_statistics ; struct proc_dir_entry *proc_net_devsnmp6 ; struct udp_mib *udp_stats_in6 ; struct udp_mib *udplite_stats_in6 ; struct ipstats_mib *ipv6_statistics ; struct icmpv6_mib *icmpv6_statistics ; struct icmpv6msg_mib *icmpv6msg_statistics ; struct linux_xfrm_mib *xfrm_statistics ; }; struct netns_unix { int sysctl_max_dgram_qlen ; struct ctl_table_header *ctl ; }; struct netns_packet { struct mutex sklist_lock ; struct hlist_head sklist ; }; struct netns_frags { struct percpu_counter mem ; int timeout ; int high_thresh ; int low_thresh ; }; struct ipv4_devconf; struct fib_rules_ops; struct fib_table; struct local_ports { seqlock_t lock ; int range[2U] ; bool warned ; }; struct ping_group_range { seqlock_t lock ; kgid_t range[2U] ; }; struct inet_peer_base; struct xt_table; struct netns_ipv4 { struct ctl_table_header *forw_hdr ; struct ctl_table_header *frags_hdr ; struct ctl_table_header *ipv4_hdr ; struct ctl_table_header *route_hdr ; struct ctl_table_header *xfrm4_hdr ; struct ipv4_devconf *devconf_all ; struct ipv4_devconf *devconf_dflt ; struct fib_rules_ops *rules_ops ; bool fib_has_custom_rules ; struct fib_table *fib_local ; struct fib_table *fib_main ; struct fib_table *fib_default ; int fib_num_tclassid_users ; struct hlist_head *fib_table_hash ; bool fib_offload_disabled ; struct sock *fibnl ; struct sock **icmp_sk ; struct sock *mc_autojoin_sk ; struct inet_peer_base *peers ; struct sock **tcp_sk ; struct netns_frags frags ; struct xt_table *iptable_filter ; struct xt_table *iptable_mangle ; struct xt_table *iptable_raw ; struct xt_table *arptable_filter ; struct xt_table *iptable_security ; struct xt_table *nat_table ; int sysctl_icmp_echo_ignore_all ; int sysctl_icmp_echo_ignore_broadcasts ; int sysctl_icmp_ignore_bogus_error_responses ; int sysctl_icmp_ratelimit ; int sysctl_icmp_ratemask ; int sysctl_icmp_errors_use_inbound_ifaddr ; struct local_ports ip_local_ports ; int sysctl_tcp_ecn ; int sysctl_tcp_ecn_fallback ; int sysctl_ip_no_pmtu_disc ; int sysctl_ip_fwd_use_pmtu ; int sysctl_ip_nonlocal_bind ; int sysctl_fwmark_reflect ; int sysctl_tcp_fwmark_accept ; int sysctl_tcp_mtu_probing ; int sysctl_tcp_base_mss ; int sysctl_tcp_probe_threshold ; u32 sysctl_tcp_probe_interval ; struct ping_group_range ping_group_range ; atomic_t dev_addr_genid ; unsigned long *sysctl_local_reserved_ports ; struct list_head mr_tables ; struct fib_rules_ops *mr_rules_ops ; atomic_t rt_genid ; }; struct neighbour; struct dst_ops { unsigned short family ; unsigned int gc_thresh ; int (*gc)(struct dst_ops * ) ; struct dst_entry *(*check)(struct dst_entry * , __u32 ) ; unsigned int (*default_advmss)(struct dst_entry const * ) ; unsigned int (*mtu)(struct dst_entry const * ) ; u32 *(*cow_metrics)(struct dst_entry * , unsigned long ) ; void (*destroy)(struct dst_entry * ) ; void (*ifdown)(struct dst_entry * , struct net_device * , int ) ; struct dst_entry *(*negative_advice)(struct dst_entry * ) ; void (*link_failure)(struct sk_buff * ) ; void (*update_pmtu)(struct dst_entry * , struct sock * , struct sk_buff * , u32 ) ; void (*redirect)(struct dst_entry * , struct sock * , struct sk_buff * ) ; int (*local_out)(struct sk_buff * ) ; struct neighbour *(*neigh_lookup)(struct dst_entry const * , struct sk_buff * , void const * ) ; struct kmem_cache *kmem_cachep ; struct percpu_counter pcpuc_entries ; }; struct netns_sysctl_ipv6 { struct ctl_table_header *hdr ; struct ctl_table_header *route_hdr ; struct ctl_table_header *icmp_hdr ; struct ctl_table_header *frags_hdr ; struct ctl_table_header *xfrm6_hdr ; int bindv6only ; int flush_delay ; int ip6_rt_max_size ; int ip6_rt_gc_min_interval ; int ip6_rt_gc_timeout ; int ip6_rt_gc_interval ; int ip6_rt_gc_elasticity ; int ip6_rt_mtu_expires ; int ip6_rt_min_advmss ; int flowlabel_consistency ; int auto_flowlabels ; int icmpv6_time ; int anycast_src_echo_reply ; int fwmark_reflect ; int idgen_retries ; int idgen_delay ; int flowlabel_state_ranges ; }; struct ipv6_devconf; struct rt6_info; struct rt6_statistics; struct fib6_table; struct netns_ipv6 { struct netns_sysctl_ipv6 sysctl ; struct ipv6_devconf *devconf_all ; struct ipv6_devconf *devconf_dflt ; struct inet_peer_base *peers ; struct netns_frags frags ; struct xt_table *ip6table_filter ; struct xt_table *ip6table_mangle ; struct xt_table *ip6table_raw ; struct xt_table *ip6table_security ; struct xt_table *ip6table_nat ; struct rt6_info *ip6_null_entry ; struct rt6_statistics *rt6_stats ; struct timer_list ip6_fib_timer ; struct hlist_head *fib_table_hash ; struct fib6_table *fib6_main_tbl ; struct dst_ops ip6_dst_ops ; unsigned int ip6_rt_gc_expire ; unsigned long ip6_rt_last_gc ; struct rt6_info *ip6_prohibit_entry ; struct rt6_info *ip6_blk_hole_entry ; struct fib6_table *fib6_local_tbl ; struct fib_rules_ops *fib6_rules_ops ; struct sock **icmp_sk ; struct sock *ndisc_sk ; struct sock *tcp_sk ; struct sock *igmp_sk ; struct sock *mc_autojoin_sk ; struct list_head mr6_tables ; struct fib_rules_ops *mr6_rules_ops ; atomic_t dev_addr_genid ; atomic_t fib6_sernum ; }; struct netns_nf_frag { struct netns_sysctl_ipv6 sysctl ; struct netns_frags frags ; }; struct netns_sysctl_lowpan { struct ctl_table_header *frags_hdr ; }; struct netns_ieee802154_lowpan { struct netns_sysctl_lowpan sysctl ; struct netns_frags frags ; }; struct sctp_mib; struct netns_sctp { struct sctp_mib *sctp_statistics ; struct proc_dir_entry *proc_net_sctp ; struct ctl_table_header *sysctl_header ; struct sock *ctl_sock ; struct list_head local_addr_list ; struct list_head addr_waitq ; struct timer_list addr_wq_timer ; struct list_head auto_asconf_splist ; spinlock_t addr_wq_lock ; spinlock_t local_addr_lock ; unsigned int rto_initial ; unsigned int rto_min ; unsigned int rto_max ; int rto_alpha ; int rto_beta ; int max_burst ; int cookie_preserve_enable ; char *sctp_hmac_alg ; unsigned int valid_cookie_life ; unsigned int sack_timeout ; unsigned int hb_interval ; int max_retrans_association ; int max_retrans_path ; int max_retrans_init ; int pf_retrans ; int sndbuf_policy ; int rcvbuf_policy ; int default_auto_asconf ; int addip_enable ; int addip_noauth ; int prsctp_enable ; int auth_enable ; int scope_policy ; int rwnd_upd_shift ; unsigned long max_autoclose ; }; struct netns_dccp { struct sock *v4_ctl_sk ; struct sock *v6_ctl_sk ; }; struct nf_logger; struct netns_nf { struct proc_dir_entry *proc_netfilter ; struct nf_logger const *nf_loggers[13U] ; struct ctl_table_header *nf_log_dir_header ; }; struct ebt_table; struct netns_xt { struct list_head tables[13U] ; bool notrack_deprecated_warning ; bool clusterip_deprecated_warning ; struct ebt_table *broute_table ; struct ebt_table *frame_filter ; struct ebt_table *frame_nat ; }; struct hlist_nulls_node; struct hlist_nulls_head { struct hlist_nulls_node *first ; }; struct hlist_nulls_node { struct hlist_nulls_node *next ; struct hlist_nulls_node **pprev ; }; struct nf_proto_net { struct ctl_table_header *ctl_table_header ; struct ctl_table *ctl_table ; struct ctl_table_header *ctl_compat_header ; struct ctl_table *ctl_compat_table ; unsigned int users ; }; struct nf_generic_net { struct nf_proto_net pn ; unsigned int timeout ; }; struct nf_tcp_net { struct nf_proto_net pn ; unsigned int timeouts[14U] ; unsigned int tcp_loose ; unsigned int tcp_be_liberal ; unsigned int tcp_max_retrans ; }; struct nf_udp_net { struct nf_proto_net pn ; unsigned int timeouts[2U] ; }; struct nf_icmp_net { struct nf_proto_net pn ; unsigned int timeout ; }; struct nf_ip_net { struct nf_generic_net generic ; struct nf_tcp_net tcp ; struct nf_udp_net udp ; struct nf_icmp_net icmp ; struct nf_icmp_net icmpv6 ; struct ctl_table_header *ctl_table_header ; struct ctl_table *ctl_table ; }; struct ct_pcpu { spinlock_t lock ; struct hlist_nulls_head unconfirmed ; struct hlist_nulls_head dying ; struct hlist_nulls_head tmpl ; }; struct ip_conntrack_stat; struct nf_ct_event_notifier; struct nf_exp_event_notifier; struct netns_ct { atomic_t count ; unsigned int expect_count ; struct delayed_work ecache_dwork ; bool ecache_dwork_pending ; struct ctl_table_header *sysctl_header ; struct ctl_table_header *acct_sysctl_header ; struct ctl_table_header *tstamp_sysctl_header ; struct ctl_table_header *event_sysctl_header ; struct ctl_table_header *helper_sysctl_header ; char *slabname ; unsigned int sysctl_log_invalid ; int sysctl_events ; int sysctl_acct ; int sysctl_auto_assign_helper ; bool auto_assign_helper_warned ; int sysctl_tstamp ; int sysctl_checksum ; unsigned int htable_size ; seqcount_t generation ; struct kmem_cache *nf_conntrack_cachep ; struct hlist_nulls_head *hash ; struct hlist_head *expect_hash ; struct ct_pcpu *pcpu_lists ; struct ip_conntrack_stat *stat ; struct nf_ct_event_notifier *nf_conntrack_event_cb ; struct nf_exp_event_notifier *nf_expect_event_cb ; struct nf_ip_net nf_ct_proto ; unsigned int labels_used ; u8 label_words ; struct hlist_head *nat_bysource ; unsigned int nat_htable_size ; }; struct nft_af_info; struct netns_nftables { struct list_head af_info ; struct list_head commit_list ; struct nft_af_info *ipv4 ; struct nft_af_info *ipv6 ; struct nft_af_info *inet ; struct nft_af_info *arp ; struct nft_af_info *bridge ; struct nft_af_info *netdev ; unsigned int base_seq ; u8 gencursor ; }; struct tasklet_struct { struct tasklet_struct *next ; unsigned long state ; atomic_t count ; void (*func)(unsigned long ) ; unsigned long data ; }; struct flow_cache_percpu { struct hlist_head *hash_table ; int hash_count ; u32 hash_rnd ; int hash_rnd_recalc ; struct tasklet_struct flush_tasklet ; }; struct flow_cache { u32 hash_shift ; struct flow_cache_percpu *percpu ; struct notifier_block hotcpu_notifier ; int low_watermark ; int high_watermark ; struct timer_list rnd_timer ; }; struct xfrm_policy_hash { struct hlist_head *table ; unsigned int hmask ; u8 dbits4 ; u8 sbits4 ; u8 dbits6 ; u8 sbits6 ; }; struct xfrm_policy_hthresh { struct work_struct work ; seqlock_t lock ; u8 lbits4 ; u8 rbits4 ; u8 lbits6 ; u8 rbits6 ; }; struct netns_xfrm { struct list_head state_all ; struct hlist_head *state_bydst ; struct hlist_head *state_bysrc ; struct hlist_head *state_byspi ; unsigned int state_hmask ; unsigned int state_num ; struct work_struct state_hash_work ; struct hlist_head state_gc_list ; struct work_struct state_gc_work ; struct list_head policy_all ; struct hlist_head *policy_byidx ; unsigned int policy_idx_hmask ; struct hlist_head policy_inexact[3U] ; struct xfrm_policy_hash policy_bydst[3U] ; unsigned int policy_count[6U] ; struct work_struct policy_hash_work ; struct xfrm_policy_hthresh policy_hthresh ; struct sock *nlsk ; struct sock *nlsk_stash ; u32 sysctl_aevent_etime ; u32 sysctl_aevent_rseqth ; int sysctl_larval_drop ; u32 sysctl_acq_expires ; struct ctl_table_header *sysctl_hdr ; struct dst_ops xfrm4_dst_ops ; struct dst_ops xfrm6_dst_ops ; spinlock_t xfrm_state_lock ; rwlock_t xfrm_policy_lock ; struct mutex xfrm_cfg_mutex ; struct flow_cache flow_cache_global ; atomic_t flow_cache_genid ; struct list_head flow_cache_gc_list ; spinlock_t flow_cache_gc_lock ; struct work_struct flow_cache_gc_work ; struct work_struct flow_cache_flush_work ; struct mutex flow_flush_sem ; }; struct mpls_route; struct netns_mpls { size_t platform_labels ; struct mpls_route **platform_label ; struct ctl_table_header *ctl ; }; struct proc_ns_operations; struct ns_common { atomic_long_t stashed ; struct proc_ns_operations const *ops ; unsigned int inum ; }; struct net_generic; struct netns_ipvs; struct net { atomic_t passive ; atomic_t count ; spinlock_t rules_mod_lock ; atomic64_t cookie_gen ; struct list_head list ; struct list_head cleanup_list ; struct list_head exit_list ; struct user_namespace *user_ns ; spinlock_t nsid_lock ; struct idr netns_ids ; struct ns_common ns ; struct proc_dir_entry *proc_net ; struct proc_dir_entry *proc_net_stat ; struct ctl_table_set sysctls ; struct sock *rtnl ; struct sock *genl_sock ; struct list_head dev_base_head ; struct hlist_head *dev_name_head ; struct hlist_head *dev_index_head ; unsigned int dev_base_seq ; int ifindex ; unsigned int dev_unreg_count ; struct list_head rules_ops ; struct net_device *loopback_dev ; struct netns_core core ; struct netns_mib mib ; struct netns_packet packet ; struct netns_unix unx ; struct netns_ipv4 ipv4 ; struct netns_ipv6 ipv6 ; struct netns_ieee802154_lowpan ieee802154_lowpan ; struct netns_sctp sctp ; struct netns_dccp dccp ; struct netns_nf nf ; struct netns_xt xt ; struct netns_ct ct ; struct netns_nftables nft ; struct netns_nf_frag nf_frag ; struct sock *nfnl ; struct sock *nfnl_stash ; struct sk_buff_head wext_nlevents ; struct net_generic *gen ; struct netns_xfrm xfrm ; struct netns_ipvs *ipvs ; struct netns_mpls mpls ; struct sock *diag_nlsk ; atomic_t fnhe_genid ; }; struct __anonstruct_possible_net_t_302 { struct net *net ; }; typedef struct __anonstruct_possible_net_t_302 possible_net_t; typedef unsigned long kernel_ulong_t; struct pci_device_id { __u32 vendor ; __u32 device ; __u32 subvendor ; __u32 subdevice ; __u32 class ; __u32 class_mask ; kernel_ulong_t driver_data ; }; struct acpi_device_id { __u8 id[9U] ; kernel_ulong_t driver_data ; }; struct of_device_id { char name[32U] ; char type[32U] ; char compatible[128U] ; void const *data ; }; enum fwnode_type { FWNODE_INVALID = 0, FWNODE_OF = 1, FWNODE_ACPI = 2, FWNODE_PDATA = 3 } ; struct fwnode_handle { enum fwnode_type type ; struct fwnode_handle *secondary ; }; typedef u32 phandle; struct property { char *name ; int length ; void *value ; struct property *next ; unsigned long _flags ; unsigned int unique_id ; struct bin_attribute attr ; }; struct device_node { char const *name ; char const *type ; phandle phandle ; char const *full_name ; struct fwnode_handle fwnode ; struct property *properties ; struct property *deadprops ; struct device_node *parent ; struct device_node *child ; struct device_node *sibling ; struct kobject kobj ; unsigned long _flags ; void *data ; }; enum ldv_27935 { PHY_INTERFACE_MODE_NA = 0, PHY_INTERFACE_MODE_MII = 1, PHY_INTERFACE_MODE_GMII = 2, PHY_INTERFACE_MODE_SGMII = 3, PHY_INTERFACE_MODE_TBI = 4, PHY_INTERFACE_MODE_REVMII = 5, PHY_INTERFACE_MODE_RMII = 6, PHY_INTERFACE_MODE_RGMII = 7, PHY_INTERFACE_MODE_RGMII_ID = 8, PHY_INTERFACE_MODE_RGMII_RXID = 9, PHY_INTERFACE_MODE_RGMII_TXID = 10, PHY_INTERFACE_MODE_RTBI = 11, PHY_INTERFACE_MODE_SMII = 12, PHY_INTERFACE_MODE_XGMII = 13, PHY_INTERFACE_MODE_MOCA = 14, PHY_INTERFACE_MODE_QSGMII = 15, PHY_INTERFACE_MODE_MAX = 16 } ; typedef enum ldv_27935 phy_interface_t; enum ldv_27989 { MDIOBUS_ALLOCATED = 1, MDIOBUS_REGISTERED = 2, MDIOBUS_UNREGISTERED = 3, MDIOBUS_RELEASED = 4 } ; struct phy_device; struct mii_bus { char const *name ; char id[17U] ; void *priv ; int (*read)(struct mii_bus * , int , int ) ; int (*write)(struct mii_bus * , int , int , u16 ) ; int (*reset)(struct mii_bus * ) ; struct mutex mdio_lock ; struct device *parent ; enum ldv_27989 state ; struct device dev ; struct phy_device *phy_map[32U] ; u32 phy_mask ; u32 phy_ignore_ta_mask ; int *irq ; }; enum phy_state { PHY_DOWN = 0, PHY_STARTING = 1, PHY_READY = 2, PHY_PENDING = 3, PHY_UP = 4, PHY_AN = 5, PHY_RUNNING = 6, PHY_NOLINK = 7, PHY_FORCING = 8, PHY_CHANGELINK = 9, PHY_HALTED = 10, PHY_RESUMING = 11 } ; struct phy_c45_device_ids { u32 devices_in_package ; u32 device_ids[8U] ; }; struct phy_driver; struct phy_device { struct phy_driver *drv ; struct mii_bus *bus ; struct device dev ; u32 phy_id ; struct phy_c45_device_ids c45_ids ; bool is_c45 ; bool is_internal ; bool has_fixups ; bool suspended ; enum phy_state state ; u32 dev_flags ; phy_interface_t interface ; int addr ; int speed ; int duplex ; int pause ; int asym_pause ; int link ; u32 interrupts ; u32 supported ; u32 advertising ; u32 lp_advertising ; int autoneg ; int link_timeout ; int irq ; void *priv ; struct work_struct phy_queue ; struct delayed_work state_queue ; atomic_t irq_disable ; struct mutex lock ; struct net_device *attached_dev ; void (*adjust_link)(struct net_device * ) ; }; struct phy_driver { u32 phy_id ; char *name ; unsigned int phy_id_mask ; u32 features ; u32 flags ; void const *driver_data ; int (*soft_reset)(struct phy_device * ) ; int (*config_init)(struct phy_device * ) ; int (*probe)(struct phy_device * ) ; int (*suspend)(struct phy_device * ) ; int (*resume)(struct phy_device * ) ; int (*config_aneg)(struct phy_device * ) ; int (*aneg_done)(struct phy_device * ) ; int (*read_status)(struct phy_device * ) ; int (*ack_interrupt)(struct phy_device * ) ; int (*config_intr)(struct phy_device * ) ; int (*did_interrupt)(struct phy_device * ) ; void (*remove)(struct phy_device * ) ; int (*match_phy_device)(struct phy_device * ) ; int (*ts_info)(struct phy_device * , struct ethtool_ts_info * ) ; int (*hwtstamp)(struct phy_device * , struct ifreq * ) ; bool (*rxtstamp)(struct phy_device * , struct sk_buff * , int ) ; void (*txtstamp)(struct phy_device * , struct sk_buff * , int ) ; int (*set_wol)(struct phy_device * , struct ethtool_wolinfo * ) ; void (*get_wol)(struct phy_device * , struct ethtool_wolinfo * ) ; void (*link_change_notify)(struct phy_device * ) ; int (*read_mmd_indirect)(struct phy_device * , int , int , int ) ; void (*write_mmd_indirect)(struct phy_device * , int , int , int , u32 ) ; int (*module_info)(struct phy_device * , struct ethtool_modinfo * ) ; int (*module_eeprom)(struct phy_device * , struct ethtool_eeprom * , u8 * ) ; struct device_driver driver ; }; struct fixed_phy_status { int link ; int speed ; int duplex ; int pause ; int asym_pause ; }; enum dsa_tag_protocol { DSA_TAG_PROTO_NONE = 0, DSA_TAG_PROTO_DSA = 1, DSA_TAG_PROTO_TRAILER = 2, DSA_TAG_PROTO_EDSA = 3, DSA_TAG_PROTO_BRCM = 4 } ; struct dsa_chip_data { struct device *host_dev ; int sw_addr ; int eeprom_len ; struct device_node *of_node ; char *port_names[12U] ; struct device_node *port_dn[12U] ; s8 *rtable ; }; struct dsa_platform_data { struct device *netdev ; struct net_device *of_netdev ; int nr_chips ; struct dsa_chip_data *chip ; }; struct packet_type; struct dsa_switch; struct dsa_switch_tree { struct dsa_platform_data *pd ; struct net_device *master_netdev ; int (*rcv)(struct sk_buff * , struct net_device * , struct packet_type * , struct net_device * ) ; enum dsa_tag_protocol tag_protocol ; s8 cpu_switch ; s8 cpu_port ; int link_poll_needed ; struct work_struct link_poll_work ; struct timer_list link_poll_timer ; struct dsa_switch *ds[4U] ; }; struct dsa_switch_driver; struct dsa_switch { struct dsa_switch_tree *dst ; int index ; enum dsa_tag_protocol tag_protocol ; struct dsa_chip_data *pd ; struct dsa_switch_driver *drv ; struct device *master_dev ; char hwmon_name[24U] ; struct device *hwmon_dev ; u32 dsa_port_mask ; u32 phys_port_mask ; u32 phys_mii_mask ; struct mii_bus *slave_mii_bus ; struct net_device *ports[12U] ; }; struct dsa_switch_driver { struct list_head list ; enum dsa_tag_protocol tag_protocol ; int priv_size ; char *(*probe)(struct device * , int ) ; int (*setup)(struct dsa_switch * ) ; int (*set_addr)(struct dsa_switch * , u8 * ) ; u32 (*get_phy_flags)(struct dsa_switch * , int ) ; int (*phy_read)(struct dsa_switch * , int , int ) ; int (*phy_write)(struct dsa_switch * , int , int , u16 ) ; void (*poll_link)(struct dsa_switch * ) ; void (*adjust_link)(struct dsa_switch * , int , struct phy_device * ) ; void (*fixed_link_update)(struct dsa_switch * , int , struct fixed_phy_status * ) ; void (*get_strings)(struct dsa_switch * , int , uint8_t * ) ; void (*get_ethtool_stats)(struct dsa_switch * , int , uint64_t * ) ; int (*get_sset_count)(struct dsa_switch * ) ; void (*get_wol)(struct dsa_switch * , int , struct ethtool_wolinfo * ) ; int (*set_wol)(struct dsa_switch * , int , struct ethtool_wolinfo * ) ; int (*suspend)(struct dsa_switch * ) ; int (*resume)(struct dsa_switch * ) ; int (*port_enable)(struct dsa_switch * , int , struct phy_device * ) ; void (*port_disable)(struct dsa_switch * , int , struct phy_device * ) ; int (*set_eee)(struct dsa_switch * , int , struct phy_device * , struct ethtool_eee * ) ; int (*get_eee)(struct dsa_switch * , int , struct ethtool_eee * ) ; int (*get_temp)(struct dsa_switch * , int * ) ; int (*get_temp_limit)(struct dsa_switch * , int * ) ; int (*set_temp_limit)(struct dsa_switch * , int ) ; int (*get_temp_alarm)(struct dsa_switch * , bool * ) ; int (*get_eeprom_len)(struct dsa_switch * ) ; int (*get_eeprom)(struct dsa_switch * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct dsa_switch * , struct ethtool_eeprom * , u8 * ) ; int (*get_regs_len)(struct dsa_switch * , int ) ; void (*get_regs)(struct dsa_switch * , int , struct ethtool_regs * , void * ) ; int (*port_join_bridge)(struct dsa_switch * , int , u32 ) ; int (*port_leave_bridge)(struct dsa_switch * , int , u32 ) ; int (*port_stp_update)(struct dsa_switch * , int , u8 ) ; int (*fdb_add)(struct dsa_switch * , int , unsigned char const * , u16 ) ; int (*fdb_del)(struct dsa_switch * , int , unsigned char const * , u16 ) ; int (*fdb_getnext)(struct dsa_switch * , int , unsigned char * , bool * ) ; }; struct ieee_ets { __u8 willing ; __u8 ets_cap ; __u8 cbs ; __u8 tc_tx_bw[8U] ; __u8 tc_rx_bw[8U] ; __u8 tc_tsa[8U] ; __u8 prio_tc[8U] ; __u8 tc_reco_bw[8U] ; __u8 tc_reco_tsa[8U] ; __u8 reco_prio_tc[8U] ; }; struct ieee_maxrate { __u64 tc_maxrate[8U] ; }; struct ieee_qcn { __u8 rpg_enable[8U] ; __u32 rppp_max_rps[8U] ; __u32 rpg_time_reset[8U] ; __u32 rpg_byte_reset[8U] ; __u32 rpg_threshold[8U] ; __u32 rpg_max_rate[8U] ; __u32 rpg_ai_rate[8U] ; __u32 rpg_hai_rate[8U] ; __u32 rpg_gd[8U] ; __u32 rpg_min_dec_fac[8U] ; __u32 rpg_min_rate[8U] ; __u32 cndd_state_machine[8U] ; }; struct ieee_qcn_stats { __u64 rppp_rp_centiseconds[8U] ; __u32 rppp_created_rps[8U] ; }; struct ieee_pfc { __u8 pfc_cap ; __u8 pfc_en ; __u8 mbc ; __u16 delay ; __u64 requests[8U] ; __u64 indications[8U] ; }; struct cee_pg { __u8 willing ; __u8 error ; __u8 pg_en ; __u8 tcs_supported ; __u8 pg_bw[8U] ; __u8 prio_pg[8U] ; }; struct cee_pfc { __u8 willing ; __u8 error ; __u8 pfc_en ; __u8 tcs_supported ; }; struct dcb_app { __u8 selector ; __u8 priority ; __u16 protocol ; }; struct dcb_peer_app_info { __u8 willing ; __u8 error ; }; struct dcbnl_rtnl_ops { int (*ieee_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_setets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_getmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_setmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_getqcn)(struct net_device * , struct ieee_qcn * ) ; int (*ieee_setqcn)(struct net_device * , struct ieee_qcn * ) ; int (*ieee_getqcnstats)(struct net_device * , struct ieee_qcn_stats * ) ; int (*ieee_getpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_setpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_getapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_setapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_delapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_peer_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_peer_getpfc)(struct net_device * , struct ieee_pfc * ) ; u8 (*getstate)(struct net_device * ) ; u8 (*setstate)(struct net_device * , u8 ) ; void (*getpermhwaddr)(struct net_device * , u8 * ) ; void (*setpgtccfgtx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgtx)(struct net_device * , int , u8 ) ; void (*setpgtccfgrx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgrx)(struct net_device * , int , u8 ) ; void (*getpgtccfgtx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgtx)(struct net_device * , int , u8 * ) ; void (*getpgtccfgrx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgrx)(struct net_device * , int , u8 * ) ; void (*setpfccfg)(struct net_device * , int , u8 ) ; void (*getpfccfg)(struct net_device * , int , u8 * ) ; u8 (*setall)(struct net_device * ) ; u8 (*getcap)(struct net_device * , int , u8 * ) ; int (*getnumtcs)(struct net_device * , int , u8 * ) ; int (*setnumtcs)(struct net_device * , int , u8 ) ; u8 (*getpfcstate)(struct net_device * ) ; void (*setpfcstate)(struct net_device * , u8 ) ; void (*getbcncfg)(struct net_device * , int , u32 * ) ; void (*setbcncfg)(struct net_device * , int , u32 ) ; void (*getbcnrp)(struct net_device * , int , u8 * ) ; void (*setbcnrp)(struct net_device * , int , u8 ) ; int (*setapp)(struct net_device * , u8 , u16 , u8 ) ; int (*getapp)(struct net_device * , u8 , u16 ) ; u8 (*getfeatcfg)(struct net_device * , int , u8 * ) ; u8 (*setfeatcfg)(struct net_device * , int , u8 ) ; u8 (*getdcbx)(struct net_device * ) ; u8 (*setdcbx)(struct net_device * , u8 ) ; int (*peer_getappinfo)(struct net_device * , struct dcb_peer_app_info * , u16 * ) ; int (*peer_getapptable)(struct net_device * , struct dcb_app * ) ; int (*cee_peer_getpg)(struct net_device * , struct cee_pg * ) ; int (*cee_peer_getpfc)(struct net_device * , struct cee_pfc * ) ; }; struct taskstats { __u16 version ; __u32 ac_exitcode ; __u8 ac_flag ; __u8 ac_nice ; __u64 cpu_count ; __u64 cpu_delay_total ; __u64 blkio_count ; __u64 blkio_delay_total ; __u64 swapin_count ; __u64 swapin_delay_total ; __u64 cpu_run_real_total ; __u64 cpu_run_virtual_total ; char ac_comm[32U] ; __u8 ac_sched ; __u8 ac_pad[3U] ; __u32 ac_uid ; __u32 ac_gid ; __u32 ac_pid ; __u32 ac_ppid ; __u32 ac_btime ; __u64 ac_etime ; __u64 ac_utime ; __u64 ac_stime ; __u64 ac_minflt ; __u64 ac_majflt ; __u64 coremem ; __u64 virtmem ; __u64 hiwater_rss ; __u64 hiwater_vm ; __u64 read_char ; __u64 write_char ; __u64 read_syscalls ; __u64 write_syscalls ; __u64 read_bytes ; __u64 write_bytes ; __u64 cancelled_write_bytes ; __u64 nvcsw ; __u64 nivcsw ; __u64 ac_utimescaled ; __u64 ac_stimescaled ; __u64 cpu_scaled_run_real_total ; __u64 freepages_count ; __u64 freepages_delay_total ; }; struct netprio_map { struct callback_head rcu ; u32 priomap_len ; u32 priomap[] ; }; struct xfrm_policy; struct xfrm_state; struct 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_for_children ; struct net *net_ns ; }; struct nlmsghdr { __u32 nlmsg_len ; __u16 nlmsg_type ; __u16 nlmsg_flags ; __u32 nlmsg_seq ; __u32 nlmsg_pid ; }; struct nlattr { __u16 nla_len ; __u16 nla_type ; }; struct netlink_callback { struct sk_buff *skb ; struct nlmsghdr const *nlh ; int (*dump)(struct sk_buff * , struct netlink_callback * ) ; int (*done)(struct netlink_callback * ) ; void *data ; struct module *module ; u16 family ; u16 min_dump_alloc ; unsigned int prev_seq ; unsigned int seq ; long args[6U] ; }; struct ndmsg { __u8 ndm_family ; __u8 ndm_pad1 ; __u16 ndm_pad2 ; __s32 ndm_ifindex ; __u16 ndm_state ; __u8 ndm_flags ; __u8 ndm_type ; }; struct rtnl_link_stats64 { __u64 rx_packets ; __u64 tx_packets ; __u64 rx_bytes ; __u64 tx_bytes ; __u64 rx_errors ; __u64 tx_errors ; __u64 rx_dropped ; __u64 tx_dropped ; __u64 multicast ; __u64 collisions ; __u64 rx_length_errors ; __u64 rx_over_errors ; __u64 rx_crc_errors ; __u64 rx_frame_errors ; __u64 rx_fifo_errors ; __u64 rx_missed_errors ; __u64 tx_aborted_errors ; __u64 tx_carrier_errors ; __u64 tx_fifo_errors ; __u64 tx_heartbeat_errors ; __u64 tx_window_errors ; __u64 rx_compressed ; __u64 tx_compressed ; }; struct ifla_vf_stats { __u64 rx_packets ; __u64 tx_packets ; __u64 rx_bytes ; __u64 tx_bytes ; __u64 broadcast ; __u64 multicast ; }; struct ifla_vf_info { __u32 vf ; __u8 mac[32U] ; __u32 vlan ; __u32 qos ; __u32 spoofchk ; __u32 linkstate ; __u32 min_tx_rate ; __u32 max_tx_rate ; __u32 rss_query_en ; }; struct netpoll_info; struct wireless_dev; struct wpan_dev; struct mpls_dev; enum netdev_tx { __NETDEV_TX_MIN = (-0x7FFFFFFF-1), NETDEV_TX_OK = 0, NETDEV_TX_BUSY = 16, NETDEV_TX_LOCKED = 32 } ; typedef enum netdev_tx netdev_tx_t; struct net_device_stats { unsigned long rx_packets ; unsigned long tx_packets ; unsigned long rx_bytes ; unsigned long tx_bytes ; unsigned long rx_errors ; unsigned long tx_errors ; unsigned long rx_dropped ; unsigned long tx_dropped ; unsigned long multicast ; unsigned long collisions ; unsigned long rx_length_errors ; unsigned long rx_over_errors ; unsigned long rx_crc_errors ; unsigned long rx_frame_errors ; unsigned long rx_fifo_errors ; unsigned long rx_missed_errors ; unsigned long tx_aborted_errors ; unsigned long tx_carrier_errors ; unsigned long tx_fifo_errors ; unsigned long tx_heartbeat_errors ; unsigned long tx_window_errors ; unsigned long rx_compressed ; unsigned long tx_compressed ; }; struct neigh_parms; struct netdev_hw_addr_list { struct list_head list ; int count ; }; struct hh_cache { u16 hh_len ; u16 __pad ; seqlock_t hh_lock ; unsigned long hh_data[16U] ; }; struct header_ops { int (*create)(struct sk_buff * , struct net_device * , unsigned short , void const * , void const * , unsigned int ) ; int (*parse)(struct sk_buff const * , unsigned char * ) ; int (*cache)(struct neighbour const * , struct hh_cache * , __be16 ) ; void (*cache_update)(struct hh_cache * , struct net_device const * , unsigned char const * ) ; }; struct napi_struct { struct list_head poll_list ; unsigned long state ; int weight ; unsigned int gro_count ; int (*poll)(struct napi_struct * , int ) ; spinlock_t poll_lock ; int poll_owner ; struct net_device *dev ; struct sk_buff *gro_list ; struct sk_buff *skb ; struct hrtimer timer ; struct list_head dev_list ; struct hlist_node napi_hash_node ; unsigned int napi_id ; }; enum rx_handler_result { RX_HANDLER_CONSUMED = 0, RX_HANDLER_ANOTHER = 1, RX_HANDLER_EXACT = 2, RX_HANDLER_PASS = 3 } ; typedef enum rx_handler_result rx_handler_result_t; typedef rx_handler_result_t rx_handler_func_t(struct sk_buff ** ); struct Qdisc; struct netdev_queue { struct net_device *dev ; struct Qdisc *qdisc ; struct Qdisc *qdisc_sleeping ; struct kobject kobj ; int numa_node ; spinlock_t _xmit_lock ; int xmit_lock_owner ; unsigned long trans_start ; unsigned long trans_timeout ; unsigned long state ; struct dql dql ; unsigned long tx_maxrate ; }; struct rps_map { unsigned int len ; struct callback_head rcu ; u16 cpus[0U] ; }; struct rps_dev_flow { u16 cpu ; u16 filter ; unsigned int last_qtail ; }; struct rps_dev_flow_table { unsigned int mask ; struct callback_head rcu ; struct rps_dev_flow flows[0U] ; }; struct netdev_rx_queue { struct rps_map *rps_map ; struct rps_dev_flow_table *rps_flow_table ; struct kobject kobj ; struct net_device *dev ; }; struct xps_map { unsigned int len ; unsigned int alloc_len ; struct callback_head rcu ; u16 queues[0U] ; }; struct xps_dev_maps { struct callback_head rcu ; struct xps_map *cpu_map[0U] ; }; struct netdev_tc_txq { u16 count ; u16 offset ; }; struct netdev_fcoe_hbainfo { char manufacturer[64U] ; char serial_number[64U] ; char hardware_version[64U] ; char driver_version[64U] ; char optionrom_version[64U] ; char firmware_version[64U] ; char model[256U] ; char model_description[256U] ; }; struct netdev_phys_item_id { unsigned char id[32U] ; unsigned char id_len ; }; struct net_device_ops { int (*ndo_init)(struct net_device * ) ; void (*ndo_uninit)(struct net_device * ) ; int (*ndo_open)(struct net_device * ) ; int (*ndo_stop)(struct net_device * ) ; netdev_tx_t (*ndo_start_xmit)(struct sk_buff * , struct net_device * ) ; u16 (*ndo_select_queue)(struct net_device * , struct sk_buff * , void * , u16 (*)(struct net_device * , struct sk_buff * ) ) ; void (*ndo_change_rx_flags)(struct net_device * , int ) ; void (*ndo_set_rx_mode)(struct net_device * ) ; int (*ndo_set_mac_address)(struct net_device * , void * ) ; int (*ndo_validate_addr)(struct net_device * ) ; int (*ndo_do_ioctl)(struct net_device * , struct ifreq * , int ) ; int (*ndo_set_config)(struct net_device * , struct ifmap * ) ; int (*ndo_change_mtu)(struct net_device * , int ) ; int (*ndo_neigh_setup)(struct net_device * , struct neigh_parms * ) ; void (*ndo_tx_timeout)(struct net_device * ) ; struct rtnl_link_stats64 *(*ndo_get_stats64)(struct net_device * , struct rtnl_link_stats64 * ) ; struct net_device_stats *(*ndo_get_stats)(struct net_device * ) ; int (*ndo_vlan_rx_add_vid)(struct net_device * , __be16 , u16 ) ; int (*ndo_vlan_rx_kill_vid)(struct net_device * , __be16 , u16 ) ; void (*ndo_poll_controller)(struct net_device * ) ; int (*ndo_netpoll_setup)(struct net_device * , struct netpoll_info * ) ; void (*ndo_netpoll_cleanup)(struct net_device * ) ; int (*ndo_busy_poll)(struct napi_struct * ) ; int (*ndo_set_vf_mac)(struct net_device * , int , u8 * ) ; int (*ndo_set_vf_vlan)(struct net_device * , int , u16 , u8 ) ; int (*ndo_set_vf_rate)(struct net_device * , int , int , int ) ; int (*ndo_set_vf_spoofchk)(struct net_device * , int , bool ) ; int (*ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) ; int (*ndo_set_vf_link_state)(struct net_device * , int , int ) ; int (*ndo_get_vf_stats)(struct net_device * , int , struct ifla_vf_stats * ) ; int (*ndo_set_vf_port)(struct net_device * , int , struct nlattr ** ) ; int (*ndo_get_vf_port)(struct net_device * , int , struct sk_buff * ) ; int (*ndo_set_vf_rss_query_en)(struct net_device * , int , bool ) ; int (*ndo_setup_tc)(struct net_device * , u8 ) ; int (*ndo_fcoe_enable)(struct net_device * ) ; int (*ndo_fcoe_disable)(struct net_device * ) ; int (*ndo_fcoe_ddp_setup)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_ddp_done)(struct net_device * , u16 ) ; int (*ndo_fcoe_ddp_target)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_get_hbainfo)(struct net_device * , struct netdev_fcoe_hbainfo * ) ; int (*ndo_fcoe_get_wwn)(struct net_device * , u64 * , int ) ; int (*ndo_rx_flow_steer)(struct net_device * , struct sk_buff const * , u16 , u32 ) ; int (*ndo_add_slave)(struct net_device * , struct net_device * ) ; int (*ndo_del_slave)(struct net_device * , struct net_device * ) ; netdev_features_t (*ndo_fix_features)(struct net_device * , netdev_features_t ) ; int (*ndo_set_features)(struct net_device * , netdev_features_t ) ; int (*ndo_neigh_construct)(struct neighbour * ) ; void (*ndo_neigh_destroy)(struct neighbour * ) ; int (*ndo_fdb_add)(struct ndmsg * , struct nlattr ** , struct net_device * , unsigned char const * , u16 , u16 ) ; int (*ndo_fdb_del)(struct ndmsg * , struct nlattr ** , struct net_device * , unsigned char const * , u16 ) ; int (*ndo_fdb_dump)(struct sk_buff * , struct netlink_callback * , struct net_device * , struct net_device * , int ) ; int (*ndo_bridge_setlink)(struct net_device * , struct nlmsghdr * , u16 ) ; int (*ndo_bridge_getlink)(struct sk_buff * , u32 , u32 , struct net_device * , u32 , int ) ; int (*ndo_bridge_dellink)(struct net_device * , struct nlmsghdr * , u16 ) ; int (*ndo_change_carrier)(struct net_device * , bool ) ; int (*ndo_get_phys_port_id)(struct net_device * , struct netdev_phys_item_id * ) ; int (*ndo_get_phys_port_name)(struct net_device * , char * , size_t ) ; void (*ndo_add_vxlan_port)(struct net_device * , sa_family_t , __be16 ) ; void (*ndo_del_vxlan_port)(struct net_device * , sa_family_t , __be16 ) ; void *(*ndo_dfwd_add_station)(struct net_device * , struct net_device * ) ; void (*ndo_dfwd_del_station)(struct net_device * , void * ) ; netdev_tx_t (*ndo_dfwd_start_xmit)(struct sk_buff * , struct net_device * , void * ) ; int (*ndo_get_lock_subclass)(struct net_device * ) ; netdev_features_t (*ndo_features_check)(struct sk_buff * , struct net_device * , netdev_features_t ) ; int (*ndo_set_tx_maxrate)(struct net_device * , int , u32 ) ; int (*ndo_get_iflink)(struct net_device const * ) ; }; struct __anonstruct_adj_list_315 { struct list_head upper ; struct list_head lower ; }; struct __anonstruct_all_adj_list_316 { struct list_head upper ; struct list_head lower ; }; struct iw_handler_def; struct iw_public_data; struct switchdev_ops; struct vlan_info; struct tipc_bearer; struct in_device; struct dn_dev; struct inet6_dev; struct tcf_proto; struct cpu_rmap; struct pcpu_lstats; struct pcpu_sw_netstats; struct pcpu_dstats; struct pcpu_vstats; union __anonunion____missing_field_name_317 { void *ml_priv ; struct pcpu_lstats *lstats ; struct pcpu_sw_netstats *tstats ; struct pcpu_dstats *dstats ; struct pcpu_vstats *vstats ; }; struct garp_port; struct mrp_port; struct rtnl_link_ops; struct net_device { char name[16U] ; struct hlist_node name_hlist ; char *ifalias ; unsigned long mem_end ; unsigned long mem_start ; unsigned long base_addr ; int irq ; atomic_t carrier_changes ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_list ; struct list_head close_list ; struct list_head ptype_all ; struct list_head ptype_specific ; struct __anonstruct_adj_list_315 adj_list ; struct __anonstruct_all_adj_list_316 all_adj_list ; netdev_features_t features ; netdev_features_t hw_features ; netdev_features_t wanted_features ; netdev_features_t vlan_features ; netdev_features_t hw_enc_features ; netdev_features_t mpls_features ; int ifindex ; int group ; struct net_device_stats stats ; atomic_long_t rx_dropped ; atomic_long_t tx_dropped ; struct iw_handler_def const *wireless_handlers ; struct iw_public_data *wireless_data ; struct net_device_ops const *netdev_ops ; struct ethtool_ops const *ethtool_ops ; struct switchdev_ops const *switchdev_ops ; struct header_ops const *header_ops ; unsigned int flags ; unsigned int priv_flags ; unsigned short gflags ; unsigned short padded ; unsigned char operstate ; unsigned char link_mode ; unsigned char if_port ; unsigned char dma ; unsigned int mtu ; unsigned short type ; unsigned short hard_header_len ; unsigned short needed_headroom ; unsigned short needed_tailroom ; unsigned char perm_addr[32U] ; unsigned char addr_assign_type ; unsigned char addr_len ; unsigned short neigh_priv_len ; unsigned short dev_id ; unsigned short dev_port ; spinlock_t addr_list_lock ; unsigned char name_assign_type ; bool uc_promisc ; struct netdev_hw_addr_list uc ; struct netdev_hw_addr_list mc ; struct netdev_hw_addr_list dev_addrs ; struct kset *queues_kset ; unsigned int promiscuity ; unsigned int allmulti ; struct vlan_info *vlan_info ; struct dsa_switch_tree *dsa_ptr ; struct tipc_bearer *tipc_ptr ; void *atalk_ptr ; struct in_device *ip_ptr ; struct dn_dev *dn_ptr ; struct inet6_dev *ip6_ptr ; void *ax25_ptr ; struct wireless_dev *ieee80211_ptr ; struct wpan_dev *ieee802154_ptr ; struct mpls_dev *mpls_ptr ; unsigned long last_rx ; unsigned char *dev_addr ; struct netdev_rx_queue *_rx ; unsigned int num_rx_queues ; unsigned int real_num_rx_queues ; unsigned long gro_flush_timeout ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; struct tcf_proto *ingress_cl_list ; struct netdev_queue *ingress_queue ; struct list_head nf_hooks_ingress ; unsigned char broadcast[32U] ; struct cpu_rmap *rx_cpu_rmap ; struct hlist_node index_hlist ; struct netdev_queue *_tx ; unsigned int num_tx_queues ; unsigned int real_num_tx_queues ; struct Qdisc *qdisc ; unsigned long tx_queue_len ; spinlock_t tx_global_lock ; int watchdog_timeo ; struct xps_dev_maps *xps_maps ; unsigned long trans_start ; struct timer_list watchdog_timer ; int *pcpu_refcnt ; struct list_head todo_list ; struct list_head link_watch_list ; unsigned char reg_state ; bool dismantle ; unsigned short rtnl_link_state ; void (*destructor)(struct net_device * ) ; struct netpoll_info *npinfo ; possible_net_t nd_net ; union __anonunion____missing_field_name_317 __annonCompField94 ; struct garp_port *garp_port ; struct mrp_port *mrp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct attribute_group const *sysfs_rx_queue_group ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned int gso_max_size ; u16 gso_max_segs ; u16 gso_min_segs ; struct dcbnl_rtnl_ops const *dcbnl_ops ; u8 num_tc ; struct netdev_tc_txq tc_to_txq[16U] ; u8 prio_tc_map[16U] ; unsigned int fcoe_ddp_xid ; struct netprio_map *priomap ; struct phy_device *phydev ; struct lock_class_key *qdisc_tx_busylock ; }; struct packet_type { __be16 type ; struct net_device *dev ; int (*func)(struct sk_buff * , struct net_device * , struct packet_type * , struct net_device * ) ; bool (*id_match)(struct packet_type * , struct sock * ) ; void *af_packet_priv ; struct list_head list ; }; struct pcpu_sw_netstats { u64 rx_packets ; u64 rx_bytes ; u64 tx_packets ; u64 tx_bytes ; struct u64_stats_sync syncp ; }; struct mmu_notifier; struct mmu_notifier_ops; struct mmu_notifier_mm { struct hlist_head list ; spinlock_t lock ; }; struct mmu_notifier_ops { void (*release)(struct mmu_notifier * , struct mm_struct * ) ; int (*clear_flush_young)(struct mmu_notifier * , struct mm_struct * , unsigned long , unsigned long ) ; int (*test_young)(struct mmu_notifier * , struct mm_struct * , unsigned long ) ; void (*change_pte)(struct mmu_notifier * , struct mm_struct * , unsigned long , pte_t ) ; void (*invalidate_page)(struct mmu_notifier * , struct mm_struct * , unsigned long ) ; void (*invalidate_range_start)(struct mmu_notifier * , struct mm_struct * , unsigned long , unsigned long ) ; void (*invalidate_range_end)(struct mmu_notifier * , struct mm_struct * , unsigned long , unsigned long ) ; void (*invalidate_range)(struct mmu_notifier * , struct mm_struct * , unsigned long , unsigned long ) ; }; struct mmu_notifier { struct hlist_node hlist ; struct mmu_notifier_ops const *ops ; }; struct __anonstruct_global_330 { __be64 subnet_prefix ; __be64 interface_id ; }; union ib_gid { u8 raw[16U] ; struct __anonstruct_global_330 global ; }; enum rdma_link_layer { IB_LINK_LAYER_UNSPECIFIED = 0, IB_LINK_LAYER_INFINIBAND = 1, IB_LINK_LAYER_ETHERNET = 2 } ; enum ib_atomic_cap { IB_ATOMIC_NONE = 0, IB_ATOMIC_HCA = 1, IB_ATOMIC_GLOB = 2 } ; struct __anonstruct_per_transport_caps_331 { uint32_t rc_odp_caps ; uint32_t uc_odp_caps ; uint32_t ud_odp_caps ; }; struct ib_odp_caps { uint64_t general_caps ; struct __anonstruct_per_transport_caps_331 per_transport_caps ; }; struct ib_cq_init_attr { unsigned int cqe ; int comp_vector ; u32 flags ; }; struct ib_device_attr { u64 fw_ver ; __be64 sys_image_guid ; u64 max_mr_size ; u64 page_size_cap ; u32 vendor_id ; u32 vendor_part_id ; u32 hw_ver ; int max_qp ; int max_qp_wr ; int device_cap_flags ; int max_sge ; int max_sge_rd ; int max_cq ; int max_cqe ; int max_mr ; int max_pd ; int max_qp_rd_atom ; int max_ee_rd_atom ; int max_res_rd_atom ; int max_qp_init_rd_atom ; int max_ee_init_rd_atom ; enum ib_atomic_cap atomic_cap ; enum ib_atomic_cap masked_atomic_cap ; int max_ee ; int max_rdd ; int max_mw ; int max_raw_ipv6_qp ; int max_raw_ethy_qp ; int max_mcast_grp ; int max_mcast_qp_attach ; int max_total_mcast_qp_attach ; int max_ah ; int max_fmr ; int max_map_per_fmr ; int max_srq ; int max_srq_wr ; int max_srq_sge ; unsigned int max_fast_reg_page_list_len ; u16 max_pkeys ; u8 local_ca_ack_delay ; int sig_prot_cap ; int sig_guard_cap ; struct ib_odp_caps odp_caps ; uint64_t timestamp_mask ; uint64_t hca_core_clock ; }; enum ib_mtu { IB_MTU_256 = 1, IB_MTU_512 = 2, IB_MTU_1024 = 3, IB_MTU_2048 = 4, IB_MTU_4096 = 5 } ; enum ib_port_state { IB_PORT_NOP = 0, IB_PORT_DOWN = 1, IB_PORT_INIT = 2, IB_PORT_ARMED = 3, IB_PORT_ACTIVE = 4, IB_PORT_ACTIVE_DEFER = 5 } ; struct ib_protocol_stats { }; struct iw_protocol_stats { u64 ipInReceives ; u64 ipInHdrErrors ; u64 ipInTooBigErrors ; u64 ipInNoRoutes ; u64 ipInAddrErrors ; u64 ipInUnknownProtos ; u64 ipInTruncatedPkts ; u64 ipInDiscards ; u64 ipInDelivers ; u64 ipOutForwDatagrams ; u64 ipOutRequests ; u64 ipOutDiscards ; u64 ipOutNoRoutes ; u64 ipReasmTimeout ; u64 ipReasmReqds ; u64 ipReasmOKs ; u64 ipReasmFails ; u64 ipFragOKs ; u64 ipFragFails ; u64 ipFragCreates ; u64 ipInMcastPkts ; u64 ipOutMcastPkts ; u64 ipInBcastPkts ; u64 ipOutBcastPkts ; u64 tcpRtoAlgorithm ; u64 tcpRtoMin ; u64 tcpRtoMax ; u64 tcpMaxConn ; u64 tcpActiveOpens ; u64 tcpPassiveOpens ; u64 tcpAttemptFails ; u64 tcpEstabResets ; u64 tcpCurrEstab ; u64 tcpInSegs ; u64 tcpOutSegs ; u64 tcpRetransSegs ; u64 tcpInErrs ; u64 tcpOutRsts ; }; union rdma_protocol_stats { struct ib_protocol_stats ib ; struct iw_protocol_stats iw ; }; struct ib_port_attr { enum ib_port_state state ; enum ib_mtu max_mtu ; enum ib_mtu active_mtu ; int gid_tbl_len ; u32 port_cap_flags ; u32 max_msg_sz ; u32 bad_pkey_cntr ; u32 qkey_viol_cntr ; u16 pkey_tbl_len ; u16 lid ; u16 sm_lid ; u8 lmc ; u8 max_vl_num ; u8 sm_sl ; u8 subnet_timeout ; u8 init_type_reply ; u8 active_width ; u8 active_speed ; u8 phys_state ; }; struct ib_device_modify { u64 sys_image_guid ; char node_desc[64U] ; }; struct ib_port_modify { u32 set_port_cap_mask ; u32 clr_port_cap_mask ; u8 init_type ; }; enum ib_event_type { IB_EVENT_CQ_ERR = 0, IB_EVENT_QP_FATAL = 1, IB_EVENT_QP_REQ_ERR = 2, IB_EVENT_QP_ACCESS_ERR = 3, IB_EVENT_COMM_EST = 4, IB_EVENT_SQ_DRAINED = 5, IB_EVENT_PATH_MIG = 6, IB_EVENT_PATH_MIG_ERR = 7, IB_EVENT_DEVICE_FATAL = 8, IB_EVENT_PORT_ACTIVE = 9, IB_EVENT_PORT_ERR = 10, IB_EVENT_LID_CHANGE = 11, IB_EVENT_PKEY_CHANGE = 12, IB_EVENT_SM_CHANGE = 13, IB_EVENT_SRQ_ERR = 14, IB_EVENT_SRQ_LIMIT_REACHED = 15, IB_EVENT_QP_LAST_WQE_REACHED = 16, IB_EVENT_CLIENT_REREGISTER = 17, IB_EVENT_GID_CHANGE = 18 } ; struct ib_device; struct ib_cq; struct ib_qp; struct ib_srq; union __anonunion_element_332 { struct ib_cq *cq ; struct ib_qp *qp ; struct ib_srq *srq ; u8 port_num ; }; struct ib_event { struct ib_device *device ; union __anonunion_element_332 element ; enum ib_event_type event ; }; struct ib_event_handler { struct ib_device *device ; void (*handler)(struct ib_event_handler * , struct ib_event * ) ; struct list_head list ; }; struct ib_global_route { union ib_gid dgid ; u32 flow_label ; u8 sgid_index ; u8 hop_limit ; u8 traffic_class ; }; struct ib_grh { __be32 version_tclass_flow ; __be16 paylen ; u8 next_hdr ; u8 hop_limit ; union ib_gid sgid ; union ib_gid dgid ; }; struct ib_mr_init_attr { int max_reg_descriptors ; u32 flags ; }; enum ib_signature_type { IB_SIG_TYPE_NONE = 0, IB_SIG_TYPE_T10_DIF = 1 } ; enum ib_t10_dif_bg_type { IB_T10DIF_CRC = 0, IB_T10DIF_CSUM = 1 } ; struct ib_t10_dif_domain { enum ib_t10_dif_bg_type bg_type ; u16 pi_interval ; u16 bg ; u16 app_tag ; u32 ref_tag ; bool ref_remap ; bool app_escape ; bool ref_escape ; u16 apptag_check_mask ; }; union __anonunion_sig_333 { struct ib_t10_dif_domain dif ; }; struct ib_sig_domain { enum ib_signature_type sig_type ; union __anonunion_sig_333 sig ; }; struct ib_sig_attrs { u8 check_mask ; struct ib_sig_domain mem ; struct ib_sig_domain wire ; }; enum ib_sig_err_type { IB_SIG_BAD_GUARD = 0, IB_SIG_BAD_REFTAG = 1, IB_SIG_BAD_APPTAG = 2 } ; struct ib_sig_err { enum ib_sig_err_type err_type ; u32 expected ; u32 actual ; u64 sig_err_offset ; u32 key ; }; struct ib_mr_status { u32 fail_status ; struct ib_sig_err sig_err ; }; struct ib_ah_attr { struct ib_global_route grh ; u16 dlid ; u8 sl ; u8 src_path_bits ; u8 static_rate ; u8 ah_flags ; u8 port_num ; u8 dmac[6U] ; u16 vlan_id ; }; enum ib_wc_status { IB_WC_SUCCESS = 0, IB_WC_LOC_LEN_ERR = 1, IB_WC_LOC_QP_OP_ERR = 2, IB_WC_LOC_EEC_OP_ERR = 3, IB_WC_LOC_PROT_ERR = 4, IB_WC_WR_FLUSH_ERR = 5, IB_WC_MW_BIND_ERR = 6, IB_WC_BAD_RESP_ERR = 7, IB_WC_LOC_ACCESS_ERR = 8, IB_WC_REM_INV_REQ_ERR = 9, IB_WC_REM_ACCESS_ERR = 10, IB_WC_REM_OP_ERR = 11, IB_WC_RETRY_EXC_ERR = 12, IB_WC_RNR_RETRY_EXC_ERR = 13, IB_WC_LOC_RDD_VIOL_ERR = 14, IB_WC_REM_INV_RD_REQ_ERR = 15, IB_WC_REM_ABORT_ERR = 16, IB_WC_INV_EECN_ERR = 17, IB_WC_INV_EEC_STATE_ERR = 18, IB_WC_FATAL_ERR = 19, IB_WC_RESP_TIMEOUT_ERR = 20, IB_WC_GENERAL_ERR = 21 } ; enum ib_wc_opcode { IB_WC_SEND = 0, IB_WC_RDMA_WRITE = 1, IB_WC_RDMA_READ = 2, IB_WC_COMP_SWAP = 3, IB_WC_FETCH_ADD = 4, IB_WC_BIND_MW = 5, IB_WC_LSO = 6, IB_WC_LOCAL_INV = 7, IB_WC_FAST_REG_MR = 8, IB_WC_MASKED_COMP_SWAP = 9, IB_WC_MASKED_FETCH_ADD = 10, IB_WC_RECV = 128, IB_WC_RECV_RDMA_WITH_IMM = 129 } ; union __anonunion_ex_334 { __be32 imm_data ; u32 invalidate_rkey ; }; struct ib_wc { u64 wr_id ; enum ib_wc_status status ; enum ib_wc_opcode opcode ; u32 vendor_err ; u32 byte_len ; struct ib_qp *qp ; union __anonunion_ex_334 ex ; u32 src_qp ; int wc_flags ; u16 pkey_index ; u16 slid ; u8 sl ; u8 dlid_path_bits ; u8 port_num ; u8 smac[6U] ; u16 vlan_id ; }; enum ib_cq_notify_flags { IB_CQ_SOLICITED = 1, IB_CQ_NEXT_COMP = 2, IB_CQ_SOLICITED_MASK = 3, IB_CQ_REPORT_MISSED_EVENTS = 4 } ; enum ib_srq_type { IB_SRQT_BASIC = 0, IB_SRQT_XRC = 1 } ; enum ib_srq_attr_mask { IB_SRQ_MAX_WR = 1, IB_SRQ_LIMIT = 2 } ; struct ib_srq_attr { u32 max_wr ; u32 max_sge ; u32 srq_limit ; }; struct ib_xrcd; struct __anonstruct_xrc_336 { struct ib_xrcd *xrcd ; struct ib_cq *cq ; }; union __anonunion_ext_335 { struct __anonstruct_xrc_336 xrc ; }; struct ib_srq_init_attr { void (*event_handler)(struct ib_event * , void * ) ; void *srq_context ; struct ib_srq_attr attr ; enum ib_srq_type srq_type ; union __anonunion_ext_335 ext ; }; struct ib_qp_cap { u32 max_send_wr ; u32 max_recv_wr ; u32 max_send_sge ; u32 max_recv_sge ; u32 max_inline_data ; }; enum ib_sig_type { IB_SIGNAL_ALL_WR = 0, IB_SIGNAL_REQ_WR = 1 } ; enum ib_qp_type { IB_QPT_SMI = 0, IB_QPT_GSI = 1, IB_QPT_RC = 2, IB_QPT_UC = 3, IB_QPT_UD = 4, IB_QPT_RAW_IPV6 = 5, IB_QPT_RAW_ETHERTYPE = 6, IB_QPT_RAW_PACKET = 8, IB_QPT_XRC_INI = 9, IB_QPT_XRC_TGT = 10, IB_QPT_MAX = 11, IB_QPT_RESERVED1 = 4096, IB_QPT_RESERVED2 = 4097, IB_QPT_RESERVED3 = 4098, IB_QPT_RESERVED4 = 4099, IB_QPT_RESERVED5 = 4100, IB_QPT_RESERVED6 = 4101, IB_QPT_RESERVED7 = 4102, IB_QPT_RESERVED8 = 4103, IB_QPT_RESERVED9 = 4104, IB_QPT_RESERVED10 = 4105 } ; enum ib_qp_create_flags { IB_QP_CREATE_IPOIB_UD_LSO = 1, IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 2, IB_QP_CREATE_NETIF_QP = 32, IB_QP_CREATE_SIGNATURE_EN = 64, IB_QP_CREATE_USE_GFP_NOIO = 128, IB_QP_CREATE_RESERVED_START = 67108864, IB_QP_CREATE_RESERVED_END = (-0x7FFFFFFF-1) } ; struct ib_qp_init_attr { void (*event_handler)(struct ib_event * , void * ) ; void *qp_context ; struct ib_cq *send_cq ; struct ib_cq *recv_cq ; struct ib_srq *srq ; struct ib_xrcd *xrcd ; struct ib_qp_cap cap ; enum ib_sig_type sq_sig_type ; enum ib_qp_type qp_type ; enum ib_qp_create_flags create_flags ; u8 port_num ; }; enum ib_qp_state { IB_QPS_RESET = 0, IB_QPS_INIT = 1, IB_QPS_RTR = 2, IB_QPS_RTS = 3, IB_QPS_SQD = 4, IB_QPS_SQE = 5, IB_QPS_ERR = 6 } ; enum ib_mig_state { IB_MIG_MIGRATED = 0, IB_MIG_REARM = 1, IB_MIG_ARMED = 2 } ; enum ib_mw_type { IB_MW_TYPE_1 = 1, IB_MW_TYPE_2 = 2 } ; struct ib_qp_attr { enum ib_qp_state qp_state ; enum ib_qp_state cur_qp_state ; enum ib_mtu path_mtu ; enum ib_mig_state path_mig_state ; u32 qkey ; u32 rq_psn ; u32 sq_psn ; u32 dest_qp_num ; int qp_access_flags ; struct ib_qp_cap cap ; struct ib_ah_attr ah_attr ; struct ib_ah_attr alt_ah_attr ; u16 pkey_index ; u16 alt_pkey_index ; u8 en_sqd_async_notify ; u8 sq_draining ; u8 max_rd_atomic ; u8 max_dest_rd_atomic ; u8 min_rnr_timer ; u8 port_num ; u8 timeout ; u8 retry_cnt ; u8 rnr_retry ; u8 alt_port_num ; u8 alt_timeout ; u8 smac[6U] ; u8 alt_smac[6U] ; u16 vlan_id ; u16 alt_vlan_id ; }; enum ib_wr_opcode { IB_WR_RDMA_WRITE = 0, IB_WR_RDMA_WRITE_WITH_IMM = 1, IB_WR_SEND = 2, IB_WR_SEND_WITH_IMM = 3, IB_WR_RDMA_READ = 4, IB_WR_ATOMIC_CMP_AND_SWP = 5, IB_WR_ATOMIC_FETCH_AND_ADD = 6, IB_WR_LSO = 7, IB_WR_SEND_WITH_INV = 8, IB_WR_RDMA_READ_WITH_INV = 9, IB_WR_LOCAL_INV = 10, IB_WR_FAST_REG_MR = 11, IB_WR_MASKED_ATOMIC_CMP_AND_SWP = 12, IB_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13, IB_WR_BIND_MW = 14, IB_WR_REG_SIG_MR = 15, IB_WR_RESERVED1 = 240, IB_WR_RESERVED2 = 241, IB_WR_RESERVED3 = 242, IB_WR_RESERVED4 = 243, IB_WR_RESERVED5 = 244, IB_WR_RESERVED6 = 245, IB_WR_RESERVED7 = 246, IB_WR_RESERVED8 = 247, IB_WR_RESERVED9 = 248, IB_WR_RESERVED10 = 249 } ; struct ib_sge { u64 addr ; u32 length ; u32 lkey ; }; struct ib_fast_reg_page_list { struct ib_device *device ; u64 *page_list ; unsigned int max_page_list_len ; }; struct ib_mr; struct ib_mw_bind_info { struct ib_mr *mr ; u64 addr ; u64 length ; int mw_access_flags ; }; union __anonunion_ex_337 { __be32 imm_data ; u32 invalidate_rkey ; }; struct __anonstruct_rdma_339 { u64 remote_addr ; u32 rkey ; }; struct __anonstruct_atomic_340 { u64 remote_addr ; u64 compare_add ; u64 swap ; u64 compare_add_mask ; u64 swap_mask ; u32 rkey ; }; struct ib_ah; struct __anonstruct_ud_341 { struct ib_ah *ah ; void *header ; int hlen ; int mss ; u32 remote_qpn ; u32 remote_qkey ; u16 pkey_index ; u8 port_num ; }; struct __anonstruct_fast_reg_342 { u64 iova_start ; struct ib_fast_reg_page_list *page_list ; unsigned int page_shift ; unsigned int page_list_len ; u32 length ; int access_flags ; u32 rkey ; }; struct ib_mw; struct __anonstruct_bind_mw_343 { struct ib_mw *mw ; u32 rkey ; struct ib_mw_bind_info bind_info ; }; struct __anonstruct_sig_handover_344 { struct ib_sig_attrs *sig_attrs ; struct ib_mr *sig_mr ; int access_flags ; struct ib_sge *prot ; }; union __anonunion_wr_338 { struct __anonstruct_rdma_339 rdma ; struct __anonstruct_atomic_340 atomic ; struct __anonstruct_ud_341 ud ; struct __anonstruct_fast_reg_342 fast_reg ; struct __anonstruct_bind_mw_343 bind_mw ; struct __anonstruct_sig_handover_344 sig_handover ; }; struct ib_send_wr { struct ib_send_wr *next ; u64 wr_id ; struct ib_sge *sg_list ; int num_sge ; enum ib_wr_opcode opcode ; int send_flags ; union __anonunion_ex_337 ex ; union __anonunion_wr_338 wr ; u32 xrc_remote_srq_num ; }; struct ib_recv_wr { struct ib_recv_wr *next ; u64 wr_id ; struct ib_sge *sg_list ; int num_sge ; }; struct ib_phys_buf { u64 addr ; u64 size ; }; struct ib_pd; struct ib_mr_attr { struct ib_pd *pd ; u64 device_virt_addr ; u64 size ; int mr_access_flags ; u32 lkey ; u32 rkey ; }; struct ib_mw_bind { u64 wr_id ; int send_flags ; struct ib_mw_bind_info bind_info ; }; struct ib_fmr_attr { int max_pages ; int max_maps ; u8 page_shift ; }; struct ib_umem; struct ib_ucontext { struct ib_device *device ; struct list_head pd_list ; struct list_head mr_list ; struct list_head mw_list ; struct list_head cq_list ; struct list_head qp_list ; struct list_head srq_list ; struct list_head ah_list ; struct list_head xrcd_list ; struct list_head rule_list ; int closing ; struct pid *tgid ; struct rb_root umem_tree ; struct rw_semaphore umem_rwsem ; void (*invalidate_range)(struct ib_umem * , unsigned long , unsigned long ) ; struct mmu_notifier mn ; atomic_t notifier_count ; struct list_head no_private_counters ; int odp_mrs_count ; }; struct ib_uobject { u64 user_handle ; struct ib_ucontext *context ; void *object ; struct list_head list ; int id ; struct kref ref ; struct rw_semaphore mutex ; int live ; }; struct ib_udata { void const *inbuf ; void *outbuf ; size_t inlen ; size_t outlen ; }; struct ib_pd { struct ib_device *device ; struct ib_uobject *uobject ; atomic_t usecnt ; }; struct ib_xrcd { struct ib_device *device ; atomic_t usecnt ; struct inode *inode ; struct mutex tgt_qp_mutex ; struct list_head tgt_qp_list ; }; struct ib_ah { struct ib_device *device ; struct ib_pd *pd ; struct ib_uobject *uobject ; }; struct ib_cq { struct ib_device *device ; struct ib_uobject *uobject ; void (*comp_handler)(struct ib_cq * , void * ) ; void (*event_handler)(struct ib_event * , void * ) ; void *cq_context ; int cqe ; atomic_t usecnt ; }; struct __anonstruct_xrc_346 { struct ib_xrcd *xrcd ; struct ib_cq *cq ; u32 srq_num ; }; union __anonunion_ext_345 { struct __anonstruct_xrc_346 xrc ; }; struct ib_srq { struct ib_device *device ; struct ib_pd *pd ; struct ib_uobject *uobject ; void (*event_handler)(struct ib_event * , void * ) ; void *srq_context ; enum ib_srq_type srq_type ; atomic_t usecnt ; union __anonunion_ext_345 ext ; }; struct ib_qp { struct ib_device *device ; struct ib_pd *pd ; struct ib_cq *send_cq ; struct ib_cq *recv_cq ; struct ib_srq *srq ; struct ib_xrcd *xrcd ; struct list_head xrcd_list ; atomic_t usecnt ; struct list_head open_list ; struct ib_qp *real_qp ; struct ib_uobject *uobject ; void (*event_handler)(struct ib_event * , void * ) ; void *qp_context ; u32 qp_num ; enum ib_qp_type qp_type ; }; struct ib_mr { struct ib_device *device ; struct ib_pd *pd ; struct ib_uobject *uobject ; u32 lkey ; u32 rkey ; atomic_t usecnt ; }; struct ib_mw { struct ib_device *device ; struct ib_pd *pd ; struct ib_uobject *uobject ; u32 rkey ; enum ib_mw_type type ; }; struct ib_fmr { struct ib_device *device ; struct ib_pd *pd ; struct list_head list ; u32 lkey ; u32 rkey ; }; enum ib_flow_attr_type { IB_FLOW_ATTR_NORMAL = 0, IB_FLOW_ATTR_ALL_DEFAULT = 1, IB_FLOW_ATTR_MC_DEFAULT = 2, IB_FLOW_ATTR_SNIFFER = 3 } ; struct ib_flow_attr { enum ib_flow_attr_type type ; u16 size ; u16 priority ; u32 flags ; u8 num_of_specs ; u8 port ; }; struct ib_flow { struct ib_qp *qp ; struct ib_uobject *uobject ; }; struct ib_mad_hdr; struct ib_pkey_cache; struct ib_gid_cache; struct ib_cache { rwlock_t lock ; struct ib_event_handler event_handler ; struct ib_pkey_cache **pkey_cache ; struct ib_gid_cache **gid_cache ; u8 *lmc_cache ; }; struct ib_dma_mapping_ops { int (*mapping_error)(struct ib_device * , u64 ) ; u64 (*map_single)(struct ib_device * , void * , size_t , enum dma_data_direction ) ; void (*unmap_single)(struct ib_device * , u64 , size_t , enum dma_data_direction ) ; u64 (*map_page)(struct ib_device * , struct page * , unsigned long , size_t , enum dma_data_direction ) ; void (*unmap_page)(struct ib_device * , u64 , size_t , enum dma_data_direction ) ; int (*map_sg)(struct ib_device * , struct scatterlist * , int , enum dma_data_direction ) ; void (*unmap_sg)(struct ib_device * , struct scatterlist * , int , enum dma_data_direction ) ; void (*sync_single_for_cpu)(struct ib_device * , u64 , size_t , enum dma_data_direction ) ; void (*sync_single_for_device)(struct ib_device * , u64 , size_t , enum dma_data_direction ) ; void *(*alloc_coherent)(struct ib_device * , size_t , u64 * , gfp_t ) ; void (*free_coherent)(struct ib_device * , size_t , void * , u64 ) ; }; struct iw_cm_verbs; struct ib_port_immutable { int pkey_tbl_len ; int gid_tbl_len ; u32 core_cap_flags ; u32 max_mad_size ; }; enum ldv_32268 { IB_DEV_UNINITIALIZED = 0, IB_DEV_REGISTERED = 1, IB_DEV_UNREGISTERED = 2 } ; struct ib_device { struct device *dma_device ; char name[64U] ; struct list_head event_handler_list ; spinlock_t event_handler_lock ; spinlock_t client_data_lock ; struct list_head core_list ; struct list_head client_data_list ; struct ib_cache cache ; struct ib_port_immutable *port_immutable ; int num_comp_vectors ; struct iw_cm_verbs *iwcm ; int (*get_protocol_stats)(struct ib_device * , union rdma_protocol_stats * ) ; int (*query_device)(struct ib_device * , struct ib_device_attr * , struct ib_udata * ) ; int (*query_port)(struct ib_device * , u8 , struct ib_port_attr * ) ; enum rdma_link_layer (*get_link_layer)(struct ib_device * , u8 ) ; int (*query_gid)(struct ib_device * , u8 , int , union ib_gid * ) ; int (*query_pkey)(struct ib_device * , u8 , u16 , u16 * ) ; int (*modify_device)(struct ib_device * , int , struct ib_device_modify * ) ; int (*modify_port)(struct ib_device * , u8 , int , struct ib_port_modify * ) ; struct ib_ucontext *(*alloc_ucontext)(struct ib_device * , struct ib_udata * ) ; int (*dealloc_ucontext)(struct ib_ucontext * ) ; int (*mmap)(struct ib_ucontext * , struct vm_area_struct * ) ; struct ib_pd *(*alloc_pd)(struct ib_device * , struct ib_ucontext * , struct ib_udata * ) ; int (*dealloc_pd)(struct ib_pd * ) ; struct ib_ah *(*create_ah)(struct ib_pd * , struct ib_ah_attr * ) ; int (*modify_ah)(struct ib_ah * , struct ib_ah_attr * ) ; int (*query_ah)(struct ib_ah * , struct ib_ah_attr * ) ; int (*destroy_ah)(struct ib_ah * ) ; struct ib_srq *(*create_srq)(struct ib_pd * , struct ib_srq_init_attr * , struct ib_udata * ) ; int (*modify_srq)(struct ib_srq * , struct ib_srq_attr * , enum ib_srq_attr_mask , struct ib_udata * ) ; int (*query_srq)(struct ib_srq * , struct ib_srq_attr * ) ; int (*destroy_srq)(struct ib_srq * ) ; int (*post_srq_recv)(struct ib_srq * , struct ib_recv_wr * , struct ib_recv_wr ** ) ; struct ib_qp *(*create_qp)(struct ib_pd * , struct ib_qp_init_attr * , struct ib_udata * ) ; int (*modify_qp)(struct ib_qp * , struct ib_qp_attr * , int , struct ib_udata * ) ; int (*query_qp)(struct ib_qp * , struct ib_qp_attr * , int , struct ib_qp_init_attr * ) ; int (*destroy_qp)(struct ib_qp * ) ; int (*post_send)(struct ib_qp * , struct ib_send_wr * , struct ib_send_wr ** ) ; int (*post_recv)(struct ib_qp * , struct ib_recv_wr * , struct ib_recv_wr ** ) ; struct ib_cq *(*create_cq)(struct ib_device * , struct ib_cq_init_attr const * , struct ib_ucontext * , struct ib_udata * ) ; int (*modify_cq)(struct ib_cq * , u16 , u16 ) ; int (*destroy_cq)(struct ib_cq * ) ; int (*resize_cq)(struct ib_cq * , int , struct ib_udata * ) ; int (*poll_cq)(struct ib_cq * , int , struct ib_wc * ) ; int (*peek_cq)(struct ib_cq * , int ) ; int (*req_notify_cq)(struct ib_cq * , enum ib_cq_notify_flags ) ; int (*req_ncomp_notif)(struct ib_cq * , int ) ; struct ib_mr *(*get_dma_mr)(struct ib_pd * , int ) ; struct ib_mr *(*reg_phys_mr)(struct ib_pd * , struct ib_phys_buf * , int , int , u64 * ) ; struct ib_mr *(*reg_user_mr)(struct ib_pd * , u64 , u64 , u64 , int , struct ib_udata * ) ; int (*rereg_user_mr)(struct ib_mr * , int , u64 , u64 , u64 , int , struct ib_pd * , struct ib_udata * ) ; int (*query_mr)(struct ib_mr * , struct ib_mr_attr * ) ; int (*dereg_mr)(struct ib_mr * ) ; int (*destroy_mr)(struct ib_mr * ) ; struct ib_mr *(*create_mr)(struct ib_pd * , struct ib_mr_init_attr * ) ; struct ib_mr *(*alloc_fast_reg_mr)(struct ib_pd * , int ) ; struct ib_fast_reg_page_list *(*alloc_fast_reg_page_list)(struct ib_device * , int ) ; void (*free_fast_reg_page_list)(struct ib_fast_reg_page_list * ) ; int (*rereg_phys_mr)(struct ib_mr * , int , struct ib_pd * , struct ib_phys_buf * , int , int , u64 * ) ; struct ib_mw *(*alloc_mw)(struct ib_pd * , enum ib_mw_type ) ; int (*bind_mw)(struct ib_qp * , struct ib_mw * , struct ib_mw_bind * ) ; int (*dealloc_mw)(struct ib_mw * ) ; struct ib_fmr *(*alloc_fmr)(struct ib_pd * , int , struct ib_fmr_attr * ) ; int (*map_phys_fmr)(struct ib_fmr * , u64 * , int , u64 ) ; int (*unmap_fmr)(struct list_head * ) ; int (*dealloc_fmr)(struct ib_fmr * ) ; int (*attach_mcast)(struct ib_qp * , union ib_gid * , u16 ) ; int (*detach_mcast)(struct ib_qp * , union ib_gid * , u16 ) ; int (*process_mad)(struct ib_device * , int , u8 , struct ib_wc const * , struct ib_grh const * , struct ib_mad_hdr const * , size_t , struct ib_mad_hdr * , size_t * , u16 * ) ; struct ib_xrcd *(*alloc_xrcd)(struct ib_device * , struct ib_ucontext * , struct ib_udata * ) ; int (*dealloc_xrcd)(struct ib_xrcd * ) ; struct ib_flow *(*create_flow)(struct ib_qp * , struct ib_flow_attr * , int ) ; int (*destroy_flow)(struct ib_flow * ) ; int (*check_mr_status)(struct ib_mr * , u32 , struct ib_mr_status * ) ; struct ib_dma_mapping_ops *dma_ops ; struct module *owner ; struct device dev ; struct kobject *ports_parent ; struct list_head port_list ; enum ldv_32268 reg_state ; int uverbs_abi_ver ; u64 uverbs_cmd_mask ; u64 uverbs_ex_cmd_mask ; char node_desc[64U] ; __be64 node_guid ; u32 local_dma_lkey ; u8 node_type ; u8 phys_port_cnt ; int (*get_port_immutable)(struct ib_device * , u8 , struct ib_port_immutable * ) ; }; struct ib_mad_hdr { u8 base_version ; u8 mgmt_class ; u8 class_version ; u8 method ; __be16 status ; __be16 class_specific ; __be64 tid ; __be16 attr_id ; __be16 resv ; __be32 attr_mod ; }; struct iw_cm_id; enum iw_cm_event_type { IW_CM_EVENT_CONNECT_REQUEST = 1, IW_CM_EVENT_CONNECT_REPLY = 2, IW_CM_EVENT_ESTABLISHED = 3, IW_CM_EVENT_DISCONNECT = 4, IW_CM_EVENT_CLOSE = 5 } ; struct iw_cm_event { enum iw_cm_event_type event ; int status ; struct __kernel_sockaddr_storage local_addr ; struct __kernel_sockaddr_storage remote_addr ; void *private_data ; void *provider_data ; u8 private_data_len ; u8 ord ; u8 ird ; }; struct iw_cm_id { int (*cm_handler)(struct iw_cm_id * , struct iw_cm_event * ) ; void *context ; struct ib_device *device ; struct __kernel_sockaddr_storage local_addr ; struct __kernel_sockaddr_storage remote_addr ; void *provider_data ; int (*event_handler)(struct iw_cm_id * , struct iw_cm_event * ) ; void (*add_ref)(struct iw_cm_id * ) ; void (*rem_ref)(struct iw_cm_id * ) ; u8 tos ; }; struct iw_cm_conn_param { void const *private_data ; u16 private_data_len ; u32 ord ; u32 ird ; u32 qpn ; }; struct iw_cm_verbs { void (*add_ref)(struct ib_qp * ) ; void (*rem_ref)(struct ib_qp * ) ; struct ib_qp *(*get_qp)(struct ib_device * , int ) ; int (*connect)(struct iw_cm_id * , struct iw_cm_conn_param * ) ; int (*accept)(struct iw_cm_id * , struct iw_cm_conn_param * ) ; int (*reject)(struct iw_cm_id * , void const * , u8 ) ; int (*create_listen)(struct iw_cm_id * , int ) ; int (*destroy_listen)(struct iw_cm_id * ) ; }; 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 ipv4_devconf { void *sysctl ; int data[29U] ; unsigned long state[1U] ; }; struct in_ifaddr; struct ip_mc_list; struct in_device { struct net_device *dev ; atomic_t refcnt ; int dead ; struct in_ifaddr *ifa_list ; struct ip_mc_list *mc_list ; struct ip_mc_list **mc_hash ; int mc_count ; spinlock_t mc_tomb_lock ; struct ip_mc_list *mc_tomb ; unsigned long mr_v1_seen ; unsigned long mr_v2_seen ; unsigned long mr_maxdelay ; unsigned char mr_qrv ; unsigned char mr_gq_running ; unsigned char mr_ifc_count ; struct timer_list mr_gq_timer ; struct timer_list mr_ifc_timer ; struct neigh_parms *arp_parms ; struct ipv4_devconf cnf ; struct callback_head callback_head ; }; struct in_ifaddr { struct hlist_node hash ; struct in_ifaddr *ifa_next ; struct in_device *ifa_dev ; struct callback_head callback_head ; __be32 ifa_local ; __be32 ifa_address ; __be32 ifa_mask ; __be32 ifa_broadcast ; unsigned char ifa_scope ; unsigned char ifa_prefixlen ; __u32 ifa_flags ; char ifa_label[16U] ; __u32 ifa_valid_lft ; __u32 ifa_preferred_lft ; unsigned long ifa_cstamp ; unsigned long ifa_tstamp ; }; struct hotplug_slot; struct pci_slot { struct pci_bus *bus ; struct list_head list ; struct hotplug_slot *hotplug ; unsigned char number ; struct kobject kobj ; }; typedef int pci_power_t; typedef unsigned int pci_channel_state_t; enum pci_channel_state { pci_channel_io_normal = 1, pci_channel_io_frozen = 2, pci_channel_io_perm_failure = 3 } ; typedef unsigned short pci_dev_flags_t; typedef unsigned short pci_bus_flags_t; struct pcie_link_state; struct pci_vpd; struct pci_sriov; struct pci_ats; struct pci_driver; union __anonunion____missing_field_name_352 { struct pci_sriov *sriov ; struct pci_dev *physfn ; }; struct pci_dev { struct list_head bus_list ; struct pci_bus *bus ; struct pci_bus *subordinate ; void *sysdata ; struct proc_dir_entry *procent ; struct pci_slot *slot ; unsigned int devfn ; unsigned short vendor ; unsigned short device ; unsigned short subsystem_vendor ; unsigned short subsystem_device ; unsigned int class ; u8 revision ; u8 hdr_type ; u8 pcie_cap ; u8 msi_cap ; u8 msix_cap ; unsigned char pcie_mpss : 3 ; u8 rom_base_reg ; u8 pin ; u16 pcie_flags_reg ; u8 dma_alias_devfn ; struct pci_driver *driver ; u64 dma_mask ; struct device_dma_parameters dma_parms ; pci_power_t current_state ; u8 pm_cap ; unsigned char pme_support : 5 ; unsigned char pme_interrupt : 1 ; unsigned char pme_poll : 1 ; unsigned char d1_support : 1 ; unsigned char d2_support : 1 ; unsigned char no_d1d2 : 1 ; unsigned char no_d3cold : 1 ; unsigned char d3cold_allowed : 1 ; unsigned char mmio_always_on : 1 ; unsigned char wakeup_prepared : 1 ; unsigned char runtime_d3cold : 1 ; unsigned char ignore_hotplug : 1 ; unsigned int d3_delay ; unsigned int d3cold_delay ; struct pcie_link_state *link_state ; pci_channel_state_t error_state ; struct device dev ; int cfg_size ; unsigned int irq ; struct resource resource[17U] ; bool match_driver ; unsigned char transparent : 1 ; unsigned char multifunction : 1 ; unsigned char is_added : 1 ; unsigned char is_busmaster : 1 ; unsigned char no_msi : 1 ; unsigned char no_64bit_msi : 1 ; unsigned char block_cfg_access : 1 ; unsigned char broken_parity_status : 1 ; unsigned char irq_reroute_variant : 2 ; unsigned char msi_enabled : 1 ; unsigned char msix_enabled : 1 ; unsigned char ari_enabled : 1 ; unsigned char is_managed : 1 ; unsigned char needs_freset : 1 ; unsigned char state_saved : 1 ; unsigned char is_physfn : 1 ; unsigned char is_virtfn : 1 ; unsigned char reset_fn : 1 ; unsigned char is_hotplug_bridge : 1 ; unsigned char __aer_firmware_first_valid : 1 ; unsigned char __aer_firmware_first : 1 ; unsigned char broken_intx_masking : 1 ; unsigned char io_window_1k : 1 ; unsigned char irq_managed : 1 ; unsigned char has_secondary_link : 1 ; pci_dev_flags_t dev_flags ; atomic_t enable_cnt ; u32 saved_config_space[16U] ; struct hlist_head saved_cap_space ; struct bin_attribute *rom_attr ; int rom_attr_enabled ; struct bin_attribute *res_attr[17U] ; struct bin_attribute *res_attr_wc[17U] ; struct list_head msi_list ; struct attribute_group const **msi_irq_groups ; struct pci_vpd *vpd ; union __anonunion____missing_field_name_352 __annonCompField97 ; struct pci_ats *ats ; phys_addr_t rom ; size_t romlen ; char *driver_override ; }; struct pci_ops; struct msi_controller; struct pci_bus { struct list_head node ; struct pci_bus *parent ; struct list_head children ; struct list_head devices ; struct pci_dev *self ; struct list_head slots ; struct resource *resource[4U] ; struct list_head resources ; struct resource busn_res ; struct pci_ops *ops ; struct msi_controller *msi ; void *sysdata ; struct proc_dir_entry *procdir ; unsigned char number ; unsigned char primary ; unsigned char max_bus_speed ; unsigned char cur_bus_speed ; char name[48U] ; unsigned short bridge_ctl ; pci_bus_flags_t bus_flags ; struct device *bridge ; struct device dev ; struct bin_attribute *legacy_io ; struct bin_attribute *legacy_mem ; unsigned char is_added : 1 ; }; struct pci_ops { void *(*map_bus)(struct pci_bus * , unsigned int , int ) ; int (*read)(struct pci_bus * , unsigned int , int , int , u32 * ) ; int (*write)(struct pci_bus * , unsigned int , int , int , u32 ) ; }; struct pci_dynids { spinlock_t lock ; struct list_head list ; }; typedef unsigned int pci_ers_result_t; struct pci_error_handlers { pci_ers_result_t (*error_detected)(struct pci_dev * , enum pci_channel_state ) ; pci_ers_result_t (*mmio_enabled)(struct pci_dev * ) ; pci_ers_result_t (*link_reset)(struct pci_dev * ) ; pci_ers_result_t (*slot_reset)(struct pci_dev * ) ; void (*reset_notify)(struct pci_dev * , bool ) ; void (*resume)(struct pci_dev * ) ; }; struct pci_driver { struct list_head node ; char const *name ; struct pci_device_id const *id_table ; int (*probe)(struct pci_dev * , struct pci_device_id const * ) ; void (*remove)(struct pci_dev * ) ; int (*suspend)(struct pci_dev * , pm_message_t ) ; int (*suspend_late)(struct pci_dev * , pm_message_t ) ; int (*resume_early)(struct pci_dev * ) ; int (*resume)(struct pci_dev * ) ; void (*shutdown)(struct pci_dev * ) ; int (*sriov_configure)(struct pci_dev * , int ) ; struct pci_error_handlers const *err_handler ; struct device_driver driver ; struct pci_dynids dynids ; }; struct ipv6_stable_secret { bool initialized ; struct in6_addr secret ; }; 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 mldv1_unsolicited_report_interval ; __s32 mldv2_unsolicited_report_interval ; __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 accept_ra_from_local ; __s32 optimistic_dad ; __s32 use_optimistic ; __s32 mc_forwarding ; __s32 disable_ipv6 ; __s32 accept_dad ; __s32 force_tllao ; __s32 ndisc_notify ; __s32 suppress_frag_ndisc ; __s32 accept_ra_mtu ; struct ipv6_stable_secret stable_secret ; void *sysctl ; }; struct page_counter { atomic_long_t count ; unsigned long limit ; struct page_counter *parent ; unsigned long watermark ; unsigned long failcnt ; }; struct sock_filter { __u16 code ; __u8 jt ; __u8 jf ; __u32 k ; }; struct bpf_insn { __u8 code ; unsigned char dst_reg : 4 ; unsigned char src_reg : 4 ; __s16 off ; __s32 imm ; }; enum bpf_prog_type { BPF_PROG_TYPE_UNSPEC = 0, BPF_PROG_TYPE_SOCKET_FILTER = 1, BPF_PROG_TYPE_KPROBE = 2, BPF_PROG_TYPE_SCHED_CLS = 3, BPF_PROG_TYPE_SCHED_ACT = 4 } ; struct bpf_prog_aux; struct sock_fprog_kern { u16 len ; struct sock_filter *filter ; }; union __anonunion____missing_field_name_360 { struct sock_filter insns[0U] ; struct bpf_insn insnsi[0U] ; }; struct bpf_prog { u16 pages ; bool jited ; bool gpl_compatible ; u32 len ; enum bpf_prog_type type ; struct bpf_prog_aux *aux ; struct sock_fprog_kern *orig_prog ; unsigned int (*bpf_func)(struct sk_buff const * , struct bpf_insn const * ) ; union __anonunion____missing_field_name_360 __annonCompField102 ; }; struct sk_filter { atomic_t refcnt ; struct callback_head rcu ; struct bpf_prog *prog ; }; struct pollfd { int fd ; short events ; short revents ; }; struct poll_table_struct { void (*_qproc)(struct file * , wait_queue_head_t * , struct poll_table_struct * ) ; unsigned long _key ; }; struct nla_policy { u16 type ; u16 len ; }; struct rtnl_link_ops { struct list_head list ; char const *kind ; size_t priv_size ; void (*setup)(struct net_device * ) ; int maxtype ; struct nla_policy const *policy ; int (*validate)(struct nlattr ** , struct nlattr ** ) ; int (*newlink)(struct net * , struct net_device * , struct nlattr ** , struct nlattr ** ) ; int (*changelink)(struct net_device * , struct nlattr ** , struct nlattr ** ) ; void (*dellink)(struct net_device * , struct list_head * ) ; size_t (*get_size)(struct net_device const * ) ; int (*fill_info)(struct sk_buff * , struct net_device const * ) ; size_t (*get_xstats_size)(struct net_device const * ) ; int (*fill_xstats)(struct sk_buff * , struct net_device const * ) ; unsigned int (*get_num_tx_queues)(void) ; unsigned int (*get_num_rx_queues)(void) ; int slave_maxtype ; struct nla_policy const *slave_policy ; int (*slave_validate)(struct nlattr ** , struct nlattr ** ) ; int (*slave_changelink)(struct net_device * , struct net_device * , struct nlattr ** , struct nlattr ** ) ; size_t (*get_slave_size)(struct net_device const * , struct net_device const * ) ; int (*fill_slave_info)(struct sk_buff * , struct net_device const * , struct net_device const * ) ; struct net *(*get_link_net)(struct net_device const * ) ; }; struct neigh_table; struct neigh_parms { possible_net_t net ; struct net_device *dev ; struct list_head list ; int (*neigh_setup)(struct neighbour * ) ; void (*neigh_cleanup)(struct neighbour * ) ; struct neigh_table *tbl ; void *sysctl_table ; int dead ; atomic_t refcnt ; struct callback_head callback_head ; int reachable_time ; int data[13U] ; unsigned long data_state[1U] ; }; struct neigh_statistics { unsigned long allocs ; unsigned long destroys ; unsigned long hash_grows ; unsigned long res_failed ; unsigned long lookups ; unsigned long hits ; unsigned long rcv_probes_mcast ; unsigned long rcv_probes_ucast ; unsigned long periodic_gc_runs ; unsigned long forced_gc_runs ; unsigned long unres_discards ; }; struct neigh_ops; struct neighbour { struct neighbour *next ; struct neigh_table *tbl ; struct neigh_parms *parms ; unsigned long confirmed ; unsigned long updated ; rwlock_t lock ; atomic_t refcnt ; struct sk_buff_head arp_queue ; unsigned int arp_queue_len_bytes ; struct timer_list timer ; unsigned long used ; atomic_t probes ; __u8 flags ; __u8 nud_state ; __u8 type ; __u8 dead ; seqlock_t ha_lock ; unsigned char ha[32U] ; struct hh_cache hh ; int (*output)(struct neighbour * , struct sk_buff * ) ; struct neigh_ops const *ops ; struct callback_head rcu ; struct net_device *dev ; u8 primary_key[0U] ; }; struct neigh_ops { int family ; void (*solicit)(struct neighbour * , struct sk_buff * ) ; void (*error_report)(struct neighbour * , struct sk_buff * ) ; int (*output)(struct neighbour * , struct sk_buff * ) ; int (*connected_output)(struct neighbour * , struct sk_buff * ) ; }; struct pneigh_entry { struct pneigh_entry *next ; possible_net_t net ; struct net_device *dev ; u8 flags ; u8 key[0U] ; }; struct neigh_hash_table { struct neighbour **hash_buckets ; unsigned int hash_shift ; __u32 hash_rnd[4U] ; struct callback_head rcu ; }; struct neigh_table { int family ; int entry_size ; int key_len ; __be16 protocol ; __u32 (*hash)(void const * , struct net_device const * , __u32 * ) ; bool (*key_eq)(struct neighbour const * , void const * ) ; int (*constructor)(struct neighbour * ) ; int (*pconstructor)(struct pneigh_entry * ) ; void (*pdestructor)(struct pneigh_entry * ) ; void (*proxy_redo)(struct sk_buff * ) ; char *id ; struct neigh_parms parms ; struct list_head parms_list ; int gc_interval ; int gc_thresh1 ; int gc_thresh2 ; int gc_thresh3 ; unsigned long last_flush ; struct delayed_work gc_work ; struct timer_list proxy_timer ; struct sk_buff_head proxy_queue ; atomic_t entries ; rwlock_t lock ; unsigned long last_rand ; struct neigh_statistics *stats ; struct neigh_hash_table *nht ; struct pneigh_entry **phash_buckets ; }; struct dn_route; union __anonunion____missing_field_name_368 { struct dst_entry *next ; struct rtable *rt_next ; struct rt6_info *rt6_next ; struct dn_route *dn_next ; }; struct dst_entry { struct callback_head callback_head ; struct dst_entry *child ; struct net_device *dev ; struct dst_ops *ops ; unsigned long _metrics ; unsigned long expires ; struct dst_entry *path ; struct dst_entry *from ; struct xfrm_state *xfrm ; int (*input)(struct sk_buff * ) ; int (*output)(struct sock * , struct sk_buff * ) ; unsigned short flags ; unsigned short pending_confirm ; short error ; short obsolete ; unsigned short header_len ; unsigned short trailer_len ; __u32 tclassid ; long __pad_to_align_refcnt[2U] ; atomic_t __refcnt ; int __use ; unsigned long lastuse ; union __anonunion____missing_field_name_368 __annonCompField103 ; }; struct __anonstruct_socket_lock_t_369 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_369 socket_lock_t; struct proto; typedef __u32 __portpair; typedef __u64 __addrpair; struct __anonstruct____missing_field_name_371 { __be32 skc_daddr ; __be32 skc_rcv_saddr ; }; union __anonunion____missing_field_name_370 { __addrpair skc_addrpair ; struct __anonstruct____missing_field_name_371 __annonCompField104 ; }; union __anonunion____missing_field_name_372 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; struct __anonstruct____missing_field_name_374 { __be16 skc_dport ; __u16 skc_num ; }; union __anonunion____missing_field_name_373 { __portpair skc_portpair ; struct __anonstruct____missing_field_name_374 __annonCompField107 ; }; union __anonunion____missing_field_name_375 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; union __anonunion____missing_field_name_376 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; struct sock_common { union __anonunion____missing_field_name_370 __annonCompField105 ; union __anonunion____missing_field_name_372 __annonCompField106 ; union __anonunion____missing_field_name_373 __annonCompField108 ; unsigned short skc_family ; unsigned char volatile skc_state ; unsigned char skc_reuse : 4 ; unsigned char skc_reuseport : 1 ; unsigned char skc_ipv6only : 1 ; unsigned char skc_net_refcnt : 1 ; int skc_bound_dev_if ; union __anonunion____missing_field_name_375 __annonCompField109 ; struct proto *skc_prot ; possible_net_t skc_net ; struct in6_addr skc_v6_daddr ; struct in6_addr skc_v6_rcv_saddr ; atomic64_t skc_cookie ; int skc_dontcopy_begin[0U] ; union __anonunion____missing_field_name_376 __annonCompField110 ; int skc_tx_queue_mapping ; atomic_t skc_refcnt ; int skc_dontcopy_end[0U] ; }; struct cg_proto; struct __anonstruct_sk_backlog_377 { 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_377 sk_backlog ; int sk_forward_alloc ; __u32 sk_rxhash ; u16 sk_incoming_cpu ; __u32 sk_txhash ; unsigned int sk_napi_id ; unsigned int sk_ll_usec ; atomic_t sk_drops ; int sk_rcvbuf ; struct sk_filter *sk_filter ; struct socket_wq *sk_wq ; struct xfrm_policy *sk_policy[2U] ; unsigned long sk_flags ; struct dst_entry *sk_rx_dst ; struct dst_entry *sk_dst_cache ; spinlock_t sk_dst_lock ; atomic_t sk_wmem_alloc ; atomic_t sk_omem_alloc ; int sk_sndbuf ; struct sk_buff_head sk_write_queue ; unsigned char sk_shutdown : 2 ; unsigned char sk_no_check_tx : 1 ; unsigned char sk_no_check_rx : 1 ; unsigned char sk_userlocks : 4 ; unsigned char sk_protocol ; unsigned short sk_type ; int sk_wmem_queued ; gfp_t sk_allocation ; u32 sk_pacing_rate ; u32 sk_max_pacing_rate ; netdev_features_t sk_route_caps ; netdev_features_t sk_route_nocaps ; int sk_gso_type ; unsigned int sk_gso_max_size ; u16 sk_gso_max_segs ; int sk_rcvlowat ; unsigned long sk_lingertime ; struct sk_buff_head sk_error_queue ; struct proto *sk_prot_creator ; rwlock_t sk_callback_lock ; int sk_err ; int sk_err_soft ; u32 sk_ack_backlog ; u32 sk_max_ack_backlog ; __u32 sk_priority ; __u32 sk_cgrp_prioidx ; struct pid *sk_peer_pid ; struct cred const *sk_peer_cred ; long sk_rcvtimeo ; long sk_sndtimeo ; struct timer_list sk_timer ; ktime_t sk_stamp ; u16 sk_tsflags ; u32 sk_tskey ; struct socket *sk_socket ; void *sk_user_data ; struct page_frag sk_frag ; struct sk_buff *sk_send_head ; __s32 sk_peek_off ; int sk_write_pending ; void *sk_security ; __u32 sk_mark ; u32 sk_classid ; struct cg_proto *sk_cgrp ; void (*sk_state_change)(struct sock * ) ; void (*sk_data_ready)(struct sock * ) ; void (*sk_write_space)(struct sock * ) ; void (*sk_error_report)(struct sock * ) ; int (*sk_backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*sk_destruct)(struct sock * ) ; }; struct request_sock_ops; struct timewait_sock_ops; struct inet_hashinfo; struct raw_hashinfo; struct udp_table; union __anonunion_h_380 { struct inet_hashinfo *hashinfo ; struct udp_table *udp_table ; struct raw_hashinfo *raw_hash ; }; struct proto { void (*close)(struct sock * , long ) ; int (*connect)(struct sock * , struct sockaddr * , int ) ; int (*disconnect)(struct sock * , int ) ; struct sock *(*accept)(struct sock * , int , int * ) ; int (*ioctl)(struct sock * , int , unsigned long ) ; int (*init)(struct sock * ) ; void (*destroy)(struct sock * ) ; void (*shutdown)(struct sock * , int ) ; int (*setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_ioctl)(struct sock * , unsigned int , unsigned long ) ; int (*sendmsg)(struct sock * , struct msghdr * , size_t ) ; int (*recvmsg)(struct sock * , struct msghdr * , size_t , int , int , int * ) ; int (*sendpage)(struct sock * , struct page * , int , size_t , int ) ; int (*bind)(struct sock * , struct sockaddr * , int ) ; int (*backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*release_cb)(struct sock * ) ; void (*hash)(struct sock * ) ; void (*unhash)(struct sock * ) ; void (*rehash)(struct sock * ) ; int (*get_port)(struct sock * , unsigned short ) ; void (*clear_sk)(struct sock * , int ) ; unsigned int inuse_idx ; bool (*stream_memory_free)(struct sock const * ) ; void (*enter_memory_pressure)(struct sock * ) ; atomic_long_t *memory_allocated ; struct percpu_counter *sockets_allocated ; int *memory_pressure ; long *sysctl_mem ; int *sysctl_wmem ; int *sysctl_rmem ; int max_header ; bool no_autobind ; struct kmem_cache *slab ; unsigned int obj_size ; int slab_flags ; struct percpu_counter *orphan_count ; struct request_sock_ops *rsk_prot ; struct timewait_sock_ops *twsk_prot ; union __anonunion_h_380 h ; struct module *owner ; char name[32U] ; struct list_head node ; int (*init_cgroup)(struct mem_cgroup * , struct cgroup_subsys * ) ; void (*destroy_cgroup)(struct mem_cgroup * ) ; struct cg_proto *(*proto_cgroup)(struct mem_cgroup * ) ; }; struct cg_proto { struct page_counter memory_allocated ; struct percpu_counter sockets_allocated ; int memory_pressure ; long sysctl_mem[3U] ; unsigned long flags ; struct mem_cgroup *memcg ; }; struct request_sock_ops { int family ; int obj_size ; struct kmem_cache *slab ; char *slab_name ; int (*rtx_syn_ack)(struct sock * , struct request_sock * ) ; 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 request_sock const * ) ; }; struct request_sock { struct sock_common __req_common ; struct request_sock *dl_next ; struct sock *rsk_listener ; u16 mss ; u8 num_retrans ; unsigned char cookie_ts : 1 ; unsigned char num_timeout : 7 ; u32 window_clamp ; u32 rcv_wnd ; u32 ts_recent ; struct timer_list rsk_timer ; struct request_sock_ops const *rsk_ops ; struct sock *sk ; u32 *saved_syn ; 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 * ) ; }; 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 ip6_sf_list { struct ip6_sf_list *sf_next ; struct in6_addr sf_addr ; unsigned long sf_count[2U] ; unsigned char sf_gsresp ; unsigned char sf_oldin ; unsigned char sf_crcount ; }; struct ifmcaddr6 { struct in6_addr mca_addr ; struct inet6_dev *idev ; struct ifmcaddr6 *next ; struct ip6_sf_list *mca_sources ; struct ip6_sf_list *mca_tomb ; unsigned int mca_sfmode ; unsigned char mca_crcount ; unsigned long mca_sfcount[2U] ; struct timer_list mca_timer ; unsigned int mca_flags ; int mca_users ; atomic_t mca_refcnt ; spinlock_t mca_lock ; unsigned long mca_cstamp ; unsigned long mca_tstamp ; }; struct ifacaddr6 { struct in6_addr aca_addr ; struct inet6_dev *aca_idev ; struct rt6_info *aca_rt ; struct ifacaddr6 *aca_next ; int aca_users ; atomic_t aca_refcnt ; unsigned long aca_cstamp ; unsigned long aca_tstamp ; }; struct ipv6_devstat { struct proc_dir_entry *proc_dir_entry ; struct ipstats_mib *ipv6 ; struct icmpv6_mib_device *icmpv6dev ; struct icmpv6msg_mib_device *icmpv6msgdev ; }; struct inet6_dev { struct net_device *dev ; struct list_head addr_list ; struct ifmcaddr6 *mc_list ; struct ifmcaddr6 *mc_tomb ; spinlock_t mc_lock ; unsigned char mc_qrv ; unsigned char mc_gq_running ; unsigned char mc_ifc_count ; unsigned char mc_dad_count ; unsigned long mc_v1_seen ; unsigned long mc_qi ; unsigned long mc_qri ; unsigned long mc_maxdelay ; struct timer_list mc_gq_timer ; struct timer_list mc_ifc_timer ; struct timer_list mc_dad_timer ; struct ifacaddr6 *ac_list ; rwlock_t lock ; atomic_t refcnt ; __u32 if_flags ; int dead ; u8 rndid[8U] ; struct timer_list regen_timer ; struct list_head tempaddr_list ; struct in6_addr token ; struct neigh_parms *nd_parms ; struct ipv6_devconf cnf ; struct ipv6_devstat stats ; struct timer_list rs_timer ; __u8 rs_probes ; __u8 addr_gen_mode ; unsigned long tstamp ; struct callback_head rcu ; }; union __anonunion____missing_field_name_399 { __be32 a4 ; __be32 a6[4U] ; struct in6_addr in6 ; }; struct inetpeer_addr_base { union __anonunion____missing_field_name_399 __annonCompField112 ; }; struct inetpeer_addr { struct inetpeer_addr_base addr ; __u16 family ; }; union __anonunion____missing_field_name_400 { struct list_head gc_list ; struct callback_head gc_rcu ; }; struct __anonstruct____missing_field_name_402 { atomic_t rid ; }; union __anonunion____missing_field_name_401 { struct __anonstruct____missing_field_name_402 __annonCompField114 ; struct callback_head rcu ; struct inet_peer *gc_next ; }; struct inet_peer { struct inet_peer *avl_left ; struct inet_peer *avl_right ; struct inetpeer_addr daddr ; __u32 avl_height ; u32 metrics[16U] ; u32 rate_tokens ; unsigned long rate_last ; union __anonunion____missing_field_name_400 __annonCompField113 ; union __anonunion____missing_field_name_401 __annonCompField115 ; __u32 dtime ; atomic_t refcnt ; }; struct inet_peer_base { struct inet_peer *root ; seqlock_t lock ; int total ; }; struct uncached_list; struct rtable { struct dst_entry dst ; int rt_genid ; unsigned int rt_flags ; __u16 rt_type ; __u8 rt_is_input ; __u8 rt_uses_gateway ; int rt_iif ; __be32 rt_gateway ; u32 rt_pmtu ; struct list_head rt_uncached ; struct uncached_list *rt_uncached_list ; }; struct ibnl_client_cbs { int (*dump)(struct sk_buff * , struct netlink_callback * ) ; struct module *module ; }; struct inet_ehash_bucket { struct hlist_nulls_head chain ; }; struct inet_bind_hashbucket { spinlock_t lock ; struct hlist_head chain ; }; struct inet_listen_hashbucket { spinlock_t lock ; struct hlist_nulls_head head ; }; struct inet_hashinfo { struct inet_ehash_bucket *ehash ; spinlock_t *ehash_locks ; unsigned int ehash_mask ; unsigned int ehash_locks_mask ; struct inet_bind_hashbucket *bhash ; unsigned int bhash_size ; struct kmem_cache *bind_bucket_cachep ; struct inet_listen_hashbucket listening_hash[32U] ; }; struct net_lro_stats { unsigned long aggregated ; unsigned long flushed ; unsigned long no_desc ; }; struct net_lro_desc { struct sk_buff *parent ; struct sk_buff *last_skb ; struct skb_frag_struct *next_frag ; struct iphdr *iph ; struct tcphdr *tcph ; __wsum data_csum ; __be32 tcp_rcv_tsecr ; __be32 tcp_rcv_tsval ; __be32 tcp_ack ; u32 tcp_next_seq ; u32 skb_tot_frags_len ; u16 ip_tot_len ; u16 tcp_saw_tstamp ; __be16 tcp_window ; int pkt_aggr_cnt ; int vlan_packet ; int mss ; int active ; }; struct net_lro_mgr { struct net_device *dev ; struct net_lro_stats stats ; unsigned long features ; u32 ip_summed ; u32 ip_summed_aggr ; int max_desc ; int max_aggr ; int frag_align_pad ; struct net_lro_desc *lro_arr ; int (*get_skb_header)(struct sk_buff * , void ** , void ** , u64 * , void * ) ; int (*get_frag_header)(struct skb_frag_struct * , void ** , void ** , void ** , u64 * , void * ) ; }; struct nes_device; struct nes_hw_nic_sq_wqe { __le32 wqe_words[16U] ; }; struct nes_hw_nic_rq_wqe { __le32 wqe_words[16U] ; }; struct nes_hw_nic_cqe { __le32 cqe_words[4U] ; }; struct nes_hw_cqp_wqe { __le32 wqe_words[16U] ; }; struct nes_hw_qp_wqe { __le32 wqe_words[32U] ; }; struct nes_hw_cqe { __le32 cqe_words[8U] ; }; struct nes_hw_ceqe { __le32 ceqe_words[2U] ; }; struct nes_hw_aeqe { __le32 aeqe_words[4U] ; }; union __anonunion____missing_field_name_410 { u64 cqp_callback_context ; void *cqp_callback_pointer ; }; struct nes_cqp_request { union __anonunion____missing_field_name_410 __annonCompField119 ; wait_queue_head_t waitq ; struct nes_hw_cqp_wqe cqp_wqe ; struct list_head list ; atomic_t refcount ; void (*cqp_callback)(struct nes_device * , struct nes_cqp_request * ) ; u16 major_code ; u16 minor_code ; u8 waiting ; u8 request_done ; u8 dynamic ; u8 callback ; }; struct nes_hw_cqp { struct nes_hw_cqp_wqe *sq_vbase ; dma_addr_t sq_pbase ; spinlock_t lock ; wait_queue_head_t waitq ; u16 qp_id ; u16 sq_head ; u16 sq_tail ; u16 sq_size ; }; struct nes_first_frag { u8 buffer[128U] ; }; struct nes_hw_nic { struct nes_first_frag *first_frag_vbase ; struct nes_hw_nic_sq_wqe *sq_vbase ; struct nes_hw_nic_rq_wqe *rq_vbase ; struct sk_buff *tx_skb[512U] ; struct sk_buff *rx_skb[512U] ; dma_addr_t frag_paddr[512U] ; unsigned long first_frag_overflow[8U] ; dma_addr_t sq_pbase ; dma_addr_t rq_pbase ; u16 qp_id ; u16 sq_head ; u16 sq_tail ; u16 sq_size ; u16 rq_head ; u16 rq_tail ; u16 rq_size ; u8 replenishing_rq ; u8 reserved ; spinlock_t rq_lock ; }; struct nes_hw_nic_cq { struct nes_hw_nic_cqe volatile *cq_vbase ; void (*ce_handler)(struct nes_device * , struct nes_hw_nic_cq * ) ; dma_addr_t cq_pbase ; int rx_cqes_completed ; int cqe_allocs_pending ; int rx_pkts_indicated ; u16 cq_head ; u16 cq_size ; u16 cq_number ; u8 cqes_pending ; }; struct nes_hw_qp { struct nes_hw_qp_wqe *sq_vbase ; struct nes_hw_qp_wqe *rq_vbase ; void *q2_vbase ; dma_addr_t sq_pbase ; dma_addr_t rq_pbase ; dma_addr_t q2_pbase ; u32 qp_id ; u16 sq_head ; u16 sq_tail ; u16 sq_size ; u16 rq_head ; u16 rq_tail ; u16 rq_size ; u8 rq_encoded_size ; u8 sq_encoded_size ; }; struct nes_hw_cq { struct nes_hw_cqe *cq_vbase ; void (*ce_handler)(struct nes_device * , struct nes_hw_cq * ) ; dma_addr_t cq_pbase ; u16 cq_head ; u16 cq_size ; u16 cq_number ; }; struct nes_hw_ceq { struct nes_hw_ceqe volatile *ceq_vbase ; dma_addr_t ceq_pbase ; u16 ceq_head ; u16 ceq_size ; }; struct nes_hw_aeq { struct nes_hw_aeqe volatile *aeq_vbase ; dma_addr_t aeq_pbase ; u16 aeq_head ; u16 aeq_size ; }; struct nes_arp_entry { u32 ip_addr ; u8 mac_addr[6U] ; }; struct nes_hw_tune_timer { u16 threshold_low ; u16 threshold_target ; u16 threshold_high ; u16 timer_in_use ; u16 timer_in_use_old ; u16 timer_in_use_min ; u16 timer_in_use_max ; u8 timer_direction_upward ; u8 timer_direction_downward ; u16 cq_count_old ; u8 cq_direction_downward ; }; struct nes_qp; struct nes_adapter { u64 fw_ver ; unsigned long *allocated_qps ; unsigned long *allocated_cqs ; unsigned long *allocated_mrs ; unsigned long *allocated_pds ; unsigned long *allocated_arps ; struct nes_qp **qp_table ; struct workqueue_struct *work_q ; struct list_head list ; struct list_head active_listeners ; struct list_head nesvnic_list[4U] ; struct timer_list mh_timer ; struct timer_list lc_timer ; struct work_struct work ; spinlock_t resource_lock ; spinlock_t phy_lock ; spinlock_t pbl_lock ; spinlock_t periodic_timer_lock ; struct nes_arp_entry arp_table[4096U] ; struct nes_hw_ceq ceq[16U] ; struct nes_hw_aeq aeq[8U] ; struct nes_hw_tune_timer tune_timer ; unsigned long doorbell_start ; u32 hw_rev ; u32 vendor_id ; u32 vendor_part_id ; u32 device_cap_flags ; u32 tick_delta ; u32 timer_int_req ; u32 arp_table_size ; u32 next_arp_index ; u32 max_mr ; u32 max_256pbl ; u32 max_4kpbl ; u32 free_256pbl ; u32 free_4kpbl ; u32 max_mr_size ; u32 max_qp ; u32 next_qp ; u32 max_irrq ; u32 max_qp_wr ; u32 max_sge ; u32 max_cq ; u32 next_cq ; u32 max_cqe ; u32 max_pd ; u32 base_pd ; u32 next_pd ; u32 hte_index_mask ; u32 rx_pool_size ; u32 tx_pool_size ; u32 rx_threshold ; u32 tcp_timer_core_clk_divisor ; u32 iwarp_config ; u32 cm_config ; u32 sws_timer_config ; u32 tcp_config1 ; u32 wqm_wat ; u32 core_clock ; u32 firmware_version ; u32 eeprom_version ; u32 nic_rx_eth_route_err ; u32 et_rx_coalesce_usecs ; u32 et_rx_max_coalesced_frames ; u32 et_rx_coalesce_usecs_irq ; u32 et_rx_max_coalesced_frames_irq ; u32 et_pkt_rate_low ; u32 et_rx_coalesce_usecs_low ; u32 et_rx_max_coalesced_frames_low ; u32 et_pkt_rate_high ; u32 et_rx_coalesce_usecs_high ; u32 et_rx_max_coalesced_frames_high ; u32 et_rate_sample_interval ; u32 timer_int_limit ; u32 wqm_quanta ; u8 allow_unaligned_fpdus ; u32 mac_addr_low ; u16 mac_addr_high ; u16 firmware_eeprom_offset ; u16 software_eeprom_offset ; u16 max_irrq_wr ; u16 pd_config_size[4U] ; u16 pd_config_base[4U] ; u16 link_interrupt_count[4U] ; u8 crit_error_count[32U] ; u8 phy_index[4U] ; u8 mac_sw_state[4U] ; u8 mac_link_down[4U] ; u8 phy_type[4U] ; u8 log_port ; unsigned int devfn ; unsigned char bus_number ; unsigned char OneG_Mode ; unsigned char ref_count ; u8 netdev_count ; u8 netdev_max ; u8 port_count ; u8 virtwq ; u8 send_term_ok ; u8 et_use_adaptive_rx_coalesce ; u8 adapter_fcn_count ; u8 pft_mcast_map[48U] ; }; struct nes_ib_device; struct nes_ucontext; struct nes_vnic_mgt; struct nes_vnic { struct nes_ib_device *nesibdev ; u64 sq_full ; u64 tso_requests ; u64 segmented_tso_requests ; u64 linearized_skbs ; u64 tx_sw_dropped ; u64 endnode_nstat_rx_discard ; u64 endnode_nstat_rx_octets ; u64 endnode_nstat_rx_frames ; u64 endnode_nstat_tx_octets ; u64 endnode_nstat_tx_frames ; u64 endnode_ipv4_tcp_retransmits ; struct nes_device *nesdev ; struct net_device *netdev ; atomic_t rx_skbs_needed ; atomic_t rx_skb_timer_running ; int budget ; u32 msg_enable ; __be32 local_ipaddr ; struct napi_struct napi ; spinlock_t tx_lock ; struct timer_list rq_wqes_timer ; u32 nic_mem_size ; void *nic_vbase ; dma_addr_t nic_pbase ; struct nes_hw_nic nic ; struct nes_hw_nic_cq nic_cq ; u32 mcrq_qp_id ; struct nes_ucontext *mcrq_ucontext ; struct nes_cqp_request *(*get_cqp_request)(struct nes_device * ) ; void (*post_cqp_request)(struct nes_device * , struct nes_cqp_request * ) ; int (*mcrq_mcast_filter)(struct nes_vnic * , __u8 * ) ; struct net_device_stats netstats ; struct list_head list ; u16 max_frame_size ; u8 netdev_open ; u8 linkup ; u8 logical_port ; u8 netdev_index ; u8 perfect_filter_index ; u8 nic_index ; u8 qp_nic_index[4U] ; u8 next_qp_nic_index ; u8 of_device_registered ; u8 rdma_enabled ; u32 lro_max_aggr ; struct net_lro_mgr lro_mgr ; struct net_lro_desc lro_desc[32U] ; struct timer_list event_timer ; enum ib_event_type delayed_event ; enum ib_event_type last_dispatched_event ; spinlock_t port_ibevent_lock ; u32 mgt_mem_size ; void *mgt_vbase ; dma_addr_t mgt_pbase ; struct nes_vnic_mgt *mgtvnic[4U] ; struct task_struct *mgt_thread ; wait_queue_head_t mgt_wait_queue ; struct sk_buff_head mgt_skb_list ; }; struct nes_ib_device { struct ib_device ibdev ; struct nes_vnic *nesvnic ; u32 max_mr ; u32 max_qp ; u32 max_cq ; u32 max_pd ; u32 num_mr ; u32 num_qp ; u32 num_cq ; u32 num_pd ; }; struct nes_ucontext { struct ib_ucontext ibucontext ; struct nes_device *nesdev ; unsigned long mmap_wq_offset ; unsigned long mmap_cq_offset ; int index ; unsigned long allocated_doorbells[64U] ; u16 mmap_db_index[4096U] ; u16 first_free_db ; unsigned long allocated_wqs[64U] ; struct nes_qp *mmap_nesqp[4096U] ; u16 first_free_wq ; struct list_head cq_reg_mem_list ; struct list_head qp_reg_mem_list ; u32 mcrqf ; atomic_t usecnt ; }; struct nes_pd { struct ib_pd ibpd ; u16 pd_id ; atomic_t sqp_count ; u16 mmap_db_index ; }; struct nes_cq { struct ib_cq ibcq ; struct nes_hw_cq hw_cq ; u32 polled_completions ; u32 cq_mem_size ; spinlock_t lock ; u8 virtual_cq ; u8 pad[3U] ; u32 mcrqf ; }; struct nes_qp_context; struct nes_qp { struct ib_qp ibqp ; void *allocated_buffer ; struct iw_cm_id *cm_id ; struct nes_cq *nesscq ; struct nes_cq *nesrcq ; struct nes_pd *nespd ; void *cm_node ; void *ietf_frame ; u8 ietf_frame_size ; dma_addr_t ietf_frame_pbase ; struct ib_mr *lsmm_mr ; struct nes_hw_qp hwqp ; struct work_struct work ; enum ib_qp_state ibqp_state ; u32 iwarp_state ; u32 hte_index ; u32 last_aeq ; u32 qp_mem_size ; atomic_t refcount ; atomic_t close_timer_started ; u32 mmap_sq_db_index ; u32 mmap_rq_db_index ; spinlock_t lock ; spinlock_t pau_lock ; struct nes_qp_context *nesqp_context ; dma_addr_t nesqp_context_pbase ; void *pbl_vbase ; dma_addr_t pbl_pbase ; struct page *page ; struct timer_list terminate_timer ; enum ib_event_type terminate_eventtype ; struct sk_buff_head pau_list ; u32 pau_rcv_nxt ; unsigned char active_conn : 1 ; unsigned char skip_lsmm : 1 ; unsigned char user_mode : 1 ; unsigned char hte_added : 1 ; unsigned char flush_issued : 1 ; unsigned char destroyed : 1 ; unsigned char sig_all : 1 ; unsigned char pau_mode : 1 ; unsigned char rsvd ; u16 private_data_len ; u16 term_sq_flush_code ; u16 term_rq_flush_code ; u8 hw_iwarp_state ; u8 hw_tcp_state ; u8 term_flags ; u8 sq_kmapped ; u8 pau_busy ; u8 pau_pending ; u8 pau_state ; __u64 nesuqp_addr ; }; struct nes_qp_context { __le32 misc ; __le32 cqs ; __le32 sq_addr_low ; __le32 sq_addr_high ; __le32 rq_addr_low ; __le32 rq_addr_high ; __le32 misc2 ; __le16 tcpPorts[2U] ; __le32 ip0 ; __le32 ip1 ; __le32 ip2 ; __le32 ip3 ; __le32 mss ; __le32 arp_index_vlan ; __le32 tcp_state_flow_label ; __le32 pd_index_wscale ; __le32 keepalive ; u32 ts_recent ; u32 ts_age ; __le32 snd_nxt ; __le32 snd_wnd ; __le32 rcv_nxt ; __le32 rcv_wnd ; __le32 snd_max ; __le32 snd_una ; u32 srtt ; __le32 rttvar ; __le32 ssthresh ; __le32 cwnd ; __le32 snd_wl1 ; __le32 snd_wl2 ; __le32 max_snd_wnd ; __le32 ts_val_delta ; u32 retransmit ; u32 probe_cnt ; u32 hte_index ; __le32 q2_addr_low ; __le32 q2_addr_high ; __le32 ird_index ; u32 Rsvd3 ; __le32 ird_ord_sizes ; u32 mrkr_offset ; __le32 aeq_token_low ; __le32 aeq_token_high ; }; struct ietf_mpa_v1 { u8 key[16U] ; u8 flags ; u8 rev ; __be16 priv_data_len ; u8 priv_data[0U] ; }; struct ietf_rtr_msg { __be16 ctrl_ird ; __be16 ctrl_ord ; }; struct ietf_mpa_v2 { u8 key[16U] ; u8 flags ; u8 rev ; __be16 priv_data_len ; struct ietf_rtr_msg rtr_msg ; u8 priv_data[0U] ; }; struct nes_timer_entry { struct list_head list ; unsigned long timetosend ; struct sk_buff *skb ; u32 type ; u32 retrycount ; u32 retranscount ; u32 context ; u32 seq_num ; u32 send_retrans ; int close_when_complete ; struct net_device *netdev ; }; typedef u32 nes_addr_t; enum nes_cm_node_state { NES_CM_STATE_UNKNOWN = 0, NES_CM_STATE_INITED = 1, NES_CM_STATE_LISTENING = 2, NES_CM_STATE_SYN_RCVD = 3, NES_CM_STATE_SYN_SENT = 4, NES_CM_STATE_ONE_SIDE_ESTABLISHED = 5, NES_CM_STATE_ESTABLISHED = 6, NES_CM_STATE_ACCEPTING = 7, NES_CM_STATE_MPAREQ_SENT = 8, NES_CM_STATE_MPAREQ_RCVD = 9, NES_CM_STATE_MPAREJ_RCVD = 10, NES_CM_STATE_TSA = 11, NES_CM_STATE_FIN_WAIT1 = 12, NES_CM_STATE_FIN_WAIT2 = 13, NES_CM_STATE_CLOSE_WAIT = 14, NES_CM_STATE_TIME_WAIT = 15, NES_CM_STATE_LAST_ACK = 16, NES_CM_STATE_CLOSING = 17, NES_CM_STATE_LISTENER_DESTROYED = 18, NES_CM_STATE_CLOSED = 19 } ; enum mpa_frame_version { IETF_MPA_V1 = 1, IETF_MPA_V2 = 2 } ; enum send_rdma0 { SEND_RDMA_READ_ZERO = 1, SEND_RDMA_WRITE_ZERO = 2 } ; enum nes_cm_conn_type { NES_CM_IWARP_CONN_TYPE = 0 } ; struct nes_cm_tcp_context { u8 client ; u32 loc_seq_num ; u32 loc_ack_num ; u32 rem_ack_num ; u32 rcv_nxt ; u32 loc_id ; u32 rem_id ; u32 snd_wnd ; u32 max_snd_wnd ; u32 rcv_wnd ; u32 mss ; u8 snd_wscale ; u8 rcv_wscale ; struct nes_qp_context tsa_cntxt ; struct timeval sent_ts ; }; enum nes_cm_listener_state { NES_CM_LISTENER_PASSIVE_STATE = 1, NES_CM_LISTENER_ACTIVE_STATE = 2, NES_CM_LISTENER_EITHER_STATE = 3 } ; struct nes_cm_listener { struct list_head list ; struct nes_cm_core *cm_core ; u8 loc_mac[6U] ; nes_addr_t loc_addr ; nes_addr_t mapped_loc_addr ; u16 loc_port ; u16 mapped_loc_port ; struct iw_cm_id *cm_id ; enum nes_cm_conn_type conn_type ; atomic_t ref_count ; struct nes_vnic *nesvnic ; atomic_t pend_accepts_cnt ; int backlog ; enum nes_cm_listener_state listener_state ; u32 reused_node ; u8 tos ; }; union __anonunion____missing_field_name_412 { struct ietf_mpa_v1 mpa_frame ; struct ietf_mpa_v2 mpa_v2_frame ; u8 mpa_frame_buf[536U] ; }; struct nes_cm_node { nes_addr_t loc_addr ; nes_addr_t rem_addr ; nes_addr_t mapped_loc_addr ; nes_addr_t mapped_rem_addr ; u16 loc_port ; u16 rem_port ; u16 mapped_loc_port ; u16 mapped_rem_port ; u8 loc_mac[6U] ; u8 rem_mac[6U] ; enum nes_cm_node_state state ; struct nes_cm_tcp_context tcp_cntxt ; struct nes_cm_core *cm_core ; struct sk_buff_head resend_list ; atomic_t ref_count ; struct net_device *netdev ; struct nes_cm_node *loopbackpartner ; struct nes_timer_entry *send_entry ; struct nes_timer_entry *recv_entry ; spinlock_t retrans_list_lock ; enum send_rdma0 send_rdma0_op ; union __anonunion____missing_field_name_412 __annonCompField121 ; enum mpa_frame_version mpa_frame_rev ; u16 ird_size ; u16 ord_size ; u16 mpav2_ird_ord ; u16 mpa_frame_size ; struct iw_cm_id *cm_id ; struct list_head list ; int accelerated ; struct nes_cm_listener *listener ; enum nes_cm_conn_type conn_type ; struct nes_vnic *nesvnic ; int apbvt_set ; int accept_pend ; struct list_head timer_entry ; struct list_head reset_entry ; struct nes_qp *nesqp ; atomic_t passive_state ; u8 tos ; }; union __anonunion____missing_field_name_413 { struct iw_cm_id *cm_id ; struct net_device *netdev ; }; struct nes_cm_info { union __anonunion____missing_field_name_413 __annonCompField122 ; u16 loc_port ; u16 rem_port ; nes_addr_t loc_addr ; nes_addr_t rem_addr ; u16 mapped_loc_port ; u16 mapped_rem_port ; nes_addr_t mapped_loc_addr ; nes_addr_t mapped_rem_addr ; enum nes_cm_conn_type conn_type ; int backlog ; }; enum nes_cm_event_type { NES_CM_EVENT_UNKNOWN = 0, NES_CM_EVENT_ESTABLISHED = 1, NES_CM_EVENT_MPA_REQ = 2, NES_CM_EVENT_MPA_CONNECT = 3, NES_CM_EVENT_MPA_ACCEPT = 4, NES_CM_EVENT_MPA_REJECT = 5, NES_CM_EVENT_MPA_ESTABLISHED = 6, NES_CM_EVENT_CONNECTED = 7, NES_CM_EVENT_CLOSED = 8, NES_CM_EVENT_RESET = 9, NES_CM_EVENT_DROPPED_PKT = 10, NES_CM_EVENT_CLOSE_IMMED = 11, NES_CM_EVENT_CLOSE_HARD = 12, NES_CM_EVENT_CLOSE_CLEAN = 13, NES_CM_EVENT_ABORTED = 14, NES_CM_EVENT_SEND_FIRST = 15 } ; struct nes_cm_event { enum nes_cm_event_type type ; struct nes_cm_info cm_info ; struct work_struct event_work ; struct nes_cm_node *cm_node ; }; struct nes_cm_ops; struct nes_cm_core { enum nes_cm_node_state state ; atomic_t listen_node_cnt ; struct nes_cm_node listen_list ; spinlock_t listen_list_lock ; u32 mtu ; u32 free_tx_pkt_max ; u32 rx_pkt_posted ; atomic_t ht_node_cnt ; struct list_head connected_nodes ; spinlock_t ht_lock ; struct timer_list tcp_timer ; struct nes_cm_ops *api ; int (*post_event)(struct nes_cm_event * ) ; atomic_t events_posted ; struct workqueue_struct *event_wq ; struct workqueue_struct *disconn_wq ; atomic_t node_cnt ; u64 aborted_connects ; u32 options ; struct nes_cm_node *current_listen_node ; }; struct nes_cm_ops { int (*accelerated)(struct nes_cm_core * , struct nes_cm_node * ) ; struct nes_cm_listener *(*listen)(struct nes_cm_core * , struct nes_vnic * , struct nes_cm_info * ) ; int (*stop_listener)(struct nes_cm_core * , struct nes_cm_listener * ) ; struct nes_cm_node *(*connect)(struct nes_cm_core * , struct nes_vnic * , u16 , void * , struct nes_cm_info * ) ; int (*close)(struct nes_cm_core * , struct nes_cm_node * ) ; int (*accept)(struct nes_cm_core * , struct nes_cm_node * ) ; int (*reject)(struct nes_cm_core * , struct nes_cm_node * ) ; int (*recv_pkt)(struct nes_cm_core * , struct nes_vnic * , struct sk_buff * ) ; int (*destroy_cm_core)(struct nes_cm_core * ) ; int (*get)(struct nes_cm_core * ) ; int (*set)(struct nes_cm_core * , u32 , u32 ) ; }; struct nes_hw_mgt { struct nes_hw_nic_rq_wqe *rq_vbase ; dma_addr_t rq_pbase ; struct sk_buff *rx_skb[512U] ; u16 qp_id ; u16 sq_head ; u16 rq_head ; u16 rq_tail ; u16 rq_size ; u8 replenishing_rq ; u8 reserved ; spinlock_t rq_lock ; }; struct nes_vnic_mgt { struct nes_vnic *nesvnic ; struct nes_hw_mgt mgt ; struct nes_hw_nic_cq mgt_cq ; atomic_t rx_skbs_needed ; struct timer_list rq_wqes_timer ; atomic_t rx_skb_timer_running ; }; struct nes_device { struct nes_adapter *nesadapter ; void *regs ; void *index_reg ; struct pci_dev *pcidev ; struct net_device *netdev[16U] ; u64 link_status_interrupts ; struct tasklet_struct dpc_tasklet ; spinlock_t indexed_regs_lock ; unsigned long csr_start ; unsigned long doorbell_region ; unsigned long doorbell_start ; unsigned long mac_tx_errors ; unsigned long mac_pause_frames_sent ; unsigned long mac_pause_frames_received ; unsigned long mac_rx_errors ; unsigned long mac_rx_crc_errors ; unsigned long mac_rx_symbol_err_frames ; unsigned long mac_rx_jabber_frames ; unsigned long mac_rx_oversized_frames ; unsigned long mac_rx_short_frames ; unsigned long port_rx_discards ; unsigned long port_tx_discards ; unsigned int mac_index ; unsigned int nes_stack_start ; void *cqp_vbase ; dma_addr_t cqp_pbase ; u32 cqp_mem_size ; u8 ceq_index ; u8 nic_ceq_index ; struct nes_hw_cqp cqp ; struct nes_hw_cq ccq ; struct list_head cqp_avail_reqs ; struct list_head cqp_pending_reqs ; struct nes_cqp_request *nes_cqp_requests ; u32 int_req ; u32 int_stat ; u32 timer_int_req ; u32 timer_only_int_count ; u32 intf_int_req ; u32 last_mac_tx_pauses ; u32 last_used_chunks_tx ; struct list_head list ; u16 base_doorbell_index ; u16 currcq_count ; u16 deepcq_count ; u8 iw_status ; u8 msi_enabled ; u8 netdev_count ; u8 napi_isr_ran ; u8 disable_rx_flow_control ; u8 disable_tx_flow_control ; struct delayed_work work ; u8 link_recheck ; }; struct fib_rule_hdr { __u8 family ; __u8 dst_len ; __u8 src_len ; __u8 tos ; __u8 table ; __u8 res1 ; __u8 res2 ; __u8 action ; __u32 flags ; }; struct fib_rule { struct list_head list ; int iifindex ; int oifindex ; u32 mark ; u32 mark_mask ; u32 flags ; u32 table ; u8 action ; u32 target ; struct fib_rule *ctarget ; struct net *fr_net ; atomic_t refcnt ; u32 pref ; int suppress_ifgroup ; int suppress_prefixlen ; char iifname[16U] ; char oifname[16U] ; struct callback_head rcu ; }; struct fib_lookup_arg { void *lookup_ptr ; void *result ; struct fib_rule *rule ; int flags ; }; struct fib_rules_ops { int family ; struct list_head list ; int rule_size ; int addr_size ; int unresolved_rules ; int nr_goto_rules ; int (*action)(struct fib_rule * , struct flowi * , int , struct fib_lookup_arg * ) ; bool (*suppress)(struct fib_rule * , struct fib_lookup_arg * ) ; int (*match)(struct fib_rule * , struct flowi * , int ) ; int (*configure)(struct fib_rule * , struct sk_buff * , struct fib_rule_hdr * , struct nlattr ** ) ; int (*delete)(struct fib_rule * ) ; int (*compare)(struct fib_rule * , struct fib_rule_hdr * , struct nlattr ** ) ; int (*fill)(struct fib_rule * , struct sk_buff * , struct fib_rule_hdr * ) ; u32 (*default_pref)(struct fib_rules_ops * ) ; size_t (*nlmsg_payload)(struct fib_rule * ) ; void (*flush_cache)(struct fib_rules_ops * ) ; int nlgroup ; struct nla_policy const *policy ; struct list_head rules_list ; struct module *owner ; struct net *fro_net ; struct callback_head rcu ; }; struct fib_table { struct hlist_node tb_hlist ; u32 tb_id ; int tb_default ; int tb_num_default ; struct callback_head rcu ; unsigned long *tb_data ; unsigned long __data[0U] ; }; typedef bool ldv_func_ret_type___2; typedef bool ldv_func_ret_type___3; typedef bool ldv_func_ret_type___4; typedef bool ldv_func_ret_type___5; typedef int ldv_func_ret_type___6; typedef int ldv_func_ret_type___7; typedef bool ldv_func_ret_type___8; typedef int ldv_func_ret_type___9; struct __wait_queue; typedef struct __wait_queue wait_queue_t; struct __wait_queue { unsigned int flags ; void *private ; int (*func)(wait_queue_t * , unsigned int , int , void * ) ; struct list_head task_list ; }; enum hrtimer_restart; enum skb_free_reason { SKB_REASON_CONSUMED = 0, SKB_REASON_DROPPED = 1 } ; struct nes_hw_nic_qp_context { __le32 context_words[6U] ; }; struct nes_hw_cqp_qp_context { __le32 context_words[4U] ; }; struct nes_terminate_hdr { u8 layer_etype ; u8 error_code ; u8 hdrct ; u8 rsvd ; }; enum nes_timer_type { NES_TIMER_TYPE_SEND = 0, NES_TIMER_TYPE_RECV = 1, NES_TIMER_NODE_CLEANUP = 2, NES_TIMER_TYPE_CLOSE = 3 } ; struct nes_rskb_cb { u64 busaddr ; u32 maplen ; u32 seqnum ; u8 *data_start ; struct nes_qp *nesqp ; }; typedef int ldv_func_ret_type___10; enum hrtimer_restart; typedef struct skb_frag_struct skb_frag_t; struct skb_shared_hwtstamps { ktime_t hwtstamp ; }; struct skb_shared_info { unsigned char nr_frags ; __u8 tx_flags ; unsigned short gso_size ; unsigned short gso_segs ; unsigned short gso_type ; struct sk_buff *frag_list ; struct skb_shared_hwtstamps hwtstamps ; u32 tskey ; __be32 ip6_frag_id ; atomic_t dataref ; void *destructor_arg ; skb_frag_t frags[17U] ; }; struct netdev_hw_addr { struct list_head list ; unsigned char addr[32U] ; unsigned char type ; bool global_use ; int sync_cnt ; int refcount ; int synced ; struct callback_head callback_head ; }; struct nic_qp_map { u8 qpid ; u8 nic_index ; u8 logical_port ; u8 is_hnic ; }; enum hrtimer_restart; enum nes_resource { NES_RESOURCE_MW = 1, NES_RESOURCE_FAST_MR = 2, NES_RESOURCE_PHYS_MR = 3, NES_RESOURCE_USER_MR = 4, NES_RESOURCE_PD = 5, NES_RESOURCE_QP = 6, NES_RESOURCE_CQ = 7, NES_RESOURCE_ARP = 8 } ; typedef __u64 __le64; typedef unsigned int uint; typedef __u16 uint16_t; enum page_cache_mode { _PAGE_CACHE_MODE_WB = 0, _PAGE_CACHE_MODE_WC = 1, _PAGE_CACHE_MODE_UC_MINUS = 2, _PAGE_CACHE_MODE_UC = 3, _PAGE_CACHE_MODE_WT = 4, _PAGE_CACHE_MODE_WP = 5, _PAGE_CACHE_MODE_NUM = 8 } ; struct cpuinfo_x86; struct cpuinfo_x86 { __u8 x86 ; __u8 x86_vendor ; __u8 x86_model ; __u8 x86_mask ; int x86_tlbsize ; __u8 x86_virt_bits ; __u8 x86_phys_bits ; __u8 x86_coreid_bits ; __u32 extended_cpuid_level ; int cpuid_level ; __u32 x86_capability[14U] ; char x86_vendor_id[16U] ; char x86_model_id[64U] ; int x86_cache_size ; int x86_cache_alignment ; int x86_cache_max_rmid ; int x86_cache_occ_scale ; int x86_power ; unsigned long loops_per_jiffy ; u16 x86_max_cores ; u16 apicid ; u16 initial_apicid ; u16 x86_clflush_size ; u16 booted_cores ; u16 phys_proc_id ; u16 cpu_core_id ; u8 compute_unit_id ; u16 cpu_index ; u32 microcode ; }; enum hrtimer_restart; struct nes_pbl { u64 *pbl_vbase ; dma_addr_t pbl_pbase ; struct page *page ; unsigned long user_base ; u32 pbl_size ; struct list_head list ; }; struct nes_fast_mr_wqe_pbl { u64 *kva ; dma_addr_t paddr ; }; struct nes_ib_fast_reg_page_list { struct ib_fast_reg_page_list ibfrpl ; struct nes_fast_mr_wqe_pbl nes_wqe_pbl ; u64 pbl ; }; union __anonunion____missing_field_name_424 { struct ib_mr ibmr ; struct ib_mw ibmw ; struct ib_fmr ibfmr ; }; struct nes_mr { union __anonunion____missing_field_name_424 __annonCompField126 ; struct ib_umem *region ; u16 pbls_used ; u8 mode ; u8 pbl_4k ; }; struct nes_hw_pb { __le32 pa_low ; __le32 pa_high ; }; struct nes_vpbl { dma_addr_t pbl_pbase ; struct nes_hw_pb *pbl_vbase ; }; struct nes_root_vpbl { dma_addr_t pbl_pbase ; struct nes_hw_pb *pbl_vbase ; struct nes_vpbl *leaf_vpbl ; }; struct nes_alloc_ucontext_req { __u32 reserved32 ; __u8 userspace_ver ; __u8 reserved8[3U] ; }; struct nes_alloc_ucontext_resp { __u32 max_pds ; __u32 max_qps ; __u32 wq_size ; __u8 virtwq ; __u8 kernel_ver ; __u8 reserved[2U] ; }; struct nes_alloc_pd_resp { __u32 pd_id ; __u32 mmap_db_index ; }; struct nes_create_cq_req { __u64 user_cq_buffer ; __u32 mcrqf ; __u8 reserved[4U] ; }; struct nes_create_qp_req { __u64 user_wqe_buffers ; __u64 user_qp_buffer ; }; struct nes_mem_reg_req { __u32 reg_type ; __u32 reserved ; }; struct nes_create_cq_resp { __u32 cq_id ; __u32 cq_size ; __u32 mmap_db_index ; __u32 reserved ; }; struct nes_create_qp_resp { __u32 qp_id ; __u32 actual_sq_size ; __u32 actual_rq_size ; __u32 mmap_sq_db_index ; __u32 mmap_rq_db_index ; __u32 nes_drv_opt ; }; struct ib_umem_odp; struct ib_umem { struct ib_ucontext *context ; size_t length ; unsigned long address ; int page_size ; int writable ; int hugetlb ; struct work_struct work ; struct pid *pid ; struct mm_struct *mm ; unsigned long diff ; struct ib_umem_odp *odp_data ; struct sg_table sg_head ; int nmap ; int npages ; }; typedef int pao_T__; typedef int pao_T_____0; enum hrtimer_restart; struct in_addr { __be32 s_addr ; }; struct sockaddr_in { __kernel_sa_family_t sin_family ; __be16 sin_port ; struct in_addr sin_addr ; unsigned char __pad[8U] ; }; struct iwpm_dev_data { char dev_name[32U] ; char if_name[16U] ; }; struct iwpm_sa_data { struct __kernel_sockaddr_storage loc_addr ; struct __kernel_sockaddr_storage mapped_loc_addr ; struct __kernel_sockaddr_storage rem_addr ; struct __kernel_sockaddr_storage mapped_rem_addr ; }; struct disconn_work { struct work_struct work ; struct nes_qp *nesqp ; }; struct nes_v4_quad { u32 rsvd0 ; __le32 DstIpAdrIndex ; __be32 SrcIpadr ; __be16 TcpPorts[2U] ; }; struct option_base { u8 optionnum ; u8 length ; }; struct option_mss { u8 optionnum ; u8 length ; __be16 mss ; }; struct option_windowscale { u8 optionnum ; u8 length ; u8 shiftcount ; }; union all_known_options { char as_end ; struct option_base as_base ; struct option_mss as_mss ; struct option_windowscale as_windowscale ; }; enum nes_tcpip_pkt_type { NES_PKT_TYPE_UNKNOWN = 0, NES_PKT_TYPE_SYN = 1, NES_PKT_TYPE_SYNACK = 2, NES_PKT_TYPE_ACK = 3, NES_PKT_TYPE_FIN = 4, NES_PKT_TYPE_RST = 5 } ; typedef int ldv_func_ret_type___11; enum hrtimer_restart; struct pau_fpdu_frag { struct sk_buff *skb ; u64 physaddr ; u32 frag_len ; bool cmplt ; }; struct pau_fpdu_info { struct nes_qp *nesqp ; struct nes_cqp_request *cqp_request ; void *hdr_vbase ; dma_addr_t hdr_pbase ; int hdr_len ; u16 data_len ; u16 frag_cnt ; struct pau_fpdu_frag frags[4U] ; }; struct pau_qh_chg { struct nes_device *nesdev ; struct nes_vnic *nesvnic ; struct nes_qp *nesqp ; }; __inline static long ldv__builtin_expect(long exp , long c ) ; extern struct module __this_module ; __inline static void set_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void clear_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } __inline static int test_and_set_bit(long nr , unsigned long volatile *addr ) { char c ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %2, %0; setc %1": "+m" (*addr), "=qm" (c): "Ir" (nr): "memory"); return ((int )((signed char )c) != 0); } } __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); } } extern int printk(char const * , ...) ; extern int kstrtoull(char const * , unsigned int , unsigned long long * ) ; __inline static int kstrtoul(char const *s , unsigned int base , unsigned long *res ) { int tmp ; { tmp = kstrtoull(s, base, (unsigned long long *)res); return (tmp); } } extern unsigned long simple_strtoul(char const * , char ** , unsigned int ) ; extern int snprintf(char * , size_t , char const * , ...) ; void ldv_spin_lock(void) ; void ldv_spin_unlock(void) ; extern void *malloc(size_t ) ; extern void *calloc(size_t , size_t ) ; extern void *memset(void * , int , size_t ) ; extern int __VERIFIER_nondet_int(void) ; extern unsigned long __VERIFIER_nondet_ulong(void) ; extern void *__VERIFIER_nondet_pointer(void) ; extern void __VERIFIER_assume(int ) ; void *ldv_malloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = malloc(size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_zalloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_init_zalloc(size_t size ) { void *p ; void *tmp ; { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } void *ldv_memset(void *s , int c , size_t n ) { void *tmp ; { tmp = memset(s, c, n); return (tmp); } } int ldv_undef_int(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); return (tmp); } } void *ldv_undef_ptr(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); return (tmp); } } unsigned long ldv_undef_ulong(void) { unsigned long tmp ; { tmp = __VERIFIER_nondet_ulong(); return (tmp); } } __inline static void ldv_stop(void) { { LDV_STOP: ; goto LDV_STOP; } } __inline static long ldv__builtin_expect(long exp , long c ) { { return (exp); } } __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add_tail(struct list_head *new , struct list_head *head ) { { __list_add(new, head->prev, head); return; } } extern void list_del(struct list_head * ) ; extern __kernel_size_t strnlen(char const * , __kernel_size_t ) ; __inline static int atomic_read(atomic_t const *v ) { int __var ; { __var = 0; return ((int )*((int const volatile *)(& v->counter))); } } __inline static void atomic_inc(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; incl %0": "+m" (v->counter)); return; } } __inline static int atomic_dec_and_test(atomic_t *v ) { char c ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decl %0; sete %1": "+m" (v->counter), "=qm" (c): : "memory"); return ((int )((signed char )c) != 0); } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void _raw_spin_unlock_irqrestore(raw_spinlock_t * , unsigned long ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->__annonCompField18.rlock); } } __inline static void ldv_spin_unlock_irqrestore_12(spinlock_t *lock , unsigned long flags ) { { _raw_spin_unlock_irqrestore(& lock->__annonCompField18.rlock, flags); return; } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) ; extern void init_timer_key(struct timer_list * , unsigned int , char const * , struct lock_class_key * ) ; extern void delayed_work_timer_fn(unsigned long ) ; extern void __init_work(struct work_struct * , int ) ; extern bool queue_work_on(int , struct workqueue_struct * , struct work_struct * ) ; bool ldv_queue_work_on_15(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_17(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; extern bool queue_delayed_work_on(int , struct workqueue_struct * , struct delayed_work * , unsigned long ) ; bool ldv_queue_delayed_work_on_16(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_19(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; extern void flush_workqueue(struct workqueue_struct * ) ; void ldv_flush_workqueue_18(struct workqueue_struct *ldv_func_arg1 ) ; extern bool cancel_delayed_work_sync(struct delayed_work * ) ; bool ldv_cancel_delayed_work_sync_49(struct delayed_work *ldv_func_arg1 ) ; __inline static unsigned int readl(void const volatile *addr ) { unsigned int ret ; { __asm__ volatile ("movl %1,%0": "=r" (ret): "m" (*((unsigned int volatile *)addr)): "memory"); return (ret); } } __inline static void writel(unsigned int val , void volatile *addr ) { { __asm__ volatile ("movl %0,%1": : "r" (val), "m" (*((unsigned int volatile *)addr)): "memory"); return; } } extern void *ioremap_nocache(resource_size_t , unsigned long ) ; extern void iounmap(void volatile * ) ; __inline static char const *kobject_name(struct kobject const *kobj ) { { return ((char const *)kobj->name); } } extern void kfree(void const * ) ; void *ldv_kmem_cache_alloc_25(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_42(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; void ldv_check_alloc_flags(gfp_t flags ) ; int ldv_timer_state_5 = 0; int ldv_state_variable_20 ; int pci_counter ; struct work_struct *ldv_work_struct_3_1 ; int ldv_state_variable_30 ; int ldv_state_variable_0 ; int ldv_state_variable_12 ; int ldv_state_variable_22 ; int ldv_state_variable_14 ; int ldv_state_variable_29 ; int ldv_state_variable_17 ; struct work_struct *ldv_work_struct_2_0 ; struct timer_list *ldv_timer_list_11 ; int ldv_timer_state_7 = 0; int ldv_state_variable_19 ; struct work_struct *ldv_work_struct_4_3 ; int ldv_state_variable_27 ; int ldv_state_variable_9 ; struct work_struct *ldv_work_struct_2_2 ; struct ethtool_cmd *nes_ethtool_ops_group1 ; struct timer_list *ldv_timer_list_8 ; int ref_cnt ; int ldv_irq_line_1_1 ; int ldv_work_3_3 ; struct work_struct *ldv_work_struct_4_0 ; struct pci_dev *nes_pci_driver_group1 ; int ldv_state_variable_7 ; struct device_driver *driver_attr_idx_data_group0 ; int ldv_state_variable_23 ; struct work_struct *ldv_work_struct_3_3 ; struct nes_cm_core *nes_cm_api_group2 ; struct device_driver *driver_attr_nonidx_addr_group0 ; int ldv_irq_1_3 = 0; struct nes_cm_info *nes_cm_api_group3 ; int ldv_timer_state_8 = 0; struct ethtool_pauseparam *nes_ethtool_ops_group3 ; struct timer_list *ldv_timer_list_6 ; struct work_struct *ldv_work_struct_2_1 ; int ldv_work_4_0 ; struct work_struct *ldv_work_struct_3_2 ; int ldv_state_variable_6 ; void *ldv_irq_data_1_0 ; void *ldv_irq_data_1_3 ; int ldv_state_variable_26 ; struct work_struct *ldv_work_struct_4_2 ; int ldv_state_variable_28 ; struct nes_vnic *nes_cm_api_group0 ; int LDV_IN_INTERRUPT = 1; int ldv_irq_1_1 = 0; struct device_driver *driver_attr_flash_data_group0 ; int ldv_state_variable_3 ; int ldv_irq_line_1_0 ; int ldv_state_variable_31 ; int ldv_state_variable_4 ; int ldv_work_2_1 ; struct timer_list *ldv_timer_list_5 ; int ldv_state_variable_8 ; int ldv_state_variable_15 ; struct device_driver *driver_attr_eeprom_data_group0 ; int ldv_timer_state_11 = 0; int ldv_state_variable_5 ; int ldv_state_variable_21 ; struct device_driver *driver_attr_eeprom_cmd_group0 ; int ldv_state_variable_13 ; int ldv_work_3_2 ; int ldv_timer_state_9 = 0; int ldv_work_3_0 ; struct work_struct *ldv_work_struct_2_3 ; int ldv_timer_state_6 = 0; int ldv_state_variable_24 ; struct device_driver *driver_attr_nonidx_data_group0 ; struct device_driver *driver_attr_wqm_quanta_group0 ; struct ethtool_coalesce *nes_ethtool_ops_group0 ; struct timer_list *ldv_timer_list_10 ; int ldv_state_variable_1 ; int ldv_irq_line_1_2 ; struct timer_list *ldv_timer_list_7 ; struct net_device *nes_ethtool_ops_group2 ; int ldv_timer_state_10 = 0; void *ldv_irq_data_1_1 ; int ldv_state_variable_10 ; int ldv_irq_1_0 = 0; int ldv_work_4_1 ; int ldv_work_4_3 ; int ldv_work_3_1 ; int ldv_state_variable_16 ; int ldv_state_variable_2 ; int ldv_state_variable_25 ; int ldv_work_2_0 ; void *ldv_irq_data_1_2 ; struct timer_list *ldv_timer_list_9 ; struct work_struct *ldv_work_struct_3_0 ; int ldv_work_4_2 ; int ldv_state_variable_11 ; int ldv_irq_1_2 = 0; struct net_device *nes_netdev_ops_group1 ; int ldv_state_variable_18 ; struct device_driver *driver_attr_idx_addr_group0 ; int ldv_irq_line_1_3 ; struct device_driver *driver_attr_adapter_group0 ; struct device_driver *driver_attr_flash_cmd_group0 ; int ldv_work_2_2 ; struct work_struct *ldv_work_struct_4_1 ; struct nes_cm_node *nes_cm_api_group1 ; int ldv_work_2_3 ; void work_init_3(void) ; void ldv_initialize_driver_attribute_24(void) ; void call_and_disable_all_2(int state ) ; int reg_check_1(irqreturn_t (*handler)(int , void * ) ) ; void ldv_initialize_driver_attribute_26(void) ; void ldv_initialize_nes_cm_ops_12(void) ; void ldv_initialize_driver_attribute_23(void) ; void disable_suitable_irq_1(int line , void *data ) ; void activate_suitable_irq_1(int line , void *data ) ; void ldv_initialize_ethtool_ops_18(void) ; void ldv_initialize_driver_attribute_21(void) ; void invoke_work_2(void) ; void ldv_initialize_driver_attribute_20(void) ; void work_init_2(void) ; void ldv_net_device_ops_17(void) ; void ldv_initialize_driver_attribute_25(void) ; void activate_work_2(struct work_struct *work , int state ) ; void ldv_initialize_driver_attribute_19(void) ; void choose_interrupt_1(void) ; void disable_work_2(struct work_struct *work ) ; void work_init_4(void) ; void ldv_initialize_driver_attribute_28(void) ; int ldv_irq_1(int state , int line , void *data ) ; void ldv_pci_driver_29(void) ; void ldv_initialize_driver_attribute_27(void) ; void call_and_disable_work_2(struct work_struct *work ) ; void ldv_initialize_driver_attribute_22(void) ; extern int driver_create_file(struct device_driver * , struct driver_attribute const * ) ; extern void driver_remove_file(struct device_driver * , struct driver_attribute const * ) ; __inline static char const *dev_name(struct device const *dev ) { char const *tmp ; { if ((unsigned long )dev->init_name != (unsigned long )((char const */* const */)0)) { return ((char const *)dev->init_name); } else { } tmp = kobject_name(& dev->kobj); return (tmp); } } __inline static void *dev_get_drvdata(struct device const *dev ) { { return ((void *)dev->driver_data); } } __inline static void dev_set_drvdata(struct device *dev , void *data ) { { dev->driver_data = data; return; } } extern int dma_supported(struct device * , u64 ) ; extern int dma_set_mask(struct device * , u64 ) ; extern void dma_free_attrs(struct device * , size_t , void * , dma_addr_t , struct dma_attrs * ) ; __inline static int dma_set_coherent_mask(struct device *dev , u64 mask ) { int tmp ; { tmp = dma_supported(dev, mask); if (tmp == 0) { return (-5); } else { } dev->coherent_dma_mask = mask; return (0); } } struct sk_buff *ldv_skb_clone_33(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_41(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_35(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_31(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_39(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_40(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_36(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_37(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_38(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; extern int request_threaded_irq(unsigned int , irqreturn_t (*)(int , void * ) , irqreturn_t (*)(int , void * ) , unsigned long , char const * , void * ) ; __inline static int request_irq(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { int tmp ; { tmp = request_threaded_irq(irq, handler, (irqreturn_t (*)(int , void * ))0, flags, name, dev); return (tmp); } } __inline static int ldv_request_irq_43(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; extern void free_irq(unsigned int , void * ) ; void ldv_free_irq_46(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; void ldv_free_irq_48(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; extern void __tasklet_schedule(struct tasklet_struct * ) ; __inline static void tasklet_schedule(struct tasklet_struct *t ) { int tmp ; { tmp = test_and_set_bit(0L, (unsigned long volatile *)(& t->state)); if (tmp == 0) { __tasklet_schedule(t); } else { } return; } } extern void tasklet_kill(struct tasklet_struct * ) ; extern void tasklet_init(struct tasklet_struct * , void (*)(unsigned long ) , unsigned long ) ; __inline static struct netdev_queue *netdev_get_tx_queue(struct net_device const *dev , unsigned int index ) { { return ((struct netdev_queue *)dev->_tx + (unsigned long )index); } } __inline static void *netdev_priv(struct net_device const *dev ) { { return ((void *)dev + 3008U); } } __inline static void netif_tx_stop_queue(struct netdev_queue *dev_queue ) { { set_bit(0L, (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 int register_netdev(struct net_device * ) ; int ldv_register_netdev_44(struct net_device *dev ) ; extern void unregister_netdev(struct net_device * ) ; void ldv_unregister_netdev_45(struct net_device *dev ) ; void ldv_unregister_netdev_47(struct net_device *dev ) ; extern struct net_device *netdev_master_upper_dev_get(struct net_device * ) ; __inline static bool netif_is_bond_slave(struct net_device *dev ) { { return ((bool )((dev->flags & 2048U) != 0U && (dev->priv_flags & 32U) != 0U)); } } extern int register_inetaddr_notifier(struct notifier_block * ) ; extern int unregister_inetaddr_notifier(struct notifier_block * ) ; extern int pci_bus_read_config_byte(struct pci_bus * , unsigned int , int , u8 * ) ; __inline static int pci_read_config_byte(struct pci_dev const *dev , int where , u8 *val ) { int tmp ; { tmp = pci_bus_read_config_byte(dev->bus, dev->devfn, where, val); return (tmp); } } extern int pci_enable_device(struct pci_dev * ) ; extern void pci_disable_device(struct pci_dev * ) ; extern void pci_set_master(struct pci_dev * ) ; extern int pcie_get_readrq(struct pci_dev * ) ; extern int pcie_set_readrq(struct pci_dev * , int ) ; extern int pci_request_regions(struct pci_dev * , char const * ) ; extern void pci_release_regions(struct pci_dev * ) ; extern int __pci_register_driver(struct pci_driver * , struct module * , char const * ) ; int ldv___pci_register_driver_50(struct pci_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) ; extern void pci_unregister_driver(struct pci_driver * ) ; void ldv_pci_unregister_driver_51(struct pci_driver *ldv_func_arg1 ) ; extern void pci_disable_msi(struct pci_dev * ) ; extern int pci_enable_msi_range(struct pci_dev * , int , int ) ; __inline static int pci_enable_msi_exact(struct pci_dev *dev , int nvec ) { int rc ; int tmp ; { tmp = pci_enable_msi_range(dev, nvec, nvec); rc = tmp; if (rc < 0) { return (rc); } else { } return (0); } } __inline static void pci_free_consistent(struct pci_dev *hwdev , size_t size , void *vaddr , dma_addr_t dma_handle ) { { dma_free_attrs((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, size, vaddr, dma_handle, (struct dma_attrs *)0); return; } } __inline static int pci_set_dma_mask(struct pci_dev *dev , u64 mask ) { int tmp ; { tmp = dma_set_mask(& dev->dev, mask); return (tmp); } } __inline static int pci_set_consistent_dma_mask(struct pci_dev *dev , u64 mask ) { int tmp ; { tmp = dma_set_coherent_mask(& dev->dev, mask); return (tmp); } } __inline static void *pci_get_drvdata(struct pci_dev *pdev ) { void *tmp ; { tmp = dev_get_drvdata((struct device const *)(& pdev->dev)); return (tmp); } } __inline static void pci_set_drvdata(struct pci_dev *pdev , void *data ) { { dev_set_drvdata(& pdev->dev, data); return; } } __inline static char const *pci_name(struct pci_dev const *pdev ) { char const *tmp ; { tmp = dev_name(& pdev->dev); return (tmp); } } extern int ibnl_add_client(int , int , struct ibnl_client_cbs const * ) ; extern int ibnl_remove_client(int ) ; extern int iwpm_init(u8 ) ; extern int iwpm_exit(u8 ) ; extern int iwpm_register_pid_cb(struct sk_buff * , struct netlink_callback * ) ; extern int iwpm_add_mapping_cb(struct sk_buff * , struct netlink_callback * ) ; extern int iwpm_add_and_query_mapping_cb(struct sk_buff * , struct netlink_callback * ) ; extern int iwpm_remote_info_cb(struct sk_buff * , struct netlink_callback * ) ; extern int iwpm_mapping_error_cb(struct sk_buff * , struct netlink_callback * ) ; extern int iwpm_mapping_info_cb(struct sk_buff * , struct netlink_callback * ) ; extern int iwpm_ack_mapping_info_cb(struct sk_buff * , struct netlink_callback * ) ; int nes_cm_start(void) ; int nes_cm_stop(void) ; void nes_destroy_pau_qp(struct nes_device *nesdev , struct nes_qp *nesqp ) ; int max_mtu ; int interrupt_mod_interval ; int mpa_version ; int disable_mpa_crc ; unsigned int nes_drv_opt ; unsigned int nes_debug_level ; unsigned int wqm_quanta ; struct list_head nes_adapter_list ; atomic_t qps_destroyed ; __inline static void set_wqe_64bit_value(__le32 *wqe_words , u32 index , u64 value ) { { *(wqe_words + (unsigned long )index) = (unsigned int )value; *(wqe_words + (unsigned long )(index + 1U)) = (unsigned int )(value >> 32ULL); return; } } __inline static void set_wqe_32bit_value(__le32 *wqe_words , u32 index , u32 value ) { { *(wqe_words + (unsigned long )index) = value; return; } } __inline static void nes_fill_init_cqp_wqe(struct nes_hw_cqp_wqe *cqp_wqe , struct nes_device *nesdev ) { { cqp_wqe->wqe_words[2] = 0U; cqp_wqe->wqe_words[3] = 0U; cqp_wqe->wqe_words[4] = 0U; cqp_wqe->wqe_words[5] = 0U; cqp_wqe->wqe_words[1] = 0U; cqp_wqe->wqe_words[14] = 0U; cqp_wqe->wqe_words[7] = 0U; cqp_wqe->wqe_words[12] = 0U; cqp_wqe->wqe_words[13] = 0U; return; } } __inline static u32 nes_read_indexed(struct nes_device *nesdev , u32 reg_index ) { unsigned long flags ; void *addr ; u32 value ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); value = readl((void const volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return (value); } } __inline static u32 nes_read32(void const *addr ) { unsigned int tmp ; { tmp = readl((void const volatile *)addr); return (tmp); } } __inline static void nes_write_indexed(struct nes_device *nesdev , u32 reg_index , u32 val ) { unsigned long flags ; void *addr ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); writel(val, (void volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return; } } __inline static void nes_write32(void *addr , u32 val ) { { writel(val, (void volatile *)addr); return; } } __inline static void nes_free_resource(struct nes_adapter *nesadapter , unsigned long *resource_array , u32 resource_num ) { unsigned long flags ; { ldv_spin_lock(); clear_bit((long )resource_num, (unsigned long volatile *)resource_array); spin_unlock_irqrestore(& nesadapter->resource_lock, flags); return; } } __inline static struct nes_vnic *to_nesvnic(struct ib_device *ibdev ) { struct ib_device const *__mptr ; { __mptr = (struct ib_device const *)ibdev; return (((struct nes_ib_device *)__mptr)->nesvnic); } } __inline static struct nes_qp *to_nesqp(struct ib_qp *ibqp ) { struct ib_qp const *__mptr ; { __mptr = (struct ib_qp const *)ibqp; return ((struct nes_qp *)__mptr); } } void nes_add_ref(struct ib_qp *ibqp ) ; void nes_rem_ref(struct ib_qp *ibqp ) ; struct ib_qp *nes_get_qp(struct ib_device *device , int qpn ) ; struct nes_adapter *nes_init_adapter(struct nes_device *nesdev , u8 hw_rev ) ; void nes_destroy_adapter(struct nes_adapter *nesadapter ) ; int nes_init_cqp(struct nes_device *nesdev ) ; int nes_napi_isr(struct nes_device *nesdev ) ; void nes_dpc(unsigned long param ) ; int nes_destroy_cqp(struct nes_device *nesdev ) ; void nes_recheck_link_status(struct work_struct *work ) ; struct net_device *nes_netdev_init(struct nes_device *nesdev , void *mmio_addr ) ; void nes_netdev_destroy(struct net_device *netdev ) ; void nes_manage_arp_cache(struct net_device *netdev , unsigned char *mac_addr , u32 ip_addr , u32 action ) ; struct nes_cqp_request *nes_get_cqp_request(struct nes_device *nesdev ) ; void nes_post_cqp_request(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) ; extern int register_netevent_notifier(struct notifier_block * ) ; extern int unregister_netevent_notifier(struct notifier_block * ) ; int max_mtu = 9000; int interrupt_mod_interval = 0; int mpa_version = 1; int disable_mpa_crc = 0; unsigned int nes_drv_opt = 1280U; unsigned int nes_debug_level = 0U; unsigned int wqm_quanta = 65536U; static bool limit_maxrdreqsz ; struct list_head nes_adapter_list = {& nes_adapter_list, & nes_adapter_list}; static struct list_head nes_dev_list = {& nes_dev_list, & nes_dev_list}; static unsigned int ee_flsh_adapter ; static unsigned int sysfs_nonidx_addr ; static unsigned int sysfs_idx_addr ; static struct pci_device_id nes_pci_table[3U] = { {5752U, 256U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5752U, 272U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {0U, 0U, 0U, 0U, 0U, 0U, 0UL}}; struct pci_device_id const __mod_pci__nes_pci_table_device_table[3U] ; static struct ibnl_client_cbs nes_nl_cb_table[8U] = { {& iwpm_register_pid_cb, 0}, {& iwpm_add_mapping_cb, 0}, {& iwpm_add_and_query_mapping_cb, 0}, {0, 0}, {& iwpm_remote_info_cb, 0}, {& iwpm_mapping_error_cb, 0}, {& iwpm_mapping_info_cb, 0}, {& iwpm_ack_mapping_info_cb, 0}}; static int nes_inetaddr_event(struct notifier_block *notifier , unsigned long event , void *ptr ) ; static int nes_net_event(struct notifier_block *notifier , unsigned long event , void *ptr ) ; static int nes_notifiers_registered ; static struct notifier_block nes_inetaddr_notifier = {& nes_inetaddr_event, 0, 0}; static struct notifier_block nes_net_notifier = {& nes_net_event, 0, 0}; static int nes_inetaddr_event(struct notifier_block *notifier , unsigned long event , void *ptr ) { struct in_ifaddr *ifa ; struct net_device *event_netdev ; struct nes_device *nesdev ; struct net_device *netdev ; struct net_device *upper_dev ; struct nes_vnic *nesvnic ; unsigned int is_bonded ; struct list_head const *__mptr ; void *tmp ; bool tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; struct list_head const *__mptr___0 ; { ifa = (struct in_ifaddr *)ptr; event_netdev = (ifa->ifa_dev)->dev; if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: nes_inetaddr_event: ip address %pI4, netmask %pI4.\n", "nes_inetaddr_event", 153, & ifa->ifa_address, & ifa->ifa_mask); } else { } __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61598; ldv_61597: ; if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: Nesdev list entry = 0x%p. (%s)\n", "nes_inetaddr_event", 156, nesdev, (char *)(& (nesdev->netdev[0])->name)); } else { } netdev = nesdev->netdev[0]; tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; upper_dev = netdev_master_upper_dev_get(netdev); tmp___0 = netif_is_bond_slave(netdev); is_bonded = (unsigned int )((int )tmp___0 && (unsigned long )upper_dev == (unsigned long )event_netdev); if ((unsigned long )netdev == (unsigned long )event_netdev || is_bonded != 0U) { if ((unsigned int )nesvnic->rdma_enabled == 0U) { if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: Returning without processing event for %s since RDMA is not enabled.\n", "nes_inetaddr_event", 166, (char *)(& netdev->name)); } else { } return (1); } else { } switch (event) { case 2UL: ; if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: event:DOWN\n", "nes_inetaddr_event", 172); } else { } nes_write_indexed(nesdev, (((nesdev->pcidev)->devfn & 7U) + 64U) * 16U, 0U); tmp___1 = __fswab32(nesvnic->local_ipaddr); nes_manage_arp_cache(netdev, netdev->dev_addr, tmp___1, 2U); nesvnic->local_ipaddr = 0U; if (is_bonded != 0U) { goto ldv_61592; } else { return (1); } case 1UL: ; if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: event:UP\n", "nes_inetaddr_event", 185); } else { } if (nesvnic->local_ipaddr != 0U) { if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: Interface already has local_ipaddr\n", "nes_inetaddr_event", 188); } else { } return (1); } else { } case 8UL: ; if ((unsigned long )upper_dev != (unsigned long )((struct net_device *)0)) { nesvnic->local_ipaddr = ((upper_dev->ip_ptr)->ifa_list)->ifa_address; } else { nesvnic->local_ipaddr = ifa->ifa_address; } tmp___2 = __fswab32(nesvnic->local_ipaddr); nes_write_indexed(nesdev, (((nesdev->pcidev)->devfn & 7U) + 64U) * 16U, tmp___2); tmp___3 = __fswab32(nesvnic->local_ipaddr); nes_manage_arp_cache(netdev, netdev->dev_addr, tmp___3, 1U); if (is_bonded != 0U) { goto ldv_61592; } else { return (1); } default: ; goto ldv_61596; } ldv_61596: ; } else { } ldv_61592: __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61598: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61597; } else { } return (0); } } static int nes_net_event(struct notifier_block *notifier , unsigned long event , void *ptr ) { struct neighbour *neigh ; struct nes_device *nesdev ; struct net_device *netdev ; struct nes_vnic *nesvnic ; struct list_head const *__mptr ; void *tmp ; __u32 tmp___0 ; __u32 tmp___1 ; struct list_head const *__mptr___0 ; { neigh = (struct neighbour *)ptr; switch (event) { case 1UL: __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61616; ldv_61615: netdev = nesdev->netdev[0]; tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; if ((unsigned long )neigh->dev == (unsigned long )netdev) { if ((unsigned int )nesvnic->rdma_enabled == 0U) { if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: Skipping device %s since no RDMA\n", "nes_net_event", 240, (char *)(& netdev->name)); } else { } } else if (((int )neigh->nud_state & 222) != 0) { tmp___0 = __fswab32(*((__be32 *)(& neigh->primary_key))); nes_manage_arp_cache(neigh->dev, (unsigned char *)(& neigh->ha), tmp___0, 1U); } else { tmp___1 = __fswab32(*((__be32 *)(& neigh->primary_key))); nes_manage_arp_cache(neigh->dev, (unsigned char *)(& neigh->ha), tmp___1, 2U); } return (1); } else { } __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61616: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61615; } else { } goto ldv_61618; default: ; if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: NETEVENT_ %lu undefined\n", "nes_net_event", 255, event); } else { } goto ldv_61618; } ldv_61618: ; return (0); } } void nes_add_ref(struct ib_qp *ibqp ) { struct nes_qp *nesqp ; int tmp ; { nesqp = to_nesqp(ibqp); if ((nes_debug_level & 16384U) != 0U) { tmp = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: Bumping refcount for QP%u. Pre-inc value = %u\n", "nes_add_ref", 272, ibqp->qp_num, tmp); } else { } atomic_inc(& nesqp->refcount); return; } } static void nes_cqp_rem_ref_callback(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) { unsigned long flags ; struct nes_qp *nesqp ; struct nes_adapter *nesadapter ; { nesqp = (struct nes_qp *)cqp_request->__annonCompField119.cqp_callback_pointer; nesadapter = nesdev->nesadapter; atomic_inc(& qps_destroyed); if ((unsigned long )nesqp->pbl_vbase != (unsigned long )((void *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )nesqp->qp_mem_size, nesqp->hwqp.q2_vbase, nesqp->hwqp.q2_pbase); ldv_spin_lock(); nesadapter->free_256pbl = nesadapter->free_256pbl + 1U; spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); pci_free_consistent(nesdev->pcidev, 256UL, nesqp->pbl_vbase, nesqp->pbl_pbase); nesqp->pbl_vbase = (void *)0; } else { pci_free_consistent(nesdev->pcidev, (size_t )nesqp->qp_mem_size, (void *)nesqp->hwqp.sq_vbase, nesqp->hwqp.sq_pbase); } nes_free_resource(nesadapter, nesadapter->allocated_qps, nesqp->hwqp.qp_id); *(nesadapter->qp_table + (unsigned long )(nesqp->hwqp.qp_id - 64U)) = (struct nes_qp *)0; kfree((void const *)nesqp->allocated_buffer); return; } } void nes_rem_ref(struct ib_qp *ibqp ) { u64 u64temp ; struct nes_qp *nesqp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; u32 opcode ; int tmp___0 ; int tmp___1 ; { tmp = to_nesvnic(ibqp->device); nesvnic = tmp; nesdev = nesvnic->nesdev; nesqp = to_nesqp(ibqp); tmp___0 = atomic_read((atomic_t const *)(& nesqp->refcount)); if (tmp___0 == 0) { printk("\016iw_nes: %s: Reference count already 0 for QP%d, last aeq = 0x%04X.\n", "nes_rem_ref", ibqp->qp_num, nesqp->last_aeq); __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes.c"), "i" (324), "i" (12UL)); ldv_61643: ; goto ldv_61643; } else { } tmp___1 = atomic_dec_and_test(& nesqp->refcount); if (tmp___1 != 0) { if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { nes_destroy_pau_qp(nesdev, nesqp); } else { } cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_rem_ref", 334); } else { } return; } else { } cqp_request->waiting = 0U; cqp_request->callback = 1U; cqp_request->cqp_callback = & nes_cqp_rem_ref_callback; cqp_request->__annonCompField119.cqp_callback_pointer = (void *)nesqp; cqp_wqe = & cqp_request->cqp_wqe; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); opcode = 65538U; if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { opcode = opcode | 16384U; nesqp->hte_added = 0U; } else { } set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, opcode); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, nesqp->hwqp.qp_id); u64temp = nesqp->nesqp_context_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); nes_post_cqp_request(nesdev, cqp_request); } else { } return; } } struct ib_qp *nes_get_qp(struct ib_device *device , int qpn ) { struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; { tmp = to_nesvnic(device); nesvnic = tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; if (qpn <= 63 || (u32 )qpn >= nesadapter->max_qp + 64U) { return ((struct ib_qp *)0); } else { } return (& (*(nesadapter->qp_table + ((unsigned long )qpn + 0xffffffffffffffc0UL)))->ibqp); } } static void nes_print_macaddr(struct net_device *netdev ) { { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: %s: %pM, IRQ %u\n", "nes_print_macaddr", 381, (char *)(& netdev->name), netdev->dev_addr, netdev->irq); } else { } return; } } static irqreturn_t nes_interrupt(int irq , void *dev_id ) { struct nes_device *nesdev ; int handled ; u32 int_mask ; u32 int_req ; u32 int_stat ; u32 intf_int_stat ; u32 timer_stat ; u32 tmp ; long tmp___0 ; int tmp___1 ; { nesdev = (struct nes_device *)dev_id; handled = 0; if ((unsigned int )nesdev->msi_enabled != 0U) { handled = 1; } else { tmp___0 = ldv__builtin_expect((nesdev->nesadapter)->hw_rev == 4U, 0L); if (tmp___0 != 0L) { int_mask = nes_read32((void const *)nesdev->regs + 4U); if ((int )int_mask < 0) { int_stat = nes_read32((void const *)nesdev->regs); int_req = nesdev->int_req; if ((int_stat & int_req) != 0U) { if (((int_stat & int_req) & 2684354559U) != 0U) { handled = 1; } else { if (((int_stat & int_req) & 536870912U) != 0U) { timer_stat = nes_read32((void const *)nesdev->regs + 20U); if ((nesdev->timer_int_req & timer_stat) != 0U) { handled = 1; } else { } } else { } if (((int_stat & int_req) & 1073741824U) != 0U && handled == 0) { intf_int_stat = nes_read32((void const *)nesdev->regs + 12U); if ((nesdev->intf_int_req & intf_int_stat) != 0U) { handled = 1; } else { } } else { } } if (handled != 0) { nes_write32(nesdev->regs + 4UL, int_mask & 2147483647U); int_mask = nes_read32((void const *)nesdev->regs + 4U); nesdev->int_stat = int_stat; nesdev->napi_isr_ran = 1U; } else { } } else { } } else { } } else { tmp = nes_read32((void const *)nesdev->regs + 8U); handled = (int )tmp; } } if (handled != 0) { tmp___1 = nes_napi_isr(nesdev); if (tmp___1 == 0) { tasklet_schedule(& nesdev->dpc_tasklet); } else { } return (1); } else { return (0); } } } static int nes_probe(struct pci_dev *pcidev , struct pci_device_id const *ent ) { struct net_device *netdev ; struct nes_device *nesdev ; int ret ; void *mmio_regs ; u8 hw_rev ; char const *tmp ; char const *tmp___0 ; char const *tmp___1 ; void *tmp___2 ; char const *tmp___3 ; struct lock_class_key __key ; char const *tmp___4 ; char const *tmp___5 ; int tmp___6 ; char const *tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; char const *tmp___11 ; int tmp___12 ; char const *tmp___13 ; struct lock_class_key __key___0 ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___1 ; char const *tmp___14 ; { netdev = (struct net_device *)0; nesdev = (struct nes_device *)0; ret = 0; mmio_regs = (void *)0; if ((unsigned long )pcidev == (unsigned long )((struct pci_dev *)0)) { printk("\viw_nes: Assertion failed! %s, %s, %s, line %d\n", (char *)"pcidev != NULL", (char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes.c", "nes_probe", 467); } else { } if ((unsigned long )ent == (unsigned long )((struct pci_device_id const *)0)) { printk("\viw_nes: Assertion failed! %s, %s, %s, line %d\n", (char *)"ent != NULL", (char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes.c", "nes_probe", 468); } else { } tmp = pci_name((struct pci_dev const *)pcidev); printk("\016iw_nes: NetEffect RNIC driver v%s loading. (%s)\n", (char *)"1.5.0.1", tmp); ret = pci_enable_device(pcidev); if (ret != 0) { tmp___0 = pci_name((struct pci_dev const *)pcidev); printk("\viw_nes: Unable to enable PCI device. (%s)\n", tmp___0); goto bail0; } else { } if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: BAR0 (@0x%08lX) size = 0x%lX bytes\n", "nes_probe", 481, (unsigned long )pcidev->resource[0].start, pcidev->resource[0].start != 0ULL || pcidev->resource[0].end != pcidev->resource[0].start ? (unsigned long )((pcidev->resource[0].end - pcidev->resource[0].start) + 1ULL) : 0UL); } else { } if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: BAR1 (@0x%08lX) size = 0x%lX bytes\n", "nes_probe", 484, (unsigned long )pcidev->resource[2].start, pcidev->resource[2].start != 0ULL || pcidev->resource[2].end != pcidev->resource[2].start ? (unsigned long )((pcidev->resource[2].end - pcidev->resource[2].start) + 1ULL) : 0UL); } else { } if ((pcidev->resource[0].flags & 512UL) == 0UL || (pcidev->resource[2].flags & 512UL) == 0UL) { printk("\viw_nes: PCI regions not an MMIO resource\n"); ret = -19; goto bail1; } else { } ret = pci_request_regions(pcidev, "iw_nes"); if (ret != 0) { tmp___1 = pci_name((struct pci_dev const *)pcidev); printk("\viw_nes: Unable to request regions. (%s)\n", tmp___1); goto bail1; } else { } ret = pci_set_dma_mask(pcidev, 0xffffffffffffffffULL); if (ret < 0) { printk("\viw_nes: 64b DMA mask configuration failed\n"); goto bail2; } else { } ret = pci_set_consistent_dma_mask(pcidev, 0xffffffffffffffffULL); if (ret != 0) { printk("\viw_nes: 64b DMA consistent mask configuration failed\n"); goto bail2; } else { } pci_set_master(pcidev); tmp___2 = kzalloc(976UL, 208U); nesdev = (struct nes_device *)tmp___2; if ((unsigned long )nesdev == (unsigned long )((struct nes_device *)0)) { tmp___3 = pci_name((struct pci_dev const *)pcidev); printk("\viw_nes: %s: Unable to alloc hardware struct\n", tmp___3); ret = -12; goto bail2; } else { } if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Allocated nes device at %p\n", "nes_probe", 535, nesdev); } else { } nesdev->pcidev = pcidev; pci_set_drvdata(pcidev, (void *)nesdev); pci_read_config_byte((struct pci_dev const *)pcidev, 8, & hw_rev); if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: hw_rev=%u\n", "nes_probe", 540, (int )hw_rev); } else { } spinlock_check(& nesdev->indexed_regs_lock); __raw_spin_lock_init(& nesdev->indexed_regs_lock.__annonCompField18.rlock, "&(&nesdev->indexed_regs_lock)->rlock", & __key); mmio_regs = ioremap_nocache(pcidev->resource[0].start, pcidev->resource[0].start != 0ULL || pcidev->resource[0].end != pcidev->resource[0].start ? (unsigned long )((pcidev->resource[0].end - pcidev->resource[0].start) + 1ULL) : 0UL); if ((unsigned long )mmio_regs == (unsigned long )((void *)0)) { printk("\viw_nes: Unable to remap BAR0\n"); ret = -5; goto bail3; } else { } nesdev->regs = mmio_regs; nesdev->index_reg = mmio_regs + (unsigned long )(((pcidev->devfn & 7U) + 10U) * 8U); nes_write32(nesdev->regs + 4UL, 2147483647U); if ((nes_drv_opt & 16U) != 0U) { tmp___6 = pci_enable_msi_exact(nesdev->pcidev, 1); if (tmp___6 == 0) { nesdev->msi_enabled = 1U; if ((nes_debug_level & 2U) != 0U) { tmp___4 = pci_name((struct pci_dev const *)pcidev); printk("\viw_nes: %s[%u]: MSI is enabled for device %s\n", "nes_probe", 562, tmp___4); } else { } } else if ((nes_debug_level & 2U) != 0U) { tmp___5 = pci_name((struct pci_dev const *)pcidev); printk("\viw_nes: %s[%u]: MSI is disabled by linux for device %s\n", "nes_probe", 565, tmp___5); } else { } } else if ((nes_debug_level & 2U) != 0U) { tmp___7 = pci_name((struct pci_dev const *)pcidev); printk("\viw_nes: %s[%u]: MSI not requested due to driver options for device %s\n", "nes_probe", 569, tmp___7); } else { } nesdev->csr_start = (unsigned long )(nesdev->pcidev)->resource[0].start; nesdev->doorbell_region = (unsigned long )(nesdev->pcidev)->resource[2].start; nesdev->nesadapter = nes_init_adapter(nesdev, (int )hw_rev); if ((unsigned long )nesdev->nesadapter == (unsigned long )((struct nes_adapter *)0)) { printk("\viw_nes: Unable to initialize adapter.\n"); ret = -12; goto bail5; } else { } (nesdev->nesadapter)->et_rx_coalesce_usecs_irq = (u32 )interrupt_mod_interval; (nesdev->nesadapter)->wqm_quanta = wqm_quanta; nesdev->base_doorbell_index = 1U; nesdev->doorbell_start = (nesdev->nesadapter)->doorbell_start; if ((unsigned int )(nesdev->nesadapter)->phy_type[0] == 5U) { switch (((nesdev->pcidev)->devfn & 7U) % (unsigned int )(nesdev->nesadapter)->port_count) { case 1U: nesdev->mac_index = 2U; goto ldv_61683; case 2U: nesdev->mac_index = 1U; goto ldv_61683; case 3U: nesdev->mac_index = 3U; goto ldv_61683; case 0U: ; default: nesdev->mac_index = 0U; } ldv_61683: ; } else { nesdev->mac_index = ((nesdev->pcidev)->devfn & 7U) % (unsigned int )(nesdev->nesadapter)->port_count; } if ((int )limit_maxrdreqsz || ((unsigned int )(nesdev->nesadapter)->phy_type[0] == 7U && (unsigned int )hw_rev == 5U)) { tmp___9 = pcie_get_readrq(pcidev); if (tmp___9 > 256) { tmp___8 = pcie_set_readrq(pcidev, 256); if (tmp___8 != 0) { printk("\viw_nes: Unable to set max read request to 256 bytes\n"); } else if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Max read request size set to 256 bytes\n", "nes_probe", 619); } else { } } else { } } else { } tasklet_init(& nesdev->dpc_tasklet, & nes_dpc, (unsigned long )nesdev); tmp___10 = nes_init_cqp(nesdev); if (tmp___10 != 0) { ret = -19; goto bail6; } else { } nes_write32(nesdev->regs + 68UL, ((nesdev->pcidev)->devfn & 7U) | 536870912U); nes_read32((void const *)nesdev->regs + 68U); nesdev->int_req = (u32 )((257 << ((int )(nesdev->pcidev)->devfn & 7)) | (1 << (int )(((nesdev->pcidev)->devfn & 7U) + 16U))); if (((nesdev->pcidev)->devfn & 7U) <= 3U) { nesdev->int_req = nesdev->int_req | (u32 )(1 << (int )((nesdev->mac_index & 7U) + 24U)); } else { } if (((nesdev->pcidev)->devfn & 7U) == 0U) { nesdev->intf_int_req = 16385U; nesdev->int_req = nesdev->int_req | 1073741824U; } else { nesdev->intf_int_req = 0U; } nesdev->intf_int_req = nesdev->intf_int_req | (u32 )(1 << (int )(((nesdev->pcidev)->devfn & 7U) + 16U)); nes_write_indexed(nesdev, 37184U, 0U); nes_write_indexed(nesdev, 37188U, 0U); nes_write_indexed(nesdev, 37192U, 4709U); nes_write_indexed(nesdev, 37200U, 402790404U); nes_write_indexed(nesdev, 37196U, 394270608U); nesdev->timer_int_req = (u32 )(257 << ((int )(nesdev->pcidev)->devfn & 7)); (nesdev->nesadapter)->timer_int_req = (nesdev->nesadapter)->timer_int_req | nesdev->timer_int_req; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: setting int_req for function %u, nesdev = 0x%04X, adapter = 0x%04X\n", "nes_probe", 663, (nesdev->pcidev)->devfn & 7U, nesdev->timer_int_req, (nesdev->nesadapter)->timer_int_req); } else { } nes_write32(nesdev->regs + 16UL, ~ nesdev->intf_int_req); list_add_tail(& nesdev->list, & nes_dev_list); ret = ldv_request_irq_43(pcidev->irq, & nes_interrupt, 128UL, "iw_nes", (void *)nesdev); if (ret != 0) { tmp___11 = pci_name((struct pci_dev const *)pcidev); printk("\viw_nes: %s: requested IRQ %u is busy\n", tmp___11, pcidev->irq); goto bail65; } else { } nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req); if (nes_notifiers_registered == 0) { register_inetaddr_notifier(& nes_inetaddr_notifier); register_netevent_notifier(& nes_net_notifier); } else { } nes_notifiers_registered = nes_notifiers_registered + 1; tmp___12 = ibnl_add_client(2, 8, (struct ibnl_client_cbs const *)(& nes_nl_cb_table)); if (tmp___12 != 0) { printk("\viw_nes: %s[%u]: Failed to add netlink callback\n", "nes_probe", 687); } else { } ret = iwpm_init(2); if (ret != 0) { tmp___13 = pci_name((struct pci_dev const *)pcidev); printk("\viw_nes: %s: port mapper initialization failed\n", tmp___13); goto bail7; } else { } __init_work(& nesdev->work.work, 0); __constr_expr_0.counter = 137438953408L; nesdev->work.work.data = __constr_expr_0; lockdep_init_map(& nesdev->work.work.lockdep_map, "(&(&nesdev->work)->work)", & __key___0, 0); INIT_LIST_HEAD(& nesdev->work.work.entry); nesdev->work.work.func = & nes_recheck_link_status; init_timer_key(& nesdev->work.timer, 2097152U, "(&(&nesdev->work)->timer)", & __key___1); nesdev->work.timer.function = & delayed_work_timer_fn; nesdev->work.timer.data = (unsigned long )(& nesdev->work); netdev = nes_netdev_init(nesdev, mmio_regs); if ((unsigned long )netdev == (unsigned long )((struct net_device *)0)) { ret = -12; goto bail7; } else { } ret = ldv_register_netdev_44(netdev); if (ret != 0) { printk("\viw_nes: Unable to register netdev, ret = %d\n", ret); nes_netdev_destroy(netdev); goto bail7; } else { } nes_print_macaddr(netdev); nesdev->netdev_count = (u8 )((int )nesdev->netdev_count + 1); (nesdev->nesadapter)->netdev_count = (u8 )((int )(nesdev->nesadapter)->netdev_count + 1); tmp___14 = pci_name((struct pci_dev const *)pcidev); printk("\016iw_nes: %s: NetEffect RNIC driver successfully loaded.\n", tmp___14); return (0); bail7: printk("\viw_nes: bail7\n"); goto ldv_61695; ldv_61694: nesdev->netdev_count = (u8 )((int )nesdev->netdev_count - 1); (nesdev->nesadapter)->netdev_count = (u8 )((int )(nesdev->nesadapter)->netdev_count - 1); ldv_unregister_netdev_45(nesdev->netdev[(int )nesdev->netdev_count]); nes_netdev_destroy(nesdev->netdev[(int )nesdev->netdev_count]); ldv_61695: ; if ((unsigned int )nesdev->netdev_count != 0U) { goto ldv_61694; } else { } if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: netdev_count=%d, nesadapter->netdev_count=%d\n", "nes_probe", 733, (int )nesdev->netdev_count, (int )(nesdev->nesadapter)->netdev_count); } else { } ibnl_remove_client(2); nes_notifiers_registered = nes_notifiers_registered - 1; if (nes_notifiers_registered == 0) { unregister_netevent_notifier(& nes_net_notifier); unregister_inetaddr_notifier(& nes_inetaddr_notifier); } else { } list_del(& nesdev->list); nes_destroy_cqp(nesdev); bail65: printk("\viw_nes: bail65\n"); ldv_free_irq_46(pcidev->irq, (void *)nesdev); if ((unsigned int )nesdev->msi_enabled != 0U) { pci_disable_msi(pcidev); } else { } bail6: printk("\viw_nes: bail6\n"); tasklet_kill(& nesdev->dpc_tasklet); nes_destroy_adapter(nesdev->nesadapter); bail5: printk("\viw_nes: bail5\n"); iounmap((void volatile *)nesdev->regs); bail3: printk("\viw_nes: bail3\n"); kfree((void const *)nesdev); bail2: pci_release_regions(pcidev); bail1: pci_disable_device(pcidev); bail0: ; return (ret); } } static void nes_remove(struct pci_dev *pcidev ) { struct nes_device *nesdev ; void *tmp ; struct net_device *netdev ; int netdev_index ; unsigned long flags ; { tmp = pci_get_drvdata(pcidev); nesdev = (struct nes_device *)tmp; netdev_index = 0; if ((unsigned int )nesdev->netdev_count != 0U) { netdev = nesdev->netdev[netdev_index]; if ((unsigned long )netdev != (unsigned long )((struct net_device *)0)) { netif_stop_queue(netdev); ldv_unregister_netdev_47(netdev); nes_netdev_destroy(netdev); nesdev->netdev[netdev_index] = (struct net_device *)0; nesdev->netdev_count = (u8 )((int )nesdev->netdev_count - 1); (nesdev->nesadapter)->netdev_count = (u8 )((int )(nesdev->nesadapter)->netdev_count - 1); } else { } } else { } ibnl_remove_client(2); iwpm_exit(2); nes_notifiers_registered = nes_notifiers_registered - 1; if (nes_notifiers_registered == 0) { unregister_netevent_notifier(& nes_net_notifier); unregister_inetaddr_notifier(& nes_inetaddr_notifier); } else { } list_del(& nesdev->list); nes_destroy_cqp(nesdev); ldv_free_irq_48(pcidev->irq, (void *)nesdev); tasklet_kill(& nesdev->dpc_tasklet); ldv_spin_lock(); if ((unsigned int )nesdev->link_recheck != 0U) { spin_unlock_irqrestore(& (nesdev->nesadapter)->phy_lock, flags); ldv_cancel_delayed_work_sync_49(& nesdev->work); } else { spin_unlock_irqrestore(& (nesdev->nesadapter)->phy_lock, flags); } nes_destroy_adapter(nesdev->nesadapter); if ((unsigned int )nesdev->msi_enabled != 0U) { pci_disable_msi(pcidev); } else { } iounmap((void volatile *)nesdev->regs); kfree((void const *)nesdev); pci_release_regions(pcidev); pci_disable_device(pcidev); pci_set_drvdata(pcidev, (void *)0); return; } } static struct pci_driver nes_pci_driver = {{0, 0}, "iw_nes", (struct pci_device_id const *)(& nes_pci_table), & nes_probe, & nes_remove, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {{{{{{0}}, 0U, 0U, 0, {0, {0, 0}, 0, 0, 0UL}}}}, {0, 0}}}; static ssize_t nes_show_adapter(struct device_driver *ddp , char *buf ) { unsigned int devfn ; unsigned char bus_number ; unsigned int i ; struct nes_device *nesdev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp ; { devfn = 4294967295U; bus_number = 255U; i = 0U; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61719; ldv_61718: ; if (i == ee_flsh_adapter) { devfn = (nesdev->pcidev)->devfn; bus_number = ((nesdev->pcidev)->bus)->number; goto ldv_61717; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61719: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61718; } else { } ldv_61717: tmp = snprintf(buf, 4096UL, "%x:%x\n", (int )bus_number, devfn); return ((ssize_t )tmp); } } static ssize_t nes_store_adapter(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; unsigned long tmp ; __kernel_size_t tmp___0 ; { p = (char *)buf; tmp = simple_strtoul((char const *)p, & p, 10U); ee_flsh_adapter = (unsigned int )tmp; tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_ee_cmd(struct device_driver *ddp , char *buf ) { u32 eeprom_cmd ; u32 i ; struct nes_device *nesdev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp ; { eeprom_cmd = 57005U; i = 0U; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61739; ldv_61738: ; if (i == ee_flsh_adapter) { eeprom_cmd = nes_read32((void const *)nesdev->regs + 32U); goto ldv_61737; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61739: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61738; } else { } ldv_61737: tmp = snprintf(buf, 4096UL, "0x%x\n", eeprom_cmd); return ((ssize_t )tmp); } } static ssize_t nes_store_ee_cmd(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; u32 val ; u32 i ; struct nes_device *nesdev ; unsigned long tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; __kernel_size_t tmp___0 ; { p = (char *)buf; i = 0U; if ((((int )((signed char )*(p + 1UL)) == 120 || (int )((signed char )*(p + 1UL)) == 88) || (int )((signed char )*p) == 120) || (int )((signed char )*p) == 88) { tmp = simple_strtoul((char const *)p, & p, 16U); val = (u32 )tmp; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61755; ldv_61754: ; if (i == ee_flsh_adapter) { nes_write32(nesdev->regs + 32UL, val); goto ldv_61753; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61755: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61754; } else { } ldv_61753: ; } else { } tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_ee_data(struct device_driver *ddp , char *buf ) { u32 eeprom_data ; u32 i ; struct nes_device *nesdev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp ; { eeprom_data = 57005U; i = 0U; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61769; ldv_61768: ; if (i == ee_flsh_adapter) { eeprom_data = nes_read32((void const *)nesdev->regs + 36U); goto ldv_61767; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61769: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61768; } else { } ldv_61767: tmp = snprintf(buf, 4096UL, "0x%x\n", eeprom_data); return ((ssize_t )tmp); } } static ssize_t nes_store_ee_data(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; u32 val ; u32 i ; struct nes_device *nesdev ; unsigned long tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; __kernel_size_t tmp___0 ; { p = (char *)buf; i = 0U; if ((((int )((signed char )*(p + 1UL)) == 120 || (int )((signed char )*(p + 1UL)) == 88) || (int )((signed char )*p) == 120) || (int )((signed char )*p) == 88) { tmp = simple_strtoul((char const *)p, & p, 16U); val = (u32 )tmp; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61785; ldv_61784: ; if (i == ee_flsh_adapter) { nes_write32(nesdev->regs + 36UL, val); goto ldv_61783; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61785: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61784; } else { } ldv_61783: ; } else { } tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_flash_cmd(struct device_driver *ddp , char *buf ) { u32 flash_cmd ; u32 i ; struct nes_device *nesdev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp ; { flash_cmd = 57005U; i = 0U; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61799; ldv_61798: ; if (i == ee_flsh_adapter) { flash_cmd = nes_read32((void const *)nesdev->regs + 40U); goto ldv_61797; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61799: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61798; } else { } ldv_61797: tmp = snprintf(buf, 4096UL, "0x%x\n", flash_cmd); return ((ssize_t )tmp); } } static ssize_t nes_store_flash_cmd(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; u32 val ; u32 i ; struct nes_device *nesdev ; unsigned long tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; __kernel_size_t tmp___0 ; { p = (char *)buf; i = 0U; if ((((int )((signed char )*(p + 1UL)) == 120 || (int )((signed char )*(p + 1UL)) == 88) || (int )((signed char )*p) == 120) || (int )((signed char )*p) == 88) { tmp = simple_strtoul((char const *)p, & p, 16U); val = (u32 )tmp; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61815; ldv_61814: ; if (i == ee_flsh_adapter) { nes_write32(nesdev->regs + 40UL, val); goto ldv_61813; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61815: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61814; } else { } ldv_61813: ; } else { } tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_flash_data(struct device_driver *ddp , char *buf ) { u32 flash_data ; u32 i ; struct nes_device *nesdev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp ; { flash_data = 57005U; i = 0U; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61829; ldv_61828: ; if (i == ee_flsh_adapter) { flash_data = nes_read32((void const *)nesdev->regs + 44U); goto ldv_61827; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61829: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61828; } else { } ldv_61827: tmp = snprintf(buf, 4096UL, "0x%x\n", flash_data); return ((ssize_t )tmp); } } static ssize_t nes_store_flash_data(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; u32 val ; u32 i ; struct nes_device *nesdev ; unsigned long tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; __kernel_size_t tmp___0 ; { p = (char *)buf; i = 0U; if ((((int )((signed char )*(p + 1UL)) == 120 || (int )((signed char )*(p + 1UL)) == 88) || (int )((signed char )*p) == 120) || (int )((signed char )*p) == 88) { tmp = simple_strtoul((char const *)p, & p, 16U); val = (u32 )tmp; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61845; ldv_61844: ; if (i == ee_flsh_adapter) { nes_write32(nesdev->regs + 44UL, val); goto ldv_61843; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61845: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61844; } else { } ldv_61843: ; } else { } tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_nonidx_addr(struct device_driver *ddp , char *buf ) { int tmp ; { tmp = snprintf(buf, 4096UL, "0x%x\n", sysfs_nonidx_addr); return ((ssize_t )tmp); } } static ssize_t nes_store_nonidx_addr(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; unsigned long tmp ; __kernel_size_t tmp___0 ; { p = (char *)buf; if ((((int )((signed char )*(p + 1UL)) == 120 || (int )((signed char )*(p + 1UL)) == 88) || (int )((signed char )*p) == 120) || (int )((signed char )*p) == 88) { tmp = simple_strtoul((char const *)p, & p, 16U); sysfs_nonidx_addr = (unsigned int )tmp; } else { } tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_nonidx_data(struct device_driver *ddp , char *buf ) { u32 nonidx_data ; u32 i ; struct nes_device *nesdev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp ; { nonidx_data = 57005U; i = 0U; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61869; ldv_61868: ; if (i == ee_flsh_adapter) { nonidx_data = nes_read32((void const *)nesdev->regs + (unsigned long )sysfs_nonidx_addr); goto ldv_61867; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61869: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61868; } else { } ldv_61867: tmp = snprintf(buf, 4096UL, "0x%x\n", nonidx_data); return ((ssize_t )tmp); } } static ssize_t nes_store_nonidx_data(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; u32 val ; u32 i ; struct nes_device *nesdev ; unsigned long tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; __kernel_size_t tmp___0 ; { p = (char *)buf; i = 0U; if ((((int )((signed char )*(p + 1UL)) == 120 || (int )((signed char )*(p + 1UL)) == 88) || (int )((signed char )*p) == 120) || (int )((signed char )*p) == 88) { tmp = simple_strtoul((char const *)p, & p, 16U); val = (u32 )tmp; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61885; ldv_61884: ; if (i == ee_flsh_adapter) { nes_write32(nesdev->regs + (unsigned long )sysfs_nonidx_addr, val); goto ldv_61883; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61885: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61884; } else { } ldv_61883: ; } else { } tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_idx_addr(struct device_driver *ddp , char *buf ) { int tmp ; { tmp = snprintf(buf, 4096UL, "0x%x\n", sysfs_idx_addr); return ((ssize_t )tmp); } } static ssize_t nes_store_idx_addr(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; unsigned long tmp ; __kernel_size_t tmp___0 ; { p = (char *)buf; if ((((int )((signed char )*(p + 1UL)) == 120 || (int )((signed char )*(p + 1UL)) == 88) || (int )((signed char )*p) == 120) || (int )((signed char )*p) == 88) { tmp = simple_strtoul((char const *)p, & p, 16U); sysfs_idx_addr = (unsigned int )tmp; } else { } tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_idx_data(struct device_driver *ddp , char *buf ) { u32 idx_data ; u32 i ; struct nes_device *nesdev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp ; { idx_data = 57005U; i = 0U; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61909; ldv_61908: ; if (i == ee_flsh_adapter) { idx_data = nes_read_indexed(nesdev, sysfs_idx_addr); goto ldv_61907; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61909: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61908; } else { } ldv_61907: tmp = snprintf(buf, 4096UL, "0x%x\n", idx_data); return ((ssize_t )tmp); } } static ssize_t nes_store_idx_data(struct device_driver *ddp , char const *buf , size_t count ) { char *p ; u32 val ; u32 i ; struct nes_device *nesdev ; unsigned long tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; __kernel_size_t tmp___0 ; { p = (char *)buf; i = 0U; if ((((int )((signed char )*(p + 1UL)) == 120 || (int )((signed char )*(p + 1UL)) == 88) || (int )((signed char )*p) == 120) || (int )((signed char )*p) == 88) { tmp = simple_strtoul((char const *)p, & p, 16U); val = (u32 )tmp; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61925; ldv_61924: ; if (i == ee_flsh_adapter) { nes_write_indexed(nesdev, sysfs_idx_addr, val); goto ldv_61923; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61925: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61924; } else { } ldv_61923: ; } else { } tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static ssize_t nes_show_wqm_quanta(struct device_driver *ddp , char *buf ) { u32 wqm_quanta_value ; u32 i ; struct nes_device *nesdev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp ; { wqm_quanta_value = 57005U; i = 0U; __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61939; ldv_61938: ; if (i == ee_flsh_adapter) { wqm_quanta_value = (nesdev->nesadapter)->wqm_quanta; goto ldv_61937; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61939: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61938; } else { } ldv_61937: tmp = snprintf(buf, 4096UL, "0x%X\n", wqm_quanta_value); return ((ssize_t )tmp); } } static ssize_t nes_store_wqm_quanta(struct device_driver *ddp , char const *buf , size_t count ) { unsigned long wqm_quanta_value ; u32 wqm_config1 ; u32 i ; struct nes_device *nesdev ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; __kernel_size_t tmp___0 ; { i = 0U; tmp = kstrtoul(buf, 0U, & wqm_quanta_value); if (tmp < 0) { return (-22L); } else { } __mptr = (struct list_head const *)nes_dev_list.next; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd38UL; goto ldv_61955; ldv_61954: ; if (i == ee_flsh_adapter) { (nesdev->nesadapter)->wqm_quanta = (u32 )wqm_quanta_value; wqm_config1 = nes_read_indexed(nesdev, 20484U); nes_write_indexed(nesdev, 20484U, ((u32 )wqm_quanta_value << 1U) | (wqm_config1 & 1U)); goto ldv_61953; } else { } i = i + 1U; __mptr___0 = (struct list_head const *)nesdev->list.next; nesdev = (struct nes_device *)__mptr___0 + 0xfffffffffffffd38UL; ldv_61955: ; if ((unsigned long )(& nesdev->list) != (unsigned long )(& nes_dev_list)) { goto ldv_61954; } else { } ldv_61953: tmp___0 = strnlen(buf, count); return ((ssize_t )tmp___0); } } static struct driver_attribute driver_attr_adapter = {{"adapter", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_adapter, & nes_store_adapter}; static struct driver_attribute driver_attr_eeprom_cmd = {{"eeprom_cmd", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_ee_cmd, & nes_store_ee_cmd}; static struct driver_attribute driver_attr_eeprom_data = {{"eeprom_data", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_ee_data, & nes_store_ee_data}; static struct driver_attribute driver_attr_flash_cmd = {{"flash_cmd", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_flash_cmd, & nes_store_flash_cmd}; static struct driver_attribute driver_attr_flash_data = {{"flash_data", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_flash_data, & nes_store_flash_data}; static struct driver_attribute driver_attr_nonidx_addr = {{"nonidx_addr", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_nonidx_addr, & nes_store_nonidx_addr}; static struct driver_attribute driver_attr_nonidx_data = {{"nonidx_data", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_nonidx_data, & nes_store_nonidx_data}; static struct driver_attribute driver_attr_idx_addr = {{"idx_addr", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_idx_addr, & nes_store_idx_addr}; static struct driver_attribute driver_attr_idx_data = {{"idx_data", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_idx_data, & nes_store_idx_data}; static struct driver_attribute driver_attr_wqm_quanta = {{"wqm_quanta", 384U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & nes_show_wqm_quanta, & nes_store_wqm_quanta}; static int nes_create_driver_sysfs(struct pci_driver *drv ) { int error ; 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 ; { error = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_adapter)); tmp = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_eeprom_cmd)); error = tmp | error; tmp___0 = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_eeprom_data)); error = tmp___0 | error; tmp___1 = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_flash_cmd)); error = tmp___1 | error; tmp___2 = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_flash_data)); error = tmp___2 | error; tmp___3 = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_nonidx_addr)); error = tmp___3 | error; tmp___4 = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_nonidx_data)); error = tmp___4 | error; tmp___5 = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_idx_addr)); error = tmp___5 | error; tmp___6 = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_idx_data)); error = tmp___6 | error; tmp___7 = driver_create_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_wqm_quanta)); error = tmp___7 | error; return (error); } } static void nes_remove_driver_sysfs(struct pci_driver *drv ) { { driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_adapter)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_eeprom_cmd)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_eeprom_data)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_flash_cmd)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_flash_data)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_nonidx_addr)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_nonidx_data)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_idx_addr)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_idx_data)); driver_remove_file(& drv->driver, (struct driver_attribute const *)(& driver_attr_wqm_quanta)); return; } } static int nes_init_module(void) { int retval ; int retval1 ; { retval = nes_cm_start(); if (retval != 0) { printk("\viw_nes: Unable to start NetEffect iWARP CM.\n"); return (retval); } else { } retval = ldv___pci_register_driver_50(& nes_pci_driver, & __this_module, "iw_nes"); if (retval >= 0) { retval1 = nes_create_driver_sysfs(& nes_pci_driver); if (retval1 < 0) { printk("\viw_nes: Unable to create NetEffect sys files.\n"); } else { } } else { } return (retval); } } static void nes_exit_module(void) { { nes_cm_stop(); nes_remove_driver_sysfs(& nes_pci_driver); ldv_pci_unregister_driver_51(& nes_pci_driver); return; } } extern void ldv_initialize(void) ; extern void ldv_check_final_state(void) ; extern int ldv_shutdown_29(void) ; int ldv_retval_3 ; int ldv_retval_2 ; void ldv_initialize_driver_attribute_24(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_flash_data_group0 = (struct device_driver *)tmp; return; } } void call_and_disable_all_2(int state ) { { if (ldv_work_2_0 == state) { call_and_disable_work_2(ldv_work_struct_2_0); } else { } if (ldv_work_2_1 == state) { call_and_disable_work_2(ldv_work_struct_2_1); } else { } if (ldv_work_2_2 == state) { call_and_disable_work_2(ldv_work_struct_2_2); } else { } if (ldv_work_2_3 == state) { call_and_disable_work_2(ldv_work_struct_2_3); } else { } return; } } int reg_check_1(irqreturn_t (*handler)(int , void * ) ) { { if ((unsigned long )handler == (unsigned long )(& nes_interrupt)) { return (1); } else { } return (0); } } void ldv_initialize_driver_attribute_26(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_eeprom_data_group0 = (struct device_driver *)tmp; return; } } void ldv_initialize_driver_attribute_23(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_nonidx_addr_group0 = (struct device_driver *)tmp; return; } } void disable_suitable_irq_1(int line , void *data ) { { if (ldv_irq_1_0 != 0 && line == ldv_irq_line_1_0) { ldv_irq_1_0 = 0; return; } else { } if (ldv_irq_1_1 != 0 && line == ldv_irq_line_1_1) { ldv_irq_1_1 = 0; return; } else { } if (ldv_irq_1_2 != 0 && line == ldv_irq_line_1_2) { ldv_irq_1_2 = 0; return; } else { } if (ldv_irq_1_3 != 0 && line == ldv_irq_line_1_3) { ldv_irq_1_3 = 0; return; } else { } return; } } void activate_suitable_irq_1(int line , void *data ) { { if (ldv_irq_1_0 == 0) { ldv_irq_line_1_0 = line; ldv_irq_data_1_0 = data; ldv_irq_1_0 = 1; return; } else { } if (ldv_irq_1_1 == 0) { ldv_irq_line_1_1 = line; ldv_irq_data_1_1 = data; ldv_irq_1_1 = 1; return; } else { } if (ldv_irq_1_2 == 0) { ldv_irq_line_1_2 = line; ldv_irq_data_1_2 = data; ldv_irq_1_2 = 1; return; } else { } if (ldv_irq_1_3 == 0) { ldv_irq_line_1_3 = line; ldv_irq_data_1_3 = data; ldv_irq_1_3 = 1; return; } else { } return; } } void ldv_initialize_driver_attribute_21(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_idx_addr_group0 = (struct device_driver *)tmp; return; } } void invoke_work_2(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_2_0 == 2 || ldv_work_2_0 == 3) { ldv_work_2_0 = 4; nes_recheck_link_status(ldv_work_struct_2_0); ldv_work_2_0 = 1; } else { } goto ldv_62153; case 1: ; if (ldv_work_2_1 == 2 || ldv_work_2_1 == 3) { ldv_work_2_1 = 4; nes_recheck_link_status(ldv_work_struct_2_0); ldv_work_2_1 = 1; } else { } goto ldv_62153; case 2: ; if (ldv_work_2_2 == 2 || ldv_work_2_2 == 3) { ldv_work_2_2 = 4; nes_recheck_link_status(ldv_work_struct_2_0); ldv_work_2_2 = 1; } else { } goto ldv_62153; case 3: ; if (ldv_work_2_3 == 2 || ldv_work_2_3 == 3) { ldv_work_2_3 = 4; nes_recheck_link_status(ldv_work_struct_2_0); ldv_work_2_3 = 1; } else { } goto ldv_62153; default: ldv_stop(); } ldv_62153: ; return; } } void ldv_initialize_driver_attribute_20(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_idx_data_group0 = (struct device_driver *)tmp; return; } } void work_init_2(void) { { ldv_work_2_0 = 0; ldv_work_2_1 = 0; ldv_work_2_2 = 0; ldv_work_2_3 = 0; return; } } void ldv_initialize_driver_attribute_25(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_flash_cmd_group0 = (struct device_driver *)tmp; return; } } void activate_work_2(struct work_struct *work , int state ) { { if (ldv_work_2_0 == 0) { ldv_work_struct_2_0 = work; ldv_work_2_0 = state; return; } else { } if (ldv_work_2_1 == 0) { ldv_work_struct_2_1 = work; ldv_work_2_1 = state; return; } else { } if (ldv_work_2_2 == 0) { ldv_work_struct_2_2 = work; ldv_work_2_2 = state; return; } else { } if (ldv_work_2_3 == 0) { ldv_work_struct_2_3 = work; ldv_work_2_3 = state; return; } else { } return; } } void ldv_initialize_driver_attribute_19(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_wqm_quanta_group0 = (struct device_driver *)tmp; return; } } void choose_interrupt_1(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_irq_1_0 = ldv_irq_1(ldv_irq_1_0, ldv_irq_line_1_0, ldv_irq_data_1_0); goto ldv_62178; case 1: ldv_irq_1_0 = ldv_irq_1(ldv_irq_1_1, ldv_irq_line_1_1, ldv_irq_data_1_1); goto ldv_62178; case 2: ldv_irq_1_0 = ldv_irq_1(ldv_irq_1_2, ldv_irq_line_1_2, ldv_irq_data_1_2); goto ldv_62178; case 3: ldv_irq_1_0 = ldv_irq_1(ldv_irq_1_3, ldv_irq_line_1_3, ldv_irq_data_1_3); goto ldv_62178; default: ldv_stop(); } ldv_62178: ; return; } } void disable_work_2(struct work_struct *work ) { { if ((ldv_work_2_0 == 3 || ldv_work_2_0 == 2) && (unsigned long )ldv_work_struct_2_0 == (unsigned long )work) { ldv_work_2_0 = 1; } else { } if ((ldv_work_2_1 == 3 || ldv_work_2_1 == 2) && (unsigned long )ldv_work_struct_2_1 == (unsigned long )work) { ldv_work_2_1 = 1; } else { } if ((ldv_work_2_2 == 3 || ldv_work_2_2 == 2) && (unsigned long )ldv_work_struct_2_2 == (unsigned long )work) { ldv_work_2_2 = 1; } else { } if ((ldv_work_2_3 == 3 || ldv_work_2_3 == 2) && (unsigned long )ldv_work_struct_2_3 == (unsigned long )work) { ldv_work_2_3 = 1; } else { } return; } } void ldv_initialize_driver_attribute_28(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_adapter_group0 = (struct device_driver *)tmp; return; } } int ldv_irq_1(int state , int line , void *data ) { irqreturn_t irq_retval ; int tmp ; int tmp___0 ; { tmp = __VERIFIER_nondet_int(); irq_retval = (irqreturn_t )tmp; if (state != 0) { tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (state == 1) { LDV_IN_INTERRUPT = 2; irq_retval = nes_interrupt(line, data); LDV_IN_INTERRUPT = 1; return (state); } else { } goto ldv_62196; default: ldv_stop(); } ldv_62196: ; } else { } return (state); } } void ldv_pci_driver_29(void) { void *tmp ; { tmp = ldv_init_zalloc(2976UL); nes_pci_driver_group1 = (struct pci_dev *)tmp; return; } } void ldv_initialize_driver_attribute_27(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_eeprom_cmd_group0 = (struct device_driver *)tmp; return; } } void call_and_disable_work_2(struct work_struct *work ) { { if ((ldv_work_2_0 == 2 || ldv_work_2_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_0) { nes_recheck_link_status(work); ldv_work_2_0 = 1; return; } else { } if ((ldv_work_2_1 == 2 || ldv_work_2_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_1) { nes_recheck_link_status(work); ldv_work_2_1 = 1; return; } else { } if ((ldv_work_2_2 == 2 || ldv_work_2_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_2) { nes_recheck_link_status(work); ldv_work_2_2 = 1; return; } else { } if ((ldv_work_2_3 == 2 || ldv_work_2_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_3) { nes_recheck_link_status(work); ldv_work_2_3 = 1; return; } else { } return; } } void ldv_initialize_driver_attribute_22(void) { void *tmp ; { tmp = ldv_init_zalloc(120UL); driver_attr_nonidx_data_group0 = (struct device_driver *)tmp; return; } } void ldv_main_exported_18(void) ; void ldv_main_exported_17(void) ; void ldv_main_exported_16(void) ; void ldv_main_exported_13(void) ; void ldv_main_exported_15(void) ; void ldv_main_exported_14(void) ; void ldv_main_exported_12(void) ; int main(void) { size_t ldvarg1 ; char *ldvarg0 ; void *tmp ; char *ldvarg2 ; void *tmp___0 ; size_t ldvarg4 ; char *ldvarg3 ; void *tmp___1 ; char *ldvarg5 ; void *tmp___2 ; void *ldvarg18 ; void *tmp___3 ; struct notifier_block *ldvarg17 ; void *tmp___4 ; unsigned long ldvarg19 ; size_t ldvarg24 ; char *ldvarg25 ; void *tmp___5 ; char *ldvarg23 ; void *tmp___6 ; size_t ldvarg27 ; char *ldvarg26 ; void *tmp___7 ; char *ldvarg28 ; void *tmp___8 ; char *ldvarg31 ; void *tmp___9 ; char *ldvarg29 ; void *tmp___10 ; size_t ldvarg30 ; char *ldvarg32 ; void *tmp___11 ; char *ldvarg34 ; void *tmp___12 ; size_t ldvarg33 ; size_t ldvarg39 ; char *ldvarg40 ; void *tmp___13 ; char *ldvarg38 ; void *tmp___14 ; struct notifier_block *ldvarg41 ; void *tmp___15 ; unsigned long ldvarg43 ; void *ldvarg42 ; void *tmp___16 ; size_t ldvarg45 ; char *ldvarg44 ; void *tmp___17 ; char *ldvarg46 ; void *tmp___18 ; size_t ldvarg51 ; char *ldvarg52 ; void *tmp___19 ; char *ldvarg50 ; void *tmp___20 ; struct pci_device_id *ldvarg53 ; void *tmp___21 ; char *ldvarg65 ; void *tmp___22 ; char *ldvarg63 ; void *tmp___23 ; size_t ldvarg64 ; int tmp___24 ; int tmp___25 ; int tmp___26 ; int tmp___27 ; int tmp___28 ; int tmp___29 ; int tmp___30 ; int tmp___31 ; int tmp___32 ; int tmp___33 ; int tmp___34 ; int tmp___35 ; int tmp___36 ; int tmp___37 ; int tmp___38 ; { tmp = ldv_init_zalloc(1UL); ldvarg0 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg2 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg3 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg5 = (char *)tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg18 = tmp___3; tmp___4 = ldv_init_zalloc(24UL); ldvarg17 = (struct notifier_block *)tmp___4; tmp___5 = ldv_init_zalloc(1UL); ldvarg25 = (char *)tmp___5; tmp___6 = ldv_init_zalloc(1UL); ldvarg23 = (char *)tmp___6; tmp___7 = ldv_init_zalloc(1UL); ldvarg26 = (char *)tmp___7; tmp___8 = ldv_init_zalloc(1UL); ldvarg28 = (char *)tmp___8; tmp___9 = ldv_init_zalloc(1UL); ldvarg31 = (char *)tmp___9; tmp___10 = ldv_init_zalloc(1UL); ldvarg29 = (char *)tmp___10; tmp___11 = ldv_init_zalloc(1UL); ldvarg32 = (char *)tmp___11; tmp___12 = ldv_init_zalloc(1UL); ldvarg34 = (char *)tmp___12; tmp___13 = ldv_init_zalloc(1UL); ldvarg40 = (char *)tmp___13; tmp___14 = ldv_init_zalloc(1UL); ldvarg38 = (char *)tmp___14; tmp___15 = ldv_init_zalloc(24UL); ldvarg41 = (struct notifier_block *)tmp___15; tmp___16 = ldv_init_zalloc(1UL); ldvarg42 = tmp___16; tmp___17 = ldv_init_zalloc(1UL); ldvarg44 = (char *)tmp___17; tmp___18 = ldv_init_zalloc(1UL); ldvarg46 = (char *)tmp___18; tmp___19 = ldv_init_zalloc(1UL); ldvarg52 = (char *)tmp___19; tmp___20 = ldv_init_zalloc(1UL); ldvarg50 = (char *)tmp___20; tmp___21 = ldv_init_zalloc(32UL); ldvarg53 = (struct pci_device_id *)tmp___21; tmp___22 = ldv_init_zalloc(1UL); ldvarg65 = (char *)tmp___22; tmp___23 = ldv_init_zalloc(1UL); ldvarg63 = (char *)tmp___23; ldv_initialize(); ldv_memset((void *)(& ldvarg1), 0, 8UL); ldv_memset((void *)(& ldvarg4), 0, 8UL); ldv_memset((void *)(& ldvarg19), 0, 8UL); ldv_memset((void *)(& ldvarg24), 0, 8UL); ldv_memset((void *)(& ldvarg27), 0, 8UL); ldv_memset((void *)(& ldvarg30), 0, 8UL); ldv_memset((void *)(& ldvarg33), 0, 8UL); ldv_memset((void *)(& ldvarg39), 0, 8UL); ldv_memset((void *)(& ldvarg43), 0, 8UL); ldv_memset((void *)(& ldvarg45), 0, 8UL); ldv_memset((void *)(& ldvarg51), 0, 8UL); ldv_memset((void *)(& ldvarg64), 0, 8UL); ldv_state_variable_21 = 0; ldv_state_variable_7 = 1; ldv_state_variable_26 = 0; ldv_state_variable_17 = 0; work_init_2(); ldv_state_variable_2 = 1; ldv_state_variable_1 = 1; ldv_state_variable_18 = 0; ldv_state_variable_30 = 0; ldv_state_variable_16 = 0; ldv_state_variable_27 = 0; ldv_state_variable_25 = 0; ldv_state_variable_28 = 0; ldv_state_variable_20 = 0; ldv_state_variable_14 = 0; ldv_state_variable_24 = 0; ldv_state_variable_10 = 1; ldv_state_variable_31 = 0; ldv_state_variable_11 = 1; ldv_state_variable_22 = 0; ref_cnt = 0; ldv_state_variable_0 = 1; ldv_state_variable_13 = 0; ldv_state_variable_23 = 0; ldv_state_variable_29 = 0; ldv_state_variable_6 = 1; work_init_3(); ldv_state_variable_3 = 1; ldv_state_variable_9 = 1; ldv_state_variable_12 = 0; ldv_state_variable_15 = 0; ldv_state_variable_8 = 1; work_init_4(); ldv_state_variable_4 = 1; ldv_state_variable_19 = 0; ldv_state_variable_5 = 1; ldv_62386: tmp___24 = __VERIFIER_nondet_int(); switch (tmp___24) { case 0: ; if (ldv_state_variable_21 != 0) { tmp___25 = __VERIFIER_nondet_int(); switch (tmp___25) { case 0: ; if (ldv_state_variable_21 == 1) { nes_store_idx_addr(driver_attr_idx_addr_group0, (char const *)ldvarg2, ldvarg1); ldv_state_variable_21 = 1; } else { } goto ldv_62298; case 1: ; if (ldv_state_variable_21 == 1) { nes_show_idx_addr(driver_attr_idx_addr_group0, ldvarg0); ldv_state_variable_21 = 1; } else { } goto ldv_62298; default: ldv_stop(); } ldv_62298: ; } else { } goto ldv_62301; case 1: ; goto ldv_62301; case 2: ; if (ldv_state_variable_26 != 0) { tmp___26 = __VERIFIER_nondet_int(); switch (tmp___26) { case 0: ; if (ldv_state_variable_26 == 1) { nes_store_ee_data(driver_attr_eeprom_data_group0, (char const *)ldvarg5, ldvarg4); ldv_state_variable_26 = 1; } else { } goto ldv_62305; case 1: ; if (ldv_state_variable_26 == 1) { nes_show_ee_data(driver_attr_eeprom_data_group0, ldvarg3); ldv_state_variable_26 = 1; } else { } goto ldv_62305; default: ldv_stop(); } ldv_62305: ; } else { } goto ldv_62301; case 3: ; if (ldv_state_variable_17 != 0) { ldv_main_exported_17(); } else { } goto ldv_62301; case 4: ; if (ldv_state_variable_2 != 0) { invoke_work_2(); } else { } goto ldv_62301; case 5: ; if (ldv_state_variable_1 != 0) { choose_interrupt_1(); } else { } goto ldv_62301; case 6: ; if (ldv_state_variable_18 != 0) { ldv_main_exported_18(); } else { } goto ldv_62301; case 7: ; if (ldv_state_variable_30 != 0) { tmp___27 = __VERIFIER_nondet_int(); switch (tmp___27) { case 0: ; if (ldv_state_variable_30 == 1) { nes_net_event(ldvarg17, ldvarg19, ldvarg18); ldv_state_variable_30 = 1; } else { } goto ldv_62314; default: ldv_stop(); } ldv_62314: ; } else { } goto ldv_62301; case 8: ; if (ldv_state_variable_16 != 0) { ldv_main_exported_16(); } else { } goto ldv_62301; case 9: ; if (ldv_state_variable_27 != 0) { tmp___28 = __VERIFIER_nondet_int(); switch (tmp___28) { case 0: ; if (ldv_state_variable_27 == 1) { nes_store_ee_cmd(driver_attr_eeprom_cmd_group0, (char const *)ldvarg25, ldvarg24); ldv_state_variable_27 = 1; } else { } goto ldv_62319; case 1: ; if (ldv_state_variable_27 == 1) { nes_show_ee_cmd(driver_attr_eeprom_cmd_group0, ldvarg23); ldv_state_variable_27 = 1; } else { } goto ldv_62319; default: ldv_stop(); } ldv_62319: ; } else { } goto ldv_62301; case 10: ; if (ldv_state_variable_25 != 0) { tmp___29 = __VERIFIER_nondet_int(); switch (tmp___29) { case 0: ; if (ldv_state_variable_25 == 1) { nes_store_flash_cmd(driver_attr_flash_cmd_group0, (char const *)ldvarg28, ldvarg27); ldv_state_variable_25 = 1; } else { } goto ldv_62324; case 1: ; if (ldv_state_variable_25 == 1) { nes_show_flash_cmd(driver_attr_flash_cmd_group0, ldvarg26); ldv_state_variable_25 = 1; } else { } goto ldv_62324; default: ldv_stop(); } ldv_62324: ; } else { } goto ldv_62301; case 11: ; if (ldv_state_variable_28 != 0) { tmp___30 = __VERIFIER_nondet_int(); switch (tmp___30) { case 0: ; if (ldv_state_variable_28 == 1) { nes_store_adapter(driver_attr_adapter_group0, (char const *)ldvarg31, ldvarg30); ldv_state_variable_28 = 1; } else { } goto ldv_62329; case 1: ; if (ldv_state_variable_28 == 1) { nes_show_adapter(driver_attr_adapter_group0, ldvarg29); ldv_state_variable_28 = 1; } else { } goto ldv_62329; default: ldv_stop(); } ldv_62329: ; } else { } goto ldv_62301; case 12: ; if (ldv_state_variable_20 != 0) { tmp___31 = __VERIFIER_nondet_int(); switch (tmp___31) { case 0: ; if (ldv_state_variable_20 == 1) { nes_store_idx_data(driver_attr_idx_data_group0, (char const *)ldvarg34, ldvarg33); ldv_state_variable_20 = 1; } else { } goto ldv_62334; case 1: ; if (ldv_state_variable_20 == 1) { nes_show_idx_data(driver_attr_idx_data_group0, ldvarg32); ldv_state_variable_20 = 1; } else { } goto ldv_62334; default: ldv_stop(); } ldv_62334: ; } else { } goto ldv_62301; case 13: ; if (ldv_state_variable_14 != 0) { ldv_main_exported_14(); } else { } goto ldv_62301; case 14: ; if (ldv_state_variable_24 != 0) { tmp___32 = __VERIFIER_nondet_int(); switch (tmp___32) { case 0: ; if (ldv_state_variable_24 == 1) { nes_store_flash_data(driver_attr_flash_data_group0, (char const *)ldvarg40, ldvarg39); ldv_state_variable_24 = 1; } else { } goto ldv_62340; case 1: ; if (ldv_state_variable_24 == 1) { nes_show_flash_data(driver_attr_flash_data_group0, ldvarg38); ldv_state_variable_24 = 1; } else { } goto ldv_62340; default: ldv_stop(); } ldv_62340: ; } else { } goto ldv_62301; case 15: ; goto ldv_62301; case 16: ; if (ldv_state_variable_31 != 0) { tmp___33 = __VERIFIER_nondet_int(); switch (tmp___33) { case 0: ; if (ldv_state_variable_31 == 1) { nes_inetaddr_event(ldvarg41, ldvarg43, ldvarg42); ldv_state_variable_31 = 1; } else { } goto ldv_62346; default: ldv_stop(); } ldv_62346: ; } else { } goto ldv_62301; case 17: ; goto ldv_62301; case 18: ; if (ldv_state_variable_22 != 0) { tmp___34 = __VERIFIER_nondet_int(); switch (tmp___34) { case 0: ; if (ldv_state_variable_22 == 1) { nes_store_nonidx_data(driver_attr_nonidx_data_group0, (char const *)ldvarg46, ldvarg45); ldv_state_variable_22 = 1; } else { } goto ldv_62351; case 1: ; if (ldv_state_variable_22 == 1) { nes_show_nonidx_data(driver_attr_nonidx_data_group0, ldvarg44); ldv_state_variable_22 = 1; } else { } goto ldv_62351; default: ldv_stop(); } ldv_62351: ; } else { } goto ldv_62301; case 19: ; if (ldv_state_variable_0 != 0) { tmp___35 = __VERIFIER_nondet_int(); switch (tmp___35) { case 0: ; if (ldv_state_variable_0 == 2 && ref_cnt == 0) { nes_exit_module(); ldv_state_variable_0 = 3; goto ldv_final; } else { } goto ldv_62357; case 1: ; if (ldv_state_variable_0 == 1) { ldv_retval_2 = nes_init_module(); if (ldv_retval_2 != 0) { ldv_state_variable_0 = 3; goto ldv_final; } else { } if (ldv_retval_2 == 0) { ldv_state_variable_0 = 2; ldv_state_variable_31 = 1; ldv_state_variable_19 = 1; ldv_initialize_driver_attribute_19(); ldv_state_variable_24 = 1; ldv_initialize_driver_attribute_24(); ldv_state_variable_20 = 1; ldv_initialize_driver_attribute_20(); ldv_state_variable_15 = 1; ldv_state_variable_14 = 1; ldv_state_variable_12 = 1; ldv_initialize_nes_cm_ops_12(); ldv_state_variable_28 = 1; ldv_initialize_driver_attribute_28(); ldv_state_variable_27 = 1; ldv_initialize_driver_attribute_27(); ldv_state_variable_25 = 1; ldv_initialize_driver_attribute_25(); ldv_state_variable_16 = 1; ldv_state_variable_13 = 1; ldv_state_variable_23 = 1; ldv_initialize_driver_attribute_23(); ldv_state_variable_30 = 1; ldv_state_variable_18 = 1; ldv_initialize_ethtool_ops_18(); ldv_state_variable_22 = 1; ldv_initialize_driver_attribute_22(); ldv_state_variable_26 = 1; ldv_initialize_driver_attribute_26(); ldv_state_variable_21 = 1; ldv_initialize_driver_attribute_21(); } else { } } else { } goto ldv_62357; default: ldv_stop(); } ldv_62357: ; } else { } goto ldv_62301; case 20: ; if (ldv_state_variable_13 != 0) { ldv_main_exported_13(); } else { } goto ldv_62301; case 21: ; if (ldv_state_variable_23 != 0) { tmp___36 = __VERIFIER_nondet_int(); switch (tmp___36) { case 0: ; if (ldv_state_variable_23 == 1) { nes_store_nonidx_addr(driver_attr_nonidx_addr_group0, (char const *)ldvarg52, ldvarg51); ldv_state_variable_23 = 1; } else { } goto ldv_62363; case 1: ; if (ldv_state_variable_23 == 1) { nes_show_nonidx_addr(driver_attr_nonidx_addr_group0, ldvarg50); ldv_state_variable_23 = 1; } else { } goto ldv_62363; default: ldv_stop(); } ldv_62363: ; } else { } goto ldv_62301; case 22: ; if (ldv_state_variable_29 != 0) { tmp___37 = __VERIFIER_nondet_int(); switch (tmp___37) { case 0: ; if (ldv_state_variable_29 == 1) { ldv_retval_3 = nes_probe(nes_pci_driver_group1, (struct pci_device_id const *)ldvarg53); if (ldv_retval_3 == 0) { ldv_state_variable_29 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_62368; case 1: ; if (ldv_state_variable_29 == 2) { nes_remove(nes_pci_driver_group1); ldv_state_variable_29 = 1; } else { } goto ldv_62368; case 2: ; if (ldv_state_variable_29 == 2) { ldv_shutdown_29(); ldv_state_variable_29 = 2; } else { } goto ldv_62368; default: ldv_stop(); } ldv_62368: ; } else { } goto ldv_62301; case 23: ; goto ldv_62301; case 24: ; goto ldv_62301; case 25: ; goto ldv_62301; case 26: ; if (ldv_state_variable_12 != 0) { ldv_main_exported_12(); } else { } goto ldv_62301; case 27: ; if (ldv_state_variable_15 != 0) { ldv_main_exported_15(); } else { } goto ldv_62301; case 28: ; goto ldv_62301; case 29: ; goto ldv_62301; case 30: ; if (ldv_state_variable_19 != 0) { tmp___38 = __VERIFIER_nondet_int(); switch (tmp___38) { case 0: ; if (ldv_state_variable_19 == 1) { nes_store_wqm_quanta(driver_attr_wqm_quanta_group0, (char const *)ldvarg65, ldvarg64); ldv_state_variable_19 = 1; } else { } goto ldv_62381; case 1: ; if (ldv_state_variable_19 == 1) { nes_show_wqm_quanta(driver_attr_wqm_quanta_group0, ldvarg63); ldv_state_variable_19 = 1; } else { } goto ldv_62381; default: ldv_stop(); } ldv_62381: ; } else { } goto ldv_62301; case 31: ; goto ldv_62301; default: ldv_stop(); } ldv_62301: ; goto ldv_62386; ldv_final: ldv_check_final_state(); return 0; } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { ldv_spin_unlock(); ldv_spin_unlock_irqrestore_12(lock, flags); return; } } bool ldv_queue_work_on_15(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_16(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_17(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___4 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_18(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_19(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___5 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void *ldv_kmem_cache_alloc_25(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_pskb_expand_head_31(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_33(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv_skb_copy_35(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_36(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_37(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_38(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } int ldv_pskb_expand_head_39(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } int ldv_pskb_expand_head_40(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_41(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } void *ldv_kmem_cache_alloc_42(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } __inline static int ldv_request_irq_43(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = reg_check_1(handler); if (tmp___0 != 0 && ldv_func_res == 0) { activate_suitable_irq_1((int )irq, dev); } else { } return (ldv_func_res); } } int ldv_register_netdev_44(struct net_device *dev ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; { tmp = register_netdev(dev); ldv_func_res = tmp; ldv_state_variable_17 = 1; ldv_net_device_ops_17(); return (ldv_func_res); } } void ldv_unregister_netdev_45(struct net_device *dev ) { { unregister_netdev(dev); ldv_state_variable_17 = 0; return; } } void ldv_free_irq_46(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { free_irq(ldv_func_arg1, ldv_func_arg2); disable_suitable_irq_1((int )ldv_func_arg1, ldv_func_arg2); return; } } void ldv_unregister_netdev_47(struct net_device *dev ) { { unregister_netdev(dev); ldv_state_variable_17 = 0; return; } } void ldv_free_irq_48(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { free_irq(ldv_func_arg1, ldv_func_arg2); disable_suitable_irq_1((int )ldv_func_arg1, ldv_func_arg2); return; } } bool ldv_cancel_delayed_work_sync_49(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___8 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_2(& ldv_func_arg1->work); return (ldv_func_res); } } int ldv___pci_register_driver_50(struct pci_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) { ldv_func_ret_type___9 ldv_func_res ; int tmp ; { tmp = __pci_register_driver(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; ldv_state_variable_29 = 1; ldv_pci_driver_29(); return (ldv_func_res); } } void ldv_pci_unregister_driver_51(struct pci_driver *ldv_func_arg1 ) { { pci_unregister_driver(ldv_func_arg1); ldv_state_variable_29 = 0; return; } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static int test_and_clear_bit(long nr , unsigned long volatile *addr ) { char c ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %2, %0; setc %1": "+m" (*addr), "=qm" (c): "Ir" (nr): "memory"); return ((int )((signed char )c) != 0); } } __inline static int constant_test_bit(long nr , unsigned long const volatile *addr ) { { return ((int )((unsigned long )*(addr + (unsigned long )(nr >> 6)) >> ((int )nr & 63)) & 1); } } __inline static int variable_test_bit(long nr , unsigned long const volatile *addr ) { int oldbit ; { __asm__ volatile ("bt %2,%1\n\tsbb %0,%0": "=r" (oldbit): "m" (*((unsigned long *)addr)), "Ir" (nr)); return (oldbit); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } extern void __might_sleep(char const * , int , int ) ; extern void __list_del_entry(struct list_head * ) ; __inline static void list_del_init(struct list_head *entry ) { { __list_del_entry(entry); INIT_LIST_HEAD(entry); return; } } __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } extern void warn_slowpath_null(char const * , int const ) ; extern unsigned long __phys_addr(unsigned long ) ; extern void *memcpy(void * , void const * , size_t ) ; extern void *memset(void * , int , size_t ) ; extern void __xadd_wrong_size(void) ; __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } __inline static void atomic_dec(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decl %0": "+m" (v->counter)); return; } } __inline static int atomic_add_return(int i , atomic_t *v ) { int __ret ; { __ret = i; switch (4UL) { case 1UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddb %b0, %1\n": "+q" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5763; case 2UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddw %w0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5763; case 4UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddl %0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5763; case 8UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddq %q0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5763; default: __xadd_wrong_size(); } ldv_5763: ; return (__ret + i); } } extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; __inline static void ldv_spin_lock_70(spinlock_t *lock ) { { _raw_spin_lock(& lock->__annonCompField18.rlock); return; } } __inline static void spin_lock(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_74(spinlock_t *lock ) { { _raw_spin_unlock(& lock->__annonCompField18.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) ; __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) ; extern void __init_waitqueue_head(wait_queue_head_t * , char const * , struct lock_class_key * ) ; extern void __wake_up(wait_queue_head_t * , unsigned int , int , void * ) ; extern long prepare_to_wait_event(wait_queue_head_t * , wait_queue_t * , int ) ; extern void finish_wait(wait_queue_head_t * , wait_queue_t * ) ; extern unsigned long volatile jiffies ; extern unsigned long __msecs_to_jiffies(unsigned int const ) ; __inline static unsigned long msecs_to_jiffies(unsigned int const m ) { unsigned long tmp___0 ; { tmp___0 = __msecs_to_jiffies(m); return (tmp___0); } } extern int del_timer(struct timer_list * ) ; int ldv_del_timer_108(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_109(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_110(struct timer_list *ldv_func_arg1 ) ; extern int mod_timer(struct timer_list * , unsigned long ) ; int ldv_mod_timer_111(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; extern void add_timer(struct timer_list * ) ; extern struct workqueue_struct *system_wq ; bool ldv_queue_work_on_80(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_82(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_81(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_84(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; extern bool mod_delayed_work_on(int , struct workqueue_struct * , struct delayed_work * , unsigned long ) ; void ldv_flush_workqueue_83(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_delayed_work(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = ldv_queue_delayed_work_on_81(8192, wq, dwork, delay); return (tmp); } } __inline static bool mod_delayed_work(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = mod_delayed_work_on(8192, wq, dwork, delay); return (tmp); } } __inline static bool schedule_delayed_work(struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = queue_delayed_work(system_wq, dwork, delay); return (tmp); } } extern long schedule_timeout(long ) ; void *ldv_kmem_cache_alloc_90(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_107(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; int reg_timer_7(struct timer_list *timer ) ; void choose_timer_5(struct timer_list *timer ) ; void disable_suitable_timer_6(struct timer_list *timer ) ; void disable_suitable_timer_5(struct timer_list *timer ) ; void activate_pending_timer_6(struct timer_list *timer , unsigned long data , int pending_flag ) ; void disable_suitable_timer_7(struct timer_list *timer ) ; void choose_timer_6(struct timer_list *timer ) ; int reg_timer_6(struct timer_list *timer ) ; void activate_pending_timer_5(struct timer_list *timer , unsigned long data , int pending_flag ) ; void choose_timer_7(struct timer_list *timer ) ; int reg_timer_5(struct timer_list *timer ) ; void activate_pending_timer_7(struct timer_list *timer , unsigned long data , int pending_flag ) ; extern void __const_udelay(unsigned long ) ; extern void msleep(unsigned int ) ; __inline static void kmemcheck_mark_initialized(void *address , unsigned int n ) { { return; } } __inline static int valid_dma_direction(int dma_direction ) { { return ((dma_direction == 0 || dma_direction == 1) || dma_direction == 2); } } extern void debug_dma_map_page(struct device * , struct page * , size_t , size_t , int , dma_addr_t , bool ) ; extern void debug_dma_unmap_page(struct device * , dma_addr_t , size_t , int , bool ) ; extern struct dma_map_ops *dma_ops ; __inline static struct dma_map_ops *get_dma_ops(struct device *dev ) { long tmp ; { tmp = ldv__builtin_expect((unsigned long )dev == (unsigned long )((struct device *)0), 0L); if (tmp != 0L || (unsigned long )dev->archdata.dma_ops == (unsigned long )((struct dma_map_ops *)0)) { return (dma_ops); } else { return (dev->archdata.dma_ops); } } } __inline static dma_addr_t dma_map_single_attrs(struct device *dev , void *ptr , size_t size , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; dma_addr_t addr ; int tmp___0 ; long tmp___1 ; unsigned long tmp___2 ; unsigned long tmp___3 ; { tmp = get_dma_ops(dev); ops = tmp; kmemcheck_mark_initialized(ptr, (unsigned int )size); tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (19), "i" (12UL)); ldv_31658: ; goto ldv_31658; } else { } tmp___2 = __phys_addr((unsigned long )ptr); addr = (*(ops->map_page))(dev, (struct page *)-24189255811072L + (tmp___2 >> 12), (unsigned long )ptr & 4095UL, size, dir, attrs); tmp___3 = __phys_addr((unsigned long )ptr); debug_dma_map_page(dev, (struct page *)-24189255811072L + (tmp___3 >> 12), (unsigned long )ptr & 4095UL, size, (int )dir, addr, 1); return (addr); } } __inline static void dma_unmap_single_attrs(struct device *dev , dma_addr_t addr , size_t size , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int tmp___0 ; long tmp___1 ; { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (36), "i" (12UL)); ldv_31667: ; goto ldv_31667; } else { } if ((unsigned long )ops->unmap_page != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ))0)) { (*(ops->unmap_page))(dev, addr, size, dir, attrs); } else { } debug_dma_unmap_page(dev, addr, size, (int )dir, 1); return; } } __inline static void dma_unmap_page(struct device *dev , dma_addr_t addr , size_t size , enum dma_data_direction dir ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int tmp___0 ; long tmp___1 ; { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (96), "i" (12UL)); ldv_31710: ; goto ldv_31710; } else { } if ((unsigned long )ops->unmap_page != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ))0)) { (*(ops->unmap_page))(dev, addr, size, dir, (struct dma_attrs *)0); } else { } debug_dma_unmap_page(dev, addr, size, (int )dir, 0); return; } } __inline static void *dma_zalloc_coherent(struct device *dev , size_t size , dma_addr_t *dma_handle , gfp_t flags ) ; extern void consume_skb(struct sk_buff * ) ; struct sk_buff *ldv_skb_clone_98(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_106(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_100(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_96(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_104(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_105(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; extern unsigned char *skb_put(struct sk_buff * , unsigned int ) ; __inline static unsigned char *skb_transport_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->transport_header); } } __inline static void skb_reset_transport_header(struct sk_buff *skb ) { { skb->transport_header = (int )((__u16 )((long )skb->data)) - (int )((__u16 )((long )skb->head)); return; } } __inline static void skb_set_transport_header(struct sk_buff *skb , int const offset ) { { skb_reset_transport_header(skb); skb->transport_header = (int )skb->transport_header + (int )((__u16 )offset); return; } } __inline static unsigned char *skb_network_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->network_header); } } __inline static void skb_reset_network_header(struct sk_buff *skb ) { { skb->network_header = (int )((__u16 )((long )skb->data)) - (int )((__u16 )((long )skb->head)); return; } } struct sk_buff *ldv___netdev_alloc_skb_101(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_102(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_103(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct sk_buff *netdev_alloc_skb(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = ldv___netdev_alloc_skb_101(dev, length, 32U); return (tmp); } } __inline static struct sk_buff *dev_alloc_skb(unsigned int length ) { struct sk_buff *tmp ; { tmp = netdev_alloc_skb((struct net_device *)0, length); return (tmp); } } extern void __napi_schedule(struct napi_struct * ) ; __inline static bool napi_disable_pending(struct napi_struct *n ) { int tmp ; { tmp = constant_test_bit(1L, (unsigned long const volatile *)(& n->state)); return (tmp != 0); } } __inline static bool napi_schedule_prep(struct napi_struct *n ) { bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = napi_disable_pending(n); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { tmp___1 = test_and_set_bit(0L, (unsigned long volatile *)(& n->state)); if (tmp___1 == 0) { tmp___2 = 1; } else { tmp___2 = 0; } } else { tmp___2 = 0; } return ((bool )tmp___2); } } __inline static void napi_schedule(struct napi_struct *n ) { bool tmp ; { tmp = napi_schedule_prep(n); if ((int )tmp) { __napi_schedule(n); } else { } return; } } __inline static void netif_tx_start_queue(struct netdev_queue *dev_queue ) { { clear_bit(0L, (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_tx_wake_queue(struct netdev_queue * ) ; __inline static void netif_wake_queue(struct net_device *dev ) { struct netdev_queue *tmp ; { tmp = netdev_get_tx_queue((struct net_device const *)dev, 0U); netif_tx_wake_queue(tmp); return; } } __inline static bool netif_tx_queue_stopped(struct netdev_queue const *dev_queue ) { int tmp ; { tmp = constant_test_bit(0L, (unsigned long const volatile *)(& dev_queue->state)); return (tmp != 0); } } __inline static bool netif_queue_stopped(struct net_device const *dev ) { struct netdev_queue *tmp ; bool tmp___0 ; { tmp = netdev_get_tx_queue(dev, 0U); tmp___0 = netif_tx_queue_stopped((struct netdev_queue const *)tmp); return (tmp___0); } } extern void __dev_kfree_skb_any(struct sk_buff * , enum skb_free_reason ) ; __inline static void dev_kfree_skb_any(struct sk_buff *skb ) { { __dev_kfree_skb_any(skb, 1); return; } } extern int netif_receive_skb_sk(struct sock * , struct sk_buff * ) ; __inline static int netif_receive_skb(struct sk_buff *skb ) { int tmp ; { tmp = netif_receive_skb_sk(skb->sk, skb); return (tmp); } } extern void netif_carrier_on(struct net_device * ) ; extern void netif_carrier_off(struct net_device * ) ; extern __be16 eth_type_trans(struct sk_buff * , struct net_device * ) ; __inline static struct iphdr *ip_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_network_header(skb); return ((struct iphdr *)tmp); } } __inline static struct tcphdr *tcp_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_transport_header(skb); return ((struct tcphdr *)tmp); } } __inline static void __vlan_hwaccel_put_tag(struct sk_buff *skb , __be16 vlan_proto , u16 vlan_tci ) { { skb->vlan_proto = vlan_proto; skb->vlan_tci = (__u16 )((unsigned int )vlan_tci | 4096U); return; } } __inline static unsigned int ip_hdrlen(struct sk_buff const *skb ) { struct iphdr *tmp ; { tmp = ip_hdr(skb); return ((unsigned int )((int )tmp->ihl * 4)); } } extern void lro_receive_skb(struct net_lro_mgr * , struct sk_buff * , void * ) ; extern void lro_flush_all(struct net_lro_mgr * ) ; extern int pci_bus_read_config_word(struct pci_bus * , unsigned int , int , u16 * ) ; __inline static void *pci_zalloc_consistent(struct pci_dev *hwdev , size_t size , dma_addr_t *dma_handle ) { void *tmp ; { tmp = dma_zalloc_coherent((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, size, dma_handle, 32U); return (tmp); } } __inline static dma_addr_t pci_map_single(struct pci_dev *hwdev , void *ptr , size_t size , int direction ) { dma_addr_t tmp ; { tmp = dma_map_single_attrs((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, ptr, size, (enum dma_data_direction )direction, (struct dma_attrs *)0); return (tmp); } } __inline static void pci_unmap_single(struct pci_dev *hwdev , dma_addr_t dma_addr , size_t size , int direction ) { { dma_unmap_single_attrs((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, dma_addr, size, (enum dma_data_direction )direction, (struct dma_attrs *)0); return; } } __inline static void pci_unmap_page(struct pci_dev *hwdev , dma_addr_t dma_address , size_t size , int direction ) { { dma_unmap_page((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, dma_address, size, (enum dma_data_direction )direction); return; } } int schedule_nes_timer(struct nes_cm_node *cm_node , struct sk_buff *skb , enum nes_timer_type type , int send_retrans , int close_when_complete ) ; int nes_cm_recv(struct sk_buff *skb , struct net_device *netdevice ) ; int nes_init_mgt_qp(struct nes_device *nesdev , struct net_device *netdev , struct nes_vnic *nesvnic ) ; void nes_destroy_mgt(struct nes_vnic *nesvnic ) ; u32 mh_detected ; u32 int_mod_timer_init ; u32 int_mod_cq_depth_256 ; u32 int_mod_cq_depth_128 ; u32 int_mod_cq_depth_32 ; u32 int_mod_cq_depth_24 ; u32 int_mod_cq_depth_16 ; u32 int_mod_cq_depth_4 ; u32 int_mod_cq_depth_1 ; __inline static u32 nes_read_indexed___0(struct nes_device *nesdev , u32 reg_index ) { unsigned long flags ; void *addr ; u32 value ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); value = readl((void const volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return (value); } } __inline static void nes_write_indexed___0(struct nes_device *nesdev , u32 reg_index , u32 val ) { unsigned long flags ; void *addr ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); writel(val, (void volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return; } } __inline static int nes_is_resource_allocated(struct nes_adapter *nesadapter , unsigned long *resource_array , u32 resource_num ) { unsigned long flags ; int bit_is_set ; { ldv_spin_lock(); bit_is_set = variable_test_bit((long )resource_num, (unsigned long const volatile *)resource_array); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: resource_num %u is%s allocated.\n", "nes_is_resource_allocated", 454, resource_num, bit_is_set != 0 ? (char *)"" : (char *)" not"); } else { } spin_unlock_irqrestore(& nesadapter->resource_lock, flags); return (bit_is_set); } } void nes_nic_init_timer_defaults(struct nes_device *nesdev , u8 jumbomode ) ; int nes_init_phy(struct nes_device *nesdev ) ; int nes_init_nic_qp(struct nes_device *nesdev , struct net_device *netdev ) ; void nes_destroy_nic_qp(struct nes_vnic *nesvnic ) ; void nes_nic_ce_handler(struct nes_device *nesdev , struct nes_hw_nic_cq *cq ) ; void nes_iwarp_ce_handler(struct nes_device *nesdev , struct nes_hw_cq *hw_cq ) ; void nes_terminate_timeout(unsigned long context ) ; void flush_wqes(struct nes_device *nesdev , struct nes_qp *nesqp , u32 which_wq , u32 wait_completion ) ; int nes_manage_apbvt(struct nes_vnic *nesvnic , u32 accel_local_port , u32 nic_index , u32 add_port ) ; int nes_cm_disconn(struct nes_qp *nesqp ) ; int nes_hw_modify_qp(struct nes_device *nesdev , struct nes_qp *nesqp , u32 next_iwarp_state , u32 termlen , u32 wait_completion ) ; void nes_port_ibevent(struct nes_vnic *nesvnic ) ; int nes_read_eeprom_values(struct nes_device *nesdev , struct nes_adapter *nesadapter ) ; void nes_write_1G_phy_reg(struct nes_device *nesdev , u8 phy_reg , u8 phy_addr , u16 data ) ; void nes_read_1G_phy_reg(struct nes_device *nesdev , u8 phy_reg , u8 phy_addr , u16 *data ) ; void nes_write_10G_phy_reg(struct nes_device *nesdev , u16 phy_addr , u8 dev_addr , u16 phy_reg , u16 data ) ; void nes_read_10G_phy_reg(struct nes_device *nesdev , u8 phy_addr , u8 dev_addr , u16 phy_reg ) ; void nes_free_cqp_request(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) ; void nes_put_cqp_request(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) ; int nes_arp_table(struct nes_device *nesdev , u32 ip_addr , u8 *mac_addr , u32 action ) ; void nes_mh_fix(unsigned long parm ) ; void nes_clc(unsigned long parm ) ; static unsigned int nes_lro_max_aggr = 64U; static int wide_ppm_offset ; static u32 crit_err_count ; static unsigned char const nes_max_critical_error_count = 100U; static void nes_cqp_ce_handler(struct nes_device *nesdev , struct nes_hw_cq *cq ) ; static void nes_init_csr_ne020(struct nes_device *nesdev , u8 hw_rev , u8 port_count ) ; static int nes_init_serdes(struct nes_device *nesdev , u8 hw_rev , u8 port_count , struct nes_adapter *nesadapter , u8 OneG_Mode ) ; static void nes_nic_napi_ce_handler(struct nes_device *nesdev , struct nes_hw_nic_cq *cq ) ; static void nes_process_aeq(struct nes_device *nesdev , struct nes_hw_aeq *aeq ) ; static void nes_process_ceq(struct nes_device *nesdev , struct nes_hw_ceq *ceq ) ; static void nes_process_iwarp_aeqe(struct nes_device *nesdev , struct nes_hw_aeqe *aeqe ) ; static void process_critical_error(struct nes_device *nesdev ) ; static void nes_process_mac_intr(struct nes_device *nesdev , u32 mac_number ) ; static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev , u8 *OneG_Mode ) ; static void nes_terminate_start_timer(struct nes_qp *nesqp ) ; static unsigned char *nes_iwarp_state_str[8U] = { (unsigned char *)"Non-Existent", (unsigned char *)"Idle", (unsigned char *)"RTS", (unsigned char *)"Closing", (unsigned char *)"RSVD1", (unsigned char *)"Terminate", (unsigned char *)"Error", (unsigned char *)"RSVD2"}; static unsigned char *nes_tcp_state_str[16U] = { (unsigned char *)"Non-Existent", (unsigned char *)"Closed", (unsigned char *)"Listen", (unsigned char *)"SYN Sent", (unsigned char *)"SYN Rcvd", (unsigned char *)"Established", (unsigned char *)"Close Wait", (unsigned char *)"FIN Wait 1", (unsigned char *)"Closing", (unsigned char *)"Last Ack", (unsigned char *)"FIN Wait 2", (unsigned char *)"Time Wait", (unsigned char *)"RSVD1", (unsigned char *)"RSVD2", (unsigned char *)"RSVD3", (unsigned char *)"RSVD4"}; __inline static void print_ip(struct nes_cm_node *cm_node ) { unsigned char *rem_addr ; { if ((unsigned long )cm_node != (unsigned long )((struct nes_cm_node *)0)) { rem_addr = (unsigned char *)(& cm_node->rem_addr); printk("\viw_nes: Remote IP addr: %pI4\n", rem_addr); } else { } return; } } void nes_nic_init_timer_defaults(struct nes_device *nesdev , u8 jumbomode ) { unsigned long flags ; struct nes_adapter *nesadapter ; struct nes_hw_tune_timer *shared_timer ; { nesadapter = nesdev->nesadapter; shared_timer = & nesadapter->tune_timer; ldv_spin_lock(); shared_timer->timer_in_use_min = 40U; shared_timer->timer_in_use_max = 1000U; if ((unsigned int )jumbomode != 0U) { shared_timer->threshold_low = 12U; shared_timer->threshold_target = 40U; shared_timer->threshold_high = 128U; } else { shared_timer->threshold_low = 16U; shared_timer->threshold_target = 64U; shared_timer->threshold_high = 256U; } spin_unlock_irqrestore(& nesadapter->periodic_timer_lock, flags); return; } } static void nes_nic_init_timer(struct nes_device *nesdev ) { unsigned long flags ; struct nes_adapter *nesadapter ; struct nes_hw_tune_timer *shared_timer ; { nesadapter = nesdev->nesadapter; shared_timer = & nesadapter->tune_timer; ldv_spin_lock(); if ((unsigned int )shared_timer->timer_in_use_old == 0U) { nesdev->deepcq_count = 0U; shared_timer->timer_direction_upward = 0U; shared_timer->timer_direction_downward = 0U; shared_timer->timer_in_use = 96U; shared_timer->timer_in_use_old = 0U; } else { } if ((int )shared_timer->timer_in_use != (int )shared_timer->timer_in_use_old) { shared_timer->timer_in_use_old = shared_timer->timer_in_use; nes_write32(nesdev->regs + 24UL, (unsigned int )((int )shared_timer->timer_in_use * 8) | 2147483648U); } else { } spin_unlock_irqrestore(& nesadapter->periodic_timer_lock, flags); return; } } static void nes_nic_tune_timer(struct nes_device *nesdev ) { unsigned long flags ; struct nes_adapter *nesadapter ; struct nes_hw_tune_timer *shared_timer ; u16 cq_count ; { nesadapter = nesdev->nesadapter; shared_timer = & nesadapter->tune_timer; cq_count = nesdev->currcq_count; ldv_spin_lock(); if ((int )shared_timer->cq_count_old <= (int )cq_count) { shared_timer->cq_direction_downward = 0U; } else { shared_timer->cq_direction_downward = (u8 )((int )shared_timer->cq_direction_downward + 1); } shared_timer->cq_count_old = cq_count; if ((unsigned int )shared_timer->cq_direction_downward > 16U) { if ((int )shared_timer->threshold_low >= (int )cq_count && (unsigned int )shared_timer->threshold_low > 4U) { shared_timer->threshold_low = (u16 )((unsigned int )shared_timer->threshold_low / 2U); shared_timer->cq_direction_downward = 0U; nesdev->currcq_count = 0U; spin_unlock_irqrestore(& nesadapter->periodic_timer_lock, flags); return; } else { } } else { } if ((unsigned int )cq_count > 1U) { nesdev->deepcq_count = (int )nesdev->deepcq_count + (int )cq_count; if ((int )shared_timer->threshold_low >= (int )cq_count) { shared_timer->timer_direction_upward = (u8 )((int )shared_timer->timer_direction_upward + 1); shared_timer->timer_direction_downward = 0U; } else if ((int )shared_timer->threshold_target >= (int )cq_count) { shared_timer->timer_direction_upward = 0U; shared_timer->timer_direction_downward = 0U; } else if ((int )shared_timer->threshold_high >= (int )cq_count) { shared_timer->timer_direction_downward = (u8 )((int )shared_timer->timer_direction_downward + 1); shared_timer->timer_direction_upward = 0U; } else if ((int )cq_count <= (int )shared_timer->threshold_high * 2) { shared_timer->timer_in_use = (unsigned int )shared_timer->timer_in_use + 65534U; shared_timer->timer_direction_upward = 0U; shared_timer->timer_direction_downward = (u8 )((int )shared_timer->timer_direction_downward + 1); } else { shared_timer->timer_in_use = (unsigned int )shared_timer->timer_in_use + 65532U; shared_timer->timer_direction_upward = 0U; shared_timer->timer_direction_downward = (u8 )((int )shared_timer->timer_direction_downward + 1); } if ((unsigned int )shared_timer->timer_direction_upward > 3U) { shared_timer->timer_in_use = (unsigned int )shared_timer->timer_in_use + 3U; shared_timer->timer_direction_upward = 0U; shared_timer->timer_direction_downward = 0U; } else { } if ((unsigned int )shared_timer->timer_direction_downward > 5U) { shared_timer->timer_in_use = (unsigned int )shared_timer->timer_in_use + 65532U; shared_timer->timer_direction_downward = 0U; shared_timer->timer_direction_upward = 0U; } else { } } else { } if ((int )shared_timer->timer_in_use > (int )shared_timer->threshold_high) { shared_timer->timer_in_use = shared_timer->threshold_high; } else if ((int )shared_timer->timer_in_use < (int )shared_timer->threshold_low) { shared_timer->timer_in_use = shared_timer->threshold_low; } else { } nesdev->currcq_count = 0U; spin_unlock_irqrestore(& nesadapter->periodic_timer_lock, flags); return; } } struct nes_adapter *nes_init_adapter(struct nes_device *nesdev , u8 hw_rev ) { struct nes_adapter *nesadapter ; unsigned long num_pds ; u32 u32temp ; u32 port_count ; u16 max_rq_wrs ; u16 max_sq_wrs ; u32 max_mr ; u32 max_256pbl ; u32 max_4kpbl ; u32 max_qp ; u32 max_irrq ; u32 max_cq ; u32 hte_index_mask ; u32 adapter_size ; u32 arp_table_size ; u16 vendor_id ; u16 device_id ; u8 OneG_Mode ; u8 func_index ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; u32 tmp ; u32 tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; void *tmp___3 ; int tmp___4 ; int tmp___5 ; u16 _min1 ; u16 _min2 ; int tmp___6 ; u32 tmp___7 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; u32 pcs_control_status0 ; u32 pcs_control_status1 ; u32 reset_value ; u32 i ; u32 int_cnt ; u32 ext_cnt ; unsigned long flags ; u32 j ; u32 tmp___8 ; u32 tmp___9 ; u32 tmp___10 ; u32 tmp___11 ; char const *tmp___12 ; { nesadapter = (struct nes_adapter *)0; __mptr = (struct list_head const *)nes_adapter_list.next; nesadapter = (struct nes_adapter *)__mptr + 0xffffffffffffffc0UL; goto ldv_61032; ldv_61031: ; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Searching Adapter list for PCI devfn = 0x%X, adapter PCI slot/bus = %u/%u, pci devices PCI slot/bus = %u/%u, .\n", "nes_init_adapter", 283, (nesdev->pcidev)->devfn, (nesadapter->devfn >> 3) & 31U, (int )nesadapter->bus_number, ((nesdev->pcidev)->devfn >> 3) & 31U, (int )((nesdev->pcidev)->bus)->number); } else { } if ((((nesadapter->devfn >> 3) ^ ((nesdev->pcidev)->devfn >> 3)) & 31U) == 0U && (int )nesadapter->bus_number == (int )((nesdev->pcidev)->bus)->number) { nesadapter->ref_count = (unsigned char )((int )nesadapter->ref_count + 1); return (nesadapter); } else { } __mptr___0 = (struct list_head const *)nesadapter->list.next; nesadapter = (struct nes_adapter *)__mptr___0 + 0xffffffffffffffc0UL; ldv_61032: ; if ((unsigned long )(& nesadapter->list) != (unsigned long )(& nes_adapter_list)) { goto ldv_61031; } else { } num_pds = (nesdev->pcidev)->resource[2].start != 0ULL || (nesdev->pcidev)->resource[2].end != (nesdev->pcidev)->resource[2].start ? (unsigned long )((((nesdev->pcidev)->resource[2].end - (nesdev->pcidev)->resource[2].start) + 1ULL) >> 12) : 0UL; if ((unsigned int )hw_rev != 4U && (unsigned int )hw_rev != 5U) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: NE020 driver detected unknown hardware revision 0x%x\n", "nes_init_adapter", 295, (int )hw_rev); } else { } return ((struct nes_adapter *)0); } else { } if ((nes_debug_level & 2U) != 0U) { tmp = nes_read_indexed___0(nesdev, 168U); tmp___0 = nes_read_indexed___0(nesdev, 164U); tmp___1 = nes_read_indexed___0(nesdev, 160U); tmp___2 = nes_read_indexed___0(nesdev, (((nesdev->pcidev)->devfn & 7U) + 8U) * 8U); printk("\viw_nes: %s[%u]: Determine Soft Reset, QP_control=0x%x, CPU0=0x%x, CPU1=0x%x, CPU2=0x%x\n", "nes_init_adapter", 303, tmp___2, tmp___1, tmp___0, tmp); } else { } if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Reset and init NE020\n", "nes_init_adapter", 305); } else { } port_count = nes_reset_adapter_ne020(nesdev, & OneG_Mode); if (port_count == 0U) { return ((struct nes_adapter *)0); } else { } max_qp = nes_read_indexed___0(nesdev, 536U); if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: QP_CTX_SIZE=%u\n", "nes_init_adapter", 312, max_qp); } else { } u32temp = nes_read_indexed___0(nesdev, 24904U); if (1U << ((int )u32temp & 31) < max_qp) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Reducing Max QPs to %u due to hash table size = 0x%08X\n", "nes_init_adapter", 317, max_qp, u32temp); } else { } max_qp = 1U << ((int )u32temp & 31); } else { } hte_index_mask = (1U << (int )((u32temp & 31U) + 1U)) - 1U; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Max QP = %u, hte_index_mask = 0x%08X.\n", "nes_init_adapter", 323, max_qp, hte_index_mask); } else { } u32temp = nes_read_indexed___0(nesdev, 688U); max_irrq = (u32 )(1 << ((int )u32temp & 31)); if (max_qp > max_irrq) { max_qp = max_irrq; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Reducing Max QPs to %u due to Available Q1s.\n", "nes_init_adapter", 332, max_qp); } else { } } else { } if ((unsigned long )max_qp < num_pds) { num_pds = (unsigned long )max_qp; } else { } u32temp = nes_read_indexed___0(nesdev, 632U); max_mr = 8192U << ((int )u32temp & 7); u32temp = nes_read_indexed___0(nesdev, 640U); max_256pbl = 1U << ((int )u32temp & 31); max_4kpbl = 1U << ((int )(u32temp >> 16) & 31); max_cq = nes_read_indexed___0(nesdev, 608U); u32temp = nes_read_indexed___0(nesdev, 600U); arp_table_size = (u32 )(1 << (int )u32temp); adapter_size = 50912U; adapter_size = (u32 )(((unsigned long )max_qp + 63UL) / 64UL) * 8U + adapter_size; adapter_size = (u32 )(((unsigned long )max_mr + 63UL) / 64UL) * 8U + adapter_size; adapter_size = (u32 )(((unsigned long )max_cq + 63UL) / 64UL) * 8U + adapter_size; adapter_size = (u32 )((num_pds + 63UL) / 64UL) * 8U + adapter_size; adapter_size = (u32 )(((unsigned long )arp_table_size + 63UL) / 64UL) * 8U + adapter_size; adapter_size = max_qp * 8U + adapter_size; tmp___3 = kzalloc((size_t )adapter_size, 208U); nesadapter = (struct nes_adapter *)tmp___3; if ((unsigned long )nesadapter == (unsigned long )((struct nes_adapter *)0)) { return ((struct nes_adapter *)0); } else { } if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Allocating new nesadapter @ %p, size = %u (actual size = %u).\n", "nes_init_adapter", 366, nesadapter, 50912U, adapter_size); } else { } tmp___4 = nes_read_eeprom_values(nesdev, nesadapter); if (tmp___4 != 0) { printk("\viw_nes: Unable to read EEPROM data.\n"); kfree((void const *)nesadapter); return ((struct nes_adapter *)0); } else { } nesadapter->vendor_id = ((unsigned int )nesadapter->mac_addr_high << 8) | (nesadapter->mac_addr_low >> 24); pci_bus_read_config_word((nesdev->pcidev)->bus, (nesdev->pcidev)->devfn, 2, & device_id); nesadapter->vendor_part_id = (u32 )device_id; tmp___5 = nes_init_serdes(nesdev, (int )hw_rev, (int )((u8 )port_count), nesadapter, (int )OneG_Mode); if (tmp___5 != 0) { kfree((void const *)nesadapter); return ((struct nes_adapter *)0); } else { } nes_init_csr_ne020(nesdev, (int )hw_rev, (int )((u8 )port_count)); memset((void *)(& nesadapter->pft_mcast_map), 255, 48UL); nesadapter->devfn = (nesdev->pcidev)->devfn; nesadapter->bus_number = ((nesdev->pcidev)->bus)->number; nesadapter->ref_count = 1U; nesadapter->timer_int_req = 4294901760U; nesadapter->OneG_Mode = OneG_Mode; nesadapter->doorbell_start = nesdev->doorbell_region; nesadapter->hw_rev = (u32 )hw_rev; nesadapter->port_count = (u8 )port_count; nesadapter->max_qp = max_qp; nesadapter->hte_index_mask = hte_index_mask; nesadapter->max_irrq = max_irrq; nesadapter->max_mr = max_mr; nesadapter->max_256pbl = max_256pbl - 1U; nesadapter->max_4kpbl = max_4kpbl - 1U; nesadapter->max_cq = max_cq; nesadapter->free_256pbl = max_256pbl - 1U; nesadapter->free_4kpbl = max_4kpbl - 1U; nesadapter->max_pd = (u32 )num_pds; nesadapter->arp_table_size = arp_table_size; nesadapter->et_pkt_rate_low = 4U; if ((nes_drv_opt & 256U) != 0U) { nesadapter->et_use_adaptive_rx_coalesce = 0U; nesadapter->timer_int_limit = 2U; nesadapter->et_rx_coalesce_usecs_irq = (u32 )interrupt_mod_interval; } else { nesadapter->et_use_adaptive_rx_coalesce = 1U; nesadapter->timer_int_limit = 10U; nesadapter->et_rx_coalesce_usecs_irq = 0U; printk("iw_nes: %s: Using Adaptive Interrupt Moderation\n", "nes_init_adapter"); } if (nesadapter->et_rx_coalesce_usecs_irq != 0U) { nes_write32(nesdev->regs + 24UL, nesadapter->et_rx_coalesce_usecs_irq * 8U | 2147483648U); } else { nes_write32(nesdev->regs + 24UL, 0U); } nesadapter->base_pd = 1U; nesadapter->device_cap_flags = 2260992U; nesadapter->allocated_qps = (unsigned long *)nesadapter + 50912U; nesadapter->allocated_cqs = nesadapter->allocated_qps + ((unsigned long )max_qp + 63UL) / 64UL; nesadapter->allocated_mrs = nesadapter->allocated_cqs + ((unsigned long )max_cq + 63UL) / 64UL; nesadapter->allocated_pds = nesadapter->allocated_mrs + ((unsigned long )max_mr + 63UL) / 64UL; nesadapter->allocated_arps = nesadapter->allocated_pds + (num_pds + 63UL) / 64UL; nesadapter->qp_table = (struct nes_qp **)(nesadapter->allocated_arps + ((unsigned long )arp_table_size + 63UL) / 64UL); u32temp = 0U; goto ldv_61035; ldv_61034: set_bit((long )u32temp, (unsigned long volatile *)nesadapter->allocated_qps); set_bit((long )u32temp, (unsigned long volatile *)nesadapter->allocated_cqs); u32temp = u32temp + 1U; ldv_61035: ; if (u32temp <= 63U) { goto ldv_61034; } else { } set_bit(0L, (unsigned long volatile *)nesadapter->allocated_mrs); u32temp = 0U; goto ldv_61038; ldv_61037: set_bit((long )u32temp, (unsigned long volatile *)nesadapter->allocated_pds); u32temp = u32temp + 1U; ldv_61038: ; if (u32temp <= 19U) { goto ldv_61037; } else { } u32temp = nes_read_indexed___0(nesdev, 512U); max_rq_wrs = (unsigned int )((u16 )(u32temp >> 8)) & 3U; switch ((int )max_rq_wrs) { case 0: max_rq_wrs = 4U; goto ldv_61041; case 1: max_rq_wrs = 16U; goto ldv_61041; case 2: max_rq_wrs = 32U; goto ldv_61041; case 3: max_rq_wrs = 512U; goto ldv_61041; } ldv_61041: max_sq_wrs = (unsigned int )((u16 )u32temp) & 3U; switch ((int )max_sq_wrs) { case 0: max_sq_wrs = 4U; goto ldv_61046; case 1: max_sq_wrs = 16U; goto ldv_61046; case 2: max_sq_wrs = 32U; goto ldv_61046; case 3: max_sq_wrs = 512U; goto ldv_61046; } ldv_61046: _min1 = max_rq_wrs; _min2 = max_sq_wrs; nesadapter->max_qp_wr = (u32 )((int )_min1 < (int )_min2 ? _min1 : _min2); nesadapter->max_irrq_wr = (unsigned int )((u16 )(u32temp >> 16)) & 3U; nesadapter->max_sge = 4U; nesadapter->max_cqe = 32766U; tmp___6 = nes_read_eeprom_values(nesdev, nesadapter); if (tmp___6 != 0) { printk("\viw_nes: Unable to read EEPROM data.\n"); kfree((void const *)nesadapter); return ((struct nes_adapter *)0); } else { } u32temp = nes_read_indexed___0(nesdev, 492U); nes_write_indexed___0(nesdev, 492U, (u32temp & 4278190080U) | (nesadapter->tcp_timer_core_clk_divisor & 16777215U)); if ((unsigned int )nesadapter->port_count == 1U) { nesadapter->log_port = 0U; if ((nes_drv_opt & 32U) != 0U) { nes_write_indexed___0(nesdev, 24760U, 2U); } else { nes_write_indexed___0(nesdev, 24760U, 3U); } } else { if ((unsigned int )nesadapter->phy_type[0] == 5U) { nesadapter->log_port = 216U; } else if ((unsigned int )nesadapter->port_count == 2U) { nesadapter->log_port = 68U; } else { nesadapter->log_port = 228U; } nes_write_indexed___0(nesdev, 24760U, 3U); } nes_write_indexed___0(nesdev, 24576U, (u32 )nesadapter->log_port); if ((nes_debug_level & 2U) != 0U) { tmp___7 = nes_read_indexed___0(nesdev, 24576U); printk("\viw_nes: %s[%u]: Probe time, LOG2PHY=%u\n", "nes_init_adapter", 528, tmp___7); } else { } spinlock_check(& nesadapter->resource_lock); __raw_spin_lock_init(& nesadapter->resource_lock.__annonCompField18.rlock, "&(&nesadapter->resource_lock)->rlock", & __key); spinlock_check(& nesadapter->phy_lock); __raw_spin_lock_init(& nesadapter->phy_lock.__annonCompField18.rlock, "&(&nesadapter->phy_lock)->rlock", & __key___0); spinlock_check(& nesadapter->pbl_lock); __raw_spin_lock_init(& nesadapter->pbl_lock.__annonCompField18.rlock, "&(&nesadapter->pbl_lock)->rlock", & __key___1); spinlock_check(& nesadapter->periodic_timer_lock); __raw_spin_lock_init(& nesadapter->periodic_timer_lock.__annonCompField18.rlock, "&(&nesadapter->periodic_timer_lock)->rlock", & __key___2); INIT_LIST_HEAD((struct list_head *)(& nesadapter->nesvnic_list)); INIT_LIST_HEAD((struct list_head *)(& nesadapter->nesvnic_list) + 1UL); INIT_LIST_HEAD((struct list_head *)(& nesadapter->nesvnic_list) + 2UL); INIT_LIST_HEAD((struct list_head *)(& nesadapter->nesvnic_list) + 3UL); if ((unsigned int )nesadapter->OneG_Mode == 0U && (unsigned int )nesadapter->port_count == 2U) { i = 0U; int_cnt = 0U; ext_cnt = 0U; j = 0U; pcs_control_status0 = nes_read_indexed___0(nesdev, 10240U); pcs_control_status1 = nes_read_indexed___0(nesdev, 10752U); i = 0U; goto ldv_61066; ldv_61065: pcs_control_status0 = nes_read_indexed___0(nesdev, 10240U); pcs_control_status1 = nes_read_indexed___0(nesdev, 10752U); if ((pcs_control_status0 & 251658496U) == 251658496U || (pcs_control_status1 & 251658496U) == 251658496U) { int_cnt = int_cnt + 1U; } else { } msleep(1U); i = i + 1U; ldv_61066: ; if (i <= 199U) { goto ldv_61065; } else { } if (int_cnt > 1U) { ldv_spin_lock(); nes_write_indexed___0(nesdev, 10760U, 61640U); mh_detected = mh_detected + 1U; reset_value = nes_read32((void const *)nesdev->regs + 48U); reset_value = reset_value | 61U; nes_write32(nesdev->regs + 48UL, reset_value); goto ldv_61069; ldv_61068: ; ldv_61069: tmp___8 = nes_read32((void const *)nesdev->regs + 48U); if ((tmp___8 & 64U) == 0U) { tmp___9 = j; j = j + 1U; if (tmp___9 <= 4999U) { goto ldv_61068; } else { goto ldv_61070; } } else { } ldv_61070: spin_unlock_irqrestore(& nesadapter->phy_lock, flags); pcs_control_status0 = nes_read_indexed___0(nesdev, 10240U); pcs_control_status1 = nes_read_indexed___0(nesdev, 10752U); i = 0U; goto ldv_61076; ldv_61075: pcs_control_status0 = nes_read_indexed___0(nesdev, 10240U); pcs_control_status1 = nes_read_indexed___0(nesdev, 10752U); if ((pcs_control_status0 & 251658496U) == 251658496U || (pcs_control_status1 & 251658496U) == 251658496U) { ext_cnt = ext_cnt + 1U; if (ext_cnt > int_cnt) { ldv_spin_lock(); nes_write_indexed___0(nesdev, 10760U, 61576U); mh_detected = mh_detected + 1U; reset_value = nes_read32((void const *)nesdev->regs + 48U); reset_value = reset_value | 61U; nes_write32(nesdev->regs + 48UL, reset_value); goto ldv_61072; ldv_61071: ; ldv_61072: tmp___10 = nes_read32((void const *)nesdev->regs + 48U); if ((tmp___10 & 64U) == 0U) { tmp___11 = j; j = j + 1U; if (tmp___11 <= 4999U) { goto ldv_61071; } else { goto ldv_61073; } } else { } ldv_61073: spin_unlock_irqrestore(& nesadapter->phy_lock, flags); goto ldv_61074; } else { } } else { } msleep(1U); i = i + 1U; ldv_61076: ; if (i <= 199U) { goto ldv_61075; } else { } ldv_61074: ; } else { } } else { } if (nesadapter->hw_rev == 4U) { reg_timer_7(& nesadapter->mh_timer); nesadapter->mh_timer.function = & nes_mh_fix; nesadapter->mh_timer.expires = (unsigned long )jiffies + 50UL; nesadapter->mh_timer.data = (unsigned long )nesdev; add_timer(& nesadapter->mh_timer); } else { nes_write32(nesdev->regs + 12UL, 251658240U); } reg_timer_7(& nesadapter->lc_timer); nesadapter->lc_timer.function = & nes_clc; nesadapter->lc_timer.expires = (unsigned long )jiffies + 900000UL; nesadapter->lc_timer.data = (unsigned long )nesdev; add_timer(& nesadapter->lc_timer); list_add_tail(& nesadapter->list, & nes_adapter_list); func_index = 0U; goto ldv_61079; ldv_61078: pci_bus_read_config_word((nesdev->pcidev)->bus, ((nesdev->pcidev)->devfn & 248U) | ((unsigned int )func_index & 7U), 0, & vendor_id); if ((unsigned int )vendor_id == 65535U) { goto ldv_61077; } else { } func_index = (u8 )((int )func_index + 1); ldv_61079: ; if ((unsigned int )func_index <= 7U) { goto ldv_61078; } else { } ldv_61077: ; if ((nes_debug_level & 2U) != 0U) { tmp___12 = pci_name((struct pci_dev const *)nesdev->pcidev); printk("\viw_nes: %s[%u]: %s %d functions found for %s.\n", "nes_init_adapter", 634, "nes_init_adapter", (int )func_index, tmp___12); } else { } nesadapter->adapter_fcn_count = func_index; return (nesadapter); } } static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev , u8 *OneG_Mode ) { u32 port_count ; u32 u32temp ; u32 i ; unsigned long __ms ; unsigned long tmp ; u32 tmp___0 ; u32 tmp___1 ; unsigned long __ms___0 ; unsigned long tmp___2 ; u32 tmp___3 ; u32 tmp___4 ; u32 tmp___5 ; u32 tmp___6 ; unsigned long __ms___1 ; unsigned long tmp___7 ; u32 tmp___8 ; u32 tmp___9 ; unsigned long __ms___2 ; unsigned long tmp___10 ; u32 tmp___11 ; u32 tmp___12 ; unsigned long __ms___3 ; unsigned long tmp___13 ; u32 tmp___14 ; u32 tmp___15 ; { u32temp = nes_read32((void const *)nesdev->regs + 48U); port_count = ((u32temp & 768U) >> 8) + 1U; *OneG_Mode = (u32temp & 15360U) == 0U; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Initial Software Reset = 0x%08X, port_count=%u\n", "nes_reset_adapter_ne020", 655, u32temp, port_count); } else { } if ((unsigned int )*OneG_Mode != 0U) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Running in 1G mode.\n", "nes_reset_adapter_ne020", 657); } else { } } else { } u32temp = u32temp & 4278255552U; switch (port_count) { case 1U: u32temp = u32temp | 15597568U; goto ldv_61089; case 2U: u32temp = u32temp | 13369344U; goto ldv_61089; case 4U: u32temp = u32temp; goto ldv_61089; default: ; return (0U); } ldv_61089: tmp___6 = nes_read_indexed___0(nesdev, (((nesdev->pcidev)->devfn & 7U) + 8U) * 8U); if (tmp___6 != 0U) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Issuing Full Soft reset = 0x%08X\n", "nes_reset_adapter_ne020", 676, u32temp | 13U); } else { } nes_write32(nesdev->regs + 48UL, u32temp | 13U); i = 0U; goto ldv_61098; ldv_61097: ; if (1) { __const_udelay(4295000UL); } else { __ms = 1UL; goto ldv_61095; ldv_61094: __const_udelay(4295000UL); ldv_61095: tmp = __ms; __ms = __ms - 1UL; if (tmp != 0UL) { goto ldv_61094; } else { } } ldv_61098: tmp___0 = nes_read32((void const *)nesdev->regs + 48U); if ((tmp___0 & 64U) == 0U) { tmp___1 = i; i = i + 1U; if (tmp___1 <= 9999U) { goto ldv_61097; } else { goto ldv_61099; } } else { } ldv_61099: ; if (i > 10000U) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Did not see full soft reset done.\n", "nes_reset_adapter_ne020", 683); } else { } return (0U); } else { } i = 0U; goto ldv_61105; ldv_61104: ; if (1) { __const_udelay(4295000UL); } else { __ms___0 = 1UL; goto ldv_61102; ldv_61101: __const_udelay(4295000UL); ldv_61102: tmp___2 = __ms___0; __ms___0 = __ms___0 - 1UL; if (tmp___2 != 0UL) { goto ldv_61101; } else { } } ldv_61105: tmp___3 = nes_read_indexed___0(nesdev, 160U); if (tmp___3 != 128U) { tmp___4 = i; i = i + 1U; if (tmp___4 <= 9999U) { goto ldv_61104; } else { goto ldv_61106; } } else { } ldv_61106: ; if (i > 10000U) { tmp___5 = nes_read_indexed___0(nesdev, 160U); printk("\viw_nes: Internal CPU not ready, status = %02X\n", tmp___5); return (0U); } else { } } else { } switch (port_count) { case 1U: u32temp = u32temp | 15597584U; goto ldv_61108; case 2U: u32temp = u32temp | 13369392U; goto ldv_61108; case 4U: u32temp = u32temp | 48U; goto ldv_61108; } ldv_61108: ; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Issuing Port Soft reset = 0x%08X\n", "nes_reset_adapter_ne020", 710, u32temp | 13U); } else { } nes_write32(nesdev->regs + 48UL, u32temp | 13U); i = 0U; goto ldv_61116; ldv_61115: ; if (1) { __const_udelay(4295000UL); } else { __ms___1 = 1UL; goto ldv_61113; ldv_61112: __const_udelay(4295000UL); ldv_61113: tmp___7 = __ms___1; __ms___1 = __ms___1 - 1UL; if (tmp___7 != 0UL) { goto ldv_61112; } else { } } ldv_61116: tmp___8 = nes_read32((void const *)nesdev->regs + 48U); if ((tmp___8 & 64U) == 0U) { tmp___9 = i; i = i + 1U; if (tmp___9 <= 9999U) { goto ldv_61115; } else { goto ldv_61117; } } else { } ldv_61117: ; if (i > 10000U) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Did not see port soft reset done.\n", "nes_reset_adapter_ne020", 717); } else { } return (0U); } else { } i = 0U; goto ldv_61123; ldv_61122: ; if (1) { __const_udelay(4295000UL); } else { __ms___2 = 1UL; goto ldv_61120; ldv_61119: __const_udelay(4295000UL); ldv_61120: tmp___10 = __ms___2; __ms___2 = __ms___2 - 1UL; if (tmp___10 != 0UL) { goto ldv_61119; } else { } } ldv_61123: tmp___11 = nes_read_indexed___0(nesdev, 10252U); u32temp = tmp___11 & 15U; if (u32temp != 15U) { tmp___12 = i; i = i + 1U; if (tmp___12 <= 4999U) { goto ldv_61122; } else { goto ldv_61124; } } else { } ldv_61124: ; if (i > 5000U) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Serdes 0 not ready, status=%x\n", "nes_reset_adapter_ne020", 727, u32temp); } else { } return (0U); } else { } if (port_count > 1U) { i = 0U; goto ldv_61130; ldv_61129: ; if (1) { __const_udelay(4295000UL); } else { __ms___3 = 1UL; goto ldv_61127; ldv_61126: __const_udelay(4295000UL); ldv_61127: tmp___13 = __ms___3; __ms___3 = __ms___3 - 1UL; if (tmp___13 != 0UL) { goto ldv_61126; } else { } } ldv_61130: tmp___14 = nes_read_indexed___0(nesdev, 10764U); u32temp = tmp___14 & 15U; if (u32temp != 15U) { tmp___15 = i; i = i + 1U; if (tmp___15 <= 4999U) { goto ldv_61129; } else { goto ldv_61131; } } else { } ldv_61131: ; if (i > 5000U) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Serdes 1 not ready, status=%x\n", "nes_reset_adapter_ne020", 738, u32temp); } else { } return (0U); } else { } } else { } return (port_count); } } static int nes_init_serdes(struct nes_device *nesdev , u8 hw_rev , u8 port_count , struct nes_adapter *nesadapter , u8 OneG_Mode ) { int i ; u32 u32temp ; u32 sds ; unsigned long __ms ; unsigned long tmp ; u32 tmp___0 ; int tmp___1 ; unsigned long __ms___0 ; unsigned long tmp___2 ; u32 tmp___3 ; int tmp___4 ; { if ((unsigned int )hw_rev != 4U) { switch ((int )nesadapter->phy_type[0]) { case 1: ; if (wide_ppm_offset != 0) { nes_write_indexed___0(nesdev, 10292U, 1048490U); } else { nes_write_indexed___0(nesdev, 10292U, 255U); } goto ldv_61143; case 9: nes_write_indexed___0(nesdev, 10292U, 255U); nes_write_indexed___0(nesdev, 10256U, 0U); goto ldv_61143; case 5: nes_write_indexed___0(nesdev, 10292U, 255U); sds = nes_read_indexed___0(nesdev, 10248U); sds = sds | 256U; nes_write_indexed___0(nesdev, 10248U, sds); goto ldv_61143; default: nes_write_indexed___0(nesdev, 10292U, 255U); goto ldv_61143; } ldv_61143: ; if ((unsigned int )OneG_Mode == 0U) { nes_write_indexed___0(nesdev, 10296U, 286326784U); } else { } if ((unsigned int )port_count <= 1U) { return (0); } else { } if ((unsigned int )OneG_Mode == 0U || (unsigned int )nesadapter->phy_type[1] == 5U) { nes_write_indexed___0(nesdev, 10804U, 255U); } else { } switch ((int )nesadapter->phy_type[1]) { case 4: ; case 8: nes_write_indexed___0(nesdev, 10256U, 0U); nes_write_indexed___0(nesdev, 10768U, 0U); goto ldv_61149; case 1: ; if (wide_ppm_offset != 0) { nes_write_indexed___0(nesdev, 10804U, 1048490U); } else { } goto ldv_61149; case 9: nes_write_indexed___0(nesdev, 10768U, 0U); goto ldv_61149; case 5: sds = nes_read_indexed___0(nesdev, 10760U); sds = sds | 256U; nes_write_indexed___0(nesdev, 10760U, sds); } ldv_61149: ; if ((unsigned int )OneG_Mode == 0U) { nes_write_indexed___0(nesdev, 10808U, 286326784U); sds = nes_read_indexed___0(nesdev, 10760U); sds = sds & 4294967231U; nes_write_indexed___0(nesdev, 10760U, sds); } else { } } else { nes_write_indexed___0(nesdev, 10248U, 8U); i = 0; goto ldv_61158; ldv_61157: ; if (1) { __const_udelay(4295000UL); } else { __ms = 1UL; goto ldv_61155; ldv_61154: __const_udelay(4295000UL); ldv_61155: tmp = __ms; __ms = __ms - 1UL; if (tmp != 0UL) { goto ldv_61154; } else { } } ldv_61158: tmp___0 = nes_read_indexed___0(nesdev, 10252U); u32temp = tmp___0 & 15U; if (u32temp != 15U) { tmp___1 = i; i = i + 1; if (tmp___1 <= 4999) { goto ldv_61157; } else { goto ldv_61159; } } else { } ldv_61159: ; if (i > 5000) { if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Init: serdes 0 not ready, status=%x\n", "nes_init_serdes", 823, u32temp); } else { } return (1); } else { } nes_write_indexed___0(nesdev, 10256U, 777975U); nes_write_indexed___0(nesdev, 10260U, 2632396800U); nes_write_indexed___0(nesdev, 10264U, 267386880U); nes_write_indexed___0(nesdev, 10268U, 0U); nes_write_indexed___0(nesdev, 10272U, 0U); nes_write_indexed___0(nesdev, 10276U, 0U); if ((unsigned int )OneG_Mode != 0U) { nes_write_indexed___0(nesdev, 10280U, 4028113442U); } else { nes_write_indexed___0(nesdev, 10280U, 4026802722U); } nes_write_indexed___0(nesdev, 10292U, 255U); if ((unsigned int )port_count > 1U) { nes_write_indexed___0(nesdev, 10760U, 72U); i = 0; goto ldv_61166; ldv_61165: ; if (1) { __const_udelay(4295000UL); } else { __ms___0 = 1UL; goto ldv_61163; ldv_61162: __const_udelay(4295000UL); ldv_61163: tmp___2 = __ms___0; __ms___0 = __ms___0 - 1UL; if (tmp___2 != 0UL) { goto ldv_61162; } else { } } ldv_61166: tmp___3 = nes_read_indexed___0(nesdev, 10764U); u32temp = tmp___3 & 15U; if (u32temp != 15U) { tmp___4 = i; i = i + 1; if (tmp___4 <= 4999) { goto ldv_61165; } else { goto ldv_61167; } } else { } ldv_61167: ; if (i > 5000) { printk("%s: Init: serdes 1 not ready, status=%x\n", "nes_init_serdes", u32temp); } else { } nes_write_indexed___0(nesdev, 10768U, 777975U); nes_write_indexed___0(nesdev, 10772U, 2632396800U); nes_write_indexed___0(nesdev, 10776U, 267386880U); nes_write_indexed___0(nesdev, 10780U, 0U); nes_write_indexed___0(nesdev, 10784U, 0U); nes_write_indexed___0(nesdev, 10788U, 0U); nes_write_indexed___0(nesdev, 10792U, 4026540578U); nes_write_indexed___0(nesdev, 10804U, 255U); } else { } } return (0); } } static void nes_init_csr_ne020(struct nes_device *nesdev , u8 hw_rev , u8 port_count ) { u32 u32temp ; { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: port_count=%d\n", "nes_init_csr_ne020", 871, (int )port_count); } else { } nes_write_indexed___0(nesdev, 484U, 7U); nes_write_indexed___0(nesdev, 488U, 133236U); nes_write_indexed___0(nesdev, 472U, 294914U); nes_write_indexed___0(nesdev, 508U, 327685U); nes_write_indexed___0(nesdev, 1536U, 1431655765U); nes_write_indexed___0(nesdev, 1540U, 1431655765U); nes_write_indexed___0(nesdev, 8192U, 1U); nes_write_indexed___0(nesdev, 8196U, 1U); nes_write_indexed___0(nesdev, 8200U, 65535U); nes_write_indexed___0(nesdev, 8204U, 1U); nes_write_indexed___0(nesdev, 8208U, 961U); nes_write_indexed___0(nesdev, 8220U, 1966364280U); if ((unsigned int )port_count > 1U) { nes_write_indexed___0(nesdev, 8704U, 1U); nes_write_indexed___0(nesdev, 8708U, 1U); nes_write_indexed___0(nesdev, 8712U, 65535U); nes_write_indexed___0(nesdev, 8716U, 1U); nes_write_indexed___0(nesdev, 8720U, 961U); nes_write_indexed___0(nesdev, 8732U, 1966364280U); nes_write_indexed___0(nesdev, 2312U, 536870913U); } else { } if ((unsigned int )port_count > 2U) { nes_write_indexed___0(nesdev, 9216U, 1U); nes_write_indexed___0(nesdev, 9220U, 1U); nes_write_indexed___0(nesdev, 9224U, 65535U); nes_write_indexed___0(nesdev, 9228U, 1U); nes_write_indexed___0(nesdev, 9232U, 961U); nes_write_indexed___0(nesdev, 9244U, 1966364280U); nes_write_indexed___0(nesdev, 2320U, 536870913U); nes_write_indexed___0(nesdev, 9728U, 1U); nes_write_indexed___0(nesdev, 9732U, 1U); nes_write_indexed___0(nesdev, 9736U, 65535U); nes_write_indexed___0(nesdev, 9740U, 1U); nes_write_indexed___0(nesdev, 9744U, 961U); nes_write_indexed___0(nesdev, 9756U, 1966364280U); nes_write_indexed___0(nesdev, 2328U, 536870913U); } else { } nes_write_indexed___0(nesdev, 20480U, 98304U); nes_write_indexed___0(nesdev, 20484U, (wqm_quanta << 1) | 1U); nes_write_indexed___0(nesdev, 20488U, 522133279U); nes_write_indexed___0(nesdev, 20496U, 522133279U); nes_write_indexed___0(nesdev, 20504U, 522133279U); nes_write_indexed___0(nesdev, 20512U, 522133279U); nes_write_indexed___0(nesdev, 24720U, 4294967295U); nes_write_indexed___0(nesdev, 2304U, 536870913U); nes_write_indexed___0(nesdev, 24768U, 654U); nes_write_indexed___0(nesdev, 24776U, 32U); nes_write_indexed___0(nesdev, 492U, 2066097568U); if ((unsigned int )hw_rev != 4U) { u32temp = nes_read_indexed___0(nesdev, 2280U); u32temp = u32temp | 2147483648U; nes_write_indexed___0(nesdev, 2280U, u32temp); u32temp = nes_read_indexed___0(nesdev, 8696U); u32temp = u32temp & 2147483647U; u32temp = u32temp | 2147418128U; nes_write_indexed___0(nesdev, 8696U, u32temp); if ((unsigned int )port_count > 1U) { u32temp = nes_read_indexed___0(nesdev, 9208U); u32temp = u32temp & 2147483647U; u32temp = u32temp | 2147418128U; nes_write_indexed___0(nesdev, 9208U, u32temp); } else { } } else { } return; } } void nes_destroy_adapter(struct nes_adapter *nesadapter ) { struct nes_adapter *tmp_adapter ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)nes_adapter_list.next; tmp_adapter = (struct nes_adapter *)__mptr + 0xffffffffffffffc0UL; goto ldv_61185; ldv_61184: ; if ((nes_debug_level & 524288U) != 0U) { printk("\viw_nes: %s[%u]: Nes Adapter list entry = 0x%p.\n", "nes_destroy_adapter", 961, tmp_adapter); } else { } __mptr___0 = (struct list_head const *)tmp_adapter->list.next; tmp_adapter = (struct nes_adapter *)__mptr___0 + 0xffffffffffffffc0UL; ldv_61185: ; if ((unsigned long )(& tmp_adapter->list) != (unsigned long )(& nes_adapter_list)) { goto ldv_61184; } else { } nesadapter->ref_count = (unsigned char )((int )nesadapter->ref_count - 1); if ((unsigned int )nesadapter->ref_count == 0U) { if (nesadapter->hw_rev == 4U) { ldv_del_timer_108(& nesadapter->mh_timer); } else { } ldv_del_timer_109(& nesadapter->lc_timer); list_del(& nesadapter->list); kfree((void const *)nesadapter); } else { } return; } } int nes_init_cqp(struct nes_device *nesdev ) { struct nes_adapter *nesadapter ; struct nes_hw_cqp_qp_context *cqp_qp_context ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_hw_ceq *ceq ; struct nes_hw_ceq *nic_ceq ; struct nes_hw_aeq *aeq ; void *vmem ; dma_addr_t pmem ; u32 count ; u32 cqp_head ; u64 u64temp ; u32 u32temp ; unsigned int _max1 ; unsigned int _max2 ; unsigned int _max1___0 ; unsigned int _max2___0 ; void *tmp ; struct lock_class_key __key ; struct lock_class_key __key___0 ; unsigned int _max1___1 ; unsigned int _max2___1 ; unsigned int _max1___2 ; unsigned int _max2___2 ; unsigned int _max1___3 ; unsigned int _max2___3 ; unsigned int _max1___4 ; unsigned int _max2___4 ; struct lock_class_key __key___1 ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u32 tmp___4 ; u32 tmp___5 ; u32 tmp___6 ; u32 tmp___7 ; u32 tmp___8 ; u32 tmp___9 ; { nesadapter = nesdev->nesadapter; count = 0U; _max1 = (nesadapter->max_cq / (u32 )nesadapter->port_count + 536870880U) * 8U; _max2 = 256U; _max1___0 = 64U; _max2___0 = 256U; nesdev->cqp_mem_size = (((_max1 > _max2 ? _max1 : _max2) + (_max1___0 > _max2___0 ? _max1___0 : _max2___0)) + nesadapter->max_qp * 16U) + 12816U; nesdev->cqp_vbase = pci_zalloc_consistent(nesdev->pcidev, (size_t )nesdev->cqp_mem_size, & nesdev->cqp_pbase); if ((unsigned long )nesdev->cqp_vbase == (unsigned long )((void *)0)) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate memory for host descriptor rings\n", "nes_init_cqp", 1010); } else { } return (-12); } else { } tmp = kzalloc(51200UL, 208U); nesdev->nes_cqp_requests = (struct nes_cqp_request *)tmp; if ((unsigned long )nesdev->nes_cqp_requests == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate memory CQP request entries.\n", "nes_init_cqp", 1018); } else { } pci_free_consistent(nesdev->pcidev, (size_t )nesdev->cqp_mem_size, (void *)nesdev->cqp.sq_vbase, nesdev->cqp.sq_pbase); return (-12); } else { } if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Allocated CQP structures at %p (phys = %016lX), size = %u.\n", "nes_init_cqp", 1025, nesdev->cqp_vbase, (unsigned long )nesdev->cqp_pbase, nesdev->cqp_mem_size); } else { } spinlock_check(& nesdev->cqp.lock); __raw_spin_lock_init(& nesdev->cqp.lock.__annonCompField18.rlock, "&(&nesdev->cqp.lock)->rlock", & __key); __init_waitqueue_head(& nesdev->cqp.waitq, "&nesdev->cqp.waitq", & __key___0); vmem = (void *)(((unsigned long )nesdev->cqp_vbase + 511UL) & 0xfffffffffffffe00UL); pmem = (nesdev->cqp_pbase + 511ULL) & 0xfffffffffffffe00ULL; nesdev->cqp.sq_vbase = (struct nes_hw_cqp_wqe *)vmem; nesdev->cqp.sq_pbase = pmem; nesdev->cqp.sq_size = 128U; nesdev->cqp.sq_head = 0U; nesdev->cqp.sq_tail = 0U; nesdev->cqp.qp_id = (unsigned int )((u16 )(nesdev->pcidev)->devfn) & 7U; vmem = vmem + (unsigned long )nesdev->cqp.sq_size * 64UL; pmem = (unsigned long long )((unsigned long )nesdev->cqp.sq_size * 64UL) + pmem; nesdev->ccq.cq_vbase = (struct nes_hw_cqe *)vmem; nesdev->ccq.cq_pbase = pmem; nesdev->ccq.cq_size = 128U; nesdev->ccq.cq_head = 0U; nesdev->ccq.ce_handler = & nes_cqp_ce_handler; nesdev->ccq.cq_number = (unsigned int )((u16 )(nesdev->pcidev)->devfn) & 7U; vmem = vmem + (unsigned long )nesdev->ccq.cq_size * 32UL; pmem = (unsigned long long )((unsigned long )nesdev->ccq.cq_size * 32UL) + pmem; nesdev->ceq_index = (unsigned int )((u8 )(nesdev->pcidev)->devfn) & 7U; ceq = (struct nes_hw_ceq *)(& nesadapter->ceq) + (unsigned long )nesdev->ceq_index; ceq->ceq_vbase = (struct nes_hw_ceqe volatile *)vmem; ceq->ceq_pbase = pmem; ceq->ceq_size = (unsigned int )((u16 )(nesadapter->max_cq / (u32 )nesadapter->port_count)) - 32U; ceq->ceq_head = 0U; _max1___1 = (unsigned int )ceq->ceq_size * 8U; _max2___1 = 256U; vmem = vmem + (unsigned long )(_max1___1 > _max2___1 ? _max1___1 : _max2___1); _max1___2 = (unsigned int )ceq->ceq_size * 8U; _max2___2 = 256U; pmem = (dma_addr_t )(_max1___2 > _max2___2 ? _max1___2 : _max2___2) + pmem; nesdev->nic_ceq_index = ((unsigned int )((u8 )(nesdev->pcidev)->devfn) & 7U) + 8U; nic_ceq = (struct nes_hw_ceq *)(& nesadapter->ceq) + (unsigned long )nesdev->nic_ceq_index; nic_ceq->ceq_vbase = (struct nes_hw_ceqe volatile *)vmem; nic_ceq->ceq_pbase = pmem; nic_ceq->ceq_size = 8U; nic_ceq->ceq_head = 0U; _max1___3 = (unsigned int )nic_ceq->ceq_size * 8U; _max2___3 = 256U; vmem = vmem + (unsigned long )(_max1___3 > _max2___3 ? _max1___3 : _max2___3); _max1___4 = (unsigned int )nic_ceq->ceq_size * 8U; _max2___4 = 256U; pmem = (dma_addr_t )(_max1___4 > _max2___4 ? _max1___4 : _max2___4) + pmem; aeq = (struct nes_hw_aeq *)(& nesadapter->aeq) + ((unsigned long )(nesdev->pcidev)->devfn & 7UL); aeq->aeq_vbase = (struct nes_hw_aeqe volatile *)vmem; aeq->aeq_pbase = pmem; aeq->aeq_size = (u16 )nesadapter->max_qp; aeq->aeq_head = 0U; vmem = vmem + (unsigned long )aeq->aeq_size * 16UL; pmem = (unsigned long long )((unsigned long )aeq->aeq_size * 16UL) + pmem; cqp_qp_context = (struct nes_hw_cqp_qp_context *)vmem; cqp_qp_context->context_words[0] = (((nesdev->pcidev)->devfn & 7U) << 12) + 2048U; cqp_qp_context->context_words[1] = 0U; cqp_qp_context->context_words[2] = (unsigned int )nesdev->cqp.sq_pbase; cqp_qp_context->context_words[3] = (unsigned int )(nesdev->cqp.sq_pbase >> 32); nes_write_indexed___0(nesdev, ((nesdev->pcidev)->devfn & 7U) * 8U + 4U, (u32 )(pmem >> 32)); nes_write_indexed___0(nesdev, ((nesdev->pcidev)->devfn & 7U) * 8U, (unsigned int )pmem); INIT_LIST_HEAD(& nesdev->cqp_avail_reqs); INIT_LIST_HEAD(& nesdev->cqp_pending_reqs); count = 0U; goto ldv_61225; ldv_61224: __init_waitqueue_head(& (nesdev->nes_cqp_requests + (unsigned long )count)->waitq, "&nesdev->nes_cqp_requests[count].waitq", & __key___1); list_add_tail(& (nesdev->nes_cqp_requests + (unsigned long )count)->list, & nesdev->cqp_avail_reqs); count = count + 1U; ldv_61225: ; if (count <= 255U) { goto ldv_61224; } else { } tmp___0 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___0; cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, ((unsigned int )nesdev->ccq.cq_size << 16) | 5123U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (unsigned int )nesdev->ccq.cq_number | ((unsigned int )nesdev->ceq_index << 16)); u64temp = nesdev->ccq.cq_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); cqp_wqe->wqe_words[9] = 0U; u64temp = (u64 )(& nesdev->ccq); cqp_wqe->wqe_words[8] = (unsigned int )(u64temp >> 1); cqp_wqe->wqe_words[9] = (unsigned int )(u64temp >> 33) & 2147483647U; cqp_wqe->wqe_words[10] = 0U; tmp___1 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___1; cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, ((unsigned int )nesdev->ceq_index << 8) + 22U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (u32 )ceq->ceq_size); u64temp = ceq->ceq_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); tmp___2 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___2; cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, (((nesdev->pcidev)->devfn & 7U) << 8) + 25U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (u32 )aeq->aeq_size); u64temp = aeq->aeq_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); tmp___3 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___3; cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, ((unsigned int )nesdev->nic_ceq_index << 8) + 22U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (u32 )nic_ceq->ceq_size); u64temp = nic_ceq->ceq_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); count = 0U; ldv_61227: tmp___4 = count; count = count + 1U; if (tmp___4 > 1000U) { printk("\viw_nes: Error creating CQP\n"); pci_free_consistent(nesdev->pcidev, (size_t )nesdev->cqp_mem_size, nesdev->cqp_vbase, nesdev->cqp_pbase); return (-1); } else { } __const_udelay(42950UL); tmp___5 = nes_read_indexed___0(nesdev, (((nesdev->pcidev)->devfn & 7U) + 8U) * 8U); if ((tmp___5 & 256U) == 0U) { goto ldv_61227; } else { } if ((nes_debug_level & 2U) != 0U) { tmp___6 = nes_read_indexed___0(nesdev, (((nesdev->pcidev)->devfn & 7U) + 8U) * 8U); printk("\viw_nes: %s[%u]: CQP Status = 0x%08X\n", "nes_init_cqp", 1179, tmp___6); } else { } u32temp = 75497472U; nes_write32(nesdev->regs + 64UL, (u32 )nesdev->cqp.qp_id | u32temp); count = 0U; ldv_61229: tmp___7 = count; count = count + 1U; if (tmp___7 > 1000U) { printk("\viw_nes: Error creating CCQ, CEQ, and AEQ\n"); pci_free_consistent(nesdev->pcidev, (size_t )nesdev->cqp_mem_size, nesdev->cqp_vbase, nesdev->cqp_pbase); return (-1); } else { } __const_udelay(42950UL); tmp___8 = nes_read_indexed___0(nesdev, (((nesdev->pcidev)->devfn & 7U) + 8U) * 8U); if ((tmp___8 & 3840U) != 3840U) { goto ldv_61229; } else { } if ((nes_debug_level & 2U) != 0U) { tmp___9 = nes_read_indexed___0(nesdev, (((nesdev->pcidev)->devfn & 7U) + 8U) * 8U); printk("\viw_nes: %s[%u]: QP Status = 0x%08X\n", "nes_init_cqp", 1199, tmp___9); } else { } nesdev->cqp.sq_tail = (u16 )((int )nesdev->cqp.sq_tail + 1); return (0); } } int nes_destroy_cqp(struct nes_device *nesdev ) { struct nes_hw_cqp_wqe *cqp_wqe ; u32 count ; u32 cqp_head ; unsigned long flags ; u32 tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u32 tmp___5 ; u32 tmp___6 ; u32 tmp___7 ; { count = 0U; ldv_61239: tmp = count; count = count + 1U; if (tmp > 1000U) { goto ldv_61238; } else { } __const_udelay(42950UL); if ((int )nesdev->cqp.sq_head != (int )nesdev->cqp.sq_tail) { goto ldv_61239; } else { } ldv_61238: nes_write32(nesdev->regs + 68UL, (u32 )((long )((int )nesdev->ccq.cq_number) | (-0x7FFFFFFF-1))); nes_write32(nesdev->regs + 4UL, 2147483647U); ldv_spin_lock(); tmp___0 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___0; nesdev->cqp.sq_head = (u16 )((int )((short )nesdev->cqp.sq_head) & (int )((short )((unsigned int )nesdev->cqp.sq_size + 65535U))); cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; cqp_wqe->wqe_words[0] = (((nesdev->pcidev)->devfn & 7U) << 8) | 27U; cqp_wqe->wqe_words[3] = 0U; tmp___1 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___1; nesdev->cqp.sq_head = (u16 )((int )((short )nesdev->cqp.sq_head) & (int )((short )((unsigned int )nesdev->cqp.sq_size + 65535U))); cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; cqp_wqe->wqe_words[0] = ((unsigned int )nesdev->nic_ceq_index << 8) | 24U; tmp___2 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___2; nesdev->cqp.sq_head = (u16 )((int )((short )nesdev->cqp.sq_head) & (int )((short )((unsigned int )nesdev->cqp.sq_size + 65535U))); cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; cqp_wqe->wqe_words[0] = (unsigned int )(((int )nesdev->ceq_index << 8) | 24); tmp___3 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___3; nesdev->cqp.sq_head = (u16 )((int )((short )nesdev->cqp.sq_head) & (int )((short )((unsigned int )nesdev->cqp.sq_size + 65535U))); cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; cqp_wqe->wqe_words[0] = 5U; cqp_wqe->wqe_words[1] = (unsigned int )nesdev->ccq.cq_number | ((unsigned int )nesdev->ceq_index << 16); tmp___4 = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp___4; nesdev->cqp.sq_head = (u16 )((int )((short )nesdev->cqp.sq_head) & (int )((short )((unsigned int )nesdev->cqp.sq_size + 65535U))); cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; cqp_wqe->wqe_words[0] = 262146U; cqp_wqe->wqe_words[1] = (unsigned int )nesdev->cqp.qp_id; __asm__ volatile ("": : : "memory"); nes_write32(nesdev->regs + 64UL, (u32 )((int )nesdev->cqp.qp_id | 92274688)); spin_unlock_irqrestore(& nesdev->cqp.lock, flags); count = 0U; ldv_61241: tmp___5 = count; count = count + 1U; if (tmp___5 > 1000U) { printk("\viw_nes: Function%d: Error destroying CCQ, CEQ, and AEQ\n", (nesdev->pcidev)->devfn & 7U); goto ldv_61240; } else { } __const_udelay(42950UL); tmp___6 = nes_read_indexed___0(nesdev, (((nesdev->pcidev)->devfn & 7U) + 8U) * 8U); if ((tmp___6 & 3840U) != 0U) { goto ldv_61241; } else { } ldv_61240: ; if ((nes_debug_level & 524288U) != 0U) { tmp___7 = nes_read_indexed___0(nesdev, (((nesdev->pcidev)->devfn & 7U) + 8U) * 8U); printk("\viw_nes: %s[%u]: Function%d: QP Status = 0x%08X\n", "nes_destroy_cqp", 1292, (nesdev->pcidev)->devfn & 7U, tmp___7); } else { } kfree((void const *)nesdev->nes_cqp_requests); pci_free_consistent(nesdev->pcidev, (size_t )nesdev->cqp_mem_size, (void *)nesdev->cqp.sq_vbase, nesdev->cqp.sq_pbase); return (0); } } static int nes_init_1g_phy(struct nes_device *nesdev , u8 phy_type , u8 phy_index ) { u32 counter ; u16 phy_data ; int ret ; u32 tmp ; { counter = 0U; ret = 0; nes_read_1G_phy_reg(nesdev, 1, (int )phy_index, & phy_data); nes_write_1G_phy_reg(nesdev, 23, (int )phy_index, 45056); nes_write_1G_phy_reg(nesdev, 0, (int )phy_index, 32768); __const_udelay(429500UL); counter = 0U; ldv_61252: nes_read_1G_phy_reg(nesdev, 0, (int )phy_index, & phy_data); tmp = counter; counter = counter + 1U; if (tmp > 100U) { ret = -1; goto ldv_61251; } else { } if ((int )((short )phy_data) < 0) { goto ldv_61252; } else { } ldv_61251: phy_data = (unsigned int )phy_data & 49151U; phy_data = (u16 )((unsigned int )phy_data | 4416U); nes_write_1G_phy_reg(nesdev, 0, (int )phy_index, (int )phy_data); nes_read_1G_phy_reg(nesdev, 0, (int )phy_index, & phy_data); nes_read_1G_phy_reg(nesdev, 23, (int )phy_index, & phy_data); nes_read_1G_phy_reg(nesdev, 30, (int )phy_index, & phy_data); nes_read_1G_phy_reg(nesdev, 25, (int )phy_index, & phy_data); nes_write_1G_phy_reg(nesdev, 25, (int )phy_index, 65518); nes_read_1G_phy_reg(nesdev, 25, (int )phy_index, & phy_data); nes_read_1G_phy_reg(nesdev, 4, (int )phy_index, & phy_data); nes_write_1G_phy_reg(nesdev, 4, (int )phy_index, (int )((u16 )(((int )((short )phy_data) & -4065) | 3072))); nes_read_1G_phy_reg(nesdev, 4, (int )phy_index, & phy_data); nes_read_1G_phy_reg(nesdev, 9, (int )phy_index, & phy_data); nes_write_1G_phy_reg(nesdev, 9, (int )phy_index, (int )phy_data & 65279); nes_read_1G_phy_reg(nesdev, 9, (int )phy_index, & phy_data); nes_read_1G_phy_reg(nesdev, 0, (int )phy_index, & phy_data); nes_write_1G_phy_reg(nesdev, 0, (int )phy_index, (int )((unsigned int )phy_data | 768U)); return (ret); } } static int nes_init_2025_phy(struct nes_device *nesdev , u8 phy_type , u8 phy_index ) { u32 temp_phy_data ; u32 temp_phy_data2 ; u32 counter ; u32 sds ; u32 mac_index ; int ret ; unsigned int first_attempt ; u32 tmp ; u32 tmp___0 ; u32 tmp___1 ; unsigned long __ms ; unsigned long tmp___2 ; u32 tmp___3 ; u32 tmp___4 ; unsigned long __ms___0 ; unsigned long tmp___5 ; u32 tmp___6 ; u32 tmp___7 ; u32 tmp___8 ; unsigned long __ms___1 ; unsigned long tmp___9 ; u32 tmp___10 ; u32 tmp___11 ; { temp_phy_data = 0U; temp_phy_data2 = 0U; counter = 0U; mac_index = nesdev->mac_index; ret = 0; first_attempt = 1U; nes_read_10G_phy_reg(nesdev, (int )phy_index, 3, 55278); tmp = nes_read_indexed___0(nesdev, 8324U); temp_phy_data = (u32 )((unsigned short )tmp); __const_udelay(6442500UL); nes_read_10G_phy_reg(nesdev, (int )phy_index, 3, 55278); tmp___0 = nes_read_indexed___0(nesdev, 8324U); temp_phy_data2 = (u32 )((unsigned short )tmp___0); if (temp_phy_data != temp_phy_data2) { nes_read_10G_phy_reg(nesdev, (int )phy_index, 3, 55293); tmp___1 = nes_read_indexed___0(nesdev, 8324U); temp_phy_data = (u32 )((unsigned short )tmp___1); if ((temp_phy_data & 255U) > 32U) { return (0); } else { } printk("iw_nes: Reinitialize external PHY\n"); } else { } nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 0, 32768); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49920, 0); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49942, 10); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49944, 82); switch ((int )phy_type) { case 4: nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49942, 10); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49944, 82); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49922, 12); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49945, 8); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 39, 1); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49946, 152); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 38, 3584); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53254, 7); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53255, 10); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53256, 9); goto ldv_61266; case 8: nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49942, 10); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49944, 82); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49922, 4); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49945, 56); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 39, 19); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49946, 152); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 38, 3584); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53254, 7); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53255, 10); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53256, 9); goto ldv_61266; case 9: nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49942, 10); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49944, 82); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49922, 12); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49945, 16); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 39, 19); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49946, 128); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 38, 3584); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53254, 11); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53255, 3); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53256, 4); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 34, 16493); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 35, 32); goto ldv_61266; } ldv_61266: nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 40, 42280); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49920, 2); counter = 0U; __ms = 690UL; goto ldv_61271; ldv_61270: __const_udelay(4295000UL); ldv_61271: tmp___2 = __ms; __ms = __ms - 1UL; if (tmp___2 != 0UL) { goto ldv_61270; } else { } nes_read_10G_phy_reg(nesdev, (int )phy_index, 3, 55278); tmp___3 = nes_read_indexed___0(nesdev, 8324U); temp_phy_data = (u32 )((unsigned short )tmp___3); ldv_61278: tmp___4 = counter; counter = counter + 1U; if (tmp___4 > 150U) { printk("iw_nes: No PHY heartbeat\n"); goto ldv_61273; } else { } if (1) { __const_udelay(4295000UL); } else { __ms___0 = 1UL; goto ldv_61276; ldv_61275: __const_udelay(4295000UL); ldv_61276: tmp___5 = __ms___0; __ms___0 = __ms___0 - 1UL; if (tmp___5 != 0UL) { goto ldv_61275; } else { } } nes_read_10G_phy_reg(nesdev, (int )phy_index, 3, 55278); tmp___6 = nes_read_indexed___0(nesdev, 8324U); temp_phy_data2 = (u32 )((unsigned short )tmp___6); if (temp_phy_data2 == temp_phy_data) { goto ldv_61278; } else { } ldv_61273: counter = 0U; ldv_61285: nes_read_10G_phy_reg(nesdev, (int )phy_index, 3, 55293); tmp___7 = nes_read_indexed___0(nesdev, 8324U); temp_phy_data = (u32 )((unsigned short )tmp___7); tmp___8 = counter; counter = counter + 1U; if (tmp___8 > 300U) { if ((temp_phy_data & 255U) == 0U && first_attempt != 0U) { first_attempt = 0U; counter = 0U; nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 59476, 192); nes_write_10G_phy_reg(nesdev, (int )phy_index, 3, 59476, 64); goto ldv_61279; } else { ret = 1; goto ldv_61280; } } else { } __ms___1 = 10UL; goto ldv_61283; ldv_61282: __const_udelay(4295000UL); ldv_61283: tmp___9 = __ms___1; __ms___1 = __ms___1 - 1UL; if (tmp___9 != 0UL) { goto ldv_61282; } else { } ldv_61279: ; if ((temp_phy_data & 255U) <= 47U) { goto ldv_61285; } else { } ldv_61280: nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 53251, 0); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 61453, 254); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 61454, 50); if ((unsigned int )phy_type == 9U) { nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 61455, 12); } else { nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 61455, 2); nes_write_10G_phy_reg(nesdev, (int )phy_index, 1, 49940, 99); } sds = nes_read_indexed___0(nesdev, mac_index * 512U + 10248U); sds = sds | 1U; nes_write_indexed___0(nesdev, mac_index * 512U + 10248U, sds); sds = sds & 4294967294U; nes_write_indexed___0(nesdev, mac_index * 512U + 10248U, sds); counter = 0U; goto ldv_61287; ldv_61286: ; ldv_61287: tmp___10 = nes_read32((void const *)nesdev->regs + 48U); if ((tmp___10 & 64U) == 0U) { tmp___11 = counter; counter = counter + 1U; if (tmp___11 <= 4999U) { goto ldv_61286; } else { goto ldv_61288; } } else { } ldv_61288: ; return (ret); } } int nes_init_phy(struct nes_device *nesdev ) { struct nes_adapter *nesadapter ; u32 mac_index ; u32 tx_config ; unsigned long flags ; u8 phy_type ; u8 phy_index ; int ret ; { nesadapter = nesdev->nesadapter; mac_index = nesdev->mac_index; tx_config = 0U; phy_type = nesadapter->phy_type[mac_index]; phy_index = nesadapter->phy_index[mac_index]; ret = 0; tx_config = nes_read_indexed___0(nesdev, 8196U); if ((unsigned int )phy_type == 2U) { tx_config = tx_config & 4294967267U; tx_config = tx_config | 4U; } else { tx_config = tx_config & 4294967267U; tx_config = tx_config | 29U; } nes_write_indexed___0(nesdev, 8196U, tx_config); ldv_spin_lock(); switch ((int )phy_type) { case 2: ret = nes_init_1g_phy(nesdev, (int )phy_type, (int )phy_index); goto ldv_61300; case 4: ; case 8: ; case 9: ret = nes_init_2025_phy(nesdev, (int )phy_type, (int )phy_index); goto ldv_61300; } ldv_61300: spin_unlock_irqrestore(& (nesdev->nesadapter)->phy_lock, flags); return (ret); } } static void nes_replenish_nic_rq(struct nes_vnic *nesvnic ) { unsigned long flags ; dma_addr_t bus_address ; struct sk_buff *skb ; struct nes_hw_nic_rq_wqe *nic_rqe ; struct nes_hw_nic *nesnic ; struct nes_device *nesdev ; struct nes_rskb_cb *cb ; u32 rx_wqes_posted ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { rx_wqes_posted = 0U; nesnic = & nesvnic->nic; nesdev = nesvnic->nesdev; ldv_spin_lock(); if ((unsigned int )nesnic->replenishing_rq != 0U) { tmp = atomic_read((atomic_t const *)(& nesvnic->rx_skbs_needed)); if ((int )nesnic->rq_size + -1 == tmp) { tmp___0 = atomic_read((atomic_t const *)(& nesvnic->rx_skb_timer_running)); if (tmp___0 == 0) { atomic_set(& nesvnic->rx_skb_timer_running, 1); spin_unlock_irqrestore(& nesnic->rq_lock, flags); nesvnic->rq_wqes_timer.expires = (unsigned long )jiffies + 125UL; add_timer(& nesvnic->rq_wqes_timer); } else { spin_unlock_irqrestore(& nesnic->rq_lock, flags); } } else { spin_unlock_irqrestore(& nesnic->rq_lock, flags); } return; } else { } nesnic->replenishing_rq = 1U; spin_unlock_irqrestore(& nesnic->rq_lock, flags); ldv_61316: skb = dev_alloc_skb((unsigned int )nesvnic->max_frame_size); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { skb->dev = nesvnic->netdev; bus_address = pci_map_single(nesdev->pcidev, (void *)skb->data, (size_t )nesvnic->max_frame_size, 2); cb = (struct nes_rskb_cb *)(& skb->cb); cb->busaddr = bus_address; cb->maplen = (u32 )nesvnic->max_frame_size; nic_rqe = nesnic->rq_vbase + (unsigned long )nesvnic->nic.rq_head; nic_rqe->wqe_words[0] = (unsigned int )nesvnic->max_frame_size; nic_rqe->wqe_words[1] = 0U; nic_rqe->wqe_words[2] = (unsigned int )bus_address; nic_rqe->wqe_words[3] = (unsigned int )(bus_address >> 32); nesnic->rx_skb[(int )nesnic->rq_head] = skb; nesnic->rq_head = (u16 )((int )nesnic->rq_head + 1); nesnic->rq_head = (u16 )((int )((short )nesnic->rq_head) & (int )((short )((unsigned int )nesnic->rq_size + 65535U))); atomic_dec(& nesvnic->rx_skbs_needed); __asm__ volatile ("": : : "memory"); rx_wqes_posted = rx_wqes_posted + 1U; if (rx_wqes_posted == 255U) { nes_write32(nesdev->regs + 64UL, (rx_wqes_posted << 24) | (u32 )nesnic->qp_id); rx_wqes_posted = 0U; } else { } } else { ldv_spin_lock(); tmp___1 = atomic_read((atomic_t const *)(& nesvnic->rx_skbs_needed)); if ((int )nesnic->rq_size + -1 == tmp___1) { tmp___2 = atomic_read((atomic_t const *)(& nesvnic->rx_skb_timer_running)); if (tmp___2 == 0) { atomic_set(& nesvnic->rx_skb_timer_running, 1); spin_unlock_irqrestore(& nesnic->rq_lock, flags); nesvnic->rq_wqes_timer.expires = (unsigned long )jiffies + 125UL; add_timer(& nesvnic->rq_wqes_timer); } else { spin_unlock_irqrestore(& nesnic->rq_lock, flags); } } else { spin_unlock_irqrestore(& nesnic->rq_lock, flags); } goto ldv_61315; } tmp___3 = atomic_read((atomic_t const *)(& nesvnic->rx_skbs_needed)); if (tmp___3 != 0) { goto ldv_61316; } else { } ldv_61315: __asm__ volatile ("": : : "memory"); if (rx_wqes_posted != 0U) { nes_write32(nesdev->regs + 64UL, (rx_wqes_posted << 24) | (u32 )nesnic->qp_id); } else { } nesnic->replenishing_rq = 0U; return; } } static void nes_rq_wqes_timeout(unsigned long parm ) { struct nes_vnic *nesvnic ; int tmp ; { nesvnic = (struct nes_vnic *)parm; printk("%s: Timer fired.\n", "nes_rq_wqes_timeout"); atomic_set(& nesvnic->rx_skb_timer_running, 0); tmp = atomic_read((atomic_t const *)(& nesvnic->rx_skbs_needed)); if (tmp != 0) { nes_replenish_nic_rq(nesvnic); } else { } return; } } static int nes_lro_get_skb_hdr(struct sk_buff *skb , void **iphdr , void **tcph , u64 *hdr_flags , void *priv ) { unsigned int ip_len ; struct iphdr *iph ; struct tcphdr *tmp ; { skb_reset_network_header(skb); iph = ip_hdr((struct sk_buff const *)skb); if ((unsigned int )iph->protocol != 6U) { return (-1); } else { } ip_len = ip_hdrlen((struct sk_buff const *)skb); skb_set_transport_header(skb, (int const )ip_len); tmp = tcp_hdr((struct sk_buff const *)skb); *tcph = (void *)tmp; *hdr_flags = 3ULL; *iphdr = (void *)iph; return (0); } } int nes_init_nic_qp(struct nes_device *nesdev , struct net_device *netdev ) { struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_hw_nic_sq_wqe *nic_sqe ; struct nes_hw_nic_qp_context *nic_context ; struct sk_buff *skb ; struct nes_hw_nic_rq_wqe *nic_rqe ; struct nes_vnic *nesvnic ; void *tmp ; unsigned long flags ; void *vmem ; dma_addr_t pmem ; u64 u64temp ; int ret ; u32 cqp_head ; u32 counter ; u32 wqe_count ; struct nes_rskb_cb *cb ; u8 jumbomode ; struct lock_class_key __key ; u32 tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___3 ; bool __cond ; bool __cond___0 ; u32 _min1 ; unsigned int _min2 ; int tmp___4 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; jumbomode = 0U; nesvnic->nic_mem_size = 147736U; nesvnic->nic_vbase = pci_zalloc_consistent(nesdev->pcidev, (size_t )nesvnic->nic_mem_size, & nesvnic->nic_pbase); if ((unsigned long )nesvnic->nic_vbase == (unsigned long )((void *)0)) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate memory for NIC host descriptor rings\n", "nes_init_nic_qp", 1698); } else { } return (-12); } else { } if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Allocated NIC QP structures at %p (phys = %016lX), size = %u.\n", "nes_init_nic_qp", 1702, nesvnic->nic_vbase, (unsigned long )nesvnic->nic_pbase, nesvnic->nic_mem_size); } else { } vmem = (void *)(((unsigned long )nesvnic->nic_vbase + 255UL) & 0xffffffffffffff00UL); pmem = (nesvnic->nic_pbase + 255ULL) & 0xffffffffffffff00ULL; nesvnic->nic.first_frag_vbase = (struct nes_first_frag *)vmem; counter = 0U; goto ldv_61353; ldv_61352: nesvnic->nic.frag_paddr[counter] = pmem; pmem = pmem + 128ULL; counter = counter + 1U; ldv_61353: ; if (counter <= 511U) { goto ldv_61352; } else { } vmem = vmem + 65536UL; nesvnic->nic.sq_vbase = (struct nes_hw_nic_sq_wqe *)vmem; nesvnic->nic.sq_pbase = pmem; nesvnic->nic.sq_head = 0U; nesvnic->nic.sq_tail = 0U; nesvnic->nic.sq_size = 512U; counter = 0U; goto ldv_61356; ldv_61355: nic_sqe = nesvnic->nic.sq_vbase + (unsigned long )counter; nic_sqe->wqe_words[0] = 3221225472U; nic_sqe->wqe_words[3] = 8388608U; nic_sqe->wqe_words[6] = (unsigned int )nesvnic->nic.frag_paddr[counter]; nic_sqe->wqe_words[7] = (unsigned int )(nesvnic->nic.frag_paddr[counter] >> 32); counter = counter + 1U; ldv_61356: ; if (counter <= 511U) { goto ldv_61355; } else { } nesvnic->get_cqp_request = & nes_get_cqp_request; nesvnic->post_cqp_request = & nes_post_cqp_request; nesvnic->mcrq_mcast_filter = (int (*)(struct nes_vnic * , __u8 * ))0; spinlock_check(& nesvnic->nic.rq_lock); __raw_spin_lock_init(& nesvnic->nic.rq_lock.__annonCompField18.rlock, "&(&nesvnic->nic.rq_lock)->rlock", & __key); vmem = vmem + 32768UL; pmem = pmem + 32768ULL; nesvnic->nic.rq_vbase = (struct nes_hw_nic_rq_wqe *)vmem; nesvnic->nic.rq_pbase = pmem; nesvnic->nic.rq_head = 0U; nesvnic->nic.rq_tail = 0U; nesvnic->nic.rq_size = 512U; vmem = vmem + 32768UL; pmem = pmem + 32768ULL; if ((unsigned int )(nesdev->nesadapter)->netdev_count > 2U) { nesvnic->mcrq_qp_id = (u32 )((int )nesvnic->nic_index + 32); } else { nesvnic->mcrq_qp_id = (u32 )((int )nesvnic->nic.qp_id + 4); } nesvnic->nic_cq.cq_vbase = (struct nes_hw_nic_cqe volatile *)vmem; nesvnic->nic_cq.cq_pbase = pmem; nesvnic->nic_cq.cq_head = 0U; nesvnic->nic_cq.cq_size = 1024U; nesvnic->nic_cq.ce_handler = & nes_nic_napi_ce_handler; ldv_spin_lock(); cqp_head = (u32 )nesdev->cqp.sq_head; cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); cqp_wqe->wqe_words[0] = ((unsigned int )nesvnic->nic_cq.cq_size << 16) | 1027U; cqp_wqe->wqe_words[1] = (unsigned int )nesvnic->nic_cq.cq_number | ((unsigned int )nesdev->nic_ceq_index << 16); u64temp = nesvnic->nic_cq.cq_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); cqp_wqe->wqe_words[9] = 0U; u64temp = (u64 )(& nesvnic->nic_cq); cqp_wqe->wqe_words[8] = (unsigned int )(u64temp >> 1); cqp_wqe->wqe_words[9] = (unsigned int )(u64temp >> 33) & 2147483647U; cqp_wqe->wqe_words[10] = 0U; cqp_head = cqp_head + 1U; if (cqp_head >= (u32 )nesdev->cqp.sq_size) { cqp_head = 0U; } else { } cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); nic_context = (struct nes_hw_nic_qp_context *)nesvnic->nic_cq.cq_vbase + (unsigned long )nesvnic->nic_cq.cq_size; nic_context->context_words[0] = (((nesdev->pcidev)->devfn & 7U) << 12) | 3840U; if ((nes_debug_level & 2U) != 0U) { tmp___0 = nes_read_indexed___0(nesdev, 768U); tmp___1 = nes_read_indexed___0(nesdev, 752U); printk("\viw_nes: %s[%u]: RX_WINDOW_BUFFER_PAGE_TABLE_SIZE = 0x%08X, RX_WINDOW_BUFFER_SIZE = 0x%08X\n", "nes_init_nic_qp", 1803, tmp___1, tmp___0); } else { } tmp___2 = nes_read_indexed___0(nesdev, 768U); if (tmp___2 != 0U) { nic_context->context_words[0] = nic_context->context_words[0] | 229376U; } else { } u64temp = nesvnic->nic.sq_pbase; nic_context->context_words[2] = (unsigned int )u64temp; nic_context->context_words[3] = (unsigned int )(u64temp >> 32); u64temp = nesvnic->nic.rq_pbase; nic_context->context_words[4] = (unsigned int )u64temp; nic_context->context_words[5] = (unsigned int )(u64temp >> 32); cqp_wqe->wqe_words[0] = 327680U; cqp_wqe->wqe_words[1] = (unsigned int )nesvnic->nic.qp_id; u64temp = nesvnic->nic_cq.cq_pbase + (unsigned long long )((unsigned long )nesvnic->nic_cq.cq_size * 16UL); set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); cqp_head = cqp_head + 1U; if (cqp_head >= (u32 )nesdev->cqp.sq_size) { cqp_head = 0U; } else { } nesdev->cqp.sq_head = (u16 )cqp_head; __asm__ volatile ("": : : "memory"); nes_write32(nesdev->regs + 64UL, (u32 )((int )nesdev->cqp.qp_id | 41943040)); spin_unlock_irqrestore(& nesdev->cqp.lock, flags); if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for create NIC QP%u to complete.\n", "nes_init_nic_qp", 1833, (int )nesvnic->nic.qp_id); } else { } __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_hw.c", 1836, 0); __cond___0 = (u32 )nesdev->cqp.sq_tail == cqp_head; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61369: tmp___3 = prepare_to_wait_event(& nesdev->cqp.waitq, & __wait, 2); __int = tmp___3; __cond = (u32 )nesdev->cqp.sq_tail == cqp_head; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61368; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61369; ldv_61368: finish_wait(& nesdev->cqp.waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Create NIC QP%u completed, wait_event_timeout ret = %u.\n", "nes_init_nic_qp", 1838, (int )nesvnic->nic.qp_id, ret); } else { } if (ret == 0) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: NIC QP%u create timeout expired\n", "nes_init_nic_qp", 1840, (int )nesvnic->nic.qp_id); } else { } pci_free_consistent(nesdev->pcidev, (size_t )nesvnic->nic_mem_size, nesvnic->nic_vbase, nesvnic->nic_pbase); return (-5); } else { } counter = 0U; goto ldv_61373; ldv_61372: skb = dev_alloc_skb((unsigned int )nesvnic->max_frame_size); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: %s: out of memory for receive skb\n", "nes_init_nic_qp", 1850, (char *)(& netdev->name)); } else { } nes_destroy_nic_qp(nesvnic); return (-12); } else { } skb->dev = netdev; pmem = pci_map_single(nesdev->pcidev, (void *)skb->data, (size_t )nesvnic->max_frame_size, 2); cb = (struct nes_rskb_cb *)(& skb->cb); cb->busaddr = pmem; cb->maplen = (u32 )nesvnic->max_frame_size; nic_rqe = nesvnic->nic.rq_vbase + (unsigned long )counter; nic_rqe->wqe_words[0] = (unsigned int )nesvnic->max_frame_size; nic_rqe->wqe_words[1] = 0U; nic_rqe->wqe_words[2] = (unsigned int )pmem; nic_rqe->wqe_words[3] = (unsigned int )(pmem >> 32); nesvnic->nic.rx_skb[counter] = skb; counter = counter + 1U; ldv_61373: ; if (counter <= 510U) { goto ldv_61372; } else { } wqe_count = 511U; nesvnic->nic.rq_head = (u16 )wqe_count; __asm__ volatile ("": : : "memory"); ldv_61378: _min1 = wqe_count; _min2 = 255U; counter = _min1 < _min2 ? _min1 : _min2; wqe_count = wqe_count - counter; nes_write32(nesdev->regs + 64UL, (counter << 24) | (u32 )nesvnic->nic.qp_id); if (wqe_count != 0U) { goto ldv_61378; } else { } reg_timer_7(& nesvnic->rq_wqes_timer); nesvnic->rq_wqes_timer.function = & nes_rq_wqes_timeout; nesvnic->rq_wqes_timer.data = (unsigned long )nesvnic; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: NAPI support Enabled\n", "nes_init_nic_qp", 1883); } else { } if ((unsigned int )(nesdev->nesadapter)->et_use_adaptive_rx_coalesce != 0U) { nes_nic_init_timer(nesdev); if (netdev->mtu > 1500U) { jumbomode = 1U; } else { } nes_nic_init_timer_defaults(nesdev, (int )jumbomode); } else { } if ((unsigned int )(nesdev->nesadapter)->allow_unaligned_fpdus != 0U) { tmp___4 = nes_init_mgt_qp(nesdev, netdev, nesvnic); if (tmp___4 != 0) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: %s: Out of memory for pau nic\n", "nes_init_nic_qp", 1893, (char *)(& netdev->name)); } else { } nes_destroy_nic_qp(nesvnic); return (-12); } else { } } else { } nesvnic->lro_mgr.max_aggr = (int )nes_lro_max_aggr; nesvnic->lro_mgr.max_desc = 32; nesvnic->lro_mgr.lro_arr = (struct net_lro_desc *)(& nesvnic->lro_desc); nesvnic->lro_mgr.get_skb_header = & nes_lro_get_skb_hdr; nesvnic->lro_mgr.features = 3UL; nesvnic->lro_mgr.dev = netdev; nesvnic->lro_mgr.ip_summed = 1U; nesvnic->lro_mgr.ip_summed_aggr = 1U; return (0); } } void nes_destroy_nic_qp(struct nes_vnic *nesvnic ) { u64 u64temp ; dma_addr_t bus_address ; struct nes_device *nesdev ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_hw_nic_sq_wqe *nic_sqe ; __le16 *wqe_fragment_length ; u16 wqe_fragment_index ; u32 cqp_head ; u32 wqm_cfg0 ; unsigned long flags ; struct sk_buff *rx_skb ; struct nes_rskb_cb *cb ; int ret ; u16 tmp ; u16 tmp___0 ; int tmp___1 ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___2 ; bool __cond ; bool __cond___0 ; { nesdev = nesvnic->nesdev; if ((unsigned int )(nesdev->nesadapter)->allow_unaligned_fpdus != 0U) { nes_destroy_mgt(nesvnic); } else { } wqm_cfg0 = nes_read_indexed___0(nesdev, 20480U); nes_write_indexed___0(nesdev, 20480U, wqm_cfg0 & 4294934527U); goto ldv_61397; ldv_61396: rx_skb = nesvnic->nic.rx_skb[(int )nesvnic->nic.rq_tail]; cb = (struct nes_rskb_cb *)(& rx_skb->cb); pci_unmap_single(nesdev->pcidev, cb->busaddr, (size_t )cb->maplen, 2); tmp = nesvnic->nic.rq_tail; nesvnic->nic.rq_tail = (u16 )((int )nesvnic->nic.rq_tail + 1); consume_skb(nesvnic->nic.rx_skb[(int )tmp]); nesvnic->nic.rq_tail = (u16 )((int )((short )nesvnic->nic.rq_tail) & (int )((short )((unsigned int )nesvnic->nic.rq_size + 65535U))); ldv_61397: ; if ((int )nesvnic->nic.rq_head != (int )nesvnic->nic.rq_tail) { goto ldv_61396; } else { } goto ldv_61403; ldv_61402: nic_sqe = nesvnic->nic.sq_vbase + (unsigned long )nesvnic->nic.sq_tail; wqe_fragment_index = 1U; wqe_fragment_length = (__le16 *)(& nic_sqe->wqe_words) + 3U; wqe_fragment_length = wqe_fragment_length + 1; if ((unsigned int )*(wqe_fragment_length + (unsigned long )wqe_fragment_index) != 0U) { u64temp = (unsigned long long )nic_sqe->wqe_words[((int )wqe_fragment_index + 3) * 2]; u64temp = ((unsigned long long )nic_sqe->wqe_words[(int )wqe_fragment_index * 2 + 7] << 32) + u64temp; bus_address = u64temp; tmp___1 = test_and_clear_bit((long )nesvnic->nic.sq_tail, (unsigned long volatile *)(& nesvnic->nic.first_frag_overflow)); if (tmp___1 != 0) { tmp___0 = wqe_fragment_index; wqe_fragment_index = (u16 )((int )wqe_fragment_index + 1); pci_unmap_single(nesdev->pcidev, bus_address, (size_t )*(wqe_fragment_length + (unsigned long )tmp___0), 1); } else { } goto ldv_61401; ldv_61400: ; if ((unsigned int )*(wqe_fragment_length + (unsigned long )wqe_fragment_index) != 0U) { u64temp = (u64 )nic_sqe->wqe_words[((int )wqe_fragment_index + 3) * 2]; u64temp = ((unsigned long long )nic_sqe->wqe_words[(int )wqe_fragment_index * 2 + 7] << 32) + u64temp; bus_address = u64temp; pci_unmap_page(nesdev->pcidev, bus_address, (size_t )*(wqe_fragment_length + (unsigned long )wqe_fragment_index), 1); } else { goto ldv_61399; } wqe_fragment_index = (u16 )((int )wqe_fragment_index + 1); ldv_61401: ; if ((unsigned int )wqe_fragment_index <= 4U) { goto ldv_61400; } else { } ldv_61399: ; } else { } if ((unsigned long )nesvnic->nic.tx_skb[(int )nesvnic->nic.sq_tail] != (unsigned long )((struct sk_buff *)0)) { consume_skb(nesvnic->nic.tx_skb[(int )nesvnic->nic.sq_tail]); } else { } nesvnic->nic.sq_tail = (u16 )((int )((short )((unsigned int )nesvnic->nic.sq_tail + 1U)) & (int )((short )((unsigned int )nesvnic->nic.sq_size + 65535U))); ldv_61403: ; if ((int )nesvnic->nic.sq_head != (int )nesvnic->nic.sq_tail) { goto ldv_61402; } else { } ldv_spin_lock(); cqp_head = (u32 )nesdev->cqp.sq_head; cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, 327682U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (u32 )nesvnic->nic.qp_id); cqp_head = cqp_head + 1U; if (cqp_head >= (u32 )nesdev->cqp.sq_size) { cqp_head = 0U; } else { } cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, ((unsigned int )nesvnic->nic_cq.cq_size << 16) | 5U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (unsigned int )nesvnic->nic_cq.cq_number | ((unsigned int )nesdev->nic_ceq_index << 16)); cqp_head = cqp_head + 1U; if (cqp_head >= (u32 )nesdev->cqp.sq_size) { cqp_head = 0U; } else { } nesdev->cqp.sq_head = (u16 )cqp_head; __asm__ volatile ("": : : "memory"); nes_write32(nesdev->regs + 64UL, (u32 )((int )nesdev->cqp.qp_id | 41943040)); spin_unlock_irqrestore(& nesdev->cqp.lock, flags); if ((nes_debug_level & 524288U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for CQP, cqp_head=%u, cqp.sq_head=%u, cqp.sq_tail=%u, cqp.sq_size=%u\n", "nes_destroy_nic_qp", 2037, cqp_head, (int )nesdev->cqp.sq_head, (int )nesdev->cqp.sq_tail, (int )nesdev->cqp.sq_size); } else { } __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_hw.c", 2040, 0); __cond___0 = (u32 )nesdev->cqp.sq_tail == cqp_head; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61416: tmp___2 = prepare_to_wait_event(& nesdev->cqp.waitq, & __wait, 2); __int = tmp___2; __cond = (u32 )nesdev->cqp.sq_tail == cqp_head; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61415; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61416; ldv_61415: finish_wait(& nesdev->cqp.waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 524288U) != 0U) { printk("\viw_nes: %s[%u]: Destroy NIC QP returned, wait_event_timeout ret = %u, cqp_head=%u, cqp.sq_head=%u, cqp.sq_tail=%u\n", "nes_destroy_nic_qp", 2044, ret, cqp_head, (int )nesdev->cqp.sq_head, (int )nesdev->cqp.sq_tail); } else { } if (ret == 0) { if ((nes_debug_level & 524288U) != 0U) { printk("\viw_nes: %s[%u]: NIC QP%u destroy timeout expired\n", "nes_destroy_nic_qp", 2047, (int )nesvnic->nic.qp_id); } else { } } else { } pci_free_consistent(nesdev->pcidev, (size_t )nesvnic->nic_mem_size, nesvnic->nic_vbase, nesvnic->nic_pbase); nes_write_indexed___0(nesdev, 20480U, wqm_cfg0); return; } } int nes_napi_isr(struct nes_device *nesdev ) { struct nes_adapter *nesadapter ; u32 int_stat ; long tmp ; long tmp___0 ; { nesadapter = nesdev->nesadapter; if ((unsigned int )nesdev->napi_isr_ran != 0U) { int_stat = nesdev->int_stat; } else { int_stat = nes_read32((void const *)nesdev->regs); nesdev->int_stat = int_stat; nesdev->napi_isr_ran = 1U; } int_stat = nesdev->int_req & int_stat; if (int_stat != 0U && (int_stat & 65280U) == int_stat) { nesdev->napi_isr_ran = 0U; nes_write32(nesdev->regs, int_stat & 2432696319U); nes_process_ceq(nesdev, (struct nes_hw_ceq *)(& (nesdev->nesadapter)->ceq) + (unsigned long )nesdev->nic_ceq_index); tmp___0 = ldv__builtin_expect((long )((nesadapter->et_rx_coalesce_usecs_irq != 0U && (unsigned int )nesadapter->et_use_adaptive_rx_coalesce == 0U) || ((unsigned int )nesadapter->et_use_adaptive_rx_coalesce != 0U && (u32 )nesdev->deepcq_count > nesadapter->et_pkt_rate_low)), 0L); if (tmp___0 != 0L) { if ((nesdev->int_req & 536870912U) == 0U) { nesdev->int_req = nesdev->int_req | 536870912U; nes_write32(nesdev->regs + 20UL, nesdev->timer_int_req | ~ (nesdev->nesadapter)->timer_int_req); nes_write32(nesdev->regs + 16UL, ~ (nesdev->intf_int_req | 4U)); } else { } tmp = ldv__builtin_expect((unsigned int )nesadapter->et_use_adaptive_rx_coalesce != 0U, 0L); if (tmp != 0L) { nes_nic_init_timer(nesdev); } else { } nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req | 65535U); } else { nesdev->int_req = nesdev->int_req & 3758096383U; nes_write32(nesdev->regs + 16UL, ~ nesdev->intf_int_req); nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req); } nesdev->deepcq_count = 0U; return (1); } else { return (0); } } } static void process_critical_error(struct nes_device *nesdev ) { u32 debug_error ; u32 nes_idx_debug_error_masks0 ; u16 error_module ; u32 tmp ; { nes_idx_debug_error_masks0 = 0U; error_module = 0U; debug_error = nes_read_indexed___0(nesdev, 37180U); printk("\viw_nes: Critical Error reported by device!!! 0x%02X\n", (int )((unsigned short )debug_error)); nes_write_indexed___0(nesdev, 37180U, (debug_error & 65535U) | 16842752U); tmp = crit_err_count; crit_err_count = crit_err_count + 1U; if (tmp > 10U) { nes_write_indexed___0(nesdev, 37188U, 8388608U); } else { } error_module = (u16 )(((int )((unsigned short )debug_error) & 7936) >> 8); (nesdev->nesadapter)->crit_error_count[(int )error_module + -1] = (u8 )((int )(nesdev->nesadapter)->crit_error_count[(int )error_module + -1] + 1); if ((int )(nesdev->nesadapter)->crit_error_count[(int )error_module + -1] >= (int )((unsigned char )nes_max_critical_error_count)) { printk("\viw_nes: Masking off critical error for module 0x%02X\n", (int )error_module); nes_idx_debug_error_masks0 = nes_read_indexed___0(nesdev, 37184U); nes_write_indexed___0(nesdev, 37184U, (u32 )(1 << (int )error_module) | nes_idx_debug_error_masks0); } else { } return; } } void nes_dpc(unsigned long param ) { struct nes_device *nesdev ; struct nes_adapter *nesadapter ; u32 counter ; u32 loop_counter ; u32 int_status_bit ; u32 int_stat ; u32 timer_stat ; u32 temp_int_stat ; u32 intf_int_stat ; u32 processed_intf_int ; u16 processed_timer_int ; u16 completion_ints ; u16 timer_ints ; u32 tmp ; long tmp___0 ; { nesdev = (struct nes_device *)param; nesadapter = nesdev->nesadapter; loop_counter = 0U; processed_intf_int = 0U; processed_timer_int = 0U; completion_ints = 0U; timer_ints = 0U; ldv_61451: timer_stat = 0U; if ((unsigned int )nesdev->napi_isr_ran != 0U) { nesdev->napi_isr_ran = 0U; int_stat = nesdev->int_stat; } else { int_stat = nes_read32((void const *)nesdev->regs); } if (processed_intf_int != 0U) { int_stat = (nesdev->int_req & int_stat) & 3221225471U; } else { int_stat = nesdev->int_req & int_stat; } if ((unsigned int )processed_timer_int == 0U) { processed_timer_int = 1U; if ((int_stat & 536870912U) != 0U) { timer_stat = nes_read32((void const *)nesdev->regs + 20U); if ((nesdev->timer_int_req & timer_stat) == 0U) { int_stat = int_stat & 3758096383U; } else { } } else { } } else { int_stat = int_stat & 3758096383U; } if (int_stat != 0U) { if ((int_stat & 2432696319U) != 0U) { nes_write32(nesdev->regs, int_stat & 2432696319U); } else { } temp_int_stat = int_stat; counter = 0U; int_status_bit = 1U; goto ldv_61448; ldv_61447: ; if ((int_stat & int_status_bit) != 0U) { nes_process_ceq(nesdev, (struct nes_hw_ceq *)(& nesadapter->ceq) + (unsigned long )counter); temp_int_stat = ~ int_status_bit & temp_int_stat; completion_ints = 1U; } else { } if ((temp_int_stat & 65535U) == 0U) { goto ldv_61446; } else { } int_status_bit = int_status_bit << 1; counter = counter + 1U; ldv_61448: ; if (counter <= 15U) { goto ldv_61447; } else { } ldv_61446: int_status_bit = (u32 )(1 << (int )(((nesdev->pcidev)->devfn & 7U) + 16U)); if ((int_stat & int_status_bit) != 0U) { nes_process_aeq(nesdev, (struct nes_hw_aeq *)(& nesadapter->aeq) + ((unsigned long )(nesdev->pcidev)->devfn & 7UL)); } else { } int_status_bit = (u32 )(1 << (int )(nesdev->mac_index + 24U)); if ((int_stat & int_status_bit) != 0U) { nes_process_mac_intr(nesdev, nesdev->mac_index); } else { } if ((int_stat & 536870912U) != 0U) { if ((nesdev->timer_int_req & timer_stat) != 0U) { nes_write32(nesdev->regs + 20UL, (nesdev->timer_int_req & timer_stat) | ~ (nesdev->nesadapter)->timer_int_req); timer_ints = 1U; } else { } } else { } if ((int_stat & 1073741824U) != 0U) { processed_intf_int = 1U; intf_int_stat = nes_read32((void const *)nesdev->regs + 12U); intf_int_stat = nesdev->intf_int_req & intf_int_stat; if ((intf_int_stat & 16384U) != 0U) { process_critical_error(nesdev); } else { } if ((int )intf_int_stat & 1) { printk("\viw_nes: PCI Error reported by device!!!\n"); __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_hw.c"), "i" (2238), "i" (12UL)); ldv_61449: ; goto ldv_61449; } else { } if ((intf_int_stat & 16711680U) != 0U) { printk("\viw_nes: AEQ Overflow reported by device!!!\n"); __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_hw.c"), "i" (2242), "i" (12UL)); ldv_61450: ; goto ldv_61450; } else { } nes_write32(nesdev->regs + 12UL, intf_int_stat); } else { } } else { } int_stat = int_stat & 3221225471U; if (int_stat != 0U) { tmp = loop_counter; loop_counter = loop_counter + 1U; if (tmp <= 127U) { goto ldv_61451; } else { goto ldv_61452; } } else { } ldv_61452: ; if ((unsigned int )timer_ints == 1U) { if (nesadapter->et_rx_coalesce_usecs_irq != 0U || (unsigned int )nesadapter->et_use_adaptive_rx_coalesce != 0U) { if ((unsigned int )completion_ints == 0U) { nesdev->timer_only_int_count = nesdev->timer_only_int_count + 1U; if (nesdev->timer_only_int_count >= nesadapter->timer_int_limit) { nesdev->timer_only_int_count = 0U; nesdev->int_req = nesdev->int_req & 3758096383U; nes_write32(nesdev->regs + 16UL, ~ nesdev->intf_int_req); nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req); } else { nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req | 65535U); } } else { tmp___0 = ldv__builtin_expect((unsigned int )nesadapter->et_use_adaptive_rx_coalesce != 0U, 0L); if (tmp___0 != 0L) { nes_nic_init_timer(nesdev); } else { } nesdev->timer_only_int_count = 0U; nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req | 65535U); } } else { nesdev->timer_only_int_count = 0U; nesdev->int_req = nesdev->int_req & 3758096383U; nes_write32(nesdev->regs + 16UL, ~ nesdev->intf_int_req); nes_write32(nesdev->regs + 20UL, nesdev->timer_int_req | ~ (nesdev->nesadapter)->timer_int_req); nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req); } } else if ((unsigned int )completion_ints == 1U && ((nesadapter->et_rx_coalesce_usecs_irq != 0U && (unsigned int )nesadapter->et_use_adaptive_rx_coalesce == 0U) || ((u32 )nesdev->deepcq_count > nesadapter->et_pkt_rate_low && (unsigned int )nesadapter->et_use_adaptive_rx_coalesce != 0U))) { nesdev->timer_only_int_count = 0U; nesdev->int_req = nesdev->int_req | 536870912U; nes_write32(nesdev->regs + 20UL, nesdev->timer_int_req | ~ (nesdev->nesadapter)->timer_int_req); nes_write32(nesdev->regs + 16UL, ~ (nesdev->intf_int_req | 4U)); nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req | 65535U); } else { nes_write32(nesdev->regs + 4UL, ~ nesdev->int_req); } nesdev->deepcq_count = 0U; return; } } static void nes_process_ceq(struct nes_device *nesdev , struct nes_hw_ceq *ceq ) { u64 u64temp ; struct nes_hw_cq *cq ; u32 head ; u32 ceq_size ; { head = (u32 )ceq->ceq_head; ceq_size = (u32 )ceq->ceq_size; ldv_61462: ; if ((int )(ceq->ceq_vbase + (unsigned long )head)->ceqe_words[1] < 0) { u64temp = ((unsigned long long )(ceq->ceq_vbase + (unsigned long )head)->ceqe_words[1] << 32) | (unsigned long long )(ceq->ceq_vbase + (unsigned long )head)->ceqe_words[0]; u64temp = u64temp << 1; cq = *((struct nes_hw_cq **)(& u64temp)); __asm__ volatile ("": : : "memory"); (ceq->ceq_vbase + (unsigned long )head)->ceqe_words[1] = 0U; (*(cq->ce_handler))(nesdev, cq); head = head + 1U; if (head >= ceq_size) { head = 0U; } else { } } else { goto ldv_61461; } goto ldv_61462; ldv_61461: ceq->ceq_head = (u16 )head; return; } } static void nes_process_aeq(struct nes_device *nesdev , struct nes_hw_aeq *aeq ) { u32 head ; u32 aeq_size ; u32 aeqe_misc ; u32 aeqe_cq_id ; struct nes_hw_aeqe volatile *aeqe ; { head = (u32 )aeq->aeq_head; aeq_size = (u32 )aeq->aeq_size; ldv_61474: aeqe = aeq->aeq_vbase + (unsigned long )head; if ((int )aeqe->aeqe_words[3] >= 0) { goto ldv_61472; } else { } aeqe_misc = aeqe->aeqe_words[3]; aeqe_cq_id = aeqe->aeqe_words[2]; if ((aeqe_misc & 196608U) != 0U) { if (aeqe_cq_id > 63U) { nes_process_iwarp_aeqe(nesdev, (struct nes_hw_aeqe *)aeqe); } else if ((nes_debug_level & 65536U) != 0U) { printk("\viw_nes: %s[%u]: Processing CQP related AE, misc = 0x%04X\n", "nes_process_aeq", 2377, (int )((unsigned short )(aeqe_misc >> 16))); } else { } } else { } aeqe->aeqe_words[3] = 0U; head = head + 1U; if (head >= aeq_size) { head = 0U; } else { } nes_write32(nesdev->regs + 72UL, 65536U); goto ldv_61474; ldv_61472: aeq->aeq_head = (u16 )head; return; } } static void nes_reset_link(struct nes_device *nesdev , u32 mac_index ) { struct nes_adapter *nesadapter ; u32 reset_value ; u32 i ; u32 u32temp ; u32 tmp ; u32 tmp___0 ; u32 pcs_control_status0 ; u32 pcs_control_status1 ; u32 tmp___1 ; u32 tmp___2 ; { nesadapter = nesdev->nesadapter; i = 0U; if (nesadapter->hw_rev == 4U) { return; } else { } mh_detected = mh_detected + 1U; reset_value = nes_read32((void const *)nesdev->regs + 48U); if (mac_index == 0U || (mac_index == 1U && (unsigned int )nesadapter->OneG_Mode != 0U)) { reset_value = reset_value | 29U; } else { reset_value = reset_value | 45U; } if ((unsigned int )nesadapter->link_interrupt_count[mac_index] > 511U) { if ((unsigned int )nesadapter->OneG_Mode == 0U && (unsigned int )nesadapter->port_count == 2U) { nesadapter->link_interrupt_count[0] = 0U; nesadapter->link_interrupt_count[1] = 0U; u32temp = nes_read_indexed___0(nesdev, 10760U); if ((u32temp & 64U) != 0U) { nes_write_indexed___0(nesdev, 10760U, 61576U); } else { nes_write_indexed___0(nesdev, 10760U, 61640U); } reset_value = reset_value | 61U; } else { } nesadapter->link_interrupt_count[mac_index] = 0U; } else { } nes_write32(nesdev->regs + 48UL, reset_value); goto ldv_61484; ldv_61483: ; ldv_61484: tmp = nes_read32((void const *)nesdev->regs + 48U); if ((tmp & 64U) == 0U) { tmp___0 = i; i = i + 1U; if (tmp___0 <= 4999U) { goto ldv_61483; } else { goto ldv_61485; } } else { } ldv_61485: ; if ((reset_value & 61U) == 61U) { i = 0U; goto ldv_61491; ldv_61490: pcs_control_status0 = nes_read_indexed___0(nesdev, 10240U); pcs_control_status1 = nes_read_indexed___0(nesdev, 10752U); if (((pcs_control_status0 & 251658240U) == 251658240U && (pcs_control_status0 & 1048576U) != 0U) || ((pcs_control_status1 & 251658240U) == 251658240U && (pcs_control_status1 & 1048576U) != 0U)) { goto ldv_61488; } else { goto ldv_61489; } ldv_61488: i = i + 1U; ldv_61491: ; if (i <= 9U) { goto ldv_61490; } else { } ldv_61489: ; if (i == 10U) { u32temp = nes_read_indexed___0(nesdev, 10760U); if ((u32temp & 64U) != 0U) { nes_write_indexed___0(nesdev, 10760U, 61576U); } else { nes_write_indexed___0(nesdev, 10760U, 61640U); } nes_write32(nesdev->regs + 48UL, reset_value); goto ldv_61493; ldv_61492: ; ldv_61493: tmp___1 = nes_read32((void const *)nesdev->regs + 48U); if ((tmp___1 & 64U) == 0U) { tmp___2 = i; i = i + 1U; if (tmp___2 <= 4999U) { goto ldv_61492; } else { goto ldv_61494; } } else { } ldv_61494: ; } else { } } else { } return; } } static void nes_process_mac_intr(struct nes_device *nesdev , u32 mac_number ) { unsigned long flags ; u32 pcs_control_status ; struct nes_adapter *nesadapter ; struct nes_vnic *nesvnic ; u32 mac_status ; u32 mac_index ; u32 u32temp ; u16 phy_data ; u16 temp_phy_data ; u32 pcs_val ; u32 pcs_mask ; u32 cdr_ctrl ; u32 tmp ; u32 tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; struct list_head const *__mptr ; bool tmp___3 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; bool tmp___4 ; int tmp___5 ; struct list_head const *__mptr___2 ; unsigned long tmp___6 ; { nesadapter = nesdev->nesadapter; mac_index = nesdev->mac_index; pcs_val = 252641280U; pcs_mask = 253689856U; ldv_spin_lock(); if ((unsigned int )nesadapter->mac_sw_state[mac_number] != 0U) { spin_unlock_irqrestore(& nesadapter->phy_lock, flags); return; } else { } nesadapter->mac_sw_state[mac_number] = 1U; mac_status = nes_read_indexed___0(nesdev, mac_index * 512U + 8688U); nes_write_indexed___0(nesdev, mac_index * 512U + 8688U, mac_status); if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: MAC%u interrupt status = 0x%X.\n", "nes_process_mac_intr", 2490, mac_number, mac_status); } else { } if ((mac_status & 6U) != 0U) { nesdev->link_status_interrupts = nesdev->link_status_interrupts + 1ULL; nesadapter->link_interrupt_count[mac_index] = (u16 )((int )nesadapter->link_interrupt_count[mac_index] + 1); if (((unsigned int )nesadapter->link_interrupt_count[mac_index] & 127U) == 0U) { nes_reset_link(nesdev, mac_index); } else { } if ((unsigned int )nesadapter->OneG_Mode != 0U && (unsigned int )nesadapter->phy_type[mac_index] != 5U) { ldv_61512: nes_read_1G_phy_reg(nesdev, 26, (int )nesadapter->phy_index[mac_index], & phy_data); if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy%d data from register 0x1a = 0x%X.\n", "nes_process_mac_intr", 2504, (int )nesadapter->phy_index[mac_index], (int )phy_data); } else { } if ((int )((short )phy_data) < 0) { goto ldv_61512; } else { } temp_phy_data = 0U; ldv_61515: nes_read_1G_phy_reg(nesdev, 17, (int )nesadapter->phy_index[mac_index], & phy_data); if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy%d data from register 0x11 = 0x%X.\n", "nes_process_mac_intr", 2512, (int )nesadapter->phy_index[mac_index], (int )phy_data); } else { } if ((int )temp_phy_data == (int )phy_data) { goto ldv_61514; } else { } temp_phy_data = phy_data; goto ldv_61515; ldv_61514: nes_read_1G_phy_reg(nesdev, 30, (int )nesadapter->phy_index[mac_index], & phy_data); if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy%d data from register 0x1e = 0x%X.\n", "nes_process_mac_intr", 2521, (int )nesadapter->phy_index[mac_index], (int )phy_data); } else { } nes_read_1G_phy_reg(nesdev, 1, (int )nesadapter->phy_index[mac_index], & phy_data); if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: 1G phy%u data from register 1 = 0x%X\n", "nes_process_mac_intr", 2526, (int )nesadapter->phy_index[mac_index], (int )phy_data); } else { } if (((int )temp_phy_data & 4096) != 0) { if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: The Link is up according to the PHY\n", "nes_process_mac_intr", 2529); } else { } phy_data = 4U; } else if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: The Link is down according to the PHY\n", "nes_process_mac_intr", 2532); } else { } } else { } if ((nes_debug_level & 8U) != 0U) { tmp = nes_read_indexed___0(nesdev, 10764U); tmp___0 = nes_read_indexed___0(nesdev, 10252U); printk("\viw_nes: %s[%u]: Eth SERDES Common Status: 0=0x%08X, 1=0x%08X\n", "nes_process_mac_intr", 2537, tmp___0, tmp); } else { } if ((unsigned int )nesadapter->phy_type[mac_index] == 5U) { switch (mac_index) { case 1U: ; case 3U: pcs_control_status = nes_read_indexed___0(nesdev, 10752U); goto ldv_61518; default: pcs_control_status = nes_read_indexed___0(nesdev, 10240U); goto ldv_61518; } ldv_61518: ; } else { pcs_control_status = nes_read_indexed___0(nesdev, ((mac_index & 1U) + 20U) * 512U); pcs_control_status = nes_read_indexed___0(nesdev, ((mac_index & 1U) + 20U) * 512U); } if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: PCS PHY Control/Status%u: 0x%08X\n", "nes_process_mac_intr", 2559, mac_index, pcs_control_status); } else { } if ((unsigned int )nesadapter->OneG_Mode != 0U && (unsigned int )nesadapter->phy_type[mac_index] != 5U) { u32temp = 16842752U; if ((unsigned int )nesadapter->port_count > 2U) { u32temp = u32temp | 33685504U; } else { } if ((pcs_control_status & u32temp) != u32temp) { phy_data = 0U; if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: PCS says the link is down\n", "nes_process_mac_intr", 2568); } else { } } else { } } else { switch ((int )nesadapter->phy_type[mac_index]) { case 4: ; case 8: ; case 9: nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 4, 8); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 4, 49153); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 4, 49154); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 4, 49157); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 4, 49158); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 1, 36867); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 1, 36868); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 1, 36869); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 1, 36867); tmp___1 = nes_read_indexed___0(nesdev, 8324U); temp_phy_data = (unsigned short )tmp___1; nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 3, 33); nes_read_indexed___0(nesdev, 8324U); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 3, 33); tmp___2 = nes_read_indexed___0(nesdev, 8324U); phy_data = (unsigned short )tmp___2; phy_data = (unsigned int )temp_phy_data == 0U && (unsigned int )phy_data == 32768U ? 4U : 0U; if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: %s: Phy data = 0x%04X, link was %s.\n", "nes_process_mac_intr", 2596, "nes_process_mac_intr", (int )phy_data, (unsigned int )nesadapter->mac_link_down[mac_index] != 0U ? (char *)"DOWN" : (char *)"UP"); } else { } goto ldv_61523; case 5: ; if (mac_index <= 1U) { pcs_mask = 16842752U; pcs_val = pcs_mask; } else { pcs_mask = 33685504U; pcs_val = pcs_mask; } default: phy_data = (pcs_control_status & pcs_mask) == pcs_val ? 4U : 0U; goto ldv_61523; } ldv_61523: ; } if (((int )phy_data & 4) != 0) { if ((wide_ppm_offset != 0 && (unsigned int )nesadapter->phy_type[mac_index] == 1U) && nesadapter->hw_rev != 4U) { cdr_ctrl = nes_read_indexed___0(nesdev, mac_index * 512U + 10292U); nes_write_indexed___0(nesdev, mac_index * 512U + 10292U, cdr_ctrl | 983040U); } else { } nesadapter->mac_link_down[mac_index] = 0U; __mptr = (struct list_head const *)((struct list_head *)(& nesadapter->nesvnic_list) + (unsigned long )mac_index)->next; nesvnic = (struct nes_vnic *)__mptr + 0xffffffffffffcbb0UL; goto ldv_61531; ldv_61530: ; if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: The Link is UP!!. linkup was %d\n", "nes_process_mac_intr", 2626, (int )nesvnic->linkup); } else { } if ((unsigned int )nesvnic->linkup == 0U) { printk("iw_nes: The Link is now up for port %s, netdev %p.\n", (char *)(& (nesvnic->netdev)->name), nesvnic->netdev); tmp___3 = netif_queue_stopped((struct net_device const *)nesvnic->netdev); if ((int )tmp___3) { netif_start_queue(nesvnic->netdev); } else { } nesvnic->linkup = 1U; netif_carrier_on(nesvnic->netdev); spin_lock(& nesvnic->port_ibevent_lock); if ((unsigned int )nesvnic->of_device_registered != 0U) { if ((unsigned int )nesdev->iw_status == 0U) { nesdev->iw_status = 1U; nes_port_ibevent(nesvnic); } else { } } else { } spin_unlock(& nesvnic->port_ibevent_lock); } else { } __mptr___0 = (struct list_head const *)nesvnic->list.next; nesvnic = (struct nes_vnic *)__mptr___0 + 0xffffffffffffcbb0UL; ldv_61531: ; if ((unsigned long )(& nesvnic->list) != (unsigned long )((struct list_head *)(& nesadapter->nesvnic_list) + (unsigned long )mac_index)) { goto ldv_61530; } else { } } else { if ((wide_ppm_offset != 0 && (unsigned int )nesadapter->phy_type[mac_index] == 1U) && nesadapter->hw_rev != 4U) { cdr_ctrl = nes_read_indexed___0(nesdev, mac_index * 512U + 10292U); nes_write_indexed___0(nesdev, mac_index * 512U + 10292U, cdr_ctrl & 4293984255U); } else { } nesadapter->mac_link_down[mac_index] = 1U; __mptr___1 = (struct list_head const *)((struct list_head *)(& nesadapter->nesvnic_list) + (unsigned long )mac_index)->next; nesvnic = (struct nes_vnic *)__mptr___1 + 0xffffffffffffcbb0UL; goto ldv_61538; ldv_61537: ; if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: The Link is Down!!. linkup was %d\n", "nes_process_mac_intr", 2660, (int )nesvnic->linkup); } else { } if ((unsigned int )nesvnic->linkup == 1U) { printk("iw_nes: The Link is now down for port %s, netdev %p.\n", (char *)(& (nesvnic->netdev)->name), nesvnic->netdev); tmp___4 = netif_queue_stopped((struct net_device const *)nesvnic->netdev); if (tmp___4) { tmp___5 = 0; } else { tmp___5 = 1; } if (tmp___5) { netif_stop_queue(nesvnic->netdev); } else { } nesvnic->linkup = 0U; netif_carrier_off(nesvnic->netdev); spin_lock(& nesvnic->port_ibevent_lock); if ((unsigned int )nesvnic->of_device_registered != 0U) { if ((unsigned int )nesdev->iw_status == 1U) { nesdev->iw_status = 0U; nes_port_ibevent(nesvnic); } else { } } else { } spin_unlock(& nesvnic->port_ibevent_lock); } else { } __mptr___2 = (struct list_head const *)nesvnic->list.next; nesvnic = (struct nes_vnic *)__mptr___2 + 0xffffffffffffcbb0UL; ldv_61538: ; if ((unsigned long )(& nesvnic->list) != (unsigned long )((struct list_head *)(& nesadapter->nesvnic_list) + (unsigned long )mac_index)) { goto ldv_61537; } else { } } if ((unsigned int )nesadapter->phy_type[mac_index] == 8U) { nesdev->link_recheck = 1U; tmp___6 = msecs_to_jiffies(50U); mod_delayed_work(system_wq, & nesdev->work, tmp___6); } else { } } else { } spin_unlock_irqrestore(& nesadapter->phy_lock, flags); nesadapter->mac_sw_state[mac_number] = 0U; return; } } void nes_recheck_link_status(struct work_struct *work ) { unsigned long flags ; struct nes_device *nesdev ; struct work_struct const *__mptr ; struct nes_adapter *nesadapter ; struct nes_vnic *nesvnic ; u32 mac_index ; u16 phy_data ; u16 temp_phy_data ; u32 tmp ; u32 tmp___0 ; struct list_head const *__mptr___0 ; bool tmp___1 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; bool tmp___2 ; int tmp___3 ; struct list_head const *__mptr___3 ; unsigned long tmp___4 ; u8 tmp___5 ; { __mptr = (struct work_struct const *)work; nesdev = (struct nes_device *)__mptr + 0xfffffffffffffd18UL; nesadapter = nesdev->nesadapter; mac_index = nesdev->mac_index; ldv_spin_lock(); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 1, 36867); tmp = nes_read_indexed___0(nesdev, 8324U); temp_phy_data = (unsigned short )tmp; nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 3, 33); nes_read_indexed___0(nesdev, 8324U); nes_read_10G_phy_reg(nesdev, (int )nesadapter->phy_index[mac_index], 3, 33); tmp___0 = nes_read_indexed___0(nesdev, 8324U); phy_data = (unsigned short )tmp___0; phy_data = (unsigned int )temp_phy_data == 0U && (unsigned int )phy_data == 32768U ? 4U : 0U; if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: %s: Phy data = 0x%04X, link was %s.\n", "nes_recheck_link_status", 2717, "nes_recheck_link_status", (int )phy_data, (unsigned int )nesadapter->mac_link_down[mac_index] != 0U ? (char *)"DOWN" : (char *)"UP"); } else { } if (((int )phy_data & 4) != 0) { nesadapter->mac_link_down[mac_index] = 0U; __mptr___0 = (struct list_head const *)((struct list_head *)(& nesadapter->nesvnic_list) + (unsigned long )mac_index)->next; nesvnic = (struct nes_vnic *)__mptr___0 + 0xffffffffffffcbb0UL; goto ldv_61558; ldv_61557: ; if ((unsigned int )nesvnic->linkup == 0U) { printk("iw_nes: The Link is now up for port %s, netdev %p.\n", (char *)(& (nesvnic->netdev)->name), nesvnic->netdev); tmp___1 = netif_queue_stopped((struct net_device const *)nesvnic->netdev); if ((int )tmp___1) { netif_start_queue(nesvnic->netdev); } else { } nesvnic->linkup = 1U; netif_carrier_on(nesvnic->netdev); spin_lock(& nesvnic->port_ibevent_lock); if ((unsigned int )nesvnic->of_device_registered != 0U) { if ((unsigned int )nesdev->iw_status == 0U) { nesdev->iw_status = 1U; nes_port_ibevent(nesvnic); } else { } } else { } spin_unlock(& nesvnic->port_ibevent_lock); } else { } __mptr___1 = (struct list_head const *)nesvnic->list.next; nesvnic = (struct nes_vnic *)__mptr___1 + 0xffffffffffffcbb0UL; ldv_61558: ; if ((unsigned long )(& nesvnic->list) != (unsigned long )((struct list_head *)(& nesadapter->nesvnic_list) + (unsigned long )mac_index)) { goto ldv_61557; } else { } } else { nesadapter->mac_link_down[mac_index] = 1U; __mptr___2 = (struct list_head const *)((struct list_head *)(& nesadapter->nesvnic_list) + (unsigned long )mac_index)->next; nesvnic = (struct nes_vnic *)__mptr___2 + 0xffffffffffffcbb0UL; goto ldv_61565; ldv_61564: ; if ((unsigned int )nesvnic->linkup == 1U) { printk("iw_nes: The Link is now down for port %s, netdev %p.\n", (char *)(& (nesvnic->netdev)->name), nesvnic->netdev); tmp___2 = netif_queue_stopped((struct net_device const *)nesvnic->netdev); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { netif_stop_queue(nesvnic->netdev); } else { } nesvnic->linkup = 0U; netif_carrier_off(nesvnic->netdev); spin_lock(& nesvnic->port_ibevent_lock); if ((unsigned int )nesvnic->of_device_registered != 0U) { if ((unsigned int )nesdev->iw_status == 1U) { nesdev->iw_status = 0U; nes_port_ibevent(nesvnic); } else { } } else { } spin_unlock(& nesvnic->port_ibevent_lock); } else { } __mptr___3 = (struct list_head const *)nesvnic->list.next; nesvnic = (struct nes_vnic *)__mptr___3 + 0xffffffffffffcbb0UL; ldv_61565: ; if ((unsigned long )(& nesvnic->list) != (unsigned long )((struct list_head *)(& nesadapter->nesvnic_list) + (unsigned long )mac_index)) { goto ldv_61564; } else { } } tmp___5 = nesdev->link_recheck; nesdev->link_recheck = (u8 )((int )nesdev->link_recheck + 1); if ((unsigned int )tmp___5 <= 59U) { tmp___4 = msecs_to_jiffies(50U); schedule_delayed_work(& nesdev->work, tmp___4); } else { nesdev->link_recheck = 0U; } spin_unlock_irqrestore(& nesadapter->phy_lock, flags); return; } } static void nes_nic_napi_ce_handler(struct nes_device *nesdev , struct nes_hw_nic_cq *cq ) { struct nes_vnic *nesvnic ; struct nes_hw_nic_cq const *__mptr ; { __mptr = (struct nes_hw_nic_cq const *)cq; nesvnic = (struct nes_vnic *)__mptr + 0xffffffffffffccc0UL; napi_schedule(& nesvnic->napi); return; } } void nes_nic_ce_handler(struct nes_device *nesdev , struct nes_hw_nic_cq *cq ) { u64 u64temp ; dma_addr_t bus_address ; struct nes_hw_nic *nesnic ; struct nes_vnic *nesvnic ; struct nes_hw_nic_cq const *__mptr ; struct nes_adapter *nesadapter ; struct nes_hw_nic_rq_wqe *nic_rqe ; struct nes_hw_nic_sq_wqe *nic_sqe ; struct sk_buff *skb ; struct sk_buff *rx_skb ; struct nes_rskb_cb *cb ; __le16 *wqe_fragment_length ; u32 head ; u32 cq_size ; u32 rx_pkt_size ; u32 cqe_count ; u32 cqe_errv ; u32 cqe_misc ; u16 wqe_fragment_index ; u16 vlan_tag ; u16 pkt_type ; u16 rqes_processed ; u8 sq_cqes ; u8 nes_use_lro ; u16 tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; bool tmp___4 ; long tmp___5 ; int tmp___6 ; { __mptr = (struct nes_hw_nic_cq const *)cq; nesvnic = (struct nes_vnic *)__mptr + 0xffffffffffffccc0UL; nesadapter = nesdev->nesadapter; cqe_count = 0U; wqe_fragment_index = 1U; rqes_processed = 0U; sq_cqes = 0U; nes_use_lro = 0U; head = (u32 )cq->cq_head; cq_size = (u32 )cq->cq_size; cq->cqes_pending = 1U; if (((nesvnic->netdev)->features & 32768ULL) != 0ULL) { nes_use_lro = 1U; } else { } ldv_61609: ; if ((int )(cq->cq_vbase + (unsigned long )head)->cqe_words[3] < 0) { nesnic = & nesvnic->nic; cqe_misc = (cq->cq_vbase + (unsigned long )head)->cqe_words[3]; if ((cqe_misc & 16777216U) != 0U) { sq_cqes = (u8 )((int )sq_cqes + 1); wqe_fragment_index = 1U; nic_sqe = nesnic->sq_vbase + (unsigned long )nesnic->sq_tail; skb = nesnic->tx_skb[(int )nesnic->sq_tail]; wqe_fragment_length = (__le16 *)(& nic_sqe->wqe_words) + 3U; wqe_fragment_length = wqe_fragment_length + 1; if ((unsigned int )*(wqe_fragment_length + (unsigned long )wqe_fragment_index) != 0U) { u64temp = (unsigned long long )nic_sqe->wqe_words[((int )wqe_fragment_index + 3) * 2]; u64temp = ((unsigned long long )nic_sqe->wqe_words[(int )wqe_fragment_index * 2 + 7] << 32) + u64temp; bus_address = u64temp; tmp___0 = test_and_clear_bit((long )nesnic->sq_tail, (unsigned long volatile *)(& nesnic->first_frag_overflow)); if (tmp___0 != 0) { tmp = wqe_fragment_index; wqe_fragment_index = (u16 )((int )wqe_fragment_index + 1); pci_unmap_single(nesdev->pcidev, bus_address, (size_t )*(wqe_fragment_length + (unsigned long )tmp), 1); } else { } goto ldv_61605; ldv_61604: ; if ((unsigned int )*(wqe_fragment_length + (unsigned long )wqe_fragment_index) != 0U) { u64temp = (u64 )nic_sqe->wqe_words[((int )wqe_fragment_index + 3) * 2]; u64temp = ((unsigned long long )nic_sqe->wqe_words[(int )wqe_fragment_index * 2 + 7] << 32) + u64temp; bus_address = u64temp; pci_unmap_page(nesdev->pcidev, bus_address, (size_t )*(wqe_fragment_length + (unsigned long )wqe_fragment_index), 1); } else { goto ldv_61603; } wqe_fragment_index = (u16 )((int )wqe_fragment_index + 1); ldv_61605: ; if ((unsigned int )wqe_fragment_index <= 4U) { goto ldv_61604; } else { } ldv_61603: ; } else { } if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(skb); } else { } nesnic->sq_tail = (u16 )((int )nesnic->sq_tail + 1); nesnic->sq_tail = (u16 )((int )((short )nesnic->sq_tail) & (int )((short )((unsigned int )nesnic->sq_size + 65535U))); if ((unsigned int )sq_cqes > 128U) { __asm__ volatile ("": : : "memory"); tmp___1 = netif_queue_stopped((struct net_device const *)nesvnic->netdev); if ((int )tmp___1) { netif_wake_queue(nesvnic->netdev); } else { } sq_cqes = 0U; } else { } } else { rqes_processed = (u16 )((int )rqes_processed + 1); cq->rx_cqes_completed = cq->rx_cqes_completed + 1; cq->rx_pkts_indicated = cq->rx_pkts_indicated + 1; rx_pkt_size = cqe_misc & 65535U; nic_rqe = nesnic->rq_vbase + (unsigned long )nesnic->rq_tail; rx_skb = nesnic->rx_skb[(int )nesnic->rq_tail]; nic_rqe = nesnic->rq_vbase + (unsigned long )nesvnic->nic.rq_tail; bus_address = (unsigned long long )nic_rqe->wqe_words[2]; bus_address = ((unsigned long long )nic_rqe->wqe_words[3] << 32) + bus_address; pci_unmap_single(nesdev->pcidev, bus_address, (size_t )nesvnic->max_frame_size, 2); cb = (struct nes_rskb_cb *)(& rx_skb->cb); cb->busaddr = 0ULL; rx_skb->len = 0U; skb_put(rx_skb, rx_pkt_size); rx_skb->protocol = eth_type_trans(rx_skb, nesvnic->netdev); nesnic->rq_tail = (u16 )((int )nesnic->rq_tail + 1); nesnic->rq_tail = (u16 )((int )((short )nesnic->rq_tail) & (int )((short )((unsigned int )nesnic->rq_size + 65535U))); atomic_inc(& nesvnic->rx_skbs_needed); tmp___2 = atomic_read((atomic_t const *)(& nesvnic->rx_skbs_needed)); if (tmp___2 > (int )nesvnic->nic.rq_size >> 1) { nes_write32(nesdev->regs + 68UL, (u32 )cq->cq_number | (cqe_count << 16)); nesdev->currcq_count = (int )nesdev->currcq_count + (int )((u16 )cqe_count); cqe_count = 0U; nes_replenish_nic_rq(nesvnic); } else { } pkt_type = (unsigned short )(cq->cq_vbase + (unsigned long )head)->cqe_words[2]; cqe_errv = (cqe_misc & 16711680U) >> 16; rx_skb->ip_summed = 0U; if (((int )pkt_type & 16176) == 272 || ((int )pkt_type & 16176) == 528) { if ((cqe_errv & 30U) == 0U) { if (((nesvnic->netdev)->features & 17179869184ULL) != 0ULL) { rx_skb->ip_summed = 1U; } else { } } else if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: %s: unsuccessfully checksummed TCP or UDP packet. errv = 0x%X, pkt_type = 0x%X.\n", "nes_nic_ce_handler", 2917, (char *)(& (nesvnic->netdev)->name), cqe_errv, (int )pkt_type); } else { } } else if (((int )pkt_type & 16176) == 16) { if ((cqe_errv & 26U) == 0U) { if (((nesvnic->netdev)->features & 17179869184ULL) != 0ULL) { rx_skb->ip_summed = 1U; } else { } } else if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: %s: unsuccessfully checksummed TCP or UDP packet. errv = 0x%X, pkt_type = 0x%X.\n", "nes_nic_ce_handler", 2931, (char *)(& (nesvnic->netdev)->name), cqe_errv, (int )pkt_type); } else { } } else { } if (((int )pkt_type & 65342) == 49426) { tmp___3 = nes_cm_recv(rx_skb, nesvnic->netdev); if (tmp___3 != 0) { rx_skb = (struct sk_buff *)0; } else { } } else { } if ((unsigned long )rx_skb == (unsigned long )((struct sk_buff *)0)) { goto skip_rx_indicate0; } else { } if ((cqe_misc & 1073741824U) != 0U) { vlan_tag = (unsigned short )((cq->cq_vbase + (unsigned long )head)->cqe_words[2] >> 16); if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: %s: Reporting stripped VLAN packet. Tag = 0x%04X\n", "nes_nic_ce_handler", 2949, (char *)(& (nesvnic->netdev)->name), (int )vlan_tag); } else { } __vlan_hwaccel_put_tag(rx_skb, 129, (int )vlan_tag); } else { } if ((unsigned int )nes_use_lro != 0U) { lro_receive_skb(& nesvnic->lro_mgr, rx_skb, (void *)0); } else { netif_receive_skb(rx_skb); } skip_rx_indicate0: ; } (cq->cq_vbase + (unsigned long )head)->cqe_words[3] = 0U; cqe_count = cqe_count + 1U; head = head + 1U; if (head >= cq_size) { head = 0U; } else { } if (cqe_count == 255U) { nes_write32(nesdev->regs + 68UL, (u32 )cq->cq_number | (cqe_count << 16)); nesdev->currcq_count = (int )nesdev->currcq_count + (int )((u16 )cqe_count); cqe_count = 0U; } else { } if (cq->rx_cqes_completed >= nesvnic->budget) { goto ldv_61608; } else { } } else { cq->cqes_pending = 0U; goto ldv_61608; } goto ldv_61609; ldv_61608: ; if ((unsigned int )nes_use_lro != 0U) { lro_flush_all(& nesvnic->lro_mgr); } else { } if ((unsigned int )sq_cqes != 0U) { __asm__ volatile ("": : : "memory"); tmp___4 = netif_queue_stopped((struct net_device const *)nesvnic->netdev); if ((int )tmp___4) { netif_wake_queue(nesvnic->netdev); } else { } } else { } cq->cq_head = (u16 )head; cq->cqe_allocs_pending = (int )cqe_count; tmp___5 = ldv__builtin_expect((unsigned int )nesadapter->et_use_adaptive_rx_coalesce != 0U, 0L); if (tmp___5 != 0L) { nesdev->currcq_count = (int )nesdev->currcq_count + (int )((u16 )cqe_count); nes_nic_tune_timer(nesdev); } else { } tmp___6 = atomic_read((atomic_t const *)(& nesvnic->rx_skbs_needed)); if (tmp___6 != 0) { nes_replenish_nic_rq(nesvnic); } else { } return; } } static void nes_cqp_ce_handler(struct nes_device *nesdev , struct nes_hw_cq *cq ) { u64 u64temp ; unsigned long flags ; struct nes_hw_cqp *cqp ; struct nes_cqp_request *cqp_request ; struct nes_hw_cqp_wqe *cqp_wqe ; u32 head ; u32 cq_size ; u32 cqe_count ; u32 error_code ; u32 opcode ; u32 ctx_index ; struct list_head const *__mptr ; u16 tmp ; int tmp___0 ; { cqp = (struct nes_hw_cqp *)0; cqe_count = 0U; head = (u32 )cq->cq_head; cq_size = (u32 )cq->cq_size; ldv_61627: opcode = (cq->cq_vbase + (unsigned long )head)->cqe_words[7]; if ((int )opcode < 0) { cqp = & nesdev->cqp; error_code = (cq->cq_vbase + (unsigned long )head)->cqe_words[6]; if (error_code != 0U) { if ((nes_debug_level & 512U) != 0U) { printk("\viw_nes: %s[%u]: Bad Completion code for opcode 0x%02X from CQP, Major/Minor codes = 0x%04X:%04X.\n", "nes_cqp_ce_handler", 3047, (cq->cq_vbase + (unsigned long )head)->cqe_words[7] & 63U, (int )((unsigned short )(error_code >> 16)), (int )((unsigned short )error_code)); } else { } } else { } u64temp = ((unsigned long long )(cq->cq_vbase + (unsigned long )head)->cqe_words[3] << 32) | (unsigned long long )(cq->cq_vbase + (unsigned long )head)->cqe_words[2]; cqp_request = (struct nes_cqp_request *)u64temp; if ((unsigned long )cqp_request != (unsigned long )((struct nes_cqp_request *)0)) { if ((unsigned int )cqp_request->waiting != 0U) { cqp_request->major_code = (unsigned short )(error_code >> 16); cqp_request->minor_code = (unsigned short )error_code; __asm__ volatile ("": : : "memory"); cqp_request->request_done = 1U; __wake_up(& cqp_request->waitq, 3U, 1, (void *)0); nes_put_cqp_request(nesdev, cqp_request); } else { if ((unsigned int )cqp_request->callback != 0U) { (*(cqp_request->cqp_callback))(nesdev, cqp_request); } else { } nes_free_cqp_request(nesdev, cqp_request); } } else { __wake_up(& nesdev->cqp.waitq, 3U, 1, (void *)0); } (cq->cq_vbase + (unsigned long )head)->cqe_words[7] = 0U; nes_write32(nesdev->regs + 68UL, (u32 )((int )cq->cq_number | 65536)); cqp->sq_tail = (u16 )((int )cqp->sq_tail + 1); if ((int )cqp->sq_tail >= (int )cqp->sq_size) { cqp->sq_tail = 0U; } else { } cqe_count = cqe_count + 1U; head = head + 1U; if (head >= cq_size) { head = 0U; } else { } } else { goto ldv_61626; } goto ldv_61627; ldv_61626: cq->cq_head = (u16 )head; ldv_spin_lock(); goto ldv_61631; ldv_61630: __mptr = (struct list_head const *)nesdev->cqp_pending_reqs.next; cqp_request = (struct nes_cqp_request *)__mptr + 0xffffffffffffff60UL; list_del_init(& cqp_request->list); tmp = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); head = (u32 )tmp; nesdev->cqp.sq_head = (u16 )((int )((short )nesdev->cqp.sq_head) & (int )((short )((unsigned int )nesdev->cqp.sq_size + 65535U))); cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )head; memcpy((void *)cqp_wqe, (void const *)(& cqp_request->cqp_wqe), 64UL); __asm__ volatile ("": : : "memory"); opcode = cqp_wqe->wqe_words[0]; if ((opcode & 63U) == 16U) { ctx_index = 1U; } else { ctx_index = 2U; } cqp_wqe->wqe_words[ctx_index] = (unsigned int )((long )cqp_request); cqp_wqe->wqe_words[ctx_index + 1U] = (unsigned int )((unsigned long )cqp_request >> 32UL); if ((nes_debug_level & 512U) != 0U) { printk("\viw_nes: %s[%u]: CQP request %p (opcode 0x%02X) put on CQPs SQ wqe%u.\n", "nes_cqp_ce_handler", 3112, cqp_request, cqp_wqe->wqe_words[0] & 63U, head); } else { } __asm__ volatile ("": : : "memory"); nes_write32(nesdev->regs + 64UL, (u32 )((int )nesdev->cqp.qp_id | 25165824)); ldv_61631: tmp___0 = list_empty((struct list_head const *)(& nesdev->cqp_pending_reqs)); if (tmp___0 == 0 && ((((int )nesdev->cqp.sq_tail + (int )nesdev->cqp.sq_size) - (int )nesdev->cqp.sq_head) & ((int )nesdev->cqp.sq_size + -1)) != 1) { goto ldv_61630; } else { } spin_unlock_irqrestore(& nesdev->cqp.lock, flags); nes_write32(nesdev->regs + 68UL, (u32 )((int )cq->cq_number | 536870912)); nes_read32((void const *)nesdev->regs + 68U); return; } } static u8 *locate_mpa(u8 *pkt , u32 aeq_info ) { { if ((aeq_info & 268435456U) != 0U) { pkt = pkt + 14UL; pkt = pkt + (unsigned long )(((int )*pkt & 15) * 4); pkt = pkt + (unsigned long )((((int )*(pkt + 12UL) >> 4) & 15) * 4); } else { } return (pkt); } } static u32 iwarp_opcode(struct nes_qp *nesqp , u32 aeq_info ) { u8 *pkt ; u16 *mpa ; u32 opcode ; u8 *tmp ; __u16 tmp___0 ; { opcode = 4294967295U; if ((aeq_info & 805306368U) != 0U) { pkt = (u8 *)nesqp->hwqp.q2_vbase + 64U; tmp = locate_mpa(pkt, aeq_info); mpa = (u16 *)tmp; tmp___0 = __fswab16((int )*(mpa + 1UL)); opcode = (u32 )tmp___0 & 15U; } else { } return (opcode); } } static int nes_bld_terminate_hdr(struct nes_qp *nesqp , u16 async_event_id , u32 aeq_info ) { u8 *pkt ; u16 ddp_seg_len ; int copy_len ; u8 is_tagged ; u8 flush_code ; struct nes_terminate_hdr *termhdr ; __u16 tmp ; u32 tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; { pkt = (u8 *)nesqp->hwqp.q2_vbase + 64U; copy_len = 0; is_tagged = 0U; flush_code = 0U; termhdr = (struct nes_terminate_hdr *)nesqp->hwqp.q2_vbase; memset((void *)termhdr, 0, 64UL); if ((aeq_info & 805306368U) != 0U) { pkt = locate_mpa(pkt, aeq_info); tmp = __fswab16((int )*((u16 *)pkt)); ddp_seg_len = tmp; if ((unsigned int )ddp_seg_len != 0U) { copy_len = 2; termhdr->hdrct = 128U; if ((int )((signed char )*(pkt + 2UL)) < 0) { is_tagged = 1U; if ((unsigned int )ddp_seg_len > 13U) { copy_len = copy_len + 14; termhdr->hdrct = (u8 )((unsigned int )termhdr->hdrct | 64U); } else { } } else { if ((unsigned int )ddp_seg_len > 17U) { copy_len = copy_len + 18; termhdr->hdrct = (u8 )((unsigned int )termhdr->hdrct | 64U); } else { } if ((unsigned int )ddp_seg_len > 45U) { if (((int )*(pkt + 3UL) & 15) == 1) { copy_len = copy_len + 28; termhdr->hdrct = (u8 )((unsigned int )termhdr->hdrct | 32U); } else { } } else { } } } else { } } else { } switch ((int )async_event_id) { case 258: tmp___0 = iwarp_opcode(nesqp, aeq_info); switch (tmp___0) { case 0U: flush_code = 4U; termhdr->layer_etype = 17U; termhdr->error_code = 0U; goto ldv_61657; default: flush_code = 10U; termhdr->layer_etype = 1U; termhdr->error_code = 0U; } ldv_61657: ; goto ldv_61659; case 259: flush_code = 10U; termhdr->layer_etype = 1U; termhdr->error_code = 0U; goto ldv_61659; case 260: flush_code = 2U; termhdr->layer_etype = 18U; termhdr->error_code = 1U; goto ldv_61659; case 262: ; case 263: tmp___1 = iwarp_opcode(nesqp, aeq_info); switch (tmp___1) { case 4U: ; case 6U: flush_code = 11U; termhdr->layer_etype = 2U; termhdr->error_code = 9U; goto ldv_61666; default: flush_code = 10U; termhdr->layer_etype = 1U; termhdr->error_code = 0U; } ldv_61666: ; goto ldv_61659; case 264: ; if ((aeq_info & 805306368U) != 0U) { flush_code = 4U; termhdr->layer_etype = 17U; termhdr->error_code = 1U; } else { flush_code = 10U; termhdr->layer_etype = 1U; termhdr->error_code = 1U; } goto ldv_61659; case 265: ; case 274: ; case 516: flush_code = 10U; termhdr->layer_etype = 1U; termhdr->error_code = 2U; goto ldv_61659; case 266: flush_code = 10U; termhdr->layer_etype = 1U; termhdr->error_code = 4U; goto ldv_61659; case 261: tmp___2 = iwarp_opcode(nesqp, aeq_info); switch (tmp___2) { case 0U: flush_code = 4U; termhdr->layer_etype = 17U; termhdr->error_code = 2U; goto ldv_61675; case 4U: ; case 6U: flush_code = 10U; termhdr->layer_etype = 1U; termhdr->error_code = 9U; goto ldv_61675; default: flush_code = 10U; termhdr->layer_etype = 1U; termhdr->error_code = 3U; } ldv_61675: ; goto ldv_61659; case 1284: flush_code = 1U; termhdr->layer_etype = 35U; termhdr->error_code = 3U; goto ldv_61659; case 1285: flush_code = 21U; termhdr->layer_etype = 35U; termhdr->error_code = 2U; goto ldv_61659; case 1286: ; case 1287: flush_code = 1U; termhdr->layer_etype = 16U; termhdr->error_code = 0U; goto ldv_61659; case 1792: ; case 776: flush_code = 19U; termhdr->layer_etype = 16U; termhdr->error_code = 0U; goto ldv_61659; case 769: ; case 770: flush_code = 21U; termhdr->layer_etype = 18U; termhdr->error_code = 3U; goto ldv_61659; case 771: flush_code = 1U; termhdr->layer_etype = 18U; termhdr->error_code = 5U; goto ldv_61659; case 772: flush_code = 21U; if ((unsigned int )is_tagged != 0U) { termhdr->layer_etype = 17U; termhdr->error_code = 4U; } else { termhdr->layer_etype = 18U; termhdr->error_code = 6U; } goto ldv_61659; case 773: flush_code = 21U; termhdr->layer_etype = 18U; termhdr->error_code = 4U; goto ldv_61659; case 774: flush_code = 11U; termhdr->layer_etype = 18U; termhdr->error_code = 2U; goto ldv_61659; case 775: flush_code = 21U; termhdr->layer_etype = 18U; termhdr->error_code = 1U; goto ldv_61659; case 785: flush_code = 21U; termhdr->layer_etype = 2U; termhdr->error_code = 5U; goto ldv_61659; case 786: flush_code = 2U; termhdr->layer_etype = 2U; termhdr->error_code = 6U; goto ldv_61659; default: flush_code = 19U; termhdr->layer_etype = 2U; termhdr->error_code = 255U; goto ldv_61659; } ldv_61659: ; if (copy_len != 0) { memcpy((void *)termhdr + 1U, (void const *)pkt, (size_t )copy_len); } else { } if ((unsigned int )flush_code != 0U && (aeq_info & 524288U) == 0U) { if ((aeq_info & 262144U) != 0U) { nesqp->term_sq_flush_code = (u16 )flush_code; } else { nesqp->term_rq_flush_code = (u16 )flush_code; } } else { } return ((int )((unsigned int )copy_len + 4U)); } } static void nes_terminate_connection(struct nes_device *nesdev , struct nes_qp *nesqp , struct nes_hw_aeqe *aeqe , enum ib_event_type eventtype ) { u64 context ; unsigned long flags ; u32 aeq_info ; u16 async_event_id ; u8 tcp_state ; u8 iwarp_state ; u32 termlen ; u32 mod_qp_flags ; struct nes_adapter *nesadapter ; int __ret_warn_on ; long tmp ; int tmp___0 ; { termlen = 0U; mod_qp_flags = 1358954496U; nesadapter = nesdev->nesadapter; if ((int )nesqp->term_flags & 1) { return; } else { } aeq_info = aeqe->aeqe_words[3]; tcp_state = (u8 )((aeq_info & 251658240U) >> 24); iwarp_state = (u8 )((aeq_info & 7340032U) >> 20); async_event_id = (unsigned short )aeq_info; context = (u64 )*(nesadapter->qp_table + (unsigned long )(aeqe->aeqe_words[2] - 64U)); if (context == 0ULL) { __ret_warn_on = context == 0ULL; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_hw.c", 3391); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } else { } nesqp = (struct nes_qp *)context; ldv_spin_lock(); nesqp->hw_iwarp_state = iwarp_state; nesqp->hw_tcp_state = tcp_state; nesqp->last_aeq = (u32 )async_event_id; nesqp->terminate_eventtype = eventtype; spin_unlock_irqrestore(& nesqp->lock, flags); if ((unsigned int )nesadapter->send_term_ok != 0U) { tmp___0 = nes_bld_terminate_hdr(nesqp, (int )async_event_id, aeq_info); termlen = (u32 )tmp___0; } else { mod_qp_flags = mod_qp_flags | 33554432U; } if ((unsigned int )nesdev->iw_status == 0U) { nesqp->term_flags = 4U; nes_hw_modify_qp(nesdev, nesqp, 1610612736U, 0U, 0U); nes_cm_disconn(nesqp); } else { nes_terminate_start_timer(nesqp); nesqp->term_flags = (u8 )((unsigned int )nesqp->term_flags | 1U); nes_hw_modify_qp(nesdev, nesqp, mod_qp_flags, termlen, 0U); } return; } } static void nes_terminate_send_fin(struct nes_device *nesdev , struct nes_qp *nesqp , struct nes_hw_aeqe *aeqe ) { u32 aeq_info ; u16 async_event_id ; u8 tcp_state ; u8 iwarp_state ; unsigned long flags ; { aeq_info = aeqe->aeqe_words[3]; tcp_state = (u8 )((aeq_info & 251658240U) >> 24); iwarp_state = (u8 )((aeq_info & 7340032U) >> 20); async_event_id = (unsigned short )aeq_info; ldv_spin_lock(); nesqp->hw_iwarp_state = iwarp_state; nesqp->hw_tcp_state = tcp_state; nesqp->last_aeq = (u32 )async_event_id; spin_unlock_irqrestore(& nesqp->lock, flags); nes_hw_modify_qp(nesdev, nesqp, 1375731712U, 0U, 0U); return; } } static void nes_terminate_done(struct nes_qp *nesqp , int timeout_occurred ) { u32 next_iwarp_state ; unsigned long flags ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; u8 first_time ; { next_iwarp_state = 1610612736U; tmp = to_nesvnic(nesqp->ibqp.device); nesvnic = tmp; nesdev = nesvnic->nesdev; first_time = 0U; ldv_spin_lock(); if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { nesqp->hte_added = 0U; next_iwarp_state = next_iwarp_state | 16384U; } else { } first_time = ((int )nesqp->term_flags & 4) == 0; nesqp->term_flags = (u8 )((unsigned int )nesqp->term_flags | 4U); spin_unlock_irqrestore(& nesqp->lock, flags); if ((unsigned int )first_time != 0U) { if (timeout_occurred == 0) { ldv_del_timer_110(& nesqp->terminate_timer); } else { next_iwarp_state = next_iwarp_state | 2147483648U; } nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0U, 0U); nes_cm_disconn(nesqp); } else { } return; } } static void nes_terminate_received(struct nes_device *nesdev , struct nes_qp *nesqp , struct nes_hw_aeqe *aeqe ) { u32 aeq_info ; u8 *pkt ; u32 *mpa ; u8 ddp_ctl ; u8 rdma_ctl ; u16 aeq_id ; u8 *tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; { aeq_id = 0U; aeq_info = aeqe->aeqe_words[3]; if ((aeq_info & 805306368U) != 0U) { pkt = (u8 *)nesqp->hwqp.q2_vbase + 64U; tmp = locate_mpa(pkt, aeq_info); mpa = (u32 *)tmp; tmp___0 = __fswab32(*mpa); ddp_ctl = (u8 )(tmp___0 >> 8); tmp___1 = __fswab32(*mpa); rdma_ctl = (u8 )tmp___1; if (((int )ddp_ctl & 192) != 64) { aeq_id = 1792U; } else if (((int )ddp_ctl & 3) != 1) { aeq_id = 772U; } else { tmp___4 = __fswab32(*(mpa + 2UL)); if (tmp___4 != 2U) { aeq_id = 775U; } else { tmp___3 = __fswab32(*(mpa + 3UL)); if (tmp___3 != 1U) { aeq_id = 769U; } else { tmp___2 = __fswab32(*(mpa + 4UL)); if (tmp___2 != 0U) { aeq_id = 773U; } else if (((int )rdma_ctl & 192) != 64) { aeq_id = 785U; } else { } } } } if ((unsigned int )aeq_id != 0U) { aeq_info = (aeq_info & 4294901760U) | (u32 )aeq_id; aeqe->aeqe_words[3] = aeq_info; nes_terminate_connection(nesdev, nesqp, aeqe, 1); return; } else { } } else { } nesqp->term_flags = (u8 )((unsigned int )nesqp->term_flags | 2U); nesqp->terminate_eventtype = 1; nes_terminate_start_timer(nesqp); nes_terminate_send_fin(nesdev, nesqp, aeqe); return; } } void nes_terminate_timeout(unsigned long context ) { struct nes_qp *nesqp ; { nesqp = (struct nes_qp *)context; nes_terminate_done(nesqp, 1); return; } } static void nes_terminate_start_timer(struct nes_qp *nesqp ) { { ldv_mod_timer_111(& nesqp->terminate_timer, (unsigned long )jiffies + 250UL); return; } } static void nes_process_iwarp_aeqe(struct nes_device *nesdev , struct nes_hw_aeqe *aeqe ) { u64 context ; unsigned long flags ; struct nes_qp *nesqp ; struct nes_hw_cq *hw_cq ; struct nes_cq *nescq ; int resource_allocated ; struct nes_adapter *nesadapter ; u32 aeq_info ; u32 next_iwarp_state ; u32 aeqe_cq_id ; u16 async_event_id ; u8 tcp_state ; u8 iwarp_state ; struct ib_event ibevent ; long tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; u32 tmp___4 ; int tmp___5 ; struct nes_hw_cq const *__mptr ; { nesadapter = nesdev->nesadapter; next_iwarp_state = 0U; if ((nes_debug_level & 65536U) != 0U) { printk("\viw_nes: %s[%u]: \n", "nes_process_iwarp_aeqe", 3556); } else { } aeq_info = aeqe->aeqe_words[3]; if ((aeq_info & 524288U) != 0U || (aeq_info & 65536U) == 0U) { context = (u64 )aeqe->aeqe_words[0]; context = ((unsigned long long )aeqe->aeqe_words[1] << 32) + context; } else { context = (u64 )*(nesadapter->qp_table + (unsigned long )(aeqe->aeqe_words[2] - 64U)); tmp = ldv__builtin_expect(context == 0ULL, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_hw.c"), "i" (3564), "i" (12UL)); ldv_61768: ; goto ldv_61768; } else { } } nesqp = (struct nes_qp *)context; async_event_id = (unsigned short )aeq_info; tcp_state = (u8 )((aeq_info & 251658240U) >> 24); iwarp_state = (u8 )((aeq_info & 7340032U) >> 20); if ((nes_debug_level & 65536U) != 0U) { printk("\viw_nes: %s[%u]: aeid = 0x%04X, qp-cq id = %d, aeqe = %p, Tcp state = %s, iWARP state = %s\n", "nes_process_iwarp_aeqe", 3576, (int )async_event_id, aeqe->aeqe_words[2], aeqe, nes_tcp_state_str[(int )tcp_state], nes_iwarp_state_str[(int )iwarp_state]); } else { } aeqe_cq_id = aeqe->aeqe_words[2]; if ((aeq_info & 65536U) != 0U) { tmp___0 = nes_is_resource_allocated(nesadapter, nesadapter->allocated_qps, aeqe_cq_id); if (tmp___0 == 0) { return; } else { } } else { } switch ((int )async_event_id) { case 1283: ; if ((unsigned int )nesqp->term_flags != 0U) { return; } else { } tmp___2 = atomic_add_return(1, & nesqp->close_timer_started); if (tmp___2 == 1) { if ((unsigned int )tcp_state == 6U && (unsigned int )nesqp->ibqp_state == 3U) { ldv_spin_lock(); nesqp->hw_iwarp_state = iwarp_state; nesqp->hw_tcp_state = tcp_state; nesqp->last_aeq = (u32 )async_event_id; next_iwarp_state = 805306368U; nesqp->hw_iwarp_state = 3U; spin_unlock_irqrestore(& nesqp->lock, flags); nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0U, 0U); nes_cm_disconn(nesqp); } else { } (*((nesqp->cm_id)->add_ref))(nesqp->cm_id); schedule_nes_timer((struct nes_cm_node *)nesqp->cm_node, (struct sk_buff *)nesqp, 3, 1, 0); if ((nes_debug_level & 65536U) != 0U) { tmp___1 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u Not decrementing QP refcount (%d), need ae to finish up, original_last_aeq = 0x%04X. last_aeq = 0x%04X, scheduling timer. TCP state = %d\n", "nes_process_iwarp_aeqe", 3611, nesqp->hwqp.qp_id, tmp___1, (int )async_event_id, nesqp->last_aeq, (int )tcp_state); } else { } } else { } goto ldv_61770; case 1281: ldv_spin_lock(); nesqp->hw_iwarp_state = iwarp_state; nesqp->hw_tcp_state = tcp_state; nesqp->last_aeq = (u32 )async_event_id; spin_unlock_irqrestore(& nesqp->lock, flags); nes_cm_disconn(nesqp); goto ldv_61770; case 1537: tcp_state = 1U; ldv_spin_lock(); nesqp->hw_iwarp_state = iwarp_state; nesqp->hw_tcp_state = tcp_state; nesqp->last_aeq = (u32 )async_event_id; nesqp->hte_added = 0U; spin_unlock_irqrestore(& nesqp->lock, flags); next_iwarp_state = 1610629120U; nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0U, 0U); nes_cm_disconn(nesqp); goto ldv_61770; case 1282: tmp___3 = atomic_read((atomic_t const *)(& nesqp->close_timer_started)); if (tmp___3 != 0) { return; } else { } ldv_spin_lock(); nesqp->hw_iwarp_state = iwarp_state; nesqp->hw_tcp_state = tcp_state; nesqp->last_aeq = (u32 )async_event_id; spin_unlock_irqrestore(& nesqp->lock, flags); nes_cm_disconn(nesqp); goto ldv_61770; case 1538: nes_terminate_send_fin(nesdev, nesqp, aeqe); goto ldv_61770; case 1289: nes_terminate_received(nesdev, nesqp, aeqe); goto ldv_61770; case 262: ; case 263: ; case 258: ; case 259: ; case 265: ; case 274: ; case 516: ; case 771: ; case 264: ; case 266: printk("\viw_nes: QP[%u] async_event_id=0x%04X IB_EVENT_QP_ACCESS_ERR\n", nesqp->hwqp.qp_id, (int )async_event_id); nes_terminate_connection(nesdev, nesqp, aeqe, 3); goto ldv_61770; case 1286: ; case 1287: ; case 773: ; case 775: tmp___4 = iwarp_opcode(nesqp, aeq_info); if (tmp___4 > 7U) { aeq_info = aeq_info & 4294901760U; aeq_info = aeq_info | 786U; aeqe->aeqe_words[3] = aeq_info; } else { } case 514: ; case 1290: ; case 774: ; case 1285: ; case 260: ; case 1284: ; case 1792: ; case 776: ; case 769: ; case 770: ; case 772: ; case 785: ; case 786: ; case 261: ; case 267: ; case 268: ; case 269: ; case 270: ; case 271: ; case 272: ; case 273: ; case 275: ; case 276: ; case 277: ; case 278: ; case 279: ; case 280: ; case 281: ; case 282: ; case 283: ; case 513: ; case 517: ; case 518: ; case 787: ; case 788: printk("\viw_nes: QP[%u] async_event_id=0x%04X IB_EVENT_QP_FATAL\n", nesqp->hwqp.qp_id, (int )async_event_id); print_ip((struct nes_cm_node *)nesqp->cm_node); tmp___5 = atomic_read((atomic_t const *)(& nesqp->close_timer_started)); if (tmp___5 == 0) { nes_terminate_connection(nesdev, nesqp, aeqe, 1); } else { } goto ldv_61770; case 515: context = context << 1; if ((nes_debug_level & 65536U) != 0U) { printk("\viw_nes: %s[%u]: Processing an NES_AEQE_AEID_CQ_OPERATION_ERROR event on CQ%u, %p\n", "nes_process_iwarp_aeqe", 3725, aeqe->aeqe_words[2], (void *)context); } else { } resource_allocated = nes_is_resource_allocated(nesadapter, nesadapter->allocated_cqs, aeqe->aeqe_words[2]); if (resource_allocated != 0) { printk("\viw_nes: %s: Processing an NES_AEQE_AEID_CQ_OPERATION_ERROR event on CQ%u\n", "nes_process_iwarp_aeqe", aeqe->aeqe_words[2]); hw_cq = (struct nes_hw_cq *)context; if ((unsigned long )hw_cq != (unsigned long )((struct nes_hw_cq *)0)) { __mptr = (struct nes_hw_cq const *)hw_cq; nescq = (struct nes_cq *)__mptr + 0xffffffffffffffd0UL; if ((unsigned long )nescq->ibcq.event_handler != (unsigned long )((void (*)(struct ib_event * , void * ))0)) { ibevent.device = nescq->ibcq.device; ibevent.event = 0; ibevent.element.cq = & nescq->ibcq; (*(nescq->ibcq.event_handler))(& ibevent, nescq->ibcq.cq_context); } else { } } else { } } else { } goto ldv_61770; default: ; if ((nes_debug_level & 65536U) != 0U) { printk("\viw_nes: %s[%u]: Processing an iWARP related AE for QP, misc = 0x%04X\n", "nes_process_iwarp_aeqe", 3746, (int )async_event_id); } else { } goto ldv_61770; } ldv_61770: ; return; } } void nes_iwarp_ce_handler(struct nes_device *nesdev , struct nes_hw_cq *hw_cq ) { struct nes_cq *nescq ; struct nes_hw_cq const *__mptr ; { __mptr = (struct nes_hw_cq const *)hw_cq; nescq = (struct nes_cq *)__mptr + 0xffffffffffffffd0UL; nes_write32(nesdev->regs + 52UL, (u32 )nescq->hw_cq.cq_number); if ((unsigned long )nescq->ibcq.comp_handler != (unsigned long )((void (*)(struct ib_cq * , void * ))0)) { (*(nescq->ibcq.comp_handler))(& nescq->ibcq, nescq->ibcq.cq_context); } else { } return; } } int nes_manage_apbvt(struct nes_vnic *nesvnic , u32 accel_local_port , u32 nic_index , u32 add_port ) { struct nes_device *nesdev ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; int ret ; u16 major_code ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp ; bool __cond ; bool __cond___0 ; { nesdev = nesvnic->nesdev; ret = 0; cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_manage_apbvt", 3785); } else { } return (-12); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: %s APBV for local port=%u(0x%04x), nic_index=%u\n", "nes_manage_apbvt", 3793, add_port == 1U ? (char *)"ADD" : (char *)"DEL", accel_local_port, accel_local_port, nic_index); } else { } nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, add_port == 1U ? 32803U : 35U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (nic_index << 16) | accel_local_port); if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for CQP completion for APBVT.\n", "nes_manage_apbvt", 3801); } else { } atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); if (add_port == 1U) { __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_hw.c", 3808, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61858: tmp = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61857; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61858; ldv_61857: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; } else { } if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Completed, ret=%u, CQP Major:Minor codes = 0x%04X:0x%04X\n", "nes_manage_apbvt", 3810, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } major_code = cqp_request->major_code; nes_put_cqp_request(nesdev, cqp_request); if (ret == 0) { return (-62); } else if ((unsigned int )major_code != 0U) { return (-5); } else { return (0); } } } void nes_manage_arp_cache(struct net_device *netdev , unsigned char *mac_addr , u32 ip_addr , u32 action ) { struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_cqp_request *cqp_request ; int arp_index ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; arp_index = nes_arp_table(nesdev, ip_addr, mac_addr, action); if (arp_index == -1) { return; } else { } cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_manage_arp_cache", 3845); } else { } return; } else { } cqp_request->waiting = 0U; cqp_wqe = & cqp_request->cqp_wqe; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); cqp_wqe->wqe_words[0] = 527U; cqp_wqe->wqe_words[0] = cqp_wqe->wqe_words[0] | (((nesdev->pcidev)->devfn & 7U) << 16); cqp_wqe->wqe_words[1] = (unsigned int )arp_index; if (action == 1U) { cqp_wqe->wqe_words[0] = cqp_wqe->wqe_words[0] | 256U; cqp_wqe->wqe_words[6] = ((((unsigned int )*(mac_addr + 2UL) << 24) | ((unsigned int )*(mac_addr + 3UL) << 16)) | ((unsigned int )*(mac_addr + 4UL) << 8)) | (unsigned int )*(mac_addr + 5UL); cqp_wqe->wqe_words[7] = ((unsigned int )*mac_addr << 16) | (unsigned int )*(mac_addr + 1UL); } else { cqp_wqe->wqe_words[6] = 0U; cqp_wqe->wqe_words[7] = 0U; } if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: Not waiting for CQP, cqp.sq_head=%u, cqp.sq_tail=%u\n", "nes_manage_arp_cache", 3871, (int )nesdev->cqp.sq_head, (int )nesdev->cqp.sq_tail); } else { } atomic_set(& cqp_request->refcount, 1); nes_post_cqp_request(nesdev, cqp_request); return; } } void flush_wqes(struct nes_device *nesdev , struct nes_qp *nesqp , u32 which_wq , u32 wait_completion ) { struct nes_cqp_request *cqp_request ; struct nes_hw_cqp_wqe *cqp_wqe ; u32 sq_code ; u32 rq_code ; int ret ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp ; bool __cond ; bool __cond___0 ; { sq_code = 65537U; rq_code = 65537U; cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "flush_wqes", 3892); } else { } return; } else { } if (wait_completion != 0U) { cqp_request->waiting = 1U; atomic_set(& cqp_request->refcount, 2); } else { cqp_request->waiting = 0U; } cqp_wqe = & cqp_request->cqp_wqe; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); if ((unsigned int )nesqp->term_sq_flush_code != 0U && (which_wq & 1073741824U) != 0U) { which_wq = which_wq | 268435456U; sq_code = (u32 )((long )((int )nesqp->term_sq_flush_code) | (-0x7FFFFFFF-1)); nesqp->term_sq_flush_code = 0U; } else { } if ((unsigned int )nesqp->term_rq_flush_code != 0U && (int )which_wq < 0) { which_wq = which_wq | 268435456U; rq_code = (u32 )((long )((int )nesqp->term_rq_flush_code) | (-0x7FFFFFFF-1)); nesqp->term_rq_flush_code = 0U; } else { } if ((which_wq & 268435456U) != 0U) { cqp_wqe->wqe_words[8] = sq_code; cqp_wqe->wqe_words[9] = rq_code; } else { } cqp_wqe->wqe_words[0] = which_wq | 34U; cqp_wqe->wqe_words[1] = nesqp->hwqp.qp_id; nes_post_cqp_request(nesdev, cqp_request); if (wait_completion != 0U) { __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_hw.c", 3931, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61895: tmp = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61894; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61895; ldv_61894: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Flush SQ QP WQEs completed, ret=%u, CQP Major:Minor codes = 0x%04X:0x%04X\n", "flush_wqes", 3934, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } nes_put_cqp_request(nesdev, cqp_request); } else { } return; } } int reg_timer_7(struct timer_list *timer ) { { ldv_timer_list_7 = timer; ldv_timer_state_7 = 1; return (0); } } void choose_timer_5(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_5 = 2; return; } } void disable_suitable_timer_6(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_6) { ldv_timer_state_6 = 0; return; } else { } return; } } void disable_suitable_timer_5(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_5) { ldv_timer_state_5 = 0; return; } else { } return; } } void activate_pending_timer_6(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_6 == (unsigned long )timer) { if (ldv_timer_state_6 == 2 || pending_flag != 0) { ldv_timer_list_6 = timer; ldv_timer_list_6->data = data; ldv_timer_state_6 = 1; } else { } return; } else { } reg_timer_6(timer); ldv_timer_list_6->data = data; return; } } void disable_suitable_timer_7(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_7) { ldv_timer_state_7 = 0; return; } else { } return; } } void choose_timer_6(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_6 = 2; return; } } int reg_timer_6(struct timer_list *timer ) { { ldv_timer_list_6 = timer; ldv_timer_state_6 = 1; return (0); } } void activate_pending_timer_5(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_5 == (unsigned long )timer) { if (ldv_timer_state_5 == 2 || pending_flag != 0) { ldv_timer_list_5 = timer; ldv_timer_list_5->data = data; ldv_timer_state_5 = 1; } else { } return; } else { } reg_timer_5(timer); ldv_timer_list_5->data = data; return; } } void choose_timer_7(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_7 = 2; return; } } int reg_timer_5(struct timer_list *timer ) { { ldv_timer_list_5 = timer; ldv_timer_state_5 = 1; return (0); } } void activate_pending_timer_7(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_7 == (unsigned long )timer) { if (ldv_timer_state_7 == 2 || pending_flag != 0) { ldv_timer_list_7 = timer; ldv_timer_list_7->data = data; ldv_timer_state_7 = 1; } else { } return; } else { } reg_timer_7(timer); ldv_timer_list_7->data = data; return; } } __inline static void spin_lock(spinlock_t *lock ) { { ldv_spin_lock(); ldv_spin_lock_70(lock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { ldv_spin_unlock(); ldv_spin_unlock_74(lock); return; } } bool ldv_queue_work_on_80(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_81(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_82(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___4 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_83(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_84(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___5 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void *ldv_kmem_cache_alloc_90(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } __inline static void *dma_zalloc_coherent(struct device *dev , size_t size , dma_addr_t *dma_handle , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_pskb_expand_head_96(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_98(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv_skb_copy_100(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_101(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_102(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_103(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } int ldv_pskb_expand_head_104(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } int ldv_pskb_expand_head_105(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_106(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } void *ldv_kmem_cache_alloc_107(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_del_timer_108(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_109(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_110(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___10 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_mod_timer_111(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___9 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern size_t strlcpy(char * , char const * , size_t ) ; __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) ; extern int del_timer_sync(struct timer_list * ) ; int ldv_del_timer_sync_163(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_135(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_137(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_136(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_139(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_138(struct workqueue_struct *ldv_func_arg1 ) ; void *ldv_kmem_cache_alloc_145(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_162(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; void disable_suitable_timer_8(struct timer_list *timer ) ; void activate_pending_timer_8(struct timer_list *timer , unsigned long data , int pending_flag ) ; void choose_timer_8(struct timer_list *timer ) ; int reg_timer_8(struct timer_list *timer ) ; __inline static void *lowmem_page_address(struct page const *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 64L) << 12) + 0xffff880000000000UL)); } } __inline static dma_addr_t dma_map_single_attrs___0(struct device *dev , void *ptr , size_t size , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; dma_addr_t addr ; int tmp___0 ; long tmp___1 ; unsigned long tmp___2 ; unsigned long tmp___3 ; { tmp = get_dma_ops(dev); ops = tmp; kmemcheck_mark_initialized(ptr, (unsigned int )size); tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (19), "i" (12UL)); ldv_31644: ; goto ldv_31644; } else { } tmp___2 = __phys_addr((unsigned long )ptr); addr = (*(ops->map_page))(dev, (struct page *)-24189255811072L + (tmp___2 >> 12), (unsigned long )ptr & 4095UL, size, dir, attrs); tmp___3 = __phys_addr((unsigned long )ptr); debug_dma_map_page(dev, (struct page *)-24189255811072L + (tmp___3 >> 12), (unsigned long )ptr & 4095UL, size, (int )dir, addr, 1); return (addr); } } __inline static dma_addr_t dma_map_page(struct device *dev , struct page *page , size_t offset , size_t size , enum dma_data_direction dir ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; dma_addr_t addr ; void *tmp___0 ; int tmp___1 ; long tmp___2 ; { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = lowmem_page_address((struct page const *)page); kmemcheck_mark_initialized(tmp___0 + offset, (unsigned int )size); tmp___1 = valid_dma_direction((int )dir); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (84), "i" (12UL)); ldv_31688: ; goto ldv_31688; } else { } addr = (*(ops->map_page))(dev, page, offset, size, dir, (struct dma_attrs *)0); debug_dma_map_page(dev, page, offset, size, (int )dir, addr, 0); return (addr); } } __inline static unsigned int skb_frag_size(skb_frag_t const *frag ) { { return ((unsigned int )frag->size); } } extern void kfree_skb(struct sk_buff * ) ; struct sk_buff *ldv_skb_clone_153(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_161(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_155(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_151(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_159(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_160(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; __inline static unsigned char *skb_end_pointer(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->end); } } __inline static bool skb_is_nonlinear(struct sk_buff const *skb ) { { return ((unsigned int )skb->data_len != 0U); } } __inline static unsigned int skb_headlen(struct sk_buff const *skb ) { { return ((unsigned int )skb->len - (unsigned int )skb->data_len); } } extern unsigned char *__pskb_pull_tail(struct sk_buff * , int ) ; __inline static void skb_set_network_header(struct sk_buff *skb , int const offset ) { { skb_reset_network_header(skb); skb->network_header = (int )skb->network_header + (int )((__u16 )offset); return; } } struct sk_buff *ldv___netdev_alloc_skb_156(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_157(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_158(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct page *skb_frag_page(skb_frag_t const *frag ) { { return ((struct page *)frag->page.p); } } __inline static dma_addr_t skb_frag_dma_map(struct device *dev , skb_frag_t const *frag , size_t offset , size_t size , enum dma_data_direction dir ) { struct page *tmp ; dma_addr_t tmp___0 ; { tmp = skb_frag_page(frag); tmp___0 = dma_map_page(dev, tmp, (size_t )frag->page_offset + offset, size, dir); return (tmp___0); } } __inline static int __skb_linearize(struct sk_buff *skb ) { unsigned char *tmp ; { tmp = __pskb_pull_tail(skb, (int )skb->data_len); return ((unsigned long )tmp != (unsigned long )((unsigned char *)0U) ? 0 : -12); } } __inline static int skb_linearize(struct sk_buff *skb ) { int tmp___0 ; int tmp___1 ; bool tmp___2 ; { tmp___2 = skb_is_nonlinear((struct sk_buff const *)skb); if ((int )tmp___2) { tmp___0 = __skb_linearize(skb); tmp___1 = tmp___0; } else { tmp___1 = 0; } return (tmp___1); } } __inline static bool skb_is_gso(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_end_pointer(skb); return ((unsigned int )((struct skb_shared_info *)tmp)->gso_size != 0U); } } __inline static void ethtool_cmd_speed_set(struct ethtool_cmd *ep , __u32 speed ) { { ep->speed = (unsigned short )speed; ep->speed_hi = (unsigned short )(speed >> 16); return; } } extern u32 ethtool_op_get_link(struct net_device * ) ; __inline static void napi_complete(struct napi_struct *n ) { { return; } } extern void napi_disable(struct napi_struct * ) ; __inline static void napi_enable(struct napi_struct *n ) { int tmp ; long tmp___0 ; { tmp = constant_test_bit(0L, (unsigned long const volatile *)(& n->state)); tmp___0 = ldv__builtin_expect(tmp == 0, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/netdevice.h"), "i" (507), "i" (12UL)); ldv_41847: ; goto ldv_41847; } else { } __asm__ volatile ("": : : "memory"); clear_bit(0L, (unsigned long volatile *)(& n->state)); return; } } extern void netif_napi_add(struct net_device * , struct napi_struct * , int (*)(struct napi_struct * , int ) , int ) ; extern int dev_queue_xmit_sk(struct sock * , struct sk_buff * ) ; __inline static int dev_queue_xmit(struct sk_buff *skb ) { int tmp ; { tmp = dev_queue_xmit_sk(skb->sk, skb); return (tmp); } } extern void free_netdev(struct net_device * ) ; void ldv_free_netdev_164(struct net_device *dev ) ; __inline static bool netif_running(struct net_device const *dev ) { int tmp ; { tmp = constant_test_bit(0L, (unsigned long const volatile *)(& dev->state)); return (tmp != 0); } } __inline static bool netif_carrier_ok(struct net_device const *dev ) { int tmp ; { tmp = constant_test_bit(2L, (unsigned long const volatile *)(& dev->state)); return (tmp == 0); } } __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 int eth_validate_addr(struct net_device * ) ; extern struct net_device *alloc_etherdev_mqs(int , unsigned int , unsigned int ) ; __inline static bool is_zero_ether_addr(u8 const *addr ) { { return (((unsigned int )*((u32 const *)addr) | (unsigned int )*((u16 const *)addr + 4U)) == 0U); } } __inline static bool is_multicast_ether_addr(u8 const *addr ) { u32 a ; { a = *((u32 const *)addr); return ((a & 1U) != 0U); } } __inline static bool is_valid_ether_addr(u8 const *addr ) { bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; { tmp = is_multicast_ether_addr(addr); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { tmp___1 = is_zero_ether_addr(addr); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___3 = 1; } else { tmp___3 = 0; } } else { tmp___3 = 0; } return ((bool )tmp___3); } } __inline static dma_addr_t pci_map_single___0(struct pci_dev *hwdev , void *ptr , size_t size , int direction ) { dma_addr_t tmp ; { tmp = dma_map_single_attrs___0((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, ptr, size, (enum dma_data_direction )direction, (struct dma_attrs *)0); return (tmp); } } atomic_t cm_connects ; atomic_t cm_accepts ; atomic_t cm_disconnects ; atomic_t cm_closes ; atomic_t cm_connecteds ; atomic_t cm_connect_reqs ; atomic_t cm_rejects ; atomic_t mod_qp_timouts ; atomic_t qps_created ; atomic_t sw_qps_destroyed ; u32 mh_pauses_sent ; u32 cm_packets_sent ; u32 cm_packets_bounced ; u32 cm_packets_created ; u32 cm_packets_received ; u32 cm_packets_dropped ; u32 cm_packets_retrans ; atomic_t cm_listens_created ; atomic_t cm_listens_destroyed ; u32 cm_backlog_drops ; atomic_t cm_loopbacks ; atomic_t cm_nodes_created ; atomic_t cm_nodes_destroyed ; atomic_t cm_accel_dropped_pkts ; atomic_t cm_resets_recvd ; atomic_t pau_qps_created ; atomic_t pau_qps_destroyed ; __inline static u32 nes_read_indexed___1(struct nes_device *nesdev , u32 reg_index ) { unsigned long flags ; void *addr ; u32 value ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); value = readl((void const volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return (value); } } __inline static void nes_write_indexed___1(struct nes_device *nesdev , u32 reg_index , u32 val ) { unsigned long flags ; void *addr ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); writel(val, (void volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return; } } int nes_nic_cm_xmit(struct sk_buff *skb , struct net_device *netdev ) ; struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev ) ; void nes_destroy_ofa_device(struct nes_ib_device *nesibdev ) ; int nes_register_ofa_device(struct nes_ib_device *nesibdev ) ; static struct nic_qp_map nic_qp_mapping_0[16U] = { {16U, 0U, 0U, 1U}, {24U, 4U, 0U, 0U}, {28U, 8U, 0U, 0U}, {32U, 12U, 0U, 0U}, {20U, 2U, 2U, 1U}, {26U, 6U, 2U, 0U}, {30U, 10U, 2U, 0U}, {34U, 14U, 2U, 0U}, {18U, 1U, 1U, 1U}, {25U, 5U, 1U, 0U}, {29U, 9U, 1U, 0U}, {33U, 13U, 1U, 0U}, {22U, 3U, 3U, 1U}, {27U, 7U, 3U, 0U}, {31U, 11U, 3U, 0U}, {35U, 15U, 3U, 0U}}; static struct nic_qp_map nic_qp_mapping_1[8U] = { {18U, 1U, 1U, 1U}, {25U, 5U, 1U, 0U}, {29U, 9U, 1U, 0U}, {33U, 13U, 1U, 0U}, {22U, 3U, 3U, 1U}, {27U, 7U, 3U, 0U}, {31U, 11U, 3U, 0U}, {35U, 15U, 3U, 0U}}; static struct nic_qp_map nic_qp_mapping_2[4U] = { {20U, 2U, 2U, 1U}, {26U, 6U, 2U, 0U}, {30U, 10U, 2U, 0U}, {34U, 14U, 2U, 0U}}; static struct nic_qp_map nic_qp_mapping_3[4U] = { {22U, 3U, 3U, 1U}, {27U, 7U, 3U, 0U}, {31U, 11U, 3U, 0U}, {35U, 15U, 3U, 0U}}; static struct nic_qp_map nic_qp_mapping_4[2U] = { {28U, 8U, 0U, 0U}, {32U, 12U, 0U, 0U}}; static struct nic_qp_map nic_qp_mapping_5[2U] = { {29U, 9U, 1U, 0U}, {33U, 13U, 1U, 0U}}; static struct nic_qp_map nic_qp_mapping_6[2U] = { {30U, 10U, 2U, 0U}, {34U, 14U, 2U, 0U}}; static struct nic_qp_map nic_qp_mapping_7[2U] = { {31U, 11U, 3U, 0U}, {35U, 15U, 3U, 0U}}; static struct nic_qp_map *nic_qp_mapping_per_function[8U] = { (struct nic_qp_map *)(& nic_qp_mapping_0), (struct nic_qp_map *)(& nic_qp_mapping_1), (struct nic_qp_map *)(& nic_qp_mapping_2), (struct nic_qp_map *)(& nic_qp_mapping_3), (struct nic_qp_map *)(& nic_qp_mapping_4), (struct nic_qp_map *)(& nic_qp_mapping_5), (struct nic_qp_map *)(& nic_qp_mapping_6), (struct nic_qp_map *)(& nic_qp_mapping_7)}; static unsigned int const default_msg = 55U; static int debug = -1; static int nics_per_function = 1; static int nes_netdev_poll(struct napi_struct *napi , int budget ) { struct nes_vnic *nesvnic ; struct napi_struct const *__mptr ; struct nes_device *nesdev ; struct nes_hw_nic_cq *nescq ; { __mptr = (struct napi_struct const *)napi; nesvnic = (struct nes_vnic *)__mptr + 0xffffffffffffff78UL; nesdev = nesvnic->nesdev; nescq = & nesvnic->nic_cq; nesvnic->budget = budget; nescq->cqes_pending = 0U; nescq->rx_cqes_completed = 0; nescq->cqe_allocs_pending = 0; nescq->rx_pkts_indicated = 0; nes_nic_ce_handler(nesdev, nescq); if ((unsigned int )nescq->cqes_pending == 0U) { napi_complete(napi); nes_write32(nesdev->regs + 68UL, (u32 )(((int )nescq->cq_number | 536870912) | (nescq->cqe_allocs_pending << 16))); nes_read32((void const *)nesdev->regs + 68U); } else { nes_write32(nesdev->regs + 68UL, (u32 )((int )nescq->cq_number | (nescq->cqe_allocs_pending << 16))); if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: %s: exiting with work pending\n", "nes_netdev_poll", 125, (char *)(& (nesvnic->netdev)->name)); } else { } } return (nescq->rx_pkts_indicated); } } static int nes_netdev_open(struct net_device *netdev ) { u32 macaddr_low ; u16 macaddr_high ; struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; int ret ; int i ; struct nes_vnic *first_nesvnic ; u32 nic_active_bit ; u32 nic_active ; struct list_head *list_pos ; struct list_head *list_temp ; unsigned long flags ; struct list_head const *__mptr ; unsigned long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; first_nesvnic = (struct nes_vnic *)0; if ((unsigned long )nesdev == (unsigned long )((struct nes_device *)0)) { printk("\viw_nes: Assertion failed! %s, %s, %s, line %d\n", (char *)"nesdev != NULL", (char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_nic.c", "nes_netdev_open", 149); } else { } if ((unsigned int )nesvnic->netdev_open == 1U) { return (0); } else { } if ((nesvnic->msg_enable & 32U) != 0U) { printk("\016iw_nes: %s: enabling interface\n", (char *)(& netdev->name)); } else { } ret = nes_init_nic_qp(nesdev, netdev); if (ret != 0) { return (ret); } else { } netif_carrier_off(netdev); netif_stop_queue(netdev); if ((unsigned int )nesvnic->of_device_registered == 0U && (unsigned int )nesvnic->rdma_enabled != 0U) { nesvnic->nesibdev = nes_init_ofa_device(netdev); if ((unsigned long )nesvnic->nesibdev == (unsigned long )((struct nes_ib_device *)0)) { printk("\viw_nes: %s: nesvnic->nesibdev alloc failed", (char *)(& netdev->name)); } else { (nesvnic->nesibdev)->nesvnic = nesvnic; ret = nes_register_ofa_device(nesvnic->nesibdev); if (ret != 0) { printk("\viw_nes: %s: Unable to register RDMA device, ret = %d\n", (char *)(& netdev->name), ret); } else { } } } else { } nic_active_bit = (u32 )(1 << (int )nesvnic->nic_index); nic_active = nes_read_indexed___1(nesdev, 24592U); nic_active = nic_active | nic_active_bit; nes_write_indexed___1(nesdev, 24592U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24616U); nic_active = nic_active | nic_active_bit; nes_write_indexed___1(nesdev, 24616U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24624U); nic_active = nic_active | nic_active_bit; nes_write_indexed___1(nesdev, 24624U, nic_active); macaddr_high = (int )((u16 )*(netdev->dev_addr)) << 8U; macaddr_high = (int )((u16 )*(netdev->dev_addr + 1UL)) + (int )macaddr_high; macaddr_low = (unsigned int )*(netdev->dev_addr + 2UL) << 24; macaddr_low = ((unsigned int )*(netdev->dev_addr + 3UL) << 16) + macaddr_low; macaddr_low = ((unsigned int )*(netdev->dev_addr + 4UL) << 8) + macaddr_low; macaddr_low = (u32 )*(netdev->dev_addr + 5UL) + macaddr_low; i = 0; goto ldv_61009; ldv_61008: ; if ((unsigned int )nesvnic->qp_nic_index[i] == 15U) { goto ldv_61007; } else { } if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: i=%d, perfect filter table index= %d, PERF FILTER LOW (Addr:%08X) = %08X, HIGH = %08X.\n", "nes_netdev_open", 210, i, (int )nesvnic->qp_nic_index[i], ((int )nesvnic->qp_nic_index[i] + 3136) * 8, macaddr_low, ((unsigned int )macaddr_high | ((unsigned int )nesvnic->nic_index << 16)) | 1048576U); } else { } nes_write_indexed___1(nesdev, (u32 )(((int )nesvnic->qp_nic_index[i] + 3136) * 8), macaddr_low); nes_write_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[i] * 8 + 25092), ((unsigned int )macaddr_high | ((unsigned int )nesvnic->nic_index << 16)) | 1048576U); i = i + 1; ldv_61009: ; if (i <= 3) { goto ldv_61008; } else { } ldv_61007: nes_write32(nesdev->regs + 68UL, (u32 )((int )nesvnic->nic_cq.cq_number | 536870912)); nes_read32((void const *)nesdev->regs + 68U); list_pos = ((struct list_head *)(& (nesdev->nesadapter)->nesvnic_list) + (unsigned long )nesdev->mac_index)->next; list_temp = list_pos->next; goto ldv_61014; ldv_61013: __mptr = (struct list_head const *)list_pos; first_nesvnic = (struct nes_vnic *)__mptr + 0xffffffffffffcbb0UL; if ((unsigned int )first_nesvnic->netdev_open == 1U) { goto ldv_61012; } else { } list_pos = list_temp; list_temp = list_pos->next; ldv_61014: ; if ((unsigned long )((struct list_head *)(& (nesdev->nesadapter)->nesvnic_list) + (unsigned long )nesdev->mac_index) != (unsigned long )list_pos) { goto ldv_61013; } else { } ldv_61012: ; if ((unsigned int )first_nesvnic->netdev_open == 0U) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Setting up MAC interrupt mask.\n", "nes_netdev_open", 230); } else { } nes_write_indexed___1(nesdev, nesdev->mac_index * 512U + 8692U, 4294967097U); first_nesvnic = nesvnic; } else { } if ((unsigned int )first_nesvnic->linkup != 0U) { nesvnic->linkup = 1U; netif_start_queue(netdev); netif_carrier_on(netdev); } else { } ldv_spin_lock(); if ((unsigned int )(nesdev->nesadapter)->phy_type[nesdev->mac_index] == 8U) { nesdev->link_recheck = 1U; tmp___0 = msecs_to_jiffies(50U); mod_delayed_work(system_wq, & nesdev->work, tmp___0); } else { } spin_unlock_irqrestore(& (nesdev->nesadapter)->phy_lock, flags); ldv_spin_lock(); if ((unsigned int )nesvnic->of_device_registered != 0U) { (nesdev->nesadapter)->send_term_ok = 1U; if ((unsigned int )nesvnic->linkup == 1U) { if ((unsigned int )nesdev->iw_status == 0U) { nesdev->iw_status = 1U; nes_port_ibevent(nesvnic); } else { } } else { nesdev->iw_status = 0U; } } else { } spin_unlock_irqrestore(& nesvnic->port_ibevent_lock, flags); napi_enable(& nesvnic->napi); nesvnic->netdev_open = 1U; return (0); } } static int nes_netdev_stop(struct net_device *netdev ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; u32 nic_active_mask ; u32 nic_active ; struct nes_vnic *first_nesvnic ; struct list_head *list_pos ; struct list_head *list_temp ; unsigned long flags ; struct list_head const *__mptr ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; first_nesvnic = (struct nes_vnic *)0; if ((nes_debug_level & 524288U) != 0U) { printk("\viw_nes: %s[%u]: nesvnic=%p, nesdev=%p, netdev=%p %s\n", "nes_netdev_stop", 287, nesvnic, nesdev, netdev, (char *)(& netdev->name)); } else { } if ((unsigned int )nesvnic->netdev_open == 0U) { return (0); } else { } if ((nesvnic->msg_enable & 16U) != 0U) { printk("\016iw_nes: %s: disabling interface\n", (char *)(& netdev->name)); } else { } netif_carrier_off(netdev); napi_disable(& nesvnic->napi); netif_stop_queue(netdev); list_pos = ((struct list_head *)(& (nesdev->nesadapter)->nesvnic_list) + (unsigned long )nesdev->mac_index)->next; list_temp = list_pos->next; goto ldv_61031; ldv_61030: __mptr = (struct list_head const *)list_pos; first_nesvnic = (struct nes_vnic *)__mptr + 0xffffffffffffcbb0UL; if ((unsigned int )first_nesvnic->netdev_open == 1U && (unsigned long )first_nesvnic != (unsigned long )nesvnic) { goto ldv_61029; } else { } list_pos = list_temp; list_temp = list_pos->next; ldv_61031: ; if ((unsigned long )((struct list_head *)(& (nesdev->nesadapter)->nesvnic_list) + (unsigned long )nesdev->mac_index) != (unsigned long )list_pos) { goto ldv_61030; } else { } ldv_61029: ; if (((unsigned int )first_nesvnic->netdev_open == 1U && (unsigned long )first_nesvnic != (unsigned long )nesvnic) && ((((first_nesvnic->nesdev)->pcidev)->devfn ^ ((nesvnic->nesdev)->pcidev)->devfn) & 7U) != 0U) { nes_write_indexed___1(nesdev, nesdev->mac_index * 512U + 8692U, 4294967295U); nes_write_indexed___1(first_nesvnic->nesdev, (first_nesvnic->nesdev)->mac_index * 512U + 8692U, 4294967097U); } else { nes_write_indexed___1(nesdev, nesdev->mac_index * 512U + 8692U, 4294967295U); } nic_active_mask = ~ ((unsigned int )(1 << (int )nesvnic->nic_index)); nes_write_indexed___1(nesdev, (u32 )((int )nesvnic->perfect_filter_index * 8 + 25092), 0U); nic_active = nes_read_indexed___1(nesdev, 24592U); nic_active = nic_active & nic_active_mask; nes_write_indexed___1(nesdev, 24592U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24608U); nic_active = nic_active & nic_active_mask; nes_write_indexed___1(nesdev, 24608U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24616U); nic_active = nic_active & nic_active_mask; nes_write_indexed___1(nesdev, 24616U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24600U); nic_active = nic_active & nic_active_mask; nes_write_indexed___1(nesdev, 24600U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24624U); nic_active = nic_active & nic_active_mask; nes_write_indexed___1(nesdev, 24624U, nic_active); ldv_spin_lock(); if ((unsigned int )nesvnic->of_device_registered != 0U) { (nesdev->nesadapter)->send_term_ok = 0U; nesdev->iw_status = 0U; if ((unsigned int )nesvnic->linkup == 1U) { nes_port_ibevent(nesvnic); } else { } } else { } ldv_del_timer_sync_163(& nesvnic->event_timer); nesvnic->event_timer.function = (void (*)(unsigned long ))0; spin_unlock_irqrestore(& nesvnic->port_ibevent_lock, flags); nes_destroy_nic_qp(nesvnic); nesvnic->netdev_open = 0U; return (0); } } static int nes_nic_send(struct sk_buff *skb , struct net_device *netdev ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_hw_nic *nesnic ; struct nes_hw_nic_sq_wqe *nic_sqe ; struct tcphdr *tcph ; __le16 *wqe_fragment_length ; u32 wqe_misc ; u16 wqe_fragment_index ; u16 skb_fragment_index ; dma_addr_t bus_address ; unsigned char *tmp___0 ; bool tmp___1 ; unsigned int _min1 ; unsigned int _min2 ; unsigned int tmp___2 ; unsigned int _min1___0 ; unsigned int _min2___0 ; unsigned int tmp___3 ; unsigned int tmp___4 ; unsigned char *tmp___5 ; unsigned char *tmp___6 ; unsigned int tmp___7 ; u16 tmp___8 ; unsigned int tmp___9 ; unsigned int tmp___10 ; unsigned int tmp___11 ; skb_frag_t *frag ; unsigned char *tmp___12 ; unsigned int tmp___13 ; unsigned char *tmp___14 ; unsigned int tmp___15 ; unsigned char *tmp___16 ; unsigned int tmp___17 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; nesnic = & nesvnic->nic; wqe_fragment_index = 1U; nic_sqe = nesnic->sq_vbase + (unsigned long )nesnic->sq_head; wqe_fragment_length = (__le16 *)(& nic_sqe->wqe_words) + 3U; if (((int )skb->vlan_tci & 4096) != 0) { if ((nes_debug_level & 256U) != 0U) { printk("\viw_nes: %s[%u]: %s: VLAN packet to send... VLAN = %08X\n", "nes_nic_send", 378, (char *)(& netdev->name), (int )skb->vlan_tci & -4097); } else { } wqe_misc = 8388608U; *wqe_fragment_length = (unsigned int )skb->vlan_tci & 61439U; } else { wqe_misc = 0U; } wqe_fragment_length = wqe_fragment_length + 1; wqe_misc = wqe_misc | 2147483648U; if ((unsigned int )*((unsigned char *)skb + 145UL) == 6U) { tmp___1 = skb_is_gso((struct sk_buff const *)skb); if ((int )tmp___1) { tcph = tcp_hdr((struct sk_buff const *)skb); tmp___0 = skb_end_pointer((struct sk_buff const *)skb); wqe_misc = ((u32 )((struct skb_shared_info *)tmp___0)->gso_size | wqe_misc) | 4194304U; set_wqe_32bit_value((__le32 *)(& nic_sqe->wqe_words), 2U, (unsigned int )tcph->doff | (((unsigned int )((long )tcph) - (unsigned int )((long )skb->data)) << 4)); } else { } } else { wqe_misc = wqe_misc | 1073741824U; } set_wqe_32bit_value((__le32 *)(& nic_sqe->wqe_words), 1U, skb->len); _min1 = 128U; tmp___2 = skb_headlen((struct sk_buff const *)skb); _min2 = tmp___2; memcpy((void *)(& (nesnic->first_frag_vbase + (unsigned long )nesnic->sq_head)->buffer), (void const *)skb->data, (size_t )(_min1 < _min2 ? _min1 : _min2)); _min1___0 = 128U; tmp___3 = skb_headlen((struct sk_buff const *)skb); _min2___0 = tmp___3; *wqe_fragment_length = (unsigned short )(_min1___0 < _min2___0 ? _min1___0 : _min2___0); *(wqe_fragment_length + 1UL) = 0U; tmp___10 = skb_headlen((struct sk_buff const *)skb); if (tmp___10 > 128U) { tmp___6 = skb_end_pointer((struct sk_buff const *)skb); if ((int )((struct skb_shared_info *)tmp___6)->nr_frags + 1 > 4) { if ((nes_debug_level & 256U) != 0U) { tmp___4 = skb_headlen((struct sk_buff const *)skb); tmp___5 = skb_end_pointer((struct sk_buff const *)skb); printk("\viw_nes: %s[%u]: %s: Packet with %u fragments not sent, skb_headlen=%u\n", "nes_nic_send", 413, (char *)(& netdev->name), (int )((struct skb_shared_info *)tmp___5)->nr_frags + 2, tmp___4); } else { } kfree_skb(skb); nesvnic->tx_sw_dropped = nesvnic->tx_sw_dropped + 1ULL; return (32); } else { } set_bit((long )nesnic->sq_head, (unsigned long volatile *)(& nesnic->first_frag_overflow)); tmp___7 = skb_headlen((struct sk_buff const *)skb); bus_address = pci_map_single___0(nesdev->pcidev, (void *)skb->data + 128U, (size_t )(tmp___7 - 128U), 1); tmp___8 = wqe_fragment_index; wqe_fragment_index = (u16 )((int )wqe_fragment_index + 1); tmp___9 = skb_headlen((struct sk_buff const *)skb); *(wqe_fragment_length + (unsigned long )tmp___8) = (unsigned int )((unsigned short )tmp___9) - 128U; *(wqe_fragment_length + (unsigned long )wqe_fragment_index) = 0U; set_wqe_64bit_value((__le32 *)(& nic_sqe->wqe_words), 8U, bus_address); nesnic->tx_skb[(int )nesnic->sq_head] = skb; } else { } tmp___17 = skb_headlen((struct sk_buff const *)skb); if (tmp___17 == skb->len) { tmp___11 = skb_headlen((struct sk_buff const *)skb); if (tmp___11 <= 128U) { nic_sqe->wqe_words[4] = 0U; nesnic->tx_skb[(int )nesnic->sq_head] = skb; } else { } } else { nesnic->tx_skb[(int )nesnic->sq_head] = skb; skb_fragment_index = 0U; goto ldv_61055; ldv_61054: tmp___12 = skb_end_pointer((struct sk_buff const *)skb); frag = (skb_frag_t *)(& ((struct skb_shared_info *)tmp___12)->frags) + (unsigned long )skb_fragment_index; tmp___13 = skb_frag_size((skb_frag_t const *)frag); bus_address = skb_frag_dma_map(& (nesdev->pcidev)->dev, (skb_frag_t const *)frag, 0UL, (size_t )tmp___13, 1); tmp___14 = skb_end_pointer((struct sk_buff const *)skb); tmp___15 = skb_frag_size((skb_frag_t const *)(& ((struct skb_shared_info *)tmp___14)->frags) + (unsigned long )skb_fragment_index); *(wqe_fragment_length + (unsigned long )wqe_fragment_index) = (unsigned short )tmp___15; set_wqe_64bit_value((__le32 *)(& nic_sqe->wqe_words), (u32 )(((int )wqe_fragment_index + 3) * 2), bus_address); wqe_fragment_index = (u16 )((int )wqe_fragment_index + 1); if ((unsigned int )wqe_fragment_index <= 4U) { *(wqe_fragment_length + (unsigned long )wqe_fragment_index) = 0U; } else { } skb_fragment_index = (u16 )((int )skb_fragment_index + 1); ldv_61055: tmp___16 = skb_end_pointer((struct sk_buff const *)skb); if ((int )((unsigned short )((struct skb_shared_info *)tmp___16)->nr_frags) > (int )skb_fragment_index) { goto ldv_61054; } else { } } set_wqe_32bit_value((__le32 *)(& nic_sqe->wqe_words), 0U, wqe_misc); nesnic->sq_head = (u16 )((int )nesnic->sq_head + 1); nesnic->sq_head = (u16 )((int )((short )nesnic->sq_head) & (int )((short )((unsigned int )nesnic->sq_size + 65535U))); return (0); } } static int nes_netdev_start_xmit(struct sk_buff *skb , struct net_device *netdev ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_hw_nic *nesnic ; struct nes_hw_nic_sq_wqe *nic_sqe ; struct tcphdr *tcph ; dma_addr_t tso_bus_address[17U] ; dma_addr_t bus_address ; u32 tso_frag_index ; u32 tso_frag_count ; u32 tso_wqe_length ; u32 curr_tcp_seq ; u32 wqe_count ; u32 send_rc ; struct iphdr *iph ; __le16 *wqe_fragment_length ; u32 nr_frags ; u32 original_first_length ; u16 wqe_fragment_index ; u16 hoffset ; u16 nhoffset ; u16 wqes_needed ; u16 wqes_available ; u32 wqe_misc ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; bool tmp___3 ; int tmp___4 ; unsigned char *tmp___5 ; unsigned int tmp___6 ; bool tmp___7 ; int tmp___8 ; long tmp___9 ; skb_frag_t *frag ; unsigned char *tmp___10 ; unsigned int tmp___11 ; unsigned char *tmp___12 ; struct tcphdr *tmp___13 ; __u32 tmp___14 ; unsigned char *tmp___15 ; unsigned char *tmp___16 ; unsigned char *tmp___17 ; unsigned char *tmp___18 ; bool tmp___19 ; unsigned char *tmp___20 ; unsigned int tmp___21 ; unsigned int _min1 ; u32 _min2 ; __u32 tmp___22 ; unsigned int _min1___0 ; u32 _min2___0 ; unsigned int tmp___23 ; u16 tmp___24 ; unsigned int tmp___25 ; unsigned int tmp___26 ; unsigned int tmp___27 ; unsigned char *tmp___28 ; unsigned int tmp___29 ; unsigned char *tmp___30 ; u32 tmp___31 ; unsigned int tmp___32 ; unsigned char *tmp___33 ; __u16 tmp___34 ; unsigned char *tmp___35 ; unsigned char *tmp___36 ; unsigned char *tmp___37 ; int tmp___38 ; bool tmp___39 ; int tmp___40 ; long tmp___41 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; nesnic = & nesvnic->nic; wqe_count = 1U; wqe_fragment_index = 1U; tmp___0 = netif_carrier_ok((struct net_device const *)netdev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else { } tmp___2 = netif_queue_stopped((struct net_device const *)netdev); if ((int )tmp___2) { return (16); } else { } if (((((int )nesnic->sq_tail + (int )nesnic->sq_size * 2) - (int )nesnic->sq_head) & ((int )nesnic->sq_size + -1)) == 1) { tmp___3 = netif_queue_stopped((struct net_device const *)netdev); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { netif_stop_queue(netdev); __asm__ volatile ("": : : "memory"); if (((((int )nesnic->sq_tail + (int )nesnic->sq_size * 2) - (int )nesnic->sq_head) & ((int )nesnic->sq_size + -1)) != 1) { netif_start_queue(netdev); goto sq_no_longer_full; } else { } } else { } nesvnic->sq_full = nesvnic->sq_full + 1ULL; return (16); } else { } sq_no_longer_full: tmp___5 = skb_end_pointer((struct sk_buff const *)skb); nr_frags = (u32 )((struct skb_shared_info *)tmp___5)->nr_frags; tmp___6 = skb_headlen((struct sk_buff const *)skb); if (tmp___6 > 128U) { nr_frags = nr_frags + 1U; } else { } tmp___41 = ldv__builtin_expect(nr_frags > 4U, 0L); if (tmp___41 != 0L) { tmp___39 = skb_is_gso((struct sk_buff const *)skb); if ((int )tmp___39) { nesvnic->segmented_tso_requests = nesvnic->segmented_tso_requests + 1ULL; nesvnic->tso_requests = nesvnic->tso_requests + 1ULL; wqes_needed = (u16 )(nr_frags >> 2); wqes_needed = ((nr_frags & 3U) != 0U) + (int )wqes_needed; wqes_available = (u16 )((int )((short )((unsigned int )(((int )nesnic->sq_tail + (int )nesnic->sq_size) - (int )nesnic->sq_head) + 65535U)) & (int )((short )((unsigned int )nesnic->sq_size + 65535U))); tmp___9 = ldv__builtin_expect((int )wqes_needed > (int )wqes_available, 0L); if (tmp___9 != 0L) { tmp___7 = netif_queue_stopped((struct net_device const *)netdev); if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { netif_stop_queue(netdev); __asm__ volatile ("": : : "memory"); wqes_available = (u16 )((int )((short )((unsigned int )(((int )nesnic->sq_tail + (int )nesnic->sq_size) - (int )nesnic->sq_head) + 65535U)) & (int )((short )((unsigned int )nesnic->sq_size + 65535U))); if ((int )wqes_needed <= (int )wqes_available) { netif_start_queue(netdev); goto tso_sq_no_longer_full; } else { } } else { } nesvnic->sq_full = nesvnic->sq_full + 1ULL; if ((nes_debug_level & 256U) != 0U) { printk("\viw_nes: %s[%u]: %s: HNIC SQ full- TSO request has too many frags!\n", "nes_netdev_start_xmit", 552, (char *)(& netdev->name)); } else { } return (16); } else { } tso_sq_no_longer_full: tso_frag_count = 0U; goto ldv_61089; ldv_61088: tmp___10 = skb_end_pointer((struct sk_buff const *)skb); frag = (skb_frag_t *)(& ((struct skb_shared_info *)tmp___10)->frags) + (unsigned long )tso_frag_count; tmp___11 = skb_frag_size((skb_frag_t const *)frag); tso_bus_address[tso_frag_count] = skb_frag_dma_map(& (nesdev->pcidev)->dev, (skb_frag_t const *)frag, 0UL, (size_t )tmp___11, 1); tso_frag_count = tso_frag_count + 1U; ldv_61089: tmp___12 = skb_end_pointer((struct sk_buff const *)skb); if ((u32 )((struct skb_shared_info *)tmp___12)->nr_frags > tso_frag_count) { goto ldv_61088; } else { } tso_frag_index = 0U; tmp___13 = tcp_hdr((struct sk_buff const *)skb); tmp___14 = __fswab32(tmp___13->seq); curr_tcp_seq = tmp___14; tmp___15 = skb_transport_header((struct sk_buff const *)skb); hoffset = (int )((u16 )((long )tmp___15)) - (int )((u16 )((long )skb->data)); tmp___16 = skb_network_header((struct sk_buff const *)skb); nhoffset = (int )((u16 )((long )tmp___16)) - (int )((u16 )((long )skb->data)); tmp___17 = skb_transport_header((struct sk_buff const *)skb); original_first_length = (u32 )((int )hoffset + ((int )((struct tcphdr *)tmp___17)->doff << 2)); wqe_count = 0U; goto ldv_61101; ldv_61100: tso_wqe_length = 0U; nic_sqe = nesnic->sq_vbase + (unsigned long )nesnic->sq_head; wqe_fragment_length = (__le16 *)(& nic_sqe->wqe_words) + 3U; if (((int )skb->vlan_tci & 4096) != 0) { if ((nes_debug_level & 256U) != 0U) { printk("\viw_nes: %s[%u]: %s: VLAN packet to send... VLAN = %08X\n", "nes_netdev_start_xmit", 582, (char *)(& netdev->name), (int )skb->vlan_tci & -4097); } else { } wqe_misc = 8388608U; *wqe_fragment_length = (unsigned int )skb->vlan_tci & 61439U; } else { wqe_misc = 0U; } wqe_fragment_length = wqe_fragment_length + 1; if (original_first_length > 128U) { if ((nes_debug_level & 256U) != 0U) { printk("\viw_nes: %s[%u]: OLD_ERROR: SKB header too big, headlen=%u, FIRST_FRAG_SIZE=%u\n", "nes_netdev_start_xmit", 594, original_first_length, 128); } else { } if ((nes_debug_level & 256U) != 0U) { tmp___18 = skb_end_pointer((struct sk_buff const *)skb); tmp___19 = skb_is_gso((struct sk_buff const *)skb); tmp___20 = skb_end_pointer((struct sk_buff const *)skb); tmp___21 = skb_headlen((struct sk_buff const *)skb); printk("\viw_nes: %s[%u]: %s Request to tx NIC packet length %u, headlen %u, (%u frags), is_gso = %u tso_size=%u\n", "nes_netdev_start_xmit", 599, (char *)(& netdev->name), skb->len, tmp___21, (int )((struct skb_shared_info *)tmp___20)->nr_frags, (int )tmp___19, (int )((struct skb_shared_info *)tmp___18)->gso_size); } else { } } else { } _min1 = 128U; _min2 = original_first_length; memcpy((void *)(& (nesnic->first_frag_vbase + (unsigned long )nesnic->sq_head)->buffer), (void const *)skb->data, (size_t )(_min1 < _min2 ? _min1 : _min2)); iph = (struct iphdr *)(& (nesnic->first_frag_vbase + (unsigned long )nesnic->sq_head)->buffer) + (unsigned long )nhoffset; tcph = (struct tcphdr *)(& (nesnic->first_frag_vbase + (unsigned long )nesnic->sq_head)->buffer) + (unsigned long )hoffset; if (wqe_count + 1U != (u32 )wqes_needed) { tcph->fin = 0U; tcph->psh = 0U; tcph->rst = 0U; tcph->urg = 0U; } else { } if (wqe_count != 0U) { tcph->syn = 0U; } else { } tmp___22 = __fswab32(curr_tcp_seq); tcph->seq = tmp___22; _min1___0 = 128U; _min2___0 = original_first_length; *wqe_fragment_length = (unsigned short )(_min1___0 < _min2___0 ? _min1___0 : _min2___0); wqe_fragment_index = 1U; if (wqe_count == 0U) { tmp___27 = skb_headlen((struct sk_buff const *)skb); if (tmp___27 > original_first_length) { set_bit((long )nesnic->sq_head, (unsigned long volatile *)(& nesnic->first_frag_overflow)); tmp___23 = skb_headlen((struct sk_buff const *)skb); bus_address = pci_map_single___0(nesdev->pcidev, (void *)skb->data + (unsigned long )original_first_length, (size_t )(tmp___23 - original_first_length), 1); tmp___24 = wqe_fragment_index; wqe_fragment_index = (u16 )((int )wqe_fragment_index + 1); tmp___25 = skb_headlen((struct sk_buff const *)skb); *(wqe_fragment_length + (unsigned long )tmp___24) = (int )((unsigned short )tmp___25) - (int )((unsigned short )original_first_length); *(wqe_fragment_length + (unsigned long )wqe_fragment_index) = 0U; set_wqe_64bit_value((__le32 *)(& nic_sqe->wqe_words), 8U, bus_address); tmp___26 = skb_headlen((struct sk_buff const *)skb); tso_wqe_length = (tmp___26 - original_first_length) + tso_wqe_length; } else { } } else { } goto ldv_61099; ldv_61098: tmp___28 = skb_end_pointer((struct sk_buff const *)skb); tmp___29 = skb_frag_size((skb_frag_t const *)(& ((struct skb_shared_info *)tmp___28)->frags) + (unsigned long )tso_frag_index); *(wqe_fragment_length + (unsigned long )wqe_fragment_index) = (unsigned short )tmp___29; set_wqe_64bit_value((__le32 *)(& nic_sqe->wqe_words), (u32 )(((int )wqe_fragment_index + 3) * 2), tso_bus_address[tso_frag_index]); wqe_fragment_index = (u16 )((int )wqe_fragment_index + 1); tmp___30 = skb_end_pointer((struct sk_buff const *)skb); tmp___31 = tso_frag_index; tso_frag_index = tso_frag_index + 1U; tmp___32 = skb_frag_size((skb_frag_t const *)(& ((struct skb_shared_info *)tmp___30)->frags) + (unsigned long )tmp___31); tso_wqe_length = tmp___32 + tso_wqe_length; if ((unsigned int )wqe_fragment_index <= 4U) { *(wqe_fragment_length + (unsigned long )wqe_fragment_index) = 0U; } else { } if (tso_frag_index == tso_frag_count) { goto ldv_61097; } else { } ldv_61099: ; if ((unsigned int )wqe_fragment_index <= 4U) { goto ldv_61098; } else { } ldv_61097: ; if (wqe_count + 1U == (u32 )wqes_needed) { nesnic->tx_skb[(int )nesnic->sq_head] = skb; } else { nesnic->tx_skb[(int )nesnic->sq_head] = (struct sk_buff *)0; } tmp___33 = skb_end_pointer((struct sk_buff const *)skb); wqe_misc = ((u32 )((struct skb_shared_info *)tmp___33)->gso_size | wqe_misc) | 2147483648U; tmp___35 = skb_end_pointer((struct sk_buff const *)skb); if (tso_wqe_length + original_first_length > (u32 )((struct skb_shared_info *)tmp___35)->gso_size) { wqe_misc = wqe_misc | 4194304U; } else { tmp___34 = __fswab16(((int )((__u16 )tso_wqe_length) + (int )((__u16 )original_first_length)) - (int )nhoffset); iph->tot_len = tmp___34; } set_wqe_32bit_value((__le32 *)(& nic_sqe->wqe_words), 0U, wqe_misc); set_wqe_32bit_value((__le32 *)(& nic_sqe->wqe_words), 2U, (unsigned int )tcph->doff | ((unsigned int )hoffset << 4)); set_wqe_32bit_value((__le32 *)(& nic_sqe->wqe_words), 1U, tso_wqe_length + original_first_length); curr_tcp_seq = curr_tcp_seq + tso_wqe_length; nesnic->sq_head = (u16 )((int )nesnic->sq_head + 1); nesnic->sq_head = (u16 )((int )((short )nesnic->sq_head) & (int )((short )((unsigned int )nesnic->sq_size + 65535U))); wqe_count = wqe_count + 1U; ldv_61101: ; if ((u32 )wqes_needed > wqe_count) { goto ldv_61100; } else { } } else { nesvnic->linearized_skbs = nesvnic->linearized_skbs + 1ULL; tmp___36 = skb_transport_header((struct sk_buff const *)skb); hoffset = (int )((u16 )((long )tmp___36)) - (int )((u16 )((long )skb->data)); tmp___37 = skb_network_header((struct sk_buff const *)skb); nhoffset = (int )((u16 )((long )tmp___37)) - (int )((u16 )((long )skb->data)); skb_linearize(skb); skb_set_transport_header(skb, (int const )hoffset); skb_set_network_header(skb, (int const )nhoffset); tmp___38 = nes_nic_send(skb, netdev); send_rc = (u32 )tmp___38; if (send_rc != 0U) { return (0); } else { } } } else { tmp___40 = nes_nic_send(skb, netdev); send_rc = (u32 )tmp___40; if (send_rc != 0U) { return (0); } else { } } __asm__ volatile ("": : : "memory"); if (wqe_count != 0U) { nes_write32(nesdev->regs + 64UL, ((wqe_count << 24) | (u32 )nesvnic->nic.qp_id) | 8388608U); } else { } netdev->trans_start = jiffies; return (0); } } static struct net_device_stats *nes_netdev_get_stats(struct net_device *netdev ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; u64 u64temp ; u32 u32temp ; u32 tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; u32 tmp___3 ; u32 tmp___4 ; u32 tmp___5 ; u32 tmp___6 ; u32 tmp___7 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; u32temp = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->nic_index * 512 + 12416)); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; nesvnic->endnode_nstat_rx_discard = nesvnic->endnode_nstat_rx_discard + (u64 )u32temp; tmp___0 = nes_read_indexed___1(nesdev, (u32 )(((int )nesvnic->nic_index + 24) * 512)); u64temp = (unsigned long long )tmp___0; tmp___1 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->nic_index * 512 + 12292)); u64temp = ((unsigned long long )tmp___1 << 32) + u64temp; nesvnic->endnode_nstat_rx_octets = nesvnic->endnode_nstat_rx_octets + u64temp; nesvnic->netstats.rx_bytes = (unsigned long )((unsigned long long )nesvnic->netstats.rx_bytes + u64temp); tmp___2 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->nic_index * 512 + 12296)); u64temp = (unsigned long long )tmp___2; tmp___3 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->nic_index * 512 + 12300)); u64temp = ((unsigned long long )tmp___3 << 32) + u64temp; nesvnic->endnode_nstat_rx_frames = nesvnic->endnode_nstat_rx_frames + u64temp; nesvnic->netstats.rx_packets = (unsigned long )((unsigned long long )nesvnic->netstats.rx_packets + u64temp); tmp___4 = nes_read_indexed___1(nesdev, (u32 )(((int )nesvnic->nic_index + 56) * 512)); u64temp = (unsigned long long )tmp___4; tmp___5 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->nic_index * 512 + 28676)); u64temp = ((unsigned long long )tmp___5 << 32) + u64temp; nesvnic->endnode_nstat_tx_octets = nesvnic->endnode_nstat_tx_octets + u64temp; nesvnic->netstats.tx_bytes = (unsigned long )((unsigned long long )nesvnic->netstats.tx_bytes + u64temp); tmp___6 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->nic_index * 512 + 28680)); u64temp = (unsigned long long )tmp___6; tmp___7 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->nic_index * 512 + 28684)); u64temp = ((unsigned long long )tmp___7 << 32) + u64temp; nesvnic->endnode_nstat_tx_frames = nesvnic->endnode_nstat_tx_frames + u64temp; nesvnic->netstats.tx_packets = (unsigned long )((unsigned long long )nesvnic->netstats.tx_packets + u64temp); u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8564U); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_short_frames = (nesvnic->nesdev)->mac_rx_short_frames + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8568U); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_oversized_frames = (nesvnic->nesdev)->mac_rx_oversized_frames + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8572U); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_jabber_frames = (nesvnic->nesdev)->mac_rx_jabber_frames + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8584U); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_symbol_err_frames = (nesvnic->nesdev)->mac_rx_symbol_err_frames + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8580U); nesvnic->netstats.rx_length_errors = nesvnic->netstats.rx_length_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8576U); (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_crc_errors = (nesvnic->nesdev)->mac_rx_crc_errors + (unsigned long )u32temp; nesvnic->netstats.rx_crc_errors = nesvnic->netstats.rx_crc_errors + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8504U); (nesvnic->nesdev)->mac_tx_errors = (nesvnic->nesdev)->mac_tx_errors + (unsigned long )u32temp; nesvnic->netstats.tx_errors = nesvnic->netstats.tx_errors + (unsigned long )u32temp; return (& nesvnic->netstats); } } static void nes_netdev_tx_timeout(struct net_device *netdev ) { struct nes_vnic *nesvnic ; void *tmp ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; if ((nesvnic->msg_enable & 8U) != 0U) { if ((nes_debug_level & 256U) != 0U) { printk("\viw_nes: %s[%u]: %s: tx timeout\n", "nes_netdev_tx_timeout", 797, (char *)(& netdev->name)); } else { } } else { } return; } } static int nes_netdev_set_mac_address(struct net_device *netdev , void *p ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct sockaddr *mac_addr ; int i ; u32 macaddr_low ; u16 macaddr_high ; bool tmp___0 ; int tmp___1 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; mac_addr = (struct sockaddr *)p; tmp___0 = is_valid_ether_addr((u8 const *)(& mac_addr->sa_data)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (-99); } else { } memcpy((void *)netdev->dev_addr, (void const *)(& mac_addr->sa_data), (size_t )netdev->addr_len); printk("iw_nes: %s: Address length = %d, Address = %pM\n", "nes_netdev_set_mac_address", (int )netdev->addr_len, (char *)(& mac_addr->sa_data)); macaddr_high = (int )((u16 )*(netdev->dev_addr)) << 8U; macaddr_high = (int )((u16 )*(netdev->dev_addr + 1UL)) + (int )macaddr_high; macaddr_low = (unsigned int )*(netdev->dev_addr + 2UL) << 24; macaddr_low = ((unsigned int )*(netdev->dev_addr + 3UL) << 16) + macaddr_low; macaddr_low = ((unsigned int )*(netdev->dev_addr + 4UL) << 8) + macaddr_low; macaddr_low = (u32 )*(netdev->dev_addr + 5UL) + macaddr_low; i = 0; goto ldv_61128; ldv_61127: ; if ((unsigned int )nesvnic->qp_nic_index[i] == 15U) { goto ldv_61126; } else { } nes_write_indexed___1(nesdev, (u32 )(((int )nesvnic->qp_nic_index[i] + 3136) * 8), macaddr_low); nes_write_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[i] * 8 + 25092), ((unsigned int )macaddr_high | ((unsigned int )nesvnic->nic_index << 16)) | 1048576U); i = i + 1; ldv_61128: ; if (i <= 3) { goto ldv_61127; } else { } ldv_61126: ; return (0); } } static void set_allmulti(struct nes_device *nesdev , u32 nic_active_bit ) { u32 nic_active ; { nic_active = nes_read_indexed___1(nesdev, 24608U); nic_active = nic_active | nic_active_bit; nes_write_indexed___1(nesdev, 24608U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24600U); nic_active = ~ nic_active_bit & nic_active; nes_write_indexed___1(nesdev, 24600U, nic_active); return; } } static void nes_netdev_set_multicast_list(struct net_device *netdev ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; u32 nic_active_bit ; u32 nic_active ; u32 perfect_filter_register_address ; u32 macaddr_low ; u16 macaddr_high ; u8 mc_all_on ; u8 mc_index ; int mc_nic_index ; u8 pft_entries_preallocated ; int _max1 ; int _max2 ; u8 max_pft_entries_avaiable ; unsigned long flags ; int mc_count ; char *addrs ; int i ; struct netdev_hw_addr *ha ; void *tmp___0 ; struct list_head const *__mptr ; int tmp___1 ; struct list_head const *__mptr___0 ; int tmp___2 ; char *addr ; int tmp___3 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; nesadapter = (nesvnic->nesdev)->nesadapter; mc_all_on = 0U; mc_nic_index = -1; _max1 = (int )nesadapter->adapter_fcn_count * nics_per_function; _max2 = 4; pft_entries_preallocated = (u8 )(_max1 > _max2 ? _max1 : _max2); max_pft_entries_avaiable = 48U - (unsigned int )pft_entries_preallocated; mc_count = netdev->mc.count; ldv_spin_lock(); nic_active_bit = (u32 )(1 << (int )nesvnic->nic_index); if ((netdev->flags & 256U) != 0U) { nic_active = nes_read_indexed___1(nesdev, 24608U); nic_active = nic_active | nic_active_bit; nes_write_indexed___1(nesdev, 24608U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24600U); nic_active = nic_active | nic_active_bit; nes_write_indexed___1(nesdev, 24600U, nic_active); mc_all_on = 1U; } else if ((netdev->flags & 512U) != 0U || (unsigned int )nesvnic->nic_index > 3U) { set_allmulti(nesdev, nic_active_bit); mc_all_on = 1U; } else { nic_active = nes_read_indexed___1(nesdev, 24608U); nic_active = ~ nic_active_bit & nic_active; nes_write_indexed___1(nesdev, 24608U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24600U); nic_active = ~ nic_active_bit & nic_active; nes_write_indexed___1(nesdev, 24600U, nic_active); } if ((nes_debug_level & 128U) != 0U) { printk("\viw_nes: %s[%u]: Number of MC entries = %d, Promiscuous = %d, All Multicast = %d.\n", "nes_netdev_set_multicast_list", 904, mc_count, (netdev->flags & 256U) != 0U, (netdev->flags & 512U) != 0U); } else { } if ((unsigned int )mc_all_on == 0U) { tmp___0 = kzalloc((size_t )(mc_count * 6), 32U); addrs = (char *)tmp___0; if ((unsigned long )addrs == (unsigned long )((char *)0)) { set_allmulti(nesdev, nic_active_bit); goto unlock; } else { } i = 0; __mptr = (struct list_head const *)netdev->mc.list.next; ha = (struct netdev_hw_addr *)__mptr; goto ldv_61165; ldv_61164: tmp___1 = i; i = i + 1; memcpy((void *)addrs + (unsigned long )(tmp___1 * 6), (void const *)(& ha->addr), 6UL); __mptr___0 = (struct list_head const *)ha->list.next; ha = (struct netdev_hw_addr *)__mptr___0; ldv_61165: ; if ((unsigned long )(& ha->list) != (unsigned long )(& netdev->mc.list)) { goto ldv_61164; } else { } perfect_filter_register_address = (u32 )(((int )pft_entries_preallocated + 3136) * 8); i = 0; mc_index = 0U; goto ldv_61176; ldv_61175: ; goto ldv_61168; ldv_61167: ; ldv_61168: ; if (i < mc_count && (unsigned long )nesvnic->mcrq_mcast_filter != (unsigned long )((int (*)(struct nes_vnic * , __u8 * ))0)) { tmp___2 = i; i = i + 1; mc_nic_index = (*(nesvnic->mcrq_mcast_filter))(nesvnic, (__u8 *)addrs + (unsigned long )(tmp___2 * 6)); if (mc_nic_index == 0) { goto ldv_61167; } else { goto ldv_61169; } } else { } ldv_61169: ; if (mc_nic_index < 0) { mc_nic_index = (int )nesvnic->nic_index; } else { } goto ldv_61171; ldv_61170: ; if ((nes_debug_level & 128U) != 0U) { printk("\viw_nes: %s[%u]: mc_index=%d skipping nic_index=%d, used for=%d \n", "nes_netdev_set_multicast_list", 936, (int )mc_index, (int )nesvnic->nic_index, (int )nesadapter->pft_mcast_map[(int )mc_index]); } else { } mc_index = (u8 )((int )mc_index + 1); ldv_61171: ; if (((unsigned int )nesadapter->pft_mcast_map[(int )mc_index] <= 15U && (int )nesadapter->pft_mcast_map[(int )mc_index] != (int )nesvnic->nic_index) && (int )mc_index < (int )max_pft_entries_avaiable) { goto ldv_61170; } else { } if ((int )mc_index >= (int )max_pft_entries_avaiable) { goto ldv_61173; } else { } if (i < mc_count) { tmp___3 = i; i = i + 1; addr = addrs + (unsigned long )(tmp___3 * 6); if ((nes_debug_level & 128U) != 0U) { printk("\viw_nes: %s[%u]: Assigning MC Address %pM to register 0x%04X nic_idx=%d\n", "nes_netdev_set_multicast_list", 947, addr, (u32 )((int )mc_index * 8) + perfect_filter_register_address, mc_nic_index); } else { } macaddr_high = (int )((u16 )((unsigned char )*addr)) << 8U; macaddr_high = (int )((u16 )((unsigned char )*(addr + 1UL))) + (int )macaddr_high; macaddr_low = (u32 )((int )((unsigned char )*(addr + 2UL)) << 24); macaddr_low = (u32 )((int )((unsigned char )*(addr + 3UL)) << 16) + macaddr_low; macaddr_low = (u32 )((int )((unsigned char )*(addr + 4UL)) << 8) + macaddr_low; macaddr_low = (u32 )((unsigned char )*(addr + 5UL)) + macaddr_low; nes_write_indexed___1(nesdev, (u32 )((int )mc_index * 8) + perfect_filter_register_address, macaddr_low); nes_write_indexed___1(nesdev, ((u32 )((int )mc_index * 8) + perfect_filter_register_address) + 4U, ((unsigned int )macaddr_high | ((unsigned int )(1 << mc_nic_index) << 16)) | 1048576U); nesadapter->pft_mcast_map[(int )mc_index] = nesvnic->nic_index; } else { if ((nes_debug_level & 128U) != 0U) { printk("\viw_nes: %s[%u]: Clearing MC Address at register 0x%04X\n", "nes_netdev_set_multicast_list", 966, (u32 )((int )mc_index * 8) + perfect_filter_register_address); } else { } nes_write_indexed___1(nesdev, ((u32 )((int )mc_index * 8) + perfect_filter_register_address) + 4U, 0U); nesadapter->pft_mcast_map[(int )mc_index] = 255U; } mc_index = (u8 )((int )mc_index + 1); ldv_61176: ; if ((int )mc_index < (int )max_pft_entries_avaiable) { goto ldv_61175; } else { } ldv_61173: kfree((void const *)addrs); if (i < mc_count) { set_allmulti(nesdev, nic_active_bit); } else { } } else { } unlock: spin_unlock_irqrestore(& nesadapter->resource_lock, flags); return; } } static int nes_netdev_change_mtu(struct net_device *netdev , int new_mtu ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; int ret ; u8 jumbomode ; u32 nic_active ; u32 nic_active_bit ; u32 uc_all_active ; u32 mc_all_active ; u32 tmp___0 ; u32 tmp___1 ; bool tmp___2 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; ret = 0; jumbomode = 0U; if (new_mtu <= 59 || new_mtu > max_mtu) { return (-22); } else { } netdev->mtu = (unsigned int )new_mtu; nesvnic->max_frame_size = (unsigned int )((u16 )new_mtu) + 18U; if (netdev->mtu > 1500U) { jumbomode = 1U; } else { } nes_nic_init_timer_defaults(nesdev, (int )jumbomode); tmp___2 = netif_running((struct net_device const *)netdev); if ((int )tmp___2) { nic_active_bit = (u32 )(1 << (int )nesvnic->nic_index); tmp___0 = nes_read_indexed___1(nesdev, 24608U); mc_all_active = tmp___0 & nic_active_bit; tmp___1 = nes_read_indexed___1(nesdev, 24600U); uc_all_active = tmp___1 & nic_active_bit; nes_netdev_stop(netdev); nes_netdev_open(netdev); nic_active = nes_read_indexed___1(nesdev, 24608U); nic_active = nic_active | mc_all_active; nes_write_indexed___1(nesdev, 24608U, nic_active); nic_active = nes_read_indexed___1(nesdev, 24600U); nic_active = nic_active | uc_all_active; nes_write_indexed___1(nesdev, 24600U, nic_active); } else { } return (ret); } } static char const nes_ethtool_stringset[58U][32U] = { { 'L', 'i', 'n', 'k', ' ', 'C', 'h', 'a', 'n', 'g', 'e', ' ', 'I', 'n', 't', 'e', 'r', 'r', 'u', 'p', 't', 's', '\000'}, { 'L', 'i', 'n', 'e', 'a', 'r', 'i', 'z', 'e', 'd', ' ', 'S', 'K', 'B', 's', '\000'}, { 'T', '/', 'G', 'S', 'O', ' ', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\000'}, { 'P', 'a', 'u', 's', 'e', ' ', 'F', 'r', 'a', 'm', 'e', 's', ' ', 'S', 'e', 'n', 't', '\000'}, { 'P', 'a', 'u', 's', 'e', ' ', 'F', 'r', 'a', 'm', 'e', 's', ' ', 'R', 'e', 'c', 'e', 'i', 'v', 'e', 'd', '\000'}, { 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', ' ', 'R', 'o', 'u', 't', 'i', 'n', 'g', ' ', 'E', 'r', 'r', 'o', 'r', 's', '\000'}, { 'S', 'Q', ' ', 'S', 'W', ' ', 'D', 'r', 'o', 'p', 'p', 'e', 'd', ' ', 'S', 'K', 'B', 's', '\000'}, { 'S', 'Q', ' ', 'F', 'u', 'l', 'l', '\000'}, { 'S', 'e', 'g', 'm', 'e', 'n', 't', 'e', 'd', ' ', 'T', 'S', 'O', ' ', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\000'}, { 'R', 'x', ' ', 'S', 'y', 'm', 'b', 'o', 'l', ' ', 'E', 'r', 'r', 'o', 'r', 's', '\000'}, { 'R', 'x', ' ', 'J', 'a', 'b', 'b', 'e', 'r', ' ', 'E', 'r', 'r', 'o', 'r', 's', '\000'}, { 'R', 'x', ' ', 'O', 'v', 'e', 'r', 's', 'i', 'z', 'e', 'd', ' ', 'F', 'r', 'a', 'm', 'e', 's', '\000'}, { 'R', 'x', ' ', 'S', 'h', 'o', 'r', 't', ' ', 'F', 'r', 'a', 'm', 'e', 's', '\000'}, { 'R', 'x', ' ', 'L', 'e', 'n', 'g', 't', 'h', ' ', 'E', 'r', 'r', 'o', 'r', 's', '\000'}, { 'R', 'x', ' ', 'C', 'R', 'C', ' ', 'E', 'r', 'r', 'o', 'r', 's', '\000'}, { 'R', 'x', ' ', 'P', 'o', 'r', 't', ' ', 'D', 'i', 's', 'c', 'a', 'r', 'd', '\000'}, { 'E', 'n', 'd', 'n', 'o', 'd', 'e', ' ', 'R', 'x', ' ', 'D', 'i', 's', 'c', 'a', 'r', 'd', 's', '\000'}, { 'E', 'n', 'd', 'n', 'o', 'd', 'e', ' ', 'R', 'x', ' ', 'O', 'c', 't', 'e', 't', 's', '\000'}, { 'E', 'n', 'd', 'n', 'o', 'd', 'e', ' ', 'R', 'x', ' ', 'F', 'r', 'a', 'm', 'e', 's', '\000'}, { 'E', 'n', 'd', 'n', 'o', 'd', 'e', ' ', 'T', 'x', ' ', 'O', 'c', 't', 'e', 't', 's', '\000'}, { 'E', 'n', 'd', 'n', 'o', 'd', 'e', ' ', 'T', 'x', ' ', 'F', 'r', 'a', 'm', 'e', 's', '\000'}, { 'T', 'x', ' ', 'E', 'r', 'r', 'o', 'r', 's', '\000'}, { 'm', 'h', ' ', 'd', 'e', 't', 'e', 'c', 't', 'e', 'd', '\000'}, { 'm', 'h', ' ', 'p', 'a', 'u', 's', 'e', 's', '\000'}, { 'R', 'e', 't', 'r', 'a', 'n', 's', 'm', 'i', 's', 's', 'i', 'o', 'n', ' ', 'C', 'o', 'u', 'n', 't', '\000'}, { 'C', 'M', ' ', 'C', 'o', 'n', 'n', 'e', 'c', 't', 's', '\000'}, { 'C', 'M', ' ', 'A', 'c', 'c', 'e', 'p', 't', 's', '\000'}, { 'D', 'i', 's', 'c', 'o', 'n', 'n', 'e', 'c', 't', 's', '\000'}, { 'C', 'o', 'n', 'n', 'e', 'c', 't', 'e', 'd', ' ', 'E', 'v', 'e', 'n', 't', 's', '\000'}, { 'C', 'o', 'n', 'n', 'e', 'c', 't', ' ', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\000'}, { 'C', 'M', ' ', 'R', 'e', 'j', 'e', 'c', 't', 's', '\000'}, { 'M', 'o', 'd', 'i', 'f', 'y', 'Q', 'P', ' ', 'T', 'i', 'm', 'e', 'o', 'u', 't', 's', '\000'}, { 'C', 'r', 'e', 'a', 't', 'e', 'Q', 'P', 's', '\000'}, { 'S', 'W', ' ', 'D', 'e', 's', 't', 'r', 'o', 'y', 'Q', 'P', 's', '\000'}, { 'D', 'e', 's', 't', 'r', 'o', 'y', 'Q', 'P', 's', '\000'}, { 'C', 'M', ' ', 'C', 'l', 'o', 's', 'e', 's', '\000'}, { 'C', 'M', ' ', 'P', 'a', 'c', 'k', 'e', 't', 's', ' ', 'S', 'e', 'n', 't', '\000'}, { 'C', 'M', ' ', 'P', 'a', 'c', 'k', 'e', 't', 's', ' ', 'B', 'o', 'u', 'n', 'c', 'e', 'd', '\000'}, { 'C', 'M', ' ', 'P', 'a', 'c', 'k', 'e', 't', 's', ' ', 'C', 'r', 'e', 'a', 't', 'e', 'd', '\000'}, { 'C', 'M', ' ', 'P', 'a', 'c', 'k', 'e', 't', 's', ' ', 'R', 'c', 'v', 'd', '\000'}, { 'C', 'M', ' ', 'P', 'a', 'c', 'k', 'e', 't', 's', ' ', 'D', 'r', 'o', 'p', 'p', 'e', 'd', '\000'}, { 'C', 'M', ' ', 'P', 'a', 'c', 'k', 'e', 't', 's', ' ', 'R', 'e', 't', 'r', 'a', 'n', 's', '\000'}, { 'C', 'M', ' ', 'L', 'i', 's', 't', 'e', 'n', 's', ' ', 'C', 'r', 'e', 'a', 't', 'e', 'd', '\000'}, { 'C', 'M', ' ', 'L', 'i', 's', 't', 'e', 'n', 's', ' ', 'D', 'e', 's', 't', 'r', 'o', 'y', 'e', 'd', '\000'}, { 'C', 'M', ' ', 'B', 'a', 'c', 'k', 'l', 'o', 'g', ' ', 'D', 'r', 'o', 'p', 's', '\000'}, { 'C', 'M', ' ', 'L', 'o', 'o', 'p', 'b', 'a', 'c', 'k', 's', '\000'}, { 'C', 'M', ' ', 'N', 'o', 'd', 'e', 's', ' ', 'C', 'r', 'e', 'a', 't', 'e', 'd', '\000'}, { 'C', 'M', ' ', 'N', 'o', 'd', 'e', 's', ' ', 'D', 'e', 's', 't', 'r', 'o', 'y', 'e', 'd', '\000'}, { 'C', 'M', ' ', 'A', 'c', 'c', 'e', 'l', ' ', 'D', 'r', 'o', 'p', 's', '\000'}, { 'C', 'M', ' ', 'R', 'e', 's', 'e', 't', 's', ' ', 'R', 'e', 'c', 'e', 'i', 'v', 'e', 'd', '\000'}, { 'F', 'r', 'e', 'e', ' ', '4', 'K', 'p', 'b', 'l', 's', '\000'}, { 'F', 'r', 'e', 'e', ' ', '2', '5', '6', 'p', 'b', 'l', 's', '\000'}, { 'T', 'i', 'm', 'e', 'r', ' ', 'I', 'n', 'i', 't', 's', '\000'}, { 'L', 'R', 'O', ' ', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd', '\000'}, { 'L', 'R', 'O', ' ', 'f', 'l', 'u', 's', 'h', 'e', 'd', '\000'}, { 'L', 'R', 'O', ' ', 'n', 'o', '_', 'd', 'e', 's', 'c', '\000'}, { 'P', 'A', 'U', ' ', 'C', 'r', 'e', 'a', 't', 'e', 'Q', 'P', 's', '\000'}, { 'P', 'A', 'U', ' ', 'D', 'e', 's', 't', 'r', 'o', 'y', 'Q', 'P', 's', '\000'}}; static int nes_netdev_get_sset_count(struct net_device *netdev , int stringset ) { { if (stringset == 1) { return (58); } else { return (-22); } } } static void nes_netdev_get_strings(struct net_device *netdev , u32 stringset , u8 *ethtool_strings ) { { if (stringset == 1U) { memcpy((void *)ethtool_strings, (void const *)(& nes_ethtool_stringset), 1856UL); } else { } return; } } static void nes_netdev_get_ethtool_stats(struct net_device *netdev , struct ethtool_stats *target_ethtool_stats , u64 *target_stat_values ) { u64 u64temp ; struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; u32 nic_count ; u32 u32temp ; u32 index ; u32 tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; u32 tmp___3 ; u32 tmp___4 ; u32 tmp___5 ; u32 tmp___6 ; u32 tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; int tmp___23 ; int tmp___24 ; int tmp___25 ; int tmp___26 ; int tmp___27 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; index = 0U; target_ethtool_stats->n_stats = 58U; *(target_stat_values + (unsigned long )index) = (nesvnic->nesdev)->link_status_interrupts; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->linearized_skbs; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->tso_requests; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8472U); (nesvnic->nesdev)->mac_pause_frames_sent = (nesvnic->nesdev)->mac_pause_frames_sent + (unsigned long )u32temp; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->mac_pause_frames_sent; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8532U); (nesvnic->nesdev)->mac_pause_frames_received = (nesvnic->nesdev)->mac_pause_frames_received + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 64U + 2608U); (nesvnic->nesdev)->port_rx_discards = (nesvnic->nesdev)->port_rx_discards + (unsigned long )u32temp; nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 64U + 2612U); (nesvnic->nesdev)->port_tx_discards = (nesvnic->nesdev)->port_tx_discards + (unsigned long )u32temp; nesvnic->netstats.tx_dropped = nesvnic->netstats.tx_dropped + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8564U); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_short_frames = (nesvnic->nesdev)->mac_rx_short_frames + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8568U); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_oversized_frames = (nesvnic->nesdev)->mac_rx_oversized_frames + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8572U); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_jabber_frames = (nesvnic->nesdev)->mac_rx_jabber_frames + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8584U); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_symbol_err_frames = (nesvnic->nesdev)->mac_rx_symbol_err_frames + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8580U); nesvnic->netstats.rx_length_errors = nesvnic->netstats.rx_length_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8576U); (nesvnic->nesdev)->mac_rx_errors = (nesvnic->nesdev)->mac_rx_errors + (unsigned long )u32temp; (nesvnic->nesdev)->mac_rx_crc_errors = (nesvnic->nesdev)->mac_rx_crc_errors + (unsigned long )u32temp; nesvnic->netstats.rx_crc_errors = nesvnic->netstats.rx_crc_errors + (unsigned long )u32temp; u32temp = nes_read_indexed___1(nesdev, (nesvnic->nesdev)->mac_index * 512U + 8504U); (nesvnic->nesdev)->mac_tx_errors = (nesvnic->nesdev)->mac_tx_errors + (unsigned long )u32temp; nesvnic->netstats.tx_errors = nesvnic->netstats.tx_errors + (unsigned long )u32temp; nic_count = 0U; goto ldv_61217; ldv_61216: ; if ((unsigned int )nesvnic->qp_nic_index[nic_count] == 15U) { goto ldv_61215; } else { } u32temp = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[nic_count] * 512 + 12416)); nesvnic->netstats.rx_dropped = nesvnic->netstats.rx_dropped + (unsigned long )u32temp; nesvnic->endnode_nstat_rx_discard = nesvnic->endnode_nstat_rx_discard + (u64 )u32temp; tmp___0 = nes_read_indexed___1(nesdev, (u32 )(((int )nesvnic->qp_nic_index[nic_count] + 24) * 512)); u64temp = (unsigned long long )tmp___0; tmp___1 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[nic_count] * 512 + 12292)); u64temp = ((unsigned long long )tmp___1 << 32) + u64temp; nesvnic->endnode_nstat_rx_octets = nesvnic->endnode_nstat_rx_octets + u64temp; nesvnic->netstats.rx_bytes = (unsigned long )((unsigned long long )nesvnic->netstats.rx_bytes + u64temp); tmp___2 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[nic_count] * 512 + 12296)); u64temp = (unsigned long long )tmp___2; tmp___3 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[nic_count] * 512 + 12300)); u64temp = ((unsigned long long )tmp___3 << 32) + u64temp; nesvnic->endnode_nstat_rx_frames = nesvnic->endnode_nstat_rx_frames + u64temp; nesvnic->netstats.rx_packets = (unsigned long )((unsigned long long )nesvnic->netstats.rx_packets + u64temp); tmp___4 = nes_read_indexed___1(nesdev, (u32 )(((int )nesvnic->qp_nic_index[nic_count] + 56) * 512)); u64temp = (unsigned long long )tmp___4; tmp___5 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[nic_count] * 512 + 28676)); u64temp = ((unsigned long long )tmp___5 << 32) + u64temp; nesvnic->endnode_nstat_tx_octets = nesvnic->endnode_nstat_tx_octets + u64temp; nesvnic->netstats.tx_bytes = (unsigned long )((unsigned long long )nesvnic->netstats.tx_bytes + u64temp); tmp___6 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[nic_count] * 512 + 28680)); u64temp = (unsigned long long )tmp___6; tmp___7 = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[nic_count] * 512 + 28684)); u64temp = ((unsigned long long )tmp___7 << 32) + u64temp; nesvnic->endnode_nstat_tx_frames = nesvnic->endnode_nstat_tx_frames + u64temp; nesvnic->netstats.tx_packets = (unsigned long )((unsigned long long )nesvnic->netstats.tx_packets + u64temp); u32temp = nes_read_indexed___1(nesdev, (u32 )((int )nesvnic->qp_nic_index[nic_count] * 512 + 28800)); nesvnic->endnode_ipv4_tcp_retransmits = nesvnic->endnode_ipv4_tcp_retransmits + (u64 )u32temp; nic_count = nic_count + 1U; ldv_61217: ; if (nic_count <= 3U) { goto ldv_61216; } else { } ldv_61215: index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->mac_pause_frames_received; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesdev->nesadapter)->nic_rx_eth_route_err; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->tx_sw_dropped; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->sq_full; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->segmented_tso_requests; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->mac_rx_symbol_err_frames; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->mac_rx_jabber_frames; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->mac_rx_oversized_frames; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->mac_rx_short_frames; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )nesvnic->netstats.rx_length_errors; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->mac_rx_crc_errors; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->port_rx_discards; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->endnode_nstat_rx_discard; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->endnode_nstat_rx_octets; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->endnode_nstat_rx_frames; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->endnode_nstat_tx_octets; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->endnode_nstat_tx_frames; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )(nesvnic->nesdev)->mac_tx_errors; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )mh_detected; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )mh_pauses_sent; index = index + 1U; *(target_stat_values + (unsigned long )index) = nesvnic->endnode_ipv4_tcp_retransmits; index = index + 1U; tmp___8 = atomic_read((atomic_t const *)(& cm_connects)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___8; index = index + 1U; tmp___9 = atomic_read((atomic_t const *)(& cm_accepts)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___9; index = index + 1U; tmp___10 = atomic_read((atomic_t const *)(& cm_disconnects)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___10; index = index + 1U; tmp___11 = atomic_read((atomic_t const *)(& cm_connecteds)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___11; index = index + 1U; tmp___12 = atomic_read((atomic_t const *)(& cm_connect_reqs)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___12; index = index + 1U; tmp___13 = atomic_read((atomic_t const *)(& cm_rejects)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___13; index = index + 1U; tmp___14 = atomic_read((atomic_t const *)(& mod_qp_timouts)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___14; index = index + 1U; tmp___15 = atomic_read((atomic_t const *)(& qps_created)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___15; index = index + 1U; tmp___16 = atomic_read((atomic_t const *)(& sw_qps_destroyed)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___16; index = index + 1U; tmp___17 = atomic_read((atomic_t const *)(& qps_destroyed)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___17; index = index + 1U; tmp___18 = atomic_read((atomic_t const *)(& cm_closes)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___18; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )cm_packets_sent; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )cm_packets_bounced; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )cm_packets_created; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )cm_packets_received; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )cm_packets_dropped; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )cm_packets_retrans; index = index + 1U; tmp___19 = atomic_read((atomic_t const *)(& cm_listens_created)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___19; index = index + 1U; tmp___20 = atomic_read((atomic_t const *)(& cm_listens_destroyed)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___20; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )cm_backlog_drops; index = index + 1U; tmp___21 = atomic_read((atomic_t const *)(& cm_loopbacks)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___21; index = index + 1U; tmp___22 = atomic_read((atomic_t const *)(& cm_nodes_created)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___22; index = index + 1U; tmp___23 = atomic_read((atomic_t const *)(& cm_nodes_destroyed)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___23; index = index + 1U; tmp___24 = atomic_read((atomic_t const *)(& cm_accel_dropped_pkts)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___24; index = index + 1U; tmp___25 = atomic_read((atomic_t const *)(& cm_resets_recvd)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___25; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )nesadapter->free_4kpbl; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )nesadapter->free_256pbl; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )int_mod_timer_init; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )nesvnic->lro_mgr.stats.aggregated; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )nesvnic->lro_mgr.stats.flushed; index = index + 1U; *(target_stat_values + (unsigned long )index) = (u64 )nesvnic->lro_mgr.stats.no_desc; index = index + 1U; tmp___26 = atomic_read((atomic_t const *)(& pau_qps_created)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___26; index = index + 1U; tmp___27 = atomic_read((atomic_t const *)(& pau_qps_destroyed)); *(target_stat_values + (unsigned long )index) = (u64 )tmp___27; return; } } static void nes_netdev_get_drvinfo(struct net_device *netdev , struct ethtool_drvinfo *drvinfo ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_adapter *nesadapter ; char const *tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesadapter = (nesvnic->nesdev)->nesadapter; strlcpy((char *)(& drvinfo->driver), "iw_nes", 32UL); tmp___0 = pci_name((struct pci_dev const *)(nesvnic->nesdev)->pcidev); strlcpy((char *)(& drvinfo->bus_info), tmp___0, 32UL); snprintf((char *)(& drvinfo->fw_version), 32UL, "%u.%u", nesadapter->firmware_version >> 16, nesadapter->firmware_version & 255U); strlcpy((char *)(& drvinfo->version), "1.5.0.1", 32UL); drvinfo->testinfo_len = 0U; drvinfo->eedump_len = 0U; drvinfo->regdump_len = 0U; return; } } static int nes_netdev_set_coalesce(struct net_device *netdev , struct ethtool_coalesce *et_coalesce ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_hw_tune_timer *shared_timer ; unsigned long flags ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; shared_timer = & nesadapter->tune_timer; ldv_spin_lock(); if (et_coalesce->rx_max_coalesced_frames_low != 0U) { shared_timer->threshold_low = (u16 )et_coalesce->rx_max_coalesced_frames_low; } else { } if (et_coalesce->rx_max_coalesced_frames_irq != 0U) { shared_timer->threshold_target = (u16 )et_coalesce->rx_max_coalesced_frames_irq; } else { } if (et_coalesce->rx_max_coalesced_frames_high != 0U) { shared_timer->threshold_high = (u16 )et_coalesce->rx_max_coalesced_frames_high; } else { } if (et_coalesce->rx_coalesce_usecs_low != 0U) { shared_timer->timer_in_use_min = (u16 )et_coalesce->rx_coalesce_usecs_low; } else { } if (et_coalesce->rx_coalesce_usecs_high != 0U) { shared_timer->timer_in_use_max = (u16 )et_coalesce->rx_coalesce_usecs_high; } else { } spin_unlock_irqrestore(& nesadapter->periodic_timer_lock, flags); nesadapter->et_rx_coalesce_usecs_irq = et_coalesce->rx_coalesce_usecs_irq; if (et_coalesce->use_adaptive_rx_coalesce != 0U) { nesadapter->et_use_adaptive_rx_coalesce = 1U; nesadapter->timer_int_limit = 10U; nesadapter->et_rx_coalesce_usecs_irq = 0U; if (et_coalesce->pkt_rate_low != 0U) { nesadapter->et_pkt_rate_low = et_coalesce->pkt_rate_low; } else { } } else { nesadapter->et_use_adaptive_rx_coalesce = 0U; nesadapter->timer_int_limit = 2U; if (nesadapter->et_rx_coalesce_usecs_irq != 0U) { nes_write32(nesdev->regs + 24UL, nesadapter->et_rx_coalesce_usecs_irq * 8U | 2147483648U); } else { } } return (0); } } static int nes_netdev_get_coalesce(struct net_device *netdev , struct ethtool_coalesce *et_coalesce ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct ethtool_coalesce temp_et_coalesce ; struct nes_hw_tune_timer *shared_timer ; unsigned long flags ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; shared_timer = & nesadapter->tune_timer; memset((void *)(& temp_et_coalesce), 0, 92UL); temp_et_coalesce.rx_coalesce_usecs_irq = nesadapter->et_rx_coalesce_usecs_irq; temp_et_coalesce.use_adaptive_rx_coalesce = (__u32 )nesadapter->et_use_adaptive_rx_coalesce; temp_et_coalesce.rate_sample_interval = nesadapter->et_rate_sample_interval; temp_et_coalesce.pkt_rate_low = nesadapter->et_pkt_rate_low; ldv_spin_lock(); temp_et_coalesce.rx_max_coalesced_frames_low = (__u32 )shared_timer->threshold_low; temp_et_coalesce.rx_max_coalesced_frames_irq = (__u32 )shared_timer->threshold_target; temp_et_coalesce.rx_max_coalesced_frames_high = (__u32 )shared_timer->threshold_high; temp_et_coalesce.rx_coalesce_usecs_low = (__u32 )shared_timer->timer_in_use_min; temp_et_coalesce.rx_coalesce_usecs_high = (__u32 )shared_timer->timer_in_use_max; if ((unsigned int )nesadapter->et_use_adaptive_rx_coalesce != 0U) { temp_et_coalesce.rx_coalesce_usecs_irq = (__u32 )shared_timer->timer_in_use; } else { } spin_unlock_irqrestore(& nesadapter->periodic_timer_lock, flags); memcpy((void *)et_coalesce, (void const *)(& temp_et_coalesce), 92UL); return (0); } } static void nes_netdev_get_pauseparam(struct net_device *netdev , struct ethtool_pauseparam *et_pauseparam ) { struct nes_vnic *nesvnic ; void *tmp ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; et_pauseparam->autoneg = 0U; et_pauseparam->rx_pause = (unsigned int )(nesvnic->nesdev)->disable_rx_flow_control == 0U; et_pauseparam->tx_pause = (unsigned int )(nesvnic->nesdev)->disable_tx_flow_control == 0U; return; } } static int nes_netdev_set_pauseparam(struct net_device *netdev , struct ethtool_pauseparam *et_pauseparam ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; u32 u32temp ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; if (et_pauseparam->autoneg != 0U) { return (0); } else { } if (et_pauseparam->tx_pause == 1U && (unsigned int )nesdev->disable_tx_flow_control == 1U) { u32temp = nes_read_indexed___1(nesdev, nesdev->mac_index * 512U + 8196U); u32temp = u32temp | 1U; nes_write_indexed___1(nesdev, nesdev->mac_index * 512U + 8196U, u32temp); nesdev->disable_tx_flow_control = 0U; } else if (et_pauseparam->tx_pause == 0U && (unsigned int )nesdev->disable_tx_flow_control == 0U) { u32temp = nes_read_indexed___1(nesdev, nesdev->mac_index * 512U + 8196U); u32temp = u32temp & 4294967294U; nes_write_indexed___1(nesdev, nesdev->mac_index * 512U + 8196U, u32temp); nesdev->disable_tx_flow_control = 1U; } else { } if (et_pauseparam->rx_pause == 1U && (unsigned int )nesdev->disable_rx_flow_control == 1U) { u32temp = nes_read_indexed___1(nesdev, (nesdev->mac_index + 40U) * 64U); u32temp = u32temp & 4294836223U; nes_write_indexed___1(nesdev, (nesdev->mac_index + 40U) * 64U, u32temp); nesdev->disable_rx_flow_control = 0U; } else if (et_pauseparam->rx_pause == 0U && (unsigned int )nesdev->disable_rx_flow_control == 0U) { u32temp = nes_read_indexed___1(nesdev, (nesdev->mac_index + 40U) * 64U); u32temp = u32temp | 131072U; nes_write_indexed___1(nesdev, (nesdev->mac_index + 40U) * 64U, u32temp); nesdev->disable_rx_flow_control = 1U; } else { } return (0); } } static int nes_netdev_get_settings(struct net_device *netdev , struct ethtool_cmd *et_cmd ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; u32 mac_index ; u8 phy_type ; u8 phy_index ; u16 phy_data ; unsigned long flags ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; mac_index = nesdev->mac_index; phy_type = nesadapter->phy_type[mac_index]; phy_index = nesadapter->phy_index[mac_index]; et_cmd->duplex = 1U; et_cmd->port = 2U; et_cmd->maxtxpkt = 511U; et_cmd->maxrxpkt = 511U; if ((unsigned int )nesadapter->OneG_Mode != 0U) { ethtool_cmd_speed_set(et_cmd, 1000U); if ((unsigned int )phy_type == 5U) { et_cmd->supported = 32U; et_cmd->advertising = 32U; et_cmd->autoneg = 0U; et_cmd->transceiver = 0U; et_cmd->phy_address = (__u8 )mac_index; } else { et_cmd->supported = 96U; et_cmd->advertising = 96U; ldv_spin_lock(); nes_read_1G_phy_reg(nesdev, 0, (int )phy_index, & phy_data); spin_unlock_irqrestore(& nesadapter->phy_lock, flags); if (((int )phy_data & 4096) != 0) { et_cmd->autoneg = 1U; } else { et_cmd->autoneg = 0U; } et_cmd->transceiver = 1U; et_cmd->phy_address = phy_index; } return (0); } else { } if (((unsigned int )phy_type == 4U || (unsigned int )phy_type == 8U) || (unsigned int )phy_type == 9U) { et_cmd->transceiver = 1U; et_cmd->port = 3U; et_cmd->supported = 1024U; et_cmd->advertising = 1024U; et_cmd->phy_address = phy_index; } else { et_cmd->transceiver = 0U; et_cmd->supported = 4096U; et_cmd->advertising = 4096U; et_cmd->phy_address = (__u8 )mac_index; } ethtool_cmd_speed_set(et_cmd, 10000U); et_cmd->autoneg = 0U; return (0); } } static int nes_netdev_set_settings(struct net_device *netdev , struct ethtool_cmd *et_cmd ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; unsigned long flags ; u16 phy_data ; u8 phy_index ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; if ((unsigned int )nesadapter->OneG_Mode != 0U && (unsigned int )nesadapter->phy_type[nesdev->mac_index] != 5U) { phy_index = nesadapter->phy_index[nesdev->mac_index]; ldv_spin_lock(); nes_read_1G_phy_reg(nesdev, 0, (int )phy_index, & phy_data); if ((unsigned int )et_cmd->autoneg != 0U) { phy_data = (u16 )((unsigned int )phy_data | 4864U); } else { phy_data = (unsigned int )phy_data & 61439U; } nes_write_1G_phy_reg(nesdev, 0, (int )phy_index, (int )phy_data); spin_unlock_irqrestore(& nesadapter->phy_lock, flags); } else { } return (0); } } static struct ethtool_ops const nes_ethtool_ops = {& nes_netdev_get_settings, & nes_netdev_set_settings, & nes_netdev_get_drvinfo, 0, 0, 0, 0, 0, 0, 0, & ethtool_op_get_link, 0, 0, 0, & nes_netdev_get_coalesce, & nes_netdev_set_coalesce, 0, 0, & nes_netdev_get_pauseparam, & nes_netdev_set_pauseparam, 0, & nes_netdev_get_strings, 0, & nes_netdev_get_ethtool_stats, 0, 0, 0, 0, & nes_netdev_get_sset_count, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static void nes_vlan_mode(struct net_device *netdev , struct nes_device *nesdev , netdev_features_t features ) { struct nes_adapter *nesadapter ; u32 u32temp ; unsigned long flags ; { nesadapter = nesdev->nesadapter; ldv_spin_lock(); if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: %s: %s\n", "nes_vlan_mode", 1599, "nes_vlan_mode", (char *)(& netdev->name)); } else { } u32temp = nes_read_indexed___1(nesdev, 2280U); if ((features & 256ULL) != 0ULL) { u32temp = u32temp & 4261412863U; } else { u32temp = u32temp | 33554432U; } nes_write_indexed___1(nesdev, 2280U, u32temp); spin_unlock_irqrestore(& nesadapter->phy_lock, flags); return; } } static netdev_features_t nes_fix_features(struct net_device *netdev , netdev_features_t features ) { { if ((features & 256ULL) != 0ULL) { features = features | 128ULL; } else { features = features & 0xffffffffffffff7fULL; } return (features); } } static int nes_set_features(struct net_device *netdev , netdev_features_t features ) { struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; u32 changed ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; changed = (u32 )netdev->features ^ (u32 )features; if (((unsigned long long )changed & 256ULL) != 0ULL) { nes_vlan_mode(netdev, nesdev, features); } else { } return (0); } } static struct net_device_ops const nes_netdev_ops = {0, 0, & nes_netdev_open, & nes_netdev_stop, (netdev_tx_t (*)(struct sk_buff * , struct net_device * ))(& nes_netdev_start_xmit), 0, 0, & nes_netdev_set_multicast_list, & nes_netdev_set_mac_address, & eth_validate_addr, 0, 0, & nes_netdev_change_mtu, 0, & nes_netdev_tx_timeout, 0, & nes_netdev_get_stats, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & nes_fix_features, & nes_set_features, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; struct net_device *nes_netdev_init(struct nes_device *nesdev , void *mmio_addr ) { u64 u64temp ; struct nes_vnic *nesvnic ; struct net_device *netdev ; struct nic_qp_map *curr_qp_map ; u8 phy_type ; void *tmp ; struct lock_class_key __key ; struct lock_class_key __key___0 ; u32 u32temp ; u32 link_mask ; u32 link_val ; u16 temp_phy_data ; u16 phy_data ; unsigned long flags ; u32 tmp___0 ; u32 tmp___1 ; { phy_type = (nesdev->nesadapter)->phy_type[nesdev->mac_index]; netdev = alloc_etherdev_mqs(16792, 1U, 1U); if ((unsigned long )netdev == (unsigned long )((struct net_device *)0)) { printk("\viw_nes: nesvnic etherdev alloc failed"); return ((struct net_device *)0); } else { } tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: netdev = %p, %s\n", "nes_netdev_init", 1671, netdev, (char *)(& netdev->name)); } else { } netdev->dev.parent = & (nesdev->pcidev)->dev; netdev->watchdog_timeo = 1500; netdev->irq = (int )(nesdev->pcidev)->irq; netdev->mtu = 1500U; netdev->hard_header_len = 14U; netdev->addr_len = 6U; netdev->type = 1U; netdev->netdev_ops = & nes_netdev_ops; netdev->ethtool_ops = & nes_ethtool_ops; netif_napi_add(netdev, & nesvnic->napi, & nes_netdev_poll, 128); if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Enabling VLAN Insert/Delete.\n", "nes_netdev_init", 1684); } else { } nesvnic->netdev = netdev; nesvnic->nesdev = nesdev; nesvnic->msg_enable = netif_msg_init(debug, (int )default_msg); nesvnic->netdev_index = nesdev->netdev_count; nesvnic->perfect_filter_index = (nesdev->nesadapter)->netdev_count; nesvnic->max_frame_size = (unsigned int )((int )((u16 )netdev->mtu) + (int )netdev->hard_header_len) + 4U; curr_qp_map = nic_qp_mapping_per_function[(nesdev->pcidev)->devfn & 7U]; nesvnic->nic.qp_id = (u16 )(curr_qp_map + (unsigned long )nesdev->netdev_count)->qpid; nesvnic->nic_index = (curr_qp_map + (unsigned long )nesdev->netdev_count)->nic_index; nesvnic->logical_port = (curr_qp_map + (unsigned long )nesdev->netdev_count)->logical_port; u64temp = (unsigned long long )(nesdev->nesadapter)->mac_addr_low; u64temp = ((unsigned long long )(nesdev->nesadapter)->mac_addr_high << 32) + u64temp; u64temp = (u64 )nesvnic->nic_index + u64temp; *(netdev->dev_addr) = (unsigned char )(u64temp >> 40); *(netdev->dev_addr + 1UL) = (unsigned char )(u64temp >> 32); *(netdev->dev_addr + 2UL) = (unsigned char )(u64temp >> 24); *(netdev->dev_addr + 3UL) = (unsigned char )(u64temp >> 16); *(netdev->dev_addr + 4UL) = (unsigned char )(u64temp >> 8); *(netdev->dev_addr + 5UL) = (unsigned char )u64temp; netdev->hw_features = 17179869443ULL; if ((unsigned int )nesvnic->logical_port <= 1U || (nesdev->nesadapter)->hw_rev != 4U) { netdev->hw_features = netdev->hw_features | 65536ULL; } else { } netdev->features = netdev->hw_features | 160ULL; netdev->hw_features = netdev->hw_features | 32768ULL; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: nesvnic = %p, reported features = 0x%lX, QPid = %d, nic_index = %d, logical_port = %d, mac_index = %d.\n", "nes_netdev_init", 1720, nesvnic, (unsigned long )netdev->features, (int )nesvnic->nic.qp_id, (int )nesvnic->nic_index, (int )nesvnic->logical_port, nesdev->mac_index); } else { } if ((unsigned int )((nesvnic->nesdev)->nesadapter)->port_count == 1U && (unsigned int )((nesvnic->nesdev)->nesadapter)->adapter_fcn_count == 1U) { nesvnic->qp_nic_index[0] = nesvnic->nic_index; nesvnic->qp_nic_index[1] = (unsigned int )nesvnic->nic_index + 1U; if ((nes_drv_opt & 32U) != 0U) { nesvnic->qp_nic_index[2] = 15U; nesvnic->qp_nic_index[3] = 15U; } else { nesvnic->qp_nic_index[2] = (unsigned int )nesvnic->nic_index + 2U; nesvnic->qp_nic_index[3] = (unsigned int )nesvnic->nic_index + 3U; } } else if ((unsigned int )((nesvnic->nesdev)->nesadapter)->port_count == 2U || ((unsigned int )((nesvnic->nesdev)->nesadapter)->port_count == 1U && (unsigned int )((nesvnic->nesdev)->nesadapter)->adapter_fcn_count == 2U)) { nesvnic->qp_nic_index[0] = nesvnic->nic_index; nesvnic->qp_nic_index[1] = (unsigned int )nesvnic->nic_index + 2U; nesvnic->qp_nic_index[2] = 15U; nesvnic->qp_nic_index[3] = 15U; } else { nesvnic->qp_nic_index[0] = nesvnic->nic_index; nesvnic->qp_nic_index[1] = 15U; nesvnic->qp_nic_index[2] = 15U; nesvnic->qp_nic_index[3] = 15U; } nesvnic->next_qp_nic_index = 0U; if ((unsigned int )nesdev->netdev_count == 0U) { nesvnic->rdma_enabled = 1U; } else { nesvnic->rdma_enabled = 0U; } nesvnic->nic_cq.cq_number = nesvnic->nic.qp_id; reg_timer_7(& nesvnic->event_timer); nesvnic->event_timer.function = (void (*)(unsigned long ))0; spinlock_check(& nesvnic->tx_lock); __raw_spin_lock_init(& nesvnic->tx_lock.__annonCompField18.rlock, "&(&nesvnic->tx_lock)->rlock", & __key); spinlock_check(& nesvnic->port_ibevent_lock); __raw_spin_lock_init(& nesvnic->port_ibevent_lock.__annonCompField18.rlock, "&(&nesvnic->port_ibevent_lock)->rlock", & __key___0); nesdev->netdev[(int )nesdev->netdev_count] = netdev; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Adding nesvnic (%p) to the adapters nesvnic_list for MAC%d.\n", "nes_netdev_init", 1765, nesvnic, nesdev->mac_index); } else { } list_add_tail(& nesvnic->list, (struct list_head *)(& (nesdev->nesadapter)->nesvnic_list) + (unsigned long )nesdev->mac_index); if ((unsigned int )nesdev->netdev_count == 0U && (((nesdev->pcidev)->devfn & 7U) == nesdev->mac_index || ((unsigned int )phy_type == 5U && ((((nesdev->pcidev)->devfn & 7U) == 1U && nesdev->mac_index == 2U) || (((nesdev->pcidev)->devfn & 7U) == 2U && nesdev->mac_index == 1U))))) { link_mask = 0U; link_val = 0U; phy_data = 0U; u32temp = nes_read_indexed___1(nesdev, ((nesdev->mac_index & 1U) + 20U) * 512U); if ((unsigned int )phy_type != 5U) { u32temp = u32temp | 2097152U; nes_write_indexed___1(nesdev, ((nesdev->mac_index & 1U) + 20U) * 512U, u32temp); } else { } switch ((int )phy_type) { case 5: ; if (nesdev->mac_index <= 1U) { link_mask = 16842752U; link_val = 16842752U; } else { link_mask = 33685504U; link_val = 33685504U; } goto ldv_61318; case 8: ldv_spin_lock(); nes_read_10G_phy_reg(nesdev, (int )(nesdev->nesadapter)->phy_index[nesdev->mac_index], 1, 36867); tmp___0 = nes_read_indexed___1(nesdev, 8324U); temp_phy_data = (unsigned short )tmp___0; nes_read_10G_phy_reg(nesdev, (int )(nesdev->nesadapter)->phy_index[nesdev->mac_index], 3, 33); nes_read_indexed___1(nesdev, 8324U); nes_read_10G_phy_reg(nesdev, (int )(nesdev->nesadapter)->phy_index[nesdev->mac_index], 3, 33); tmp___1 = nes_read_indexed___1(nesdev, 8324U); phy_data = (unsigned short )tmp___1; spin_unlock_irqrestore(& (nesdev->nesadapter)->phy_lock, flags); phy_data = (unsigned int )temp_phy_data == 0U && (unsigned int )phy_data == 32768U ? 4U : 0U; goto ldv_61318; default: link_mask = 253689856U; link_val = 252641280U; goto ldv_61318; } ldv_61318: u32temp = nes_read_indexed___1(nesdev, ((nesdev->mac_index & 1U) + 20U) * 512U); if ((unsigned int )phy_type == 8U) { if (((int )phy_data & 4) != 0) { nesvnic->linkup = 1U; } else { } } else if ((u32temp & link_mask) == link_val) { nesvnic->linkup = 1U; } else { } u32temp = nes_read_indexed___1(nesdev, nesdev->mac_index * 512U + 8688U); if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Phy interrupt status = 0x%X.\n", "nes_netdev_init", 1837, u32temp); } else { } nes_write_indexed___1(nesdev, nesdev->mac_index * 512U + 8688U, u32temp); nes_init_phy(nesdev); } else { } nes_vlan_mode(netdev, nesdev, netdev->features); return (netdev); } } void nes_netdev_destroy(struct net_device *netdev ) { struct nes_vnic *nesvnic ; void *tmp ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; list_del(& nesvnic->list); if ((unsigned int )nesvnic->of_device_registered != 0U) { nes_destroy_ofa_device(nesvnic->nesibdev); } else { } ldv_free_netdev_164(netdev); return; } } int nes_nic_cm_xmit(struct sk_buff *skb , struct net_device *netdev ) { int ret ; { skb->dev = netdev; ret = dev_queue_xmit(skb); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Bad return code from dev_queue_xmit %d\n", "nes_nic_cm_xmit", 1879, ret); } else { } } else { } return (ret); } } int ldv_retval_0 ; int ldv_retval_1 ; extern int ldv_ndo_uninit_17(void) ; extern int ldv_ndo_init_17(void) ; void disable_suitable_timer_8(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_8) { ldv_timer_state_8 = 0; return; } else { } return; } } void activate_pending_timer_8(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_8 == (unsigned long )timer) { if (ldv_timer_state_8 == 2 || pending_flag != 0) { ldv_timer_list_8 = timer; ldv_timer_list_8->data = data; ldv_timer_state_8 = 1; } else { } return; } else { } reg_timer_8(timer); ldv_timer_list_8->data = data; return; } } void ldv_initialize_ethtool_ops_18(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; { tmp = ldv_init_zalloc(92UL); nes_ethtool_ops_group0 = (struct ethtool_coalesce *)tmp; tmp___0 = ldv_init_zalloc(3008UL); nes_ethtool_ops_group2 = (struct net_device *)tmp___0; tmp___1 = ldv_init_zalloc(44UL); nes_ethtool_ops_group1 = (struct ethtool_cmd *)tmp___1; tmp___2 = ldv_init_zalloc(16UL); nes_ethtool_ops_group3 = (struct ethtool_pauseparam *)tmp___2; return; } } void choose_timer_8(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_8 = 2; return; } } int reg_timer_8(struct timer_list *timer ) { { ldv_timer_list_8 = timer; ldv_timer_state_8 = 1; return (0); } } void ldv_net_device_ops_17(void) { void *tmp ; { tmp = ldv_init_zalloc(3008UL); nes_netdev_ops_group1 = (struct net_device *)tmp; return; } } void ldv_main_exported_18(void) { struct ethtool_drvinfo *ldvarg15 ; void *tmp ; int ldvarg16 ; u32 ldvarg12 ; u64 *ldvarg13 ; void *tmp___0 ; struct ethtool_stats *ldvarg14 ; void *tmp___1 ; u8 *ldvarg11 ; void *tmp___2 ; int tmp___3 ; { tmp = ldv_init_zalloc(196UL); ldvarg15 = (struct ethtool_drvinfo *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg13 = (u64 *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg14 = (struct ethtool_stats *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg11 = (u8 *)tmp___2; ldv_memset((void *)(& ldvarg16), 0, 4UL); ldv_memset((void *)(& ldvarg12), 0, 4UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_18 == 1) { nes_netdev_get_sset_count(nes_ethtool_ops_group2, ldvarg16); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 1: ; if (ldv_state_variable_18 == 1) { nes_netdev_get_settings(nes_ethtool_ops_group2, nes_ethtool_ops_group1); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 2: ; if (ldv_state_variable_18 == 1) { nes_netdev_set_coalesce(nes_ethtool_ops_group2, nes_ethtool_ops_group0); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 3: ; if (ldv_state_variable_18 == 1) { nes_netdev_get_drvinfo(nes_ethtool_ops_group2, ldvarg15); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 4: ; if (ldv_state_variable_18 == 1) { nes_netdev_set_pauseparam(nes_ethtool_ops_group2, nes_ethtool_ops_group3); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 5: ; if (ldv_state_variable_18 == 1) { nes_netdev_set_settings(nes_ethtool_ops_group2, nes_ethtool_ops_group1); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 6: ; if (ldv_state_variable_18 == 1) { nes_netdev_get_ethtool_stats(nes_ethtool_ops_group2, ldvarg14, ldvarg13); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 7: ; if (ldv_state_variable_18 == 1) { nes_netdev_get_strings(nes_ethtool_ops_group2, ldvarg12, ldvarg11); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 8: ; if (ldv_state_variable_18 == 1) { nes_netdev_get_coalesce(nes_ethtool_ops_group2, nes_ethtool_ops_group0); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 9: ; if (ldv_state_variable_18 == 1) { nes_netdev_get_pauseparam(nes_ethtool_ops_group2, nes_ethtool_ops_group3); ldv_state_variable_18 = 1; } else { } goto ldv_61367; case 10: ; if (ldv_state_variable_18 == 1) { ethtool_op_get_link(nes_ethtool_ops_group2); ldv_state_variable_18 = 1; } else { } goto ldv_61367; default: ldv_stop(); } ldv_61367: ; return; } } void ldv_main_exported_17(void) { void *ldvarg6 ; void *tmp ; int ldvarg9 ; netdev_features_t ldvarg10 ; netdev_features_t ldvarg7 ; struct sk_buff *ldvarg8 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg6 = tmp; tmp___0 = ldv_init_zalloc(232UL); ldvarg8 = (struct sk_buff *)tmp___0; ldv_memset((void *)(& ldvarg9), 0, 4UL); ldv_memset((void *)(& ldvarg10), 0, 8UL); ldv_memset((void *)(& ldvarg7), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_17 == 3) { nes_netdev_stop(nes_netdev_ops_group1); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 1: ; if (ldv_state_variable_17 == 1) { nes_netdev_set_multicast_list(nes_netdev_ops_group1); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 3) { nes_netdev_set_multicast_list(nes_netdev_ops_group1); ldv_state_variable_17 = 3; } else { } if (ldv_state_variable_17 == 2) { nes_netdev_set_multicast_list(nes_netdev_ops_group1); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 2: ; if (ldv_state_variable_17 == 1) { eth_validate_addr(nes_netdev_ops_group1); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 3) { eth_validate_addr(nes_netdev_ops_group1); ldv_state_variable_17 = 3; } else { } if (ldv_state_variable_17 == 2) { eth_validate_addr(nes_netdev_ops_group1); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 3: ; if (ldv_state_variable_17 == 1) { nes_netdev_get_stats(nes_netdev_ops_group1); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 3) { nes_netdev_get_stats(nes_netdev_ops_group1); ldv_state_variable_17 = 3; } else { } if (ldv_state_variable_17 == 2) { nes_netdev_get_stats(nes_netdev_ops_group1); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 4: ; if (ldv_state_variable_17 == 1) { nes_set_features(nes_netdev_ops_group1, ldvarg10); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 3) { nes_set_features(nes_netdev_ops_group1, ldvarg10); ldv_state_variable_17 = 3; } else { } if (ldv_state_variable_17 == 2) { nes_set_features(nes_netdev_ops_group1, ldvarg10); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 5: ; if (ldv_state_variable_17 == 3) { nes_netdev_change_mtu(nes_netdev_ops_group1, ldvarg9); ldv_state_variable_17 = 3; } else { } if (ldv_state_variable_17 == 2) { nes_netdev_change_mtu(nes_netdev_ops_group1, ldvarg9); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 6: ; if (ldv_state_variable_17 == 2) { ldv_retval_1 = nes_netdev_open(nes_netdev_ops_group1); if (ldv_retval_1 == 0) { ldv_state_variable_17 = 3; } else { } } else { } goto ldv_61388; case 7: ; if (ldv_state_variable_17 == 3) { nes_netdev_start_xmit(ldvarg8, nes_netdev_ops_group1); ldv_state_variable_17 = 3; } else { } goto ldv_61388; case 8: ; if (ldv_state_variable_17 == 1) { nes_fix_features(nes_netdev_ops_group1, ldvarg7); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 3) { nes_fix_features(nes_netdev_ops_group1, ldvarg7); ldv_state_variable_17 = 3; } else { } if (ldv_state_variable_17 == 2) { nes_fix_features(nes_netdev_ops_group1, ldvarg7); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 9: ; if (ldv_state_variable_17 == 1) { nes_netdev_set_mac_address(nes_netdev_ops_group1, ldvarg6); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 3) { nes_netdev_set_mac_address(nes_netdev_ops_group1, ldvarg6); ldv_state_variable_17 = 3; } else { } if (ldv_state_variable_17 == 2) { nes_netdev_set_mac_address(nes_netdev_ops_group1, ldvarg6); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 10: ; if (ldv_state_variable_17 == 1) { nes_netdev_tx_timeout(nes_netdev_ops_group1); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 3) { nes_netdev_tx_timeout(nes_netdev_ops_group1); ldv_state_variable_17 = 3; } else { } if (ldv_state_variable_17 == 2) { nes_netdev_tx_timeout(nes_netdev_ops_group1); ldv_state_variable_17 = 2; } else { } goto ldv_61388; case 11: ; if (ldv_state_variable_17 == 1) { ldv_retval_0 = ldv_ndo_init_17(); if (ldv_retval_0 == 0) { ldv_state_variable_17 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61388; case 12: ; if (ldv_state_variable_17 == 2) { ldv_ndo_uninit_17(); ldv_state_variable_17 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61388; default: ldv_stop(); } ldv_61388: ; return; } } bool ldv_queue_work_on_135(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_136(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_137(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___4 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_138(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_139(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___5 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void *ldv_kmem_cache_alloc_145(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_pskb_expand_head_151(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_153(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv_skb_copy_155(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_156(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_157(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_158(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } int ldv_pskb_expand_head_159(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } int ldv_pskb_expand_head_160(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_161(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } void *ldv_kmem_cache_alloc_162(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_del_timer_sync_163(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } void ldv_free_netdev_164(struct net_device *dev ) { { free_netdev(dev); ldv_state_variable_17 = 0; return; } } extern unsigned long find_next_zero_bit(unsigned long const * , unsigned long , unsigned long ) ; extern unsigned long find_first_zero_bit(unsigned long const * , unsigned long ) ; __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) ; bool ldv_queue_work_on_186(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_188(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_187(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_190(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_189(struct workqueue_struct *ldv_func_arg1 ) ; __inline static unsigned short readw(void const volatile *addr ) { unsigned short ret ; { __asm__ volatile ("movw %1,%0": "=r" (ret): "m" (*((unsigned short volatile *)addr)): "memory"); return (ret); } } void *ldv_kmem_cache_alloc_196(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_213(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_204(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_212(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_206(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_202(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_210(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_211(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_207(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_208(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_209(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; u32 mh_detected ; u32 mh_pauses_sent ; __inline static u32 nes_read_indexed___2(struct nes_device *nesdev , u32 reg_index ) { unsigned long flags ; void *addr ; u32 value ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); value = readl((void const volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return (value); } } __inline static void nes_write_indexed___2(struct nes_device *nesdev , u32 reg_index , u32 val ) { unsigned long flags ; void *addr ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); writel(val, (void volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return; } } __inline static int nes_alloc_resource(struct nes_adapter *nesadapter , unsigned long *resource_array , u32 max_resources , u32 *req_resource_num , u32 *next , enum nes_resource resource_type___0 ) { unsigned long flags ; u32 resource_num ; unsigned long tmp ; unsigned long tmp___0 ; { ldv_spin_lock(); tmp = find_next_zero_bit((unsigned long const *)resource_array, (unsigned long )max_resources, (unsigned long )*next); resource_num = (u32 )tmp; if (resource_num >= max_resources) { tmp___0 = find_first_zero_bit((unsigned long const *)resource_array, (unsigned long )max_resources); resource_num = (u32 )tmp___0; if (resource_num >= max_resources) { printk("\viw_nes: %s: No available resources [type=%u].\n", "nes_alloc_resource", (unsigned int )resource_type___0); spin_unlock_irqrestore(& nesadapter->resource_lock, flags); return (-24); } else { } } else { } set_bit((long )resource_num, (unsigned long volatile *)resource_array); *next = resource_num + 1U; if (*next == max_resources) { *next = 0U; } else { } spin_unlock_irqrestore(& nesadapter->resource_lock, flags); *req_resource_num = resource_num; return (0); } } __inline static void nes_free_resource___0(struct nes_adapter *nesadapter , unsigned long *resource_array , u32 resource_num ) { unsigned long flags ; { ldv_spin_lock(); clear_bit((long )resource_num, (unsigned long volatile *)resource_array); spin_unlock_irqrestore(& nesadapter->resource_lock, flags); return; } } void nes_dump_mem(unsigned int dump_debug_level , void *addr , int length ) ; static u16 nes_read16_eeprom(void *addr , u16 offset ) ; static u32 nes_set_pau(struct nes_device *nesdev ) { u32 ret ; u32 counter ; u32 tmp ; { ret = 0U; nes_write_indexed___2(nesdev, 268U, 117440513U); nes_write_indexed___2(nesdev, 188U, 1U); counter = 0U; goto ldv_60924; ldv_60923: __const_udelay(128850UL); tmp = nes_read_indexed___2(nesdev, 268U); if (tmp == 0U) { printk("\016iw_nes: PAU is supported.\n"); goto ldv_60922; } else { } nes_write_indexed___2(nesdev, 188U, 1U); counter = counter + 1U; ldv_60924: ; if (counter <= 9U) { goto ldv_60923; } else { } ldv_60922: ; if (counter == 10U) { printk("\016iw_nes: PAU is not supported.\n"); return (4294967295U); } else { } return (ret); } } int nes_read_eeprom_values(struct nes_device *nesdev , struct nes_adapter *nesadapter ) { u32 mac_addr_low ; u16 mac_addr_high ; u16 eeprom_data ; u16 eeprom_offset ; u16 next_section_address ; u16 sw_section_ver ; u8 major_ver ; u8 minor_ver ; u32 tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; u16 tmp___6 ; u16 tmp___7 ; u16 tmp___8 ; u16 tmp___9 ; u16 tmp___10 ; u16 tmp___11 ; u16 tmp___12 ; { major_ver = 0U; minor_ver = 0U; if ((unsigned int )nesadapter->firmware_eeprom_offset == 0U) { eeprom_data = nes_read16_eeprom(nesdev->regs, 0); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Offset 0 = 0x%04X\n", "nes_read_eeprom_values", 100, (int )eeprom_data); } else { } eeprom_offset = (unsigned int )((u16 )((((int )eeprom_data & 127) << 3) << (((int )eeprom_data & 128) >> 7))) + 2U; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: Firmware Offset = 0x%04X\n", "nes_read_eeprom_values", 103, (int )eeprom_offset); } else { } nesadapter->firmware_eeprom_offset = eeprom_offset; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 4U)); if ((unsigned int )eeprom_data != 22342U) { if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: Not a valid Firmware Image = 0x%04X\n", "nes_read_eeprom_values", 107, (int )eeprom_data); } else { } return (-1); } else { } eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 2U)); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Offset %u = 0x%04X\n", "nes_read_eeprom_values", 113, (int )eeprom_offset + 2, (int )eeprom_data); } else { } eeprom_offset = (int )((u16 )((((int )eeprom_data & 255) << 3) << (((int )eeprom_data & 256) >> 8))) + (int )eeprom_offset; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: Software Offset = 0x%04X\n", "nes_read_eeprom_values", 115, (int )eeprom_offset); } else { } nesadapter->software_eeprom_offset = eeprom_offset; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 4U)); if ((unsigned int )eeprom_data != 22355U) { printk("Not a valid Software Image = 0x%04X\n", (int )eeprom_data); return (-1); } else { } sw_section_ver = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )nesadapter->software_eeprom_offset + 6U)); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: Software section version number = 0x%04X\n", "nes_read_eeprom_values", 124, (int )sw_section_ver); } else { } eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 2U)); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Offset %u (next section) = 0x%04X\n", "nes_read_eeprom_values", 128, (int )eeprom_offset + 2, (int )eeprom_data); } else { } next_section_address = (int )((u16 )((((int )eeprom_data & 255) << 3) << (((int )eeprom_data & 256) >> 8))) + (int )eeprom_offset; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )next_section_address + 4U)); if ((unsigned int )eeprom_data != 16717U) { if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Changed offset should be 0x414d but was 0x%04X\n", "nes_read_eeprom_values", 134, (int )eeprom_data); } else { } goto no_fw_rev; } else { } eeprom_offset = next_section_address; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 2U)); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Offset %u (next section) = 0x%04X\n", "nes_read_eeprom_values", 141, (int )eeprom_offset + 2, (int )eeprom_data); } else { } next_section_address = (int )((u16 )((((int )eeprom_data & 255) << 3) << (((int )eeprom_data & 256) >> 8))) + (int )eeprom_offset; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )next_section_address + 4U)); if ((unsigned int )eeprom_data != 20306U) { if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Changed offset should be 0x4f52 but was 0x%04X\n", "nes_read_eeprom_values", 147, (int )eeprom_data); } else { } goto no_fw_rev; } else { } eeprom_offset = next_section_address; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 2U)); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Offset %u (next section) = 0x%04X\n", "nes_read_eeprom_values", 154, (int )eeprom_offset + 2, (int )eeprom_data); } else { } next_section_address = (((unsigned int )eeprom_data & 255U) << 3U) + (unsigned int )eeprom_offset; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )next_section_address + 4U)); if ((unsigned int )eeprom_data != 22342U) { if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Changed offset should be 0x5746 but was 0x%04X\n", "nes_read_eeprom_values", 159, (int )eeprom_data); } else { } goto no_fw_rev; } else { } eeprom_offset = next_section_address; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 2U)); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Offset %u (next section) = 0x%04X\n", "nes_read_eeprom_values", 166, (int )eeprom_offset + 2, (int )eeprom_data); } else { } next_section_address = (((unsigned int )eeprom_data & 255U) << 3U) + (unsigned int )eeprom_offset; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )next_section_address + 4U)); if ((unsigned int )eeprom_data != 22355U) { if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Changed offset should be 0x5753 but was 0x%04X\n", "nes_read_eeprom_values", 171, (int )eeprom_data); } else { } goto no_fw_rev; } else { } eeprom_offset = next_section_address; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 2U)); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Offset %u (next section) = 0x%04X\n", "nes_read_eeprom_values", 178, (int )eeprom_offset + 2, (int )eeprom_data); } else { } next_section_address = (((unsigned int )eeprom_data & 255U) << 3U) + (unsigned int )eeprom_offset; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )next_section_address + 4U)); if ((unsigned int )eeprom_data != 16717U) { if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Changed offset should be 0x414d but was 0x%04X\n", "nes_read_eeprom_values", 183, (int )eeprom_data); } else { } goto no_fw_rev; } else { } eeprom_offset = next_section_address; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )eeprom_offset + 2U)); if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Offset %u (next section) = 0x%04X\n", "nes_read_eeprom_values", 190, (int )eeprom_offset + 2, (int )eeprom_data); } else { } next_section_address = (((unsigned int )eeprom_data & 255U) << 3U) + (unsigned int )eeprom_offset; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )next_section_address + 4U)); if ((unsigned int )eeprom_data != 17998U) { if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: EEPROM Changed offset should be 0x464e but was 0x%04X\n", "nes_read_eeprom_values", 195, (int )eeprom_data); } else { } goto no_fw_rev; } else { } eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )next_section_address + 8U)); printk("iw_nes: Firmware version %u.%u\n", (int )((unsigned char )((int )eeprom_data >> 8)), (int )((unsigned char )eeprom_data)); major_ver = (unsigned char )((int )eeprom_data >> 8); minor_ver = (unsigned char )eeprom_data; if ((nes_drv_opt & 512U) != 0U) { if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: Virtual WQs have been disabled\n", "nes_read_eeprom_values", 204); } else { } } else if (((unsigned int )major_ver == 2U && (unsigned int )minor_ver > 21U) || ((unsigned int )major_ver > 2U && (unsigned int )major_ver != 255U)) { nesadapter->virtwq = 1U; } else { } if (((unsigned int )major_ver == 3U && (unsigned int )minor_ver > 15U) || (unsigned int )major_ver > 3U) { nesadapter->send_term_ok = 1U; } else { } if ((nes_drv_opt & 1024U) != 0U) { tmp = nes_set_pau(nesdev); if (tmp == 0U) { nesadapter->allow_unaligned_fpdus = 1U; } else { } } else { } nesadapter->firmware_version = ((unsigned int )((unsigned char )((int )eeprom_data >> 8)) << 16) + (unsigned int )((unsigned char )eeprom_data); eeprom_data = nes_read16_eeprom(nesdev->regs, (int )((unsigned int )next_section_address + 10U)); printk("iw_nes: EEPROM version %u.%u\n", (int )((unsigned char )((int )eeprom_data >> 8)), (int )((unsigned char )eeprom_data)); nesadapter->eeprom_version = ((unsigned int )((unsigned char )((int )eeprom_data >> 8)) << 16) + (unsigned int )((unsigned char )eeprom_data); no_fw_rev: eeprom_offset = nesadapter->software_eeprom_offset; eeprom_offset = (unsigned int )eeprom_offset + 8U; tmp___0 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->netdev_max = (unsigned char )tmp___0; eeprom_offset = (unsigned int )eeprom_offset + 2U; mac_addr_high = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___1 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); mac_addr_low = (unsigned int )tmp___1; eeprom_offset = (unsigned int )eeprom_offset + 2U; mac_addr_low = mac_addr_low << 16; tmp___2 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); mac_addr_low = (u32 )tmp___2 + mac_addr_low; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: Base MAC Address = 0x%04X%08X\n", "nes_read_eeprom_values", 237, (int )mac_addr_high, mac_addr_low); } else { } if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: MAC Address count = %u\n", "nes_read_eeprom_values", 238, (int )nesadapter->netdev_max); } else { } nesadapter->mac_addr_low = mac_addr_low; nesadapter->mac_addr_high = mac_addr_high; eeprom_offset = (unsigned int )eeprom_offset + 10U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->phy_type[0] = (unsigned char )((int )eeprom_data >> 8); nesadapter->phy_type[1] = (unsigned char )eeprom_data; eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->phy_type[2] = (unsigned char )((int )eeprom_data >> 8); nesadapter->phy_type[3] = (unsigned char )eeprom_data; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: port_count = %u, port 0 -> %u, port 1 -> %u, port 2 -> %u, port 3 -> %u\n", "nes_read_eeprom_values", 259, (int )nesadapter->port_count, (int )nesadapter->phy_type[0], (int )nesadapter->phy_type[1], (int )nesadapter->phy_type[2], (int )nesadapter->phy_type[3]); } else { } eeprom_offset = (unsigned int )eeprom_offset + 10U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->pd_config_size[0] = eeprom_data; eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->pd_config_base[0] = eeprom_data; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: PD0 config, size=0x%04x, base=0x%04x\n", "nes_read_eeprom_values", 269, (int )nesadapter->pd_config_size[0], (int )nesadapter->pd_config_base[0]); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->pd_config_size[1] = eeprom_data; eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->pd_config_base[1] = eeprom_data; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: PD1 config, size=0x%04x, base=0x%04x\n", "nes_read_eeprom_values", 278, (int )nesadapter->pd_config_size[1], (int )nesadapter->pd_config_base[1]); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->pd_config_size[2] = eeprom_data; eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->pd_config_base[2] = eeprom_data; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: PD2 config, size=0x%04x, base=0x%04x\n", "nes_read_eeprom_values", 287, (int )nesadapter->pd_config_size[2], (int )nesadapter->pd_config_base[2]); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->pd_config_size[3] = eeprom_data; eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->pd_config_base[3] = eeprom_data; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: PD3 config, size=0x%04x, base=0x%04x\n", "nes_read_eeprom_values", 296, (int )nesadapter->pd_config_size[3], (int )nesadapter->pd_config_base[3]); } else { } eeprom_offset = (unsigned int )eeprom_offset + 22U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___3 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->rx_pool_size = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___3; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: rx_pool_size = 0x%08X\n", "nes_read_eeprom_values", 304, nesadapter->rx_pool_size); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___4 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->tx_pool_size = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___4; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: tx_pool_size = 0x%08X\n", "nes_read_eeprom_values", 311, nesadapter->tx_pool_size); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___5 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->rx_threshold = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___5; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: rx_threshold = 0x%08X\n", "nes_read_eeprom_values", 318, nesadapter->rx_threshold); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___6 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->tcp_timer_core_clk_divisor = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___6; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: tcp_timer_core_clk_divisor = 0x%08X\n", "nes_read_eeprom_values", 326, nesadapter->tcp_timer_core_clk_divisor); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___7 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->iwarp_config = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___7; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: iwarp_config = 0x%08X\n", "nes_read_eeprom_values", 333, nesadapter->iwarp_config); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___8 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->cm_config = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___8; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: cm_config = 0x%08X\n", "nes_read_eeprom_values", 340, nesadapter->cm_config); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___9 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->sws_timer_config = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___9; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: sws_timer_config = 0x%08X\n", "nes_read_eeprom_values", 347, nesadapter->sws_timer_config); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___10 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->tcp_config1 = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___10; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: tcp_config1 = 0x%08X\n", "nes_read_eeprom_values", 354, nesadapter->tcp_config1); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___11 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->wqm_wat = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___11; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: wqm_wat = 0x%08X\n", "nes_read_eeprom_values", 361, nesadapter->wqm_wat); } else { } eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); eeprom_offset = (unsigned int )eeprom_offset + 2U; tmp___12 = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->core_clock = ((unsigned int )eeprom_data << 16) + (unsigned int )tmp___12; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: core_clock = 0x%08X\n", "nes_read_eeprom_values", 368, nesadapter->core_clock); } else { } if ((unsigned int )sw_section_ver != 0U && nesadapter->hw_rev != 4U) { eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->phy_index[0] = (u8 )((int )eeprom_data >> 8); nesadapter->phy_index[1] = (u8 )eeprom_data; eeprom_offset = (unsigned int )eeprom_offset + 2U; eeprom_data = nes_read16_eeprom(nesdev->regs, (int )eeprom_offset); nesadapter->phy_index[2] = (u8 )((int )eeprom_data >> 8); nesadapter->phy_index[3] = (u8 )eeprom_data; } else { nesadapter->phy_index[0] = 4U; nesadapter->phy_index[1] = 5U; nesadapter->phy_index[2] = 6U; nesadapter->phy_index[3] = 7U; } if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: Phy address map = 0 > %u, 1 > %u, 2 > %u, 3 > %u\n", "nes_read_eeprom_values", 387, (int )nesadapter->phy_index[0], (int )nesadapter->phy_index[1], (int )nesadapter->phy_index[2], (int )nesadapter->phy_index[3]); } else { } } else { } return (0); } } static u16 nes_read16_eeprom(void *addr , u16 offset ) { unsigned int tmp ; unsigned short tmp___0 ; { writel((unsigned int )(((int )offset >> 1) + 65536), (void volatile *)addr + 32U); ldv_60943: tmp = readl((void const volatile *)addr + 32U); if ((tmp & 65536U) != 0U) { goto ldv_60943; } else { } tmp___0 = readw((void const volatile *)addr + 36U); return (tmp___0); } } void nes_write_1G_phy_reg(struct nes_device *nesdev , u8 phy_reg , u8 phy_addr , u16 data ) { u32 u32temp ; u32 counter ; { nes_write_indexed___2(nesdev, 8324U, (((unsigned int )data | ((unsigned int )phy_reg << 18)) | ((unsigned int )phy_addr << 23)) | 1342308352U); counter = 0U; goto ldv_60955; ldv_60954: __const_udelay(128850UL); u32temp = nes_read_indexed___2(nesdev, 8688U); if ((int )u32temp & 1) { nes_write_indexed___2(nesdev, 8688U, 1U); goto ldv_60953; } else { } counter = counter + 1U; ldv_60955: ; if (counter <= 99U) { goto ldv_60954; } else { } ldv_60953: ; if ((u32temp & 1U) == 0U) { if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy is not responding. interrupt status = 0x%X.\n", "nes_write_1G_phy_reg", 431, u32temp); } else { } } else { } return; } } void nes_read_1G_phy_reg(struct nes_device *nesdev , u8 phy_reg , u8 phy_addr , u16 *data ) { u32 u32temp ; u32 counter ; u32 tmp ; { nes_write_indexed___2(nesdev, 8324U, (((unsigned int )phy_reg << 18) | ((unsigned int )phy_addr << 23)) | 1610743808U); counter = 0U; goto ldv_60967; ldv_60966: __const_udelay(128850UL); u32temp = nes_read_indexed___2(nesdev, 8688U); if ((int )u32temp & 1) { nes_write_indexed___2(nesdev, 8688U, 1U); goto ldv_60965; } else { } counter = counter + 1U; ldv_60967: ; if (counter <= 99U) { goto ldv_60966; } else { } ldv_60965: ; if ((u32temp & 1U) == 0U) { if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy is not responding. interrupt status = 0x%X.\n", "nes_read_1G_phy_reg", 461, u32temp); } else { } *data = 65535U; } else { tmp = nes_read_indexed___2(nesdev, 8324U); *data = (unsigned short )tmp; } return; } } void nes_write_10G_phy_reg(struct nes_device *nesdev , u16 phy_addr , u8 dev_addr , u16 phy_reg , u16 data ) { u32 port_addr ; u32 u32temp ; u32 counter ; { port_addr = (u32 )phy_addr; nes_write_indexed___2(nesdev, 8324U, (((unsigned int )phy_reg | ((unsigned int )dev_addr << 18)) | (port_addr << 23)) | 131072U); counter = 0U; goto ldv_60981; ldv_60980: __const_udelay(128850UL); u32temp = nes_read_indexed___2(nesdev, 8688U); if ((int )u32temp & 1) { nes_write_indexed___2(nesdev, 8688U, 1U); goto ldv_60979; } else { } counter = counter + 1U; ldv_60981: ; if (counter <= 99U) { goto ldv_60980; } else { } ldv_60979: ; if ((u32temp & 1U) == 0U) { if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy is not responding. interrupt status = 0x%X.\n", "nes_write_10G_phy_reg", 494, u32temp); } else { } } else { } nes_write_indexed___2(nesdev, 8324U, (((unsigned int )data | ((unsigned int )dev_addr << 18)) | (port_addr << 23)) | 268566528U); counter = 0U; goto ldv_60985; ldv_60984: __const_udelay(128850UL); u32temp = nes_read_indexed___2(nesdev, 8688U); if ((int )u32temp & 1) { nes_write_indexed___2(nesdev, 8688U, 1U); goto ldv_60983; } else { } counter = counter + 1U; ldv_60985: ; if (counter <= 99U) { goto ldv_60984; } else { } ldv_60983: ; if ((u32temp & 1U) == 0U) { if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy is not responding. interrupt status = 0x%X.\n", "nes_write_10G_phy_reg", 509, u32temp); } else { } } else { } return; } } void nes_read_10G_phy_reg(struct nes_device *nesdev , u8 phy_addr , u8 dev_addr , u16 phy_reg ) { u32 port_addr ; u32 u32temp ; u32 counter ; { port_addr = (u32 )phy_addr; nes_write_indexed___2(nesdev, 8324U, (((unsigned int )phy_reg | ((unsigned int )dev_addr << 18)) | (port_addr << 23)) | 131072U); counter = 0U; goto ldv_60997; ldv_60996: __const_udelay(128850UL); u32temp = nes_read_indexed___2(nesdev, 8688U); if ((int )u32temp & 1) { nes_write_indexed___2(nesdev, 8688U, 1U); goto ldv_60995; } else { } counter = counter + 1U; ldv_60997: ; if (counter <= 99U) { goto ldv_60996; } else { } ldv_60995: ; if ((u32temp & 1U) == 0U) { if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy is not responding. interrupt status = 0x%X.\n", "nes_read_10G_phy_reg", 539, u32temp); } else { } } else { } nes_write_indexed___2(nesdev, 8324U, (((unsigned int )dev_addr << 18) | (port_addr << 23)) | 805437440U); counter = 0U; goto ldv_61001; ldv_61000: __const_udelay(128850UL); u32temp = nes_read_indexed___2(nesdev, 8688U); if ((int )u32temp & 1) { nes_write_indexed___2(nesdev, 8688U, 1U); goto ldv_60999; } else { } counter = counter + 1U; ldv_61001: ; if (counter <= 99U) { goto ldv_61000; } else { } ldv_60999: ; if ((u32temp & 1U) == 0U) { if ((nes_debug_level & 8U) != 0U) { printk("\viw_nes: %s[%u]: Phy is not responding. interrupt status = 0x%X.\n", "nes_read_10G_phy_reg", 554, u32temp); } else { } } else { } return; } } struct nes_cqp_request *nes_get_cqp_request(struct nes_device *nesdev ) { unsigned long flags ; struct nes_cqp_request *cqp_request ; struct list_head const *__mptr ; int tmp ; int tmp___0 ; void *tmp___1 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; { cqp_request = (struct nes_cqp_request *)0; tmp___0 = list_empty((struct list_head const *)(& nesdev->cqp_avail_reqs)); if (tmp___0 == 0) { ldv_spin_lock(); tmp = list_empty((struct list_head const *)(& nesdev->cqp_avail_reqs)); if (tmp == 0) { __mptr = (struct list_head const *)nesdev->cqp_avail_reqs.next; cqp_request = (struct nes_cqp_request *)__mptr + 0xffffffffffffff60UL; list_del_init(& cqp_request->list); } else { } spin_unlock_irqrestore(& nesdev->cqp.lock, flags); } else { } if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { tmp___1 = kzalloc(200UL, 32U); cqp_request = (struct nes_cqp_request *)tmp___1; if ((unsigned long )cqp_request != (unsigned long )((struct nes_cqp_request *)0)) { cqp_request->dynamic = 1U; INIT_LIST_HEAD(& cqp_request->list); } else { } } else { } if ((unsigned long )cqp_request != (unsigned long )((struct nes_cqp_request *)0)) { __init_waitqueue_head(& cqp_request->waitq, "&cqp_request->waitq", & __key); cqp_request->waiting = 0U; cqp_request->request_done = 0U; cqp_request->callback = 0U; __init_waitqueue_head(& cqp_request->waitq, "&cqp_request->waitq", & __key___0); if ((nes_debug_level & 512U) != 0U) { printk("\viw_nes: %s[%u]: Got cqp request %p from the available list \n", "nes_get_cqp_request", 590, cqp_request); } else { } } else { printk("\viw_nes: %s: Could not allocated a CQP request.\n", "nes_get_cqp_request"); } return (cqp_request); } } void nes_free_cqp_request(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) { unsigned long flags ; { if ((nes_debug_level & 512U) != 0U) { printk("\viw_nes: %s[%u]: CQP request %p (opcode 0x%02X) freed.\n", "nes_free_cqp_request", 605, cqp_request, cqp_request->cqp_wqe.wqe_words[0] & 63U); } else { } if ((unsigned int )cqp_request->dynamic != 0U) { kfree((void const *)cqp_request); } else { ldv_spin_lock(); list_add_tail(& cqp_request->list, & nesdev->cqp_avail_reqs); spin_unlock_irqrestore(& nesdev->cqp.lock, flags); } return; } } void nes_put_cqp_request(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) { int tmp ; { tmp = atomic_dec_and_test(& cqp_request->refcount); if (tmp != 0) { nes_free_cqp_request(nesdev, cqp_request); } else { } return; } } void nes_post_cqp_request(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) { struct nes_hw_cqp_wqe *cqp_wqe ; unsigned long flags ; u32 cqp_head ; u64 u64temp ; u32 opcode ; int ctx_index ; u16 tmp ; int tmp___0 ; int tmp___1 ; { ctx_index = 2; ldv_spin_lock(); if (((((int )nesdev->cqp.sq_tail + (int )nesdev->cqp.sq_size * 2) - (int )nesdev->cqp.sq_head) & ((int )nesdev->cqp.sq_size + -1)) != 1) { tmp___1 = list_empty((struct list_head const *)(& nesdev->cqp_pending_reqs)); if (tmp___1 != 0) { tmp = nesdev->cqp.sq_head; nesdev->cqp.sq_head = (u16 )((int )nesdev->cqp.sq_head + 1); cqp_head = (u32 )tmp; nesdev->cqp.sq_head = (u16 )((int )((short )nesdev->cqp.sq_head) & (int )((short )((unsigned int )nesdev->cqp.sq_size + 65535U))); cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; memcpy((void *)cqp_wqe, (void const *)(& cqp_request->cqp_wqe), 64UL); opcode = cqp_wqe->wqe_words[0]; if ((opcode & 63U) == 16U) { ctx_index = 1; } else { } __asm__ volatile ("": : : "memory"); u64temp = (u64 )cqp_request; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), (u32 )ctx_index, u64temp); if ((nes_debug_level & 512U) != 0U) { tmp___0 = atomic_read((atomic_t const *)(& cqp_request->refcount)); printk("\viw_nes: %s[%u]: CQP request (opcode 0x%02X), line 1 = 0x%08X put on CQPs SQ, request = %p, cqp_head = %u, cqp_tail = %u, cqp_size = %u, waiting = %d, refcount = %d.\n", "nes_post_cqp_request", 658, opcode & 63U, cqp_wqe->wqe_words[1], cqp_request, (int )nesdev->cqp.sq_head, (int )nesdev->cqp.sq_tail, (int )nesdev->cqp.sq_size, (int )cqp_request->waiting, tmp___0); } else { } __asm__ volatile ("": : : "memory"); nes_write32(nesdev->regs + 64UL, (u32 )((int )nesdev->cqp.qp_id | 25165824)); __asm__ volatile ("": : : "memory"); } else { goto _L; } } else { _L: /* CIL Label */ if ((nes_debug_level & 512U) != 0U) { printk("\viw_nes: %s[%u]: CQP request %p (opcode 0x%02X), line 1 = 0x%08X put on the pending queue.\n", "nes_post_cqp_request", 671, cqp_request, cqp_request->cqp_wqe.wqe_words[0] & 63U, cqp_request->cqp_wqe.wqe_words[1]); } else { } list_add_tail(& cqp_request->list, & nesdev->cqp_pending_reqs); } spin_unlock_irqrestore(& nesdev->cqp.lock, flags); return; } } int nes_arp_table(struct nes_device *nesdev , u32 ip_addr , u8 *mac_addr , u32 action ) { struct nes_adapter *nesadapter ; int arp_index ; int err ; __be32 tmp_addr ; __u32 tmp ; { nesadapter = nesdev->nesadapter; err = 0; arp_index = 0; goto ldv_61045; ldv_61044: ; if (nesadapter->arp_table[arp_index].ip_addr == ip_addr) { goto ldv_61043; } else { } arp_index = arp_index + 1; ldv_61045: ; if ((unsigned int )arp_index < nesadapter->arp_table_size) { goto ldv_61044; } else { } ldv_61043: ; if (action == 1U) { if ((u32 )arp_index != nesadapter->arp_table_size) { return (-1); } else { } arp_index = 0; err = nes_alloc_resource(nesadapter, nesadapter->allocated_arps, nesadapter->arp_table_size, (u32 *)(& arp_index), & nesadapter->next_arp_index, 8); if (err != 0) { if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: nes_alloc_resource returned error = %u\n", "nes_arp_table", 704, err); } else { } return (err); } else { } if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: ADD, arp_index=%d\n", "nes_arp_table", 707, arp_index); } else { } nesadapter->arp_table[arp_index].ip_addr = ip_addr; memcpy((void *)(& nesadapter->arp_table[arp_index].mac_addr), (void const *)mac_addr, 6UL); return (arp_index); } else { } if ((u32 )arp_index == nesadapter->arp_table_size) { tmp = __fswab32(ip_addr); tmp_addr = tmp; if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: MAC for %pI4 not in ARP table - cannot %s\n", "nes_arp_table", 718, & tmp_addr, action == 3U ? (char *)"resolve" : (char *)"delete"); } else { } return (-1); } else { } if (action == 3U) { if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: RESOLVE, arp_index=%d\n", "nes_arp_table", 723, arp_index); } else { } return (arp_index); } else { } if (action == 2U) { if ((nes_debug_level & 16U) != 0U) { printk("\viw_nes: %s[%u]: DELETE, arp_index=%d\n", "nes_arp_table", 728, arp_index); } else { } nesadapter->arp_table[arp_index].ip_addr = 0U; memset((void *)(& nesadapter->arp_table[arp_index].mac_addr), 0, 6UL); nes_free_resource___0(nesadapter, nesadapter->allocated_arps, (u32 )arp_index); return (arp_index); } else { } return (-1); } } void nes_mh_fix(unsigned long parm ) { unsigned long flags ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_vnic *nesvnic ; u32 used_chunks_tx ; u32 temp_used_chunks_tx ; u32 temp_last_used_chunks_tx ; u32 used_chunks_mask ; u32 mac_tx_frames_low ; u32 mac_tx_frames_high ; u32 mac_tx_pauses ; u32 serdes_status ; u32 reset_value ; u32 tx_control ; u32 tx_config ; u32 tx_pause_quanta ; u32 rx_control ; u32 rx_config ; u32 mac_exact_match ; u32 mpp_debug ; u32 i ; u32 chunks_tx_progress ; void *tmp ; u32 tmp___0 ; u32 tmp___1 ; { nesdev = (struct nes_device *)parm; nesadapter = nesdev->nesadapter; i = 0U; chunks_tx_progress = 0U; ldv_spin_lock(); if ((unsigned int )nesadapter->mac_sw_state[0] != 0U || (unsigned int )nesadapter->mac_link_down[0] != 0U) { spin_unlock_irqrestore(& nesadapter->phy_lock, flags); goto no_mh_work; } else { } nesadapter->mac_sw_state[0] = 2U; spin_unlock_irqrestore(& nesadapter->phy_lock, flags); mac_tx_frames_low = nes_read_indexed___2(nesdev, 8456U); mac_tx_frames_high = nes_read_indexed___2(nesdev, 8460U); mac_tx_pauses = nes_read_indexed___2(nesdev, 8472U); used_chunks_tx = nes_read_indexed___2(nesdev, 24752U); nesdev->mac_pause_frames_sent = nesdev->mac_pause_frames_sent + (unsigned long )mac_tx_pauses; used_chunks_mask = 0U; temp_used_chunks_tx = used_chunks_tx; temp_last_used_chunks_tx = nesdev->last_used_chunks_tx; if ((unsigned long )nesdev->netdev[0] != (unsigned long )((struct net_device *)0)) { tmp = netdev_priv((struct net_device const *)nesdev->netdev[0]); nesvnic = (struct nes_vnic *)tmp; } else { goto ldv_61073; } i = 0U; goto ldv_61075; ldv_61074: used_chunks_mask = used_chunks_mask << 8; if ((unsigned int )nesvnic->qp_nic_index[i] != 255U) { used_chunks_mask = used_chunks_mask | 255U; if ((temp_used_chunks_tx & 255U) < (temp_last_used_chunks_tx & 255U)) { chunks_tx_progress = 1U; } else { } } else { } temp_used_chunks_tx = temp_used_chunks_tx >> 8; temp_last_used_chunks_tx = temp_last_used_chunks_tx >> 8; i = i + 1U; ldv_61075: ; if (i <= 3U) { goto ldv_61074; } else { } if ((((mac_tx_frames_low != 0U || mac_tx_frames_high != 0U) || (used_chunks_tx & used_chunks_mask) == 0U) || (nesdev->last_used_chunks_tx & used_chunks_mask) == 0U) || chunks_tx_progress != 0U) { nesdev->last_used_chunks_tx = used_chunks_tx; goto ldv_61073; } else { } nesdev->last_used_chunks_tx = used_chunks_tx; __asm__ volatile ("": : : "memory"); nes_write_indexed___2(nesdev, 8192U, 5U); mh_pauses_sent = mh_pauses_sent + 1U; mac_tx_pauses = nes_read_indexed___2(nesdev, 8472U); if (mac_tx_pauses != 0U) { nesdev->mac_pause_frames_sent = nesdev->mac_pause_frames_sent + (unsigned long )mac_tx_pauses; goto ldv_61073; } else { } tx_control = nes_read_indexed___2(nesdev, 8192U); tx_config = nes_read_indexed___2(nesdev, 8196U); tx_pause_quanta = nes_read_indexed___2(nesdev, 8200U); rx_control = nes_read_indexed___2(nesdev, 8204U); rx_config = nes_read_indexed___2(nesdev, 8208U); mac_exact_match = nes_read_indexed___2(nesdev, 8220U); mpp_debug = nes_read_indexed___2(nesdev, 2560U); mac_tx_pauses = nes_read_indexed___2(nesdev, 8472U); if (mac_tx_pauses != 0U) { nesdev->last_mac_tx_pauses = (u32 )nesdev->mac_pause_frames_sent; if ((int )nes_debug_level & 1) { printk("\viw_nes: %s[%u]: failsafe caught slow outbound pause\n", "nes_mh_fix", 831); } else { } goto ldv_61073; } else { } mh_detected = mh_detected + 1U; nes_write_indexed___2(nesdev, 8192U, 0U); nes_write_indexed___2(nesdev, 8196U, 0U); reset_value = nes_read32((void const *)nesdev->regs + 48U); nes_write32(nesdev->regs + 48UL, reset_value | 29U); goto ldv_61079; ldv_61078: ; ldv_61079: tmp___0 = nes_read32((void const *)nesdev->regs + 48U); if ((tmp___0 & 64U) == 0U) { tmp___1 = i; i = i + 1U; if (tmp___1 <= 4999U) { goto ldv_61078; } else { goto ldv_61080; } } else { } ldv_61080: nes_write_indexed___2(nesdev, 10248U, 8U); serdes_status = nes_read_indexed___2(nesdev, 10252U); nes_write_indexed___2(nesdev, 10256U, 777975U); nes_write_indexed___2(nesdev, 10260U, 2632396800U); nes_write_indexed___2(nesdev, 10264U, 267386880U); nes_write_indexed___2(nesdev, 10268U, 0U); nes_write_indexed___2(nesdev, 10272U, 0U); nes_write_indexed___2(nesdev, 10276U, 0U); if ((unsigned int )nesadapter->OneG_Mode != 0U) { nes_write_indexed___2(nesdev, 10280U, 4028113442U); } else { nes_write_indexed___2(nesdev, 10280U, 4026802722U); } serdes_status = nes_read_indexed___2(nesdev, 10284U); nes_write_indexed___2(nesdev, 10292U, 255U); nes_write_indexed___2(nesdev, 8192U, tx_control); nes_write_indexed___2(nesdev, 8196U, tx_config); nes_write_indexed___2(nesdev, 8200U, tx_pause_quanta); nes_write_indexed___2(nesdev, 8204U, rx_control); nes_write_indexed___2(nesdev, 8208U, rx_config); nes_write_indexed___2(nesdev, 8220U, mac_exact_match); nes_write_indexed___2(nesdev, 2560U, mpp_debug); ldv_61073: nesadapter->mac_sw_state[0] = 0U; no_mh_work: (nesdev->nesadapter)->mh_timer.expires = (unsigned long )jiffies + 50UL; add_timer(& (nesdev->nesadapter)->mh_timer); return; } } void nes_clc(unsigned long parm ) { unsigned long flags ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; { nesdev = (struct nes_device *)parm; nesadapter = nesdev->nesadapter; ldv_spin_lock(); nesadapter->link_interrupt_count[0] = 0U; nesadapter->link_interrupt_count[1] = 0U; nesadapter->link_interrupt_count[2] = 0U; nesadapter->link_interrupt_count[3] = 0U; spin_unlock_irqrestore(& nesadapter->phy_lock, flags); nesadapter->lc_timer.expires = (unsigned long )jiffies + 900000UL; add_timer(& nesadapter->lc_timer); return; } } void nes_dump_mem(unsigned int dump_debug_level , void *addr , int length ) { char xlate[16U] ; char *ptr ; char hex_buf[80U] ; char ascii_buf[20U] ; int num_char ; int num_ascii ; int num_hex ; 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 ; { xlate[0] = 48; xlate[1] = 49; xlate[2] = 50; xlate[3] = 51; xlate[4] = 52; xlate[5] = 53; xlate[6] = 54; xlate[7] = 55; xlate[8] = 56; xlate[9] = 57; xlate[10] = 97; xlate[11] = 98; xlate[12] = 99; xlate[13] = 100; xlate[14] = 101; xlate[15] = 102; if ((nes_debug_level & dump_debug_level) == 0U) { return; } else { } ptr = (char *)addr; if (length > 256) { if ((dump_debug_level & nes_debug_level) != 0U) { printk("\viw_nes: %s[%u]: Length truncated from %x to %x\n", "nes_dump_mem", 921, length, 256); } else { } length = 256; } else { } if ((dump_debug_level & nes_debug_level) != 0U) { printk("\viw_nes: %s[%u]: Address=0x%p, length=0x%x (%d)\n", "nes_dump_mem", 924, ptr, length, length); } else { } memset((void *)(& ascii_buf), 0, 20UL); memset((void *)(& hex_buf), 0, 80UL); num_ascii = 0; num_hex = 0; num_char = 0; goto ldv_61101; ldv_61100: ; if (num_ascii == 8) { tmp = num_ascii; num_ascii = num_ascii + 1; ascii_buf[tmp] = 32; tmp___0 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___0] = 45; tmp___1 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___1] = 32; } else { } if ((int )((signed char )*ptr) <= 31 || (int )((signed char )*ptr) == 127) { tmp___2 = num_ascii; num_ascii = num_ascii + 1; ascii_buf[tmp___2] = 46; } else { tmp___3 = num_ascii; num_ascii = num_ascii + 1; ascii_buf[tmp___3] = *ptr; } tmp___4 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___4] = xlate[((int )*ptr & 240) >> 4]; tmp___5 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___5] = xlate[(int )*ptr & 15]; tmp___6 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___6] = 32; ptr = ptr + 1; if (num_ascii > 16) { if ((dump_debug_level & nes_debug_level) != 0U) { printk("\viw_nes: %s[%u]: %s | %s\n", "nes_dump_mem", 949, (char *)(& hex_buf), (char *)(& ascii_buf)); } else { } memset((void *)(& ascii_buf), 0, 20UL); memset((void *)(& hex_buf), 0, 80UL); num_ascii = 0; num_hex = 0; } else { } num_char = num_char + 1; ldv_61101: ; if (num_char < length) { goto ldv_61100; } else { } if (num_ascii != 0) { goto ldv_61104; ldv_61103: ; if (num_ascii == 8) { tmp___7 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___7] = 32; tmp___8 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___8] = 32; } else { } tmp___9 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___9] = 32; tmp___10 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___10] = 32; tmp___11 = num_hex; num_hex = num_hex + 1; hex_buf[tmp___11] = 32; num_ascii = num_ascii + 1; ldv_61104: ; if (num_ascii <= 16) { goto ldv_61103; } else { } if ((dump_debug_level & nes_debug_level) != 0U) { printk("\viw_nes: %s[%u]: %s | %s\n", "nes_dump_mem", 970, (char *)(& hex_buf), (char *)(& ascii_buf)); } else { } } else { } return; } } bool ldv_queue_work_on_186(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_187(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_188(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___4 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_189(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_190(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___5 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void *ldv_kmem_cache_alloc_196(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_pskb_expand_head_202(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_204(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv_skb_copy_206(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_207(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_208(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_209(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } int ldv_pskb_expand_head_210(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } int ldv_pskb_expand_head_211(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_212(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } void *ldv_kmem_cache_alloc_213(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern uint16_t __cachemode2pte_tbl[8U] ; __inline static unsigned long cachemode2protval(enum page_cache_mode pcm ) { long tmp ; { tmp = ldv__builtin_expect((unsigned int )pcm == 0U, 1L); if (tmp != 0L) { return (0UL); } else { } return ((unsigned long )__cachemode2pte_tbl[(unsigned int )pcm]); } } extern void __might_fault(char const * , int ) ; extern int sprintf(char * , char const * , ...) ; bool ldv_is_err(void const *ptr ) ; void *ldv_err_ptr(long error ) ; __inline static void *ERR_PTR(long error ) ; __inline static bool IS_ERR(void const *ptr ) ; extern struct cpuinfo_x86 boot_cpu_data ; __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) ; int ldv_del_timer_261(struct timer_list *ldv_func_arg1 ) ; int ldv_mod_timer_262(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; bool ldv_queue_work_on_233(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_235(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_234(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_237(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_236(struct workqueue_struct *ldv_func_arg1 ) ; __inline static phys_addr_t virt_to_phys(void volatile *address ) { unsigned long tmp ; { tmp = __phys_addr((unsigned long )address); return ((phys_addr_t )tmp); } } void *ldv_kmem_cache_alloc_243(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_260(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; void activate_pending_timer_9(struct timer_list *timer , unsigned long data , int pending_flag ) ; int reg_timer_9(struct timer_list *timer ) ; void disable_suitable_timer_9(struct timer_list *timer ) ; void choose_timer_9(struct timer_list *timer ) ; extern void get_random_bytes(void * , int ) ; extern int remap_pfn_range(struct vm_area_struct * , unsigned long , unsigned long , unsigned long , pgprot_t ) ; extern unsigned long _copy_from_user(void * , void const * , unsigned int ) ; extern unsigned long _copy_to_user(void * , void const * , unsigned int ) ; extern void __copy_from_user_overflow(void) ; extern void __copy_to_user_overflow(void) ; __inline static unsigned long copy_from_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; long tmp___0 ; { tmp = __builtin_object_size((void const *)to, 0); sz = (int )tmp; __might_fault("./arch/x86/include/asm/uaccess.h", 697); tmp___0 = ldv__builtin_expect((long )(sz < 0 || (unsigned long )sz >= n), 1L); if (tmp___0 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { __copy_from_user_overflow(); } return (n); } } __inline static unsigned long copy_to_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; long tmp___0 ; { tmp = __builtin_object_size(from, 0); sz = (int )tmp; __might_fault("./arch/x86/include/asm/uaccess.h", 732); tmp___0 = ldv__builtin_expect((long )(sz < 0 || (unsigned long )sz >= n), 1L); if (tmp___0 != 0L) { n = _copy_to_user(to, from, (unsigned int )n); } else { __copy_to_user_overflow(); } return (n); } } __inline static void *kmap(struct page *page ) { void *tmp ; { __might_sleep("include/linux/highmem.h", 58, 0); tmp = lowmem_page_address((struct page const *)page); return (tmp); } } __inline static void kunmap(struct page *page ) { { return; } } extern int device_create_file(struct device * , struct device_attribute const * ) ; extern void device_remove_file(struct device * , struct device_attribute const * ) ; __inline static struct page *sg_page(struct scatterlist *sg ) { long tmp ; long tmp___0 ; { tmp = ldv__builtin_expect(sg->sg_magic != 2271560481UL, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (123), "i" (12UL)); ldv_29948: ; goto ldv_29948; } else { } tmp___0 = ldv__builtin_expect((long )((int )sg->page_link) & 1L, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (124), "i" (12UL)); ldv_29949: ; goto ldv_29949; } else { } return ((struct page *)(sg->page_link & 0xfffffffffffffffcUL)); } } extern struct scatterlist *sg_next(struct scatterlist * ) ; extern void *dma_alloc_attrs(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ) ; __inline static void *dma_zalloc_coherent(struct device *dev , size_t size , dma_addr_t *dma_handle , gfp_t flags ) ; extern struct ib_device *ib_alloc_device(size_t ) ; extern void ib_dealloc_device(struct ib_device * ) ; extern int ib_register_device(struct ib_device * , int (*)(struct ib_device * , u8 , struct kobject * ) ) ; extern void ib_unregister_device(struct ib_device * ) ; __inline static int ib_copy_from_udata(void *dest , struct ib_udata *udata , size_t len ) { unsigned long tmp ; { tmp = copy_from_user(dest, udata->inbuf, len); return (tmp != 0UL ? -14 : 0); } } __inline static int ib_copy_to_udata(struct ib_udata *udata , void *src , size_t len ) { unsigned long tmp ; { tmp = copy_to_user(udata->outbuf, (void const *)src, len); return (tmp != 0UL ? -14 : 0); } } extern void ib_dispatch_event(struct ib_event * ) ; struct sk_buff *ldv_skb_clone_251(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_259(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_253(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_249(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_257(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_258(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_254(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_255(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_256(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; extern int netdev_refcnt_read(struct net_device const * ) ; __inline static void *pci_alloc_consistent(struct pci_dev *hwdev , size_t size , dma_addr_t *dma_handle ) { void *tmp ; { tmp = dma_alloc_attrs((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, size, dma_handle, 32U, (struct dma_attrs *)0); return (tmp); } } __inline static void *pci_zalloc_consistent___0(struct pci_dev *hwdev , size_t size , dma_addr_t *dma_handle ) { void *tmp ; { tmp = dma_zalloc_coherent((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, size, dma_handle, 32U); return (tmp); } } int nes_accept(struct iw_cm_id *cm_id , struct iw_cm_conn_param *conn_param ) ; int nes_reject(struct iw_cm_id *cm_id , void const *pdata , u8 pdata_len ) ; int nes_connect(struct iw_cm_id *cm_id , struct iw_cm_conn_param *conn_param ) ; int nes_create_listen(struct iw_cm_id *cm_id , int backlog ) ; int nes_destroy_listen(struct iw_cm_id *cm_id ) ; atomic_t mod_qp_timouts ; atomic_t qps_created ; atomic_t sw_qps_destroyed ; __inline static void nes_fill_init_qp_wqe(struct nes_hw_qp_wqe *wqe , struct nes_qp *nesqp , u32 head ) { u32 value ; { value = (unsigned int )((long )nesqp) | head; set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 3U, (unsigned int )((unsigned long )nesqp >> 32UL)); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 2U, value); return; } } __inline static int nes_alloc_resource___0(struct nes_adapter *nesadapter , unsigned long *resource_array , u32 max_resources , u32 *req_resource_num , u32 *next , enum nes_resource resource_type___0 ) { unsigned long flags ; u32 resource_num ; unsigned long tmp ; unsigned long tmp___0 ; { ldv_spin_lock(); tmp = find_next_zero_bit((unsigned long const *)resource_array, (unsigned long )max_resources, (unsigned long )*next); resource_num = (u32 )tmp; if (resource_num >= max_resources) { tmp___0 = find_first_zero_bit((unsigned long const *)resource_array, (unsigned long )max_resources); resource_num = (u32 )tmp___0; if (resource_num >= max_resources) { printk("\viw_nes: %s: No available resources [type=%u].\n", "nes_alloc_resource", (unsigned int )resource_type___0); spin_unlock_irqrestore(& nesadapter->resource_lock, flags); return (-24); } else { } } else { } set_bit((long )resource_num, (unsigned long volatile *)resource_array); *next = resource_num + 1U; if (*next == max_resources) { *next = 0U; } else { } spin_unlock_irqrestore(& nesadapter->resource_lock, flags); *req_resource_num = resource_num; return (0); } } __inline static void nes_free_resource___1(struct nes_adapter *nesadapter , unsigned long *resource_array , u32 resource_num ) { unsigned long flags ; { ldv_spin_lock(); clear_bit((long )resource_num, (unsigned long volatile *)resource_array); spin_unlock_irqrestore(& nesadapter->resource_lock, flags); return; } } __inline static struct nes_pd *to_nespd(struct ib_pd *ibpd ) { struct ib_pd const *__mptr ; { __mptr = (struct ib_pd const *)ibpd; return ((struct nes_pd *)__mptr); } } __inline static struct nes_ucontext *to_nesucontext(struct ib_ucontext *ibucontext ) { struct ib_ucontext const *__mptr ; { __mptr = (struct ib_ucontext const *)ibucontext; return ((struct nes_ucontext *)__mptr); } } __inline static struct nes_mr *to_nesmr(struct ib_mr *ibmr ) { struct ib_mr const *__mptr ; { __mptr = (struct ib_mr const *)ibmr; return ((struct nes_mr *)__mptr); } } __inline static struct nes_mr *to_nesmw(struct ib_mw *ibmw ) { struct ib_mw const *__mptr ; { __mptr = (struct ib_mw const *)ibmw; return ((struct nes_mr *)__mptr); } } __inline static struct nes_cq *to_nescq(struct ib_cq *ibcq ) { struct ib_cq const *__mptr ; { __mptr = (struct ib_cq const *)ibcq; return ((struct nes_cq *)__mptr); } } int nes_modify_qp(struct ib_qp *ibqp , struct ib_qp_attr *attr , int attr_mask , struct ib_udata *udata ) ; __inline static int ib_umem_offset(struct ib_umem *umem ) { { return ((int )((unsigned int )umem->address & ((unsigned int )umem->page_size - 1U))); } } extern struct ib_umem *ib_umem_get(struct ib_ucontext * , unsigned long , size_t , int , int ) ; extern void ib_umem_release(struct ib_umem * ) ; static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev ) ; static struct ib_mw *nes_alloc_mw(struct ib_pd *ibpd , enum ib_mw_type type ) { struct nes_pd *nespd ; struct nes_pd *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_cqp_request *cqp_request ; struct nes_mr *nesmr ; struct ib_mw *ibmw ; struct nes_hw_cqp_wqe *cqp_wqe ; int ret ; u32 stag ; u32 stag_index ; u32 next_stag_index ; u32 driver_key ; u8 stag_key ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___6 ; bool __cond ; bool __cond___0 ; void *tmp___7 ; void *tmp___8 ; { tmp = to_nespd(ibpd); nespd = tmp; tmp___0 = to_nesvnic(ibpd->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; stag_index = 0U; next_stag_index = 0U; driver_key = 0U; stag_key = 0U; if ((unsigned int )type != 1U) { tmp___1 = ERR_PTR(-22L); return ((struct ib_mw *)tmp___1); } else { } get_random_bytes((void *)(& next_stag_index), 4); stag_key = (unsigned char )next_stag_index; driver_key = 0U; next_stag_index = next_stag_index >> 8; next_stag_index = next_stag_index % nesadapter->max_mr; ret = nes_alloc_resource___0(nesadapter, nesadapter->allocated_mrs, nesadapter->max_mr, & stag_index, & next_stag_index, 1); if (ret != 0) { tmp___2 = ERR_PTR((long )ret); return ((struct ib_mw *)tmp___2); } else { } tmp___3 = kzalloc(56UL, 208U); nesmr = (struct nes_mr *)tmp___3; if ((unsigned long )nesmr == (unsigned long )((struct nes_mr *)0)) { nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); tmp___4 = ERR_PTR(-12L); return ((struct ib_mw *)tmp___4); } else { } stag = stag_index << 8; stag = stag | driver_key; stag = (u32 )stag_key + stag; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Registering STag 0x%08X, index = 0x%08X\n", "nes_alloc_mw", 103, stag, stag_index); } else { } cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { kfree((void const *)nesmr); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); tmp___5 = ERR_PTR(-12L); return ((struct ib_mw *)tmp___5); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; cqp_wqe->wqe_words[0] = 2884105U; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, (u32 )nespd->pd_id & 32767U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 8U, stag); atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 130, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61691: tmp___6 = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp___6; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61690; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61691; ldv_61690: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Register STag 0x%08X completed, wait_event_timeout ret = %u, CQP Major:Minor codes = 0x%04X:0x%04X.\n", "nes_alloc_mw", 133, stag, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } if (ret == 0 || (unsigned int )cqp_request->major_code != 0U) { nes_put_cqp_request(nesdev, cqp_request); kfree((void const *)nesmr); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); if (ret == 0) { tmp___7 = ERR_PTR(-62L); return ((struct ib_mw *)tmp___7); } else { tmp___8 = ERR_PTR(-12L); return ((struct ib_mw *)tmp___8); } } else { } nes_put_cqp_request(nesdev, cqp_request); nesmr->__annonCompField126.ibmw.rkey = stag; nesmr->mode = 3U; ibmw = & nesmr->__annonCompField126.ibmw; nesmr->pbl_4k = 0U; nesmr->pbls_used = 0U; return (ibmw); } } static int nes_dealloc_mw(struct ib_mw *ibmw ) { struct nes_mr *nesmr ; struct nes_mr *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; int err ; int ret ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___1 ; bool __cond ; bool __cond___0 ; { tmp = to_nesmw(ibmw); nesmr = tmp; tmp___0 = to_nesvnic(ibmw->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; err = 0; cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_dealloc_mw", 173); } else { } return (-12); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, 13U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 8U, ibmw->rkey); atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for deallocate STag 0x%08X to complete.\n", "nes_dealloc_mw", 187, ibmw->rkey); } else { } __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 189, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61716: tmp___1 = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp___1; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61715; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61716; ldv_61715: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Deallocate STag completed, wait_event_timeout ret = %u, CQP Major:Minor codes = 0x%04X:0x%04X.\n", "nes_dealloc_mw", 192, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } if (ret == 0) { err = -62; } else if ((unsigned int )cqp_request->major_code != 0U) { err = -5; } else { } nes_put_cqp_request(nesdev, cqp_request); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, (ibmw->rkey & 268435200U) >> 8); kfree((void const *)nesmr); return (err); } } static int nes_bind_mw(struct ib_qp *ibqp , struct ib_mw *ibmw , struct ib_mw_bind *ibmw_bind ) { u64 u64temp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_qp *nesqp ; struct nes_qp *tmp___0 ; struct nes_hw_qp_wqe *wqe ; unsigned long flags ; u32 head ; u32 wqe_misc ; u32 qsize ; { tmp = to_nesvnic(ibqp->device); nesvnic = tmp; nesdev = nesvnic->nesdev; tmp___0 = to_nesqp(ibqp); nesqp = tmp___0; flags = 0UL; wqe_misc = 0U; if ((unsigned int )nesqp->ibqp_state > 3U) { return (-22); } else { } ldv_spin_lock(); head = (u32 )nesqp->hwqp.sq_head; qsize = (u32 )nesqp->hwqp.sq_tail; if (((qsize * 2U + head) - (u32 )nesqp->hwqp.sq_tail) % qsize == qsize - 1U) { spin_unlock_irqrestore(& nesqp->lock, flags); return (-12); } else { } wqe = nesqp->hwqp.sq_vbase + (unsigned long )head; nes_fill_init_qp_wqe(wqe, nesqp, head); u64temp = ibmw_bind->wr_id; set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 4U, u64temp); wqe_misc = 8U; wqe_misc = wqe_misc | 1073741824U; if ((ibmw_bind->send_flags & 2) != 0) { wqe_misc = wqe_misc | 2147483648U; } else { } if ((ibmw_bind->bind_info.mw_access_flags & 2) != 0) { wqe_misc = wqe_misc | 524288U; } else { } if ((ibmw_bind->bind_info.mw_access_flags & 4) != 0) { wqe_misc = wqe_misc | 262144U; } else { } set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 0U, wqe_misc); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 6U, (ibmw_bind->bind_info.mr)->lkey); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 7U, ibmw->rkey); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 8U, (u32 )ibmw_bind->bind_info.length); wqe->wqe_words[9] = 0U; u64temp = ibmw_bind->bind_info.addr; set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 10U, u64temp); head = head + 1U; if (head >= qsize) { head = 0U; } else { } nesqp->hwqp.sq_head = (u16 )head; __asm__ volatile ("": : : "memory"); nes_write32(nesdev->regs + 64UL, nesqp->hwqp.qp_id | 25165824U); spin_unlock_irqrestore(& nesqp->lock, flags); return (0); } } static int alloc_fast_reg_mr(struct nes_device *nesdev , struct nes_pd *nespd , u32 stag , u32 page_count___0 ) { struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; unsigned long flags ; int ret ; struct nes_adapter *nesadapter ; u32 opcode ; u16 major_code ; u64 region_length ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp ; bool __cond ; bool __cond___0 ; { nesadapter = nesdev->nesadapter; opcode = 0U; region_length = (u64 )((unsigned long )page_count___0 * 4096UL); cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "alloc_fast_reg_mr", 300); } else { } return (-12); } else { } if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: alloc_fast_reg_mr: page_count = %d, region_length = %llu\n", "alloc_fast_reg_mr", 305, page_count___0, region_length); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; ldv_spin_lock(); if (nesadapter->free_4kpbl != 0U) { nesadapter->free_4kpbl = nesadapter->free_4kpbl - 1U; spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); } else { spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Out of Pbls\n", "alloc_fast_reg_mr", 316); } else { } nes_free_cqp_request(nesdev, cqp_request); return (-12); } opcode = 2107913U; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, opcode); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, 1U); cqp_wqe->wqe_words[6] = (unsigned int )(region_length >> 8) & 4278190080U; cqp_wqe->wqe_words[6] = cqp_wqe->wqe_words[6] | ((__le32 )nespd->pd_id & 32767U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 8U, stag); set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 10U, 0ULL); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 7U, 0U); set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 12U, 0ULL); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 14U, page_count___0 * 8U); cqp_wqe->wqe_words[0] = cqp_wqe->wqe_words[0] | 2048U; __asm__ volatile ("": : : "memory"); atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 355, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61758: tmp = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61757; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61758; ldv_61757: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Allocate STag 0x%08X completed, wait_event_timeout ret = %u, CQP Major:Minor codes = 0x%04X:0x%04X.\n", "alloc_fast_reg_mr", 360, stag, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } major_code = cqp_request->major_code; nes_put_cqp_request(nesdev, cqp_request); if (ret == 0 || (unsigned int )major_code != 0U) { ldv_spin_lock(); nesadapter->free_4kpbl = nesadapter->free_4kpbl + 1U; spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); } else { } if (ret == 0) { return (-62); } else if ((unsigned int )major_code != 0U) { return (-5); } else { } return (0); } } static struct ib_mr *nes_alloc_fast_reg_mr(struct ib_pd *ibpd , int max_page_list_len ) { struct nes_pd *nespd ; struct nes_pd *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; u32 next_stag_index ; u8 stag_key ; u32 driver_key ; int err ; u32 stag_index ; struct nes_mr *nesmr ; u32 stag ; int ret ; struct ib_mr *ibmr ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; { tmp = to_nespd(ibpd); nespd = tmp; tmp___0 = to_nesvnic(ibpd->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; stag_key = 0U; driver_key = 0U; err = 0; stag_index = 0U; if ((unsigned int )max_page_list_len > 512U) { tmp___1 = ERR_PTR(-7L); return ((struct ib_mr *)tmp___1); } else { } get_random_bytes((void *)(& next_stag_index), 4); stag_key = (unsigned char )next_stag_index; next_stag_index = next_stag_index >> 8; next_stag_index = next_stag_index % nesadapter->max_mr; err = nes_alloc_resource___0(nesadapter, nesadapter->allocated_mrs, nesadapter->max_mr, & stag_index, & next_stag_index, 2); if (err != 0) { tmp___2 = ERR_PTR((long )err); return ((struct ib_mr *)tmp___2); } else { } tmp___3 = kzalloc(56UL, 208U); nesmr = (struct nes_mr *)tmp___3; if ((unsigned long )nesmr == (unsigned long )((struct nes_mr *)0)) { nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); tmp___4 = ERR_PTR(-12L); return ((struct ib_mr *)tmp___4); } else { } stag = stag_index << 8; stag = stag | driver_key; stag = (u32 )stag_key + stag; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Allocating STag 0x%08X index = 0x%08X\n", "nes_alloc_fast_reg_mr", 425, stag, stag_index); } else { } ret = alloc_fast_reg_mr(nesdev, nespd, stag, (u32 )max_page_list_len); if (ret == 0) { nesmr->__annonCompField126.ibmr.rkey = stag; nesmr->__annonCompField126.ibmr.lkey = stag; nesmr->mode = 5U; ibmr = & nesmr->__annonCompField126.ibmr; } else { kfree((void const *)nesmr); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); tmp___5 = ERR_PTR(-12L); ibmr = (struct ib_mr *)tmp___5; } return (ibmr); } } static struct ib_fast_reg_page_list *nes_alloc_fast_reg_page_list(struct ib_device *ibdev , int page_list_len ) { struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct ib_fast_reg_page_list *pifrpl ; struct nes_ib_fast_reg_page_list *pnesfrpl ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; { tmp = to_nesvnic(ibdev); nesvnic = tmp; nesdev = nesvnic->nesdev; if ((unsigned int )page_list_len > 512U) { tmp___0 = ERR_PTR(-7L); return ((struct ib_fast_reg_page_list *)tmp___0); } else { } tmp___1 = kzalloc(((unsigned long )page_list_len + 6UL) * 8UL, 208U); pnesfrpl = (struct nes_ib_fast_reg_page_list *)tmp___1; if ((unsigned long )pnesfrpl == (unsigned long )((struct nes_ib_fast_reg_page_list *)0)) { tmp___2 = ERR_PTR(-12L); return ((struct ib_fast_reg_page_list *)tmp___2); } else { } pifrpl = & pnesfrpl->ibfrpl; pifrpl->page_list = & pnesfrpl->pbl; pifrpl->max_page_list_len = (unsigned int )page_list_len; tmp___3 = pci_alloc_consistent(nesdev->pcidev, (unsigned long )page_list_len * 8UL, & pnesfrpl->nes_wqe_pbl.paddr); pnesfrpl->nes_wqe_pbl.kva = (u64 *)tmp___3; if ((unsigned long )pnesfrpl->nes_wqe_pbl.kva == (unsigned long )((u64 *)0ULL)) { kfree((void const *)pnesfrpl); tmp___4 = ERR_PTR(-12L); return ((struct ib_fast_reg_page_list *)tmp___4); } else { } if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: nes_alloc_fast_reg_pbl: nes_frpl = %p, ibfrpl = %p, ibfrpl.page_list = %p, pbl.kva = %p, pbl.paddr = %llx\n", "nes_alloc_fast_reg_page_list", 484, pnesfrpl, & pnesfrpl->ibfrpl, pnesfrpl->ibfrpl.page_list, pnesfrpl->nes_wqe_pbl.kva, pnesfrpl->nes_wqe_pbl.paddr); } else { } return (pifrpl); } } static void nes_free_fast_reg_page_list(struct ib_fast_reg_page_list *pifrpl ) { struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_ib_fast_reg_page_list *pnesfrpl ; struct ib_fast_reg_page_list const *__mptr ; { tmp = to_nesvnic(pifrpl->device); nesvnic = tmp; nesdev = nesvnic->nesdev; __mptr = (struct ib_fast_reg_page_list const *)pifrpl; pnesfrpl = (struct nes_ib_fast_reg_page_list *)__mptr; pci_free_consistent(nesdev->pcidev, (unsigned long )pifrpl->max_page_list_len * 8UL, (void *)pnesfrpl->nes_wqe_pbl.kva, pnesfrpl->nes_wqe_pbl.paddr); kfree((void const *)pnesfrpl); return; } } static int nes_query_device(struct ib_device *ibdev , struct ib_device_attr *props , struct ib_udata *uhw ) { struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_ib_device *nesibdev ; { tmp = to_nesvnic(ibdev); nesvnic = tmp; nesdev = nesvnic->nesdev; nesibdev = nesvnic->nesibdev; if (uhw->inlen != 0UL || uhw->outlen != 0UL) { return (-22); } else { } memset((void *)props, 0, 224UL); memcpy((void *)(& props->sys_image_guid), (void const *)(nesvnic->netdev)->dev_addr, 6UL); props->fw_ver = (u64 )(nesdev->nesadapter)->firmware_version; props->device_cap_flags = (int )(nesdev->nesadapter)->device_cap_flags; props->vendor_id = (nesdev->nesadapter)->vendor_id; props->vendor_part_id = (nesdev->nesadapter)->vendor_part_id; props->hw_ver = (nesdev->nesadapter)->hw_rev; props->max_mr_size = 2147483648ULL; props->max_qp = (int )nesibdev->max_qp; props->max_qp_wr = (int )((nesdev->nesadapter)->max_qp_wr - 2U); props->max_sge = (int )(nesdev->nesadapter)->max_sge; props->max_cq = (int )nesibdev->max_cq; props->max_cqe = (int )(nesdev->nesadapter)->max_cqe; props->max_mr = (int )nesibdev->max_mr; props->max_mw = (int )nesibdev->max_mr; props->max_pd = (int )nesibdev->max_pd; props->max_sge_rd = 1; switch ((int )(nesdev->nesadapter)->max_irrq_wr) { case 0: props->max_qp_rd_atom = 2; goto ldv_61805; case 1: props->max_qp_rd_atom = 8; goto ldv_61805; case 2: props->max_qp_rd_atom = 32; goto ldv_61805; case 3: props->max_qp_rd_atom = 64; goto ldv_61805; default: props->max_qp_rd_atom = 0; } ldv_61805: props->max_qp_init_rd_atom = props->max_qp_rd_atom; props->atomic_cap = 0; props->max_map_per_fmr = 1; return (0); } } static int nes_query_port(struct ib_device *ibdev , u8 port , struct ib_port_attr *props ) { struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct net_device *netdev ; bool tmp___0 ; { tmp = to_nesvnic(ibdev); nesvnic = tmp; netdev = nesvnic->netdev; memset((void *)props, 0, 48UL); props->max_mtu = 5; if (netdev->mtu > 4095U) { props->active_mtu = 5; } else if (netdev->mtu > 2047U) { props->active_mtu = 4; } else if (netdev->mtu > 1023U) { props->active_mtu = 3; } else if (netdev->mtu > 511U) { props->active_mtu = 2; } else { props->active_mtu = 1; } props->lid = 1U; props->lmc = 0U; props->sm_lid = 0U; props->sm_sl = 0U; tmp___0 = netif_queue_stopped((struct net_device const *)netdev); if ((int )tmp___0) { props->state = 1; } else if ((unsigned int )nesvnic->linkup != 0U) { props->state = 4; } else { props->state = 1; } props->phys_state = 0U; props->port_cap_flags = 9764864U; props->gid_tbl_len = 1; props->pkey_tbl_len = 1U; props->qkey_viol_cntr = 0U; props->active_width = 2U; props->active_speed = 1U; props->max_msg_sz = 2147483648U; return (0); } } static int nes_query_pkey(struct ib_device *ibdev , u8 port , u16 index , u16 *pkey ) { { *pkey = 0U; return (0); } } static int nes_query_gid(struct ib_device *ibdev , u8 port , int index , union ib_gid *gid ) { struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; { tmp = to_nesvnic(ibdev); nesvnic = tmp; memset((void *)(& gid->raw), 0, 16UL); memcpy((void *)(& gid->raw), (void const *)(nesvnic->netdev)->dev_addr, 6UL); return (0); } } static struct ib_ucontext *nes_alloc_ucontext(struct ib_device *ibdev , struct ib_udata *udata ) { struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_alloc_ucontext_req req ; struct nes_alloc_ucontext_resp uresp ; struct nes_ucontext *nes_ucontext ; struct nes_ib_device *nesibdev ; void *tmp___0 ; int tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; int tmp___6 ; { tmp = to_nesvnic(ibdev); nesvnic = tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; nesibdev = nesvnic->nesibdev; tmp___1 = ib_copy_from_udata((void *)(& req), udata, 8UL); if (tmp___1 != 0) { printk("\viw_nes: Invalid structure size on allocate user context.\n"); tmp___0 = ERR_PTR(-22L); return ((struct ib_ucontext *)tmp___0); } else { } if ((unsigned int )req.userspace_ver != 2U) { printk("\viw_nes: Invalid userspace driver version detected. Detected version %d, should be %d\n", (int )req.userspace_ver, 2); tmp___2 = ERR_PTR(-22L); return ((struct ib_ucontext *)tmp___2); } else { } memset((void *)(& uresp), 0, 16UL); uresp.max_qps = nesibdev->max_qp; uresp.max_pds = nesibdev->max_pd; uresp.wq_size = (nesdev->nesadapter)->max_qp_wr * 2U; uresp.virtwq = nesadapter->virtwq; uresp.kernel_ver = 2U; tmp___3 = kzalloc(42472UL, 208U); nes_ucontext = (struct nes_ucontext *)tmp___3; if ((unsigned long )nes_ucontext == (unsigned long )((struct nes_ucontext *)0)) { tmp___4 = ERR_PTR(-12L); return ((struct ib_ucontext *)tmp___4); } else { } nes_ucontext->nesdev = nesdev; nes_ucontext->mmap_wq_offset = (unsigned long )uresp.max_pds; nes_ucontext->mmap_cq_offset = nes_ucontext->mmap_wq_offset + (((unsigned long )uresp.max_qps + 16UL) * 256UL - 1UL) / 4096UL; tmp___6 = ib_copy_to_udata(udata, (void *)(& uresp), 16UL); if (tmp___6 != 0) { kfree((void const *)nes_ucontext); tmp___5 = ERR_PTR(-14L); return ((struct ib_ucontext *)tmp___5); } else { } INIT_LIST_HEAD(& nes_ucontext->cq_reg_mem_list); INIT_LIST_HEAD(& nes_ucontext->qp_reg_mem_list); atomic_set(& nes_ucontext->usecnt, 1); return (& nes_ucontext->ibucontext); } } static int nes_dealloc_ucontext(struct ib_ucontext *context ) { struct nes_ucontext *nes_ucontext ; struct nes_ucontext *tmp ; int tmp___0 ; { tmp = to_nesucontext(context); nes_ucontext = tmp; tmp___0 = atomic_dec_and_test(& nes_ucontext->usecnt); if (tmp___0 == 0) { return (0); } else { } kfree((void const *)nes_ucontext); return (0); } } static int nes_mmap(struct ib_ucontext *context , struct vm_area_struct *vma ) { unsigned long index ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_ucontext *nes_ucontext ; struct nes_qp *nesqp ; int tmp___0 ; phys_addr_t tmp___1 ; int tmp___2 ; int tmp___3 ; pgprot_t __constr_expr_0 ; unsigned long tmp___4 ; int tmp___5 ; { tmp = to_nesvnic(context->device); nesvnic = tmp; nesdev = nesvnic->nesdev; nes_ucontext = to_nesucontext(context); if (vma->vm_pgoff >= nes_ucontext->mmap_wq_offset) { index = (vma->vm_pgoff - nes_ucontext->mmap_wq_offset) * 4096UL; index = index / ((((unsigned long )(nesdev->nesadapter)->max_qp_wr + 16UL) * 256UL - 1UL) & 0xfffffffffffff000UL); tmp___0 = variable_test_bit((long )index, (unsigned long const volatile *)(& nes_ucontext->allocated_wqs)); if (tmp___0 == 0) { if ((nes_debug_level & 1024U) != 0U) { printk("\viw_nes: %s[%u]: wq %lu not allocated\n", "nes_mmap", 733, index); } else { } return (-14); } else { } nesqp = nes_ucontext->mmap_nesqp[index]; if ((unsigned long )nesqp == (unsigned long )((struct nes_qp *)0)) { if ((nes_debug_level & 1024U) != 0U) { printk("\viw_nes: %s[%u]: wq %lu has a NULL QP base.\n", "nes_mmap", 738, index); } else { } return (-14); } else { } tmp___1 = virt_to_phys((void volatile *)nesqp->hwqp.sq_vbase); tmp___2 = remap_pfn_range(vma, vma->vm_start, (unsigned long )(tmp___1 >> 12), vma->vm_end - vma->vm_start, vma->vm_page_prot); if (tmp___2 != 0) { if ((nes_debug_level & 1024U) != 0U) { printk("\viw_nes: %s[%u]: remap_pfn_range failed.\n", "nes_mmap", 745); } else { } return (-11); } else { } vma->vm_private_data = (void *)nesqp; return (0); } else { index = vma->vm_pgoff; tmp___3 = variable_test_bit((long )index, (unsigned long const volatile *)(& nes_ucontext->allocated_doorbells)); if (tmp___3 == 0) { return (-14); } else { } if ((unsigned int )boot_cpu_data.x86 > 3U) { tmp___4 = cachemode2protval(2); __constr_expr_0.pgprot = vma->vm_page_prot.pgprot | tmp___4; vma->vm_page_prot = __constr_expr_0; } else { vma->vm_page_prot = vma->vm_page_prot; } tmp___5 = remap_pfn_range(vma, vma->vm_start, (nesdev->doorbell_start + (unsigned long )(((int )nes_ucontext->mmap_db_index[index] - (int )nesdev->base_doorbell_index) * 4096)) >> 12, 4096UL, vma->vm_page_prot); if (tmp___5 != 0) { return (-11); } else { } vma->vm_private_data = (void *)nes_ucontext; return (0); } return (-38); } } static struct ib_pd *nes_alloc_pd(struct ib_device *ibdev , struct ib_ucontext *context , struct ib_udata *udata ) { struct nes_pd *nespd ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_ucontext *nesucontext ; struct nes_alloc_pd_resp uresp ; u32 pd_num ; int err ; int tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; unsigned long tmp___4 ; void *tmp___5 ; void *tmp___6 ; int tmp___7 ; { tmp = to_nesvnic(ibdev); nesvnic = tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; pd_num = 0U; if ((nes_debug_level & 4096U) != 0U) { tmp___0 = netdev_refcnt_read((struct net_device const *)nesvnic->netdev); printk("\viw_nes: %s[%u]: nesvnic=%p, netdev=%p %s, ibdev=%p, context=%p, netdev refcnt=%u\n", "nes_alloc_pd", 786, nesvnic, nesdev->netdev[0], (char *)(& (nesdev->netdev[0])->name), ibdev, context, tmp___0); } else { } err = nes_alloc_resource___0(nesadapter, nesadapter->allocated_pds, nesadapter->max_pd, & pd_num, & nesadapter->next_pd, 5); if (err != 0) { tmp___1 = ERR_PTR((long )err); return ((struct ib_pd *)tmp___1); } else { } tmp___2 = kzalloc(40UL, 208U); nespd = (struct nes_pd *)tmp___2; if ((unsigned long )nespd == (unsigned long )((struct nes_pd *)0)) { nes_free_resource___1(nesadapter, nesadapter->allocated_pds, pd_num); tmp___3 = ERR_PTR(-12L); return ((struct ib_pd *)tmp___3); } else { } if ((nes_debug_level & 4096U) != 0U) { printk("\viw_nes: %s[%u]: Allocating PD (%p) for ib device %s\n", "nes_alloc_pd", 801, nespd, (char *)(& (nesvnic->nesibdev)->ibdev.name)); } else { } nespd->pd_id = (int )((u16 )nesadapter->base_pd) + (int )((u16 )pd_num); if ((unsigned long )context != (unsigned long )((struct ib_ucontext *)0)) { nesucontext = to_nesucontext(context); tmp___4 = find_next_zero_bit((unsigned long const *)(& nesucontext->allocated_doorbells), 4096UL, (unsigned long )nesucontext->first_free_db); nespd->mmap_db_index = (u16 )tmp___4; if ((nes_debug_level & 4096U) != 0U) { printk("\viw_nes: %s[%u]: find_first_zero_biton doorbells returned %u, mapping pd_id %u.\n", "nes_alloc_pd", 810, (int )nespd->mmap_db_index, (int )nespd->pd_id); } else { } if ((unsigned int )nespd->mmap_db_index > 4095U) { if ((nes_debug_level & 4096U) != 0U) { printk("\viw_nes: %s[%u]: mmap_db_index > MAX\n", "nes_alloc_pd", 812); } else { } nes_free_resource___1(nesadapter, nesadapter->allocated_pds, pd_num); kfree((void const *)nespd); tmp___5 = ERR_PTR(-12L); return ((struct ib_pd *)tmp___5); } else { } uresp.pd_id = (__u32 )nespd->pd_id; uresp.mmap_db_index = (__u32 )nespd->mmap_db_index; tmp___7 = ib_copy_to_udata(udata, (void *)(& uresp), 8UL); if (tmp___7 != 0) { nes_free_resource___1(nesadapter, nesadapter->allocated_pds, pd_num); kfree((void const *)nespd); tmp___6 = ERR_PTR(-14L); return ((struct ib_pd *)tmp___6); } else { } set_bit((long )nespd->mmap_db_index, (unsigned long volatile *)(& nesucontext->allocated_doorbells)); nesucontext->mmap_db_index[(int )nespd->mmap_db_index] = nespd->pd_id; nesucontext->first_free_db = (unsigned int )nespd->mmap_db_index + 1U; } else { } if ((nes_debug_level & 4096U) != 0U) { printk("\viw_nes: %s[%u]: PD%u structure located @%p.\n", "nes_alloc_pd", 831, (int )nespd->pd_id, nespd); } else { } return (& nespd->ibpd); } } static int nes_dealloc_pd(struct ib_pd *ibpd ) { struct nes_ucontext *nesucontext ; struct nes_pd *nespd ; struct nes_pd *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; { tmp = to_nespd(ibpd); nespd = tmp; tmp___0 = to_nesvnic(ibpd->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; if ((unsigned long )ibpd->uobject != (unsigned long )((struct ib_uobject *)0) && (unsigned long )(ibpd->uobject)->context != (unsigned long )((struct ib_ucontext *)0)) { nesucontext = to_nesucontext((ibpd->uobject)->context); if ((nes_debug_level & 4096U) != 0U) { printk("\viw_nes: %s[%u]: Clearing bit %u from allocated doorbells\n", "nes_dealloc_pd", 850, (int )nespd->mmap_db_index); } else { } clear_bit((long )nespd->mmap_db_index, (unsigned long volatile *)(& nesucontext->allocated_doorbells)); nesucontext->mmap_db_index[(int )nespd->mmap_db_index] = 0U; if ((int )nesucontext->first_free_db > (int )nespd->mmap_db_index) { nesucontext->first_free_db = nespd->mmap_db_index; } else { } } else { } if ((nes_debug_level & 4096U) != 0U) { printk("\viw_nes: %s[%u]: Deallocating PD%u structure located @%p.\n", "nes_dealloc_pd", 859, (int )nespd->pd_id, nespd); } else { } nes_free_resource___1(nesadapter, nesadapter->allocated_pds, (u32 )nespd->pd_id - nesadapter->base_pd); kfree((void const *)nespd); return (0); } } static struct ib_ah *nes_create_ah(struct ib_pd *pd , struct ib_ah_attr *ah_attr ) { void *tmp ; { tmp = ERR_PTR(-38L); return ((struct ib_ah *)tmp); } } static int nes_destroy_ah(struct ib_ah *ah ) { { return (-38); } } __inline static u8 nes_get_encoded_size(int *size ) { u8 encoded_size ; { encoded_size = 0U; if (*size <= 32) { *size = 32; encoded_size = 1U; } else if (*size <= 128) { *size = 128; encoded_size = 2U; } else if (*size <= 512) { *size = 512; encoded_size = 3U; } else { } return (encoded_size); } } static int nes_setup_virt_qp(struct nes_qp *nesqp , struct nes_pbl *nespbl , struct nes_vnic *nesvnic , int sq_size , int rq_size ) { unsigned long flags ; void *mem ; __le64 *pbl ; __le64 *tpbl ; __le64 *pblbuffer ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; u32 pbl_entries ; u8 rq_pbl_entries ; u8 sq_pbl_entries ; void *tmp ; __le64 *tmp___0 ; __le64 *tmp___1 ; u8 tmp___2 ; __le64 *tmp___3 ; __le64 *tmp___4 ; u8 tmp___5 ; unsigned int _max1 ; unsigned int _max2 ; { pbl = (__le64 *)0ULL; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; pbl_entries = nespbl->pbl_size >> 3; if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Userspace PBL, pbl_size=%u, pbl_entries = %d pbl_vbase=%p, pbl_pbase=%lx\n", "nes_setup_virt_qp", 928, nespbl->pbl_size, pbl_entries, (void *)nespbl->pbl_vbase, (unsigned long )nespbl->pbl_pbase); } else { } pbl = nespbl->pbl_vbase; rq_pbl_entries = (u8 )((unsigned long )rq_size * 128UL >> 12); sq_pbl_entries = (u8 )((unsigned long )sq_size * 128UL >> 12); nesqp->hwqp.sq_pbase = (unsigned long long )*((__le32 *)pbl) | ((unsigned long long )*((__le32 *)pbl + 1UL) << 32); if ((unsigned long )nespbl->page == (unsigned long )((struct page *)0)) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: QP nespbl->page is NULL \n", "nes_setup_virt_qp", 936); } else { } kfree((void const *)nespbl); return (-12); } else { } tmp = kmap(nespbl->page); nesqp->hwqp.sq_vbase = (struct nes_hw_qp_wqe *)tmp; nesqp->page = nespbl->page; if ((unsigned long )nesqp->hwqp.sq_vbase == (unsigned long )((struct nes_hw_qp_wqe *)0)) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: QP sq_vbase kmap failed\n", "nes_setup_virt_qp", 944); } else { } kfree((void const *)nespbl); return (-12); } else { } pbl = pbl + (unsigned long )sq_pbl_entries; nesqp->hwqp.rq_pbase = (unsigned long long )*((__le32 *)pbl) | ((unsigned long long )*((__le32 *)pbl + 1UL) << 32); if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: QP sq_vbase= %p sq_pbase=%lx rq_vbase=%p rq_pbase=%lx\n", "nes_setup_virt_qp", 958, nesqp->hwqp.sq_vbase, (unsigned long )nesqp->hwqp.sq_pbase, nesqp->hwqp.rq_vbase, (unsigned long )nesqp->hwqp.rq_pbase); } else { } ldv_spin_lock(); if (nesadapter->free_256pbl == 0U) { pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); kunmap(nesqp->page); kfree((void const *)nespbl); return (-12); } else { } nesadapter->free_256pbl = nesadapter->free_256pbl - 1U; spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); nesqp->pbl_vbase = pci_alloc_consistent(nesdev->pcidev, 256UL, & nesqp->pbl_pbase); pblbuffer = (__le64 *)nesqp->pbl_vbase; if ((unsigned long )nesqp->pbl_vbase == (unsigned long )((void *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); kfree((void const *)nespbl); ldv_spin_lock(); nesadapter->free_256pbl = nesadapter->free_256pbl + 1U; spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); kunmap(nesqp->page); return (-12); } else { } memset(nesqp->pbl_vbase, 0, 256UL); tpbl = pblbuffer + 16UL; pbl = nespbl->pbl_vbase; goto ldv_61909; ldv_61908: tmp___0 = tpbl; tpbl = tpbl + 1; tmp___1 = pbl; pbl = pbl + 1; *tmp___0 = *tmp___1; ldv_61909: tmp___2 = sq_pbl_entries; sq_pbl_entries = (u8 )((int )sq_pbl_entries - 1); if ((unsigned int )tmp___2 != 0U) { goto ldv_61908; } else { } tpbl = pblbuffer; goto ldv_61912; ldv_61911: tmp___3 = tpbl; tpbl = tpbl + 1; tmp___4 = pbl; pbl = pbl + 1; *tmp___3 = *tmp___4; ldv_61912: tmp___5 = rq_pbl_entries; rq_pbl_entries = (u8 )((int )rq_pbl_entries - 1); if ((unsigned int )tmp___5 != 0U) { goto ldv_61911; } else { } pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); kfree((void const *)nespbl); _max1 = 176U; _max2 = 256U; nesqp->qp_mem_size = (_max1 > _max2 ? _max1 : _max2) + 256U; nesqp->qp_mem_size = nesqp->qp_mem_size + 4095U; nesqp->qp_mem_size = nesqp->qp_mem_size & 4294963200U; mem = pci_alloc_consistent(nesdev->pcidev, (size_t )nesqp->qp_mem_size, & nesqp->hwqp.q2_pbase); if ((unsigned long )mem == (unsigned long )((void *)0)) { pci_free_consistent(nesdev->pcidev, 256UL, nesqp->pbl_vbase, nesqp->pbl_pbase); nesqp->pbl_vbase = (void *)0; ldv_spin_lock(); nesadapter->free_256pbl = nesadapter->free_256pbl + 1U; spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); kunmap(nesqp->page); return (-12); } else { } nesqp->sq_kmapped = 1U; nesqp->hwqp.q2_vbase = mem; mem = mem + 256UL; memset(nesqp->hwqp.q2_vbase, 0, 256UL); nesqp->nesqp_context = (struct nes_qp_context *)mem; memset((void *)nesqp->nesqp_context, 0, 176UL); nesqp->nesqp_context_pbase = nesqp->hwqp.q2_pbase + 256ULL; return (0); } } static int nes_setup_mmap_qp(struct nes_qp *nesqp , struct nes_vnic *nesvnic , int sq_size , int rq_size ) { void *mem ; struct nes_device *nesdev ; unsigned int _max1 ; unsigned int _max2 ; { nesdev = nesvnic->nesdev; _max1 = 176U; _max2 = 256U; nesqp->qp_mem_size = ((u32 )((unsigned long )sq_size + (unsigned long )rq_size) * 128U + (_max1 > _max2 ? _max1 : _max2)) + 256U; nesqp->qp_mem_size = nesqp->qp_mem_size + 4095U; nesqp->qp_mem_size = nesqp->qp_mem_size & 4294963200U; mem = pci_alloc_consistent(nesdev->pcidev, (size_t )nesqp->qp_mem_size, & nesqp->hwqp.sq_pbase); if ((unsigned long )mem == (unsigned long )((void *)0)) { return (-12); } else { } if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: PCI consistent memory for host descriptor rings located @ %p (pa = 0x%08lX.) size = %u.\n", "nes_setup_mmap_qp", 1052, mem, (unsigned long )nesqp->hwqp.sq_pbase, nesqp->qp_mem_size); } else { } memset(mem, 0, (size_t )nesqp->qp_mem_size); nesqp->hwqp.sq_vbase = (struct nes_hw_qp_wqe *)mem; mem = mem + (unsigned long )sq_size * 128UL; nesqp->hwqp.rq_vbase = (struct nes_hw_qp_wqe *)mem; nesqp->hwqp.rq_pbase = nesqp->hwqp.sq_pbase + (unsigned long long )((unsigned long )sq_size * 128UL); mem = mem + (unsigned long )rq_size * 128UL; nesqp->hwqp.q2_vbase = mem; nesqp->hwqp.q2_pbase = nesqp->hwqp.rq_pbase + (unsigned long long )((unsigned long )rq_size * 128UL); mem = mem + 256UL; memset(nesqp->hwqp.q2_vbase, 0, 256UL); nesqp->nesqp_context = (struct nes_qp_context *)mem; nesqp->nesqp_context_pbase = nesqp->hwqp.q2_pbase + 256ULL; memset((void *)nesqp->nesqp_context, 0, 176UL); return (0); } } __inline static void nes_free_qp_mem(struct nes_device *nesdev , struct nes_qp *nesqp , int virt_wqs ) { unsigned long flags ; struct nes_adapter *nesadapter ; { nesadapter = nesdev->nesadapter; if (virt_wqs == 0) { pci_free_consistent(nesdev->pcidev, (size_t )nesqp->qp_mem_size, (void *)nesqp->hwqp.sq_vbase, nesqp->hwqp.sq_pbase); } else { ldv_spin_lock(); nesadapter->free_256pbl = nesadapter->free_256pbl + 1U; spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); pci_free_consistent(nesdev->pcidev, (size_t )nesqp->qp_mem_size, nesqp->hwqp.q2_vbase, nesqp->hwqp.q2_pbase); pci_free_consistent(nesdev->pcidev, 256UL, nesqp->pbl_vbase, nesqp->pbl_pbase); nesqp->pbl_vbase = (void *)0; if ((unsigned int )nesqp->sq_kmapped != 0U) { nesqp->sq_kmapped = 0U; kunmap(nesqp->page); } else { } } return; } } static struct ib_qp *nes_create_qp(struct ib_pd *ibpd , struct ib_qp_init_attr *init_attr , struct ib_udata *udata ) { u64 u64temp ; u64 u64nesqp ; struct nes_pd *nespd ; struct nes_pd *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_qp *nesqp ; struct nes_cq *nescq ; struct nes_ucontext *nes_ucontext ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; struct nes_create_qp_req req ; struct nes_create_qp_resp uresp ; struct nes_pbl *nespbl ; u32 qp_num ; u32 opcode ; void *mem ; unsigned long flags ; int ret ; int err ; int virt_wqs ; int sq_size ; int rq_size ; u8 sq_encoded_size ; u8 rq_encoded_size ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; int tmp___6 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; void *tmp___7 ; unsigned long tmp___8 ; void *tmp___9 ; void *tmp___10 ; int tmp___11 ; int tmp___12 ; void *tmp___13 ; void *tmp___14 ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___15 ; bool __cond ; bool __cond___0 ; void *tmp___16 ; void *tmp___17 ; void *tmp___18 ; int tmp___19 ; struct lock_class_key __key ; void *tmp___20 ; int tmp___21 ; { u64temp = 0ULL; u64nesqp = 0ULL; tmp = to_nespd(ibpd); nespd = tmp; tmp___0 = to_nesvnic(ibpd->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; nespbl = (struct nes_pbl *)0; qp_num = 0U; opcode = 0U; virt_wqs = 0; if ((int )init_attr->create_flags != 0) { tmp___1 = ERR_PTR(-22L); return ((struct ib_qp *)tmp___1); } else { } atomic_inc(& qps_created); switch ((unsigned int )init_attr->qp_type) { case 2U: ; if ((nes_drv_opt & 128U) != 0U) { init_attr->cap.max_inline_data = 0U; } else { init_attr->cap.max_inline_data = 64U; } sq_size = (int )init_attr->cap.max_send_wr; rq_size = (int )init_attr->cap.max_recv_wr; sq_encoded_size = nes_get_encoded_size(& sq_size); rq_encoded_size = nes_get_encoded_size(& rq_size); if ((unsigned int )sq_encoded_size == 0U || (unsigned int )rq_encoded_size == 0U) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: OLD_ERROR bad rq (%u) or sq (%u) size\n", "nes_create_qp", 1157, rq_size, sq_size); } else { } tmp___2 = ERR_PTR(-22L); return ((struct ib_qp *)tmp___2); } else { } init_attr->cap.max_send_wr = (u32 )(sq_size + -2); init_attr->cap.max_recv_wr = (u32 )(rq_size + -1); if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: RQ size=%u, SQ Size=%u\n", "nes_create_qp", 1163, rq_size, sq_size); } else { } ret = nes_alloc_resource___0(nesadapter, nesadapter->allocated_qps, nesadapter->max_qp, & qp_num, & nesadapter->next_qp, 6); if (ret != 0) { tmp___3 = ERR_PTR((long )ret); return ((struct ib_qp *)tmp___3); } else { } mem = kzalloc(1871UL, 208U); if ((unsigned long )mem == (unsigned long )((void *)0)) { nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate QP\n", "nes_create_qp", 1175); } else { } tmp___4 = ERR_PTR(-12L); return ((struct ib_qp *)tmp___4); } else { } u64nesqp = (u64 )mem; u64nesqp = u64nesqp + 1023ULL; u64temp = 1023ULL; u64nesqp = ~ u64temp & u64nesqp; nesqp = (struct nes_qp *)u64nesqp; nesqp->allocated_buffer = mem; if ((unsigned long )udata != (unsigned long )((struct ib_udata *)0)) { tmp___6 = ib_copy_from_udata((void *)(& req), udata, 16UL); if (tmp___6 != 0) { nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); kfree((void const *)nesqp->allocated_buffer); if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: ib_copy_from_udata() Failed \n", "nes_create_qp", 1191); } else { } tmp___5 = ERR_PTR(-14L); return ((struct ib_qp *)tmp___5); } else { } if (req.user_wqe_buffers != 0ULL) { virt_wqs = 1; } else { } if (req.user_qp_buffer != 0ULL) { nesqp->nesuqp_addr = req.user_qp_buffer; } else { } if ((unsigned long )ibpd->uobject != (unsigned long )((struct ib_uobject *)0) && (unsigned long )(ibpd->uobject)->context != (unsigned long )((struct ib_ucontext *)0)) { nesqp->user_mode = 1U; nes_ucontext = to_nesucontext((ibpd->uobject)->context); if (virt_wqs != 0) { err = 1; __mptr = (struct list_head const *)nes_ucontext->qp_reg_mem_list.next; nespbl = (struct nes_pbl *)__mptr + 0xffffffffffffffd8UL; goto ldv_61974; ldv_61973: ; if (nespbl->user_base == (unsigned long )req.user_wqe_buffers) { list_del(& nespbl->list); err = 0; if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Found PBL for virtual QP. nespbl=%p. user_base=0x%lx\n", "nes_create_qp", 1209, nespbl, nespbl->user_base); } else { } goto ldv_61972; } else { } __mptr___0 = (struct list_head const *)nespbl->list.next; nespbl = (struct nes_pbl *)__mptr___0 + 0xffffffffffffffd8UL; ldv_61974: ; if ((unsigned long )(& nespbl->list) != (unsigned long )(& nes_ucontext->qp_reg_mem_list)) { goto ldv_61973; } else { } ldv_61972: ; if (err != 0) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Didn\'t Find PBL for virtual QP. address = %llx.\n", "nes_create_qp", 1215, req.user_wqe_buffers); } else { } nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); kfree((void const *)nesqp->allocated_buffer); tmp___7 = ERR_PTR(-14L); return ((struct ib_qp *)tmp___7); } else { } } else { } nes_ucontext = to_nesucontext((ibpd->uobject)->context); tmp___8 = find_next_zero_bit((unsigned long const *)(& nes_ucontext->allocated_wqs), 4096UL, (unsigned long )nes_ucontext->first_free_wq); nesqp->mmap_sq_db_index = (u32 )tmp___8; if (nesqp->mmap_sq_db_index > 4095U) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: db index > max user regions, failing create QP\n", "nes_create_qp", 1230); } else { } nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); if (virt_wqs != 0) { pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); kfree((void const *)nespbl); } else { } kfree((void const *)nesqp->allocated_buffer); tmp___9 = ERR_PTR(-12L); return ((struct ib_qp *)tmp___9); } else { } set_bit((long )nesqp->mmap_sq_db_index, (unsigned long volatile *)(& nes_ucontext->allocated_wqs)); nes_ucontext->mmap_nesqp[nesqp->mmap_sq_db_index] = nesqp; nes_ucontext->first_free_wq = (unsigned int )((u16 )nesqp->mmap_sq_db_index) + 1U; } else { nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); kfree((void const *)nesqp->allocated_buffer); tmp___10 = ERR_PTR(-14L); return ((struct ib_qp *)tmp___10); } } else { } if (virt_wqs == 0) { tmp___11 = nes_setup_mmap_qp(nesqp, nesvnic, sq_size, rq_size); err = tmp___11; } else { tmp___12 = nes_setup_virt_qp(nesqp, nespbl, nesvnic, sq_size, rq_size); err = tmp___12; } if (err != 0) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: error geting qp mem code = %d\n", "nes_create_qp", 1253, err); } else { } nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); kfree((void const *)nesqp->allocated_buffer); tmp___13 = ERR_PTR(-12L); return ((struct ib_qp *)tmp___13); } else { } nesqp->hwqp.sq_size = (u16 )sq_size; nesqp->hwqp.sq_encoded_size = sq_encoded_size; nesqp->hwqp.sq_head = 1U; nesqp->hwqp.rq_size = (u16 )rq_size; nesqp->hwqp.rq_encoded_size = rq_encoded_size; nesqp->hwqp.qp_id = qp_num; nesqp->ibqp.qp_num = nesqp->hwqp.qp_id; nesqp->nespd = nespd; nescq = to_nescq(init_attr->send_cq); nesqp->nesscq = nescq; nescq = to_nescq(init_attr->recv_cq); nesqp->nesrcq = nescq; (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | (((nesdev->pcidev)->devfn & 7U) << 12); (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | ((unsigned int )nesqp->hwqp.rq_encoded_size << 8); (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | ((unsigned int )nesqp->hwqp.sq_encoded_size << 10); if ((unsigned long )udata == (unsigned long )((struct ib_udata *)0)) { (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 1073741824U; (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 536870912U; } else { } (nesqp->nesqp_context)->cqs = (unsigned int )(nesqp->nesscq)->hw_cq.cq_number + ((unsigned int )(nesqp->nesrcq)->hw_cq.cq_number << 16); u64temp = nesqp->hwqp.sq_pbase; (nesqp->nesqp_context)->sq_addr_low = (unsigned int )u64temp; (nesqp->nesqp_context)->sq_addr_high = (unsigned int )(u64temp >> 32); if (virt_wqs == 0) { u64temp = nesqp->hwqp.sq_pbase; (nesqp->nesqp_context)->sq_addr_low = (unsigned int )u64temp; (nesqp->nesqp_context)->sq_addr_high = (unsigned int )(u64temp >> 32); u64temp = nesqp->hwqp.rq_pbase; (nesqp->nesqp_context)->rq_addr_low = (unsigned int )u64temp; (nesqp->nesqp_context)->rq_addr_high = (unsigned int )(u64temp >> 32); } else { u64temp = nesqp->pbl_pbase; (nesqp->nesqp_context)->rq_addr_low = (unsigned int )u64temp; (nesqp->nesqp_context)->rq_addr_high = (unsigned int )(u64temp >> 32); } ldv_spin_lock(); (nesqp->nesqp_context)->misc2 = (nesqp->nesqp_context)->misc2 | ((unsigned int )nesvnic->qp_nic_index[(int )nesvnic->next_qp_nic_index] << 10); nesvnic->next_qp_nic_index = (u8 )((int )nesvnic->next_qp_nic_index + 1); if ((unsigned int )nesvnic->next_qp_nic_index > 3U || (unsigned int )nesvnic->qp_nic_index[(int )nesvnic->next_qp_nic_index] == 15U) { nesvnic->next_qp_nic_index = 0U; } else { } spin_unlock_irqrestore(& nesdev->cqp.lock, flags); (nesqp->nesqp_context)->pd_index_wscale = (nesqp->nesqp_context)->pd_index_wscale | ((unsigned int )(nesqp->nespd)->pd_id << 16); u64temp = nesqp->hwqp.q2_pbase; (nesqp->nesqp_context)->q2_addr_low = (unsigned int )u64temp; (nesqp->nesqp_context)->q2_addr_high = (unsigned int )(u64temp >> 32); (nesqp->nesqp_context)->aeq_token_low = (unsigned int )((long )nesqp); (nesqp->nesqp_context)->aeq_token_high = (unsigned int )((unsigned long )nesqp >> 32UL); (nesqp->nesqp_context)->ird_ord_sizes = (((unsigned int )nesadapter->max_irrq_wr << 16) & 196608U) | 1207959552U; if (disable_mpa_crc != 0) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Disabling MPA crc checking due to module option.\n", "nes_create_qp", 1331); } else { } (nesqp->nesqp_context)->ird_ord_sizes = (nesqp->nesqp_context)->ird_ord_sizes | 2147483648U; } else { } cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request\n", "nes_create_qp", 1339); } else { } nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); nes_free_qp_mem(nesdev, nesqp, virt_wqs); kfree((void const *)nesqp->allocated_buffer); tmp___14 = ERR_PTR(-12L); return ((struct ib_qp *)tmp___14); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; if (virt_wqs == 0) { opcode = 268500992U; } else { opcode = 268509184U; } opcode = opcode | 32768U; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, opcode); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, nesqp->hwqp.qp_id); u64temp = nesqp->nesqp_context_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for create iWARP QP%u to complete.\n", "nes_create_qp", 1368, nesqp->hwqp.qp_id); } else { } __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 1370, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61985: tmp___15 = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp___15; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61984; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61985; ldv_61984: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Create iwarp QP%u completed, wait_event_timeout ret=%u, nesdev->cqp_head = %u, nesdev->cqp.sq_tail = %u, CQP Major:Minor codes = 0x%04X:0x%04X.\n", "nes_create_qp", 1375, nesqp->hwqp.qp_id, ret, (int )nesdev->cqp.sq_head, (int )nesdev->cqp.sq_tail, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } if (ret == 0 || (unsigned int )cqp_request->major_code != 0U) { nes_put_cqp_request(nesdev, cqp_request); nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); nes_free_qp_mem(nesdev, nesqp, virt_wqs); kfree((void const *)nesqp->allocated_buffer); if (ret == 0) { tmp___16 = ERR_PTR(-62L); return ((struct ib_qp *)tmp___16); } else { tmp___17 = ERR_PTR(-5L); return ((struct ib_qp *)tmp___17); } } else { } nes_put_cqp_request(nesdev, cqp_request); if ((unsigned long )ibpd->uobject != (unsigned long )((struct ib_uobject *)0)) { uresp.mmap_sq_db_index = nesqp->mmap_sq_db_index; uresp.mmap_rq_db_index = 0U; uresp.actual_sq_size = (__u32 )sq_size; uresp.actual_rq_size = (__u32 )rq_size; uresp.qp_id = nesqp->hwqp.qp_id; uresp.nes_drv_opt = nes_drv_opt; tmp___19 = ib_copy_to_udata(udata, (void *)(& uresp), 24UL); if (tmp___19 != 0) { nes_free_resource___1(nesadapter, nesadapter->allocated_qps, qp_num); nes_free_qp_mem(nesdev, nesqp, virt_wqs); kfree((void const *)nesqp->allocated_buffer); tmp___18 = ERR_PTR(-14L); return ((struct ib_qp *)tmp___18); } else { } } else { } if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: QP%u structure located @%p.Size = %u.\n", "nes_create_qp", 1406, nesqp->hwqp.qp_id, nesqp, 848U); } else { } spinlock_check(& nesqp->lock); __raw_spin_lock_init(& nesqp->lock.__annonCompField18.rlock, "&(&nesqp->lock)->rlock", & __key); nes_add_ref(& nesqp->ibqp); goto ldv_61989; default: ; if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: Invalid QP type: %d\n", "nes_create_qp", 1411, (unsigned int )init_attr->qp_type); } else { } tmp___20 = ERR_PTR(-22L); return ((struct ib_qp *)tmp___20); } ldv_61989: nesqp->sig_all = (unsigned int )init_attr->sq_sig_type == 0U; reg_timer_7(& nesqp->terminate_timer); nesqp->terminate_timer.function = & nes_terminate_timeout; nesqp->terminate_timer.data = (unsigned long )nesqp; *((nesdev->nesadapter)->qp_table + (unsigned long )(nesqp->hwqp.qp_id - 64U)) = nesqp; if ((nes_debug_level & 16384U) != 0U) { tmp___21 = netdev_refcnt_read((struct net_device const *)nesvnic->netdev); printk("\viw_nes: %s[%u]: netdev refcnt=%u\n", "nes_create_qp", 1423, tmp___21); } else { } return (& nesqp->ibqp); } } static void nes_clean_cq(struct nes_qp *nesqp , struct nes_cq *nescq ) { u32 cq_head ; u32 lo ; u32 hi ; u64 u64temp ; unsigned long flags ; { flags = 0UL; ldv_spin_lock(); cq_head = (u32 )nescq->hw_cq.cq_head; goto ldv_62001; ldv_62000: __asm__ volatile ("lfence": : : "memory"); lo = (nescq->hw_cq.cq_vbase + (unsigned long )cq_head)->cqe_words[2]; hi = (nescq->hw_cq.cq_vbase + (unsigned long )cq_head)->cqe_words[3]; u64temp = ((unsigned long long )hi << 32) | (unsigned long long )lo; u64temp = u64temp & 0xfffffffffffffc00ULL; if ((unsigned long long )nesqp == u64temp) { (nescq->hw_cq.cq_vbase + (unsigned long )cq_head)->cqe_words[2] = 0U; (nescq->hw_cq.cq_vbase + (unsigned long )cq_head)->cqe_words[3] = 0U; } else { } cq_head = cq_head + 1U; if (cq_head >= (u32 )nescq->hw_cq.cq_size) { cq_head = 0U; } else { } ldv_62001: ; if ((int )(nescq->hw_cq.cq_vbase + (unsigned long )cq_head)->cqe_words[7] < 0) { goto ldv_62000; } else { } spin_unlock_irqrestore(& nescq->lock, flags); return; } } static int nes_destroy_qp(struct ib_qp *ibqp ) { struct nes_qp *nesqp ; struct nes_qp *tmp ; struct nes_ucontext *nes_ucontext ; struct ib_qp_attr attr ; struct iw_cm_id *cm_id ; struct iw_cm_event cm_event ; int ret ; int tmp___0 ; { tmp = to_nesqp(ibqp); nesqp = tmp; ret = 0; atomic_inc(& sw_qps_destroyed); nesqp->destroyed = 1U; if ((unsigned int )nesqp->ibqp_state != 0U && (unsigned int )nesqp->ibqp_state <= 3U) { attr.qp_state = 6; nes_modify_qp(& nesqp->ibqp, & attr, 1, (struct ib_udata *)0); } else { } if (((unsigned int )nesqp->ibqp_state == 1U || (unsigned int )nesqp->ibqp_state == 2U) && (unsigned long )nesqp->cm_id != (unsigned long )((struct iw_cm_id *)0)) { cm_id = nesqp->cm_id; cm_event.event = 2; cm_event.status = -110; cm_event.local_addr = cm_id->local_addr; cm_event.remote_addr = cm_id->remote_addr; cm_event.private_data = (void *)0; cm_event.private_data_len = 0U; if ((nes_debug_level & 16384U) != 0U) { tmp___0 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: Generating a CM Timeout Event for QP%u. cm_id = %p, refcount = %u. \n", "nes_destroy_qp", 1496, nesqp->hwqp.qp_id, cm_id, tmp___0); } else { } (*(cm_id->rem_ref))(cm_id); ret = (*(cm_id->event_handler))(cm_id, & cm_event); if (ret != 0) { if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: OFA CM event_handler returned, ret=%d\n", "nes_destroy_qp", 1501, ret); } else { } } else { } } else { } if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { if ((unsigned long )ibqp->uobject != (unsigned long )((struct ib_uobject *)0) && (unsigned long )(ibqp->uobject)->context != (unsigned long )((struct ib_ucontext *)0)) { nes_ucontext = to_nesucontext((ibqp->uobject)->context); clear_bit((long )nesqp->mmap_sq_db_index, (unsigned long volatile *)(& nes_ucontext->allocated_wqs)); nes_ucontext->mmap_nesqp[nesqp->mmap_sq_db_index] = (struct nes_qp *)0; if ((u32 )nes_ucontext->first_free_wq > nesqp->mmap_sq_db_index) { nes_ucontext->first_free_wq = (u16 )nesqp->mmap_sq_db_index; } else { } } else { } if (nesqp->pbl_pbase != 0ULL && (unsigned int )nesqp->sq_kmapped != 0U) { nesqp->sq_kmapped = 0U; kunmap(nesqp->page); } else { } } else { if ((unsigned long )nesqp->nesscq != (unsigned long )((struct nes_cq *)0)) { nes_clean_cq(nesqp, nesqp->nesscq); } else { } if ((unsigned long )nesqp->nesrcq != (unsigned long )((struct nes_cq *)0) && (unsigned long )nesqp->nesrcq != (unsigned long )nesqp->nesscq) { nes_clean_cq(nesqp, nesqp->nesrcq); } else { } } nes_rem_ref(& nesqp->ibqp); return (0); } } static struct ib_cq *nes_create_cq(struct ib_device *ibdev , struct ib_cq_init_attr const *attr , struct ib_ucontext *context , struct ib_udata *udata ) { int entries ; u64 u64temp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_cq *nescq ; struct nes_ucontext *nes_ucontext ; struct nes_cqp_request *cqp_request ; void *mem ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_pbl *nespbl ; struct nes_create_cq_req req ; struct nes_create_cq_resp resp ; u32 cq_num ; u32 opcode ; u32 pbl_entries ; int err ; unsigned long flags ; int ret ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; int _max1 ; int _max2 ; void *tmp___5 ; int tmp___6 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; void *tmp___7 ; void *tmp___8 ; struct lock_class_key __key ; void *tmp___9 ; void *tmp___10 ; void *tmp___11 ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___12 ; bool __cond ; bool __cond___0 ; void *tmp___13 ; void *tmp___14 ; int tmp___15 ; { entries = (int )attr->cqe; tmp = to_nesvnic(ibdev); nesvnic = tmp; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; nes_ucontext = (struct nes_ucontext *)0; mem = (void *)0; nespbl = (struct nes_pbl *)0; cq_num = 0U; opcode = 0U; pbl_entries = 1U; if ((unsigned int )attr->flags != 0U) { tmp___0 = ERR_PTR(-22L); return ((struct ib_cq *)tmp___0); } else { } if ((u32 )entries > nesadapter->max_cqe) { tmp___1 = ERR_PTR(-22L); return ((struct ib_cq *)tmp___1); } else { } err = nes_alloc_resource___0(nesadapter, nesadapter->allocated_cqs, nesadapter->max_cq, & cq_num, & nesadapter->next_cq, 7); if (err != 0) { tmp___2 = ERR_PTR((long )err); return ((struct ib_cq *)tmp___2); } else { } tmp___3 = kzalloc(168UL, 208U); nescq = (struct nes_cq *)tmp___3; if ((unsigned long )nescq == (unsigned long )((struct nes_cq *)0)) { nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate nes_cq struct\n", "nes_create_cq", 1573); } else { } tmp___4 = ERR_PTR(-12L); return ((struct ib_cq *)tmp___4); } else { } _max1 = entries + 1; _max2 = 5; nescq->hw_cq.cq_size = (u16 )(_max1 > _max2 ? _max1 : _max2); nescq->hw_cq.cq_number = (u16 )cq_num; nescq->ibcq.cqe = (int )nescq->hw_cq.cq_size + -1; if ((unsigned long )context != (unsigned long )((struct ib_ucontext *)0)) { nes_ucontext = to_nesucontext(context); tmp___6 = ib_copy_from_udata((void *)(& req), udata, 16UL); if (tmp___6 != 0) { nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); kfree((void const *)nescq); tmp___5 = ERR_PTR(-14L); return ((struct ib_cq *)tmp___5); } else { } nesvnic->mcrq_ucontext = nes_ucontext; nes_ucontext->mcrqf = req.mcrqf; if (nes_ucontext->mcrqf != 0U) { if ((int )nes_ucontext->mcrqf < 0) { nescq->hw_cq.cq_number = ((unsigned int )nesvnic->nic.qp_id + (unsigned int )((u16 )((nes_ucontext->mcrqf & 15U) + 2147483647U)) * 2U) + 28U; } else if ((nes_ucontext->mcrqf & 1073741824U) != 0U) { nescq->hw_cq.cq_number = (u16 )nes_ucontext->mcrqf; } else { nescq->hw_cq.cq_number = (unsigned int )((int )((u16 )nesvnic->mcrq_qp_id) + (int )((u16 )nes_ucontext->mcrqf)) - 1U; } nescq->mcrqf = nes_ucontext->mcrqf; nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); } else { } if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: CQ Virtual Address = %08lX, size = %u.\n", "nes_create_cq", 1602, (unsigned long )req.user_cq_buffer, entries); } else { } err = 1; __mptr = (struct list_head const *)nes_ucontext->cq_reg_mem_list.next; nespbl = (struct nes_pbl *)__mptr + 0xffffffffffffffd8UL; goto ldv_62048; ldv_62047: ; if (nespbl->user_base == (unsigned long )req.user_cq_buffer) { list_del(& nespbl->list); err = 0; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Found PBL for virtual CQ. nespbl=%p.\n", "nes_create_cq", 1609, nespbl); } else { } goto ldv_62046; } else { } __mptr___0 = (struct list_head const *)nespbl->list.next; nespbl = (struct nes_pbl *)__mptr___0 + 0xffffffffffffffd8UL; ldv_62048: ; if ((unsigned long )(& nespbl->list) != (unsigned long )(& nes_ucontext->cq_reg_mem_list)) { goto ldv_62047; } else { } ldv_62046: ; if (err != 0) { nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); kfree((void const *)nescq); tmp___7 = ERR_PTR(-14L); return ((struct ib_cq *)tmp___7); } else { } pbl_entries = nespbl->pbl_size >> 3; nescq->cq_mem_size = 0U; } else { nescq->cq_mem_size = (u32 )nescq->hw_cq.cq_size * 32U; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Attempting to allocate pci memory (%u entries, %u bytes) for CQ%u.\n", "nes_create_cq", 1624, entries, nescq->cq_mem_size, (int )nescq->hw_cq.cq_number); } else { } mem = pci_zalloc_consistent___0(nesdev->pcidev, (size_t )nescq->cq_mem_size, & nescq->hw_cq.cq_pbase); if ((unsigned long )mem == (unsigned long )((void *)0)) { printk("\viw_nes: Unable to allocate pci memory for cq\n"); nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); kfree((void const *)nescq); tmp___8 = ERR_PTR(-12L); return ((struct ib_cq *)tmp___8); } else { } nescq->hw_cq.cq_vbase = (struct nes_hw_cqe *)mem; nescq->hw_cq.cq_head = 0U; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: CQ%u virtual address @ %p, phys = 0x%08X\n", "nes_create_cq", 1640, (int )nescq->hw_cq.cq_number, nescq->hw_cq.cq_vbase, (unsigned int )nescq->hw_cq.cq_pbase); } else { } } nescq->hw_cq.ce_handler = & nes_iwarp_ce_handler; spinlock_check(& nescq->lock); __raw_spin_lock_init(& nescq->lock.__annonCompField18.rlock, "&(&nescq->lock)->rlock", & __key); cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_create_cq", 1649); } else { } if ((unsigned long )context == (unsigned long )((struct ib_ucontext *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )nescq->cq_mem_size, mem, nescq->hw_cq.cq_pbase); } else { pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); kfree((void const *)nespbl); } nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); kfree((void const *)nescq); tmp___9 = ERR_PTR(-12L); return ((struct ib_cq *)tmp___9); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; opcode = ((unsigned int )nescq->hw_cq.cq_size << 16) | 5635U; ldv_spin_lock(); if (pbl_entries != 1U) { if (pbl_entries > 32U) { if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: pbl_entries=%u, use a 4k PBL\n", "nes_create_cq", 1675, pbl_entries); } else { } if (nesadapter->free_4kpbl == 0U) { spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); nes_free_cqp_request(nesdev, cqp_request); if ((unsigned long )context == (unsigned long )((struct ib_ucontext *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )nescq->cq_mem_size, mem, nescq->hw_cq.cq_pbase); } else { pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); kfree((void const *)nespbl); } nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); kfree((void const *)nescq); tmp___10 = ERR_PTR(-12L); return ((struct ib_cq *)tmp___10); } else { opcode = opcode | 49152U; nescq->virtual_cq = 2U; nesadapter->free_4kpbl = nesadapter->free_4kpbl - 1U; } } else { if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: pbl_entries=%u, use a 256 byte PBL\n", "nes_create_cq", 1697, pbl_entries); } else { } if (nesadapter->free_256pbl == 0U) { spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); nes_free_cqp_request(nesdev, cqp_request); if ((unsigned long )context == (unsigned long )((struct ib_ucontext *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )nescq->cq_mem_size, mem, nescq->hw_cq.cq_pbase); } else { pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); kfree((void const *)nespbl); } nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); kfree((void const *)nescq); tmp___11 = ERR_PTR(-12L); return ((struct ib_cq *)tmp___11); } else { opcode = opcode | 32768U; nescq->virtual_cq = 1U; nesadapter->free_256pbl = nesadapter->free_256pbl - 1U; } } } else { } spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, opcode); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (unsigned int )nescq->hw_cq.cq_number | ((unsigned int )nesdev->ceq_index << 16)); if ((unsigned long )context != (unsigned long )((struct ib_ucontext *)0)) { if (pbl_entries != 1U) { u64temp = nespbl->pbl_pbase; } else { u64temp = *(nespbl->pbl_vbase); } set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 10U, (u32 )nes_ucontext->mmap_db_index[0]); } else { u64temp = nescq->hw_cq.cq_pbase; cqp_wqe->wqe_words[10] = 0U; } set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); cqp_wqe->wqe_words[9] = 0U; u64temp = (unsigned long long )(& nescq->hw_cq); cqp_wqe->wqe_words[8] = (unsigned int )(u64temp >> 1); cqp_wqe->wqe_words[9] = (unsigned int )(u64temp >> 33) & 2147483647U; atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for create iWARP CQ%u to complete.\n", "nes_create_cq", 1751, (int )nescq->hw_cq.cq_number); } else { } __ret = 2400000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 1753, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 2400000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_62060: tmp___12 = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp___12; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_62059; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_62060; ldv_62059: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Create iWARP CQ%u completed, wait_event_timeout ret = %d.\n", "nes_create_cq", 1755, (int )nescq->hw_cq.cq_number, ret); } else { } if (ret == 0 || (unsigned int )cqp_request->major_code != 0U) { nes_put_cqp_request(nesdev, cqp_request); if ((unsigned long )context == (unsigned long )((struct ib_ucontext *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )nescq->cq_mem_size, mem, nescq->hw_cq.cq_pbase); } else { pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); kfree((void const *)nespbl); } nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); kfree((void const *)nescq); tmp___13 = ERR_PTR(-5L); return ((struct ib_cq *)tmp___13); } else { } nes_put_cqp_request(nesdev, cqp_request); if ((unsigned long )context != (unsigned long )((struct ib_ucontext *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, (void *)nespbl->pbl_vbase, nespbl->pbl_pbase); kfree((void const *)nespbl); resp.cq_id = (__u32 )nescq->hw_cq.cq_number; resp.cq_size = (__u32 )nescq->hw_cq.cq_size; resp.mmap_db_index = 0U; tmp___15 = ib_copy_to_udata(udata, (void *)(& resp), 12UL); if (tmp___15 != 0) { nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, cq_num); kfree((void const *)nescq); tmp___14 = ERR_PTR(-14L); return ((struct ib_cq *)tmp___14); } else { } } else { } return (& nescq->ibcq); } } static int nes_destroy_cq(struct ib_cq *ib_cq ) { struct nes_cq *nescq ; struct nes_device *nesdev ; struct nes_vnic *nesvnic ; struct nes_adapter *nesadapter ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; unsigned long flags ; u32 opcode ; int ret ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp ; bool __cond ; bool __cond___0 ; { opcode = 0U; if ((unsigned long )ib_cq == (unsigned long )((struct ib_cq *)0)) { return (0); } else { } nescq = to_nescq(ib_cq); nesvnic = to_nesvnic(ib_cq->device); nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Destroy CQ%u\n", "nes_destroy_cq", 1814, (int )nescq->hw_cq.cq_number); } else { } cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_destroy_cq", 1819); } else { } return (-12); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; opcode = (u32 )(((int )nescq->hw_cq.cq_size << 16) | 5); ldv_spin_lock(); if ((unsigned int )nescq->virtual_cq == 1U) { nesadapter->free_256pbl = nesadapter->free_256pbl + 1U; if (nesadapter->free_256pbl > nesadapter->max_256pbl) { printk("\viw_nes: %s: free 256B PBLs(%u) has exceeded the max(%u)\n", "nes_destroy_cq", nesadapter->free_256pbl, nesadapter->max_256pbl); } else { } } else if ((unsigned int )nescq->virtual_cq == 2U) { nesadapter->free_4kpbl = nesadapter->free_4kpbl + 1U; if (nesadapter->free_4kpbl > nesadapter->max_4kpbl) { printk("\viw_nes: %s: free 4K PBLs(%u) has exceeded the max(%u)\n", "nes_destroy_cq", nesadapter->free_4kpbl, nesadapter->max_4kpbl); } else { } opcode = opcode | 16384U; } else { } spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, opcode); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (unsigned int )nescq->hw_cq.cq_number | (((nesdev->pcidev)->devfn & 7U) << 16)); if (nescq->mcrqf == 0U) { nes_free_resource___1(nesadapter, nesadapter->allocated_cqs, (u32 )nescq->hw_cq.cq_number); } else { } atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for destroy iWARP CQ%u to complete.\n", "nes_destroy_cq", 1855, (int )nescq->hw_cq.cq_number); } else { } __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 1857, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_62086: tmp = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_62085; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_62086; ldv_62085: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Destroy iWARP CQ%u completed, wait_event_timeout ret = %u, CQP Major:Minor codes = 0x%04X:0x%04X.\n", "nes_destroy_cq", 1861, (int )nescq->hw_cq.cq_number, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } if (ret == 0) { if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: iWARP CQ%u destroy timeout expired\n", "nes_destroy_cq", 1864, (int )nescq->hw_cq.cq_number); } else { } ret = -62; } else if ((unsigned int )cqp_request->major_code != 0U) { if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: iWARP CQ%u destroy failed\n", "nes_destroy_cq", 1868, (int )nescq->hw_cq.cq_number); } else { } ret = -5; } else { ret = 0; } nes_put_cqp_request(nesdev, cqp_request); if (nescq->cq_mem_size != 0U) { pci_free_consistent(nesdev->pcidev, (size_t )nescq->cq_mem_size, (void *)nescq->hw_cq.cq_vbase, nescq->hw_cq.cq_pbase); } else { } kfree((void const *)nescq); return (ret); } } static u32 root_256(struct nes_device *nesdev , struct nes_root_vpbl *root_vpbl , struct nes_root_vpbl *new_root , u16 pbl_count_4k ) { u64 leaf_pbl ; int i ; int j ; int k ; void *tmp ; { if ((unsigned int )pbl_count_4k == 1U) { tmp = pci_alloc_consistent(nesdev->pcidev, 512UL, & new_root->pbl_pbase); new_root->pbl_vbase = (struct nes_hw_pb *)tmp; if ((unsigned long )new_root->pbl_vbase == (unsigned long )((struct nes_hw_pb *)0)) { return (0U); } else { } leaf_pbl = root_vpbl->pbl_pbase; i = 0; goto ldv_62100; ldv_62099: (new_root->pbl_vbase + (unsigned long )i)->pa_low = (unsigned int )leaf_pbl; (new_root->pbl_vbase + (unsigned long )i)->pa_high = (unsigned int )(leaf_pbl >> 32); leaf_pbl = leaf_pbl + 256ULL; i = i + 1; ldv_62100: ; if (i <= 15) { goto ldv_62099; } else { } } else { i = 3; goto ldv_62106; ldv_62105: j = i * 16; *(root_vpbl->pbl_vbase + (unsigned long )j) = *(root_vpbl->pbl_vbase + (unsigned long )i); leaf_pbl = (unsigned long long )(root_vpbl->pbl_vbase + (unsigned long )j)->pa_low + ((unsigned long long )(root_vpbl->pbl_vbase + (unsigned long )j)->pa_high << 32); k = 1; goto ldv_62103; ldv_62102: leaf_pbl = leaf_pbl + 256ULL; (root_vpbl->pbl_vbase + (unsigned long )(j + k))->pa_low = (unsigned int )leaf_pbl; (root_vpbl->pbl_vbase + (unsigned long )(j + k))->pa_high = (unsigned int )(leaf_pbl >> 32); k = k + 1; ldv_62103: ; if (k <= 15) { goto ldv_62102; } else { } i = i - 1; ldv_62106: ; if (i >= 0) { goto ldv_62105; } else { } } return (1U); } } static int nes_reg_mr(struct nes_device *nesdev , struct nes_pd *nespd , u32 stag , u64 region_length , struct nes_root_vpbl *root_vpbl , dma_addr_t single_buffer , u16 pbl_count_4k , u16 residual_page_count_4k , int acc , u64 *iova_start , u16 *actual_pbl_cnt , u8 *used_4k_pbls ) { struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; unsigned long flags ; int ret ; struct nes_adapter *nesadapter ; uint pg_cnt ; u16 pbl_count_256 ; u16 pbl_count ; u8 use_256_pbls ; u8 use_4k_pbls ; u16 use_two_level ; struct nes_root_vpbl new_root ; u32 opcode ; u16 major_code ; u32 tmp ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___0 ; bool __cond ; bool __cond___0 ; { nesadapter = nesdev->nesadapter; pg_cnt = 0U; pbl_count_256 = 0U; pbl_count = 0U; use_256_pbls = 0U; use_4k_pbls = 0U; use_two_level = (unsigned int )pbl_count_4k > 1U; new_root.pbl_pbase = 0ULL; new_root.pbl_vbase = (struct nes_hw_pb *)0; new_root.leaf_vpbl = (struct nes_vpbl *)0; opcode = 0U; cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_reg_mr", 1957); } else { } return (-12); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; if ((unsigned int )pbl_count_4k != 0U) { ldv_spin_lock(); pg_cnt = (uint )(((int )pbl_count_4k + -1) * 512 + (int )residual_page_count_4k); pbl_count_256 = (u16 )((pg_cnt + 31U) / 32U); if (pg_cnt <= 32U) { if ((u32 )pbl_count_256 <= nesadapter->free_256pbl) { use_256_pbls = 1U; } else if ((u32 )pbl_count_4k <= nesadapter->free_4kpbl) { use_4k_pbls = 1U; } else { } } else if (pg_cnt <= 2048U) { if ((u32 )((int )pbl_count_4k + (int )use_two_level) <= nesadapter->free_4kpbl && nesadapter->free_4kpbl > nesadapter->max_4kpbl >> 1) { use_4k_pbls = 1U; } else if ((u32 )((int )pbl_count_256 + 1) <= nesadapter->free_256pbl) { use_256_pbls = 1U; use_two_level = 1U; } else if ((u32 )((int )pbl_count_4k + (int )use_two_level) <= nesadapter->free_4kpbl) { use_4k_pbls = 1U; } else { } } else if ((u32 )((int )pbl_count_4k + 1) <= nesadapter->free_4kpbl) { use_4k_pbls = 1U; } else { } if ((unsigned int )use_256_pbls != 0U) { pbl_count = pbl_count_256; nesadapter->free_256pbl = nesadapter->free_256pbl - (u32 )((int )pbl_count + (int )use_two_level); } else if ((unsigned int )use_4k_pbls != 0U) { pbl_count = pbl_count_4k; nesadapter->free_4kpbl = nesadapter->free_4kpbl - (u32 )((int )pbl_count + (int )use_two_level); } else { spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Out of Pbls\n", "nes_reg_mr", 1996); } else { } nes_free_cqp_request(nesdev, cqp_request); return (-12); } spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); } else { } if ((unsigned int )use_256_pbls != 0U && (unsigned int )use_two_level != 0U) { tmp = root_256(nesdev, root_vpbl, & new_root, (int )pbl_count_4k); if (tmp == 1U) { if (new_root.pbl_pbase != 0ULL) { root_vpbl = & new_root; } else { } } else { ldv_spin_lock(); nesadapter->free_256pbl = nesadapter->free_256pbl + (u32 )((int )pbl_count_256 + (int )use_two_level); use_256_pbls = 0U; if ((unsigned int )pbl_count_4k == 1U) { use_two_level = 0U; } else { } pbl_count = pbl_count_4k; if ((u32 )((int )pbl_count_4k + (int )use_two_level) <= nesadapter->free_4kpbl) { nesadapter->free_4kpbl = nesadapter->free_4kpbl - (u32 )((int )pbl_count + (int )use_two_level); use_4k_pbls = 1U; } else { } spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); if ((unsigned int )use_4k_pbls == 0U) { return (-12); } else { } } } else { } opcode = 74250U; if (acc & 1) { opcode = opcode | 131072U; } else { } if ((acc & 2) != 0) { opcode = opcode | 2621440U; } else { } if ((acc & 4) != 0) { opcode = opcode | 2359296U; } else { } if ((acc & 16) != 0) { opcode = opcode | 3145728U; } else { } nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, opcode); set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 10U, *iova_start); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 7U, (u32 )region_length); cqp_wqe->wqe_words[6] = (unsigned int )(region_length >> 8) & 4278190080U; cqp_wqe->wqe_words[6] = cqp_wqe->wqe_words[6] | ((__le32 )nespd->pd_id & 32767U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 8U, stag); if ((unsigned int )pbl_count == 0U) { set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 12U, single_buffer); } else { set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 12U, root_vpbl->pbl_pbase); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (u32 )pbl_count); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 14U, pg_cnt * 8U); if ((unsigned int )use_4k_pbls != 0U) { cqp_wqe->wqe_words[0] = cqp_wqe->wqe_words[0] | 2048U; } else { } } __asm__ volatile ("": : : "memory"); atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 2067, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_62147: tmp___0 = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp___0; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_62146; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_62147; ldv_62146: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Register STag 0x%08X completed, wait_event_timeout ret = %u, CQP Major:Minor codes = 0x%04X:0x%04X.\n", "nes_reg_mr", 2070, stag, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } major_code = cqp_request->major_code; nes_put_cqp_request(nesdev, cqp_request); if ((ret == 0 || (unsigned int )major_code != 0U) && (unsigned int )pbl_count != 0U) { ldv_spin_lock(); if ((unsigned int )use_256_pbls != 0U) { nesadapter->free_256pbl = nesadapter->free_256pbl + (u32 )((int )pbl_count + (int )use_two_level); } else if ((unsigned int )use_4k_pbls != 0U) { nesadapter->free_4kpbl = nesadapter->free_4kpbl + (u32 )((int )pbl_count + (int )use_two_level); } else { } spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); } else { } if (new_root.pbl_pbase != 0ULL) { pci_free_consistent(nesdev->pcidev, 512UL, (void *)new_root.pbl_vbase, new_root.pbl_pbase); } else { } if (ret == 0) { return (-62); } else if ((unsigned int )major_code != 0U) { return (-5); } else { } *actual_pbl_cnt = (int )pbl_count + (int )use_two_level; *used_4k_pbls = use_4k_pbls; return (0); } } static struct ib_mr *nes_reg_phys_mr(struct ib_pd *ib_pd , struct ib_phys_buf *buffer_list , int num_phys_buf , int acc , u64 *iova_start ) { u64 region_length ; struct nes_pd *nespd ; struct nes_pd *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_mr *nesmr ; struct ib_mr *ibmr ; struct nes_vpbl vpbl ; struct nes_root_vpbl root_vpbl ; u32 stag ; u32 i ; unsigned long mask ; u32 stag_index ; u32 next_stag_index ; u32 driver_key ; u32 root_pbl_index ; u32 cur_pbl_index ; int err ; int ret ; u16 pbl_count ; u8 single_page ; u8 stag_key ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; void *tmp___6 ; void *tmp___7 ; void *tmp___8 ; void *tmp___9 ; void *tmp___10 ; void *tmp___11 ; void *tmp___12 ; u32 tmp___13 ; void *tmp___14 ; { tmp = to_nespd(ib_pd); nespd = tmp; tmp___0 = to_nesvnic(ib_pd->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; stag_index = 0U; next_stag_index = 0U; driver_key = 0U; root_pbl_index = 0U; cur_pbl_index = 0U; err = 0; ret = 0; pbl_count = 0U; single_page = 1U; stag_key = 0U; region_length = 0ULL; vpbl.pbl_vbase = (struct nes_hw_pb *)0; root_vpbl.pbl_vbase = (struct nes_hw_pb *)0; root_vpbl.pbl_pbase = 0ULL; get_random_bytes((void *)(& next_stag_index), 4); stag_key = (unsigned char )next_stag_index; driver_key = 0U; next_stag_index = next_stag_index >> 8; next_stag_index = next_stag_index % nesadapter->max_mr; if (num_phys_buf > 524288) { tmp___1 = ERR_PTR(-7L); return ((struct ib_mr *)tmp___1); } else { } if (((buffer_list->addr ^ *iova_start) & 4095ULL) != 0ULL) { tmp___2 = ERR_PTR(-22L); return ((struct ib_mr *)tmp___2); } else { } err = nes_alloc_resource___0(nesadapter, nesadapter->allocated_mrs, nesadapter->max_mr, & stag_index, & next_stag_index, 3); if (err != 0) { tmp___3 = ERR_PTR((long )err); return ((struct ib_mr *)tmp___3); } else { } tmp___4 = kzalloc(56UL, 208U); nesmr = (struct nes_mr *)tmp___4; if ((unsigned long )nesmr == (unsigned long )((struct nes_mr *)0)) { nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); tmp___5 = ERR_PTR(-12L); return ((struct ib_mr *)tmp___5); } else { } i = 0U; goto ldv_62182; ldv_62181: ; if ((i & 511U) == 0U) { if (root_pbl_index == 1U) { tmp___6 = pci_alloc_consistent(nesdev->pcidev, 8192UL, & root_vpbl.pbl_pbase); root_vpbl.pbl_vbase = (struct nes_hw_pb *)tmp___6; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Allocating root PBL, va = %p, pa = 0x%08X\n", "nes_reg_phys_mr", 2166, root_vpbl.pbl_vbase, (unsigned int )root_vpbl.pbl_pbase); } else { } if ((unsigned long )root_vpbl.pbl_vbase == (unsigned long )((struct nes_hw_pb *)0)) { pci_free_consistent(nesdev->pcidev, 4096UL, (void *)vpbl.pbl_vbase, vpbl.pbl_pbase); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); kfree((void const *)nesmr); tmp___7 = ERR_PTR(-12L); return ((struct ib_mr *)tmp___7); } else { } tmp___8 = kzalloc(16384UL, 208U); root_vpbl.leaf_vpbl = (struct nes_vpbl *)tmp___8; if ((unsigned long )root_vpbl.leaf_vpbl == (unsigned long )((struct nes_vpbl *)0)) { pci_free_consistent(nesdev->pcidev, 8192UL, (void *)root_vpbl.pbl_vbase, root_vpbl.pbl_pbase); pci_free_consistent(nesdev->pcidev, 4096UL, (void *)vpbl.pbl_vbase, vpbl.pbl_pbase); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); kfree((void const *)nesmr); tmp___9 = ERR_PTR(-12L); return ((struct ib_mr *)tmp___9); } else { } (root_vpbl.pbl_vbase)->pa_low = (unsigned int )vpbl.pbl_pbase; (root_vpbl.pbl_vbase)->pa_high = (unsigned int )(vpbl.pbl_pbase >> 32); *(root_vpbl.leaf_vpbl) = vpbl; } else { } tmp___10 = pci_alloc_consistent(nesdev->pcidev, 4096UL, & vpbl.pbl_pbase); vpbl.pbl_vbase = (struct nes_hw_pb *)tmp___10; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Allocating leaf PBL, va = %p, pa = 0x%016lX\n", "nes_reg_phys_mr", 2193, vpbl.pbl_vbase, (unsigned long )vpbl.pbl_pbase); } else { } if ((unsigned long )vpbl.pbl_vbase == (unsigned long )((struct nes_hw_pb *)0)) { nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); tmp___11 = ERR_PTR(-12L); ibmr = (struct ib_mr *)tmp___11; kfree((void const *)nesmr); goto reg_phys_err; } else { } if (root_pbl_index != 0U) { (root_vpbl.pbl_vbase + (unsigned long )root_pbl_index)->pa_low = (unsigned int )vpbl.pbl_pbase; (root_vpbl.pbl_vbase + (unsigned long )root_pbl_index)->pa_high = (unsigned int )(vpbl.pbl_pbase >> 32); *(root_vpbl.leaf_vpbl + (unsigned long )root_pbl_index) = vpbl; } else { } root_pbl_index = root_pbl_index + 1U; cur_pbl_index = 0U; } else { } mask = (buffer_list + (unsigned long )i)->size == 0ULL; if (i != 0U) { mask = (unsigned long )((buffer_list + (unsigned long )i)->addr | (unsigned long long )mask); } else { } if ((u32 )(num_phys_buf + -1) != i) { mask = (unsigned long )(((buffer_list + (unsigned long )i)->addr + (buffer_list + (unsigned long )i)->size) | (unsigned long long )mask); } else { } if ((mask & 4095UL) != 0UL) { nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Invalid buffer addr or size\n", "nes_reg_phys_mr", 2220); } else { } tmp___12 = ERR_PTR(-22L); ibmr = (struct ib_mr *)tmp___12; kfree((void const *)nesmr); goto reg_phys_err; } else { } region_length = (buffer_list + (unsigned long )i)->size + region_length; if (i != 0U && (unsigned int )single_page != 0U) { if ((buffer_list + (unsigned long )(i - 1U))->addr + 4096ULL != (buffer_list + (unsigned long )i)->addr) { single_page = 0U; } else { } } else { } (vpbl.pbl_vbase + (unsigned long )cur_pbl_index)->pa_low = (unsigned int )(buffer_list + (unsigned long )i)->addr & 4294963200U; tmp___13 = cur_pbl_index; cur_pbl_index = cur_pbl_index + 1U; (vpbl.pbl_vbase + (unsigned long )tmp___13)->pa_high = (unsigned int )((buffer_list + (unsigned long )i)->addr >> 32); i = i + 1U; ldv_62182: ; if ((u32 )num_phys_buf > i) { goto ldv_62181; } else { } stag = stag_index << 8; stag = stag | driver_key; stag = (u32 )stag_key + stag; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Registering STag 0x%08X, VA = 0x%016lX, length = 0x%016lX, index = 0x%08X\n", "nes_reg_phys_mr", 2242, stag, (unsigned long )*iova_start, (unsigned long )region_length, stag_index); } else { } if (root_pbl_index == 1U) { root_vpbl.pbl_pbase = vpbl.pbl_pbase; } else { } if ((unsigned int )single_page != 0U) { pbl_count = 0U; } else { pbl_count = (u16 )root_pbl_index; } ret = nes_reg_mr(nesdev, nespd, stag, region_length, & root_vpbl, buffer_list->addr, (int )pbl_count, (int )((unsigned short )cur_pbl_index), acc, iova_start, & nesmr->pbls_used, & nesmr->pbl_4k); if (ret == 0) { nesmr->__annonCompField126.ibmr.rkey = stag; nesmr->__annonCompField126.ibmr.lkey = stag; nesmr->mode = 0U; ibmr = & nesmr->__annonCompField126.ibmr; } else { kfree((void const *)nesmr); tmp___14 = ERR_PTR(-12L); ibmr = (struct ib_mr *)tmp___14; } reg_phys_err: ; if (root_pbl_index == 1U) { pci_free_consistent(nesdev->pcidev, 4096UL, (void *)vpbl.pbl_vbase, vpbl.pbl_pbase); } else { i = 0U; goto ldv_62185; ldv_62184: pci_free_consistent(nesdev->pcidev, 4096UL, (void *)(root_vpbl.leaf_vpbl + (unsigned long )i)->pbl_vbase, (root_vpbl.leaf_vpbl + (unsigned long )i)->pbl_pbase); i = i + 1U; ldv_62185: ; if (i < root_pbl_index) { goto ldv_62184; } else { } kfree((void const *)root_vpbl.leaf_vpbl); pci_free_consistent(nesdev->pcidev, 8192UL, (void *)root_vpbl.pbl_vbase, root_vpbl.pbl_pbase); } return (ibmr); } } static struct ib_mr *nes_get_dma_mr(struct ib_pd *pd , int acc ) { struct ib_phys_buf bl ; u64 kva ; struct ib_mr *tmp ; { kva = 0ULL; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: \n", "nes_get_dma_mr", 2295); } else { } bl.size = 1099511627775ULL; bl.addr = 0ULL; tmp = nes_reg_phys_mr(pd, & bl, 1, acc, & kva); return (tmp); } } static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd , u64 start , u64 length , u64 virt , int acc , struct ib_udata *udata ) { u64 iova_start ; __le64 *pbl ; u64 region_length ; dma_addr_t last_dma_addr ; dma_addr_t first_dma_addr ; struct nes_pd *nespd ; struct nes_pd *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct ib_mr *ibmr ; void *tmp___1 ; struct scatterlist *sg ; struct nes_ucontext *nes_ucontext ; struct nes_pbl *nespbl ; struct nes_mr *nesmr ; struct ib_umem *region ; struct nes_mem_reg_req req ; struct nes_vpbl vpbl ; struct nes_root_vpbl root_vpbl ; int entry ; int page_index___0 ; int page_count___0 ; int err ; int pbl_depth ; int chunk_pages ; int ret ; u32 stag ; u32 stag_index ; u32 next_stag_index ; u32 driver_key ; u32 root_pbl_index ; u32 cur_pbl_index ; u32 skip_pages ; u16 pbl_count ; u8 single_page ; u8 stag_key ; int first_page ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; void *tmp___5 ; int tmp___6 ; void *tmp___7 ; void *tmp___8 ; void *tmp___9 ; void *tmp___10 ; void *tmp___11 ; int tmp___12 ; void *tmp___13 ; void *tmp___14 ; void *tmp___15 ; void *tmp___16 ; void *tmp___17 ; void *tmp___18 ; void *tmp___19 ; void *tmp___20 ; void *tmp___21 ; void *tmp___22 ; void *tmp___23 ; void *tmp___24 ; void *tmp___25 ; void *tmp___26 ; void *tmp___27 ; void *tmp___28 ; { last_dma_addr = 0ULL; first_dma_addr = 0ULL; tmp = to_nespd(pd); nespd = tmp; tmp___0 = to_nesvnic(pd->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; tmp___1 = ERR_PTR(-22L); ibmr = (struct ib_mr *)tmp___1; page_count___0 = 0; pbl_depth = 0; stag_index = 0U; root_pbl_index = 0U; cur_pbl_index = 0U; single_page = 1U; first_page = 1; region = ib_umem_get((pd->uobject)->context, (unsigned long )start, (size_t )length, acc, 0); tmp___2 = IS_ERR((void const *)region); if ((int )tmp___2) { return ((struct ib_mr *)region); } else { } if ((nes_debug_level & 2048U) != 0U) { tmp___3 = ib_umem_offset(region); printk("\viw_nes: %s[%u]: User base = 0x%lX, Virt base = 0x%lX, length = %u, offset = %u, page size = %u.\n", "nes_reg_user_mr", 2352, (unsigned long )start, (unsigned long )virt, (unsigned int )length, tmp___3, region->page_size); } else { } tmp___4 = ib_umem_offset(region); skip_pages = (unsigned int )tmp___4 >> 12; tmp___6 = ib_copy_from_udata((void *)(& req), udata, 8UL); if (tmp___6 != 0) { ib_umem_release(region); tmp___5 = ERR_PTR(-14L); return ((struct ib_mr *)tmp___5); } else { } if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Memory Registration type = %08X.\n", "nes_reg_user_mr", 2360, req.reg_type); } else { } switch (req.reg_type) { case 0U: pbl_depth = 0; region_length = 0ULL; vpbl.pbl_vbase = (struct nes_hw_pb *)0; root_vpbl.pbl_vbase = (struct nes_hw_pb *)0; root_vpbl.pbl_pbase = 0ULL; get_random_bytes((void *)(& next_stag_index), 4); stag_key = (unsigned char )next_stag_index; driver_key = next_stag_index & 1879048192U; next_stag_index = next_stag_index >> 8; next_stag_index = next_stag_index % nesadapter->max_mr; err = nes_alloc_resource___0(nesadapter, nesadapter->allocated_mrs, nesadapter->max_mr, & stag_index, & next_stag_index, 4); if (err != 0) { ib_umem_release(region); tmp___7 = ERR_PTR((long )err); return ((struct ib_mr *)tmp___7); } else { } tmp___8 = kzalloc(56UL, 208U); nesmr = (struct nes_mr *)tmp___8; if ((unsigned long )nesmr == (unsigned long )((struct nes_mr *)0)) { ib_umem_release(region); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); tmp___9 = ERR_PTR(-12L); return ((struct ib_mr *)tmp___9); } else { } nesmr->region = region; entry = 0; sg = region->sg_head.sgl; goto ldv_62246; ldv_62245: ; if ((sg->dma_address & 4095ULL) != 0ULL) { ib_umem_release(region); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Unaligned Memory Buffer: 0x%x\n", "nes_reg_user_mr", 2398, (unsigned int )sg->dma_address); } else { } tmp___10 = ERR_PTR(-22L); ibmr = (struct ib_mr *)tmp___10; kfree((void const *)nesmr); goto reg_user_mr_err; } else { } if (sg->dma_length == 0U) { ib_umem_release(region); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Invalid Buffer Size\n", "nes_reg_user_mr", 2408); } else { } tmp___11 = ERR_PTR(-22L); ibmr = (struct ib_mr *)tmp___11; kfree((void const *)nesmr); goto reg_user_mr_err; } else { } region_length = (u64 )sg->dma_length + region_length; chunk_pages = (int )(sg->dma_length >> 12); region_length = region_length - (u64 )(skip_pages << 12); page_index___0 = (int )skip_pages; goto ldv_62243; ldv_62242: skip_pages = 0U; if (page_count___0 != 0) { tmp___12 = ib_umem_offset(region); if ((size_t )((page_count___0 << 12) - (tmp___12 & 4095)) >= region->length) { goto enough_pages; } else { } } else { } if ((page_count___0 & 511) == 0) { if (page_count___0 > 524287) { ib_umem_release(region); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); kfree((void const *)nesmr); tmp___13 = ERR_PTR(-7L); ibmr = (struct ib_mr *)tmp___13; goto reg_user_mr_err; } else { } if (root_pbl_index == 1U) { tmp___14 = pci_alloc_consistent(nesdev->pcidev, 8192UL, & root_vpbl.pbl_pbase); root_vpbl.pbl_vbase = (struct nes_hw_pb *)tmp___14; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Allocating root PBL, va = %p, pa = 0x%08X\n", "nes_reg_user_mr", 2434, root_vpbl.pbl_vbase, (unsigned int )root_vpbl.pbl_pbase); } else { } if ((unsigned long )root_vpbl.pbl_vbase == (unsigned long )((struct nes_hw_pb *)0)) { ib_umem_release(region); pci_free_consistent(nesdev->pcidev, 4096UL, (void *)vpbl.pbl_vbase, vpbl.pbl_pbase); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); kfree((void const *)nesmr); tmp___15 = ERR_PTR(-12L); ibmr = (struct ib_mr *)tmp___15; goto reg_user_mr_err; } else { } tmp___16 = kzalloc(16384UL, 208U); root_vpbl.leaf_vpbl = (struct nes_vpbl *)tmp___16; if ((unsigned long )root_vpbl.leaf_vpbl == (unsigned long )((struct nes_vpbl *)0)) { ib_umem_release(region); pci_free_consistent(nesdev->pcidev, 8192UL, (void *)root_vpbl.pbl_vbase, root_vpbl.pbl_pbase); pci_free_consistent(nesdev->pcidev, 4096UL, (void *)vpbl.pbl_vbase, vpbl.pbl_pbase); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); kfree((void const *)nesmr); tmp___17 = ERR_PTR(-12L); ibmr = (struct ib_mr *)tmp___17; goto reg_user_mr_err; } else { } (root_vpbl.pbl_vbase)->pa_low = (unsigned int )vpbl.pbl_pbase; (root_vpbl.pbl_vbase)->pa_high = (unsigned int )(vpbl.pbl_pbase >> 32); *(root_vpbl.leaf_vpbl) = vpbl; } else { } tmp___18 = pci_alloc_consistent(nesdev->pcidev, 4096UL, & vpbl.pbl_pbase); vpbl.pbl_vbase = (struct nes_hw_pb *)tmp___18; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Allocating leaf PBL, va = %p, pa = 0x%08X\n", "nes_reg_user_mr", 2468, vpbl.pbl_vbase, (unsigned int )vpbl.pbl_pbase); } else { } if ((unsigned long )vpbl.pbl_vbase == (unsigned long )((struct nes_hw_pb *)0)) { ib_umem_release(region); nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, stag_index); tmp___19 = ERR_PTR(-12L); ibmr = (struct ib_mr *)tmp___19; kfree((void const *)nesmr); goto reg_user_mr_err; } else { } if (root_pbl_index != 0U) { (root_vpbl.pbl_vbase + (unsigned long )root_pbl_index)->pa_low = (unsigned int )vpbl.pbl_pbase; (root_vpbl.pbl_vbase + (unsigned long )root_pbl_index)->pa_high = (unsigned int )(vpbl.pbl_pbase >> 32); *(root_vpbl.leaf_vpbl + (unsigned long )root_pbl_index) = vpbl; } else { } root_pbl_index = root_pbl_index + 1U; cur_pbl_index = 0U; } else { } if ((unsigned int )single_page != 0U) { if (page_count___0 != 0) { if (last_dma_addr + 4096ULL != sg->dma_address + (dma_addr_t )(page_index___0 * 4096)) { single_page = 0U; } else { } last_dma_addr = sg->dma_address + (dma_addr_t )(page_index___0 * 4096); } else { first_dma_addr = sg->dma_address + (dma_addr_t )(page_index___0 * 4096); last_dma_addr = first_dma_addr; } } else { } (vpbl.pbl_vbase + (unsigned long )cur_pbl_index)->pa_low = (unsigned int )sg->dma_address + (unsigned int )(page_index___0 * 4096); (vpbl.pbl_vbase + (unsigned long )cur_pbl_index)->pa_high = (unsigned int )((sg->dma_address + (dma_addr_t )(page_index___0 * 4096)) >> 32); cur_pbl_index = cur_pbl_index + 1U; page_count___0 = page_count___0 + 1; page_index___0 = page_index___0 + 1; ldv_62243: ; if (page_index___0 < chunk_pages) { goto ldv_62242; } else { } entry = entry + 1; sg = sg_next(sg); ldv_62246: ; if (region->nmap > entry) { goto ldv_62245; } else { } enough_pages: ; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: calculating stag, stag_index=0x%08x, driver_key=0x%08x, stag_key=0x%08x\n", "nes_reg_user_mr", 2515, stag_index, driver_key, (int )stag_key); } else { } stag = stag_index << 8; stag = stag | driver_key; stag = (u32 )stag_key + stag; iova_start = virt; if (root_pbl_index == 1U) { root_vpbl.pbl_pbase = vpbl.pbl_pbase; } else { } if ((unsigned int )single_page != 0U) { pbl_count = 0U; } else { pbl_count = (u16 )root_pbl_index; first_dma_addr = 0ULL; } if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Registering STag 0x%08X, VA = 0x%08X, length = 0x%08X, index = 0x%08X, region->length=0x%08llx, pbl_count = %u\n", "nes_reg_user_mr", 2536, stag, (unsigned int )iova_start, (unsigned int )region_length, stag_index, (unsigned long long )region->length, (int )pbl_count); } else { } ret = nes_reg_mr(nesdev, nespd, stag, (u64 )region->length, & root_vpbl, first_dma_addr, (int )pbl_count, (int )((unsigned short )cur_pbl_index), acc, & iova_start, & nesmr->pbls_used, & nesmr->pbl_4k); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: ret=%d\n", "nes_reg_user_mr", 2541, ret); } else { } if (ret == 0) { nesmr->__annonCompField126.ibmr.rkey = stag; nesmr->__annonCompField126.ibmr.lkey = stag; nesmr->mode = 0U; ibmr = & nesmr->__annonCompField126.ibmr; } else { ib_umem_release(region); kfree((void const *)nesmr); tmp___20 = ERR_PTR(-12L); ibmr = (struct ib_mr *)tmp___20; } reg_user_mr_err: ; if (root_pbl_index == 1U) { pci_free_consistent(nesdev->pcidev, 4096UL, (void *)vpbl.pbl_vbase, vpbl.pbl_pbase); } else { page_index___0 = 0; goto ldv_62249; ldv_62248: pci_free_consistent(nesdev->pcidev, 4096UL, (void *)(root_vpbl.leaf_vpbl + (unsigned long )page_index___0)->pbl_vbase, (root_vpbl.leaf_vpbl + (unsigned long )page_index___0)->pbl_pbase); page_index___0 = page_index___0 + 1; ldv_62249: ; if ((u32 )page_index___0 < root_pbl_index) { goto ldv_62248; } else { } kfree((void const *)root_vpbl.leaf_vpbl); pci_free_consistent(nesdev->pcidev, 8192UL, (void *)root_vpbl.pbl_vbase, root_vpbl.pbl_pbase); } if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Leaving, ibmr=%p", "nes_reg_user_mr", 2570, ibmr); } else { } return (ibmr); case 1U: ; case 2U: ; if (region->length == 0UL) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Unable to register zero length region for CQ\n", "nes_reg_user_mr", 2576); } else { } ib_umem_release(region); tmp___21 = ERR_PTR(-22L); return ((struct ib_mr *)tmp___21); } else { } tmp___22 = kzalloc(56UL, 208U); nespbl = (struct nes_pbl *)tmp___22; if ((unsigned long )nespbl == (unsigned long )((struct nes_pbl *)0)) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate PBL\n", "nes_reg_user_mr", 2582); } else { } ib_umem_release(region); tmp___23 = ERR_PTR(-12L); return ((struct ib_mr *)tmp___23); } else { } tmp___24 = kzalloc(56UL, 208U); nesmr = (struct nes_mr *)tmp___24; if ((unsigned long )nesmr == (unsigned long )((struct nes_mr *)0)) { ib_umem_release(region); kfree((void const *)nespbl); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate nesmr\n", "nes_reg_user_mr", 2590); } else { } tmp___25 = ERR_PTR(-12L); return ((struct ib_mr *)tmp___25); } else { } nesmr->region = region; nes_ucontext = to_nesucontext((pd->uobject)->context); pbl_depth = (int )(region->length >> 12); pbl_depth = ((region->length & 4095UL) != 0UL) + pbl_depth; nespbl->pbl_size = (u32 )((unsigned long )pbl_depth) * 8U; if (req.reg_type == 1U) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Attempting to allocate QP PBL memory", "nes_reg_user_mr", 2599); } else { } } else if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Attempting to allocate CP PBL memory", "nes_reg_user_mr", 2601); } else { } if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: %u bytes, %u entries.\n", "nes_reg_user_mr", 2605, nespbl->pbl_size, pbl_depth); } else { } tmp___26 = pci_alloc_consistent(nesdev->pcidev, (size_t )nespbl->pbl_size, & nespbl->pbl_pbase); pbl = (__le64 *)tmp___26; if ((unsigned long )pbl == (unsigned long )((__le64 *)0ULL)) { ib_umem_release(region); kfree((void const *)nesmr); kfree((void const *)nespbl); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate PBL memory\n", "nes_reg_user_mr", 2612); } else { } tmp___27 = ERR_PTR(-12L); return ((struct ib_mr *)tmp___27); } else { } nespbl->pbl_vbase = pbl; nespbl->user_base = (unsigned long )start; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Allocated PBL memory, %u bytes, pbl_pbase=%lx, pbl_vbase=%p user_base=0x%lx\n", "nes_reg_user_mr", 2621, nespbl->pbl_size, (unsigned long )nespbl->pbl_pbase, (void *)nespbl->pbl_vbase, nespbl->user_base); } else { } entry = 0; sg = region->sg_head.sgl; goto ldv_62257; ldv_62256: chunk_pages = (int )(sg->dma_length >> 12); chunk_pages = ((sg->dma_length & 4095U) != 0U) + chunk_pages; if (first_page != 0) { nespbl->page = sg_page(sg); first_page = 0; } else { } page_index___0 = 0; goto ldv_62254; ldv_62253: *((__le32 *)pbl) = (unsigned int )sg->dma_address + (unsigned int )(page_index___0 * 4096); *((__le32 *)pbl + 1UL) = (unsigned int )((sg->dma_address + (dma_addr_t )(page_index___0 * 4096)) >> 32); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: pbl=%p, *pbl=0x%016llx, 0x%08x%08x\n", "nes_reg_user_mr", 2640, pbl, *pbl, *((__le32 *)pbl + 1UL), *((__le32 *)pbl)); } else { } pbl = pbl + 1; page_index___0 = page_index___0 + 1; ldv_62254: ; if (page_index___0 < chunk_pages) { goto ldv_62253; } else { } entry = entry + 1; sg = sg_next(sg); ldv_62257: ; if (region->nmap > entry) { goto ldv_62256; } else { } if (req.reg_type == 1U) { list_add_tail(& nespbl->list, & nes_ucontext->qp_reg_mem_list); } else { list_add_tail(& nespbl->list, & nes_ucontext->cq_reg_mem_list); } nesmr->__annonCompField126.ibmr.rkey = 4294967295U; nesmr->__annonCompField126.ibmr.lkey = 4294967295U; nesmr->mode = (u8 )req.reg_type; return (& nesmr->__annonCompField126.ibmr); } ib_umem_release(region); tmp___28 = ERR_PTR(-38L); return ((struct ib_mr *)tmp___28); } } static int nes_dereg_mr(struct ib_mr *ib_mr ) { struct nes_mr *nesmr ; struct nes_mr *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; unsigned long flags ; int ret ; u16 major_code ; u16 minor_code ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___1 ; bool __cond ; bool __cond___0 ; { tmp = to_nesmr(ib_mr); nesmr = tmp; tmp___0 = to_nesvnic(ib_mr->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; if ((unsigned long )nesmr->region != (unsigned long )((struct ib_umem *)0)) { ib_umem_release(nesmr->region); } else { } if ((unsigned int )nesmr->mode != 0U) { kfree((void const *)nesmr); return (0); } else { } cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_dereg_mr", 2689); } else { } return (-12); } else { } cqp_request->waiting = 1U; cqp_wqe = & cqp_request->cqp_wqe; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, 9741U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 8U, ib_mr->rkey); atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for deallocate STag 0x%08X completed\n", "nes_dereg_mr", 2705, ib_mr->rkey); } else { } __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 2707, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_62283: tmp___1 = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp___1; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_62282; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_62283; ldv_62282: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Deallocate STag 0x%08X completed, wait_event_timeout ret = %u, CQP Major:Minor codes = 0x%04X:0x%04X\n", "nes_dereg_mr", 2710, ib_mr->rkey, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } major_code = cqp_request->major_code; minor_code = cqp_request->minor_code; nes_put_cqp_request(nesdev, cqp_request); if (ret == 0) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Timeout waiting to destroy STag, ib_mr=%p, rkey = 0x%08X\n", "nes_dereg_mr", 2720, ib_mr, ib_mr->rkey); } else { } return (-62); } else if ((unsigned int )major_code != 0U) { if ((nes_debug_level & 2048U) != 0U) { printk("\viw_nes: %s[%u]: Error (0x%04X:0x%04X) while attempting to destroy STag, ib_mr=%p, rkey = 0x%08X\n", "nes_dereg_mr", 2725, (int )major_code, (int )minor_code, ib_mr, ib_mr->rkey); } else { } return (-5); } else { } if ((unsigned int )nesmr->pbls_used != 0U) { ldv_spin_lock(); if ((unsigned int )nesmr->pbl_4k != 0U) { nesadapter->free_4kpbl = nesadapter->free_4kpbl + (u32 )nesmr->pbls_used; if (nesadapter->free_4kpbl > nesadapter->max_4kpbl) { printk("\viw_nes: free 4KB PBLs(%u) has exceeded the max(%u)\n", nesadapter->free_4kpbl, nesadapter->max_4kpbl); } else { } } else { nesadapter->free_256pbl = nesadapter->free_256pbl + (u32 )nesmr->pbls_used; if (nesadapter->free_256pbl > nesadapter->max_256pbl) { printk("\viw_nes: free 256B PBLs(%u) has exceeded the max(%u)\n", nesadapter->free_256pbl, nesadapter->max_256pbl); } else { } } spin_unlock_irqrestore(& nesadapter->pbl_lock, flags); } else { } nes_free_resource___1(nesadapter, nesadapter->allocated_mrs, (ib_mr->rkey & 268435200U) >> 8); kfree((void const *)nesmr); return (0); } } static ssize_t show_rev(struct device *dev , struct device_attribute *attr , char *buf ) { struct nes_ib_device *nesibdev ; struct device const *__mptr ; struct nes_vnic *nesvnic ; int tmp ; { __mptr = (struct device const *)dev; nesibdev = (struct nes_ib_device *)__mptr + 0xfffffffffffffc58UL; nesvnic = nesibdev->nesvnic; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: \n", "show_rev", 2767); } else { } tmp = sprintf(buf, "%x\n", ((nesvnic->nesdev)->nesadapter)->hw_rev); return ((ssize_t )tmp); } } static ssize_t show_fw_ver(struct device *dev , struct device_attribute *attr , char *buf ) { struct nes_ib_device *nesibdev ; struct device const *__mptr ; struct nes_vnic *nesvnic ; int tmp ; { __mptr = (struct device const *)dev; nesibdev = (struct nes_ib_device *)__mptr + 0xfffffffffffffc58UL; nesvnic = nesibdev->nesvnic; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: \n", "show_fw_ver", 2782); } else { } tmp = sprintf(buf, "%u.%u\n", ((nesvnic->nesdev)->nesadapter)->firmware_version >> 16, ((nesvnic->nesdev)->nesadapter)->firmware_version & 255U); return ((ssize_t )tmp); } } static ssize_t show_hca(struct device *dev , struct device_attribute *attr , char *buf ) { int tmp ; { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: \n", "show_hca", 2795); } else { } tmp = sprintf(buf, "NES020\n"); return ((ssize_t )tmp); } } static ssize_t show_board(struct device *dev , struct device_attribute *attr , char *buf ) { int tmp ; { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: \n", "show_board", 2806); } else { } tmp = sprintf(buf, "%.*s\n", 32, (char *)"NES020 Board ID"); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_hw_rev = {{"hw_rev", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_rev, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_attr_fw_ver = {{"fw_ver", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_fw_ver, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_attr_hca_type = {{"hca_type", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_hca, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_attr_board_id = {{"board_id", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_board, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute *nes_dev_attributes[4U] = { & dev_attr_hw_rev, & dev_attr_fw_ver, & dev_attr_hca_type, & dev_attr_board_id}; static int nes_query_qp(struct ib_qp *ibqp , struct ib_qp_attr *attr , int attr_mask , struct ib_qp_init_attr *init_attr ) { struct nes_qp *nesqp ; struct nes_qp *tmp ; { tmp = to_nesqp(ibqp); nesqp = tmp; if ((nes_debug_level & 16384U) != 0U) { printk("\viw_nes: %s[%u]: \n", "nes_query_qp", 2832); } else { } attr->qp_access_flags = 0; attr->cap.max_send_wr = (u32 )nesqp->hwqp.sq_size; attr->cap.max_recv_wr = (u32 )nesqp->hwqp.rq_size; attr->cap.max_recv_sge = 1U; if ((nes_drv_opt & 128U) != 0U) { attr->cap.max_inline_data = 0U; } else { attr->cap.max_inline_data = 64U; } init_attr->event_handler = nesqp->ibqp.event_handler; init_attr->qp_context = nesqp->ibqp.qp_context; init_attr->send_cq = nesqp->ibqp.send_cq; init_attr->recv_cq = nesqp->ibqp.recv_cq; init_attr->srq = nesqp->ibqp.srq; init_attr->cap = attr->cap; return (0); } } int nes_hw_modify_qp(struct nes_device *nesdev , struct nes_qp *nesqp , u32 next_iwarp_state , u32 termlen , u32 wait_completion ) { struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; int ret ; u16 major_code ; int tmp ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___0 ; bool __cond ; bool __cond___0 ; { if ((nes_debug_level & 32768U) != 0U) { tmp = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u, refcount=%d\n", "nes_hw_modify_qp", 2868, nesqp->hwqp.qp_id, tmp); } else { } cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_hw_modify_qp", 2872); } else { } return (-12); } else { } if (wait_completion != 0U) { cqp_request->waiting = 1U; } else { cqp_request->waiting = 0U; } cqp_wqe = & cqp_request->cqp_wqe; set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, next_iwarp_state | 65537U); if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: using next_iwarp_state=%08x, wqe_words=%08x\n", "nes_hw_modify_qp", 2885, next_iwarp_state, cqp_wqe->wqe_words[0]); } else { } nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, nesqp->hwqp.qp_id); set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, nesqp->nesqp_context_pbase); if ((next_iwarp_state & 1879048192U) == 1342177280U && (next_iwarp_state & 33554432U) == 0U) { termlen = ((termlen + 3U) >> 2) << 28; set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 15U, termlen); } else { } atomic_set(& cqp_request->refcount, 2); nes_post_cqp_request(nesdev, cqp_request); if (wait_completion != 0U) { __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_verbs.c", 2905, 0); __cond___0 = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_62401: tmp___0 = prepare_to_wait_event(& cqp_request->waitq, & __wait, 2); __int = tmp___0; __cond = (unsigned int )cqp_request->request_done != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_62400; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_62401; ldv_62400: finish_wait(& cqp_request->waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: Modify iwarp QP%u completed, wait_event_timeout ret=%u, CQP Major:Minor codes = 0x%04X:0x%04X.\n", "nes_hw_modify_qp", 2908, nesqp->hwqp.qp_id, ret, (int )cqp_request->major_code, (int )cqp_request->minor_code); } else { } major_code = cqp_request->major_code; if ((unsigned int )major_code != 0U) { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: Modify iwarp QP%u failedCQP Major:Minor codes = 0x%04X:0x%04X, intended next state = 0x%08X.\n", "nes_hw_modify_qp", 2914, nesqp->hwqp.qp_id, (int )cqp_request->major_code, (int )cqp_request->minor_code, next_iwarp_state); } else { } } else { } nes_put_cqp_request(nesdev, cqp_request); if (ret == 0) { return (-62); } else if ((unsigned int )major_code != 0U) { return (-5); } else { return (0); } } else { return (0); } } } int nes_modify_qp(struct ib_qp *ibqp , struct ib_qp_attr *attr , int attr_mask , struct ib_udata *udata ) { struct nes_qp *nesqp ; struct nes_qp *tmp ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp___0 ; struct nes_device *nesdev ; u32 next_iwarp_state ; int err ; unsigned long qplockflags ; int ret ; u16 original_last_aeq ; u8 issue_modify_qp ; u8 dont_wait ; 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 ; { tmp = to_nesqp(ibqp); nesqp = tmp; tmp___0 = to_nesvnic(ibqp->device); nesvnic = tmp___0; nesdev = nesvnic->nesdev; next_iwarp_state = 0U; issue_modify_qp = 0U; dont_wait = 0U; if ((nes_debug_level & 32768U) != 0U) { tmp___1 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u: QP State=%u, cur QP State=%u, iwarp_state=0x%X, refcount=%d\n", "nes_modify_qp", 2953, nesqp->hwqp.qp_id, (unsigned int )attr->qp_state, (unsigned int )nesqp->ibqp_state, nesqp->iwarp_state, tmp___1); } else { } ldv_spin_lock(); if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: hw_iwarp_state=0x%X, hw_tcp_state=0x%X, QP Access Flags=0x%X, attr_mask = 0x%0x\n", "nes_modify_qp", 2960, nesqp->hwqp.qp_id, (int )nesqp->hw_iwarp_state, (int )nesqp->hw_tcp_state, attr->qp_access_flags, attr_mask); } else { } if (attr_mask & 1) { switch ((unsigned int )attr->qp_state) { case 1U: ; if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: new state = init\n", "nes_modify_qp", 2966, nesqp->hwqp.qp_id); } else { } if (nesqp->iwarp_state > 268435456U) { spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (-22); } else { } next_iwarp_state = 268435456U; issue_modify_qp = 1U; goto ldv_62422; case 2U: ; if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: new state = rtr\n", "nes_modify_qp", 2976, nesqp->hwqp.qp_id); } else { } if (nesqp->iwarp_state > 268435456U) { spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (-22); } else { } next_iwarp_state = 268435456U; issue_modify_qp = 1U; goto ldv_62422; case 3U: ; if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: new state = rts\n", "nes_modify_qp", 2986, nesqp->hwqp.qp_id); } else { } if (nesqp->iwarp_state > 536870912U) { spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (-22); } else { } if ((unsigned long )nesqp->cm_id == (unsigned long )((struct iw_cm_id *)0)) { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: Failing attempt to move QP to RTS without a CM_ID. \n", "nes_modify_qp", 2993, nesqp->hwqp.qp_id); } else { } spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (-22); } else { } next_iwarp_state = 536870912U; if (nesqp->iwarp_state != 536870912U) { next_iwarp_state = next_iwarp_state | 3328U; } else { } issue_modify_qp = 1U; nesqp->hw_tcp_state = 5U; nesqp->hw_iwarp_state = 2U; nesqp->hte_added = 1U; goto ldv_62422; case 4U: issue_modify_qp = 1U; if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: new state=closing. SQ head=%u, SQ tail=%u\n", "nes_modify_qp", 3009, nesqp->hwqp.qp_id, (int )nesqp->hwqp.sq_head, (int )nesqp->hwqp.sq_tail); } else { } if (nesqp->iwarp_state == 805306368U) { spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (0); } else { if (nesqp->iwarp_state > 805306368U) { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: State change to closing ignored due to current iWARP state\n", "nes_modify_qp", 3017, nesqp->hwqp.qp_id); } else { } spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (-22); } else { } if ((unsigned int )nesqp->hw_iwarp_state != 2U) { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: State change to closing already done based on hw state.\n", "nes_modify_qp", 3024, nesqp->hwqp.qp_id); } else { } issue_modify_qp = 0U; } else { } switch ((int )nesqp->hw_iwarp_state) { case 3: next_iwarp_state = 805306368U; goto ldv_62427; case 5: next_iwarp_state = 1342177280U; goto ldv_62427; case 6: next_iwarp_state = 1610612736U; goto ldv_62427; default: next_iwarp_state = 805306368U; nesqp->hw_iwarp_state = 3U; goto ldv_62427; } ldv_62427: ; } goto ldv_62422; case 5U: ; if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: new state = terminate\n", "nes_modify_qp", 3046, nesqp->hwqp.qp_id); } else { } if (nesqp->iwarp_state > 1342177279U) { spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (-22); } else { } next_iwarp_state = 1342177280U; nesqp->hw_iwarp_state = 5U; issue_modify_qp = 1U; goto ldv_62422; case 6U: ; case 0U: ; if (nesqp->iwarp_state == 1610612736U) { spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (-22); } else { } if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: new state = error\n", "nes_modify_qp", 3063, nesqp->hwqp.qp_id); } else { } if ((unsigned int )nesqp->term_flags != 0U) { ldv_del_timer_261(& nesqp->terminate_timer); } else { } next_iwarp_state = 1610612736U; if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: set CQP_QP_DEL_HTE\n", "nes_modify_qp", 3070); } else { } next_iwarp_state = next_iwarp_state | 16384U; nesqp->hte_added = 0U; } else { } if (((unsigned int )nesqp->hw_tcp_state > 1U && (unsigned int )nesdev->iw_status != 0U) && (unsigned int )nesqp->hw_tcp_state != 11U) { next_iwarp_state = next_iwarp_state | 2147483648U; } else { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: QP%u NOT setting NES_CQP_QP_RESET since TCP state = %u\n", "nes_modify_qp", 3080, nesqp->hwqp.qp_id, (int )nesqp->hw_tcp_state); } else { } dont_wait = 1U; } issue_modify_qp = 1U; nesqp->hw_iwarp_state = 6U; goto ldv_62422; default: spin_unlock_irqrestore(& nesqp->lock, qplockflags); return (-22); } ldv_62422: nesqp->ibqp_state = attr->qp_state; nesqp->iwarp_state = next_iwarp_state & 1879048192U; if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: Change nesqp->iwarp_state=%08x\n", "nes_modify_qp", 3095, nesqp->iwarp_state); } else { } } else { } if ((attr_mask & 8) != 0) { if (attr->qp_access_flags & 1) { (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 25165824U; issue_modify_qp = 1U; } else { } if ((attr->qp_access_flags & 2) != 0) { (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 8388608U; issue_modify_qp = 1U; } else { } if ((attr->qp_access_flags & 4) != 0) { (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 16777216U; issue_modify_qp = 1U; } else { } if ((attr->qp_access_flags & 16) != 0) { (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 268435456U; issue_modify_qp = 1U; } else { } if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 25165824U; issue_modify_qp = 1U; } else { } } else { } original_last_aeq = (u16 )nesqp->last_aeq; spin_unlock_irqrestore(& nesqp->lock, qplockflags); if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: issue_modify_qp=%u\n", "nes_modify_qp", 3127, (int )issue_modify_qp); } else { } ret = 0; if ((unsigned int )issue_modify_qp != 0U) { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: call nes_hw_modify_qp\n", "nes_modify_qp", 3133); } else { } ret = nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0U, 1U); if (ret != 0) { if ((nes_debug_level & 32768U) != 0U) { printk("\viw_nes: %s[%u]: nes_hw_modify_qp (next_iwarp_state = 0x%08X) failed for QP%u.\n", "nes_modify_qp", 3138, next_iwarp_state, nesqp->hwqp.qp_id); } else { } } else { } } else { } if ((unsigned int )issue_modify_qp != 0U && (unsigned int )nesqp->ibqp_state > 3U) { if ((nes_debug_level & 32768U) != 0U) { tmp___2 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u Issued ModifyQP refcount (%d), original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n", "nes_modify_qp", 3146, nesqp->hwqp.qp_id, tmp___2, (int )original_last_aeq, nesqp->last_aeq); } else { } if (ret == 0 || (unsigned int )original_last_aeq != 514U) { if ((unsigned int )dont_wait != 0U) { if ((unsigned long )nesqp->cm_id != (unsigned long )((struct iw_cm_id *)0) && (unsigned int )nesqp->hw_tcp_state != 0U) { if ((nes_debug_level & 32768U) != 0U) { tmp___3 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u Queuing fake disconnect for QP refcount (%d), original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n", "nes_modify_qp", 3153, nesqp->hwqp.qp_id, tmp___3, (int )original_last_aeq, nesqp->last_aeq); } else { } ldv_spin_lock(); nesqp->hw_tcp_state = 1U; nesqp->last_aeq = 1537U; spin_unlock_irqrestore(& nesqp->lock, qplockflags); nes_cm_disconn(nesqp); } else if ((nes_debug_level & 32768U) != 0U) { tmp___4 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u No fake disconnect, QP refcount=%d\n", "nes_modify_qp", 3162, nesqp->hwqp.qp_id, tmp___4); } else { } } else { ldv_spin_lock(); if ((unsigned long )nesqp->cm_id != (unsigned long )((struct iw_cm_id *)0)) { tmp___6 = atomic_add_return(1, & nesqp->close_timer_started); if (tmp___6 == 1) { (*((nesqp->cm_id)->add_ref))(nesqp->cm_id); if ((nes_debug_level & 32768U) != 0U) { tmp___5 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u Not decrementing QP refcount (%d), need ae to finish up, original_last_aeq = 0x%04X. last_aeq = 0x%04X, scheduling timer.\n", "nes_modify_qp", 3174, nesqp->hwqp.qp_id, tmp___5, (int )original_last_aeq, nesqp->last_aeq); } else { } schedule_nes_timer((struct nes_cm_node *)nesqp->cm_node, (struct sk_buff *)nesqp, 3, 1, 0); } else { } spin_unlock_irqrestore(& nesqp->lock, qplockflags); } else { spin_unlock_irqrestore(& nesqp->lock, qplockflags); if ((nes_debug_level & 32768U) != 0U) { tmp___7 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u Not decrementing QP refcount (%d), need ae to finish up, original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n", "nes_modify_qp", 3184, nesqp->hwqp.qp_id, tmp___7, (int )original_last_aeq, nesqp->last_aeq); } else { } } } } else if ((nes_debug_level & 32768U) != 0U) { tmp___8 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u Decrementing QP refcount (%d), No ae to finish up, original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n", "nes_modify_qp", 3191, nesqp->hwqp.qp_id, tmp___8, (int )original_last_aeq, nesqp->last_aeq); } else { } } else if ((nes_debug_level & 32768U) != 0U) { tmp___9 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u Decrementing QP refcount (%d), No ae to finish up, original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n", "nes_modify_qp", 3197, nesqp->hwqp.qp_id, tmp___9, (int )original_last_aeq, nesqp->last_aeq); } else { } err = 0; if ((nes_debug_level & 32768U) != 0U) { tmp___10 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u Leaving, refcount=%d\n", "nes_modify_qp", 3203, nesqp->hwqp.qp_id, tmp___10); } else { } return (err); } } static int nes_multicast_attach(struct ib_qp *ibqp , union ib_gid *gid , u16 lid ) { { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: \n", "nes_multicast_attach", 3214); } else { } return (-38); } } static int nes_multicast_detach(struct ib_qp *ibqp , union ib_gid *gid , u16 lid ) { { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: \n", "nes_multicast_detach", 3224); } else { } return (-38); } } static int nes_process_mad(struct ib_device *ibdev , int mad_flags , u8 port_num , struct ib_wc const *in_wc , struct ib_grh const *in_grh , struct ib_mad_hdr const *in , size_t in_mad_size , struct ib_mad_hdr *out , size_t *out_mad_size , u16 *out_mad_pkey_index ) { { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: \n", "nes_process_mad", 3238); } else { } return (-38); } } __inline static void fill_wqe_sg_send(struct nes_hw_qp_wqe *wqe , struct ib_send_wr *ib_wr , u32 uselkey ) { int sge_index ; int total_payload_length ; { total_payload_length = 0; sge_index = 0; goto ldv_62468; ldv_62467: set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), (u32 )((sge_index + 4) * 4), (ib_wr->sg_list + (unsigned long )sge_index)->addr); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), (u32 )(sge_index * 4 + 18), (ib_wr->sg_list + (unsigned long )sge_index)->length); if (uselkey != 0U) { set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), (u32 )(sge_index * 4 + 19), (ib_wr->sg_list + (unsigned long )sge_index)->lkey); } else { set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), (u32 )(sge_index * 4 + 19), 0U); } total_payload_length = (int )((ib_wr->sg_list + (unsigned long )sge_index)->length + (u32 )total_payload_length); sge_index = sge_index + 1; ldv_62468: ; if (ib_wr->num_sge > sge_index) { goto ldv_62467; } else { } if ((nes_debug_level & 262144U) != 0U) { printk("\viw_nes: %s[%u]: UC UC UC, sending total_payload_length=%u \n", "fill_wqe_sg_send", 3261, total_payload_length); } else { } set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 1U, (u32 )total_payload_length); return; } } static int nes_post_send(struct ib_qp *ibqp , struct ib_send_wr *ib_wr , struct ib_send_wr **bad_wr ) { u64 u64temp ; unsigned long flags ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_qp *nesqp ; struct nes_qp *tmp___0 ; struct nes_hw_qp_wqe *wqe ; int err ; u32 qsize ; u32 head ; u32 wqe_misc ; u32 wqe_count ; u32 counter ; int i ; int flags___0 ; struct nes_ib_fast_reg_page_list *pnesfrpl ; struct ib_fast_reg_page_list const *__mptr ; u64 *src_page_list ; u64 *dst_page_list ; u32 _min1 ; unsigned int _min2 ; { flags = 0UL; tmp = to_nesvnic(ibqp->device); nesvnic = tmp; nesdev = nesvnic->nesdev; tmp___0 = to_nesqp(ibqp); nesqp = tmp___0; err = 0; qsize = (u32 )nesqp->hwqp.sq_size; wqe_misc = 0U; wqe_count = 0U; if ((unsigned int )nesqp->ibqp_state > 3U) { err = -22; goto out; } else { } ldv_spin_lock(); head = (u32 )nesqp->hwqp.sq_head; goto ldv_62511; ldv_62510: ; if ((unsigned int )nesqp->term_flags != 0U) { err = -22; goto ldv_62489; } else { } if (((qsize * 2U + head) - (u32 )nesqp->hwqp.sq_tail) % qsize == qsize - 1U) { err = -12; goto ldv_62489; } else { } wqe = nesqp->hwqp.sq_vbase + (unsigned long )head; nes_fill_init_qp_wqe(wqe, nesqp, head); u64temp = ib_wr->wr_id; set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 4U, u64temp); switch ((unsigned int )ib_wr->opcode) { case 2U: ; case 8U: ; if ((unsigned int )ib_wr->opcode == 2U) { if ((ib_wr->send_flags & 4) != 0) { wqe_misc = 5U; } else { wqe_misc = 3U; } } else { if ((ib_wr->send_flags & 4) != 0) { wqe_misc = 6U; } else { wqe_misc = 4U; } set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 7U, ib_wr->ex.invalidate_rkey); } if ((u32 )ib_wr->num_sge > (nesdev->nesadapter)->max_sge) { err = -22; goto ldv_62492; } else { } if (ib_wr->send_flags & 1) { wqe_misc = wqe_misc | 1073741824U; } else { } if (((ib_wr->send_flags & 8) != 0 && (nes_drv_opt & 128U) == 0U) && (ib_wr->sg_list)->length <= 64U) { memcpy((void *)(& wqe->wqe_words) + 12U, (void const *)(ib_wr->sg_list)->addr, (size_t )(ib_wr->sg_list)->length); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 1U, (ib_wr->sg_list)->length); wqe_misc = wqe_misc | 268435456U; } else { fill_wqe_sg_send(wqe, ib_wr, 1U); } goto ldv_62492; case 0U: wqe_misc = 0U; if ((u32 )ib_wr->num_sge > (nesdev->nesadapter)->max_sge) { if ((nes_debug_level & 262144U) != 0U) { printk("\viw_nes: %s[%u]: Exceeded max sge, ib_wr=%u, max=%u\n", "nes_post_send", 3357, ib_wr->num_sge, (nesdev->nesadapter)->max_sge); } else { } err = -22; goto ldv_62492; } else { } if (ib_wr->send_flags & 1) { wqe_misc = wqe_misc | 1073741824U; } else { } set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 11U, ib_wr->wr.rdma.rkey); set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 8U, ib_wr->wr.rdma.remote_addr); if (((ib_wr->send_flags & 8) != 0 && (nes_drv_opt & 128U) == 0U) && (ib_wr->sg_list)->length <= 64U) { memcpy((void *)(& wqe->wqe_words) + 12U, (void const *)(ib_wr->sg_list)->addr, (size_t )(ib_wr->sg_list)->length); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 1U, (ib_wr->sg_list)->length); wqe_misc = wqe_misc | 268435456U; } else { fill_wqe_sg_send(wqe, ib_wr, 1U); } wqe->wqe_words[10] = wqe->wqe_words[1]; goto ldv_62492; case 4U: ; case 9U: ; if (ib_wr->num_sge > 1) { if ((nes_debug_level & 262144U) != 0U) { printk("\viw_nes: %s[%u]: Exceeded max sge, ib_wr=%u, max=1\n", "nes_post_send", 3390, ib_wr->num_sge); } else { } err = -22; goto ldv_62492; } else { } if ((unsigned int )ib_wr->opcode == 4U) { wqe_misc = 1U; } else { wqe_misc = 11U; set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 7U, ib_wr->ex.invalidate_rkey); } set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 8U, ib_wr->wr.rdma.remote_addr); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 11U, ib_wr->wr.rdma.rkey); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 10U, (ib_wr->sg_list)->length); set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 16U, (ib_wr->sg_list)->addr); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 19U, (ib_wr->sg_list)->lkey); goto ldv_62492; case 10U: wqe_misc = 10U; set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 6U, ib_wr->ex.invalidate_rkey); goto ldv_62492; case 11U: flags___0 = ib_wr->wr.fast_reg.access_flags; __mptr = (struct ib_fast_reg_page_list const *)ib_wr->wr.fast_reg.page_list; pnesfrpl = (struct nes_ib_fast_reg_page_list *)__mptr; src_page_list = pnesfrpl->ibfrpl.page_list; dst_page_list = pnesfrpl->nes_wqe_pbl.kva; if (ib_wr->wr.fast_reg.page_list_len > 512U) { if ((nes_debug_level & 262144U) != 0U) { printk("\viw_nes: %s[%u]: SQ_FMR: bad page_list_len\n", "nes_post_send", 3432); } else { } err = -22; goto ldv_62492; } else { } wqe_misc = 9U; set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 10U, ib_wr->wr.fast_reg.iova_start); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 8U, ib_wr->wr.fast_reg.length); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 9U, 0U); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 7U, ib_wr->wr.fast_reg.rkey); if (ib_wr->wr.fast_reg.page_shift == 12U) { wqe_misc = wqe_misc; } else if (ib_wr->wr.fast_reg.page_shift == 21U) { wqe_misc = wqe_misc | 128U; } else { if ((nes_debug_level & 262144U) != 0U) { printk("\viw_nes: %s[%u]: Invalid page shift, ib_wr=%u, max=1\n", "nes_post_send", 3455, ib_wr->num_sge); } else { } err = -22; goto ldv_62492; } wqe_misc = wqe_misc | 65536U; if (flags___0 & 1) { wqe_misc = wqe_misc | 131072U; } else { } if ((flags___0 & 2) != 0) { wqe_misc = wqe_misc | 524288U; } else { } if ((flags___0 & 4) != 0) { wqe_misc = wqe_misc | 262144U; } else { } if ((flags___0 & 16) != 0) { wqe_misc = wqe_misc | 1048576U; } else { } if (ib_wr->wr.fast_reg.page_list_len > pnesfrpl->ibfrpl.max_page_list_len) { if ((nes_debug_level & 262144U) != 0U) { printk("\viw_nes: %s[%u]: Invalid page list length, ib_wr=%p, value=%u, max=%u\n", "nes_post_send", 3479, ib_wr, ib_wr->wr.fast_reg.page_list_len, pnesfrpl->ibfrpl.max_page_list_len); } else { } err = -22; goto ldv_62492; } else { } set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 12U, pnesfrpl->nes_wqe_pbl.paddr); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 14U, ib_wr->wr.fast_reg.page_list_len * 8U); i = 0; goto ldv_62507; ldv_62506: *(dst_page_list + (unsigned long )i) = *(src_page_list + (unsigned long )i); i = i + 1; ldv_62507: ; if ((unsigned int )i < ib_wr->wr.fast_reg.page_list_len) { goto ldv_62506; } else { } if ((nes_debug_level & 262144U) != 0U) { printk("\viw_nes: %s[%u]: SQ_FMR: iova_start: %llx, length: %d, rkey: %0x, pgl_paddr: %llx, page_list_len: %u, wqe_misc: %x\n", "nes_post_send", 3503, ib_wr->wr.fast_reg.iova_start, ib_wr->wr.fast_reg.length, ib_wr->wr.fast_reg.rkey, pnesfrpl->nes_wqe_pbl.paddr, ib_wr->wr.fast_reg.page_list_len, wqe_misc); } else { } goto ldv_62492; default: err = -22; goto ldv_62492; } ldv_62492: ; if (err != 0) { goto ldv_62489; } else { } if ((ib_wr->send_flags & 2) != 0 || (unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { wqe_misc = wqe_misc | 2147483648U; } else { } wqe->wqe_words[0] = wqe_misc; ib_wr = ib_wr->next; head = head + 1U; wqe_count = wqe_count + 1U; if (head >= qsize) { head = 0U; } else { } ldv_62511: ; if ((unsigned long )ib_wr != (unsigned long )((struct ib_send_wr *)0)) { goto ldv_62510; } else { } ldv_62489: nesqp->hwqp.sq_head = (u16 )head; __asm__ volatile ("": : : "memory"); goto ldv_62516; ldv_62515: _min1 = wqe_count; _min2 = 255U; counter = _min1 < _min2 ? _min1 : _min2; wqe_count = wqe_count - counter; nes_write32(nesdev->regs + 64UL, ((counter << 24) | nesqp->hwqp.qp_id) | 8388608U); ldv_62516: ; if (wqe_count != 0U) { goto ldv_62515; } else { } spin_unlock_irqrestore(& nesqp->lock, flags); out: ; if (err != 0) { *bad_wr = ib_wr; } else { } return (err); } } static int nes_post_recv(struct ib_qp *ibqp , struct ib_recv_wr *ib_wr , struct ib_recv_wr **bad_wr ) { u64 u64temp ; unsigned long flags ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_qp *nesqp ; struct nes_qp *tmp___0 ; struct nes_hw_qp_wqe *wqe ; int err ; int sge_index ; u32 qsize ; u32 head ; u32 wqe_count ; u32 counter ; u32 total_payload_length ; u32 _min1 ; unsigned int _min2 ; { flags = 0UL; tmp = to_nesvnic(ibqp->device); nesvnic = tmp; nesdev = nesvnic->nesdev; tmp___0 = to_nesqp(ibqp); nesqp = tmp___0; err = 0; qsize = (u32 )nesqp->hwqp.rq_size; wqe_count = 0U; if ((unsigned int )nesqp->ibqp_state > 3U) { err = -22; goto out; } else { } ldv_spin_lock(); head = (u32 )nesqp->hwqp.rq_head; goto ldv_62543; ldv_62542: ; if ((unsigned int )nesqp->term_flags != 0U) { err = -22; goto ldv_62537; } else { } if ((u32 )ib_wr->num_sge > (nesdev->nesadapter)->max_sge) { err = -22; goto ldv_62537; } else { } if (((qsize * 2U + head) - (u32 )nesqp->hwqp.rq_tail) % qsize == qsize - 1U) { err = -12; goto ldv_62537; } else { } if ((nes_debug_level & 131072U) != 0U) { printk("\viw_nes: %s[%u]: ibwr sge count = %u.\n", "nes_post_recv", 3592, ib_wr->num_sge); } else { } wqe = nesqp->hwqp.rq_vbase + (unsigned long )head; nes_fill_init_qp_wqe(wqe, nesqp, head); u64temp = ib_wr->wr_id; set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 4U, u64temp); total_payload_length = 0U; sge_index = 0; goto ldv_62540; ldv_62539: set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), (u32 )((sge_index + 2) * 4), (ib_wr->sg_list + (unsigned long )sge_index)->addr); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), (u32 )(sge_index * 4 + 10), (ib_wr->sg_list + (unsigned long )sge_index)->length); set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), (u32 )(sge_index * 4 + 11), (ib_wr->sg_list + (unsigned long )sge_index)->lkey); total_payload_length = (ib_wr->sg_list + (unsigned long )sge_index)->length + total_payload_length; sge_index = sge_index + 1; ldv_62540: ; if (ib_wr->num_sge > sge_index) { goto ldv_62539; } else { } set_wqe_32bit_value((__le32 *)(& wqe->wqe_words), 1U, total_payload_length); ib_wr = ib_wr->next; head = head + 1U; wqe_count = wqe_count + 1U; if (head >= qsize) { head = 0U; } else { } ldv_62543: ; if ((unsigned long )ib_wr != (unsigned long )((struct ib_recv_wr *)0)) { goto ldv_62542; } else { } ldv_62537: nesqp->hwqp.rq_head = (u16 )head; __asm__ volatile ("": : : "memory"); goto ldv_62548; ldv_62547: _min1 = wqe_count; _min2 = 255U; counter = _min1 < _min2 ? _min1 : _min2; wqe_count = wqe_count - counter; nes_write32(nesdev->regs + 64UL, (counter << 24) | nesqp->hwqp.qp_id); ldv_62548: ; if (wqe_count != 0U) { goto ldv_62547; } else { } spin_unlock_irqrestore(& nesqp->lock, flags); out: ; if (err != 0) { *bad_wr = ib_wr; } else { } return (err); } } static int nes_poll_cq(struct ib_cq *ibcq , int num_entries , struct ib_wc *entry ) { u64 u64temp ; u64 wrid ; unsigned long flags ; struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_cq *nescq ; struct nes_cq *tmp___0 ; struct nes_qp *nesqp ; struct nes_hw_cqe cqe ; u32 head ; u32 wq_tail ; u32 cq_size ; u32 cqe_count ; u32 wqe_index ; u32 u32temp ; u32 move_cq_head ; u32 err_code ; { flags = 0UL; tmp = to_nesvnic(ibcq->device); nesvnic = tmp; nesdev = nesvnic->nesdev; tmp___0 = to_nescq(ibcq); nescq = tmp___0; wq_tail = 0U; cqe_count = 0U; move_cq_head = 1U; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: \n", "nes_poll_cq", 3661); } else { } ldv_spin_lock(); head = (u32 )nescq->hw_cq.cq_head; cq_size = (u32 )nescq->hw_cq.cq_size; goto ldv_62583; ldv_62582: ; if ((int )(nescq->hw_cq.cq_vbase + (unsigned long )head)->cqe_words[7] >= 0) { goto ldv_62572; } else { } __asm__ volatile ("lfence": : : "memory"); cqe = *(nescq->hw_cq.cq_vbase + (unsigned long )head); u32temp = cqe.cqe_words[2]; wqe_index = ((nesdev->nesadapter)->max_qp_wr - 1U) & u32temp; u32temp = u32temp & 4294966272U; u64temp = ((unsigned long long )cqe.cqe_words[3] << 32) | (unsigned long long )u32temp; if (u64temp != 0ULL) { nesqp = (struct nes_qp *)u64temp; memset((void *)entry, 0, 64UL); if (cqe.cqe_words[6] == 0U) { entry->status = 0; } else { err_code = cqe.cqe_words[6]; if (err_code >> 16 == 32768U) { entry->status = (enum ib_wc_status )(err_code & 65535U); (nescq->hw_cq.cq_vbase + (unsigned long )head)->cqe_words[6] = 65537U; } else { entry->status = 5; } } entry->qp = & nesqp->ibqp; entry->src_qp = nesqp->hwqp.qp_id; if ((cqe.cqe_words[7] & 256U) != 0U) { if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { nesqp->skip_lsmm = 0U; nesqp->hwqp.sq_tail = (u16 )((int )nesqp->hwqp.sq_tail + 1); } else { } wrid = ((unsigned long long )(nesqp->hwqp.sq_vbase + (unsigned long )wqe_index)->wqe_words[5] << 32) | (unsigned long long )(nesqp->hwqp.sq_vbase + (unsigned long )wqe_index)->wqe_words[4]; entry->byte_len = (nesqp->hwqp.sq_vbase + (unsigned long )wqe_index)->wqe_words[1]; switch ((nesqp->hwqp.sq_vbase + (unsigned long )wqe_index)->wqe_words[0] & 63U) { case 0U: ; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Operation = RDMA WRITE.\n", "nes_poll_cq", 3725); } else { } entry->opcode = 1; goto ldv_62574; case 1U: ; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Operation = RDMA READ.\n", "nes_poll_cq", 3729); } else { } entry->opcode = 2; entry->byte_len = (nesqp->hwqp.sq_vbase + (unsigned long )wqe_index)->wqe_words[10]; goto ldv_62574; case 4U: ; case 6U: ; case 3U: ; case 5U: ; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Operation = Send.\n", "nes_poll_cq", 3738); } else { } entry->opcode = 0; goto ldv_62574; case 10U: entry->opcode = 7; goto ldv_62574; case 9U: entry->opcode = 8; goto ldv_62574; } ldv_62574: nesqp->hwqp.sq_tail = ((unsigned int )((u16 )wqe_index) + 1U) & ((unsigned int )nesqp->hwqp.sq_size + 65535U); if ((unsigned int )entry->status != 0U && (int )nesqp->hwqp.sq_tail != (int )nesqp->hwqp.sq_head) { move_cq_head = 0U; wq_tail = (u32 )nesqp->hwqp.sq_tail; } else { } } else { entry->byte_len = cqe.cqe_words[0]; wrid = (unsigned long long )(nesqp->hwqp.rq_vbase + (unsigned long )wqe_index)->wqe_words[4] | ((unsigned long long )(nesqp->hwqp.rq_vbase + (unsigned long )wqe_index)->wqe_words[5] << 32); entry->opcode = 128; nesqp->hwqp.rq_tail = ((unsigned int )((u16 )wqe_index) + 1U) & ((unsigned int )nesqp->hwqp.rq_size + 65535U); if ((unsigned int )entry->status != 0U && (int )nesqp->hwqp.rq_tail != (int )nesqp->hwqp.rq_head) { move_cq_head = 0U; wq_tail = (u32 )nesqp->hwqp.rq_tail; } else { } } entry->wr_id = wrid; entry = entry + 1; cqe_count = cqe_count + 1U; } else { } if (move_cq_head != 0U) { (nescq->hw_cq.cq_vbase + (unsigned long )head)->cqe_words[7] = 0U; head = head + 1U; if (head >= cq_size) { head = 0U; } else { } nescq->polled_completions = nescq->polled_completions + 1U; if (nescq->polled_completions > cq_size / 2U || nescq->polled_completions == 255U) { if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: CQ%u Issuing CQE Allocate since more than half of cqes are pending %u of %u.\n", "nes_poll_cq", 3783, (int )nescq->hw_cq.cq_number, nescq->polled_completions, cq_size); } else { } nes_write32(nesdev->regs + 68UL, (u32 )nescq->hw_cq.cq_number | (nescq->polled_completions << 16)); nescq->polled_completions = 0U; } else { } } else { wqe_index = cqe.cqe_words[2]; wqe_index = (- (nesdev->nesadapter)->max_qp_wr & wqe_index) | wq_tail; (nescq->hw_cq.cq_vbase + (unsigned long )head)->cqe_words[2] = wqe_index; move_cq_head = 1U; } ldv_62583: ; if ((u32 )num_entries > cqe_count) { goto ldv_62582; } else { } ldv_62572: ; if (nescq->polled_completions != 0U) { nes_write32(nesdev->regs + 68UL, (u32 )nescq->hw_cq.cq_number | (nescq->polled_completions << 16)); nescq->polled_completions = 0U; } else { } nescq->hw_cq.cq_head = (u16 )head; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Reporting %u completions for CQ%u.\n", "nes_poll_cq", 3806, cqe_count, (int )nescq->hw_cq.cq_number); } else { } spin_unlock_irqrestore(& nescq->lock, flags); return ((int )cqe_count); } } static int nes_req_notify_cq(struct ib_cq *ibcq , enum ib_cq_notify_flags notify_flags ) { struct nes_vnic *nesvnic ; struct nes_vnic *tmp ; struct nes_device *nesdev ; struct nes_cq *nescq ; struct nes_cq *tmp___0 ; u32 cq_arm ; { tmp = to_nesvnic(ibcq->device); nesvnic = tmp; nesdev = nesvnic->nesdev; tmp___0 = to_nescq(ibcq); nescq = tmp___0; if ((nes_debug_level & 8192U) != 0U) { printk("\viw_nes: %s[%u]: Requesting notification for CQ%u.\n", "nes_req_notify_cq", 3825, (int )nescq->hw_cq.cq_number); } else { } cq_arm = (u32 )nescq->hw_cq.cq_number; if (((unsigned int )notify_flags & 3U) == 2U) { cq_arm = cq_arm | 536870912U; } else if (((unsigned int )notify_flags & 3U) == 1U) { cq_arm = cq_arm | 1073741824U; } else { return (-22); } nes_write32(nesdev->regs + 68UL, cq_arm); nes_read32((void const *)nesdev->regs + 68U); return (0); } } static int nes_port_immutable(struct ib_device *ibdev , u8 port_num , struct ib_port_immutable *immutable ) { struct ib_port_attr attr ; int err ; { err = nes_query_port(ibdev, (int )port_num, & attr); if (err != 0) { return (err); } else { } immutable->pkey_tbl_len = (int )attr.pkey_tbl_len; immutable->gid_tbl_len = attr.gid_tbl_len; immutable->core_cap_flags = 4194312U; return (0); } } struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev ) { struct nes_ib_device *nesibdev ; struct nes_vnic *nesvnic ; void *tmp ; struct nes_device *nesdev ; struct ib_device *tmp___0 ; void *tmp___1 ; { tmp = netdev_priv((struct net_device const *)netdev); nesvnic = (struct nes_vnic *)tmp; nesdev = nesvnic->nesdev; tmp___0 = ib_alloc_device(2528UL); nesibdev = (struct nes_ib_device *)tmp___0; if ((unsigned long )nesibdev == (unsigned long )((struct nes_ib_device *)0)) { return ((struct nes_ib_device *)0); } else { } strlcpy((char *)(& nesibdev->ibdev.name), "nes%d", 64UL); nesibdev->ibdev.owner = & __this_module; nesibdev->ibdev.node_type = 4U; memset((void *)(& nesibdev->ibdev.node_guid), 0, 8UL); memcpy((void *)(& nesibdev->ibdev.node_guid), (void const *)netdev->dev_addr, 6UL); nesibdev->ibdev.uverbs_cmd_mask = 1035461439ULL; nesibdev->ibdev.phys_port_cnt = 1U; nesibdev->ibdev.num_comp_vectors = 1; nesibdev->ibdev.dma_device = & (nesdev->pcidev)->dev; nesibdev->ibdev.dev.parent = & (nesdev->pcidev)->dev; nesibdev->ibdev.query_device = & nes_query_device; nesibdev->ibdev.query_port = & nes_query_port; nesibdev->ibdev.query_pkey = & nes_query_pkey; nesibdev->ibdev.query_gid = & nes_query_gid; nesibdev->ibdev.alloc_ucontext = & nes_alloc_ucontext; nesibdev->ibdev.dealloc_ucontext = & nes_dealloc_ucontext; nesibdev->ibdev.mmap = & nes_mmap; nesibdev->ibdev.alloc_pd = & nes_alloc_pd; nesibdev->ibdev.dealloc_pd = & nes_dealloc_pd; nesibdev->ibdev.create_ah = & nes_create_ah; nesibdev->ibdev.destroy_ah = & nes_destroy_ah; nesibdev->ibdev.create_qp = & nes_create_qp; nesibdev->ibdev.modify_qp = & nes_modify_qp; nesibdev->ibdev.query_qp = & nes_query_qp; nesibdev->ibdev.destroy_qp = & nes_destroy_qp; nesibdev->ibdev.create_cq = & nes_create_cq; nesibdev->ibdev.destroy_cq = & nes_destroy_cq; nesibdev->ibdev.poll_cq = & nes_poll_cq; nesibdev->ibdev.get_dma_mr = & nes_get_dma_mr; nesibdev->ibdev.reg_phys_mr = & nes_reg_phys_mr; nesibdev->ibdev.reg_user_mr = & nes_reg_user_mr; nesibdev->ibdev.dereg_mr = & nes_dereg_mr; nesibdev->ibdev.alloc_mw = & nes_alloc_mw; nesibdev->ibdev.dealloc_mw = & nes_dealloc_mw; nesibdev->ibdev.bind_mw = & nes_bind_mw; nesibdev->ibdev.alloc_fast_reg_mr = & nes_alloc_fast_reg_mr; nesibdev->ibdev.alloc_fast_reg_page_list = & nes_alloc_fast_reg_page_list; nesibdev->ibdev.free_fast_reg_page_list = & nes_free_fast_reg_page_list; nesibdev->ibdev.attach_mcast = & nes_multicast_attach; nesibdev->ibdev.detach_mcast = & nes_multicast_detach; nesibdev->ibdev.process_mad = & nes_process_mad; nesibdev->ibdev.req_notify_cq = & nes_req_notify_cq; nesibdev->ibdev.post_send = & nes_post_send; nesibdev->ibdev.post_recv = & nes_post_recv; tmp___1 = kzalloc(64UL, 208U); nesibdev->ibdev.iwcm = (struct iw_cm_verbs *)tmp___1; if ((unsigned long )nesibdev->ibdev.iwcm == (unsigned long )((struct iw_cm_verbs *)0)) { ib_dealloc_device(& nesibdev->ibdev); return ((struct nes_ib_device *)0); } else { } (nesibdev->ibdev.iwcm)->add_ref = & nes_add_ref; (nesibdev->ibdev.iwcm)->rem_ref = & nes_rem_ref; (nesibdev->ibdev.iwcm)->get_qp = & nes_get_qp; (nesibdev->ibdev.iwcm)->connect = & nes_connect; (nesibdev->ibdev.iwcm)->accept = & nes_accept; (nesibdev->ibdev.iwcm)->reject = & nes_reject; (nesibdev->ibdev.iwcm)->create_listen = & nes_create_listen; (nesibdev->ibdev.iwcm)->destroy_listen = & nes_destroy_listen; nesibdev->ibdev.get_port_immutable = & nes_port_immutable; return (nesibdev); } } static void nes_handle_delayed_event(unsigned long data ) { struct nes_vnic *nesvnic ; struct ib_event event ; { nesvnic = (struct nes_vnic *)data; if ((unsigned int )nesvnic->delayed_event != (unsigned int )nesvnic->last_dispatched_event) { event.device = & (nesvnic->nesibdev)->ibdev; if ((unsigned long )event.device == (unsigned long )((struct ib_device *)0)) { goto stop_timer; } else { } event.event = nesvnic->delayed_event; event.element.port_num = (unsigned int )nesvnic->logical_port + 1U; ib_dispatch_event(& event); } else { } stop_timer: nesvnic->event_timer.function = (void (*)(unsigned long ))0; return; } } void nes_port_ibevent(struct nes_vnic *nesvnic ) { struct nes_ib_device *nesibdev ; struct nes_device *nesdev ; struct ib_event event ; unsigned long tmp ; unsigned long tmp___0 ; { nesibdev = nesvnic->nesibdev; nesdev = nesvnic->nesdev; event.device = & nesibdev->ibdev; event.element.port_num = (unsigned int )nesvnic->logical_port + 1U; event.event = (unsigned int )nesdev->iw_status != 0U ? 9 : 10; if ((unsigned long )nesvnic->event_timer.function == (unsigned long )((void (*)(unsigned long ))0)) { ib_dispatch_event(& event); nesvnic->last_dispatched_event = event.event; nesvnic->event_timer.function = & nes_handle_delayed_event; nesvnic->event_timer.data = (unsigned long )nesvnic; tmp = msecs_to_jiffies(100U); nesvnic->event_timer.expires = tmp + (unsigned long )jiffies; add_timer(& nesvnic->event_timer); } else { tmp___0 = msecs_to_jiffies(100U); ldv_mod_timer_262(& nesvnic->event_timer, tmp___0 + (unsigned long )jiffies); } nesvnic->delayed_event = event.event; return; } } void nes_destroy_ofa_device(struct nes_ib_device *nesibdev ) { { if ((unsigned long )nesibdev == (unsigned long )((struct nes_ib_device *)0)) { return; } else { } nes_unregister_ofa_device(nesibdev); kfree((void const *)nesibdev->ibdev.iwcm); ib_dealloc_device(& nesibdev->ibdev); return; } } int nes_register_ofa_device(struct nes_ib_device *nesibdev ) { struct nes_vnic *nesvnic ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; int i ; int ret ; { nesvnic = nesibdev->nesvnic; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; ret = ib_register_device(& (nesvnic->nesibdev)->ibdev, (int (*)(struct ib_device * , u8 , struct kobject * ))0); if (ret != 0) { return (ret); } else { } nesibdev->max_cq = (nesadapter->max_cq - 64U) / (u32 )nesadapter->port_count; nesibdev->max_mr = nesadapter->max_mr / (u32 )nesadapter->port_count; nesibdev->max_qp = (nesadapter->max_qp - 64U) / (u32 )nesadapter->port_count; nesibdev->max_pd = nesadapter->max_pd / (u32 )nesadapter->port_count; i = 0; goto ldv_62635; ldv_62634: ret = device_create_file(& nesibdev->ibdev.dev, (struct device_attribute const *)nes_dev_attributes[i]); if (ret != 0) { goto ldv_62632; ldv_62631: i = i - 1; device_remove_file(& nesibdev->ibdev.dev, (struct device_attribute const *)nes_dev_attributes[i]); ldv_62632: ; if (i > 0) { goto ldv_62631; } else { } ib_unregister_device(& nesibdev->ibdev); return (ret); } else { } i = i + 1; ldv_62635: ; if ((unsigned int )i <= 3U) { goto ldv_62634; } else { } nesvnic->of_device_registered = 1U; return (0); } } static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev ) { struct nes_vnic *nesvnic ; int i ; { nesvnic = nesibdev->nesvnic; i = 0; goto ldv_62645; ldv_62644: device_remove_file(& nesibdev->ibdev.dev, (struct device_attribute const *)nes_dev_attributes[i]); i = i + 1; ldv_62645: ; if ((unsigned int )i <= 3U) { goto ldv_62644; } else { } if ((unsigned int )nesvnic->of_device_registered != 0U) { ib_unregister_device(& nesibdev->ibdev); } else { } nesvnic->of_device_registered = 0U; return; } } void activate_pending_timer_9(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_9 == (unsigned long )timer) { if (ldv_timer_state_9 == 2 || pending_flag != 0) { ldv_timer_list_9 = timer; ldv_timer_list_9->data = data; ldv_timer_state_9 = 1; } else { } return; } else { } reg_timer_9(timer); ldv_timer_list_9->data = data; return; } } int reg_timer_9(struct timer_list *timer ) { { ldv_timer_list_9 = timer; ldv_timer_state_9 = 1; return (0); } } void disable_suitable_timer_9(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_9) { ldv_timer_state_9 = 0; return; } else { } return; } } void choose_timer_9(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_9 = 2; return; } } void ldv_main_exported_16(void) { struct device_attribute *ldvarg22 ; void *tmp ; struct device *ldvarg20 ; void *tmp___0 ; char *ldvarg21 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(48UL); ldvarg22 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg20 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg21 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_16 == 1) { show_rev(ldvarg20, ldvarg22, ldvarg21); ldv_state_variable_16 = 1; } else { } goto ldv_62668; default: ldv_stop(); } ldv_62668: ; return; } } void ldv_main_exported_13(void) { struct device *ldvarg47 ; void *tmp ; struct device_attribute *ldvarg49 ; void *tmp___0 ; char *ldvarg48 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1416UL); ldvarg47 = (struct device *)tmp; tmp___0 = ldv_init_zalloc(48UL); ldvarg49 = (struct device_attribute *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg48 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_13 == 1) { show_board(ldvarg47, ldvarg49, ldvarg48); ldv_state_variable_13 = 1; } else { } goto ldv_62677; default: ldv_stop(); } ldv_62677: ; return; } } void ldv_main_exported_15(void) { struct device_attribute *ldvarg62 ; void *tmp ; struct device *ldvarg60 ; void *tmp___0 ; char *ldvarg61 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(48UL); ldvarg62 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg60 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg61 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_15 == 1) { show_fw_ver(ldvarg60, ldvarg62, ldvarg61); ldv_state_variable_15 = 1; } else { } goto ldv_62686; default: ldv_stop(); } ldv_62686: ; return; } } void ldv_main_exported_14(void) { char *ldvarg36 ; void *tmp ; struct device *ldvarg35 ; void *tmp___0 ; struct device_attribute *ldvarg37 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1UL); ldvarg36 = (char *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg35 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(48UL); ldvarg37 = (struct device_attribute *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_14 == 1) { show_hca(ldvarg35, ldvarg37, ldvarg36); ldv_state_variable_14 = 1; } else { } goto ldv_62695; default: ldv_stop(); } ldv_62695: ; return; } } __inline static void *ERR_PTR(long error ) { void *tmp ; { tmp = ldv_err_ptr(error); return (tmp); } } __inline static bool IS_ERR(void const *ptr ) { bool tmp ; { tmp = ldv_is_err(ptr); return (tmp); } } bool ldv_queue_work_on_233(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_234(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_235(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___4 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_236(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_237(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___5 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void *ldv_kmem_cache_alloc_243(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_pskb_expand_head_249(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_251(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv_skb_copy_253(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_254(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_255(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_256(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } int ldv_pskb_expand_head_257(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } int ldv_pskb_expand_head_258(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_259(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } void *ldv_kmem_cache_alloc_260(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_del_timer_261(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_mod_timer_262(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } extern void __bad_percpu_size(void) ; extern void warn_slowpath_fmt(char const * , int const , char const * , ...) ; extern int memcmp(void const * , void const * , size_t ) ; __inline static bool IS_ERR(void const *ptr ) ; __inline static int atomic_sub_return(int i , atomic_t *v ) { int tmp ; { tmp = atomic_add_return(- i, v); return (tmp); } } extern int __preempt_count ; __inline static void __preempt_count_add(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%0": "+m" (__preempt_count): "qi" (val)); } goto ldv_6163; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6163; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6163; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%0": "+m" (__preempt_count): "re" (val)); } goto ldv_6163; default: __bad_percpu_size(); } ldv_6163: ; return; } } __inline static void __preempt_count_sub(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%0": "+m" (__preempt_count): "qi" (- val)); } goto ldv_6175; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6175; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6175; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%0": "+m" (__preempt_count): "re" (- val)); } goto ldv_6175; default: __bad_percpu_size(); } ldv_6175: ; return; } } extern void lock_acquire(struct lockdep_map * , unsigned int , int , int , int , struct lockdep_map * , unsigned long ) ; extern void lock_release(struct lockdep_map * , int , unsigned long ) ; extern void lockdep_rcu_suspicious(char const * , int const , char const * ) ; __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) ; extern struct timespec current_kernel_time(void) ; __inline static void __rcu_read_lock(void) { { __preempt_count_add(1); __asm__ volatile ("": : : "memory"); return; } } __inline static void __rcu_read_unlock(void) { { __asm__ volatile ("": : : "memory"); __preempt_count_sub(1); return; } } extern bool rcu_is_watching(void) ; __inline static void rcu_lock_acquire(struct lockdep_map *map ) { { lock_acquire(map, 0U, 0, 2, 0, (struct lockdep_map *)0, 0UL); return; } } __inline static void rcu_lock_release(struct lockdep_map *map ) { { lock_release(map, 1, 0UL); return; } } extern struct lockdep_map rcu_lock_map ; extern int debug_lockdep_rcu_enabled(void) ; __inline static void rcu_read_lock(void) { bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; { __rcu_read_lock(); rcu_lock_acquire(& rcu_lock_map); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 849, "rcu_read_lock() used illegally while idle"); } else { } } else { } return; } } __inline static void rcu_read_unlock(void) { bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; { tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 900, "rcu_read_unlock() used illegally while idle"); } else { } } else { } __rcu_read_unlock(); rcu_lock_release(& rcu_lock_map); return; } } __inline static int timer_pending(struct timer_list const *timer ) { { return ((unsigned long )timer->entry.pprev != (unsigned long )((struct hlist_node **/* const */)0)); } } int ldv_del_timer_315(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_318(struct timer_list *ldv_func_arg1 ) ; int ldv_mod_timer_312(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_313(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_314(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; extern struct workqueue_struct *__alloc_workqueue_key(char const * , unsigned int , int , struct lock_class_key * , char const * , ...) ; extern void destroy_workqueue(struct workqueue_struct * ) ; void ldv_destroy_workqueue_316(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_destroy_workqueue_317(struct workqueue_struct *ldv_func_arg1 ) ; bool ldv_queue_work_on_284(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_286(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_285(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_288(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_287(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_work(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = ldv_queue_work_on_284(8192, wq, work); return (tmp); } } void *ldv_kmem_cache_alloc_294(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_311(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; void activate_work_3(struct work_struct *work , int state ) ; void activate_pending_timer_10(struct timer_list *timer , unsigned long data , int pending_flag ) ; void call_and_disable_all_4(int state ) ; int reg_timer_10(struct timer_list *timer ) ; void call_and_disable_work_3(struct work_struct *work ) ; void disable_work_3(struct work_struct *work ) ; void invoke_work_4(void) ; void activate_work_4(struct work_struct *work , int state ) ; void disable_suitable_timer_10(struct timer_list *timer ) ; void disable_work_4(struct work_struct *work ) ; void invoke_work_3(void) ; void call_and_disable_all_3(int state ) ; void choose_timer_10(struct timer_list *timer ) ; void call_and_disable_work_4(struct work_struct *work ) ; struct sk_buff *ldv_skb_clone_302(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_310(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_304(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_300(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_308(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_309(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; extern unsigned char *skb_pull(struct sk_buff * , unsigned int ) ; __inline static void skb_reset_mac_header(struct sk_buff *skb ) { { skb->mac_header = (int )((__u16 )((long )skb->data)) - (int )((__u16 )((long )skb->head)); return; } } extern void skb_trim(struct sk_buff * , unsigned int ) ; struct sk_buff *ldv___netdev_alloc_skb_305(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_306(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_307(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct sk_buff *netdev_alloc_skb___0(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = ldv___netdev_alloc_skb_305(dev, length, 32U); return (tmp); } } __inline static struct sk_buff *dev_alloc_skb___0(unsigned int length ) { struct sk_buff *tmp ; { tmp = netdev_alloc_skb___0((struct net_device *)0, length); return (tmp); } } extern struct net init_net ; extern struct neighbour *neigh_lookup(struct neigh_table * , void const * , struct net_device * ) ; extern void neigh_destroy(struct neighbour * ) ; extern int __neigh_event_send(struct neighbour * , struct sk_buff * ) ; __inline static void neigh_release(struct neighbour *neigh ) { int tmp ; { tmp = atomic_dec_and_test(& neigh->refcnt); if (tmp != 0) { neigh_destroy(neigh); } else { } return; } } __inline static int neigh_event_send(struct neighbour *neigh , struct sk_buff *skb ) { unsigned long now ; int tmp ; { now = jiffies; if (neigh->used != now) { neigh->used = now; } else { } if (((int )neigh->nud_state & 218) == 0) { tmp = __neigh_event_send(neigh, skb); return (tmp); } else { } return (0); } } extern void dst_release(struct dst_entry * ) ; __inline static bool ether_addr_equal(u8 const *addr1 , u8 const *addr2 ) { u32 fold ; { fold = ((unsigned int )*((u32 const *)addr1) ^ (unsigned int )*((u32 const *)addr2)) | (unsigned int )((int )((unsigned short )*((u16 const *)addr1 + 4U)) ^ (int )((unsigned short )*((u16 const *)addr2 + 4U))); return (fold == 0U); } } extern struct neigh_table arp_tbl ; extern struct rtable *ip_route_output_flow(struct net * , struct flowi4 * , struct sock * ) ; __inline static struct rtable *ip_route_output_key(struct net *net , struct flowi4 *flp ) { struct rtable *tmp ; { tmp = ip_route_output_flow(net, flp, (struct sock *)0); return (tmp); } } __inline static struct rtable *ip_route_output(struct net *net , __be32 daddr , __be32 saddr , u8 tos , int oif ) { struct flowi4 fl4 ; struct rtable *tmp ; { fl4.__fl_common.flowic_oif = oif; fl4.__fl_common.flowic_iif = 0; fl4.__fl_common.flowic_mark = 0U; fl4.__fl_common.flowic_tos = tos; fl4.__fl_common.flowic_scope = (unsigned char)0; fl4.__fl_common.flowic_proto = (unsigned char)0; fl4.__fl_common.flowic_flags = (unsigned char)0; fl4.__fl_common.flowic_secid = 0U; fl4.saddr = saddr; fl4.daddr = daddr; fl4.uli.ports.dport = (unsigned short)0; fl4.uli.ports.sport = (unsigned short)0; tmp = ip_route_output_key(net, & fl4); return (tmp); } } __inline static void ip_rt_put(struct rtable *rt ) { { dst_release(& rt->dst); return; } } __inline static bool between(__u32 seq1 , __u32 seq2 , __u32 seq3 ) { { return (seq3 - seq2 >= seq1 - seq2); } } extern u32 crc32c(u32 , void const * , unsigned int ) ; extern int iwpm_valid_pid(void) ; extern int iwpm_register_pid(struct iwpm_dev_data * , u8 ) ; extern int iwpm_add_mapping(struct iwpm_sa_data * , u8 ) ; extern int iwpm_add_and_query_mapping(struct iwpm_sa_data * , u8 ) ; extern int iwpm_remove_mapping(struct __kernel_sockaddr_storage * , u8 ) ; extern int iwpm_get_remote_info(struct __kernel_sockaddr_storage * , struct __kernel_sockaddr_storage * , struct __kernel_sockaddr_storage * , u8 ) ; extern int iwpm_create_mapinfo(struct __kernel_sockaddr_storage * , struct __kernel_sockaddr_storage * , u8 ) ; extern int iwpm_remove_mapinfo(struct __kernel_sockaddr_storage * , struct __kernel_sockaddr_storage * ) ; int nes_add_ref_cm_node(struct nes_cm_node *cm_node ) ; int nes_rem_ref_cm_node(struct nes_cm_node *cm_node ) ; void nes_queue_mgt_skbs(struct sk_buff *skb , struct nes_vnic *nesvnic , struct nes_qp *nesqp ) ; atomic_t cm_connects ; atomic_t cm_accepts ; atomic_t cm_disconnects ; atomic_t cm_closes ; atomic_t cm_connecteds ; atomic_t cm_connect_reqs ; atomic_t cm_rejects ; u32 cm_packets_sent ; u32 cm_packets_bounced ; u32 cm_packets_created ; u32 cm_packets_received ; u32 cm_packets_dropped ; u32 cm_packets_retrans ; atomic_t cm_listens_created ; atomic_t cm_listens_destroyed ; u32 cm_backlog_drops ; atomic_t cm_loopbacks ; atomic_t cm_nodes_created ; atomic_t cm_nodes_destroyed ; atomic_t cm_accel_dropped_pkts ; atomic_t cm_resets_recvd ; __inline static __le32 get_crc_value(struct nes_v4_quad *nes_quad ) { u32 crc_value ; { crc_value = crc32c(4294967295U, (void const *)nes_quad, 16U); return (crc_value); } } __inline static u32 nes_read_indexed___3(struct nes_device *nesdev , u32 reg_index ) { unsigned long flags ; void *addr ; u32 value ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); value = readl((void const volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return (value); } } __inline static int mini_cm_accelerated(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) ; static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *cm_core , struct nes_vnic *nesvnic , struct nes_cm_info *cm_info ) ; static int mini_cm_del_listen(struct nes_cm_core *cm_core , struct nes_cm_listener *listener ) ; static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core , struct nes_vnic *nesvnic , u16 private_data_len , void *private_data , struct nes_cm_info *cm_info ) ; static int mini_cm_close(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) ; static int mini_cm_accept(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) ; static int mini_cm_reject(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) ; static int mini_cm_recv_pkt(struct nes_cm_core *cm_core , struct nes_vnic *nesvnic , struct sk_buff *skb ) ; static int mini_cm_dealloc_core(struct nes_cm_core *cm_core ) ; static int mini_cm_get(struct nes_cm_core *cm_core ) ; static int mini_cm_set(struct nes_cm_core *cm_core , u32 type , u32 value ) ; static void form_cm_frame(struct sk_buff *skb , struct nes_cm_node *cm_node , void *options , u32 optionsize , void *data , u32 datasize , u8 flags ) ; static int add_ref_cm_node(struct nes_cm_node *cm_node ) ; static int rem_ref_cm_node(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) ; static int nes_cm_disconn_true(struct nes_qp *nesqp ) ; static int nes_cm_post_event(struct nes_cm_event *event ) ; static int nes_disconnect(struct nes_qp *nesqp , int abrupt ) ; static void nes_disconnect_worker(struct work_struct *work ) ; static int send_mpa_request(struct nes_cm_node *cm_node , struct sk_buff *skb ) ; static int send_mpa_reject(struct nes_cm_node *cm_node ) ; static int send_syn(struct nes_cm_node *cm_node , u32 sendack , struct sk_buff *skb ) ; static int send_reset(struct nes_cm_node *cm_node , struct sk_buff *skb ) ; static int send_ack(struct nes_cm_node *cm_node , struct sk_buff *skb ) ; static int send_fin(struct nes_cm_node *cm_node , struct sk_buff *skb ) ; static void process_packet(struct nes_cm_node *cm_node , struct sk_buff *skb , struct nes_cm_core *cm_core ) ; static void active_open_err(struct nes_cm_node *cm_node , struct sk_buff *skb , int reset ) ; static void passive_open_err(struct nes_cm_node *cm_node , struct sk_buff *skb , int reset ) ; static void cleanup_retrans_entry(struct nes_cm_node *cm_node ) ; static void handle_rcv_mpa(struct nes_cm_node *cm_node , struct sk_buff *skb ) ; static void free_retrans_entry(struct nes_cm_node *cm_node ) ; static int handle_tcp_options(struct nes_cm_node *cm_node , struct tcphdr *tcph , struct sk_buff *skb , int optionsize , int passive ) ; static void cm_event_connected(struct nes_cm_event *event ) ; static void cm_event_connect_error(struct nes_cm_event *event ) ; static void cm_event_reset(struct nes_cm_event *event ) ; static void cm_event_mpa_req(struct nes_cm_event *event ) ; static void cm_event_mpa_reject(struct nes_cm_event *event ) ; static void handle_recv_entry(struct nes_cm_node *cm_node , u32 rem_node ) ; static int cm_build_mpa_frame(struct nes_cm_node *cm_node , u8 **start_buff , u16 *buff_len , u8 *pci_mem , u8 mpa_key ) ; static void build_mpa_v2(struct nes_cm_node *cm_node , void *start_addr , u8 mpa_key ) ; static void build_mpa_v1(struct nes_cm_node *cm_node , void *start_addr , u8 mpa_key ) ; static void build_rdma0_msg(struct nes_cm_node *cm_node , struct nes_qp **nesqp_addr ) ; static void print_core(struct nes_cm_core *core ) ; static void record_ird_ord(struct nes_cm_node *cm_node , u16 conn_ird , u16 conn_ord ) ; static struct nes_cm_ops nes_cm_api = {& mini_cm_accelerated, & mini_cm_listen, & mini_cm_del_listen, & mini_cm_connect, & mini_cm_close, & mini_cm_accept, & mini_cm_reject, & mini_cm_recv_pkt, & mini_cm_dealloc_core, & mini_cm_get, & mini_cm_set}; static struct nes_cm_core *g_cm_core ; int nes_add_ref_cm_node(struct nes_cm_node *cm_node ) { int tmp ; { tmp = add_ref_cm_node(cm_node); return (tmp); } } int nes_rem_ref_cm_node(struct nes_cm_node *cm_node ) { int tmp ; { tmp = rem_ref_cm_node(cm_node->cm_core, cm_node); return (tmp); } } static struct nes_cm_event *create_event(struct nes_cm_node *cm_node , enum nes_cm_event_type type ) { struct nes_cm_event *event ; void *tmp ; { if ((unsigned long )cm_node->cm_id == (unsigned long )((struct iw_cm_id *)0)) { return ((struct nes_cm_event *)0); } else { } tmp = kzalloc(136UL, 32U); event = (struct nes_cm_event *)tmp; if ((unsigned long )event == (unsigned long )((struct nes_cm_event *)0)) { return ((struct nes_cm_event *)0); } else { } event->type = type; event->cm_node = cm_node; event->cm_info.rem_addr = cm_node->rem_addr; event->cm_info.loc_addr = cm_node->loc_addr; event->cm_info.rem_port = cm_node->rem_port; event->cm_info.loc_port = cm_node->loc_port; event->cm_info.__annonCompField122.cm_id = cm_node->cm_id; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node=%p Created event=%p, type=%u, dst_addr=%08x[%x], src_addr=%08x[%x]\n", "create_event", 199, cm_node, event, (unsigned int )type, event->cm_info.loc_addr, (int )event->cm_info.loc_port, event->cm_info.rem_addr, (int )event->cm_info.rem_port); } else { } nes_cm_post_event(event); return (event); } } static int send_mpa_request(struct nes_cm_node *cm_node , struct sk_buff *skb ) { u8 start_addr ; u8 *start_ptr ; u8 **start_buff ; u16 buff_len ; int tmp ; { start_addr = 0U; start_ptr = & start_addr; start_buff = & start_ptr; buff_len = 0U; if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: skb set to NULL\n", "send_mpa_request", 217); } else { } return (-1); } else { } cm_build_mpa_frame(cm_node, start_buff, & buff_len, (u8 *)0U, 0); form_cm_frame(skb, cm_node, (void *)0, 0U, (void *)*start_buff, (u32 )buff_len, 1); tmp = schedule_nes_timer(cm_node, skb, 0, 1, 0); return (tmp); } } static int send_mpa_reject(struct nes_cm_node *cm_node ) { struct sk_buff *skb ; u8 start_addr ; u8 *start_ptr ; u8 **start_buff ; u16 buff_len ; struct ietf_mpa_v1 *mpa_frame ; int tmp ; { skb = (struct sk_buff *)0; start_addr = 0U; start_ptr = & start_addr; start_buff = & start_ptr; buff_len = 0U; skb = dev_alloc_skb___0(536U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a Free pkt\n", "send_mpa_reject", 241); } else { } return (-12); } else { } cm_build_mpa_frame(cm_node, start_buff, & buff_len, (u8 *)0U, 1); mpa_frame = (struct ietf_mpa_v1 *)*start_buff; mpa_frame->flags = (u8 )((unsigned int )mpa_frame->flags | 32U); form_cm_frame(skb, cm_node, (void *)0, 0U, (void *)*start_buff, (u32 )buff_len, 5); cm_node->state = 12; tmp = schedule_nes_timer(cm_node, skb, 0, 1, 0); return (tmp); } } static int parse_mpa(struct nes_cm_node *cm_node , u8 *buffer , u32 *type , u32 len ) { struct ietf_mpa_v1 *mpa_frame ; struct ietf_mpa_v2 *mpa_v2_frame ; struct ietf_rtr_msg *rtr_msg ; int mpa_hdr_len ; int priv_data_len ; __u16 tmp ; int tmp___0 ; int tmp___1 ; u16 ird_size ; u16 ord_size ; u16 rtr_ctrl_ird ; u16 rtr_ctrl_ord ; __u16 tmp___2 ; __u16 tmp___3 ; { *type = 1U; if (len <= 19U) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: The received ietf buffer was too small (%x)\n", "parse_mpa", 273, len); } else { } return (-22); } else { } mpa_frame = (struct ietf_mpa_v1 *)buffer; mpa_hdr_len = 20; tmp = __fswab16((int )mpa_frame->priv_data_len); priv_data_len = (int )tmp; if (priv_data_len > 512) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: The received Length of Private Data field exceeds 512 octets\n", "parse_mpa", 285); } else { } return (-22); } else { } if ((unsigned int )mpa_frame->rev != 1U && (unsigned int )mpa_frame->rev != 2U) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: The received mpa version is not supported\n", "parse_mpa", 295); } else { } return (-22); } else { } if ((unsigned int )mpa_frame->rev > (unsigned int )cm_node->mpa_frame_rev) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: The received mpa version can not be interoperated\n", "parse_mpa", 303); } else { } return (-22); } else { cm_node->mpa_frame_rev = (enum mpa_frame_version )mpa_frame->rev; } if ((unsigned int )cm_node->state != 8U) { tmp___0 = memcmp((void const *)(& mpa_frame->key), (void const *)"MPA ID Req Frame", 16UL); if (tmp___0 != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Unexpected MPA Key received \n", "parse_mpa", 311); } else { } return (-22); } else { } } else { tmp___1 = memcmp((void const *)(& mpa_frame->key), (void const *)"MPA ID Rep Frame", 16UL); if (tmp___1 != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Unexpected MPA Key received \n", "parse_mpa", 316); } else { } return (-22); } else { } } if ((u32 )(priv_data_len + mpa_hdr_len) != len) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: The received ietf buffer was not right complete (%x + %x != %x)\n", "parse_mpa", 324, priv_data_len, mpa_hdr_len, len); } else { } return (-22); } else { } if (len > 536U) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: The received ietf buffer was too large (%x + %x != %x)\n", "parse_mpa", 331, priv_data_len, mpa_hdr_len, len); } else { } return (-22); } else { } cm_node->mpa_frame_size = (u16 )priv_data_len; switch ((int )mpa_frame->rev) { case 2: mpa_v2_frame = (struct ietf_mpa_v2 *)buffer; mpa_hdr_len = mpa_hdr_len + 4; cm_node->mpa_frame_size = (unsigned int )cm_node->mpa_frame_size + 65532U; rtr_msg = & mpa_v2_frame->rtr_msg; tmp___2 = __fswab16((int )rtr_msg->ctrl_ird); rtr_ctrl_ird = tmp___2; tmp___3 = __fswab16((int )rtr_msg->ctrl_ord); rtr_ctrl_ord = tmp___3; ird_size = (unsigned int )rtr_ctrl_ird & 16383U; ord_size = (unsigned int )rtr_ctrl_ord & 16383U; if ((int )((short )rtr_ctrl_ird) >= 0) { return (-22); } else { } if ((unsigned int )ird_size == 16383U || (unsigned int )ord_size == 16383U) { cm_node->mpav2_ird_ord = 16383U; } else { } if ((unsigned int )cm_node->mpav2_ird_ord != 16383U) { if ((unsigned int )cm_node->state != 8U) { if ((unsigned int )ord_size > 64U) { cm_node->ird_size = 64U; } else { cm_node->ird_size = ord_size; if ((unsigned int )ord_size == 0U && ((int )rtr_ctrl_ord & 16384) != 0) { cm_node->ird_size = 1U; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s: Remote peer doesn\'t support RDMA0_READ (ord=%u)\n", "parse_mpa", 375, "parse_mpa", (int )ord_size); } else { } } else { } } if ((unsigned int )ird_size > 127U) { cm_node->ord_size = 127U; } else { cm_node->ord_size = ird_size; } } else { if ((unsigned int )ord_size > 64U) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s: Unable to support the requested (ord =%u)\n", "parse_mpa", 386, "parse_mpa", (int )ord_size); } else { } return (-22); } else { } cm_node->ird_size = ord_size; if ((unsigned int )ird_size > 127U) { cm_node->ord_size = 127U; } else if ((unsigned int )ird_size == 0U && ((int )rtr_ctrl_ord & 16384) != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s: Remote peer doesn\'t support RDMA0_READ (ird=%u)\n", "parse_mpa", 398, "parse_mpa", (int )ird_size); } else { } return (-22); } else { cm_node->ord_size = ird_size; } } } else { } if (((int )rtr_ctrl_ord & 16384) != 0) { cm_node->send_rdma0_op = 1; } else if ((int )((short )rtr_ctrl_ord) < 0) { cm_node->send_rdma0_op = 2; } else { return (-22); } goto ldv_61605; case 1: ; default: ; goto ldv_61605; } ldv_61605: memcpy((void *)(& cm_node->__annonCompField121.mpa_frame_buf), (void const *)buffer + (unsigned long )mpa_hdr_len, (size_t )cm_node->mpa_frame_size); if (((int )mpa_frame->flags & 32) != 0) { *type = 2U; } else { } return (0); } } static void form_cm_frame(struct sk_buff *skb , struct nes_cm_node *cm_node , void *options , u32 optionsize , void *data , u32 datasize , u8 flags ) { struct tcphdr *tcph ; struct iphdr *iph ; struct ethhdr *ethh ; u8 *buf ; u16 packetsize ; unsigned char *tmp ; __u16 tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u16 tmp___4 ; __u16 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u16 tmp___8 ; unsigned char *tmp___9 ; { packetsize = 20U; packetsize = (unsigned int )packetsize + 20U; packetsize = ((int )((u16 )optionsize) + (int )((u16 )datasize)) + (int )packetsize; skb_trim(skb, 0U); memset((void *)skb->data, 0, 54UL); tmp = skb_put(skb, (unsigned int )((int )packetsize + 14)); buf = tmp; ethh = (struct ethhdr *)buf; buf = buf + 14UL; iph = (struct iphdr *)buf; buf = buf + 20UL; tcph = (struct tcphdr *)buf; skb_reset_mac_header(skb); skb_set_network_header(skb, 14); skb_set_transport_header(skb, 34); buf = buf + 20UL; skb->ip_summed = 3U; if (((cm_node->netdev)->features & 2ULL) == 0ULL) { skb->ip_summed = 0U; } else { } skb->protocol = 8U; skb->data_len = 0U; skb->mac_len = 14U; memcpy((void *)(& ethh->h_dest), (void const *)(& cm_node->rem_mac), 6UL); memcpy((void *)(& ethh->h_source), (void const *)(& cm_node->loc_mac), 6UL); ethh->h_proto = 8U; iph->version = 4U; iph->ihl = 5U; iph->tos = 0U; tmp___0 = __fswab16((int )packetsize); iph->tot_len = tmp___0; cm_node->tcp_cntxt.loc_id = cm_node->tcp_cntxt.loc_id + 1U; tmp___1 = __fswab16((int )((__u16 )cm_node->tcp_cntxt.loc_id)); iph->id = tmp___1; iph->frag_off = 64U; iph->ttl = 64U; iph->protocol = 6U; tmp___2 = __fswab32(cm_node->mapped_loc_addr); iph->saddr = tmp___2; tmp___3 = __fswab32(cm_node->mapped_rem_addr); iph->daddr = tmp___3; tmp___4 = __fswab16((int )cm_node->mapped_loc_port); tcph->source = tmp___4; tmp___5 = __fswab16((int )cm_node->mapped_rem_port); tcph->dest = tmp___5; tmp___6 = __fswab32(cm_node->tcp_cntxt.loc_seq_num); tcph->seq = tmp___6; if ((int )flags & 1) { cm_node->tcp_cntxt.loc_ack_num = cm_node->tcp_cntxt.rcv_nxt; tmp___7 = __fswab32(cm_node->tcp_cntxt.loc_ack_num); tcph->ack_seq = tmp___7; tcph->ack = 1U; } else { tcph->ack_seq = 0U; } if (((int )flags & 2) != 0) { cm_node->tcp_cntxt.loc_seq_num = cm_node->tcp_cntxt.loc_seq_num + 1U; tcph->syn = 1U; } else { cm_node->tcp_cntxt.loc_seq_num = cm_node->tcp_cntxt.loc_seq_num + datasize; } if (((int )flags & 4) != 0) { cm_node->tcp_cntxt.loc_seq_num = cm_node->tcp_cntxt.loc_seq_num + 1U; tcph->fin = 1U; } else { } if (((int )flags & 8) != 0) { tcph->rst = 1U; } else { } tcph->doff = (unsigned char )(((unsigned long )optionsize + 23UL) >> 2); tmp___8 = __fswab16((int )((__u16 )cm_node->tcp_cntxt.rcv_wnd)); tcph->window = tmp___8; tcph->urg_ptr = 0U; if (optionsize != 0U) { memcpy((void *)buf, (void const *)options, (size_t )optionsize); } else { } buf = buf + (unsigned long )optionsize; if (datasize != 0U) { memcpy((void *)buf, (void const *)data, (size_t )datasize); } else { } tmp___9 = skb_end_pointer((struct sk_buff const *)skb); ((struct skb_shared_info *)tmp___9)->nr_frags = 0U; cm_packets_created = cm_packets_created + 1U; return; } } static void nes_create_sockaddr(__be32 ip_addr , __be16 port , struct __kernel_sockaddr_storage *addr ) { struct sockaddr_in *nes_sockaddr ; { nes_sockaddr = (struct sockaddr_in *)addr; nes_sockaddr->sin_family = 2U; memcpy((void *)(& nes_sockaddr->sin_addr.s_addr), (void const *)(& ip_addr), 4UL); nes_sockaddr->sin_port = port; return; } } static int nes_create_mapinfo(struct nes_cm_info *cm_info ) { struct __kernel_sockaddr_storage local_sockaddr ; struct __kernel_sockaddr_storage mapped_sockaddr ; __u16 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; int tmp___3 ; { tmp = __fswab16((int )cm_info->loc_port); tmp___0 = __fswab32(cm_info->loc_addr); nes_create_sockaddr(tmp___0, (int )tmp, & local_sockaddr); tmp___1 = __fswab16((int )cm_info->mapped_loc_port); tmp___2 = __fswab32(cm_info->mapped_loc_addr); nes_create_sockaddr(tmp___2, (int )tmp___1, & mapped_sockaddr); tmp___3 = iwpm_create_mapinfo(& local_sockaddr, & mapped_sockaddr, 2); return (tmp___3); } } static int nes_remove_mapinfo(u32 loc_addr , u16 loc_port , u32 mapped_loc_addr , u16 mapped_loc_port ) { struct __kernel_sockaddr_storage local_sockaddr ; struct __kernel_sockaddr_storage mapped_sockaddr ; __u16 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; int tmp___3 ; { tmp = __fswab16((int )loc_port); tmp___0 = __fswab32(loc_addr); nes_create_sockaddr(tmp___0, (int )tmp, & local_sockaddr); tmp___1 = __fswab16((int )mapped_loc_port); tmp___2 = __fswab32(mapped_loc_addr); nes_create_sockaddr(tmp___2, (int )tmp___1, & mapped_sockaddr); iwpm_remove_mapinfo(& local_sockaddr, & mapped_sockaddr); tmp___3 = iwpm_remove_mapping(& local_sockaddr, 2); return (tmp___3); } } static void nes_form_pm_msg(struct nes_cm_info *cm_info , struct iwpm_sa_data *pm_msg ) { __u16 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; { tmp = __fswab16((int )cm_info->loc_port); tmp___0 = __fswab32(cm_info->loc_addr); nes_create_sockaddr(tmp___0, (int )tmp, & pm_msg->loc_addr); tmp___1 = __fswab16((int )cm_info->rem_port); tmp___2 = __fswab32(cm_info->rem_addr); nes_create_sockaddr(tmp___2, (int )tmp___1, & pm_msg->rem_addr); return; } } static void nes_form_reg_msg(struct nes_vnic *nesvnic , struct iwpm_dev_data *pm_msg ) { { memcpy((void *)(& pm_msg->dev_name), (void const *)(& (nesvnic->nesibdev)->ibdev.name), 32UL); memcpy((void *)(& pm_msg->if_name), (void const *)(& (nesvnic->netdev)->name), 16UL); return; } } static void record_sockaddr_info(struct __kernel_sockaddr_storage *addr_info , nes_addr_t *ip_addr , u16 *port_num ) { struct sockaddr_in *in_addr ; __u32 tmp ; __u16 tmp___0 ; { in_addr = (struct sockaddr_in *)addr_info; if ((unsigned int )in_addr->sin_family == 2U) { tmp = __fswab32(in_addr->sin_addr.s_addr); *ip_addr = tmp; tmp___0 = __fswab16((int )in_addr->sin_port); *port_num = tmp___0; } else { } return; } } static void nes_record_pm_msg(struct nes_cm_info *cm_info , struct iwpm_sa_data *pm_msg ) { { record_sockaddr_info(& pm_msg->mapped_loc_addr, & cm_info->mapped_loc_addr, & cm_info->mapped_loc_port); record_sockaddr_info(& pm_msg->mapped_rem_addr, & cm_info->mapped_rem_addr, & cm_info->mapped_rem_port); return; } } static int nes_get_remote_addr(struct nes_cm_node *cm_node ) { struct __kernel_sockaddr_storage mapped_loc_addr ; struct __kernel_sockaddr_storage mapped_rem_addr ; struct __kernel_sockaddr_storage remote_addr ; int ret ; __u16 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; { tmp = __fswab16((int )cm_node->mapped_loc_port); tmp___0 = __fswab32(cm_node->mapped_loc_addr); nes_create_sockaddr(tmp___0, (int )tmp, & mapped_loc_addr); tmp___1 = __fswab16((int )cm_node->mapped_rem_port); tmp___2 = __fswab32(cm_node->mapped_rem_addr); nes_create_sockaddr(tmp___2, (int )tmp___1, & mapped_rem_addr); ret = iwpm_get_remote_info(& mapped_loc_addr, & mapped_rem_addr, & remote_addr, 2); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Unable to find remote peer address info\n", "nes_get_remote_addr", 640); } else { } } else { record_sockaddr_info(& remote_addr, & cm_node->rem_addr, & cm_node->rem_port); } return (ret); } } static void print_core(struct nes_cm_core *core ) { int tmp ; int tmp___0 ; { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: ---------------------------------------------\n", "print_core", 652); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: CM Core -- (core = %p )\n", "print_core", 653, core); } else { } if ((unsigned long )core == (unsigned long )((struct nes_cm_core *)0)) { return; } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: ---------------------------------------------\n", "print_core", 656); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: State : %u \n", "print_core", 658, (unsigned int )core->state); } else { } if ((nes_debug_level & 32U) != 0U) { tmp = atomic_read((atomic_t const *)(& core->listen_node_cnt)); printk("\viw_nes: %s[%u]: Listen Nodes : %u \n", "print_core", 660, tmp); } else { } if ((nes_debug_level & 32U) != 0U) { tmp___0 = atomic_read((atomic_t const *)(& core->node_cnt)); printk("\viw_nes: %s[%u]: Active Nodes : %u \n", "print_core", 661, tmp___0); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: core : %p \n", "print_core", 663, core); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: -------------- end core ---------------\n", "print_core", 665); } else { } return; } } static void record_ird_ord(struct nes_cm_node *cm_node , u16 conn_ird , u16 conn_ord ) { { if ((unsigned int )conn_ird > 64U) { conn_ird = 64U; } else { } if ((unsigned int )conn_ord > 127U) { conn_ord = 127U; } else { } cm_node->ird_size = conn_ird; cm_node->ord_size = conn_ord; return; } } static int cm_build_mpa_frame(struct nes_cm_node *cm_node , u8 **start_buff , u16 *buff_len , u8 *pci_mem , u8 mpa_key ) { int ret ; { ret = 0; *start_buff = (unsigned long )pci_mem == (unsigned long )((u8 *)0U) ? (u8 *)(& cm_node->__annonCompField121.mpa_frame_buf) : pci_mem; switch ((unsigned int )cm_node->mpa_frame_rev) { case 1U: *start_buff = *start_buff + 4UL; *buff_len = (unsigned int )cm_node->mpa_frame_size + 20U; build_mpa_v1(cm_node, (void *)*start_buff, (int )mpa_key); goto ldv_61685; case 2U: *buff_len = (unsigned int )cm_node->mpa_frame_size + 24U; build_mpa_v2(cm_node, (void *)*start_buff, (int )mpa_key); goto ldv_61685; default: ret = -22; } ldv_61685: ; return (ret); } } static void build_mpa_v2(struct nes_cm_node *cm_node , void *start_addr , u8 mpa_key ) { struct ietf_mpa_v2 *mpa_frame ; struct ietf_rtr_msg *rtr_msg ; u16 ctrl_ird ; u16 ctrl_ord ; __u16 tmp ; __u16 tmp___0 ; { mpa_frame = (struct ietf_mpa_v2 *)start_addr; rtr_msg = & mpa_frame->rtr_msg; build_mpa_v1(cm_node, start_addr, (int )mpa_key); mpa_frame->flags = (u8 )((unsigned int )mpa_frame->flags | 16U); mpa_frame->priv_data_len = (unsigned int )mpa_frame->priv_data_len + 1024U; if ((unsigned int )cm_node->mpav2_ird_ord == 16383U) { ctrl_ird = 16383U; ctrl_ord = 16383U; } else { ctrl_ird = (unsigned int )cm_node->ird_size & 16383U; ctrl_ord = (unsigned int )cm_node->ord_size & 16383U; } ctrl_ird = (u16 )((unsigned int )ctrl_ird | 32768U); ctrl_ird = (u16 )((unsigned int )ctrl_ird | 16384U); switch ((int )mpa_key) { case 0: ctrl_ord = (u16 )((unsigned int )ctrl_ord | 32768U); ctrl_ord = (u16 )((unsigned int )ctrl_ord | 16384U); goto ldv_61698; case 1: ; switch ((unsigned int )cm_node->send_rdma0_op) { case 2U: ctrl_ord = (u16 )((unsigned int )ctrl_ord | 32768U); goto ldv_61701; case 1U: ctrl_ord = (u16 )((unsigned int )ctrl_ord | 16384U); goto ldv_61701; } ldv_61701: ; } ldv_61698: tmp = __fswab16((int )ctrl_ird); rtr_msg->ctrl_ird = tmp; tmp___0 = __fswab16((int )ctrl_ord); rtr_msg->ctrl_ord = tmp___0; return; } } static void build_mpa_v1(struct nes_cm_node *cm_node , void *start_addr , u8 mpa_key ) { struct ietf_mpa_v1 *mpa_frame ; __u16 tmp ; { mpa_frame = (struct ietf_mpa_v1 *)start_addr; switch ((int )mpa_key) { case 0: memcpy((void *)(& mpa_frame->key), (void const *)"MPA ID Req Frame", 16UL); goto ldv_61710; case 1: memcpy((void *)(& mpa_frame->key), (void const *)"MPA ID Rep Frame", 16UL); goto ldv_61710; } ldv_61710: mpa_frame->flags = 64U; mpa_frame->rev = (u8 )cm_node->mpa_frame_rev; tmp = __fswab16((int )cm_node->mpa_frame_size); mpa_frame->priv_data_len = tmp; return; } } static void build_rdma0_msg(struct nes_cm_node *cm_node , struct nes_qp **nesqp_addr ) { u64 u64temp ; struct nes_qp *nesqp ; struct nes_hw_qp_wqe *wqe ; int __ret_warn_on ; long tmp ; { nesqp = *nesqp_addr; wqe = nesqp->hwqp.sq_vbase; u64temp = nesqp->nesuqp_addr; u64temp = u64temp | 512ULL; set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 2U, u64temp); wqe->wqe_words[16] = 0U; wqe->wqe_words[17] = 0U; switch ((unsigned int )cm_node->send_rdma0_op) { case 2U: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Sending first write.\n", "build_rdma0_msg", 788); } else { } wqe->wqe_words[0] = 0U; wqe->wqe_words[1] = 0U; wqe->wqe_words[18] = 0U; wqe->wqe_words[19] = 0U; goto ldv_61721; case 1U: ; default: ; if ((unsigned int )cm_node->send_rdma0_op != 1U) { __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_fmt("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c", 800, "Unsupported RDMA0 len operation=%u\n", (unsigned int )cm_node->send_rdma0_op); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Sending first rdma operation.\n", "build_rdma0_msg", 801); } else { } wqe->wqe_words[0] = 1U; wqe->wqe_words[8] = 1U; wqe->wqe_words[9] = 0U; wqe->wqe_words[10] = 0U; wqe->wqe_words[11] = 1U; wqe->wqe_words[19] = 1U; goto ldv_61721; } ldv_61721: ; if ((unsigned int )nesqp->sq_kmapped != 0U) { nesqp->sq_kmapped = 0U; kunmap(nesqp->page); } else { } (nesqp->nesqp_context)->ird_ord_sizes = (nesqp->nesqp_context)->ird_ord_sizes & 4060086271U; nesqp->skip_lsmm = 1U; nesqp->hwqp.sq_tail = 0U; return; } } int schedule_nes_timer(struct nes_cm_node *cm_node , struct sk_buff *skb , enum nes_timer_type type , int send_retrans , int close_when_complete ) { unsigned long flags ; struct nes_cm_core *cm_core ; struct nes_timer_entry *new_send ; int ret ; void *tmp ; int __ret_warn_on ; long tmp___0 ; struct tcphdr *tmp___1 ; __u32 tmp___2 ; int tmp___3 ; { cm_core = cm_node->cm_core; ret = 0; tmp = kzalloc(72UL, 32U); new_send = (struct nes_timer_entry *)tmp; if ((unsigned long )new_send == (unsigned long )((struct nes_timer_entry *)0)) { return (-12); } else { } new_send->retrycount = 64U; new_send->retranscount = 8U; new_send->skb = skb; new_send->timetosend = jiffies; new_send->type = (u32 )type; new_send->netdev = cm_node->netdev; new_send->send_retrans = (u32 )send_retrans; new_send->close_when_complete = close_when_complete; if ((unsigned int )type == 3U) { new_send->timetosend = new_send->timetosend + 25UL; if ((unsigned long )cm_node->recv_entry != (unsigned long )((struct nes_timer_entry *)0)) { kfree((void const *)new_send); __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c", 857); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (-22); } else { } cm_node->recv_entry = new_send; } else { } if ((unsigned int )type == 0U) { tmp___1 = tcp_hdr((struct sk_buff const *)skb); tmp___2 = __fswab32(tmp___1->seq); new_send->seq_num = tmp___2; atomic_inc(& (new_send->skb)->users); ldv_spin_lock(); cm_node->send_entry = new_send; add_ref_cm_node(cm_node); spin_unlock_irqrestore(& cm_node->retrans_list_lock, flags); new_send->timetosend = (unsigned long )jiffies + 250UL; ret = nes_nic_cm_xmit(new_send->skb, cm_node->netdev); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Error sending packet %p (jiffies = %lu)\n", "schedule_nes_timer", 875, new_send, jiffies); } else { } new_send->timetosend = jiffies; ret = 0; } else { cm_packets_sent = cm_packets_sent + 1U; if (send_retrans == 0) { cleanup_retrans_entry(cm_node); if (close_when_complete != 0) { rem_ref_cm_node(cm_core, cm_node); } else { } return (ret); } else { } } } else { } tmp___3 = timer_pending((struct timer_list const *)(& cm_core->tcp_timer)); if (tmp___3 == 0) { ldv_mod_timer_312(& cm_core->tcp_timer, new_send->timetosend); } else { } return (ret); } } static void nes_retrans_expired(struct nes_cm_node *cm_node ) { struct iw_cm_id *cm_id ; enum nes_cm_node_state state ; { cm_id = cm_node->cm_id; state = cm_node->state; cm_node->state = 19; switch ((unsigned int )state) { case 3U: ; case 17U: rem_ref_cm_node(cm_node->cm_core, cm_node); goto ldv_61747; case 16U: ; case 12U: ; if ((unsigned long )cm_node->cm_id != (unsigned long )((struct iw_cm_id *)0)) { (*(cm_id->rem_ref))(cm_id); } else { } send_reset(cm_node, (struct sk_buff *)0); goto ldv_61747; default: add_ref_cm_node(cm_node); send_reset(cm_node, (struct sk_buff *)0); create_event(cm_node, 14); } ldv_61747: ; return; } } static void handle_recv_entry(struct nes_cm_node *cm_node , u32 rem_node ) { struct nes_timer_entry *recv_entry ; struct iw_cm_id *cm_id ; struct nes_qp *nesqp ; unsigned long qplockflags ; int tmp ; int tmp___0 ; { recv_entry = cm_node->recv_entry; cm_id = cm_node->cm_id; if ((unsigned long )recv_entry == (unsigned long )((struct nes_timer_entry *)0)) { return; } else { } nesqp = (struct nes_qp *)recv_entry->skb; if ((unsigned long )nesqp != (unsigned long )((struct nes_qp *)0)) { ldv_spin_lock(); if ((unsigned long )nesqp->cm_id != (unsigned long )((struct iw_cm_id *)0)) { if ((nes_debug_level & 32U) != 0U) { tmp = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u: cm_id = %p, refcount = %d: HIT A NES_TIMER_TYPE_CLOSE with something to do!!!\n", "handle_recv_entry", 936, nesqp->hwqp.qp_id, cm_id, tmp); } else { } nesqp->hw_tcp_state = 1U; nesqp->last_aeq = 1537U; nesqp->ibqp_state = 6; spin_unlock_irqrestore(& nesqp->lock, qplockflags); nes_cm_disconn(nesqp); } else { spin_unlock_irqrestore(& nesqp->lock, qplockflags); if ((nes_debug_level & 32U) != 0U) { tmp___0 = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: QP%u: cm_id = %p, refcount = %d: HIT A NES_TIMER_TYPE_CLOSE with nothing to do!!!\n", "handle_recv_entry", 948, nesqp->hwqp.qp_id, cm_id, tmp___0); } else { } } } else if (rem_node != 0U) { rem_ref_cm_node(cm_node->cm_core, cm_node); } else { } if ((unsigned long )cm_node->cm_id != (unsigned long )((struct iw_cm_id *)0)) { (*(cm_id->rem_ref))(cm_id); } else { } kfree((void const *)recv_entry); cm_node->recv_entry = (struct nes_timer_entry *)0; return; } } static void nes_cm_timer_tick(unsigned long pass ) { unsigned long flags ; unsigned long nexttimeout ; struct nes_cm_node *cm_node ; struct nes_timer_entry *send_entry ; struct nes_timer_entry *recv_entry ; struct list_head *list_core_temp ; struct list_head *list_node ; struct nes_cm_core *cm_core ; u32 settimer ; unsigned long timetosend ; int ret ; struct list_head timer_list ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; unsigned long _min1 ; unsigned long _min2 ; int close_when_complete ; int tmp ; { nexttimeout = (unsigned long )jiffies + 500UL; cm_core = g_cm_core; settimer = 0U; ret = 0; INIT_LIST_HEAD(& timer_list); ldv_spin_lock(); list_node = cm_core->connected_nodes.next; list_core_temp = list_node->next; goto ldv_61778; ldv_61777: __mptr = (struct list_head const *)list_node; cm_node = (struct nes_cm_node *)__mptr + 0xfffffffffffffbe0UL; if ((unsigned long )cm_node->recv_entry != (unsigned long )((struct nes_timer_entry *)0) || (unsigned long )cm_node->send_entry != (unsigned long )((struct nes_timer_entry *)0)) { add_ref_cm_node(cm_node); list_add(& cm_node->timer_entry, & timer_list); } else { } list_node = list_core_temp; list_core_temp = list_node->next; ldv_61778: ; if ((unsigned long )(& cm_core->connected_nodes) != (unsigned long )list_node) { goto ldv_61777; } else { } spin_unlock_irqrestore(& cm_core->ht_lock, flags); list_node = timer_list.next; list_core_temp = list_node->next; goto ldv_61801; ldv_61800: __mptr___0 = (struct list_head const *)list_node; cm_node = (struct nes_cm_node *)__mptr___0 + 0xfffffffffffffba8UL; recv_entry = cm_node->recv_entry; if ((unsigned long )recv_entry != (unsigned long )((struct nes_timer_entry *)0)) { if ((long )((unsigned long )jiffies - recv_entry->timetosend) < 0L) { if (recv_entry->timetosend < nexttimeout || settimer == 0U) { nexttimeout = recv_entry->timetosend; settimer = 1U; } else { } } else { handle_recv_entry(cm_node, 1U); } } else { } ldv_spin_lock(); send_entry = cm_node->send_entry; if ((unsigned long )send_entry == (unsigned long )((struct nes_timer_entry *)0)) { goto ldv_61788; } else { } if ((long )((unsigned long )jiffies - send_entry->timetosend) < 0L) { if ((unsigned int )cm_node->state != 11U) { if (send_entry->timetosend < nexttimeout || settimer == 0U) { nexttimeout = send_entry->timetosend; settimer = 1U; } else { } } else { free_retrans_entry(cm_node); } goto ldv_61788; } else { } if ((unsigned int )cm_node->state == 11U || (unsigned int )cm_node->state == 19U) { free_retrans_entry(cm_node); goto ldv_61788; } else { } if (send_entry->retranscount == 0U || send_entry->retrycount == 0U) { cm_packets_dropped = cm_packets_dropped + 1U; free_retrans_entry(cm_node); spin_unlock_irqrestore(& cm_node->retrans_list_lock, flags); nes_retrans_expired(cm_node); cm_node->state = 19; ldv_spin_lock(); goto ldv_61788; } else { } atomic_inc(& (send_entry->skb)->users); cm_packets_retrans = cm_packets_retrans + 1U; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Retransmitting send_entry %p for node %p, jiffies = %lu, time to send = %lu, retranscount = %u, send_entry->seq_num = 0x%08X, cm_node->tcp_cntxt.rem_ack_num = 0x%08X\n", "nes_cm_timer_tick", 1057, send_entry, cm_node, jiffies, send_entry->timetosend, send_entry->retranscount, send_entry->seq_num, cm_node->tcp_cntxt.rem_ack_num); } else { } spin_unlock_irqrestore(& cm_node->retrans_list_lock, flags); ret = nes_nic_cm_xmit(send_entry->skb, cm_node->netdev); ldv_spin_lock(); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: rexmit failed for node=%p\n", "nes_cm_timer_tick", 1065, cm_node); } else { } cm_packets_bounced = cm_packets_bounced + 1U; send_entry->retrycount = send_entry->retrycount - 1U; nexttimeout = (unsigned long )jiffies + 10UL; settimer = 1U; goto ldv_61788; } else { cm_packets_sent = cm_packets_sent + 1U; } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Packet Sent: retrans count = %u, retry count = %u.\n", "nes_cm_timer_tick", 1077, send_entry->retranscount, send_entry->retrycount); } else { } if (send_entry->send_retrans != 0U) { send_entry->retranscount = send_entry->retranscount - 1U; timetosend = (unsigned long )(250 << (int )(8U - send_entry->retranscount)); _min1 = timetosend; _min2 = 3000UL; send_entry->timetosend = (_min1 < _min2 ? _min1 : _min2) + (unsigned long )jiffies; if (send_entry->timetosend < nexttimeout || settimer == 0U) { nexttimeout = send_entry->timetosend; settimer = 1U; } else { } } else { close_when_complete = send_entry->close_when_complete; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node=%p state=%d\n", "nes_cm_timer_tick", 1095, cm_node, (unsigned int )cm_node->state); } else { } free_retrans_entry(cm_node); if (close_when_complete != 0) { rem_ref_cm_node(cm_node->cm_core, cm_node); } else { } } ldv_61788: spin_unlock_irqrestore(& cm_node->retrans_list_lock, flags); rem_ref_cm_node(cm_node->cm_core, cm_node); list_node = list_core_temp; list_core_temp = list_node->next; ldv_61801: ; if ((unsigned long )(& timer_list) != (unsigned long )list_node) { goto ldv_61800; } else { } if (settimer != 0U) { tmp = timer_pending((struct timer_list const *)(& cm_core->tcp_timer)); if (tmp == 0) { ldv_mod_timer_313(& cm_core->tcp_timer, nexttimeout); } else { } } else { } return; } } static int send_syn(struct nes_cm_node *cm_node , u32 sendack , struct sk_buff *skb ) { int ret ; int flags ; char optionsbuffer[12U] ; int optionssize ; union all_known_options *options ; __u16 tmp ; { flags = 2; optionssize = 0; if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { return (-22); } else { } options = (union all_known_options *)(& optionsbuffer) + (unsigned long )optionssize; options->as_mss.optionnum = 2U; options->as_mss.length = 4U; tmp = __fswab16((int )((__u16 )cm_node->tcp_cntxt.mss)); options->as_mss.mss = tmp; optionssize = (int )((unsigned int )optionssize + 4U); options = (union all_known_options *)(& optionsbuffer) + (unsigned long )optionssize; options->as_windowscale.optionnum = 3U; options->as_windowscale.length = 3U; options->as_windowscale.shiftcount = cm_node->tcp_cntxt.rcv_wscale; optionssize = (int )((unsigned int )optionssize + 3U); if (sendack != 0U && (nes_drv_opt & 64U) == 0U) { options = (union all_known_options *)(& optionsbuffer) + (unsigned long )optionssize; options->as_base.optionnum = 188U; options->as_base.length = 2U; optionssize = (int )((unsigned int )optionssize + 2U); options = (union all_known_options *)(& optionsbuffer) + (unsigned long )optionssize; options->as_end = 1; optionssize = optionssize + 1; options = (union all_known_options *)(& optionsbuffer) + (unsigned long )optionssize; options->as_end = 1; optionssize = optionssize + 1; } else { } options = (union all_known_options *)(& optionsbuffer) + (unsigned long )optionssize; options->as_end = 0; optionssize = optionssize + 1; if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { skb = dev_alloc_skb___0(536U); } else { } if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a Free pkt\n", "send_syn", 1166); } else { } return (-1); } else { } if (sendack != 0U) { flags = flags | 1; } else { } form_cm_frame(skb, cm_node, (void *)(& optionsbuffer), (u32 )optionssize, (void *)0, 0U, (int )((u8 )flags)); ret = schedule_nes_timer(cm_node, skb, 0, 1, 0); return (ret); } } static int send_reset(struct nes_cm_node *cm_node , struct sk_buff *skb ) { int ret ; int flags ; { flags = 9; if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { skb = dev_alloc_skb___0(536U); } else { } if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a Free pkt\n", "send_reset", 1191); } else { } return (-12); } else { } form_cm_frame(skb, cm_node, (void *)0, 0U, (void *)0, 0U, (int )((u8 )flags)); ret = schedule_nes_timer(cm_node, skb, 0, 0, 1); return (ret); } } static int send_ack(struct nes_cm_node *cm_node , struct sk_buff *skb ) { int ret ; { if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { skb = dev_alloc_skb___0(536U); } else { } if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a Free pkt\n", "send_ack", 1213); } else { } return (-1); } else { } form_cm_frame(skb, cm_node, (void *)0, 0U, (void *)0, 0U, 1); ret = schedule_nes_timer(cm_node, skb, 0, 0, 0); return (ret); } } static int send_fin(struct nes_cm_node *cm_node , struct sk_buff *skb ) { int ret ; { if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { skb = dev_alloc_skb___0(536U); } else { } if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a Free pkt\n", "send_fin", 1236); } else { } return (-1); } else { } form_cm_frame(skb, cm_node, (void *)0, 0U, (void *)0, 0U, 5); ret = schedule_nes_timer(cm_node, skb, 0, 1, 0); return (ret); } } static struct nes_cm_node *find_node(struct nes_cm_core *cm_core , u16 rem_port , nes_addr_t rem_addr , u16 loc_port , nes_addr_t loc_addr ) { unsigned long flags ; struct list_head *hte ; struct nes_cm_node *cm_node ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { hte = & cm_core->connected_nodes; ldv_spin_lock(); __mptr = (struct list_head const *)hte->next; cm_node = (struct nes_cm_node *)__mptr + 0xfffffffffffffbe0UL; goto ldv_61849; ldv_61848: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: finding node %x:%x =? %x:%x ^ %x:%x =? %x:%x\n", "find_node", 1268, cm_node->loc_addr, (int )cm_node->loc_port, loc_addr, (int )loc_port, cm_node->rem_addr, (int )cm_node->rem_port, rem_addr, (int )rem_port); } else { } if (((cm_node->mapped_loc_addr == loc_addr && (int )cm_node->mapped_loc_port == (int )loc_port) && cm_node->mapped_rem_addr == rem_addr) && (int )cm_node->mapped_rem_port == (int )rem_port) { add_ref_cm_node(cm_node); spin_unlock_irqrestore(& cm_core->ht_lock, flags); return (cm_node); } else { } __mptr___0 = (struct list_head const *)cm_node->list.next; cm_node = (struct nes_cm_node *)__mptr___0 + 0xfffffffffffffbe0UL; ldv_61849: ; if ((unsigned long )(& cm_node->list) != (unsigned long )hte) { goto ldv_61848; } else { } spin_unlock_irqrestore(& cm_core->ht_lock, flags); return ((struct nes_cm_node *)0); } } static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core , nes_addr_t dst_addr , u16 dst_port , enum nes_cm_listener_state listener_state , int local ) { unsigned long flags ; struct nes_cm_listener *listen_node ; nes_addr_t listen_addr ; u16 listen_port ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { ldv_spin_lock(); __mptr = (struct list_head const *)cm_core->listen_list.list.next; listen_node = (struct nes_cm_listener *)__mptr; goto ldv_61867; ldv_61866: ; if (local != 0) { listen_addr = listen_node->loc_addr; listen_port = listen_node->loc_port; } else { listen_addr = listen_node->mapped_loc_addr; listen_port = listen_node->mapped_loc_port; } if (((listen_addr == dst_addr || listen_addr == 0U) && (int )listen_port == (int )dst_port) && ((unsigned int )listen_node->listener_state & (unsigned int )listener_state) != 0U) { atomic_inc(& listen_node->ref_count); spin_unlock_irqrestore(& cm_core->listen_list_lock, flags); return (listen_node); } else { } __mptr___0 = (struct list_head const *)listen_node->list.next; listen_node = (struct nes_cm_listener *)__mptr___0; ldv_61867: ; if ((unsigned long )(& listen_node->list) != (unsigned long )(& cm_core->listen_list.list)) { goto ldv_61866; } else { } spin_unlock_irqrestore(& cm_core->listen_list_lock, flags); return ((struct nes_cm_listener *)0); } } static int add_hte_node(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) { unsigned long flags ; struct list_head *hte ; { if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0) || (unsigned long )cm_core == (unsigned long )((struct nes_cm_core *)0)) { return (-22); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Adding Node %p to Active Connection HT\n", "add_hte_node", 1336, cm_node); } else { } ldv_spin_lock(); hte = & cm_core->connected_nodes; list_add_tail(& cm_node->list, hte); atomic_inc(& cm_core->ht_node_cnt); spin_unlock_irqrestore(& cm_core->ht_lock, flags); return (0); } } static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core , struct nes_cm_listener *listener , int free_hanging_nodes ) { int ret ; int err ; unsigned long flags ; struct list_head *list_pos ; struct list_head *list_temp ; struct nes_cm_node *cm_node ; struct list_head reset_list ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct nes_cm_node *loopback ; enum nes_cm_node_state old_state ; int __ret_warn_on ; long tmp___0 ; struct nes_cm_event event ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { ret = -22; err = 0; list_pos = (struct list_head *)0; list_temp = (struct list_head *)0; cm_node = (struct nes_cm_node *)0; if ((nes_debug_level & 32U) != 0U) { tmp = atomic_read((atomic_t const *)(& listener->ref_count)); printk("\viw_nes: %s[%u]: attempting listener= %p free_nodes= %d, refcnt=%d\n", "mini_cm_dec_refcnt_listen", 1367, listener, free_hanging_nodes, tmp); } else { } INIT_LIST_HEAD(& reset_list); if (free_hanging_nodes != 0) { ldv_spin_lock(); list_pos = g_cm_core->connected_nodes.next; list_temp = list_pos->next; goto ldv_61892; ldv_61891: __mptr = (struct list_head const *)list_pos; cm_node = (struct nes_cm_node *)__mptr + 0xfffffffffffffbe0UL; if ((unsigned long )cm_node->listener == (unsigned long )listener && cm_node->accelerated == 0) { add_ref_cm_node(cm_node); list_add(& cm_node->reset_entry, & reset_list); } else { } list_pos = list_temp; list_temp = list_pos->next; ldv_61892: ; if ((unsigned long )(& g_cm_core->connected_nodes) != (unsigned long )list_pos) { goto ldv_61891; } else { } spin_unlock_irqrestore(& cm_core->ht_lock, flags); } else { } list_pos = reset_list.next; list_temp = list_pos->next; goto ldv_61902; ldv_61901: __mptr___0 = (struct list_head const *)list_pos; cm_node = (struct nes_cm_node *)__mptr___0 + 0xfffffffffffffb98UL; loopback = cm_node->loopbackpartner; if ((unsigned int )cm_node->state > 11U) { rem_ref_cm_node(cm_node->cm_core, cm_node); } else if ((unsigned long )loopback == (unsigned long )((struct nes_cm_node *)0)) { cleanup_retrans_entry(cm_node); err = send_reset(cm_node, (struct sk_buff *)0); if (err != 0) { cm_node->state = 19; __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c", 1400); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { old_state = cm_node->state; cm_node->state = 18; if ((unsigned int )old_state != 9U) { rem_ref_cm_node(cm_node->cm_core, cm_node); } else { } } } else { event.cm_node = loopback; event.cm_info.rem_addr = loopback->rem_addr; event.cm_info.loc_addr = loopback->loc_addr; event.cm_info.rem_port = loopback->rem_port; event.cm_info.loc_port = loopback->loc_port; event.cm_info.__annonCompField122.cm_id = loopback->cm_id; add_ref_cm_node(loopback); loopback->state = 19; cm_event_connect_error(& event); cm_node->state = 18; rem_ref_cm_node(cm_node->cm_core, cm_node); } list_pos = list_temp; list_temp = list_pos->next; ldv_61902: ; if ((unsigned long )(& reset_list) != (unsigned long )list_pos) { goto ldv_61901; } else { } ldv_spin_lock(); tmp___1 = atomic_sub_return(1, & listener->ref_count); if (tmp___1 == 0) { list_del(& listener->list); atomic_dec(& cm_core->listen_node_cnt); spin_unlock_irqrestore(& cm_core->listen_list_lock, flags); if ((unsigned long )listener->nesvnic != (unsigned long )((struct nes_vnic *)0)) { nes_manage_apbvt(listener->nesvnic, (u32 )listener->mapped_loc_port, (((listener->nesvnic)->nesdev)->pcidev)->devfn & 7U, 0U); nes_remove_mapinfo(listener->loc_addr, (int )listener->loc_port, listener->mapped_loc_addr, (int )listener->mapped_loc_port); if ((nes_debug_level & 2097152U) != 0U) { printk("\viw_nes: %s[%u]: Delete APBVT mapped_loc_port = %04X\n", "mini_cm_dec_refcnt_listen", 1456, (int )listener->mapped_loc_port); } else { } } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: destroying listener (%p)\n", "mini_cm_dec_refcnt_listen", 1459, listener); } else { } kfree((void const *)listener); listener = (struct nes_cm_listener *)0; ret = 0; atomic_inc(& cm_listens_destroyed); } else { spin_unlock_irqrestore(& cm_core->listen_list_lock, flags); } if ((unsigned long )listener != (unsigned long )((struct nes_cm_listener *)0)) { tmp___3 = atomic_read((atomic_t const *)(& listener->pend_accepts_cnt)); if (tmp___3 > 0) { if ((nes_debug_level & 32U) != 0U) { tmp___2 = atomic_read((atomic_t const *)(& listener->pend_accepts_cnt)); printk("\viw_nes: %s[%u]: destroying listener (%p) with non-zero pending accepts=%u\n", "mini_cm_dec_refcnt_listen", 1472, listener, tmp___2); } else { } } else { } } else { } return (ret); } } static int mini_cm_del_listen(struct nes_cm_core *cm_core , struct nes_cm_listener *listener ) { int tmp ; { listener->listener_state = 1; listener->cm_id = (struct iw_cm_id *)0; tmp = mini_cm_dec_refcnt_listen(cm_core, listener, 1); return (tmp); } } __inline static int mini_cm_accelerated(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) { long tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; { cm_node->accelerated = 1; if (cm_node->accept_pend != 0) { tmp = ldv__builtin_expect((unsigned long )cm_node->listener == (unsigned long )((struct nes_cm_listener *)0), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c"), "i" (1500), "i" (12UL)); ldv_61912: ; goto ldv_61912; } else { } atomic_dec(& (cm_node->listener)->pend_accepts_cnt); cm_node->accept_pend = 0; tmp___0 = atomic_read((atomic_t const *)(& (cm_node->listener)->pend_accepts_cnt)); tmp___1 = ldv__builtin_expect(tmp___0 < 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c"), "i" (1503), "i" (12UL)); ldv_61913: ; goto ldv_61913; } else { } } else { } tmp___2 = timer_pending((struct timer_list const *)(& cm_core->tcp_timer)); if (tmp___2 == 0) { ldv_mod_timer_314(& cm_core->tcp_timer, (unsigned long )jiffies + 10UL); } else { } return (0); } } static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic , u32 dst_ip , int arpindex ) { struct rtable *rt ; struct neighbour *neigh ; int rc ; struct net_device *netdev ; struct nes_adapter *nesadapter ; __u32 tmp ; bool tmp___0 ; bool tmp___1 ; __u32 tmp___2 ; bool tmp___3 ; { rc = arpindex; nesadapter = (nesvnic->nesdev)->nesadapter; tmp = __fswab32(dst_ip); rt = ip_route_output(& init_net, tmp, 0U, 0, 0); tmp___0 = IS_ERR((void const *)rt); if ((int )tmp___0) { printk("\v%s: ip_route_output_key failed for 0x%08X\n", "nes_addr_resolve_neigh", dst_ip); return (rc); } else { } tmp___1 = netif_is_bond_slave(nesvnic->netdev); if ((int )tmp___1) { netdev = netdev_master_upper_dev_get(nesvnic->netdev); } else { netdev = nesvnic->netdev; } neigh = neigh_lookup(& arp_tbl, (void const *)(& rt->rt_gateway), netdev); rcu_read_lock(); if ((unsigned long )neigh != (unsigned long )((struct neighbour *)0)) { if (((int )neigh->nud_state & 222) != 0) { if ((nes_debug_level & 32U) != 0U) { tmp___2 = __fswab32(rt->rt_gateway); printk("\viw_nes: %s[%u]: Neighbor MAC address for 0x%08X is %pM, Gateway is 0x%08X \n", "nes_addr_resolve_neigh", 1543, dst_ip, (unsigned char *)(& neigh->ha), tmp___2); } else { } if (arpindex >= 0) { tmp___3 = ether_addr_equal((u8 const *)(& nesadapter->arp_table[arpindex].mac_addr), (u8 const *)(& neigh->ha)); if ((int )tmp___3) { goto out; } else { } nes_manage_arp_cache(nesvnic->netdev, (unsigned char *)(& nesadapter->arp_table[arpindex].mac_addr), dst_ip, 2U); } else { } nes_manage_arp_cache(nesvnic->netdev, (unsigned char *)(& neigh->ha), dst_ip, 1U); rc = nes_arp_table(nesvnic->nesdev, dst_ip, (u8 *)0U, 3U); } else { neigh_event_send(neigh, (struct sk_buff *)0); } } else { } out: rcu_read_unlock(); if ((unsigned long )neigh != (unsigned long )((struct neighbour *)0)) { neigh_release(neigh); } else { } ip_rt_put(rt); return (rc); } } static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core , struct nes_vnic *nesvnic , struct nes_cm_info *cm_info , struct nes_cm_listener *listener ) { struct nes_cm_node *cm_node ; struct timespec ts ; int oldarpindex ; int arpindex ; struct nes_device *nesdev ; struct nes_adapter *nesadapter ; void *tmp ; struct lock_class_key __key ; __u32 tmp___0 ; { oldarpindex = 0; arpindex = 0; tmp = kzalloc(1160UL, 32U); cm_node = (struct nes_cm_node *)tmp; if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { return ((struct nes_cm_node *)0); } else { } if ((unsigned long )listener != (unsigned long )((struct nes_cm_listener *)0)) { cm_node->loc_addr = listener->loc_addr; cm_node->loc_port = listener->loc_port; } else { cm_node->loc_addr = cm_info->loc_addr; cm_node->loc_port = cm_info->loc_port; } cm_node->rem_addr = cm_info->rem_addr; cm_node->rem_port = cm_info->rem_port; cm_node->mapped_loc_addr = cm_info->mapped_loc_addr; cm_node->mapped_rem_addr = cm_info->mapped_rem_addr; cm_node->mapped_loc_port = cm_info->mapped_loc_port; cm_node->mapped_rem_port = cm_info->mapped_rem_port; cm_node->mpa_frame_rev = (enum mpa_frame_version )mpa_version; cm_node->send_rdma0_op = 1; cm_node->mpav2_ird_ord = 0U; cm_node->ird_size = 0U; cm_node->ord_size = 0U; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Make node addresses : loc = %pI4:%x, rem = %pI4:%x\n", "make_cm_node", 1617, & cm_node->loc_addr, (int )cm_node->loc_port, & cm_node->rem_addr, (int )cm_node->rem_port); } else { } cm_node->listener = listener; if ((unsigned long )listener != (unsigned long )((struct nes_cm_listener *)0)) { cm_node->tos = listener->tos; } else { } cm_node->netdev = nesvnic->netdev; cm_node->cm_id = cm_info->__annonCompField122.cm_id; memcpy((void *)(& cm_node->loc_mac), (void const *)(nesvnic->netdev)->dev_addr, 6UL); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: listener=%p, cm_id=%p\n", "make_cm_node", 1626, cm_node->listener, cm_node->cm_id); } else { } spinlock_check(& cm_node->retrans_list_lock); __raw_spin_lock_init(& cm_node->retrans_list_lock.__annonCompField18.rlock, "&(&cm_node->retrans_list_lock)->rlock", & __key); cm_node->loopbackpartner = (struct nes_cm_node *)0; atomic_set(& cm_node->ref_count, 1); cm_node->cm_core = cm_core; cm_node->tcp_cntxt.loc_id = 15175U; cm_node->tcp_cntxt.rcv_wscale = 2U; cm_node->tcp_cntxt.rcv_wnd = 64240U; ts = current_kernel_time(); tmp___0 = __fswab32((__u32 )ts.tv_nsec); cm_node->tcp_cntxt.loc_seq_num = tmp___0; cm_node->tcp_cntxt.mss = (u32 )nesvnic->max_frame_size - 58U; cm_node->tcp_cntxt.rcv_nxt = 0U; atomic_inc(& cm_core->node_cnt); cm_node->conn_type = cm_info->conn_type; cm_node->apbvt_set = 0; cm_node->accept_pend = 0; cm_node->nesvnic = nesvnic; nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; cm_node->loopbackpartner = (struct nes_cm_node *)0; oldarpindex = nes_arp_table(nesdev, cm_node->mapped_rem_addr, (u8 *)0U, 3U); arpindex = nes_addr_resolve_neigh(nesvnic, cm_node->mapped_rem_addr, oldarpindex); if (arpindex < 0) { kfree((void const *)cm_node); return ((struct nes_cm_node *)0); } else { } memcpy((void *)(& cm_node->rem_mac), (void const *)(& nesadapter->arp_table[arpindex].mac_addr), 6UL); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Remote mac addr from arp table: %pM\n", "make_cm_node", 1669, (u8 *)(& cm_node->rem_mac)); } else { } add_hte_node(cm_core, cm_node); atomic_inc(& cm_nodes_created); return (cm_node); } } static int add_ref_cm_node(struct nes_cm_node *cm_node ) { { atomic_inc(& cm_node->ref_count); return (0); } } static int rem_ref_cm_node(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) { unsigned long flags ; struct nes_qp *nesqp ; int tmp ; long tmp___0 ; int tmp___1 ; long tmp___2 ; int __ret_warn_on ; long tmp___3 ; { if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { return (-22); } else { } ldv_spin_lock(); tmp = atomic_sub_return(1, & cm_node->ref_count); if (tmp != 0) { spin_unlock_irqrestore(& (cm_node->cm_core)->ht_lock, flags); return (0); } else { } list_del(& cm_node->list); atomic_dec(& cm_core->ht_node_cnt); spin_unlock_irqrestore(& (cm_node->cm_core)->ht_lock, flags); if (cm_node->accelerated == 0 && cm_node->accept_pend != 0) { tmp___0 = ldv__builtin_expect((unsigned long )cm_node->listener == (unsigned long )((struct nes_cm_listener *)0), 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c"), "i" (1711), "i" (12UL)); ldv_61949: ; goto ldv_61949; } else { } atomic_dec(& (cm_node->listener)->pend_accepts_cnt); tmp___1 = atomic_read((atomic_t const *)(& (cm_node->listener)->pend_accepts_cnt)); tmp___2 = ldv__builtin_expect(tmp___1 < 0, 0L); if (tmp___2 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c"), "i" (1713), "i" (12UL)); ldv_61950: ; goto ldv_61950; } else { } } else { } __ret_warn_on = (unsigned long )cm_node->send_entry != (unsigned long )((struct nes_timer_entry *)0); tmp___3 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c", 1715); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned long )cm_node->recv_entry != (unsigned long )((struct nes_timer_entry *)0)) { handle_recv_entry(cm_node, 0U); } else { } if ((unsigned long )cm_node->listener != (unsigned long )((struct nes_cm_listener *)0)) { mini_cm_dec_refcnt_listen(cm_core, cm_node->listener, 0); } else { if (cm_node->apbvt_set != 0 && (unsigned long )cm_node->nesvnic != (unsigned long )((struct nes_vnic *)0)) { nes_manage_apbvt(cm_node->nesvnic, (u32 )cm_node->mapped_loc_port, (((cm_node->nesvnic)->nesdev)->pcidev)->devfn & 7U, 0U); } else { } if ((nes_debug_level & 2097152U) != 0U) { printk("\viw_nes: %s[%u]: Delete APBVT mapped_loc_port = %04X\n", "rem_ref_cm_node", 1727, (int )cm_node->mapped_loc_port); } else { } nes_remove_mapinfo(cm_node->loc_addr, (int )cm_node->loc_port, cm_node->mapped_loc_addr, (int )cm_node->mapped_loc_port); } atomic_dec(& cm_core->node_cnt); atomic_inc(& cm_nodes_destroyed); nesqp = cm_node->nesqp; if ((unsigned long )nesqp != (unsigned long )((struct nes_qp *)0)) { nesqp->cm_node = (void *)0; nes_rem_ref(& nesqp->ibqp); cm_node->nesqp = (struct nes_qp *)0; } else { } kfree((void const *)cm_node); return (0); } } static int process_options(struct nes_cm_node *cm_node , u8 *optionsloc , u32 optionsize , u32 syn_packet ) { u32 tmp ; u32 offset ; union all_known_options *all_options ; char got_mss_option ; __u16 tmp___0 ; { offset = 0U; got_mss_option = 0; goto ldv_61967; ldv_61972: all_options = (union all_known_options *)optionsloc + (unsigned long )offset; switch ((int )all_options->as_base.optionnum) { case 0: offset = optionsize; goto ldv_61965; case 1: offset = offset + 1U; goto ldv_61967; case 2: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s: MSS Length: %d Offset: %d Size: %d\n", "process_options", 1768, "process_options", (int )all_options->as_mss.length, offset, optionsize); } else { } got_mss_option = 1; if ((unsigned int )all_options->as_mss.length != 4U) { return (1); } else { tmp___0 = __fswab16((int )all_options->as_mss.mss); tmp = (u32 )tmp___0; if (tmp != 0U && cm_node->tcp_cntxt.mss > tmp) { cm_node->tcp_cntxt.mss = tmp; } else { } } goto ldv_61965; case 3: cm_node->tcp_cntxt.snd_wscale = all_options->as_windowscale.shiftcount; goto ldv_61965; default: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: TCP Option not understood: %x\n", "process_options", 1785, (int )all_options->as_base.optionnum); } else { } goto ldv_61965; } ldv_61965: offset = (u32 )all_options->as_base.length + offset; ldv_61967: ; if (offset < optionsize) { goto ldv_61972; } else { } if ((int )((signed char )got_mss_option) == 0 && syn_packet != 0U) { cm_node->tcp_cntxt.mss = 536U; } else { } return (0); } } static void drop_packet(struct sk_buff *skb ) { { atomic_inc(& cm_accel_dropped_pkts); dev_kfree_skb_any(skb); return; } } static void handle_fin_pkt(struct nes_cm_node *cm_node ) { int tmp ; { if ((nes_debug_level & 32U) != 0U) { tmp = atomic_read((atomic_t const *)(& cm_node->ref_count)); printk("\viw_nes: %s[%u]: Received FIN, cm_node = %p, state = %u. refcnt=%d\n", "handle_fin_pkt", 1805, cm_node, (unsigned int )cm_node->state, tmp); } else { } switch ((unsigned int )cm_node->state) { case 3U: ; case 4U: ; case 6U: ; case 10U: cm_node->tcp_cntxt.rcv_nxt = cm_node->tcp_cntxt.rcv_nxt + 1U; cleanup_retrans_entry(cm_node); cm_node->state = 16; send_fin(cm_node, (struct sk_buff *)0); goto ldv_61985; case 8U: create_event(cm_node, 14); cm_node->tcp_cntxt.rcv_nxt = cm_node->tcp_cntxt.rcv_nxt + 1U; cleanup_retrans_entry(cm_node); cm_node->state = 19; add_ref_cm_node(cm_node); send_reset(cm_node, (struct sk_buff *)0); goto ldv_61985; case 12U: cm_node->tcp_cntxt.rcv_nxt = cm_node->tcp_cntxt.rcv_nxt + 1U; cleanup_retrans_entry(cm_node); cm_node->state = 17; send_ack(cm_node, (struct sk_buff *)0); goto ldv_61985; case 13U: cm_node->tcp_cntxt.rcv_nxt = cm_node->tcp_cntxt.rcv_nxt + 1U; cleanup_retrans_entry(cm_node); cm_node->state = 15; send_ack(cm_node, (struct sk_buff *)0); schedule_nes_timer(cm_node, (struct sk_buff *)0, 3, 1, 0); goto ldv_61985; case 15U: cm_node->tcp_cntxt.rcv_nxt = cm_node->tcp_cntxt.rcv_nxt + 1U; cleanup_retrans_entry(cm_node); cm_node->state = 19; rem_ref_cm_node(cm_node->cm_core, cm_node); goto ldv_61985; case 11U: ; default: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Error Rcvd FIN for node-%p state = %d\n", "handle_fin_pkt", 1849, cm_node, (unsigned int )cm_node->state); } else { } goto ldv_61985; } ldv_61985: ; return; } } static void handle_rst_pkt(struct nes_cm_node *cm_node , struct sk_buff *skb , struct tcphdr *tcph ) { int reset ; int tmp ; int tmp___0 ; { reset = 0; atomic_inc(& cm_resets_recvd); if ((nes_debug_level & 32U) != 0U) { tmp = atomic_read((atomic_t const *)(& cm_node->ref_count)); printk("\viw_nes: %s[%u]: Received Reset, cm_node = %p, state = %u. refcnt=%d\n", "handle_rst_pkt", 1863, cm_node, (unsigned int )cm_node->state, tmp); } else { } cleanup_retrans_entry(cm_node); switch ((unsigned int )cm_node->state) { case 4U: ; case 8U: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s[%u] create abort for cm_node=%p listener=%p state=%d\n", "handle_rst_pkt", 1870, "handle_rst_pkt", 1870, cm_node, cm_node->listener, (unsigned int )cm_node->state); } else { } switch ((unsigned int )cm_node->mpa_frame_rev) { case 2U: cm_node->mpa_frame_rev = 1; cm_node->state = 4; tmp___0 = send_syn(cm_node, 0U, (struct sk_buff *)0); if (tmp___0 != 0) { active_open_err(cm_node, skb, reset); } else { } goto ldv_62002; case 1U: ; default: active_open_err(cm_node, skb, reset); goto ldv_62002; } ldv_62002: ; goto ldv_62005; case 9U: atomic_inc(& cm_node->passive_state); dev_kfree_skb_any(skb); goto ldv_62005; case 6U: ; case 3U: ; case 2U: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Bad state %s[%u]\n", "handle_rst_pkt", 1893, "handle_rst_pkt", 1893); } else { } passive_open_err(cm_node, skb, reset); goto ldv_62005; case 11U: active_open_err(cm_node, skb, reset); goto ldv_62005; case 19U: drop_packet(skb); goto ldv_62005; case 13U: ; case 12U: ; case 16U: (*((cm_node->cm_id)->rem_ref))(cm_node->cm_id); case 15U: cm_node->state = 19; rem_ref_cm_node(cm_node->cm_core, cm_node); drop_packet(skb); goto ldv_62005; default: drop_packet(skb); goto ldv_62005; } ldv_62005: ; return; } } static void handle_rcv_mpa(struct nes_cm_node *cm_node , struct sk_buff *skb ) { int ret ; int datasize ; u8 *dataloc ; enum nes_cm_event_type type ; u32 res_type ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; { ret = 0; datasize = (int )skb->len; dataloc = skb->data; type = 0; ret = parse_mpa(cm_node, dataloc, & res_type, (u32 )datasize); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: didn\'t like MPA Request\n", "handle_rcv_mpa", 1929); } else { } if ((unsigned int )cm_node->state == 8U) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s[%u] create abort for cm_node=%p listener=%p state=%d\n", "handle_rcv_mpa", 1934, "handle_rcv_mpa", 1934, cm_node, cm_node->listener, (unsigned int )cm_node->state); } else { } active_open_err(cm_node, skb, 1); } else { passive_open_err(cm_node, skb, 1); } return; } else { } switch ((unsigned int )cm_node->state) { case 6U: ; if (res_type == 2U) { __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c", 1948); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } cm_node->state = 9; type = 2; atomic_set(& cm_node->passive_state, 0); goto ldv_62030; case 8U: cleanup_retrans_entry(cm_node); if (res_type == 2U) { type = 5; cm_node->state = 10; } else { type = 7; cm_node->state = 11; } goto ldv_62030; default: __ret_warn_on___0 = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c", 1966); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); goto ldv_62030; } ldv_62030: dev_kfree_skb_any(skb); create_event(cm_node, type); return; } } static void indicate_pkt_err(struct nes_cm_node *cm_node , struct sk_buff *skb ) { { switch ((unsigned int )cm_node->state) { case 4U: ; case 8U: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s[%u] create abort for cm_node=%p listener=%p state=%d\n", "indicate_pkt_err", 1980, "indicate_pkt_err", 1980, cm_node, cm_node->listener, (unsigned int )cm_node->state); } else { } active_open_err(cm_node, skb, 1); goto ldv_62042; case 6U: ; case 3U: passive_open_err(cm_node, skb, 1); goto ldv_62042; case 11U: ; default: drop_packet(skb); } ldv_62042: ; return; } } static int check_syn(struct nes_cm_node *cm_node , struct tcphdr *tcph , struct sk_buff *skb ) { int err ; __u32 tmp ; { tmp = __fswab32(tcph->ack_seq); err = tmp != cm_node->tcp_cntxt.loc_seq_num; if (err != 0) { active_open_err(cm_node, skb, 1); } else { } return (err); } } static int check_seq(struct nes_cm_node *cm_node , struct tcphdr *tcph , struct sk_buff *skb ) { int err ; u32 seq ; u32 ack_seq ; u32 loc_seq_num ; u32 rcv_nxt ; u32 rcv_wnd ; __u32 tmp ; __u32 tmp___0 ; bool tmp___1 ; int tmp___2 ; { err = 0; loc_seq_num = cm_node->tcp_cntxt.loc_seq_num; rcv_nxt = cm_node->tcp_cntxt.rcv_nxt; tmp = __fswab32(tcph->seq); seq = tmp; tmp___0 = __fswab32(tcph->ack_seq); ack_seq = tmp___0; rcv_wnd = cm_node->tcp_cntxt.rcv_wnd; if (ack_seq != loc_seq_num) { err = 1; } else { tmp___1 = between(seq, rcv_nxt, rcv_nxt + rcv_wnd); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { err = 1; } else { } } if (err != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s[%u] create abort for cm_node=%p listener=%p state=%d\n", "check_seq", 2025, "check_seq", 2025, cm_node, cm_node->listener, (unsigned int )cm_node->state); } else { } indicate_pkt_err(cm_node, skb); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: seq OLD_ERROR cm_node =%p seq=0x%08X rcv_nxt=0x%08X rcv_wnd=0x%x\n", "check_seq", 2029, cm_node, seq, rcv_nxt, rcv_wnd); } else { } } else { } return (err); } } static void handle_syn_pkt(struct nes_cm_node *cm_node , struct sk_buff *skb , struct tcphdr *tcph ) { int ret ; u32 inc_sequence ; int optionsize ; __u32 tmp ; int tmp___0 ; long tmp___1 ; { optionsize = (int )((unsigned int )((int )tcph->doff << 2) - 20U); skb_trim(skb, 0U); tmp = __fswab32(tcph->seq); inc_sequence = tmp; switch ((unsigned int )cm_node->state) { case 4U: ; case 8U: active_open_err(cm_node, skb, 1); goto ldv_62075; case 2U: tmp___0 = atomic_read((atomic_t const *)(& (cm_node->listener)->pend_accepts_cnt)); if (tmp___0 > (cm_node->listener)->backlog) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: drop syn due to backlog pressure \n", "handle_syn_pkt", 2061); } else { } cm_backlog_drops = cm_backlog_drops + 1U; passive_open_err(cm_node, skb, 0); goto ldv_62075; } else { } ret = handle_tcp_options(cm_node, tcph, skb, optionsize, 1); if (ret != 0) { passive_open_err(cm_node, skb, 0); goto ldv_62075; } else { } cm_node->tcp_cntxt.rcv_nxt = inc_sequence + 1U; tmp___1 = ldv__builtin_expect((unsigned long )cm_node->send_entry != (unsigned long )((struct nes_timer_entry *)0), 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c"), "i" (2074), "i" (12UL)); ldv_62078: ; goto ldv_62078; } else { } cm_node->accept_pend = 1; atomic_inc(& (cm_node->listener)->pend_accepts_cnt); cm_node->state = 3; send_syn(cm_node, 1U, skb); goto ldv_62075; case 19U: cleanup_retrans_entry(cm_node); add_ref_cm_node(cm_node); send_reset(cm_node, skb); goto ldv_62075; case 11U: ; case 6U: ; case 12U: ; case 13U: ; case 9U: ; case 16U: ; case 17U: ; case 0U: ; default: drop_packet(skb); goto ldv_62075; } ldv_62075: ; return; } } static void handle_synack_pkt(struct nes_cm_node *cm_node , struct sk_buff *skb , struct tcphdr *tcph ) { int ret ; u32 inc_sequence ; int optionsize ; __u32 tmp ; int tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; { optionsize = (int )((unsigned int )((int )tcph->doff << 2) - 20U); skb_trim(skb, 0U); tmp = __fswab32(tcph->seq); inc_sequence = tmp; switch ((unsigned int )cm_node->state) { case 4U: cleanup_retrans_entry(cm_node); tmp___0 = check_syn(cm_node, tcph, skb); if (tmp___0 != 0) { return; } else { } tmp___1 = __fswab32(tcph->ack_seq); cm_node->tcp_cntxt.rem_ack_num = tmp___1; ret = handle_tcp_options(cm_node, tcph, skb, optionsize, 0); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node=%p tcp_options failed\n", "handle_synack_pkt", 2121, cm_node); } else { } goto ldv_62099; } else { } cleanup_retrans_entry(cm_node); cm_node->tcp_cntxt.rcv_nxt = inc_sequence + 1U; send_mpa_request(cm_node, skb); cm_node->state = 8; goto ldv_62099; case 9U: passive_open_err(cm_node, skb, 1); goto ldv_62099; case 2U: tmp___2 = __fswab32(tcph->ack_seq); cm_node->tcp_cntxt.loc_seq_num = tmp___2; cleanup_retrans_entry(cm_node); cm_node->state = 19; send_reset(cm_node, skb); goto ldv_62099; case 19U: tmp___3 = __fswab32(tcph->ack_seq); cm_node->tcp_cntxt.loc_seq_num = tmp___3; cleanup_retrans_entry(cm_node); add_ref_cm_node(cm_node); send_reset(cm_node, skb); goto ldv_62099; case 6U: ; case 12U: ; case 13U: ; case 16U: ; case 11U: ; case 17U: ; case 0U: ; case 8U: ; default: drop_packet(skb); goto ldv_62099; } ldv_62099: ; return; } } static int handle_ack_pkt(struct nes_cm_node *cm_node , struct sk_buff *skb , struct tcphdr *tcph ) { int datasize ; u32 inc_sequence ; int ret ; int optionsize ; int tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; { datasize = 0; ret = 0; optionsize = (int )((unsigned int )((int )tcph->doff << 2) - 20U); tmp = check_seq(cm_node, tcph, skb); if (tmp != 0) { return (-22); } else { } skb_pull(skb, (unsigned int )((int )tcph->doff << 2)); tmp___0 = __fswab32(tcph->seq); inc_sequence = tmp___0; datasize = (int )skb->len; switch ((unsigned int )cm_node->state) { case 3U: cleanup_retrans_entry(cm_node); ret = handle_tcp_options(cm_node, tcph, skb, optionsize, 1); if (ret != 0) { goto ldv_62122; } else { } tmp___1 = __fswab32(tcph->ack_seq); cm_node->tcp_cntxt.rem_ack_num = tmp___1; cm_node->state = 6; if (datasize != 0) { cm_node->tcp_cntxt.rcv_nxt = inc_sequence + (u32 )datasize; nes_get_remote_addr(cm_node); handle_rcv_mpa(cm_node, skb); } else { dev_kfree_skb_any(skb); } goto ldv_62122; case 6U: cleanup_retrans_entry(cm_node); if (datasize != 0) { cm_node->tcp_cntxt.rcv_nxt = inc_sequence + (u32 )datasize; handle_rcv_mpa(cm_node, skb); } else { drop_packet(skb); } goto ldv_62122; case 8U: tmp___2 = __fswab32(tcph->ack_seq); cm_node->tcp_cntxt.rem_ack_num = tmp___2; if (datasize != 0) { cm_node->tcp_cntxt.rcv_nxt = inc_sequence + (u32 )datasize; handle_rcv_mpa(cm_node, skb); } else { dev_kfree_skb_any(skb); } goto ldv_62122; case 2U: cleanup_retrans_entry(cm_node); cm_node->state = 19; send_reset(cm_node, skb); goto ldv_62122; case 19U: cleanup_retrans_entry(cm_node); add_ref_cm_node(cm_node); send_reset(cm_node, skb); goto ldv_62122; case 16U: ; case 17U: cleanup_retrans_entry(cm_node); cm_node->state = 19; (*((cm_node->cm_id)->rem_ref))(cm_node->cm_id); rem_ref_cm_node(cm_node->cm_core, cm_node); drop_packet(skb); goto ldv_62122; case 12U: cleanup_retrans_entry(cm_node); drop_packet(skb); cm_node->state = 13; goto ldv_62122; case 4U: ; case 13U: ; case 11U: ; case 9U: ; case 0U: ; default: cleanup_retrans_entry(cm_node); drop_packet(skb); goto ldv_62122; } ldv_62122: ; return (ret); } } static int handle_tcp_options(struct nes_cm_node *cm_node , struct tcphdr *tcph , struct sk_buff *skb , int optionsize , int passive ) { u8 *optionsloc ; int tmp ; __u16 tmp___0 ; { optionsloc = (u8 *)tcph + 1U; if (optionsize != 0) { tmp = process_options(cm_node, optionsloc, (u32 )optionsize, (unsigned int )tcph->syn); if (tmp != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s: Node %p, Sending RESET\n", "handle_tcp_options", 2258, "handle_tcp_options", cm_node); } else { } if (passive != 0) { passive_open_err(cm_node, skb, 1); } else { active_open_err(cm_node, skb, 1); } return (1); } else { } } else { } tmp___0 = __fswab16((int )tcph->window); cm_node->tcp_cntxt.snd_wnd = (u32 )((int )tmp___0 << (int )cm_node->tcp_cntxt.snd_wscale); if (cm_node->tcp_cntxt.snd_wnd > cm_node->tcp_cntxt.max_snd_wnd) { cm_node->tcp_cntxt.max_snd_wnd = cm_node->tcp_cntxt.snd_wnd; } else { } return (0); } } static void active_open_err(struct nes_cm_node *cm_node , struct sk_buff *skb , int reset ) { { cleanup_retrans_entry(cm_node); if (reset != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: OLD_ERROR active err called for cm_node=%p, state=%d\n", "active_open_err", 2285, cm_node, (unsigned int )cm_node->state); } else { } add_ref_cm_node(cm_node); send_reset(cm_node, skb); } else { dev_kfree_skb_any(skb); } cm_node->state = 19; create_event(cm_node, 14); return; } } static void passive_open_err(struct nes_cm_node *cm_node , struct sk_buff *skb , int reset ) { { cleanup_retrans_entry(cm_node); cm_node->state = 19; if (reset != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: passive_open_err sending RST for cm_node=%p state =%d\n", "passive_open_err", 2307, cm_node, (unsigned int )cm_node->state); } else { } send_reset(cm_node, skb); } else { dev_kfree_skb_any(skb); rem_ref_cm_node(cm_node->cm_core, cm_node); } return; } } static void free_retrans_entry(struct nes_cm_node *cm_node ) { struct nes_timer_entry *send_entry ; { send_entry = cm_node->send_entry; if ((unsigned long )send_entry != (unsigned long )((struct nes_timer_entry *)0)) { cm_node->send_entry = (struct nes_timer_entry *)0; dev_kfree_skb_any(send_entry->skb); kfree((void const *)send_entry); rem_ref_cm_node(cm_node->cm_core, cm_node); } else { } return; } } static void cleanup_retrans_entry(struct nes_cm_node *cm_node ) { unsigned long flags ; { ldv_spin_lock(); free_retrans_entry(cm_node); spin_unlock_irqrestore(& cm_node->retrans_list_lock, flags); return; } } static void process_packet(struct nes_cm_node *cm_node , struct sk_buff *skb , struct nes_cm_core *cm_core ) { enum nes_tcpip_pkt_type pkt_type ; struct tcphdr *tcph ; struct tcphdr *tmp ; u32 fin_set ; int ret ; struct iphdr *tmp___0 ; int tmp___1 ; { pkt_type = 0; tmp = tcp_hdr((struct sk_buff const *)skb); tcph = tmp; fin_set = 0U; ret = 0; tmp___0 = ip_hdr((struct sk_buff const *)skb); skb_pull(skb, (unsigned int )((int )tmp___0->ihl << 2)); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: process_packet: cm_node=%p state =%d syn=%d ack=%d rst=%d fin=%d\n", "process_packet", 2357, cm_node, (unsigned int )cm_node->state, (int )tcph->syn, (int )tcph->ack, (int )tcph->rst, (int )tcph->fin); } else { } if ((unsigned int )*((unsigned char *)tcph + 13UL) != 0U) { pkt_type = 5; } else if ((unsigned int )*((unsigned char *)tcph + 13UL) != 0U) { pkt_type = 1; if ((unsigned int )*((unsigned char *)tcph + 13UL) != 0U) { pkt_type = 2; } else { } } else if ((unsigned int )*((unsigned char *)tcph + 13UL) != 0U) { pkt_type = 3; } else { } if ((unsigned int )*((unsigned char *)tcph + 13UL) != 0U) { fin_set = 1U; } else { } switch ((unsigned int )pkt_type) { case 1U: handle_syn_pkt(cm_node, skb, tcph); goto ldv_62176; case 2U: handle_synack_pkt(cm_node, skb, tcph); goto ldv_62176; case 3U: ret = handle_ack_pkt(cm_node, skb, tcph); if (fin_set != 0U && ret == 0) { handle_fin_pkt(cm_node); } else { } goto ldv_62176; case 5U: handle_rst_pkt(cm_node, skb, tcph); goto ldv_62176; default: ; if (fin_set != 0U) { tmp___1 = check_seq(cm_node, tcph, skb); if (tmp___1 == 0) { handle_fin_pkt(cm_node); } else { } } else { } drop_packet(skb); goto ldv_62176; } ldv_62176: ; return; } } static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *cm_core , struct nes_vnic *nesvnic , struct nes_cm_info *cm_info ) { struct nes_cm_listener *listener ; struct iwpm_dev_data pm_reg_msg ; struct iwpm_sa_data pm_msg ; unsigned long flags ; int iwpm_err ; int tmp ; void *tmp___0 ; { iwpm_err = 0; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Search for 0x%08x : 0x%04x\n", "mini_cm_listen", 2407, cm_info->loc_addr, (int )cm_info->loc_port); } else { } listener = find_listener(cm_core, cm_info->loc_addr, (int )cm_info->loc_port, 3, 1); if ((unsigned long )listener != (unsigned long )((struct nes_cm_listener *)0) && (unsigned int )listener->listener_state == 2U) { atomic_dec(& listener->ref_count); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Not creating listener since it already exists\n", "mini_cm_listen", 2416); } else { } return ((struct nes_cm_listener *)0); } else { } if ((unsigned long )listener == (unsigned long )((struct nes_cm_listener *)0)) { nes_form_reg_msg(nesvnic, & pm_reg_msg); iwpm_err = iwpm_register_pid(& pm_reg_msg, 2); if (iwpm_err != 0) { if ((nes_debug_level & 2097152U) != 0U) { printk("\viw_nes: %s[%u]: Port Mapper reg pid fail (err = %d).\n", "mini_cm_listen", 2425, iwpm_err); } else { } } else { } tmp = iwpm_valid_pid(); if (tmp != 0 && iwpm_err == 0) { nes_form_pm_msg(cm_info, & pm_msg); iwpm_err = iwpm_add_mapping(& pm_msg, 2); if (iwpm_err != 0) { if ((nes_debug_level & 2097152U) != 0U) { printk("\viw_nes: %s[%u]: Port Mapper query fail (err = %d).\n", "mini_cm_listen", 2432, iwpm_err); } else { } } else { nes_record_pm_msg(cm_info, & pm_msg); } } else { } tmp___0 = kzalloc(96UL, 32U); listener = (struct nes_cm_listener *)tmp___0; if ((unsigned long )listener == (unsigned long )((struct nes_cm_listener *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Not creating listener memory allocation failed\n", "mini_cm_listen", 2440); } else { } return ((struct nes_cm_listener *)0); } else { } listener->loc_addr = cm_info->loc_addr; listener->loc_port = cm_info->loc_port; listener->mapped_loc_addr = cm_info->mapped_loc_addr; listener->mapped_loc_port = cm_info->mapped_loc_port; listener->reused_node = 0U; atomic_set(& listener->ref_count, 1); } else { listener->reused_node = 1U; } listener->cm_id = cm_info->__annonCompField122.cm_id; atomic_set(& listener->pend_accepts_cnt, 0); listener->cm_core = cm_core; listener->nesvnic = nesvnic; atomic_inc(& cm_core->node_cnt); listener->conn_type = cm_info->conn_type; listener->backlog = cm_info->backlog; listener->listener_state = 2; if (listener->reused_node == 0U) { ldv_spin_lock(); list_add(& listener->list, & cm_core->listen_list.list); spin_unlock_irqrestore(& cm_core->listen_list_lock, flags); atomic_inc(& cm_core->listen_node_cnt); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Api - listen(): addr=0x%08X, port=0x%04x, listener = %p, backlog = %d, cm_id = %p.\n", "mini_cm_listen", 2478, cm_info->loc_addr, (int )cm_info->loc_port, listener, listener->backlog, listener->cm_id); } else { } return (listener); } } static struct nes_cm_node *mini_cm_connect(struct nes_cm_core *cm_core , struct nes_vnic *nesvnic , u16 private_data_len , void *private_data , struct nes_cm_info *cm_info ) { int ret ; struct nes_cm_node *cm_node ; struct nes_cm_listener *loopbackremotelistener ; struct nes_cm_node *loopbackremotenode ; struct nes_cm_info loopback_cm_info ; u8 *start_buff ; { ret = 0; cm_node = make_cm_node(cm_core, nesvnic, cm_info, (struct nes_cm_listener *)0); if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { return ((struct nes_cm_node *)0); } else { } cm_node->tcp_cntxt.client = 1U; cm_node->tcp_cntxt.rcv_wscale = 2U; if (cm_info->loc_addr == cm_info->rem_addr) { loopbackremotelistener = find_listener(cm_core, cm_node->mapped_loc_addr, (int )cm_node->mapped_rem_port, 2, 0); if ((unsigned long )loopbackremotelistener == (unsigned long )((struct nes_cm_listener *)0)) { create_event(cm_node, 14); } else { loopback_cm_info = *cm_info; loopback_cm_info.loc_port = cm_info->rem_port; loopback_cm_info.rem_port = cm_info->loc_port; loopback_cm_info.mapped_loc_port = cm_info->mapped_rem_port; loopback_cm_info.mapped_rem_port = cm_info->mapped_loc_port; loopback_cm_info.__annonCompField122.cm_id = loopbackremotelistener->cm_id; loopbackremotenode = make_cm_node(cm_core, nesvnic, & loopback_cm_info, loopbackremotelistener); if ((unsigned long )loopbackremotenode == (unsigned long )((struct nes_cm_node *)0)) { rem_ref_cm_node(cm_node->cm_core, cm_node); return ((struct nes_cm_node *)0); } else { } atomic_inc(& cm_loopbacks); loopbackremotenode->loopbackpartner = cm_node; loopbackremotenode->tcp_cntxt.rcv_wscale = 2U; cm_node->loopbackpartner = loopbackremotenode; memcpy((void *)(& loopbackremotenode->__annonCompField121.mpa_frame_buf), (void const *)private_data, (size_t )private_data_len); loopbackremotenode->mpa_frame_size = private_data_len; cm_node->state = 11; cm_node->tcp_cntxt.rcv_nxt = loopbackremotenode->tcp_cntxt.loc_seq_num; loopbackremotenode->tcp_cntxt.rcv_nxt = cm_node->tcp_cntxt.loc_seq_num; cm_node->tcp_cntxt.max_snd_wnd = loopbackremotenode->tcp_cntxt.rcv_wnd; loopbackremotenode->tcp_cntxt.max_snd_wnd = cm_node->tcp_cntxt.rcv_wnd; cm_node->tcp_cntxt.snd_wnd = loopbackremotenode->tcp_cntxt.rcv_wnd; loopbackremotenode->tcp_cntxt.snd_wnd = cm_node->tcp_cntxt.rcv_wnd; cm_node->tcp_cntxt.snd_wscale = loopbackremotenode->tcp_cntxt.rcv_wscale; loopbackremotenode->tcp_cntxt.snd_wscale = cm_node->tcp_cntxt.rcv_wscale; loopbackremotenode->state = 9; create_event(loopbackremotenode, 2); } return (cm_node); } else { } start_buff = (u8 *)(& cm_node->__annonCompField121.mpa_frame_buf) + 24UL; cm_node->mpa_frame_size = private_data_len; memcpy((void *)start_buff, (void const *)private_data, (size_t )private_data_len); cm_node->state = 4; ret = send_syn(cm_node, 0U, (struct sk_buff *)0); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Api - connect() FAILED: dest addr=0x%08X, port=0x%04x, cm_node=%p, cm_id = %p.\n", "mini_cm_connect", 2576, cm_node->rem_addr, (int )cm_node->rem_port, cm_node, cm_node->cm_id); } else { } rem_ref_cm_node(cm_node->cm_core, cm_node); cm_node = (struct nes_cm_node *)0; } else { } if ((unsigned long )cm_node != (unsigned long )((struct nes_cm_node *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Api - connect(): dest addr=0x%08X,port=0x%04x, cm_node=%p, cm_id = %p.\n", "mini_cm_connect", 2585, cm_node->rem_addr, (int )cm_node->rem_port, cm_node, cm_node->cm_id); } else { } } else { } return (cm_node); } } static int mini_cm_accept(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) { { return (0); } } static int mini_cm_reject(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) { int ret ; int err ; int passive_state ; struct nes_cm_event event ; struct iw_cm_id *cm_id ; struct nes_cm_node *loopback ; int __ret_warn_on ; long tmp ; { ret = 0; err = 0; cm_id = cm_node->cm_id; loopback = cm_node->loopbackpartner; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %s cm_node=%p type=%d state=%d\n", "mini_cm_reject", 2615, "mini_cm_reject", cm_node, (int )cm_node->tcp_cntxt.client, (unsigned int )cm_node->state); } else { } if ((unsigned int )cm_node->tcp_cntxt.client != 0U) { return (ret); } else { } cleanup_retrans_entry(cm_node); if ((unsigned long )loopback == (unsigned long )((struct nes_cm_node *)0)) { passive_state = atomic_add_return(1, & cm_node->passive_state); if (passive_state == 2) { cm_node->state = 19; rem_ref_cm_node(cm_core, cm_node); } else if ((unsigned int )cm_node->state == 18U) { rem_ref_cm_node(cm_core, cm_node); } else { ret = send_mpa_reject(cm_node); if (ret != 0) { cm_node->state = 19; err = send_reset(cm_node, (struct sk_buff *)0); if (err != 0) { __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_cm.c", 2635); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } } else { (*(cm_id->add_ref))(cm_id); } } } else { cm_node->cm_id = (struct iw_cm_id *)0; if ((unsigned int )cm_node->state == 18U) { rem_ref_cm_node(cm_core, cm_node); rem_ref_cm_node(cm_core, loopback); } else { event.cm_node = loopback; event.cm_info.rem_addr = loopback->rem_addr; event.cm_info.loc_addr = loopback->loc_addr; event.cm_info.rem_port = loopback->rem_port; event.cm_info.loc_port = loopback->loc_port; event.cm_info.__annonCompField122.cm_id = loopback->cm_id; cm_event_mpa_reject(& event); rem_ref_cm_node(cm_core, cm_node); loopback->state = 17; cm_id = loopback->cm_id; rem_ref_cm_node(cm_core, loopback); (*(cm_id->rem_ref))(cm_id); } } return (ret); } } static int mini_cm_close(struct nes_cm_core *cm_core , struct nes_cm_node *cm_node ) { int ret ; { ret = 0; if ((unsigned long )cm_core == (unsigned long )((struct nes_cm_core *)0) || (unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { return (-22); } else { } switch ((unsigned int )cm_node->state) { case 3U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 8U: ; case 9U: cleanup_retrans_entry(cm_node); send_reset(cm_node, (struct sk_buff *)0); goto ldv_62235; case 14U: cm_node->state = 16; send_fin(cm_node, (struct sk_buff *)0); goto ldv_62235; case 12U: ; case 13U: ; case 16U: ; case 15U: ; case 17U: ret = -1; goto ldv_62235; case 2U: cleanup_retrans_entry(cm_node); send_reset(cm_node, (struct sk_buff *)0); goto ldv_62235; case 10U: ; case 0U: ; case 1U: ; case 19U: ; case 18U: ret = rem_ref_cm_node(cm_core, cm_node); goto ldv_62235; case 11U: ; if ((unsigned long )cm_node->send_entry != (unsigned long )((struct nes_timer_entry *)0)) { printk("\vERROR Close got called from STATE_TSA send_entry=%p\n", cm_node->send_entry); } else { } ret = rem_ref_cm_node(cm_core, cm_node); goto ldv_62235; } ldv_62235: ; return (ret); } } static int mini_cm_recv_pkt(struct nes_cm_core *cm_core , struct nes_vnic *nesvnic , struct sk_buff *skb ) { struct nes_cm_node *cm_node ; struct nes_cm_listener *listener ; struct iphdr *iph ; struct tcphdr *tcph ; struct nes_cm_info nfo ; int skb_handled ; __be32 tmp_daddr ; __be32 tmp_saddr ; __u32 tmp ; __u16 tmp___0 ; __u32 tmp___1 ; __u16 tmp___2 ; __u32 tmp___3 ; __u16 tmp___4 ; __u32 tmp___5 ; __u16 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u16 tmp___9 ; { cm_node = (struct nes_cm_node *)0; listener = (struct nes_cm_listener *)0; skb_handled = 1; if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return (0); } else { } if (skb->len <= 39U) { return (0); } else { } iph = (struct iphdr *)skb->data; tcph = (struct tcphdr *)skb->data + 20U; tmp = __fswab32(iph->daddr); nfo.loc_addr = tmp; tmp___0 = __fswab16((int )tcph->dest); nfo.loc_port = tmp___0; tmp___1 = __fswab32(iph->saddr); nfo.rem_addr = tmp___1; tmp___2 = __fswab16((int )tcph->source); nfo.rem_port = tmp___2; tmp___3 = __fswab32(iph->daddr); nfo.mapped_loc_addr = tmp___3; tmp___4 = __fswab16((int )tcph->dest); nfo.mapped_loc_port = tmp___4; tmp___5 = __fswab32(iph->saddr); nfo.mapped_rem_addr = tmp___5; tmp___6 = __fswab16((int )tcph->source); nfo.mapped_rem_port = tmp___6; tmp___7 = __fswab32(iph->daddr); tmp_daddr = tmp___7; tmp___8 = __fswab32(iph->saddr); tmp_saddr = tmp___8; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n", "mini_cm_recv_pkt", 2759, & tmp_daddr, (int )tcph->dest, & tmp_saddr, (int )tcph->source); } else { } cm_node = find_node(cm_core, (int )nfo.mapped_rem_port, nfo.mapped_rem_addr, (int )nfo.mapped_loc_port, nfo.mapped_loc_addr); if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { if ((unsigned int )*((unsigned char *)tcph + 13UL) == 0U || (unsigned int )*((unsigned char *)tcph + 13UL) != 0U) { skb_handled = 0; goto ldv_62263; } else { } listener = find_listener(cm_core, nfo.mapped_loc_addr, (int )nfo.mapped_loc_port, 2, 0); if ((unsigned long )listener == (unsigned long )((struct nes_cm_listener *)0)) { nfo.__annonCompField122.cm_id = (struct iw_cm_id *)0; nfo.conn_type = 0; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Unable to find listener for the pkt\n", "mini_cm_recv_pkt", 2779); } else { } skb_handled = 0; goto ldv_62263; } else { } nfo.__annonCompField122.cm_id = listener->cm_id; nfo.conn_type = listener->conn_type; cm_node = make_cm_node(cm_core, nesvnic, & nfo, listener); if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate node\n", "mini_cm_recv_pkt", 2789); } else { } cm_packets_dropped = cm_packets_dropped + 1U; atomic_dec(& listener->ref_count); dev_kfree_skb_any(skb); goto ldv_62263; } else { } if ((unsigned int )*((unsigned char *)tcph + 13UL) == 0U && (unsigned int )*((unsigned char *)tcph + 13UL) == 0U) { cm_node->state = 2; } else { cm_packets_dropped = cm_packets_dropped + 1U; rem_ref_cm_node(cm_core, cm_node); dev_kfree_skb_any(skb); goto ldv_62263; } add_ref_cm_node(cm_node); } else if ((unsigned int )cm_node->state == 11U) { if ((unsigned int )*((unsigned char *)cm_node->nesqp + 820UL) != 0U) { nes_queue_mgt_skbs(skb, nesvnic, cm_node->nesqp); } else { rem_ref_cm_node(cm_core, cm_node); atomic_inc(& cm_accel_dropped_pkts); dev_kfree_skb_any(skb); } goto ldv_62263; } else { } skb_reset_network_header(skb); skb_set_transport_header(skb, 20); tmp___9 = __fswab16((int )iph->tot_len); skb->len = (unsigned int )tmp___9; process_packet(cm_node, skb, cm_core); rem_ref_cm_node(cm_core, cm_node); ldv_62263: ; return (skb_handled); } } static struct nes_cm_core *nes_cm_alloc_core(void) { struct nes_cm_core *cm_core ; void *tmp ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; char const *__lock_name ; struct workqueue_struct *tmp___0 ; struct lock_class_key __key___2 ; char const *__lock_name___0 ; struct workqueue_struct *tmp___1 ; { tmp = kzalloc(1544UL, 208U); cm_core = (struct nes_cm_core *)tmp; if ((unsigned long )cm_core == (unsigned long )((struct nes_cm_core *)0)) { return ((struct nes_cm_core *)0); } else { } INIT_LIST_HEAD(& cm_core->connected_nodes); reg_timer_7(& cm_core->tcp_timer); cm_core->tcp_timer.function = & nes_cm_timer_tick; cm_core->mtu = 1540U; cm_core->state = 1; cm_core->free_tx_pkt_max = 10U; atomic_set(& cm_core->events_posted, 0); cm_core->api = & nes_cm_api; spinlock_check(& cm_core->ht_lock); __raw_spin_lock_init(& cm_core->ht_lock.__annonCompField18.rlock, "&(&cm_core->ht_lock)->rlock", & __key); spinlock_check(& cm_core->listen_list_lock); __raw_spin_lock_init(& cm_core->listen_list_lock.__annonCompField18.rlock, "&(&cm_core->listen_list_lock)->rlock", & __key___0); INIT_LIST_HEAD(& cm_core->listen_list.list); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Init CM Core completed -- cm_core=%p\n", "nes_cm_alloc_core", 2854, cm_core); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Enable QUEUE EVENTS\n", "nes_cm_alloc_core", 2856); } else { } __lock_name = "\"%s\"\"nesewq\""; tmp___0 = __alloc_workqueue_key("%s", 131082U, 1, & __key___1, __lock_name, (char *)"nesewq"); cm_core->event_wq = tmp___0; cm_core->post_event = & nes_cm_post_event; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Enable QUEUE DISCONNECTS\n", "nes_cm_alloc_core", 2859); } else { } __lock_name___0 = "\"%s\"\"nesdwq\""; tmp___1 = __alloc_workqueue_key("%s", 131082U, 1, & __key___2, __lock_name___0, (char *)"nesdwq"); cm_core->disconn_wq = tmp___1; print_core(cm_core); return (cm_core); } } static int mini_cm_dealloc_core(struct nes_cm_core *cm_core ) { int tmp ; { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: De-Alloc CM Core (%p)\n", "mini_cm_dealloc_core", 2872, cm_core); } else { } if ((unsigned long )cm_core == (unsigned long )((struct nes_cm_core *)0)) { return (-22); } else { } __asm__ volatile ("": : : "memory"); tmp = timer_pending((struct timer_list const *)(& cm_core->tcp_timer)); if (tmp != 0) { ldv_del_timer_315(& cm_core->tcp_timer); } else { } ldv_destroy_workqueue_316(cm_core->event_wq); ldv_destroy_workqueue_317(cm_core->disconn_wq); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: \n", "mini_cm_dealloc_core", 2884); } else { } kfree((void const *)cm_core); return (0); } } static int mini_cm_get(struct nes_cm_core *cm_core ) { { return ((int )cm_core->state); } } static int mini_cm_set(struct nes_cm_core *cm_core , u32 type , u32 value ) { int ret ; { ret = 0; switch (type) { case 2U: cm_core->mtu = value; goto ldv_62291; case 4U: cm_core->free_tx_pkt_max = value; goto ldv_62291; default: ret = -22; } ldv_62291: ; return (ret); } } static int nes_cm_init_tsa_conn(struct nes_qp *nesqp , struct nes_cm_node *cm_node ) { int ret ; { ret = 0; if ((unsigned long )nesqp == (unsigned long )((struct nes_qp *)0)) { return (-22); } else { } (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 2147516440U; if ((unsigned int )cm_node->tcp_cntxt.snd_wscale != 0U || (unsigned int )cm_node->tcp_cntxt.rcv_wscale != 0U) { (nesqp->nesqp_context)->misc = (nesqp->nesqp_context)->misc | 524288U; } else { } (nesqp->nesqp_context)->misc2 = (nesqp->nesqp_context)->misc2 | 64U; (nesqp->nesqp_context)->misc2 = (nesqp->nesqp_context)->misc2 | (__le32 )((int )cm_node->tos << 24); (nesqp->nesqp_context)->mss = (nesqp->nesqp_context)->mss | (cm_node->tcp_cntxt.mss << 16); (nesqp->nesqp_context)->tcp_state_flow_label = (nesqp->nesqp_context)->tcp_state_flow_label | 1342177280U; (nesqp->nesqp_context)->pd_index_wscale = (nesqp->nesqp_context)->pd_index_wscale | ((__le32 )((int )cm_node->tcp_cntxt.snd_wscale << 8) & 3840U); (nesqp->nesqp_context)->pd_index_wscale = (nesqp->nesqp_context)->pd_index_wscale | ((__le32 )cm_node->tcp_cntxt.rcv_wscale & 15U); (nesqp->nesqp_context)->keepalive = 128U; (nesqp->nesqp_context)->ts_recent = 0U; (nesqp->nesqp_context)->ts_age = 0U; (nesqp->nesqp_context)->snd_nxt = cm_node->tcp_cntxt.loc_seq_num; (nesqp->nesqp_context)->snd_wnd = cm_node->tcp_cntxt.snd_wnd; (nesqp->nesqp_context)->rcv_nxt = cm_node->tcp_cntxt.rcv_nxt; (nesqp->nesqp_context)->rcv_wnd = cm_node->tcp_cntxt.rcv_wnd << (int )cm_node->tcp_cntxt.rcv_wscale; (nesqp->nesqp_context)->snd_max = cm_node->tcp_cntxt.loc_seq_num; (nesqp->nesqp_context)->snd_una = cm_node->tcp_cntxt.loc_seq_num; (nesqp->nesqp_context)->srtt = 0U; (nesqp->nesqp_context)->rttvar = 6U; (nesqp->nesqp_context)->ssthresh = 1073725440U; (nesqp->nesqp_context)->cwnd = cm_node->tcp_cntxt.mss * 2U; (nesqp->nesqp_context)->snd_wl1 = cm_node->tcp_cntxt.rcv_nxt; (nesqp->nesqp_context)->snd_wl2 = cm_node->tcp_cntxt.loc_seq_num; (nesqp->nesqp_context)->max_snd_wnd = cm_node->tcp_cntxt.max_snd_wnd; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: QP%u: rcv_nxt = 0x%08X, snd_nxt = 0x%08X, Setting MSS to %u, PDWscale = 0x%08X, rcv_wnd = %u, context misc = 0x%08X.\n", "nes_cm_init_tsa_conn", 2983, nesqp->hwqp.qp_id, (nesqp->nesqp_context)->rcv_nxt, (nesqp->nesqp_context)->snd_nxt, cm_node->tcp_cntxt.mss, (nesqp->nesqp_context)->pd_index_wscale, (nesqp->nesqp_context)->rcv_wnd, (nesqp->nesqp_context)->misc); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: snd_wnd = 0x%08X.\n", "nes_cm_init_tsa_conn", 2984, (nesqp->nesqp_context)->snd_wnd); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: snd_cwnd = 0x%08X.\n", "nes_cm_init_tsa_conn", 2985, (nesqp->nesqp_context)->cwnd); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: max_swnd = 0x%08X.\n", "nes_cm_init_tsa_conn", 2986, (nesqp->nesqp_context)->max_snd_wnd); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Change cm_node state to TSA\n", "nes_cm_init_tsa_conn", 2988); } else { } cm_node->state = 11; return (ret); } } int nes_cm_disconn(struct nes_qp *nesqp ) { struct disconn_work *work ; void *tmp ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { tmp = kzalloc(88UL, 32U); work = (struct disconn_work *)tmp; if ((unsigned long )work == (unsigned long )((struct disconn_work *)0)) { return (-12); } else { } nes_add_ref(& nesqp->ibqp); work->nesqp = nesqp; __init_work(& work->work, 0); __constr_expr_0.counter = 137438953408L; work->work.data = __constr_expr_0; lockdep_init_map(& work->work.lockdep_map, "(&work->work)", & __key, 0); INIT_LIST_HEAD(& work->work.entry); work->work.func = & nes_disconnect_worker; queue_work(g_cm_core->disconn_wq, & work->work); return (0); } } static void nes_disconnect_worker(struct work_struct *work ) { struct disconn_work *dwork ; struct work_struct const *__mptr ; struct nes_qp *nesqp ; { __mptr = (struct work_struct const *)work; dwork = (struct disconn_work *)__mptr; nesqp = dwork->nesqp; kfree((void const *)dwork); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: processing AEQE id 0x%04X for QP%u.\n", "nes_disconnect_worker", 3024, nesqp->last_aeq, nesqp->hwqp.qp_id); } else { } nes_cm_disconn_true(nesqp); nes_rem_ref(& nesqp->ibqp); return; } } static int nes_cm_disconn_true(struct nes_qp *nesqp ) { unsigned long flags ; int ret ; struct iw_cm_id *cm_id ; struct iw_cm_event cm_event ; struct nes_vnic *nesvnic ; u16 last_ae ; u8 original_hw_tcp_state ; u8 original_ibqp_state ; int disconn_status ; int issue_disconn ; int issue_close ; int issue_flush ; u32 flush_q ; struct ib_event ibevent ; int tmp ; { ret = 0; disconn_status = 0; issue_disconn = 0; issue_close = 0; issue_flush = 0; flush_q = 2147483648U; if ((unsigned long )nesqp == (unsigned long )((struct nes_qp *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: disconnect_worker nesqp is NULL\n", "nes_cm_disconn_true", 3051); } else { } return (-1); } else { } ldv_spin_lock(); cm_id = nesqp->cm_id; if ((unsigned long )cm_id == (unsigned long )((struct iw_cm_id *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: QP%u disconnect_worker cmid is NULL\n", "nes_cm_disconn_true", 3060, nesqp->hwqp.qp_id); } else { } spin_unlock_irqrestore(& nesqp->lock, flags); return (-1); } else { } nesvnic = to_nesvnic(nesqp->ibqp.device); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Disconnecting QP%u\n", "nes_cm_disconn_true", 3066, nesqp->hwqp.qp_id); } else { } original_hw_tcp_state = nesqp->hw_tcp_state; original_ibqp_state = (u8 )nesqp->ibqp_state; last_ae = (u16 )nesqp->last_aeq; if ((unsigned int )nesqp->term_flags != 0U) { issue_disconn = 1; issue_close = 1; nesqp->cm_id = (struct iw_cm_id *)0; ldv_del_timer_318(& nesqp->terminate_timer); if ((unsigned int )*((unsigned char *)nesqp + 820UL) == 0U) { nesqp->flush_issued = 1U; issue_flush = 1; } else { } } else if ((unsigned int )original_hw_tcp_state == 6U || ((unsigned int )original_ibqp_state == 3U && (unsigned int )last_ae == 1282U)) { issue_disconn = 1; if ((unsigned int )last_ae == 1282U) { disconn_status = -104; } else { } } else { } if ((((unsigned int )original_hw_tcp_state == 1U || (unsigned int )original_hw_tcp_state == 11U) || (unsigned int )last_ae == 514U) || (unsigned int )last_ae == 1282U) { issue_close = 1; nesqp->cm_id = (struct iw_cm_id *)0; if ((unsigned int )*((unsigned char *)nesqp + 820UL) == 0U) { nesqp->flush_issued = 1U; issue_flush = 1; } else { } } else { } spin_unlock_irqrestore(& nesqp->lock, flags); if (issue_flush != 0 && (unsigned int )*((unsigned char *)nesqp + 820UL) == 0U) { if ((unsigned int )nesqp->hw_iwarp_state > 4U) { flush_q = flush_q | 1073741824U; } else { } flush_wqes(nesvnic->nesdev, nesqp, flush_q, 1U); if ((unsigned int )nesqp->term_flags != 0U) { ibevent.device = nesqp->ibqp.device; ibevent.event = nesqp->terminate_eventtype; ibevent.element.qp = & nesqp->ibqp; if ((unsigned long )nesqp->ibqp.event_handler != (unsigned long )((void (*)(struct ib_event * , void * ))0)) { (*(nesqp->ibqp.event_handler))(& ibevent, nesqp->ibqp.qp_context); } else { } } else { } } else { } if ((unsigned long )cm_id != (unsigned long )((struct iw_cm_id *)0) && (unsigned long )cm_id->event_handler != (unsigned long )((int (*)(struct iw_cm_id * , struct iw_cm_event * ))0)) { if (issue_disconn != 0) { atomic_inc(& cm_disconnects); cm_event.event = 4; cm_event.status = disconn_status; cm_event.local_addr = cm_id->local_addr; cm_event.remote_addr = cm_id->remote_addr; cm_event.private_data = (void *)0; cm_event.private_data_len = 0U; if ((nes_debug_level & 32U) != 0U) { tmp = atomic_read((atomic_t const *)(& nesqp->refcount)); printk("\viw_nes: %s[%u]: Generating a CM Disconnect Event for QP%u, SQ Head = %u, SQ Tail = %u. cm_id = %p, refcount = %u.\n", "nes_cm_disconn_true", 3133, nesqp->hwqp.qp_id, (int )nesqp->hwqp.sq_head, (int )nesqp->hwqp.sq_tail, cm_id, tmp); } else { } ret = (*(cm_id->event_handler))(cm_id, & cm_event); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: OFA CM event_handler returned, ret=%d\n", "nes_cm_disconn_true", 3138, ret); } else { } } else { } } else { } if (issue_close != 0) { atomic_inc(& cm_closes); nes_disconnect(nesqp, 1); cm_id->provider_data = (void *)nesqp; cm_event.event = 5; cm_event.status = 0; cm_event.provider_data = cm_id->provider_data; cm_event.local_addr = cm_id->local_addr; cm_event.remote_addr = cm_id->remote_addr; cm_event.private_data = (void *)0; cm_event.private_data_len = 0U; ret = (*(cm_id->event_handler))(cm_id, & cm_event); if (ret != 0) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: OFA CM event_handler returned, ret=%d\n", "nes_cm_disconn_true", 3157, ret); } else { } } else { } (*(cm_id->rem_ref))(cm_id); } else { } } else { } return (0); } } static int nes_disconnect(struct nes_qp *nesqp , int abrupt ) { int ret ; struct nes_vnic *nesvnic ; struct nes_device *nesdev ; struct nes_ib_device *nesibdev ; int tmp ; { ret = 0; nesvnic = to_nesvnic(nesqp->ibqp.device); if ((unsigned long )nesvnic == (unsigned long )((struct nes_vnic *)0)) { return (-22); } else { } nesdev = nesvnic->nesdev; nesibdev = nesvnic->nesibdev; if ((nes_debug_level & 32U) != 0U) { tmp = netdev_refcnt_read((struct net_device const *)nesvnic->netdev); printk("\viw_nes: %s[%u]: netdev refcnt = %u.\n", "nes_disconnect", 3185, tmp); } else { } if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { nesqp->active_conn = 0U; } else if ((unsigned long )nesqp->ietf_frame != (unsigned long )((void *)0)) { if ((unsigned long )nesqp->lsmm_mr != (unsigned long )((struct ib_mr *)0)) { (*(nesibdev->ibdev.dereg_mr))(nesqp->lsmm_mr); } else { } pci_free_consistent(nesdev->pcidev, (size_t )((int )nesqp->private_data_len + (int )nesqp->ietf_frame_size), nesqp->ietf_frame, nesqp->ietf_frame_pbase); } else { } if ((unsigned long )nesqp->cm_node != (unsigned long )((void *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Call close API\n", "nes_disconnect", 3204); } else { } (*((g_cm_core->api)->close))(g_cm_core, (struct nes_cm_node *)nesqp->cm_node); } else { } return (ret); } } int nes_accept(struct iw_cm_id *cm_id , struct iw_cm_conn_param *conn_param ) { u64 u64temp ; struct ib_qp *ibqp ; struct nes_qp *nesqp ; struct nes_vnic *nesvnic ; struct nes_device *nesdev ; struct nes_cm_node *cm_node ; struct nes_adapter *adapter ; struct ib_qp_attr attr ; struct iw_cm_event cm_event ; struct nes_hw_qp_wqe *wqe ; struct nes_v4_quad nes_quad ; u32 crc_value ; int ret ; int passive_state ; struct nes_ib_device *nesibdev ; struct ib_mr *ibmr ; struct ib_phys_buf ibphysbuf ; struct nes_pd *nespd ; u64 tagged_offset ; u8 mpa_frame_offset ; struct ietf_mpa_v2 *mpa_v2_frame ; u8 start_addr ; u8 *start_ptr ; u8 **start_buff ; u16 buff_len ; struct sockaddr_in *laddr ; struct sockaddr_in *raddr ; int tmp ; int tmp___0 ; u32 tmp___1 ; __u32 tmp___2 ; __u16 tmp___3 ; __u16 tmp___4 ; __u32 tmp___5 ; __u16 tmp___6 ; __u32 tmp___7 ; __u16 tmp___8 ; __u32 tmp___9 ; { ibmr = (struct ib_mr *)0; mpa_frame_offset = 0U; start_addr = 0U; start_ptr = & start_addr; start_buff = & start_ptr; buff_len = 0U; laddr = (struct sockaddr_in *)(& cm_id->local_addr); raddr = (struct sockaddr_in *)(& cm_id->remote_addr); ibqp = nes_get_qp(cm_id->device, (int )conn_param->qpn); if ((unsigned long )ibqp == (unsigned long )((struct ib_qp *)0)) { return (-22); } else { } nesqp = to_nesqp(ibqp); nesvnic = to_nesvnic(nesqp->ibqp.device); nesdev = nesvnic->nesdev; adapter = nesdev->nesadapter; cm_node = (struct nes_cm_node *)cm_id->provider_data; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: nes_accept: cm_node= %p nesvnic=%p, netdev=%p,%s\n", "nes_accept", 3259, cm_node, nesvnic, nesvnic->netdev, (char *)(& (nesvnic->netdev)->name)); } else { } if ((unsigned int )cm_node->state == 18U) { if ((unsigned long )cm_node->loopbackpartner != (unsigned long )((struct nes_cm_node *)0)) { rem_ref_cm_node(cm_node->cm_core, cm_node->loopbackpartner); } else { } rem_ref_cm_node(cm_node->cm_core, cm_node); return (-22); } else { } passive_state = atomic_add_return(1, & cm_node->passive_state); if (passive_state == 2) { rem_ref_cm_node(cm_node->cm_core, cm_node); return (-104); } else { } nesqp->cm_node = (void *)cm_node; cm_node->nesqp = nesqp; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: QP%u, cm_node=%p, jiffies = %lu listener = %p\n", "nes_accept", 3279, nesqp->hwqp.qp_id, cm_node, jiffies, cm_node->listener); } else { } atomic_inc(& cm_accepts); if ((nes_debug_level & 32U) != 0U) { tmp = netdev_refcnt_read((struct net_device const *)nesvnic->netdev); printk("\viw_nes: %s[%u]: netdev refcnt = %u.\n", "nes_accept", 3283, tmp); } else { } nesqp->ietf_frame_size = 24U; nesqp->ietf_frame = pci_alloc_consistent(nesdev->pcidev, (size_t )((int )nesqp->ietf_frame_size + (int )conn_param->private_data_len), & nesqp->ietf_frame_pbase); if ((unsigned long )nesqp->ietf_frame == (unsigned long )((void *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate memory for private data\n", "nes_accept", 3292); } else { } return (-12); } else { } mpa_v2_frame = (struct ietf_mpa_v2 *)nesqp->ietf_frame; if ((unsigned int )cm_node->mpa_frame_rev == 1U) { mpa_frame_offset = 4U; } else { } if ((unsigned int )cm_node->mpa_frame_rev == 1U || (unsigned int )cm_node->mpav2_ird_ord == 16383U) { record_ird_ord(cm_node, (int )((unsigned short )conn_param->ird), (int )((unsigned short )conn_param->ord)); } else { } memcpy((void *)(& mpa_v2_frame->priv_data), conn_param->private_data, (size_t )conn_param->private_data_len); cm_build_mpa_frame(cm_node, start_buff, & buff_len, (u8 *)nesqp->ietf_frame, 1); nesqp->private_data_len = conn_param->private_data_len; wqe = nesqp->hwqp.sq_vbase; if (raddr->sin_addr.s_addr != laddr->sin_addr.s_addr) { u64temp = (u64 )nesqp; nesibdev = nesvnic->nesibdev; nespd = nesqp->nespd; ibphysbuf.addr = nesqp->ietf_frame_pbase + (dma_addr_t )mpa_frame_offset; ibphysbuf.size = (u64 )buff_len; tagged_offset = (unsigned long long )*start_buff; ibmr = (*(nesibdev->ibdev.reg_phys_mr))((struct ib_pd *)nespd, & ibphysbuf, 1, 1, & tagged_offset); if ((unsigned long )ibmr == (unsigned long )((struct ib_mr *)0)) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Unable to register memory regionfor lSMM for cm_node = %p \n", "nes_accept", 3328, cm_node); } else { } pci_free_consistent(nesdev->pcidev, (size_t )((int )nesqp->private_data_len + (int )nesqp->ietf_frame_size), nesqp->ietf_frame, nesqp->ietf_frame_pbase); return (-12); } else { } ibmr->pd = & nespd->ibpd; ibmr->device = nespd->ibpd.device; nesqp->lsmm_mr = ibmr; u64temp = u64temp | 512ULL; set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 2U, u64temp); wqe->wqe_words[0] = 8421376U; wqe->wqe_words[1] = (unsigned int )buff_len; set_wqe_64bit_value((__le32 *)(& wqe->wqe_words), 16U, (unsigned long long )*start_buff); wqe->wqe_words[18] = (unsigned int )buff_len; wqe->wqe_words[19] = ibmr->lkey; if ((unsigned int )nesqp->sq_kmapped != 0U) { nesqp->sq_kmapped = 0U; kunmap(nesqp->page); } else { } (nesqp->nesqp_context)->ird_ord_sizes = (nesqp->nesqp_context)->ird_ord_sizes | 100663296U; } else { (nesqp->nesqp_context)->ird_ord_sizes = (nesqp->nesqp_context)->ird_ord_sizes | 33554432U; } nesqp->skip_lsmm = 1U; nesqp->cm_id = cm_id; cm_node->cm_id = cm_id; cm_id->provider_data = (void *)nesqp; nesqp->active_conn = 0U; if ((unsigned int )cm_node->state == 11U) { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Already state = TSA for cm_node=%p\n", "nes_accept", 3378, cm_node); } else { } } else { } nes_cm_init_tsa_conn(nesqp, cm_node); (nesqp->nesqp_context)->tcpPorts[0] = cm_node->mapped_loc_port; (nesqp->nesqp_context)->tcpPorts[1] = cm_node->mapped_rem_port; (nesqp->nesqp_context)->ip0 = cm_node->mapped_rem_addr; (nesqp->nesqp_context)->misc2 = (nesqp->nesqp_context)->misc2 | (((nesdev->pcidev)->devfn & 7U) << 16); tmp___0 = nes_arp_table(nesdev, (nesqp->nesqp_context)->ip0, (u8 *)0U, 3U); (nesqp->nesqp_context)->arp_index_vlan = (nesqp->nesqp_context)->arp_index_vlan | (__le32 )(tmp___0 << 16); tmp___1 = nes_read_indexed___3(nesdev, 496U); (nesqp->nesqp_context)->ts_val_delta = (unsigned int )jiffies - tmp___1; (nesqp->nesqp_context)->ird_index = nesqp->hwqp.qp_id; (nesqp->nesqp_context)->ird_ord_sizes = (nesqp->nesqp_context)->ird_ord_sizes | 268435456U; (nesqp->nesqp_context)->ird_ord_sizes = (nesqp->nesqp_context)->ird_ord_sizes | (__le32 )cm_node->ord_size; memset((void *)(& nes_quad), 0, 16UL); nes_quad.DstIpAdrIndex = ((nesdev->pcidev)->devfn & 7U) << 24; tmp___2 = __fswab32(cm_node->mapped_rem_addr); nes_quad.SrcIpadr = tmp___2; tmp___3 = __fswab16((int )cm_node->mapped_rem_port); nes_quad.TcpPorts[0] = tmp___3; tmp___4 = __fswab16((int )cm_node->mapped_loc_port); nes_quad.TcpPorts[1] = tmp___4; crc_value = get_crc_value(& nes_quad); tmp___5 = __fswab32(~ crc_value); nesqp->hte_index = tmp___5; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: HTE Index = 0x%08X, CRC = 0x%08X\n", "nes_accept", 3419, nesqp->hte_index, nesqp->hte_index & adapter->hte_index_mask); } else { } nesqp->hte_index = nesqp->hte_index & adapter->hte_index_mask; (nesqp->nesqp_context)->hte_index = nesqp->hte_index; (*(((cm_node->cm_core)->api)->accelerated))(cm_node->cm_core, cm_node); if ((nes_debug_level & 32U) != 0U) { tmp___6 = __fswab16((int )laddr->sin_port); tmp___7 = __fswab32(laddr->sin_addr.s_addr); tmp___8 = __fswab16((int )raddr->sin_port); tmp___9 = __fswab32(raddr->sin_addr.s_addr); printk("\viw_nes: %s[%u]: QP%u, Destination IP = 0x%08X:0x%04X, local = 0x%08X:0x%04X, rcv_nxt=0x%08X, snd_nxt=0x%08X, mpa + private data length=%u.\n", "nes_accept", 3433, nesqp->hwqp.qp_id, tmp___9, (int )tmp___8, tmp___7, (int )tmp___6, (nesqp->nesqp_context)->rcv_nxt, (nesqp->nesqp_context)->snd_nxt, (int )buff_len); } else { } (*(cm_id->add_ref))(cm_id); nes_add_ref(& nesqp->ibqp); cm_event.event = 3; cm_event.status = 0; cm_event.provider_data = (void *)nesqp; cm_event.local_addr = cm_id->local_addr; cm_event.remote_addr = cm_id->remote_addr; cm_event.private_data = (void *)0; cm_event.private_data_len = 0U; cm_event.ird = (u8 )cm_node->ird_size; cm_event.ord = (u8 )cm_node->ord_size; ret = (*(cm_id->event_handler))(cm_id, & cm_event); attr.qp_state = 3; nes_modify_qp(& nesqp->ibqp, & attr, 1, (struct ib_udata *)0); if ((unsigned long )cm_node->loopbackpartner != (unsigned long )((struct nes_cm_node *)0)) { (cm_node->loopbackpartner)->mpa_frame_size = nesqp->private_data_len; memcpy((void *)(& (cm_node->loopbackpartner)->__annonCompField121.mpa_frame_buf), conn_param->private_data, (size_t )conn_param->private_data_len); create_event(cm_node->loopbackpartner, 7); } else { } if (ret != 0) { printk("\v%s[%u] OFA CM event_handler returned, ret=%d\n", "nes_accept", 3462, ret); } else { } return (0); } } int nes_reject(struct iw_cm_id *cm_id , void const *pdata , u8 pdata_len ) { struct nes_cm_node *cm_node ; struct nes_cm_node *loopback ; struct nes_cm_core *cm_core ; u8 *start_buff ; int tmp ; { atomic_inc(& cm_rejects); cm_node = (struct nes_cm_node *)cm_id->provider_data; loopback = cm_node->loopbackpartner; cm_core = cm_node->cm_core; cm_node->cm_id = cm_id; if ((unsigned long )pdata_len + 24UL > 536UL) { return (-22); } else { } if ((unsigned long )loopback != (unsigned long )((struct nes_cm_node *)0)) { memcpy((void *)(& loopback->__annonCompField121.mpa_frame.priv_data), pdata, (size_t )pdata_len); loopback->__annonCompField121.mpa_frame.priv_data_len = (__be16 )pdata_len; loopback->mpa_frame_size = (u16 )pdata_len; } else { start_buff = (u8 *)(& cm_node->__annonCompField121.mpa_frame_buf) + 24UL; cm_node->mpa_frame_size = (u16 )pdata_len; memcpy((void *)start_buff, pdata, (size_t )pdata_len); } tmp = (*((cm_core->api)->reject))(cm_core, cm_node); return (tmp); } } int nes_connect(struct iw_cm_id *cm_id , struct iw_cm_conn_param *conn_param ) { struct ib_qp *ibqp ; struct nes_qp *nesqp ; struct nes_vnic *nesvnic ; struct nes_device *nesdev ; struct nes_cm_node *cm_node ; struct nes_cm_info cm_info ; int apbvt_set ; struct sockaddr_in *laddr ; struct sockaddr_in *raddr ; struct iwpm_dev_data pm_reg_msg ; struct iwpm_sa_data pm_msg ; int iwpm_err ; __u16 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u16 tmp___5 ; __u32 tmp___6 ; __u16 tmp___7 ; int tmp___8 ; int tmp___9 ; { apbvt_set = 0; laddr = (struct sockaddr_in *)(& cm_id->local_addr); raddr = (struct sockaddr_in *)(& cm_id->remote_addr); iwpm_err = 0; if ((unsigned int )cm_id->remote_addr.ss_family != 2U) { return (-38); } else { } ibqp = nes_get_qp(cm_id->device, (int )conn_param->qpn); if ((unsigned long )ibqp == (unsigned long )((struct ib_qp *)0)) { return (-22); } else { } nesqp = to_nesqp(ibqp); if ((unsigned long )nesqp == (unsigned long )((struct nes_qp *)0)) { return (-22); } else { } nesvnic = to_nesvnic(nesqp->ibqp.device); if ((unsigned long )nesvnic == (unsigned long )((struct nes_vnic *)0)) { return (-22); } else { } nesdev = nesvnic->nesdev; if ((unsigned long )nesdev == (unsigned long )((struct nes_device *)0)) { return (-22); } else { } if ((unsigned int )laddr->sin_port == 0U || (unsigned int )raddr->sin_port == 0U) { return (-22); } else { } if ((nes_debug_level & 32U) != 0U) { tmp = __fswab16((int )laddr->sin_port); tmp___0 = __fswab32(laddr->sin_addr.s_addr); tmp___1 = __fswab16((int )raddr->sin_port); tmp___2 = __fswab32(raddr->sin_addr.s_addr); tmp___3 = __fswab32(nesvnic->local_ipaddr); printk("\viw_nes: %s[%u]: QP%u, current IP = 0x%08X, Destination IP = 0x%08X:0x%04X, local = 0x%08X:0x%04X.\n", "nes_connect", 3541, nesqp->hwqp.qp_id, tmp___3, tmp___2, (int )tmp___1, tmp___0, (int )tmp); } else { } atomic_inc(& cm_connects); nesqp->active_conn = 1U; nesqp->cm_id = cm_id; cm_id->provider_data = (void *)nesqp; nesqp->private_data_len = conn_param->private_data_len; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: requested ord = 0x%08X.\n", "nes_connect", 3551, conn_param->ord); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: mpa private data len =%u\n", "nes_connect", 3553, (int )conn_param->private_data_len); } else { } tmp___4 = __fswab32(laddr->sin_addr.s_addr); cm_info.loc_addr = tmp___4; tmp___5 = __fswab16((int )laddr->sin_port); cm_info.loc_port = tmp___5; tmp___6 = __fswab32(raddr->sin_addr.s_addr); cm_info.rem_addr = tmp___6; tmp___7 = __fswab16((int )raddr->sin_port); cm_info.rem_port = tmp___7; cm_info.__annonCompField122.cm_id = cm_id; cm_info.conn_type = 0; cm_info.mapped_loc_addr = cm_info.loc_addr; cm_info.mapped_loc_port = cm_info.loc_port; cm_info.mapped_rem_addr = cm_info.rem_addr; cm_info.mapped_rem_port = cm_info.rem_port; nes_form_reg_msg(nesvnic, & pm_reg_msg); iwpm_err = iwpm_register_pid(& pm_reg_msg, 2); if (iwpm_err != 0) { if ((nes_debug_level & 2097152U) != 0U) { printk("\viw_nes: %s[%u]: Port Mapper reg pid fail (err = %d).\n", "nes_connect", 3573, iwpm_err); } else { } } else { } tmp___8 = iwpm_valid_pid(); if (tmp___8 != 0 && iwpm_err == 0) { nes_form_pm_msg(& cm_info, & pm_msg); iwpm_err = iwpm_add_and_query_mapping(& pm_msg, 2); if (iwpm_err != 0) { if ((nes_debug_level & 2097152U) != 0U) { printk("\viw_nes: %s[%u]: Port Mapper query fail (err = %d).\n", "nes_connect", 3580, iwpm_err); } else { } } else { nes_record_pm_msg(& cm_info, & pm_msg); } } else { } if (laddr->sin_addr.s_addr != raddr->sin_addr.s_addr) { nes_manage_apbvt(nesvnic, (u32 )cm_info.mapped_loc_port, (nesdev->pcidev)->devfn & 7U, 1U); apbvt_set = 1; } else { } tmp___9 = nes_create_mapinfo(& cm_info); if (tmp___9 != 0) { return (-12); } else { } (*(cm_id->add_ref))(cm_id); cm_node = (*((g_cm_core->api)->connect))(g_cm_core, nesvnic, (int )conn_param->private_data_len, (void *)conn_param->private_data, & cm_info); if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { if (apbvt_set != 0) { nes_manage_apbvt(nesvnic, (u32 )cm_info.mapped_loc_port, (nesdev->pcidev)->devfn & 7U, 0U); } else { } if ((nes_debug_level & 2097152U) != 0U) { printk("\viw_nes: %s[%u]: Delete mapped_loc_port = %04X\n", "nes_connect", 3607, (int )cm_info.mapped_loc_port); } else { } nes_remove_mapinfo(cm_info.loc_addr, (int )cm_info.loc_port, cm_info.mapped_loc_addr, (int )cm_info.mapped_loc_port); (*(cm_id->rem_ref))(cm_id); return (-12); } else { } record_ird_ord(cm_node, (int )((unsigned short )conn_param->ird), (int )((unsigned short )conn_param->ord)); if ((unsigned int )cm_node->send_rdma0_op == 1U && (unsigned int )cm_node->ord_size == 0U) { cm_node->ord_size = 1U; } else { } cm_node->apbvt_set = apbvt_set; cm_node->tos = cm_id->tos; nesqp->cm_node = (void *)cm_node; cm_node->nesqp = nesqp; nes_add_ref(& nesqp->ibqp); return (0); } } int nes_create_listen(struct iw_cm_id *cm_id , int backlog ) { struct nes_vnic *nesvnic ; struct nes_cm_listener *cm_node ; struct nes_cm_info cm_info ; int err ; struct sockaddr_in *laddr ; __u16 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; int tmp___2 ; { laddr = (struct sockaddr_in *)(& cm_id->local_addr); if ((nes_debug_level & 32U) != 0U) { tmp = __fswab16((int )laddr->sin_port); printk("\viw_nes: %s[%u]: cm_id = %p, local port = 0x%04X.\n", "nes_create_listen", 3641, cm_id, (int )tmp); } else { } if ((unsigned int )cm_id->local_addr.ss_family != 2U) { return (-38); } else { } nesvnic = to_nesvnic(cm_id->device); if ((unsigned long )nesvnic == (unsigned long )((struct nes_vnic *)0)) { return (-22); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: nesvnic=%p, netdev=%p, %s\n", "nes_create_listen", 3650, nesvnic, nesvnic->netdev, (char *)(& (nesvnic->netdev)->name)); } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: nesvnic->local_ipaddr=0x%08x, sin_addr.s_addr=0x%08x\n", "nes_create_listen", 3653, nesvnic->local_ipaddr, laddr->sin_addr.s_addr); } else { } tmp___0 = __fswab32(nesvnic->local_ipaddr); cm_info.loc_addr = tmp___0; tmp___1 = __fswab16((int )laddr->sin_port); cm_info.loc_port = tmp___1; cm_info.backlog = backlog; cm_info.__annonCompField122.cm_id = cm_id; cm_info.conn_type = 0; cm_info.mapped_loc_addr = cm_info.loc_addr; cm_info.mapped_loc_port = cm_info.loc_port; cm_node = (*((g_cm_core->api)->listen))(g_cm_core, nesvnic, & cm_info); if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_listener *)0)) { printk("\v%s[%u] Error returned from listen API call\n", "nes_create_listen", 3670); return (-12); } else { } cm_id->provider_data = (void *)cm_node; cm_node->tos = cm_id->tos; if (cm_node->reused_node == 0U) { tmp___2 = nes_create_mapinfo(& cm_info); if (tmp___2 != 0) { return (-12); } else { } err = nes_manage_apbvt(nesvnic, (u32 )cm_node->mapped_loc_port, ((nesvnic->nesdev)->pcidev)->devfn & 7U, 1U); if (err != 0) { printk("\vnes_manage_apbvt call returned %d.\n", err); (*((g_cm_core->api)->stop_listener))(g_cm_core, cm_node); return (err); } else { } atomic_inc(& cm_listens_created); } else { } (*(cm_id->add_ref))(cm_id); cm_id->provider_data = (void *)cm_node; return (0); } } int nes_destroy_listen(struct iw_cm_id *cm_id ) { { if ((unsigned long )cm_id->provider_data != (unsigned long )((void *)0)) { (*((g_cm_core->api)->stop_listener))(g_cm_core, (struct nes_cm_listener *)cm_id->provider_data); } else if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_id->provider_data was NULL\n", "nes_destroy_listen", 3709); } else { } (*(cm_id->rem_ref))(cm_id); return (0); } } int nes_cm_recv(struct sk_buff *skb , struct net_device *netdevice ) { int rc ; void *tmp ; { rc = 0; cm_packets_received = cm_packets_received + 1U; if ((unsigned long )g_cm_core != (unsigned long )((struct nes_cm_core *)0) && (unsigned long )g_cm_core->api != (unsigned long )((struct nes_cm_ops *)0)) { tmp = netdev_priv((struct net_device const *)netdevice); rc = (*((g_cm_core->api)->recv_pkt))(g_cm_core, (struct nes_vnic *)tmp, skb); } else if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Unable to process packet for CM, cm is not setup properly.\n", "nes_cm_recv", 3729); } else { } return (rc); } } int nes_cm_start(void) { { if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: \n", "nes_cm_start", 3741); } else { } g_cm_core = nes_cm_alloc_core(); if ((unsigned long )g_cm_core != (unsigned long )((struct nes_cm_core *)0)) { return (0); } else { return (-12); } } } int nes_cm_stop(void) { { (*((g_cm_core->api)->destroy_cm_core))(g_cm_core); return (0); } } static void cm_event_connected(struct nes_cm_event *event ) { struct nes_qp *nesqp ; struct nes_vnic *nesvnic ; struct nes_device *nesdev ; struct nes_cm_node *cm_node ; struct nes_adapter *nesadapter ; struct ib_qp_attr attr ; struct iw_cm_id *cm_id ; struct iw_cm_event cm_event ; struct nes_v4_quad nes_quad ; u32 crc_value ; int ret ; struct sockaddr_in *laddr ; struct sockaddr_in *raddr ; struct sockaddr_in *cm_event_laddr ; __u16 tmp ; __u16 tmp___0 ; __u32 tmp___1 ; int tmp___2 ; u32 tmp___3 ; __u32 tmp___4 ; __u16 tmp___5 ; __u16 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; { cm_node = event->cm_node; cm_id = cm_node->cm_id; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_event_connected - %p - cm_id = %p\n", "cm_event_connected", 3786, cm_node, cm_id); } else { } nesqp = (struct nes_qp *)cm_id->provider_data; nesvnic = to_nesvnic(nesqp->ibqp.device); nesdev = nesvnic->nesdev; nesadapter = nesdev->nesadapter; laddr = (struct sockaddr_in *)(& cm_id->local_addr); raddr = (struct sockaddr_in *)(& cm_id->remote_addr); cm_event_laddr = (struct sockaddr_in *)(& cm_event.local_addr); if ((unsigned int )*((unsigned char *)nesqp + 820UL) != 0U) { return; } else { } atomic_inc(& cm_connecteds); if ((nes_debug_level & 32U) != 0U) { tmp = __fswab16((int )laddr->sin_port); tmp___0 = __fswab16((int )raddr->sin_port); tmp___1 = __fswab32(raddr->sin_addr.s_addr); printk("\viw_nes: %s[%u]: QP%u attempting to connect to 0x%08X:0x%04X on local port 0x%04X. jiffies = %lu.\n", "cm_event_connected", 3801, nesqp->hwqp.qp_id, tmp___1, (int )tmp___0, (int )tmp, jiffies); } else { } nes_cm_init_tsa_conn(nesqp, cm_node); (nesqp->nesqp_context)->tcpPorts[0] = cm_node->mapped_loc_port; (nesqp->nesqp_context)->tcpPorts[1] = cm_node->mapped_rem_port; (nesqp->nesqp_context)->ip0 = cm_node->mapped_rem_addr; (nesqp->nesqp_context)->misc2 = (nesqp->nesqp_context)->misc2 | (((nesdev->pcidev)->devfn & 7U) << 16); tmp___2 = nes_arp_table(nesdev, (nesqp->nesqp_context)->ip0, (u8 *)0U, 3U); (nesqp->nesqp_context)->arp_index_vlan = (nesqp->nesqp_context)->arp_index_vlan | (__le32 )(tmp___2 << 16); tmp___3 = nes_read_indexed___3(nesdev, 496U); (nesqp->nesqp_context)->ts_val_delta = (unsigned int )jiffies - tmp___3; (nesqp->nesqp_context)->ird_index = nesqp->hwqp.qp_id; (nesqp->nesqp_context)->ird_ord_sizes = (nesqp->nesqp_context)->ird_ord_sizes | 268435456U; (nesqp->nesqp_context)->ird_ord_sizes = (nesqp->nesqp_context)->ird_ord_sizes | (__le32 )cm_node->ord_size; build_rdma0_msg(cm_node, & nesqp); nes_write32(nesdev->regs + 64UL, nesqp->hwqp.qp_id | 25165824U); memset((void *)(& nes_quad), 0, 16UL); nes_quad.DstIpAdrIndex = ((nesdev->pcidev)->devfn & 7U) << 24; tmp___4 = __fswab32(cm_node->mapped_rem_addr); nes_quad.SrcIpadr = tmp___4; tmp___5 = __fswab16((int )cm_node->mapped_rem_port); nes_quad.TcpPorts[0] = tmp___5; tmp___6 = __fswab16((int )cm_node->mapped_loc_port); nes_quad.TcpPorts[1] = tmp___6; crc_value = get_crc_value(& nes_quad); tmp___7 = __fswab32(~ crc_value); nesqp->hte_index = tmp___7; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: HTE Index = 0x%08X, After CRC = 0x%08X\n", "cm_event_connected", 3848, nesqp->hte_index, nesqp->hte_index & nesadapter->hte_index_mask); } else { } nesqp->hte_index = nesqp->hte_index & nesadapter->hte_index_mask; (nesqp->nesqp_context)->hte_index = nesqp->hte_index; nesqp->ietf_frame = (void *)(& cm_node->__annonCompField121.mpa_frame); nesqp->private_data_len = (u16 )((unsigned char )cm_node->mpa_frame_size); (*(((cm_node->cm_core)->api)->accelerated))(cm_node->cm_core, cm_node); cm_event.event = 2; cm_event.status = 0; cm_event.provider_data = cm_id->provider_data; cm_event_laddr->sin_family = 2U; cm_event_laddr->sin_port = laddr->sin_port; cm_event.remote_addr = cm_id->remote_addr; cm_event.private_data = (void *)(& (event->cm_node)->__annonCompField121.mpa_frame_buf); cm_event.private_data_len = (unsigned char )(event->cm_node)->mpa_frame_size; cm_event.ird = (u8 )cm_node->ird_size; cm_event.ord = (u8 )cm_node->ord_size; tmp___8 = __fswab32(event->cm_info.rem_addr); cm_event_laddr->sin_addr.s_addr = tmp___8; ret = (*(cm_id->event_handler))(cm_id, & cm_event); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: OFA CM event_handler returned, ret=%d\n", "cm_event_connected", 3872, ret); } else { } if (ret != 0) { printk("\v%s[%u] OFA CM event_handler returned, ret=%d\n", "cm_event_connected", 3876, ret); } else { } attr.qp_state = 3; nes_modify_qp(& nesqp->ibqp, & attr, 1, (struct ib_udata *)0); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Exiting connect thread for QP%u. jiffies = %lu\n", "cm_event_connected", 3881, nesqp->hwqp.qp_id, jiffies); } else { } return; } } static void cm_event_connect_error(struct nes_cm_event *event ) { struct nes_qp *nesqp ; struct iw_cm_id *cm_id ; struct iw_cm_event cm_event ; int ret ; struct sockaddr_in *cm_event_laddr ; struct sockaddr_in *cm_event_raddr ; { if ((unsigned long )event->cm_node == (unsigned long )((struct nes_cm_node *)0)) { return; } else { } cm_id = (event->cm_node)->cm_id; if ((unsigned long )cm_id == (unsigned long )((struct iw_cm_id *)0)) { return; } else { } if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node=%p, cm_id=%p\n", "cm_event_connect_error", 3905, event->cm_node, cm_id); } else { } nesqp = (struct nes_qp *)cm_id->provider_data; if ((unsigned long )nesqp == (unsigned long )((struct nes_qp *)0)) { return; } else { } nesqp->cm_id = (struct iw_cm_id *)0; cm_id->provider_data = (void *)0; cm_event.event = 2; cm_event.status = -104; cm_event.provider_data = cm_id->provider_data; cm_event.local_addr = cm_id->local_addr; cm_event.remote_addr = cm_id->remote_addr; cm_event.private_data = (void *)0; cm_event.private_data_len = 0U; cm_event_laddr = (struct sockaddr_in *)(& cm_event.local_addr); cm_event_raddr = (struct sockaddr_in *)(& cm_event.remote_addr); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: call CM_EVENT REJECTED, local_addr=%08x, remote_addr=%08x\n", "cm_event_connect_error", 3930, cm_event_laddr->sin_addr.s_addr, cm_event_raddr->sin_addr.s_addr); } else { } ret = (*(cm_id->event_handler))(cm_id, & cm_event); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: OFA CM event_handler returned, ret=%d\n", "cm_event_connect_error", 3935, ret); } else { } if (ret != 0) { printk("\v%s[%u] OFA CM event_handler returned, ret=%d\n", "cm_event_connect_error", 3938, ret); } else { } (*(cm_id->rem_ref))(cm_id); rem_ref_cm_node((event->cm_node)->cm_core, event->cm_node); return; } } static void cm_event_reset(struct nes_cm_event *event ) { struct nes_qp *nesqp ; struct iw_cm_id *cm_id ; struct iw_cm_event cm_event ; int ret ; { if ((unsigned long )event->cm_node == (unsigned long )((struct nes_cm_node *)0)) { return; } else { } if ((unsigned long )(event->cm_node)->cm_id == (unsigned long )((struct iw_cm_id *)0)) { return; } else { } cm_id = (event->cm_node)->cm_id; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: %p - cm_id = %p\n", "cm_event_reset", 3965, event->cm_node, cm_id); } else { } nesqp = (struct nes_qp *)cm_id->provider_data; if ((unsigned long )nesqp == (unsigned long )((struct nes_qp *)0)) { return; } else { } nesqp->cm_id = (struct iw_cm_id *)0; cm_event.event = 4; cm_event.status = -104; cm_event.provider_data = cm_id->provider_data; cm_event.local_addr = cm_id->local_addr; cm_event.remote_addr = cm_id->remote_addr; cm_event.private_data = (void *)0; cm_event.private_data_len = 0U; (*(cm_id->add_ref))(cm_id); ret = (*(cm_id->event_handler))(cm_id, & cm_event); atomic_inc(& cm_closes); cm_event.event = 5; cm_event.status = 0; cm_event.provider_data = cm_id->provider_data; cm_event.local_addr = cm_id->local_addr; cm_event.remote_addr = cm_id->remote_addr; cm_event.private_data = (void *)0; cm_event.private_data_len = 0U; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: NODE %p Generating CLOSE\n", "cm_event_reset", 3990, event->cm_node); } else { } ret = (*(cm_id->event_handler))(cm_id, & cm_event); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: OFA CM event_handler returned, ret=%d\n", "cm_event_reset", 3993, ret); } else { } (*(cm_id->rem_ref))(cm_id); return; } } static void cm_event_mpa_req(struct nes_cm_event *event ) { struct iw_cm_id *cm_id ; struct iw_cm_event cm_event ; int ret ; struct nes_cm_node *cm_node ; struct sockaddr_in *cm_event_laddr ; struct sockaddr_in *cm_event_raddr ; __u16 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; { cm_event_laddr = (struct sockaddr_in *)(& cm_event.local_addr); cm_event_raddr = (struct sockaddr_in *)(& cm_event.remote_addr); cm_node = event->cm_node; if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { return; } else { } cm_id = cm_node->cm_id; atomic_inc(& cm_connect_reqs); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node = %p - cm_id = %p, jiffies = %lu\n", "cm_event_mpa_req", 4024, cm_node, cm_id, jiffies); } else { } cm_event.event = 1; cm_event.status = 0; cm_event.provider_data = (void *)cm_node; cm_event_laddr->sin_family = 2U; tmp = __fswab16((int )event->cm_info.loc_port); cm_event_laddr->sin_port = tmp; tmp___0 = __fswab32(event->cm_info.loc_addr); cm_event_laddr->sin_addr.s_addr = tmp___0; cm_event_raddr->sin_family = 2U; tmp___1 = __fswab16((int )event->cm_info.rem_port); cm_event_raddr->sin_port = tmp___1; tmp___2 = __fswab32(event->cm_info.rem_addr); cm_event_raddr->sin_addr.s_addr = tmp___2; cm_event.private_data = (void *)(& cm_node->__annonCompField121.mpa_frame_buf); cm_event.private_data_len = (unsigned char )cm_node->mpa_frame_size; if ((unsigned int )cm_node->mpa_frame_rev == 1U) { cm_event.ird = 64U; cm_event.ord = 127U; } else { cm_event.ird = (u8 )cm_node->ird_size; cm_event.ord = (u8 )cm_node->ord_size; } ret = (*(cm_id->event_handler))(cm_id, & cm_event); if (ret != 0) { printk("\v%s[%u] OFA CM event_handler returned, ret=%d\n", "cm_event_mpa_req", 4050, ret); } else { } return; } } static void cm_event_mpa_reject(struct nes_cm_event *event ) { struct iw_cm_id *cm_id ; struct iw_cm_event cm_event ; struct nes_cm_node *cm_node ; int ret ; struct sockaddr_in *cm_event_laddr ; struct sockaddr_in *cm_event_raddr ; __u16 tmp ; __u32 tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; { cm_event_laddr = (struct sockaddr_in *)(& cm_event.local_addr); cm_event_raddr = (struct sockaddr_in *)(& cm_event.remote_addr); cm_node = event->cm_node; if ((unsigned long )cm_node == (unsigned long )((struct nes_cm_node *)0)) { return; } else { } cm_id = cm_node->cm_id; atomic_inc(& cm_connect_reqs); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node = %p - cm_id = %p, jiffies = %lu\n", "cm_event_mpa_reject", 4073, cm_node, cm_id, jiffies); } else { } cm_event.event = 2; cm_event.status = -111; cm_event.provider_data = cm_id->provider_data; cm_event_laddr->sin_family = 2U; tmp = __fswab16((int )event->cm_info.loc_port); cm_event_laddr->sin_port = tmp; tmp___0 = __fswab32(event->cm_info.loc_addr); cm_event_laddr->sin_addr.s_addr = tmp___0; cm_event_raddr->sin_family = 2U; tmp___1 = __fswab16((int )event->cm_info.rem_port); cm_event_raddr->sin_port = tmp___1; tmp___2 = __fswab32(event->cm_info.rem_addr); cm_event_raddr->sin_addr.s_addr = tmp___2; cm_event.private_data = (void *)(& cm_node->__annonCompField121.mpa_frame_buf); cm_event.private_data_len = (unsigned char )cm_node->mpa_frame_size; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: call CM_EVENT_MPA_REJECTED, local_addr=%08x, remove_addr=%08x\n", "cm_event_mpa_reject", 4093, cm_event_laddr->sin_addr.s_addr, cm_event_raddr->sin_addr.s_addr); } else { } ret = (*(cm_id->event_handler))(cm_id, & cm_event); if (ret != 0) { printk("\v%s[%u] OFA CM event_handler returned, ret=%d\n", "cm_event_mpa_reject", 4098, ret); } else { } return; } } static void nes_cm_event_handler(struct work_struct *work ) ; static int nes_cm_post_event(struct nes_cm_event *event ) { struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { atomic_inc(& ((event->cm_node)->cm_core)->events_posted); add_ref_cm_node(event->cm_node); (*((event->cm_info.__annonCompField122.cm_id)->add_ref))(event->cm_info.__annonCompField122.cm_id); __init_work(& event->event_work, 0); __constr_expr_0.counter = 137438953408L; event->event_work.data = __constr_expr_0; lockdep_init_map(& event->event_work.lockdep_map, "(&event->event_work)", & __key, 0); INIT_LIST_HEAD(& event->event_work.entry); event->event_work.func = & nes_cm_event_handler; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node=%p queue_work, event=%p\n", "nes_cm_post_event", 4117, event->cm_node, event); } else { } queue_work(((event->cm_node)->cm_core)->event_wq, & event->event_work); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: Exit\n", "nes_cm_post_event", 4121); } else { } return (0); } } static void nes_cm_event_handler(struct work_struct *work ) { struct nes_cm_event *event ; struct work_struct const *__mptr ; struct nes_cm_core *cm_core ; int tmp ; { __mptr = (struct work_struct const *)work; event = (struct nes_cm_event *)__mptr + 0xffffffffffffffd0UL; if (((unsigned long )event == (unsigned long )((struct nes_cm_event *)0) || (unsigned long )event->cm_node == (unsigned long )((struct nes_cm_node *)0)) || (unsigned long )(event->cm_node)->cm_core == (unsigned long )((struct nes_cm_core *)0)) { return; } else { } cm_core = (event->cm_node)->cm_core; if ((nes_debug_level & 32U) != 0U) { tmp = atomic_read((atomic_t const *)(& cm_core->events_posted)); printk("\viw_nes: %s[%u]: event=%p, event->type=%u, events posted=%u\n", "nes_cm_event_handler", 4142, event, (unsigned int )event->type, tmp); } else { } switch ((unsigned int )event->type) { case 2U: cm_event_mpa_req(event); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node=%p CM Event: MPA REQUEST\n", "nes_cm_event_handler", 4148, event->cm_node); } else { } goto ldv_62499; case 9U: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: cm_node = %p CM Event: RESET\n", "nes_cm_event_handler", 4152, event->cm_node); } else { } cm_event_reset(event); goto ldv_62499; case 7U: ; if ((unsigned long )(event->cm_node)->cm_id == (unsigned long )((struct iw_cm_id *)0) || (unsigned int )(event->cm_node)->state != 11U) { goto ldv_62499; } else { } cm_event_connected(event); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: CM Event: CONNECTED\n", "nes_cm_event_handler", 4160); } else { } goto ldv_62499; case 5U: ; if ((unsigned long )(event->cm_node)->cm_id == (unsigned long )((struct iw_cm_id *)0) || (unsigned int )(event->cm_node)->state == 11U) { goto ldv_62499; } else { } cm_event_mpa_reject(event); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: CM Event: REJECT\n", "nes_cm_event_handler", 4167); } else { } goto ldv_62499; case 14U: ; if ((unsigned long )(event->cm_node)->cm_id == (unsigned long )((struct iw_cm_id *)0) || (unsigned int )(event->cm_node)->state == 11U) { goto ldv_62499; } else { } cm_event_connect_error(event); if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: CM Event: ABORTED\n", "nes_cm_event_handler", 4175); } else { } goto ldv_62499; case 10U: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: CM Event: DROPPED PKT\n", "nes_cm_event_handler", 4178); } else { } goto ldv_62499; default: ; if ((nes_debug_level & 32U) != 0U) { printk("\viw_nes: %s[%u]: CM Event: UNKNOWN EVENT TYPE\n", "nes_cm_event_handler", 4181); } else { } goto ldv_62499; } ldv_62499: atomic_dec(& cm_core->events_posted); (*((event->cm_info.__annonCompField122.cm_id)->rem_ref))(event->cm_info.__annonCompField122.cm_id); rem_ref_cm_node(cm_core, event->cm_node); kfree((void const *)event); return; } } void work_init_3(void) { { ldv_work_3_0 = 0; ldv_work_3_1 = 0; ldv_work_3_2 = 0; ldv_work_3_3 = 0; return; } } void activate_work_3(struct work_struct *work , int state ) { { if (ldv_work_3_0 == 0) { ldv_work_struct_3_0 = work; ldv_work_3_0 = state; return; } else { } if (ldv_work_3_1 == 0) { ldv_work_struct_3_1 = work; ldv_work_3_1 = state; return; } else { } if (ldv_work_3_2 == 0) { ldv_work_struct_3_2 = work; ldv_work_3_2 = state; return; } else { } if (ldv_work_3_3 == 0) { ldv_work_struct_3_3 = work; ldv_work_3_3 = state; return; } else { } return; } } void activate_pending_timer_10(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_10 == (unsigned long )timer) { if (ldv_timer_state_10 == 2 || pending_flag != 0) { ldv_timer_list_10 = timer; ldv_timer_list_10->data = data; ldv_timer_state_10 = 1; } else { } return; } else { } reg_timer_10(timer); ldv_timer_list_10->data = data; return; } } void call_and_disable_all_4(int state ) { { if (ldv_work_4_0 == state) { call_and_disable_work_4(ldv_work_struct_4_0); } else { } if (ldv_work_4_1 == state) { call_and_disable_work_4(ldv_work_struct_4_1); } else { } if (ldv_work_4_2 == state) { call_and_disable_work_4(ldv_work_struct_4_2); } else { } if (ldv_work_4_3 == state) { call_and_disable_work_4(ldv_work_struct_4_3); } else { } return; } } void ldv_initialize_nes_cm_ops_12(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; { tmp = ldv_init_zalloc(1160UL); nes_cm_api_group1 = (struct nes_cm_node *)tmp; tmp___0 = ldv_init_zalloc(16792UL); nes_cm_api_group0 = (struct nes_vnic *)tmp___0; tmp___1 = ldv_init_zalloc(1544UL); nes_cm_api_group2 = (struct nes_cm_core *)tmp___1; tmp___2 = ldv_init_zalloc(40UL); nes_cm_api_group3 = (struct nes_cm_info *)tmp___2; return; } } int reg_timer_10(struct timer_list *timer ) { { ldv_timer_list_10 = timer; ldv_timer_state_10 = 1; return (0); } } void call_and_disable_work_3(struct work_struct *work ) { { if ((ldv_work_3_0 == 2 || ldv_work_3_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_0) { nes_disconnect_worker(work); ldv_work_3_0 = 1; return; } else { } if ((ldv_work_3_1 == 2 || ldv_work_3_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_1) { nes_disconnect_worker(work); ldv_work_3_1 = 1; return; } else { } if ((ldv_work_3_2 == 2 || ldv_work_3_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_2) { nes_disconnect_worker(work); ldv_work_3_2 = 1; return; } else { } if ((ldv_work_3_3 == 2 || ldv_work_3_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_3) { nes_disconnect_worker(work); ldv_work_3_3 = 1; return; } else { } return; } } void disable_work_3(struct work_struct *work ) { { if ((ldv_work_3_0 == 3 || ldv_work_3_0 == 2) && (unsigned long )ldv_work_struct_3_0 == (unsigned long )work) { ldv_work_3_0 = 1; } else { } if ((ldv_work_3_1 == 3 || ldv_work_3_1 == 2) && (unsigned long )ldv_work_struct_3_1 == (unsigned long )work) { ldv_work_3_1 = 1; } else { } if ((ldv_work_3_2 == 3 || ldv_work_3_2 == 2) && (unsigned long )ldv_work_struct_3_2 == (unsigned long )work) { ldv_work_3_2 = 1; } else { } if ((ldv_work_3_3 == 3 || ldv_work_3_3 == 2) && (unsigned long )ldv_work_struct_3_3 == (unsigned long )work) { ldv_work_3_3 = 1; } else { } return; } } void invoke_work_4(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_4_0 == 2 || ldv_work_4_0 == 3) { ldv_work_4_0 = 4; nes_cm_event_handler(ldv_work_struct_4_0); ldv_work_4_0 = 1; } else { } goto ldv_62541; case 1: ; if (ldv_work_4_1 == 2 || ldv_work_4_1 == 3) { ldv_work_4_1 = 4; nes_cm_event_handler(ldv_work_struct_4_0); ldv_work_4_1 = 1; } else { } goto ldv_62541; case 2: ; if (ldv_work_4_2 == 2 || ldv_work_4_2 == 3) { ldv_work_4_2 = 4; nes_cm_event_handler(ldv_work_struct_4_0); ldv_work_4_2 = 1; } else { } goto ldv_62541; case 3: ; if (ldv_work_4_3 == 2 || ldv_work_4_3 == 3) { ldv_work_4_3 = 4; nes_cm_event_handler(ldv_work_struct_4_0); ldv_work_4_3 = 1; } else { } goto ldv_62541; default: ldv_stop(); } ldv_62541: ; return; } } void activate_work_4(struct work_struct *work , int state ) { { if (ldv_work_4_0 == 0) { ldv_work_struct_4_0 = work; ldv_work_4_0 = state; return; } else { } if (ldv_work_4_1 == 0) { ldv_work_struct_4_1 = work; ldv_work_4_1 = state; return; } else { } if (ldv_work_4_2 == 0) { ldv_work_struct_4_2 = work; ldv_work_4_2 = state; return; } else { } if (ldv_work_4_3 == 0) { ldv_work_struct_4_3 = work; ldv_work_4_3 = state; return; } else { } return; } } void disable_suitable_timer_10(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_10) { ldv_timer_state_10 = 0; return; } else { } return; } } void disable_work_4(struct work_struct *work ) { { if ((ldv_work_4_0 == 3 || ldv_work_4_0 == 2) && (unsigned long )ldv_work_struct_4_0 == (unsigned long )work) { ldv_work_4_0 = 1; } else { } if ((ldv_work_4_1 == 3 || ldv_work_4_1 == 2) && (unsigned long )ldv_work_struct_4_1 == (unsigned long )work) { ldv_work_4_1 = 1; } else { } if ((ldv_work_4_2 == 3 || ldv_work_4_2 == 2) && (unsigned long )ldv_work_struct_4_2 == (unsigned long )work) { ldv_work_4_2 = 1; } else { } if ((ldv_work_4_3 == 3 || ldv_work_4_3 == 2) && (unsigned long )ldv_work_struct_4_3 == (unsigned long )work) { ldv_work_4_3 = 1; } else { } return; } } void work_init_4(void) { { ldv_work_4_0 = 0; ldv_work_4_1 = 0; ldv_work_4_2 = 0; ldv_work_4_3 = 0; return; } } void invoke_work_3(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_3_0 == 2 || ldv_work_3_0 == 3) { ldv_work_3_0 = 4; nes_disconnect_worker(ldv_work_struct_3_0); ldv_work_3_0 = 1; } else { } goto ldv_62565; case 1: ; if (ldv_work_3_1 == 2 || ldv_work_3_1 == 3) { ldv_work_3_1 = 4; nes_disconnect_worker(ldv_work_struct_3_0); ldv_work_3_1 = 1; } else { } goto ldv_62565; case 2: ; if (ldv_work_3_2 == 2 || ldv_work_3_2 == 3) { ldv_work_3_2 = 4; nes_disconnect_worker(ldv_work_struct_3_0); ldv_work_3_2 = 1; } else { } goto ldv_62565; case 3: ; if (ldv_work_3_3 == 2 || ldv_work_3_3 == 3) { ldv_work_3_3 = 4; nes_disconnect_worker(ldv_work_struct_3_0); ldv_work_3_3 = 1; } else { } goto ldv_62565; default: ldv_stop(); } ldv_62565: ; return; } } void call_and_disable_all_3(int state ) { { if (ldv_work_3_0 == state) { call_and_disable_work_3(ldv_work_struct_3_0); } else { } if (ldv_work_3_1 == state) { call_and_disable_work_3(ldv_work_struct_3_1); } else { } if (ldv_work_3_2 == state) { call_and_disable_work_3(ldv_work_struct_3_2); } else { } if (ldv_work_3_3 == state) { call_and_disable_work_3(ldv_work_struct_3_3); } else { } return; } } void choose_timer_10(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_10 = 2; return; } } void call_and_disable_work_4(struct work_struct *work ) { { if ((ldv_work_4_0 == 2 || ldv_work_4_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_0) { nes_cm_event_handler(work); ldv_work_4_0 = 1; return; } else { } if ((ldv_work_4_1 == 2 || ldv_work_4_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_1) { nes_cm_event_handler(work); ldv_work_4_1 = 1; return; } else { } if ((ldv_work_4_2 == 2 || ldv_work_4_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_2) { nes_cm_event_handler(work); ldv_work_4_2 = 1; return; } else { } if ((ldv_work_4_3 == 2 || ldv_work_4_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_3) { nes_cm_event_handler(work); ldv_work_4_3 = 1; return; } else { } return; } } void ldv_main_exported_12(void) { void *ldvarg56 ; void *tmp ; u32 ldvarg59 ; struct sk_buff *ldvarg55 ; void *tmp___0 ; struct nes_cm_listener *ldvarg54 ; void *tmp___1 ; u32 ldvarg58 ; u16 ldvarg57 ; int tmp___2 ; { tmp = ldv_init_zalloc(1UL); ldvarg56 = tmp; tmp___0 = ldv_init_zalloc(232UL); ldvarg55 = (struct sk_buff *)tmp___0; tmp___1 = ldv_init_zalloc(96UL); ldvarg54 = (struct nes_cm_listener *)tmp___1; ldv_memset((void *)(& ldvarg59), 0, 4UL); ldv_memset((void *)(& ldvarg58), 0, 4UL); ldv_memset((void *)(& ldvarg57), 0, 2UL); tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_12 == 1) { mini_cm_set(nes_cm_api_group2, ldvarg59, ldvarg58); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 1: ; if (ldv_state_variable_12 == 1) { mini_cm_connect(nes_cm_api_group2, nes_cm_api_group0, (int )ldvarg57, ldvarg56, nes_cm_api_group3); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 2: ; if (ldv_state_variable_12 == 1) { mini_cm_reject(nes_cm_api_group2, nes_cm_api_group1); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 3: ; if (ldv_state_variable_12 == 1) { mini_cm_get(nes_cm_api_group2); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 4: ; if (ldv_state_variable_12 == 1) { mini_cm_listen(nes_cm_api_group2, nes_cm_api_group0, nes_cm_api_group3); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 5: ; if (ldv_state_variable_12 == 1) { mini_cm_close(nes_cm_api_group2, nes_cm_api_group1); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 6: ; if (ldv_state_variable_12 == 1) { mini_cm_dealloc_core(nes_cm_api_group2); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 7: ; if (ldv_state_variable_12 == 1) { mini_cm_recv_pkt(nes_cm_api_group2, nes_cm_api_group0, ldvarg55); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 8: ; if (ldv_state_variable_12 == 1) { mini_cm_accelerated(nes_cm_api_group2, nes_cm_api_group1); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 9: ; if (ldv_state_variable_12 == 1) { mini_cm_accept(nes_cm_api_group2, nes_cm_api_group1); ldv_state_variable_12 = 1; } else { } goto ldv_62591; case 10: ; if (ldv_state_variable_12 == 1) { mini_cm_del_listen(nes_cm_api_group2, ldvarg54); ldv_state_variable_12 = 1; } else { } goto ldv_62591; default: ldv_stop(); } ldv_62591: ; return; } } bool ldv_queue_work_on_284(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_285(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_286(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___4 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_287(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_288(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___5 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void *ldv_kmem_cache_alloc_294(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_pskb_expand_head_300(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_302(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv_skb_copy_304(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_305(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_306(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_307(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } int ldv_pskb_expand_head_308(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } int ldv_pskb_expand_head_309(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_310(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } void *ldv_kmem_cache_alloc_311(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_mod_timer_312(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_313(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_314(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___10 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_del_timer_315(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___9 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } void ldv_destroy_workqueue_316(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_destroy_workqueue_317(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } int ldv_del_timer_318(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___11 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static bool IS_ERR(void const *ptr ) ; __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) ; bool ldv_queue_work_on_345(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_347(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_346(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_349(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_348(struct workqueue_struct *ldv_func_arg1 ) ; extern void schedule(void) ; extern int wake_up_process(struct task_struct * ) ; void *ldv_kmem_cache_alloc_355(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_372(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; void disable_suitable_timer_11(struct timer_list *timer ) ; void choose_timer_11(struct timer_list *timer ) ; int reg_timer_11(struct timer_list *timer ) ; void activate_pending_timer_11(struct timer_list *timer , unsigned long data , int pending_flag ) ; __inline static dma_addr_t dma_map_single_attrs___1(struct device *dev , void *ptr , size_t size , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; dma_addr_t addr ; int tmp___0 ; long tmp___1 ; unsigned long tmp___2 ; unsigned long tmp___3 ; { tmp = get_dma_ops(dev); ops = tmp; kmemcheck_mark_initialized(ptr, (unsigned int )size); tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (19), "i" (12UL)); ldv_26087: ; goto ldv_26087; } else { } tmp___2 = __phys_addr((unsigned long )ptr); addr = (*(ops->map_page))(dev, (struct page *)-24189255811072L + (tmp___2 >> 12), (unsigned long )ptr & 4095UL, size, dir, attrs); tmp___3 = __phys_addr((unsigned long )ptr); debug_dma_map_page(dev, (struct page *)-24189255811072L + (tmp___3 >> 12), (unsigned long )ptr & 4095UL, size, (int )dir, addr, 1); return (addr); } } __inline static void dma_unmap_single_attrs___0(struct device *dev , dma_addr_t addr , size_t size , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int tmp___0 ; long tmp___1 ; { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (36), "i" (12UL)); ldv_26096: ; goto ldv_26096; } else { } if ((unsigned long )ops->unmap_page != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ))0)) { (*(ops->unmap_page))(dev, addr, size, dir, attrs); } else { } debug_dma_unmap_page(dev, addr, size, (int )dir, 1); return; } } struct sk_buff *ldv_skb_clone_363(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_371(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_365(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_361(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_369(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_370(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; __inline static int skb_queue_empty(struct sk_buff_head const *list ) { { return ((unsigned long )((struct sk_buff const *)list->next) == (unsigned long )((struct sk_buff const *)list)); } } __inline static struct sk_buff *skb_peek(struct sk_buff_head const *list_ ) { struct sk_buff *skb ; { skb = list_->next; if ((unsigned long )skb == (unsigned long )((struct sk_buff *)list_)) { skb = (struct sk_buff *)0; } else { } return (skb); } } __inline static __u32 skb_queue_len(struct sk_buff_head const *list_ ) { { return ((__u32 )list_->qlen); } } __inline static void __skb_queue_head_init(struct sk_buff_head *list ) { struct sk_buff *tmp ; { tmp = (struct sk_buff *)list; list->next = tmp; list->prev = tmp; list->qlen = 0U; return; } } __inline static void skb_queue_head_init(struct sk_buff_head *list ) { struct lock_class_key __key ; { spinlock_check(& list->lock); __raw_spin_lock_init(& list->lock.__annonCompField18.rlock, "&(&list->lock)->rlock", & __key); __skb_queue_head_init(list); return; } } extern void skb_insert(struct sk_buff * , struct sk_buff * , struct sk_buff_head * ) ; extern void skb_queue_head(struct sk_buff_head * , struct sk_buff * ) ; extern void skb_queue_tail(struct sk_buff_head * , struct sk_buff * ) ; extern void skb_unlink(struct sk_buff * , struct sk_buff_head * ) ; extern struct sk_buff *skb_dequeue(struct sk_buff_head * ) ; struct sk_buff *ldv___netdev_alloc_skb_366(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_367(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_368(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct sk_buff *netdev_alloc_skb___1(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = ldv___netdev_alloc_skb_366(dev, length, 32U); return (tmp); } } __inline static struct sk_buff *dev_alloc_skb___1(unsigned int length ) { struct sk_buff *tmp ; { tmp = netdev_alloc_skb___1((struct net_device *)0, length); return (tmp); } } extern struct task_struct *kthread_create_on_node(int (*)(void * ) , void * , int , char const * , ...) ; extern int kthread_stop(struct task_struct * ) ; extern bool kthread_should_stop(void) ; __inline static bool before(__u32 seq1 , __u32 seq2 ) { { return ((int )(seq1 - seq2) < 0); } } __inline static dma_addr_t pci_map_single___1(struct pci_dev *hwdev , void *ptr , size_t size , int direction ) { dma_addr_t tmp ; { tmp = dma_map_single_attrs___1((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, ptr, size, (enum dma_data_direction )direction, (struct dma_attrs *)0); return (tmp); } } __inline static void pci_unmap_single___0(struct pci_dev *hwdev , dma_addr_t dma_addr , size_t size , int direction ) { { dma_unmap_single_attrs___0((unsigned long )hwdev != (unsigned long )((struct pci_dev *)0) ? & hwdev->dev : (struct device *)0, dma_addr, size, (enum dma_data_direction )direction, (struct dma_attrs *)0); return; } } atomic_t pau_qps_created ; atomic_t pau_qps_destroyed ; __inline static u32 nes_read_indexed___4(struct nes_device *nesdev , u32 reg_index ) { unsigned long flags ; void *addr ; u32 value ; { addr = nesdev->index_reg; ldv_spin_lock(); writel(reg_index, (void volatile *)addr); value = readl((void const volatile *)addr + 4U); spin_unlock_irqrestore(& nesdev->indexed_regs_lock, flags); return (value); } } static void nes_replenish_mgt_rq(struct nes_vnic_mgt *mgtvnic ) { unsigned long flags ; dma_addr_t bus_address ; struct sk_buff *skb ; struct nes_hw_nic_rq_wqe *nic_rqe ; struct nes_hw_mgt *nesmgt ; struct nes_device *nesdev ; struct nes_rskb_cb *cb ; u32 rx_wqes_posted ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { rx_wqes_posted = 0U; nesmgt = & mgtvnic->mgt; nesdev = (mgtvnic->nesvnic)->nesdev; ldv_spin_lock(); if ((unsigned int )nesmgt->replenishing_rq != 0U) { tmp = atomic_read((atomic_t const *)(& mgtvnic->rx_skbs_needed)); if ((int )nesmgt->rq_size + -1 == tmp) { tmp___0 = atomic_read((atomic_t const *)(& mgtvnic->rx_skb_timer_running)); if (tmp___0 == 0) { atomic_set(& mgtvnic->rx_skb_timer_running, 1); spin_unlock_irqrestore(& nesmgt->rq_lock, flags); mgtvnic->rq_wqes_timer.expires = (unsigned long )jiffies + 125UL; add_timer(& mgtvnic->rq_wqes_timer); } else { spin_unlock_irqrestore(& nesmgt->rq_lock, flags); } } else { spin_unlock_irqrestore(& nesmgt->rq_lock, flags); } return; } else { } nesmgt->replenishing_rq = 1U; spin_unlock_irqrestore(& nesmgt->rq_lock, flags); ldv_60950: skb = dev_alloc_skb___1((unsigned int )(mgtvnic->nesvnic)->max_frame_size); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { skb->dev = (mgtvnic->nesvnic)->netdev; bus_address = pci_map_single___1(nesdev->pcidev, (void *)skb->data, (size_t )(mgtvnic->nesvnic)->max_frame_size, 2); cb = (struct nes_rskb_cb *)(& skb->cb); cb->busaddr = bus_address; cb->maplen = (u32 )(mgtvnic->nesvnic)->max_frame_size; nic_rqe = nesmgt->rq_vbase + (unsigned long )mgtvnic->mgt.rq_head; nic_rqe->wqe_words[0] = (unsigned int )(mgtvnic->nesvnic)->max_frame_size; nic_rqe->wqe_words[1] = 0U; nic_rqe->wqe_words[2] = (unsigned int )bus_address; nic_rqe->wqe_words[3] = (unsigned int )(bus_address >> 32); nesmgt->rx_skb[(int )nesmgt->rq_head] = skb; nesmgt->rq_head = (u16 )((int )nesmgt->rq_head + 1); nesmgt->rq_head = (u16 )((int )((short )nesmgt->rq_head) & (int )((short )((unsigned int )nesmgt->rq_size + 65535U))); atomic_dec(& mgtvnic->rx_skbs_needed); __asm__ volatile ("": : : "memory"); rx_wqes_posted = rx_wqes_posted + 1U; if (rx_wqes_posted == 255U) { nes_write32(nesdev->regs + 64UL, (rx_wqes_posted << 24) | (u32 )nesmgt->qp_id); rx_wqes_posted = 0U; } else { } } else { ldv_spin_lock(); tmp___1 = atomic_read((atomic_t const *)(& mgtvnic->rx_skbs_needed)); if ((int )nesmgt->rq_size + -1 == tmp___1) { tmp___2 = atomic_read((atomic_t const *)(& mgtvnic->rx_skb_timer_running)); if (tmp___2 == 0) { atomic_set(& mgtvnic->rx_skb_timer_running, 1); spin_unlock_irqrestore(& nesmgt->rq_lock, flags); mgtvnic->rq_wqes_timer.expires = (unsigned long )jiffies + 125UL; add_timer(& mgtvnic->rq_wqes_timer); } else { spin_unlock_irqrestore(& nesmgt->rq_lock, flags); } } else { spin_unlock_irqrestore(& nesmgt->rq_lock, flags); } goto ldv_60949; } tmp___3 = atomic_read((atomic_t const *)(& mgtvnic->rx_skbs_needed)); if (tmp___3 != 0) { goto ldv_60950; } else { } ldv_60949: __asm__ volatile ("": : : "memory"); if (rx_wqes_posted != 0U) { nes_write32(nesdev->regs + 64UL, (rx_wqes_posted << 24) | (u32 )nesmgt->qp_id); } else { } nesmgt->replenishing_rq = 0U; return; } } static void nes_mgt_rq_wqes_timeout(unsigned long parm ) { struct nes_vnic_mgt *mgtvnic ; int tmp ; { mgtvnic = (struct nes_vnic_mgt *)parm; atomic_set(& mgtvnic->rx_skb_timer_running, 0); tmp = atomic_read((atomic_t const *)(& mgtvnic->rx_skbs_needed)); if (tmp != 0) { nes_replenish_mgt_rq(mgtvnic); } else { } return; } } static void nes_mgt_free_skb(struct nes_device *nesdev , struct sk_buff *skb , u32 dir ) { struct nes_rskb_cb *cb ; { cb = (struct nes_rskb_cb *)(& skb->cb); pci_unmap_single___0(nesdev->pcidev, cb->busaddr, (size_t )cb->maplen, (int )dir); cb->busaddr = 0ULL; dev_kfree_skb_any(skb); return; } } static void nes_download_callback(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) { struct pau_fpdu_info *fpdu_info ; struct nes_qp *nesqp ; struct sk_buff *skb ; int i ; { fpdu_info = (struct pau_fpdu_info *)cqp_request->__annonCompField119.cqp_callback_pointer; nesqp = fpdu_info->nesqp; i = 0; goto ldv_60970; ldv_60969: skb = fpdu_info->frags[i].skb; if ((int )fpdu_info->frags[i].cmplt) { nes_mgt_free_skb(nesdev, skb, 1U); nes_rem_ref_cm_node((struct nes_cm_node *)nesqp->cm_node); } else { } i = i + 1; ldv_60970: ; if ((int )fpdu_info->frag_cnt > i) { goto ldv_60969; } else { } if ((unsigned long )fpdu_info->hdr_vbase != (unsigned long )((void *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )fpdu_info->hdr_len, fpdu_info->hdr_vbase, fpdu_info->hdr_pbase); } else { } kfree((void const *)fpdu_info); return; } } static u32 nes_get_seq(struct sk_buff *skb , u32 *ack , u16 *wnd , u32 *fin_rcvd , u32 *rst_rcvd ) { struct nes_rskb_cb *cb ; struct iphdr *iph ; struct tcphdr *tcph ; __u32 tmp ; __u16 tmp___0 ; __u32 tmp___1 ; { cb = (struct nes_rskb_cb *)(& skb->cb); iph = (struct iphdr *)cb->data_start + 14U; tcph = (struct tcphdr *)iph + (unsigned long )((int )iph->ihl * 4); tmp = __fswab32(tcph->ack_seq); *ack = tmp; tmp___0 = __fswab16((int )tcph->window); *wnd = tmp___0; *fin_rcvd = (u32 )tcph->fin; *rst_rcvd = (u32 )tcph->rst; tmp___1 = __fswab32(tcph->seq); return (tmp___1); } } static struct sk_buff *nes_get_next_skb(struct nes_device *nesdev , struct nes_qp *nesqp , struct sk_buff *skb , u32 nextseq , u32 *ack , u16 *wnd , u32 *fin_rcvd , u32 *rst_rcvd ) { u32 seq ; bool processacks ; struct sk_buff *old_skb ; int tmp ; int tmp___0 ; bool tmp___1 ; { if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )skb->__annonCompField79.__annonCompField78.next == (unsigned long )((struct sk_buff *)(& nesqp->pau_list))) { goto out; } else { } skb = skb->__annonCompField79.__annonCompField78.next; processacks = 0; } else { tmp = skb_queue_empty((struct sk_buff_head const *)(& nesqp->pau_list)); if (tmp != 0) { goto out; } else { } skb = skb_peek((struct sk_buff_head const *)(& nesqp->pau_list)); processacks = 1; } ldv_60997: tmp___0 = skb_queue_empty((struct sk_buff_head const *)(& nesqp->pau_list)); if (tmp___0 != 0) { goto out; } else { } seq = nes_get_seq(skb, ack, wnd, fin_rcvd, rst_rcvd); if (seq == nextseq) { if (skb->len != 0U || (int )processacks) { goto ldv_60996; } else { } } else { tmp___1 = before(nextseq, seq); if ((int )tmp___1) { goto out; } else { } } old_skb = skb; skb = skb->__annonCompField79.__annonCompField78.next; skb_unlink(old_skb, & nesqp->pau_list); nes_mgt_free_skb(nesdev, old_skb, 1U); nes_rem_ref_cm_node((struct nes_cm_node *)nesqp->cm_node); if ((unsigned long )((struct sk_buff *)(& nesqp->pau_list)) == (unsigned long )skb) { goto out; } else { } goto ldv_60997; ldv_60996: ; return (skb); out: ; return ((struct sk_buff *)0); } } static int get_fpdu_info(struct nes_device *nesdev , struct nes_qp *nesqp , struct pau_fpdu_info **pau_fpdu_info ) { struct sk_buff *skb ; struct iphdr *iph ; struct tcphdr *tcph ; struct nes_rskb_cb *cb ; struct pau_fpdu_info *fpdu_info ; struct pau_fpdu_frag frags[4U] ; u32 fpdu_len ; u32 tmp_len ; int frag_cnt ; u32 tot_len ; u32 frag_tot ; u32 ack ; u32 fin_rcvd ; u32 rst_rcvd ; u16 wnd ; int i ; int rc ; __u16 tmp ; u32 _min1 ; unsigned int _min2 ; void *tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u16 tmp___4 ; int tmp___5 ; __u32 tmp___6 ; { fpdu_info = (struct pau_fpdu_info *)0; fpdu_len = 0U; frag_cnt = 0; rc = 0; *pau_fpdu_info = (struct pau_fpdu_info *)0; skb = nes_get_next_skb(nesdev, nesqp, (struct sk_buff *)0, nesqp->pau_rcv_nxt, & ack, & wnd, & fin_rcvd, & rst_rcvd); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { goto out; } else { } cb = (struct nes_rskb_cb *)(& skb->cb); if (skb->len != 0U) { tmp = __fswab16((int )*((__be16 *)skb->data)); fpdu_len = (u32 )((int )tmp + 6); fpdu_len = (fpdu_len + 3U) & 4294967292U; tmp_len = fpdu_len; frag_tot = 0U; memset((void *)(& frags), 0, 96UL); i = 0; goto ldv_61029; ldv_61028: frags[i].physaddr = cb->busaddr; frags[i].physaddr = frags[i].physaddr + (unsigned long long )((long )skb->data - (long )cb->data_start); _min1 = tmp_len; _min2 = skb->len; frags[i].frag_len = _min1 < _min2 ? _min1 : _min2; frags[i].skb = skb; frags[i].cmplt = skb->len == frags[i].frag_len; frag_tot = frags[i].frag_len + frag_tot; frag_cnt = frag_cnt + 1; tmp_len = tmp_len - frags[i].frag_len; if (tmp_len == 0U) { goto ldv_61024; } else { } skb = nes_get_next_skb(nesdev, nesqp, skb, nesqp->pau_rcv_nxt + frag_tot, & ack, & wnd, & fin_rcvd, & rst_rcvd); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { goto out; } else { } if (rst_rcvd != 0U) { goto ldv_61026; ldv_61025: skb_unlink(frags[i].skb, & nesqp->pau_list); nes_mgt_free_skb(nesdev, frags[i].skb, 1U); i = i - 1; ldv_61026: ; if (i >= 0) { goto ldv_61025; } else { } cb = (struct nes_rskb_cb *)(& skb->cb); frags[0].physaddr = cb->busaddr; frags[0].physaddr = frags[0].physaddr + (unsigned long long )((long )skb->data - (long )cb->data_start); frags[0].frag_len = skb->len; frags[0].skb = skb; frags[0].cmplt = 1; frag_cnt = 1; goto ldv_61024; } else { } cb = (struct nes_rskb_cb *)(& skb->cb); i = i + 1; ldv_61029: ; if (i <= 3) { goto ldv_61028; } else { } ldv_61024: ; } else { frags[0].physaddr = cb->busaddr; frags[0].frag_len = 0U; frags[0].skb = skb; frags[0].cmplt = 1; frag_cnt = 1; } tmp___0 = kzalloc(136UL, 32U); fpdu_info = (struct pau_fpdu_info *)tmp___0; if ((unsigned long )fpdu_info == (unsigned long )((struct pau_fpdu_info *)0)) { if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: Failed to alloc a fpdu_info.\n", "get_fpdu_info", 324); } else { } rc = -12; goto out; } else { } fpdu_info->cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )fpdu_info->cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "get_fpdu_info", 331); } else { } rc = -12; goto out; } else { } cb = (struct nes_rskb_cb *)(& (frags[0].skb)->cb); iph = (struct iphdr *)cb->data_start + 14U; tcph = (struct tcphdr *)iph + (unsigned long )((int )iph->ihl * 4); fpdu_info->hdr_len = (int )((unsigned int )((long )((unsigned char *)tcph + (unsigned long )((int )tcph->doff * 4))) - (unsigned int )((long )cb->data_start)); fpdu_info->data_len = (u16 )fpdu_len; tot_len = ((u32 )fpdu_info->hdr_len + fpdu_len) - 14U; if ((int )frags[0].cmplt) { fpdu_info->hdr_pbase = cb->busaddr; fpdu_info->hdr_vbase = (void *)0; } else { fpdu_info->hdr_vbase = pci_alloc_consistent(nesdev->pcidev, (size_t )fpdu_info->hdr_len, & fpdu_info->hdr_pbase); if ((unsigned long )fpdu_info->hdr_vbase == (unsigned long )((void *)0)) { if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate memory for pau first frag\n", "get_fpdu_info", 350); } else { } rc = -12; goto out; } else { } memcpy(fpdu_info->hdr_vbase, (void const *)cb->data_start, (size_t )fpdu_info->hdr_len); iph = (struct iphdr *)fpdu_info->hdr_vbase + 14U; tcph = (struct tcphdr *)iph + (unsigned long )((int )iph->ihl * 4); } tmp___1 = __fswab16((int )((__u16 )tot_len)); iph->tot_len = tmp___1; iph->saddr = 16777343U; tmp___2 = __fswab32(nesqp->pau_rcv_nxt); tcph->seq = tmp___2; tmp___3 = __fswab32(ack); tcph->ack_seq = tmp___3; tmp___4 = __fswab16((int )wnd); tcph->window = tmp___4; nesqp->pau_rcv_nxt = nesqp->pau_rcv_nxt + (fpdu_len + fin_rcvd); memcpy((void *)(& fpdu_info->frags), (void const *)(& frags), 96UL); fpdu_info->frag_cnt = (u16 )frag_cnt; fpdu_info->nesqp = nesqp; *pau_fpdu_info = fpdu_info; i = 0; goto ldv_61032; ldv_61031: cb = (struct nes_rskb_cb *)(& (frags[i].skb)->cb); skb_pull(frags[i].skb, frags[i].frag_len); if ((frags[i].skb)->len == 0U) { tmp___5 = skb_queue_empty((struct sk_buff_head const *)(& nesqp->pau_list)); if (tmp___5 == 0) { skb_unlink(frags[i].skb, & nesqp->pau_list); } else { } } else { iph = (struct iphdr *)cb->data_start + 14U; tcph = (struct tcphdr *)iph + (unsigned long )((int )iph->ihl * 4); tmp___6 = __fswab32(nesqp->pau_rcv_nxt); tcph->seq = tmp___6; } i = i + 1; ldv_61032: ; if (i < frag_cnt) { goto ldv_61031; } else { } out: ; if (rc != 0) { if ((unsigned long )fpdu_info != (unsigned long )((struct pau_fpdu_info *)0)) { if ((unsigned long )fpdu_info->cqp_request != (unsigned long )((struct nes_cqp_request *)0)) { nes_put_cqp_request(nesdev, fpdu_info->cqp_request); } else { } kfree((void const *)fpdu_info); } else { } } else { } return (rc); } } static int forward_fpdus(struct nes_vnic *nesvnic , struct nes_qp *nesqp ) { struct nes_device *nesdev ; struct pau_fpdu_info *fpdu_info ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_cqp_request *cqp_request ; unsigned long flags ; u64 u64tmp ; u32 u32tmp ; int rc ; { nesdev = nesvnic->nesdev; ldv_61046: ldv_spin_lock(); rc = get_fpdu_info(nesdev, nesqp, & fpdu_info); if (rc != 0 || (unsigned long )fpdu_info == (unsigned long )((struct pau_fpdu_info *)0)) { spin_unlock_irqrestore(& nesqp->pau_lock, flags); return (rc); } else { } cqp_request = fpdu_info->cqp_request; cqp_wqe = & cqp_request->cqp_wqe; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, ((unsigned int )nesvnic->logical_port << 26) | 16U); u32tmp = (u32 )(fpdu_info->hdr_len << 16); u32tmp = ((unsigned int )fpdu_info->hdr_len + (unsigned int )fpdu_info->data_len) | u32tmp; set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 3U, u32tmp); u32tmp = (fpdu_info->frags[1].frag_len << 16) | fpdu_info->frags[0].frag_len; set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 4U, u32tmp); u32tmp = (fpdu_info->frags[3].frag_len << 16) | fpdu_info->frags[2].frag_len; set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 5U, u32tmp); u64tmp = fpdu_info->hdr_pbase; set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, (unsigned int )u64tmp); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 7U, (unsigned int )(u64tmp >> 32ULL)); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 8U, (unsigned int )fpdu_info->frags[0].physaddr); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 9U, (unsigned int )(fpdu_info->frags[0].physaddr >> 32ULL)); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 10U, (unsigned int )fpdu_info->frags[1].physaddr); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 11U, (unsigned int )(fpdu_info->frags[1].physaddr >> 32ULL)); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 12U, (unsigned int )fpdu_info->frags[2].physaddr); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 13U, (unsigned int )(fpdu_info->frags[2].physaddr >> 32ULL)); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 14U, (unsigned int )fpdu_info->frags[3].physaddr); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 15U, (unsigned int )(fpdu_info->frags[3].physaddr >> 32ULL)); cqp_request->__annonCompField119.cqp_callback_pointer = (void *)fpdu_info; cqp_request->callback = 1U; cqp_request->cqp_callback = & nes_download_callback; atomic_set(& cqp_request->refcount, 1); nes_post_cqp_request(nesdev, cqp_request); spin_unlock_irqrestore(& nesqp->pau_lock, flags); goto ldv_61046; return (0); } } static void process_fpdus(struct nes_vnic *nesvnic , struct nes_qp *nesqp ) { int again ; unsigned long flags ; { again = 1; ldv_61053: forward_fpdus(nesvnic, nesqp); ldv_spin_lock(); if ((unsigned int )nesqp->pau_pending != 0U) { nesqp->pau_pending = 0U; } else { nesqp->pau_busy = 0U; again = 0; } spin_unlock_irqrestore(& nesqp->pau_lock, flags); if (again != 0) { goto ldv_61053; } else { } return; } } static void queue_fpdus(struct sk_buff *skb , struct nes_vnic *nesvnic , struct nes_qp *nesqp ) { struct sk_buff *tmpskb ; struct nes_rskb_cb *cb ; struct iphdr *iph ; struct tcphdr *tcph ; unsigned char *tcph_end ; u32 rcv_nxt ; u32 rcv_wnd ; u32 seqnum ; u32 len ; bool process_it ; unsigned long flags ; __u32 tmp ; __u16 tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; __u32 tmp___4 ; { process_it = 0; iph = (struct iphdr *)skb->data; tcph = (struct tcphdr *)iph + (unsigned long )((int )iph->ihl * 4); tmp = __fswab32(tcph->seq); seqnum = tmp; tcph_end = (unsigned char *)tcph + (unsigned long )((int )tcph->doff * 4); tmp___0 = __fswab16((int )iph->tot_len); len = (u32 )tmp___0; if (skb->len > len) { skb_trim(skb, len); } else { } skb_pull(skb, (unsigned int )((long )tcph_end) - (unsigned int )((long )skb->data)); cb = (struct nes_rskb_cb *)(& skb->cb); cb->seqnum = seqnum; rcv_nxt = nesqp->pau_rcv_nxt; rcv_wnd = (nesqp->nesqp_context)->rcv_wnd; tmp___1 = between(seqnum, rcv_nxt, rcv_nxt + rcv_wnd); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { nes_mgt_free_skb(nesvnic->nesdev, skb, 1U); nes_rem_ref_cm_node((struct nes_cm_node *)nesqp->cm_node); return; } else { } ldv_spin_lock(); if ((unsigned int )nesqp->pau_busy != 0U) { nesqp->pau_pending = 1U; } else { nesqp->pau_busy = 1U; } tmp___4 = skb_queue_len((struct sk_buff_head const *)(& nesqp->pau_list)); if (tmp___4 == 0U) { skb_queue_head(& nesqp->pau_list, skb); } else { tmpskb = nesqp->pau_list.next; goto ldv_61073; ldv_61072: cb = (struct nes_rskb_cb *)(& tmpskb->cb); tmp___3 = before(seqnum, cb->seqnum); if ((int )tmp___3) { goto ldv_61071; } else { } tmpskb = tmpskb->__annonCompField79.__annonCompField78.next; ldv_61073: ; if ((unsigned long )((struct sk_buff *)(& nesqp->pau_list)) != (unsigned long )tmpskb) { goto ldv_61072; } else { } ldv_61071: skb_insert(tmpskb, skb, & nesqp->pau_list); } if ((unsigned int )nesqp->pau_state == 2U) { process_it = 1; } else { } spin_unlock_irqrestore(& nesqp->pau_lock, flags); if ((int )process_it) { process_fpdus(nesvnic, nesqp); } else { } return; } } static int mgt_thread(void *context ) { struct nes_vnic *nesvnic ; struct sk_buff *skb ; struct nes_rskb_cb *cb ; int __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp ; __u32 tmp___0 ; bool tmp___1 ; __u32 tmp___2 ; bool tmp___3 ; int tmp___4 ; __u32 tmp___5 ; bool tmp___6 ; int tmp___7 ; bool tmp___8 ; int tmp___9 ; __u32 tmp___10 ; { nesvnic = (struct nes_vnic *)context; goto ldv_61093; ldv_61092: __ret = 0; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_mgt.c", 586, 0); tmp___2 = skb_queue_len((struct sk_buff_head const *)(& nesvnic->mgt_skb_list)); if (tmp___2 == 0U) { tmp___3 = kthread_should_stop(); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { __ret___0 = 0L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61086: tmp = prepare_to_wait_event(& nesvnic->mgt_wait_queue, & __wait, 1); __int = tmp; tmp___0 = skb_queue_len((struct sk_buff_head const *)(& nesvnic->mgt_skb_list)); if (tmp___0 != 0U) { goto ldv_61085; } else { tmp___1 = kthread_should_stop(); if ((int )tmp___1) { goto ldv_61085; } else { } } if (__int != 0L) { __ret___0 = __int; goto ldv_61085; } else { } schedule(); goto ldv_61086; ldv_61085: finish_wait(& nesvnic->mgt_wait_queue, & __wait); __ret = (int )__ret___0; } else { } } else { } goto ldv_61090; ldv_61089: skb = skb_dequeue(& nesvnic->mgt_skb_list); cb = (struct nes_rskb_cb *)(& skb->cb); cb->data_start = skb->data + 0xfffffffffffffff2UL; cb->busaddr = pci_map_single___1((nesvnic->nesdev)->pcidev, (void *)cb->data_start, (size_t )nesvnic->max_frame_size, 1); queue_fpdus(skb, nesvnic, cb->nesqp); ldv_61090: tmp___5 = skb_queue_len((struct sk_buff_head const *)(& nesvnic->mgt_skb_list)); if (tmp___5 != 0U) { tmp___6 = kthread_should_stop(); if (tmp___6) { tmp___7 = 0; } else { tmp___7 = 1; } if (tmp___7) { goto ldv_61089; } else { goto ldv_61091; } } else { } ldv_61091: ; ldv_61093: tmp___8 = kthread_should_stop(); if (tmp___8) { tmp___9 = 0; } else { tmp___9 = 1; } if (tmp___9) { goto ldv_61092; } else { } goto ldv_61096; ldv_61095: skb = skb_dequeue(& nesvnic->mgt_skb_list); cb = (struct nes_rskb_cb *)(& skb->cb); nes_rem_ref_cm_node((struct nes_cm_node *)(cb->nesqp)->cm_node); dev_kfree_skb_any(skb); ldv_61096: tmp___10 = skb_queue_len((struct sk_buff_head const *)(& nesvnic->mgt_skb_list)); if (tmp___10 != 0U) { goto ldv_61095; } else { } return (0); } } void nes_queue_mgt_skbs(struct sk_buff *skb , struct nes_vnic *nesvnic , struct nes_qp *nesqp ) { struct nes_rskb_cb *cb ; { cb = (struct nes_rskb_cb *)(& skb->cb); cb->nesqp = nesqp; skb_queue_tail(& nesvnic->mgt_skb_list, skb); __wake_up(& nesvnic->mgt_wait_queue, 1U, 1, (void *)0); return; } } void nes_destroy_pau_qp(struct nes_device *nesdev , struct nes_qp *nesqp ) { struct sk_buff *skb ; unsigned long flags ; __u32 tmp ; { atomic_inc(& pau_qps_destroyed); ldv_spin_lock(); goto ldv_61111; ldv_61110: skb = skb_dequeue(& nesqp->pau_list); nes_mgt_free_skb(nesdev, skb, 1U); nes_rem_ref_cm_node((struct nes_cm_node *)nesqp->cm_node); ldv_61111: tmp = skb_queue_len((struct sk_buff_head const *)(& nesqp->pau_list)); if (tmp != 0U) { goto ldv_61110; } else { } spin_unlock_irqrestore(& nesqp->pau_lock, flags); return; } } static void nes_chg_qh_handler(struct nes_device *nesdev , struct nes_cqp_request *cqp_request ) { struct pau_qh_chg *qh_chg ; struct nes_cqp_request *new_request ; struct nes_hw_cqp_wqe *cqp_wqe ; struct nes_adapter *nesadapter ; struct nes_qp *nesqp ; struct nes_v4_quad nes_quad ; u32 crc_value ; u64 u64temp ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; __u16 tmp___1 ; __u16 tmp___2 ; __u32 tmp___3 ; { qh_chg = (struct pau_qh_chg *)cqp_request->__annonCompField119.cqp_callback_pointer; nesadapter = nesdev->nesadapter; nesqp = qh_chg->nesqp; if ((unsigned int )cqp_request->major_code != 0U) { __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_fmt("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_mgt.c", 654, "iw_nes: Invalid cqp_request major_code=0x%x\n", (int )cqp_request->major_code); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } switch ((int )nesqp->pau_state) { case 0: nesqp->pau_state = 1U; new_request = nes_get_cqp_request(nesdev); if ((unsigned long )new_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a new_request.\n", "nes_chg_qh_handler", 662); } else { } __ret_warn_on___0 = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_mgt.c", 663); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); return; } else { } memset((void *)(& nes_quad), 0, 16UL); nes_quad.DstIpAdrIndex = ((nesdev->pcidev)->devfn & 7U) << 24; nes_quad.SrcIpadr = 16777343U; tmp___1 = __fswab16((int )(nesqp->nesqp_context)->tcpPorts[1]); nes_quad.TcpPorts[0] = tmp___1; tmp___2 = __fswab16((int )(nesqp->nesqp_context)->tcpPorts[0]); nes_quad.TcpPorts[1] = tmp___2; crc_value = get_crc_value(& nes_quad); tmp___3 = __fswab32(~ crc_value); nesqp->hte_index = tmp___3; if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: new HTE Index = 0x%08X, CRC = 0x%08X\n", "nes_chg_qh_handler", 678, nesqp->hte_index, nesqp->hte_index & nesadapter->hte_index_mask); } else { } nesqp->hte_index = nesqp->hte_index & nesadapter->hte_index_mask; (nesqp->nesqp_context)->hte_index = nesqp->hte_index; (nesqp->nesqp_context)->ip0 = 2130706433U; (nesqp->nesqp_context)->rcv_nxt = nesqp->pau_rcv_nxt; cqp_wqe = & new_request->cqp_wqe; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, 536937509U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, nesqp->hwqp.qp_id); u64temp = nesqp->nesqp_context_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for CQP completion for adding the quad hash.\n", "nes_chg_qh_handler", 694); } else { } new_request->__annonCompField119.cqp_callback_pointer = (void *)qh_chg; new_request->callback = 1U; new_request->cqp_callback = & nes_chg_qh_handler; atomic_set(& new_request->refcount, 1); nes_post_cqp_request(nesdev, new_request); goto ldv_61131; case 1: nesqp->pau_state = 2U; process_fpdus(qh_chg->nesvnic, qh_chg->nesqp); kfree((void const *)qh_chg); goto ldv_61131; } ldv_61131: ; return; } } static int nes_change_quad_hash(struct nes_device *nesdev , struct nes_vnic *nesvnic , struct nes_qp *nesqp ) { struct nes_cqp_request *cqp_request ; struct pau_qh_chg *qh_chg ; u64 u64temp ; struct nes_hw_cqp_wqe *cqp_wqe ; int ret ; void *tmp ; { cqp_request = (struct nes_cqp_request *)0; qh_chg = (struct pau_qh_chg *)0; ret = 0; cqp_request = nes_get_cqp_request(nesdev); if ((unsigned long )cqp_request == (unsigned long )((struct nes_cqp_request *)0)) { if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_change_quad_hash", 726); } else { } ret = -12; goto chg_qh_err; } else { } tmp = kzalloc(24UL, 32U); qh_chg = (struct pau_qh_chg *)tmp; if ((unsigned long )qh_chg == (unsigned long )((struct pau_qh_chg *)0)) { if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: Failed to get a cqp_request.\n", "nes_change_quad_hash", 733); } else { } ret = -12; goto chg_qh_err; } else { } qh_chg->nesdev = nesdev; qh_chg->nesvnic = nesvnic; qh_chg->nesqp = nesqp; nesqp->pau_state = 0U; cqp_wqe = & cqp_request->cqp_wqe; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, 536953893U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, nesqp->hwqp.qp_id); u64temp = nesqp->nesqp_context_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); if ((nes_debug_level & 1048576U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for CQP completion for deleting the quad hash.\n", "nes_change_quad_hash", 751); } else { } cqp_request->__annonCompField119.cqp_callback_pointer = (void *)qh_chg; cqp_request->callback = 1U; cqp_request->cqp_callback = & nes_chg_qh_handler; atomic_set(& cqp_request->refcount, 1); nes_post_cqp_request(nesdev, cqp_request); return (ret); chg_qh_err: kfree((void const *)qh_chg); if ((unsigned long )cqp_request != (unsigned long )((struct nes_cqp_request *)0)) { nes_put_cqp_request(nesdev, cqp_request); } else { } return (ret); } } static void nes_mgt_ce_handler(struct nes_device *nesdev , struct nes_hw_nic_cq *cq ) { struct nes_vnic_mgt *mgtvnic ; struct nes_hw_nic_cq const *__mptr ; struct nes_adapter *nesadapter ; u32 head ; u32 cq_size ; u32 cqe_count ; u32 cqe_misc ; u32 qp_id ; u32 skbs_needed ; unsigned long context ; struct nes_qp *nesqp ; struct sk_buff *rx_skb ; struct nes_rskb_cb *cb ; struct lock_class_key __key ; int tmp ; { __mptr = (struct nes_hw_nic_cq const *)cq; mgtvnic = (struct nes_vnic_mgt *)__mptr + 0xffffffffffffef90UL; nesadapter = nesdev->nesadapter; cqe_count = 0U; qp_id = 0U; head = (u32 )cq->cq_head; cq_size = (u32 )cq->cq_size; ldv_61165: cqe_misc = (cq->cq_vbase + (unsigned long )head)->cqe_words[3]; if ((int )cqe_misc >= 0) { goto ldv_61163; } else { } nesqp = (struct nes_qp *)0; if ((cqe_misc & 536870912U) != 0U) { qp_id = (cq->cq_vbase + (unsigned long )head)->cqe_words[0]; qp_id = qp_id & 2097151U; if (nesadapter->max_qp > qp_id) { context = (unsigned long )*(nesadapter->qp_table + (unsigned long )(qp_id - 64U)); nesqp = (struct nes_qp *)context; } else { } } else { } if ((unsigned long )nesqp != (unsigned long )((struct nes_qp *)0)) { if ((unsigned int )*((unsigned char *)nesqp + 820UL) == 0U) { nesqp->pau_mode = 1U; nesqp->pau_rcv_nxt = (cq->cq_vbase + (unsigned long )head)->cqe_words[1]; skb_queue_head_init(& nesqp->pau_list); spinlock_check(& nesqp->pau_lock); __raw_spin_lock_init(& nesqp->pau_lock.__annonCompField18.rlock, "&(&nesqp->pau_lock)->rlock", & __key); atomic_inc(& pau_qps_created); nes_change_quad_hash(nesdev, mgtvnic->nesvnic, nesqp); } else { } rx_skb = mgtvnic->mgt.rx_skb[(int )mgtvnic->mgt.rq_tail]; rx_skb->len = 0U; skb_put(rx_skb, cqe_misc & 65535U); rx_skb->protocol = eth_type_trans(rx_skb, (mgtvnic->nesvnic)->netdev); cb = (struct nes_rskb_cb *)(& rx_skb->cb); pci_unmap_single___0(nesdev->pcidev, cb->busaddr, (size_t )cb->maplen, 2); cb->busaddr = 0ULL; mgtvnic->mgt.rq_tail = (u16 )((int )mgtvnic->mgt.rq_tail + 1); mgtvnic->mgt.rq_tail = (u16 )((int )((short )mgtvnic->mgt.rq_tail) & (int )((short )((unsigned int )mgtvnic->mgt.rq_size + 65535U))); nes_add_ref_cm_node((struct nes_cm_node *)nesqp->cm_node); nes_queue_mgt_skbs(rx_skb, mgtvnic->nesvnic, nesqp); } else { printk("\viw_nes: Invalid QP %d for packed/unaligned handling\n", qp_id); } (cq->cq_vbase + (unsigned long )head)->cqe_words[3] = 0U; cqe_count = cqe_count + 1U; head = head + 1U; if (head >= cq_size) { head = 0U; } else { } if (cqe_count == 255U) { nes_write32(nesdev->regs + 68UL, (u32 )cq->cq_number | (cqe_count << 16)); nesdev->currcq_count = (int )nesdev->currcq_count + (int )((u16 )cqe_count); cqe_count = 0U; } else { } tmp = atomic_add_return(1, & mgtvnic->rx_skbs_needed); skbs_needed = (u32 )tmp; if ((u32 )((int )mgtvnic->mgt.rq_size >> 1) < skbs_needed) { nes_replenish_mgt_rq(mgtvnic); } else { } goto ldv_61165; ldv_61163: cq->cq_head = (u16 )head; nes_write32(nesdev->regs + 68UL, ((u32 )cq->cq_number | (cqe_count << 16)) | 536870912U); nes_read32((void const *)nesdev->regs + 68U); nesdev->currcq_count = (int )nesdev->currcq_count + (int )((u16 )cqe_count); return; } } int nes_init_mgt_qp(struct nes_device *nesdev , struct net_device *netdev , struct nes_vnic *nesvnic ) { struct nes_vnic_mgt *mgtvnic ; u32 counter ; void *vmem ; dma_addr_t pmem ; struct nes_hw_cqp_wqe *cqp_wqe ; u32 cqp_head ; unsigned long flags ; struct nes_hw_nic_qp_context *mgt_context ; u64 u64temp ; struct nes_hw_nic_rq_wqe *mgt_rqe ; struct sk_buff *skb ; u32 wqe_count ; struct nes_rskb_cb *cb ; u32 mgt_mem_size ; void *mgt_vbase ; dma_addr_t mgt_pbase ; int i ; int ret ; void *tmp ; struct lock_class_key __key ; struct task_struct *__k ; struct task_struct *tmp___0 ; bool tmp___1 ; int tmp___2 ; struct lock_class_key __key___0 ; u32 tmp___3 ; u32 tmp___4 ; u32 tmp___5 ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___6 ; bool __cond ; bool __cond___0 ; u32 _min1 ; unsigned int _min2 ; struct nes_vnic_mgt *tmp___7 ; { tmp = kzalloc(17600UL, 208U); mgtvnic = (struct nes_vnic_mgt *)tmp; if ((unsigned long )mgtvnic == (unsigned long )((struct nes_vnic_mgt *)0)) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate memory for mgt structure\n", "nes_init_mgt_qp", 884); } else { } return (-12); } else { } mgt_mem_size = 2840U; mgt_mem_size = (mgt_mem_size + 4095U) & 4294963200U; mgt_vbase = pci_alloc_consistent(nesdev->pcidev, (size_t )(mgt_mem_size * 4U), & mgt_pbase); if ((unsigned long )mgt_vbase == (unsigned long )((void *)0)) { kfree((void const *)mgtvnic); if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Unable to allocate memory for mgt host descriptor rings\n", "nes_init_mgt_qp", 898); } else { } return (-12); } else { } nesvnic->mgt_mem_size = mgt_mem_size * 4U; nesvnic->mgt_vbase = mgt_vbase; nesvnic->mgt_pbase = mgt_pbase; skb_queue_head_init(& nesvnic->mgt_skb_list); __init_waitqueue_head(& nesvnic->mgt_wait_queue, "&nesvnic->mgt_wait_queue", & __key); tmp___0 = kthread_create_on_node(& mgt_thread, (void *)nesvnic, -1, "nes_mgt_thread"); __k = tmp___0; tmp___1 = IS_ERR((void const *)__k); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { wake_up_process(__k); } else { } nesvnic->mgt_thread = __k; i = 0; goto ldv_61216; ldv_61215: mgtvnic->nesvnic = nesvnic; mgtvnic->mgt.qp_id = (unsigned int )((int )((u16 )nesdev->mac_index) + (int )((u16 )i)) + 36U; memset(mgt_vbase, 0, (size_t )mgt_mem_size); if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Allocated mgt QP structures at %p (phys = %016lX), size = %u.\n", "nes_init_mgt_qp", 915, mgt_vbase, (unsigned long )mgt_pbase, mgt_mem_size); } else { } vmem = (void *)(((unsigned long )mgt_vbase + 255UL) & 0xffffffffffffff00UL); pmem = (mgt_pbase + 255ULL) & 0xffffffffffffff00ULL; spinlock_check(& mgtvnic->mgt.rq_lock); __raw_spin_lock_init(& mgtvnic->mgt.rq_lock.__annonCompField18.rlock, "&(&mgtvnic->mgt.rq_lock)->rlock", & __key___0); mgtvnic->mgt.rq_vbase = (struct nes_hw_nic_rq_wqe *)vmem; mgtvnic->mgt.rq_pbase = pmem; mgtvnic->mgt.rq_head = 0U; mgtvnic->mgt.rq_tail = 0U; mgtvnic->mgt.rq_size = 32U; vmem = vmem + 2048UL; pmem = pmem + 2048ULL; mgtvnic->mgt_cq.cq_number = mgtvnic->mgt.qp_id; mgtvnic->mgt_cq.cq_vbase = (struct nes_hw_nic_cqe volatile *)vmem; mgtvnic->mgt_cq.cq_pbase = pmem; mgtvnic->mgt_cq.cq_head = 0U; mgtvnic->mgt_cq.cq_size = 32U; mgtvnic->mgt_cq.ce_handler = & nes_mgt_ce_handler; ldv_spin_lock(); cqp_head = (u32 )nesdev->cqp.sq_head; cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); cqp_wqe->wqe_words[0] = ((unsigned int )mgtvnic->mgt_cq.cq_size << 16) | 1027U; cqp_wqe->wqe_words[1] = (unsigned int )mgtvnic->mgt_cq.cq_number | ((unsigned int )nesdev->ceq_index << 16); u64temp = mgtvnic->mgt_cq.cq_pbase; set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); cqp_wqe->wqe_words[9] = 0U; u64temp = (u64 )(& mgtvnic->mgt_cq); cqp_wqe->wqe_words[8] = (unsigned int )(u64temp >> 1); cqp_wqe->wqe_words[9] = (unsigned int )(u64temp >> 33) & 2147483647U; cqp_wqe->wqe_words[10] = 0U; cqp_head = cqp_head + 1U; if (cqp_head >= (u32 )nesdev->cqp.sq_size) { cqp_head = 0U; } else { } cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); mgt_context = (struct nes_hw_nic_qp_context *)mgtvnic->mgt_cq.cq_vbase + (unsigned long )mgtvnic->mgt_cq.cq_size; mgt_context->context_words[0] = (((nesdev->pcidev)->devfn & 7U) << 12) | 1792U; if ((nes_debug_level & 2U) != 0U) { tmp___3 = nes_read_indexed___4(nesdev, 768U); tmp___4 = nes_read_indexed___4(nesdev, 752U); printk("\viw_nes: %s[%u]: RX_WINDOW_BUFFER_PAGE_TABLE_SIZE = 0x%08X, RX_WINDOW_BUFFER_SIZE = 0x%08X\n", "nes_init_mgt_qp", 976, tmp___4, tmp___3); } else { } tmp___5 = nes_read_indexed___4(nesdev, 768U); if (tmp___5 != 0U) { mgt_context->context_words[0] = mgt_context->context_words[0] | 229376U; } else { } u64temp = mgtvnic->mgt.rq_pbase; mgt_context->context_words[2] = (unsigned int )u64temp; mgt_context->context_words[3] = (unsigned int )(u64temp >> 32); u64temp = mgtvnic->mgt.rq_pbase; mgt_context->context_words[4] = (unsigned int )u64temp; mgt_context->context_words[5] = (unsigned int )(u64temp >> 32); cqp_wqe->wqe_words[0] = 327680U; cqp_wqe->wqe_words[1] = (unsigned int )mgtvnic->mgt.qp_id; u64temp = mgtvnic->mgt_cq.cq_pbase + (unsigned long long )((unsigned long )mgtvnic->mgt_cq.cq_size * 16UL); set_wqe_64bit_value((__le32 *)(& cqp_wqe->wqe_words), 6U, u64temp); cqp_head = cqp_head + 1U; if (cqp_head >= (u32 )nesdev->cqp.sq_size) { cqp_head = 0U; } else { } nesdev->cqp.sq_head = (u16 )cqp_head; __asm__ volatile ("": : : "memory"); nes_write32(nesdev->regs + 64UL, (u32 )((int )nesdev->cqp.qp_id | 41943040)); spin_unlock_irqrestore(& nesdev->cqp.lock, flags); if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for create MGT QP%u to complete.\n", "nes_init_mgt_qp", 1005, (int )mgtvnic->mgt.qp_id); } else { } __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_mgt.c", 1008, 0); __cond___0 = (u32 )nesdev->cqp.sq_tail == cqp_head; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61204: tmp___6 = prepare_to_wait_event(& nesdev->cqp.waitq, & __wait, 2); __int = tmp___6; __cond = (u32 )nesdev->cqp.sq_tail == cqp_head; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61203; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61204; ldv_61203: finish_wait(& nesdev->cqp.waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: Create MGT QP%u completed, wait_event_timeout ret = %u.\n", "nes_init_mgt_qp", 1010, (int )mgtvnic->mgt.qp_id, ret); } else { } if (ret == 0) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: MGT QP%u create timeout expired\n", "nes_init_mgt_qp", 1012, (int )mgtvnic->mgt.qp_id); } else { } if (i == 0) { pci_free_consistent(nesdev->pcidev, (size_t )nesvnic->mgt_mem_size, nesvnic->mgt_vbase, nesvnic->mgt_pbase); kfree((void const *)mgtvnic); } else { nes_destroy_mgt(nesvnic); } return (-5); } else { } counter = 0U; goto ldv_61208; ldv_61207: skb = dev_alloc_skb___1((unsigned int )nesvnic->max_frame_size); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if ((nes_debug_level & 2U) != 0U) { printk("\viw_nes: %s[%u]: %s: out of memory for receive skb\n", "nes_init_mgt_qp", 1027, (char *)(& netdev->name)); } else { } return (-12); } else { } skb->dev = netdev; pmem = pci_map_single___1(nesdev->pcidev, (void *)skb->data, (size_t )nesvnic->max_frame_size, 2); cb = (struct nes_rskb_cb *)(& skb->cb); cb->busaddr = pmem; cb->maplen = (u32 )nesvnic->max_frame_size; mgt_rqe = mgtvnic->mgt.rq_vbase + (unsigned long )counter; mgt_rqe->wqe_words[0] = (unsigned int )nesvnic->max_frame_size; mgt_rqe->wqe_words[1] = 0U; mgt_rqe->wqe_words[2] = (unsigned int )pmem; mgt_rqe->wqe_words[3] = (unsigned int )(pmem >> 32); mgtvnic->mgt.rx_skb[counter] = skb; counter = counter + 1U; ldv_61208: ; if (counter <= 30U) { goto ldv_61207; } else { } reg_timer_7(& mgtvnic->rq_wqes_timer); mgtvnic->rq_wqes_timer.function = & nes_mgt_rq_wqes_timeout; mgtvnic->rq_wqes_timer.data = (unsigned long )mgtvnic; wqe_count = 31U; mgtvnic->mgt.rq_head = (u16 )wqe_count; __asm__ volatile ("": : : "memory"); ldv_61213: _min1 = wqe_count; _min2 = 255U; counter = _min1 < _min2 ? _min1 : _min2; wqe_count = wqe_count - counter; nes_write32(nesdev->regs + 64UL, (counter << 24) | (u32 )mgtvnic->mgt.qp_id); if (wqe_count != 0U) { goto ldv_61213; } else { } nes_write32(nesdev->regs + 68UL, (u32 )((int )mgtvnic->mgt_cq.cq_number | 536870912)); nes_read32((void const *)nesdev->regs + 68U); mgt_vbase = mgt_vbase + (unsigned long )mgt_mem_size; mgt_pbase = (dma_addr_t )mgt_mem_size + mgt_pbase; tmp___7 = mgtvnic; mgtvnic = mgtvnic + 1; nesvnic->mgtvnic[i] = tmp___7; i = i + 1; ldv_61216: ; if (i <= 3) { goto ldv_61215; } else { } return (0); } } void nes_destroy_mgt(struct nes_vnic *nesvnic ) { struct nes_device *nesdev ; struct nes_vnic_mgt *mgtvnic ; struct nes_vnic_mgt *first_mgtvnic ; unsigned long flags ; struct nes_hw_cqp_wqe *cqp_wqe ; u32 cqp_head ; struct sk_buff *rx_skb ; int i ; int ret ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp ; bool __cond ; bool __cond___0 ; { nesdev = nesvnic->nesdev; kthread_stop(nesvnic->mgt_thread); first_mgtvnic = nesvnic->mgtvnic[0]; i = 0; goto ldv_61249; ldv_61248: mgtvnic = nesvnic->mgtvnic[i]; if ((unsigned long )mgtvnic == (unsigned long )((struct nes_vnic_mgt *)0)) { goto ldv_61230; } else { } goto ldv_61232; ldv_61231: rx_skb = mgtvnic->mgt.rx_skb[(int )mgtvnic->mgt.rq_tail]; nes_mgt_free_skb(nesdev, rx_skb, 2U); mgtvnic->mgt.rq_tail = (u16 )((int )mgtvnic->mgt.rq_tail + 1); mgtvnic->mgt.rq_tail = (u16 )((int )((short )mgtvnic->mgt.rq_tail) & (int )((short )((unsigned int )mgtvnic->mgt.rq_size + 65535U))); ldv_61232: ; if ((int )mgtvnic->mgt.rq_head != (int )mgtvnic->mgt.rq_tail) { goto ldv_61231; } else { } ldv_spin_lock(); cqp_head = (u32 )nesdev->cqp.sq_head; cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, 327682U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (u32 )mgtvnic->mgt.qp_id); cqp_head = cqp_head + 1U; if (cqp_head >= (u32 )nesdev->cqp.sq_size) { cqp_head = 0U; } else { } cqp_wqe = nesdev->cqp.sq_vbase + (unsigned long )cqp_head; nes_fill_init_cqp_wqe(cqp_wqe, nesdev); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 0U, ((unsigned int )mgtvnic->mgt_cq.cq_size << 16) | 5U); set_wqe_32bit_value((__le32 *)(& cqp_wqe->wqe_words), 1U, (unsigned int )mgtvnic->mgt_cq.cq_number | ((unsigned int )nesdev->ceq_index << 16)); cqp_head = cqp_head + 1U; if (cqp_head >= (u32 )nesdev->cqp.sq_size) { cqp_head = 0U; } else { } nesdev->cqp.sq_head = (u16 )cqp_head; __asm__ volatile ("": : : "memory"); nes_write32(nesdev->regs + 64UL, (u32 )((int )nesdev->cqp.qp_id | 41943040)); spin_unlock_irqrestore(& nesdev->cqp.lock, flags); if ((nes_debug_level & 524288U) != 0U) { printk("\viw_nes: %s[%u]: Waiting for CQP, cqp_head=%u, cqp.sq_head=%u, cqp.sq_tail=%u, cqp.sq_size=%u\n", "nes_destroy_mgt", 1137, cqp_head, (int )nesdev->cqp.sq_head, (int )nesdev->cqp.sq_tail, (int )nesdev->cqp.sq_size); } else { } __ret = 1200000L; __might_sleep("/home/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--43_2a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/678/dscv_tempdir/dscv/ri/43_2a/drivers/infiniband/hw/nes/nes_mgt.c", 1140, 0); __cond___0 = (u32 )nesdev->cqp.sq_tail == cqp_head; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 1200000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61245: tmp = prepare_to_wait_event(& nesdev->cqp.waitq, & __wait, 2); __int = tmp; __cond = (u32 )nesdev->cqp.sq_tail == cqp_head; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61244; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61245; ldv_61244: finish_wait(& nesdev->cqp.waitq, & __wait); __ret = __ret___0; } else { } ret = (int )__ret; if ((nes_debug_level & 524288U) != 0U) { printk("\viw_nes: %s[%u]: Destroy MGT QP returned, wait_event_timeout ret = %u, cqp_head=%u, cqp.sq_head=%u, cqp.sq_tail=%u\n", "nes_destroy_mgt", 1144, ret, cqp_head, (int )nesdev->cqp.sq_head, (int )nesdev->cqp.sq_tail); } else { } if (ret == 0) { if ((nes_debug_level & 524288U) != 0U) { printk("\viw_nes: %s[%u]: MGT QP%u destroy timeout expired\n", "nes_destroy_mgt", 1147, (int )mgtvnic->mgt.qp_id); } else { } } else { } nesvnic->mgtvnic[i] = (struct nes_vnic_mgt *)0; ldv_61230: i = i + 1; ldv_61249: ; if (i <= 3) { goto ldv_61248; } else { } if ((unsigned long )nesvnic->mgt_vbase != (unsigned long )((void *)0)) { pci_free_consistent(nesdev->pcidev, (size_t )nesvnic->mgt_mem_size, nesvnic->mgt_vbase, nesvnic->mgt_pbase); nesvnic->mgt_vbase = (void *)0; nesvnic->mgt_pbase = 0ULL; } else { } kfree((void const *)first_mgtvnic); return; } } void disable_suitable_timer_11(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_11) { ldv_timer_state_11 = 0; return; } else { } return; } } void choose_timer_11(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_11 = 2; return; } } int reg_timer_11(struct timer_list *timer ) { { ldv_timer_list_11 = timer; ldv_timer_state_11 = 1; return (0); } } void activate_pending_timer_11(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_11 == (unsigned long )timer) { if (ldv_timer_state_11 == 2 || pending_flag != 0) { ldv_timer_list_11 = timer; ldv_timer_list_11->data = data; ldv_timer_state_11 = 1; } else { } return; } else { } reg_timer_11(timer); ldv_timer_list_11->data = data; return; } } bool ldv_queue_work_on_345(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_346(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_347(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___4 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_348(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_349(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___5 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void *ldv_kmem_cache_alloc_355(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } int ldv_pskb_expand_head_361(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_363(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv_skb_copy_365(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_366(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_367(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } struct sk_buff *ldv___netdev_alloc_skb_368(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } int ldv_pskb_expand_head_369(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } int ldv_pskb_expand_head_370(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((int )((long )tmp)); } } struct sk_buff *ldv_skb_clone_371(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return ((struct sk_buff *)tmp); } } void *ldv_kmem_cache_alloc_372(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_undef_ptr(); return (tmp); } } __inline static void ldv_error(void) { { ERROR: ; __VERIFIER_error(); } } bool ldv_is_err(void const *ptr ) { { return ((unsigned long )ptr > 2012UL); } } void *ldv_err_ptr(long error ) { { return ((void *)(2012L - error)); } } long ldv_ptr_err(void const *ptr ) { { return ((long )(2012UL - (unsigned long )ptr)); } } bool ldv_is_err_or_null(void const *ptr ) { bool tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { tmp = ldv_is_err(ptr); if ((int )tmp) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((bool )tmp___0); } } int ldv_spin = 0; void ldv_check_alloc_flags(gfp_t flags ) { { if (ldv_spin != 0 && (flags & 16U) != 0U) { ldv_error(); } else { } return; } } extern struct page *ldv_some_page(void) ; struct page *ldv_check_alloc_flags_and_return_some_page(gfp_t flags ) { struct page *tmp ; { if (ldv_spin != 0 && (flags & 16U) != 0U) { ldv_error(); } else { } tmp = ldv_some_page(); return (tmp); } } void ldv_check_alloc_nonatomic(void) { { if (ldv_spin != 0) { ldv_error(); } else { } return; } } void ldv_spin_lock(void) { { ldv_spin = 1; return; } } void ldv_spin_unlock(void) { { ldv_spin = 0; return; } } int ldv_spin_trylock(void) { int is_lock ; { is_lock = ldv_undef_int(); if (is_lock != 0) { return (0); } else { ldv_spin = 1; return (1); } } }