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 long long __s64; 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 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 __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 unsigned int uint; 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 * ) ; }; typedef u64 cycle_t; 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; enum system_states { SYSTEM_BOOTING = 0, SYSTEM_RUNNING = 1, SYSTEM_HALT = 2, SYSTEM_POWER_OFF = 3, SYSTEM_RESTART = 4 } ; 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; typedef int pao_T__; typedef int pao_T_____0; struct lockdep_map; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; }; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; struct lock_class { struct list_head hash_entry ; struct list_head lock_entry ; struct lockdep_subclass_key *key ; unsigned int subclass ; unsigned int dep_gen_id ; unsigned long usage_mask ; struct stack_trace usage_traces[13U] ; struct list_head locks_after ; struct list_head locks_before ; unsigned int version ; unsigned long ops ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache[2U] ; char const *name ; int cpu ; unsigned long ip ; }; struct held_lock { u64 prev_chain_key ; unsigned long acquire_ip ; struct lockdep_map *instance ; struct lockdep_map *nest_lock ; u64 waittime_stamp ; u64 holdtime_stamp ; unsigned short class_idx : 13 ; unsigned char irq_context : 2 ; unsigned char trylock : 1 ; unsigned char read : 2 ; unsigned char check : 1 ; unsigned char hardirqs_off : 1 ; unsigned short references : 12 ; unsigned int pin_count ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct____missing_field_name_35 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion____missing_field_name_34 { struct raw_spinlock rlock ; struct __anonstruct____missing_field_name_35 __annonCompField17 ; }; struct spinlock { union __anonunion____missing_field_name_34 __annonCompField18 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_36 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_36 rwlock_t; struct seqcount { unsigned int sequence ; struct lockdep_map dep_map ; }; typedef struct seqcount seqcount_t; struct __anonstruct_seqlock_t_45 { struct seqcount seqcount ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_45 seqlock_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct user_namespace; struct __anonstruct_kuid_t_46 { uid_t val ; }; typedef struct __anonstruct_kuid_t_46 kuid_t; struct __anonstruct_kgid_t_47 { gid_t val ; }; typedef struct __anonstruct_kgid_t_47 kgid_t; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; kuid_t uid ; kgid_t gid ; dev_t rdev ; loff_t size ; struct timespec atime ; struct timespec mtime ; struct timespec ctime ; unsigned long blksize ; unsigned long long blocks ; }; struct vm_area_struct; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct __anonstruct_nodemask_t_48 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_48 nodemask_t; struct optimistic_spin_queue { atomic_t tail ; }; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct rw_semaphore; struct rw_semaphore { long count ; struct list_head wait_list ; raw_spinlock_t wait_lock ; struct optimistic_spin_queue osq ; struct task_struct *owner ; struct lockdep_map dep_map ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; enum tk_offsets { TK_OFFS_REAL = 0, TK_OFFS_BOOT = 1, TK_OFFS_TAI = 2, TK_OFFS_MAX = 3 } ; struct notifier_block; struct timer_list { struct hlist_node entry ; unsigned long expires ; void (*function)(unsigned long ) ; unsigned long data ; u32 flags ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; struct rb_node { unsigned long __rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; }; struct rb_root { struct rb_node *rb_node ; }; struct ctl_table; struct nsproxy; struct ctl_table_root; struct ctl_table_header; struct ctl_dir; typedef int proc_handler(struct ctl_table * , int , void * , size_t * , loff_t * ); struct ctl_table_poll { atomic_t event ; wait_queue_head_t wait ; }; struct ctl_table { char const *procname ; void *data ; int maxlen ; umode_t mode ; struct ctl_table *child ; proc_handler *proc_handler ; struct ctl_table_poll *poll ; void *extra1 ; void *extra2 ; }; struct ctl_node { struct rb_node node ; struct ctl_table_header *header ; }; struct __anonstruct____missing_field_name_50 { struct ctl_table *ctl_table ; int used ; int count ; int nreg ; }; union __anonunion____missing_field_name_49 { struct __anonstruct____missing_field_name_50 __annonCompField19 ; struct callback_head rcu ; }; struct ctl_table_set; struct ctl_table_header { union __anonunion____missing_field_name_49 __annonCompField20 ; struct completion *unregistering ; struct ctl_table *ctl_table_arg ; struct ctl_table_root *root ; struct ctl_table_set *set ; struct ctl_dir *parent ; struct ctl_node *node ; }; struct ctl_dir { struct ctl_table_header header ; struct rb_root root ; }; struct ctl_table_set { int (*is_seen)(struct ctl_table_set * ) ; struct ctl_dir dir ; }; struct ctl_table_root { struct ctl_table_set default_set ; struct ctl_table_set *(*lookup)(struct ctl_table_root * , struct nsproxy * ) ; int (*permissions)(struct ctl_table_header * , struct ctl_table * ) ; }; struct workqueue_struct; struct work_struct; struct work_struct { atomic_long_t data ; struct list_head entry ; void (*func)(struct work_struct * ) ; struct lockdep_map lockdep_map ; }; struct delayed_work { struct work_struct work ; struct timer_list timer ; struct workqueue_struct *wq ; int cpu ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct 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 link_vars; struct ethtool_channels; struct bnx2x_phy; struct ethtool_ringparam; struct link_params; struct ethtool_wolinfo; struct ethtool_rxnfc; struct bnx2x; struct ethtool_cmd; struct ethtool_eee; struct ethtool_pauseparam; struct ethtool_eeprom; struct ethtool_coalesce; struct ethtool_dump; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct path; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; size_t pad_until ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; struct user_namespace *user_ns ; void *private ; }; struct seq_operations { void *(*start)(struct seq_file * , loff_t * ) ; void (*stop)(struct seq_file * , void * ) ; void *(*next)(struct seq_file * , void * , loff_t * ) ; int (*show)(struct seq_file * , void * ) ; }; struct pinctrl; struct pinctrl_state; struct dev_pin_info { struct pinctrl *p ; struct pinctrl_state *default_state ; struct pinctrl_state *sleep_state ; struct pinctrl_state *idle_state ; }; struct dma_map_ops; struct dev_archdata { struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct device_driver; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct fwnode_handle; struct iommu_ops; struct iommu_group; struct device_attribute; struct bus_type { char const *name ; char const *dev_name ; struct device *dev_root ; struct device_attribute *dev_attrs ; struct attribute_group const **bus_groups ; struct attribute_group const **dev_groups ; struct attribute_group const **drv_groups ; int (*match)(struct device * , struct device_driver * ) ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*online)(struct device * ) ; int (*offline)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct dev_pm_ops const *pm ; struct iommu_ops const *iommu_ops ; struct subsys_private *p ; struct lock_class_key lock_key ; }; struct device_type; enum probe_type { PROBE_DEFAULT_STRATEGY = 0, PROBE_PREFER_ASYNCHRONOUS = 1, PROBE_FORCE_SYNCHRONOUS = 2 } ; struct of_device_id; struct acpi_device_id; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; enum probe_type probe_type ; struct of_device_id const *of_match_table ; struct acpi_device_id const *acpi_match_table ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct attribute_group const **groups ; struct dev_pm_ops const *pm ; struct driver_private *p ; }; struct class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct attribute_group const **dev_groups ; struct kobject *dev_kobj ; int (*dev_uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * ) ; void (*class_release)(struct class * ) ; void (*dev_release)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct kobj_ns_type_operations const *ns_type ; void const *(*namespace)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class * , struct class_attribute * , char * ) ; ssize_t (*store)(struct class * , struct class_attribute * , char const * , size_t ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * , kuid_t * , kgid_t * ) ; void (*release)(struct device * ) ; struct dev_pm_ops const *pm ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device * , struct device_attribute * , char * ) ; ssize_t (*store)(struct device * , struct device_attribute * , char const * , size_t ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct dma_coherent_mem; struct cma; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; void *driver_data ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; struct dev_pin_info *pins ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; unsigned long dma_pfn_offset ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct cma *cma_area ; struct dev_archdata archdata ; struct device_node *of_node ; struct fwnode_handle *fwnode ; dev_t devt ; u32 id ; spinlock_t devres_lock ; struct list_head devres_head ; struct klist_node knode_class ; struct class *class ; struct attribute_group const **groups ; void (*release)(struct device * ) ; struct iommu_group *iommu_group ; bool offline_disabled ; bool offline ; }; struct wakeup_source { char const *name ; struct list_head entry ; spinlock_t lock ; struct wake_irq *wakeirq ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active ; bool autosleep_enabled ; }; struct proc_dir_entry; struct exception_table_entry { int insn ; int fixup ; }; struct tasklet_struct { struct tasklet_struct *next ; unsigned long state ; atomic_t count ; void (*func)(unsigned long ) ; unsigned long data ; }; 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 ; }; 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; enum pcie_link_width { PCIE_LNK_WIDTH_RESRV = 0, PCIE_LNK_X1 = 1, PCIE_LNK_X2 = 2, PCIE_LNK_X4 = 4, PCIE_LNK_X8 = 8, PCIE_LNK_X12 = 12, PCIE_LNK_X16 = 16, PCIE_LNK_X32 = 32, PCIE_LNK_WIDTH_UNKNOWN = 255 } ; enum pci_bus_speed { PCI_SPEED_33MHz = 0, PCI_SPEED_66MHz = 1, PCI_SPEED_66MHz_PCIX = 2, PCI_SPEED_100MHz_PCIX = 3, PCI_SPEED_133MHz_PCIX = 4, PCI_SPEED_66MHz_PCIX_ECC = 5, PCI_SPEED_100MHz_PCIX_ECC = 6, PCI_SPEED_133MHz_PCIX_ECC = 7, PCI_SPEED_66MHz_PCIX_266 = 9, PCI_SPEED_100MHz_PCIX_266 = 10, PCI_SPEED_133MHz_PCIX_266 = 11, AGP_UNKNOWN = 12, AGP_1X = 13, AGP_2X = 14, AGP_4X = 15, AGP_8X = 16, PCI_SPEED_66MHz_PCIX_533 = 17, PCI_SPEED_100MHz_PCIX_533 = 18, PCI_SPEED_133MHz_PCIX_533 = 19, PCIE_SPEED_2_5GT = 20, PCIE_SPEED_5_0GT = 21, PCIE_SPEED_8_0GT = 22, PCI_SPEED_UNKNOWN = 255 } ; struct pcie_link_state; struct pci_vpd; struct pci_sriov; struct pci_ats; struct pci_driver; union __anonunion____missing_field_name_228 { 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_228 __annonCompField65 ; 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 shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; int nid ; struct mem_cgroup *memcg ; }; struct shrinker { unsigned long (*count_objects)(struct shrinker * , struct shrink_control * ) ; unsigned long (*scan_objects)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; unsigned long flags ; struct list_head list ; atomic_long_t *nr_deferred ; }; struct file_ra_state; struct writeback_control; struct bdi_writeback; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *cow_page ; struct page *page ; unsigned long max_pgoff ; pte_t *pte ; }; struct vm_operations_struct { void (*open)(struct vm_area_struct * ) ; void (*close)(struct vm_area_struct * ) ; int (*fault)(struct vm_area_struct * , struct vm_fault * ) ; void (*map_pages)(struct vm_area_struct * , struct vm_fault * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*pfn_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; char const *(*name)(struct vm_area_struct * ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; struct page *(*find_special_page)(struct vm_area_struct * , unsigned long ) ; }; struct kvec; struct scatterlist { unsigned long sg_magic ; unsigned long page_link ; unsigned int offset ; unsigned int length ; dma_addr_t dma_address ; unsigned int dma_length ; }; struct sg_table { struct scatterlist *sgl ; unsigned int nents ; unsigned int orig_nents ; }; struct msix_entry { u32 vector ; u16 entry ; }; 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 ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct kvec { void *iov_base ; size_t iov_len ; }; union __anonunion____missing_field_name_229 { 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_229 __annonCompField66 ; unsigned long nr_segs ; }; 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; 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_231 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_231 sync_serial_settings; struct __anonstruct_te1_settings_232 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_232 te1_settings; struct __anonstruct_raw_hdlc_proto_233 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_233 raw_hdlc_proto; struct __anonstruct_fr_proto_234 { 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_234 fr_proto; struct __anonstruct_fr_proto_pvc_235 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_235 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_236 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_236 fr_proto_pvc_info; struct __anonstruct_cisco_proto_237 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_237 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_238 { 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_238 ifs_ifsu ; }; union __anonunion_ifr_ifrn_239 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_240 { 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_239 ifr_ifrn ; union __anonunion_ifr_ifru_240 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_245 { spinlock_t lock ; int count ; }; union __anonunion____missing_field_name_244 { struct __anonstruct____missing_field_name_245 __annonCompField67 ; }; struct lockref { union __anonunion____missing_field_name_244 __annonCompField68 ; }; struct vfsmount; struct __anonstruct____missing_field_name_247 { u32 hash ; u32 len ; }; union __anonunion____missing_field_name_246 { struct __anonstruct____missing_field_name_247 __annonCompField69 ; u64 hash_len ; }; struct qstr { union __anonunion____missing_field_name_246 __annonCompField70 ; unsigned char const *name ; }; struct dentry_operations; union __anonunion_d_u_248 { 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_248 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_252 { struct radix_tree_node *parent ; void *private_data ; }; union __anonunion____missing_field_name_251 { struct __anonstruct____missing_field_name_252 __annonCompField71 ; struct callback_head callback_head ; }; struct radix_tree_node { unsigned int path ; unsigned int count ; union __anonunion____missing_field_name_251 __annonCompField72 ; 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 semaphore { raw_spinlock_t lock ; unsigned int count ; struct list_head wait_list ; }; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct block_device; struct 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_256 { projid_t val ; }; typedef struct __anonstruct_kprojid_t_256 kprojid_t; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion____missing_field_name_257 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion____missing_field_name_257 __annonCompField74 ; 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_260 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion____missing_field_name_261 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock_context; struct cdev; union __anonunion____missing_field_name_262 { 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_260 __annonCompField75 ; 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_261 __annonCompField76 ; 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_262 __annonCompField77 ; __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_263 { struct llist_node fu_llist ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_263 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_265 { struct list_head link ; int state ; }; union __anonunion_fl_u_264 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_265 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_264 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_26355 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_26355 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 in6_addr; struct sk_buff; typedef u64 netdev_features_t; union __anonunion_in6_u_280 { __u8 u6_addr8[16U] ; __be16 u6_addr16[8U] ; __be32 u6_addr32[4U] ; }; struct in6_addr { union __anonunion_in6_u_280 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_285 { struct net_device *physoutdev ; char neigh_header[8U] ; }; union __anonunion____missing_field_name_286 { __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_285 __annonCompField81 ; union __anonunion____missing_field_name_286 __annonCompField82 ; }; struct sk_buff_head { struct sk_buff *next ; struct sk_buff *prev ; __u32 qlen ; spinlock_t lock ; }; struct skb_frag_struct; typedef struct skb_frag_struct skb_frag_t; struct __anonstruct_page_287 { struct page *p ; }; struct skb_frag_struct { struct __anonstruct_page_287 page ; __u32 page_offset ; __u32 size ; }; struct skb_shared_hwtstamps { ktime_t hwtstamp ; }; struct skb_shared_info { unsigned char nr_frags ; __u8 tx_flags ; unsigned short gso_size ; unsigned short gso_segs ; unsigned short gso_type ; struct sk_buff *frag_list ; struct skb_shared_hwtstamps hwtstamps ; u32 tskey ; __be32 ip6_frag_id ; atomic_t dataref ; void *destructor_arg ; skb_frag_t frags[17U] ; }; typedef unsigned int sk_buff_data_t; struct __anonstruct____missing_field_name_289 { u32 stamp_us ; u32 stamp_jiffies ; }; union __anonunion____missing_field_name_288 { u64 v64 ; struct __anonstruct____missing_field_name_289 __annonCompField83 ; }; struct skb_mstamp { union __anonunion____missing_field_name_288 __annonCompField84 ; }; union __anonunion____missing_field_name_292 { ktime_t tstamp ; struct skb_mstamp skb_mstamp ; }; struct __anonstruct____missing_field_name_291 { struct sk_buff *next ; struct sk_buff *prev ; union __anonunion____missing_field_name_292 __annonCompField85 ; }; union __anonunion____missing_field_name_290 { struct __anonstruct____missing_field_name_291 __annonCompField86 ; struct rb_node rbnode ; }; struct sec_path; struct __anonstruct____missing_field_name_294 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion____missing_field_name_293 { __wsum csum ; struct __anonstruct____missing_field_name_294 __annonCompField88 ; }; union __anonunion____missing_field_name_295 { unsigned int napi_id ; unsigned int sender_cpu ; }; union __anonunion____missing_field_name_296 { __u32 mark ; __u32 reserved_tailroom ; }; union __anonunion____missing_field_name_297 { __be16 inner_protocol ; __u8 inner_ipproto ; }; struct sk_buff { union __anonunion____missing_field_name_290 __annonCompField87 ; 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_293 __annonCompField89 ; __u32 priority ; int skb_iif ; __u32 hash ; __be16 vlan_proto ; __u16 vlan_tci ; union __anonunion____missing_field_name_295 __annonCompField90 ; __u32 secmark ; union __anonunion____missing_field_name_296 __annonCompField91 ; union __anonunion____missing_field_name_297 __annonCompField92 ; __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; enum pkt_hash_types { PKT_HASH_TYPE_NONE = 0, PKT_HASH_TYPE_L2 = 1, PKT_HASH_TYPE_L3 = 2, PKT_HASH_TYPE_L4 = 3 } ; struct ethtool_cmd { __u32 cmd ; __u32 supported ; __u32 advertising ; __u16 speed ; __u8 duplex ; __u8 port ; __u8 phy_address ; __u8 transceiver ; __u8 autoneg ; __u8 mdio_support ; __u32 maxtxpkt ; __u32 maxrxpkt ; __u16 speed_hi ; __u8 eth_tp_mdix ; __u8 eth_tp_mdix_ctrl ; __u32 lp_advertising ; __u32 reserved[2U] ; }; struct ethtool_drvinfo { __u32 cmd ; char driver[32U] ; char version[32U] ; char fw_version[32U] ; char bus_info[32U] ; char erom_version[32U] ; char reserved2[12U] ; __u32 n_priv_flags ; __u32 n_stats ; __u32 testinfo_len ; __u32 eedump_len ; __u32 regdump_len ; }; struct ethtool_wolinfo { __u32 cmd ; __u32 supported ; __u32 wolopts ; __u8 sopass[6U] ; }; struct ethtool_tunable { __u32 cmd ; __u32 id ; __u32 type_id ; __u32 len ; void *data[0U] ; }; struct ethtool_regs { __u32 cmd ; __u32 version ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eeprom { __u32 cmd ; __u32 magic ; __u32 offset ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eee { __u32 cmd ; __u32 supported ; __u32 advertised ; __u32 lp_advertised ; __u32 eee_active ; __u32 eee_enabled ; __u32 tx_lpi_enabled ; __u32 tx_lpi_timer ; __u32 reserved[2U] ; }; struct ethtool_modinfo { __u32 cmd ; __u32 type ; __u32 eeprom_len ; __u32 reserved[8U] ; }; struct ethtool_coalesce { __u32 cmd ; __u32 rx_coalesce_usecs ; __u32 rx_max_coalesced_frames ; __u32 rx_coalesce_usecs_irq ; __u32 rx_max_coalesced_frames_irq ; __u32 tx_coalesce_usecs ; __u32 tx_max_coalesced_frames ; __u32 tx_coalesce_usecs_irq ; __u32 tx_max_coalesced_frames_irq ; __u32 stats_block_coalesce_usecs ; __u32 use_adaptive_rx_coalesce ; __u32 use_adaptive_tx_coalesce ; __u32 pkt_rate_low ; __u32 rx_coalesce_usecs_low ; __u32 rx_max_coalesced_frames_low ; __u32 tx_coalesce_usecs_low ; __u32 tx_max_coalesced_frames_low ; __u32 pkt_rate_high ; __u32 rx_coalesce_usecs_high ; __u32 rx_max_coalesced_frames_high ; __u32 tx_coalesce_usecs_high ; __u32 tx_max_coalesced_frames_high ; __u32 rate_sample_interval ; }; struct ethtool_ringparam { __u32 cmd ; __u32 rx_max_pending ; __u32 rx_mini_max_pending ; __u32 rx_jumbo_max_pending ; __u32 tx_max_pending ; __u32 rx_pending ; __u32 rx_mini_pending ; __u32 rx_jumbo_pending ; __u32 tx_pending ; }; struct ethtool_channels { __u32 cmd ; __u32 max_rx ; __u32 max_tx ; __u32 max_other ; __u32 max_combined ; __u32 rx_count ; __u32 tx_count ; __u32 other_count ; __u32 combined_count ; }; struct ethtool_pauseparam { __u32 cmd ; __u32 autoneg ; __u32 rx_pause ; __u32 tx_pause ; }; struct ethtool_test { __u32 cmd ; __u32 flags ; __u32 reserved ; __u32 len ; __u64 data[0U] ; }; struct ethtool_stats { __u32 cmd ; __u32 n_stats ; __u64 data[0U] ; }; struct ethtool_tcpip4_spec { __be32 ip4src ; __be32 ip4dst ; __be16 psrc ; __be16 pdst ; __u8 tos ; }; struct ethtool_ah_espip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 spi ; __u8 tos ; }; struct ethtool_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union ethtool_flow_union { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[52U] ; }; struct ethtool_flow_ext { __u8 padding[2U] ; unsigned char h_dest[6U] ; __be16 vlan_etype ; __be16 vlan_tci ; __be32 data[2U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union ethtool_flow_union h_u ; struct ethtool_flow_ext h_ext ; union ethtool_flow_union m_u ; struct ethtool_flow_ext m_ext ; __u64 ring_cookie ; __u32 location ; }; struct ethtool_rxnfc { __u32 cmd ; __u32 flow_type ; __u64 data ; struct ethtool_rx_flow_spec fs ; __u32 rule_cnt ; __u32 rule_locs[0U] ; }; struct ethtool_flash { __u32 cmd ; __u32 region ; char data[128U] ; }; struct ethtool_dump { __u32 cmd ; __u32 version ; __u32 flag ; __u32 len ; __u8 data[0U] ; }; struct ethtool_ts_info { __u32 cmd ; __u32 so_timestamping ; __s32 phc_index ; __u32 tx_types ; __u32 tx_reserved[3U] ; __u32 rx_filters ; __u32 rx_reserved[3U] ; }; enum ethtool_phys_id_state { ETHTOOL_ID_INACTIVE = 0, ETHTOOL_ID_ACTIVE = 1, ETHTOOL_ID_ON = 2, ETHTOOL_ID_OFF = 3 } ; struct ethtool_ops { int (*get_settings)(struct net_device * , struct ethtool_cmd * ) ; int (*set_settings)(struct net_device * , struct ethtool_cmd * ) ; void (*get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) ; int (*get_regs_len)(struct net_device * ) ; void (*get_regs)(struct net_device * , struct ethtool_regs * , void * ) ; void (*get_wol)(struct net_device * , struct ethtool_wolinfo * ) ; int (*set_wol)(struct net_device * , struct ethtool_wolinfo * ) ; u32 (*get_msglevel)(struct net_device * ) ; void (*set_msglevel)(struct net_device * , u32 ) ; int (*nway_reset)(struct net_device * ) ; u32 (*get_link)(struct net_device * ) ; int (*get_eeprom_len)(struct net_device * ) ; int (*get_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; int (*set_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*get_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*set_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; void (*get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; int (*set_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; void (*self_test)(struct net_device * , struct ethtool_test * , u64 * ) ; void (*get_strings)(struct net_device * , u32 , u8 * ) ; int (*set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) ; void (*get_ethtool_stats)(struct net_device * , struct ethtool_stats * , u64 * ) ; int (*begin)(struct net_device * ) ; void (*complete)(struct net_device * ) ; u32 (*get_priv_flags)(struct net_device * ) ; int (*set_priv_flags)(struct net_device * , u32 ) ; int (*get_sset_count)(struct net_device * , int ) ; int (*get_rxnfc)(struct net_device * , struct ethtool_rxnfc * , u32 * ) ; int (*set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*flash_device)(struct net_device * , struct ethtool_flash * ) ; int (*reset)(struct net_device * , u32 * ) ; u32 (*get_rxfh_key_size)(struct net_device * ) ; u32 (*get_rxfh_indir_size)(struct net_device * ) ; int (*get_rxfh)(struct net_device * , u32 * , u8 * , u8 * ) ; int (*set_rxfh)(struct net_device * , u32 const * , u8 const * , u8 const ) ; void (*get_channels)(struct net_device * , struct ethtool_channels * ) ; int (*set_channels)(struct net_device * , struct ethtool_channels * ) ; int (*get_dump_flag)(struct net_device * , struct ethtool_dump * ) ; int (*get_dump_data)(struct net_device * , struct ethtool_dump * , void * ) ; int (*set_dump)(struct net_device * , struct ethtool_dump * ) ; int (*get_ts_info)(struct net_device * , struct ethtool_ts_info * ) ; int (*get_module_info)(struct net_device * , struct ethtool_modinfo * ) ; int (*get_module_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_eee)(struct net_device * , struct ethtool_eee * ) ; int (*set_eee)(struct net_device * , struct ethtool_eee * ) ; int (*get_tunable)(struct net_device * , struct ethtool_tunable const * , void * ) ; int (*set_tunable)(struct net_device * , struct ethtool_tunable const * , void const * ) ; }; struct prot_inuse; struct netns_core { struct ctl_table_header *sysctl_hdr ; int sysctl_somaxconn ; struct prot_inuse *inuse ; }; struct u64_stats_sync { }; struct ipstats_mib { u64 mibs[36U] ; struct u64_stats_sync syncp ; }; struct icmp_mib { unsigned long mibs[28U] ; }; struct icmpmsg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[6U] ; }; struct 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 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 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_306 { struct net *net ; }; typedef struct __anonstruct_possible_net_t_306 possible_net_t; 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 ; }; struct mii_ioctl_data { __u16 phy_id ; __u16 reg_num ; __u16 val_in ; __u16 val_out ; }; enum ldv_28584 { 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_28584 phy_interface_t; enum ldv_28638 { 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_28638 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 { 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 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_316 { struct list_head upper ; struct list_head lower ; }; struct __anonstruct_all_adj_list_317 { 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_318 { 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_316 adj_list ; struct __anonstruct_all_adj_list_317 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_318 __annonCompField95 ; struct garp_port *garp_port ; struct mrp_port *mrp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct attribute_group const *sysfs_rx_queue_group ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned int gso_max_size ; u16 gso_max_segs ; u16 gso_min_segs ; struct dcbnl_rtnl_ops const *dcbnl_ops ; u8 num_tc ; struct netdev_tc_txq tc_to_txq[16U] ; u8 prio_tc_map[16U] ; unsigned int fcoe_ddp_xid ; struct netprio_map *priomap ; struct phy_device *phydev ; struct lock_class_key *qdisc_tx_busylock ; }; struct packet_type { __be16 type ; struct net_device *dev ; int (*func)(struct sk_buff * , struct net_device * , struct packet_type * , struct net_device * ) ; bool (*id_match)(struct packet_type * , struct sock * ) ; void *af_packet_priv ; struct list_head list ; }; struct pcpu_sw_netstats { u64 rx_packets ; u64 rx_bytes ; u64 tx_packets ; u64 tx_bytes ; struct u64_stats_sync syncp ; }; enum skb_free_reason { SKB_REASON_CONSUMED = 0, SKB_REASON_DROPPED = 1 } ; struct vlan_hdr { __be16 h_vlan_TCI ; __be16 h_vlan_encapsulated_proto ; }; struct vlan_ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_vlan_proto ; __be16 h_vlan_TCI ; __be16 h_vlan_encapsulated_proto ; }; struct pidmap { atomic_t nr_free ; void *page ; }; struct fs_pin; struct pid_namespace { struct kref kref ; struct pidmap pidmap[128U] ; struct callback_head rcu ; int last_pid ; unsigned int nr_hashed ; struct task_struct *child_reaper ; struct kmem_cache *pid_cachep ; unsigned int level ; struct pid_namespace *parent ; struct vfsmount *proc_mnt ; struct dentry *proc_self ; struct dentry *proc_thread_self ; struct fs_pin *bacct ; struct user_namespace *user_ns ; struct work_struct proc_work ; kgid_t pid_gid ; int hide_pid ; int reboot ; struct ns_common ns ; }; 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 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_342 { 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_342 __annonCompField101 ; }; 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_350 { 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_350 __annonCompField102 ; }; struct hwtstamp_config { int flags ; int tx_type ; int rx_filter ; }; struct __anonstruct_socket_lock_t_351 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_351 socket_lock_t; struct proto; typedef __u32 __portpair; typedef __u64 __addrpair; struct __anonstruct____missing_field_name_353 { __be32 skc_daddr ; __be32 skc_rcv_saddr ; }; union __anonunion____missing_field_name_352 { __addrpair skc_addrpair ; struct __anonstruct____missing_field_name_353 __annonCompField103 ; }; union __anonunion____missing_field_name_354 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; struct __anonstruct____missing_field_name_356 { __be16 skc_dport ; __u16 skc_num ; }; union __anonunion____missing_field_name_355 { __portpair skc_portpair ; struct __anonstruct____missing_field_name_356 __annonCompField106 ; }; union __anonunion____missing_field_name_357 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; union __anonunion____missing_field_name_358 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; struct sock_common { union __anonunion____missing_field_name_352 __annonCompField104 ; union __anonunion____missing_field_name_354 __annonCompField105 ; union __anonunion____missing_field_name_355 __annonCompField107 ; 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_357 __annonCompField108 ; 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_358 __annonCompField109 ; int skc_tx_queue_mapping ; atomic_t skc_refcnt ; int skc_dontcopy_end[0U] ; }; struct cg_proto; struct __anonstruct_sk_backlog_359 { 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_359 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_362 { 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_362 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 ipv6hdr { unsigned char priority : 4 ; unsigned char version : 4 ; __u8 flow_lbl[3U] ; __be16 payload_len ; __u8 nexthdr ; __u8 hop_limit ; struct in6_addr saddr ; struct in6_addr daddr ; }; struct 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 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 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_382 { __be32 a4 ; __be32 a6[4U] ; struct in6_addr in6 ; }; struct inetpeer_addr_base { union __anonunion____missing_field_name_382 __annonCompField111 ; }; struct inetpeer_addr { struct inetpeer_addr_base addr ; __u16 family ; }; union __anonunion____missing_field_name_383 { struct list_head gc_list ; struct callback_head gc_rcu ; }; struct __anonstruct____missing_field_name_385 { atomic_t rid ; }; union __anonunion____missing_field_name_384 { struct __anonstruct____missing_field_name_385 __annonCompField113 ; 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_383 __annonCompField112 ; union __anonunion____missing_field_name_384 __annonCompField114 ; __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 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] ; }; typedef unsigned char Byte; typedef unsigned long uLong; struct internal_state; struct z_stream_s { Byte const *next_in ; uLong avail_in ; uLong total_in ; Byte *next_out ; uLong avail_out ; uLong total_out ; char *msg ; struct internal_state *state ; void *workspace ; int data_type ; uLong adler ; uLong reserved ; }; typedef struct z_stream_s z_stream; typedef z_stream *z_streamp; struct internal_state { int dummy ; }; struct cdev { struct kobject kobj ; struct module *owner ; struct file_operations const *ops ; struct list_head list ; dev_t dev ; unsigned int count ; }; struct ptp_clock_time { __s64 sec ; __u32 nsec ; __u32 reserved ; }; struct ptp_extts_request { unsigned int index ; unsigned int flags ; unsigned int rsv[2U] ; }; struct ptp_perout_request { struct ptp_clock_time start ; struct ptp_clock_time period ; unsigned int index ; unsigned int flags ; unsigned int rsv[4U] ; }; enum ptp_pin_function { PTP_PF_NONE = 0, PTP_PF_EXTTS = 1, PTP_PF_PEROUT = 2, PTP_PF_PHYSYNC = 3 } ; struct ptp_pin_desc { char name[64U] ; unsigned int index ; unsigned int func ; unsigned int chan ; unsigned int rsv[5U] ; }; enum ldv_37637 { PTP_CLK_REQ_EXTTS = 0, PTP_CLK_REQ_PEROUT = 1, PTP_CLK_REQ_PPS = 2 } ; union __anonunion____missing_field_name_392 { struct ptp_extts_request extts ; struct ptp_perout_request perout ; }; struct ptp_clock_request { enum ldv_37637 type ; union __anonunion____missing_field_name_392 __annonCompField118 ; }; struct ptp_clock_info { struct module *owner ; char name[16U] ; s32 max_adj ; int n_alarm ; int n_ext_ts ; int n_per_out ; int n_pins ; int pps ; struct ptp_pin_desc *pin_config ; int (*adjfreq)(struct ptp_clock_info * , s32 ) ; int (*adjtime)(struct ptp_clock_info * , s64 ) ; int (*gettime64)(struct ptp_clock_info * , struct timespec * ) ; int (*settime64)(struct ptp_clock_info * , struct timespec const * ) ; int (*enable)(struct ptp_clock_info * , struct ptp_clock_request * , int ) ; int (*verify)(struct ptp_clock_info * , unsigned int , enum ptp_pin_function , unsigned int ) ; }; struct ptp_clock; struct cyclecounter { cycle_t (*read)(struct cyclecounter const * ) ; cycle_t mask ; u32 mult ; u32 shift ; }; struct timecounter { struct cyclecounter const *cc ; cycle_t cycle_last ; u64 nsec ; u64 mask ; u64 frac ; }; struct fcoe_capabilities { u32 capability1 ; u32 capability2 ; u32 capability3 ; u32 capability4 ; }; enum drv_info_opcode { ETH_STATS_OPCODE = 0, FCOE_STATS_OPCODE = 1, ISCSI_STATS_OPCODE = 2 } ; struct eth_stats_info { u8 version[12U] ; u8 mac_local[8U] ; u8 mac_add1[8U] ; u8 mac_add2[8U] ; u32 mtu_size ; u32 feature_flags ; u32 lso_max_size ; u32 lso_min_seg_cnt ; u32 ipv4_ofld_cnt ; u32 ipv6_ofld_cnt ; u32 promiscuous_mode ; u32 txq_size ; u32 rxq_size ; u32 txq_avg_depth ; u32 rxq_avg_depth ; u32 iov_offload ; u32 netq_cnt ; u32 vf_cnt ; }; struct fcoe_stats_info { u8 version[12U] ; u8 mac_local[8U] ; u8 mac_add1[8U] ; u8 mac_add2[8U] ; u32 qos_priority ; u32 txq_size ; u32 rxq_size ; u32 txq_avg_depth ; u32 rxq_avg_depth ; u32 rx_frames_lo ; u32 rx_frames_hi ; u32 rx_bytes_lo ; u32 rx_bytes_hi ; u32 tx_frames_lo ; u32 tx_frames_hi ; u32 tx_bytes_lo ; u32 tx_bytes_hi ; }; struct iscsi_stats_info { u8 version[12U] ; u8 mac_local[8U] ; u8 mac_add1[8U] ; u32 qos_priority ; u8 initiator_name[64U] ; u8 ww_port_name[64U] ; u8 boot_target_name[64U] ; u8 boot_target_ip[16U] ; u32 boot_target_portal ; u8 boot_init_ip[16U] ; u32 max_frame_size ; u32 txq_size ; u32 rxq_size ; u32 txq_avg_depth ; u32 rxq_avg_depth ; u32 rx_pdus_lo ; u32 rx_pdus_hi ; u32 rx_bytes_lo ; u32 rx_bytes_hi ; u32 tx_pdus_lo ; u32 tx_pdus_hi ; u32 tx_bytes_lo ; u32 tx_bytes_hi ; u32 pcp_prior_map_tbl ; }; union drv_info_to_mcp { struct eth_stats_info ether_stat ; struct fcoe_stats_info fcoe_stat ; struct iscsi_stats_info iscsi_stat ; }; enum mf_cfg_afex_vlan_mode { FUNC_MF_CFG_AFEX_VLAN_TRUNK_MODE = 0, FUNC_MF_CFG_AFEX_VLAN_ACCESS_MODE = 1, FUNC_MF_CFG_AFEX_VLAN_TRUNK_TAG_NATIVE_MODE = 2 } ; struct dcbx_ets_feature { u32 enabled ; u32 pg_bw_tbl[2U] ; u32 pri_pg_tbl[1U] ; }; struct dcbx_pfc_feature { u8 enabled ; u8 reserved ; u8 pfc_caps ; u8 pri_en_bitmap ; }; struct dcbx_app_priority_entry { u8 appBitfield ; u8 pri_bitmap ; u16 app_id ; }; struct dcbx_app_priority_feature { u8 enabled ; u8 tc_supported ; u8 default_pri ; u8 reserved ; struct dcbx_app_priority_entry app_pri_tbl[16U] ; }; struct dcbx_features { struct dcbx_ets_feature ets ; struct dcbx_pfc_feature pfc ; struct dcbx_app_priority_feature app ; }; struct emac_stats { u32 rx_stat_ifhcinoctets ; u32 rx_stat_ifhcinbadoctets ; u32 rx_stat_etherstatsfragments ; u32 rx_stat_ifhcinucastpkts ; u32 rx_stat_ifhcinmulticastpkts ; u32 rx_stat_ifhcinbroadcastpkts ; u32 rx_stat_dot3statsfcserrors ; u32 rx_stat_dot3statsalignmenterrors ; u32 rx_stat_dot3statscarriersenseerrors ; u32 rx_stat_xonpauseframesreceived ; u32 rx_stat_xoffpauseframesreceived ; u32 rx_stat_maccontrolframesreceived ; u32 rx_stat_xoffstateentered ; u32 rx_stat_dot3statsframestoolong ; u32 rx_stat_etherstatsjabbers ; u32 rx_stat_etherstatsundersizepkts ; u32 rx_stat_etherstatspkts64octets ; u32 rx_stat_etherstatspkts65octetsto127octets ; u32 rx_stat_etherstatspkts128octetsto255octets ; u32 rx_stat_etherstatspkts256octetsto511octets ; u32 rx_stat_etherstatspkts512octetsto1023octets ; u32 rx_stat_etherstatspkts1024octetsto1522octets ; u32 rx_stat_etherstatspktsover1522octets ; u32 rx_stat_falsecarriererrors ; u32 tx_stat_ifhcoutoctets ; u32 tx_stat_ifhcoutbadoctets ; u32 tx_stat_etherstatscollisions ; u32 tx_stat_outxonsent ; u32 tx_stat_outxoffsent ; u32 tx_stat_flowcontroldone ; u32 tx_stat_dot3statssinglecollisionframes ; u32 tx_stat_dot3statsmultiplecollisionframes ; u32 tx_stat_dot3statsdeferredtransmissions ; u32 tx_stat_dot3statsexcessivecollisions ; u32 tx_stat_dot3statslatecollisions ; u32 tx_stat_ifhcoutucastpkts ; u32 tx_stat_ifhcoutmulticastpkts ; u32 tx_stat_ifhcoutbroadcastpkts ; u32 tx_stat_etherstatspkts64octets ; u32 tx_stat_etherstatspkts65octetsto127octets ; u32 tx_stat_etherstatspkts128octetsto255octets ; u32 tx_stat_etherstatspkts256octetsto511octets ; u32 tx_stat_etherstatspkts512octetsto1023octets ; u32 tx_stat_etherstatspkts1024octetsto1522octets ; u32 tx_stat_etherstatspktsover1522octets ; u32 tx_stat_dot3statsinternalmactransmiterrors ; }; struct bmac1_stats { u32 tx_stat_gtpkt_lo ; u32 tx_stat_gtpkt_hi ; u32 tx_stat_gtxpf_lo ; u32 tx_stat_gtxpf_hi ; u32 tx_stat_gtfcs_lo ; u32 tx_stat_gtfcs_hi ; u32 tx_stat_gtmca_lo ; u32 tx_stat_gtmca_hi ; u32 tx_stat_gtbca_lo ; u32 tx_stat_gtbca_hi ; u32 tx_stat_gtfrg_lo ; u32 tx_stat_gtfrg_hi ; u32 tx_stat_gtovr_lo ; u32 tx_stat_gtovr_hi ; u32 tx_stat_gt64_lo ; u32 tx_stat_gt64_hi ; u32 tx_stat_gt127_lo ; u32 tx_stat_gt127_hi ; u32 tx_stat_gt255_lo ; u32 tx_stat_gt255_hi ; u32 tx_stat_gt511_lo ; u32 tx_stat_gt511_hi ; u32 tx_stat_gt1023_lo ; u32 tx_stat_gt1023_hi ; u32 tx_stat_gt1518_lo ; u32 tx_stat_gt1518_hi ; u32 tx_stat_gt2047_lo ; u32 tx_stat_gt2047_hi ; u32 tx_stat_gt4095_lo ; u32 tx_stat_gt4095_hi ; u32 tx_stat_gt9216_lo ; u32 tx_stat_gt9216_hi ; u32 tx_stat_gt16383_lo ; u32 tx_stat_gt16383_hi ; u32 tx_stat_gtmax_lo ; u32 tx_stat_gtmax_hi ; u32 tx_stat_gtufl_lo ; u32 tx_stat_gtufl_hi ; u32 tx_stat_gterr_lo ; u32 tx_stat_gterr_hi ; u32 tx_stat_gtbyt_lo ; u32 tx_stat_gtbyt_hi ; u32 rx_stat_gr64_lo ; u32 rx_stat_gr64_hi ; u32 rx_stat_gr127_lo ; u32 rx_stat_gr127_hi ; u32 rx_stat_gr255_lo ; u32 rx_stat_gr255_hi ; u32 rx_stat_gr511_lo ; u32 rx_stat_gr511_hi ; u32 rx_stat_gr1023_lo ; u32 rx_stat_gr1023_hi ; u32 rx_stat_gr1518_lo ; u32 rx_stat_gr1518_hi ; u32 rx_stat_gr2047_lo ; u32 rx_stat_gr2047_hi ; u32 rx_stat_gr4095_lo ; u32 rx_stat_gr4095_hi ; u32 rx_stat_gr9216_lo ; u32 rx_stat_gr9216_hi ; u32 rx_stat_gr16383_lo ; u32 rx_stat_gr16383_hi ; u32 rx_stat_grmax_lo ; u32 rx_stat_grmax_hi ; u32 rx_stat_grpkt_lo ; u32 rx_stat_grpkt_hi ; u32 rx_stat_grfcs_lo ; u32 rx_stat_grfcs_hi ; u32 rx_stat_grmca_lo ; u32 rx_stat_grmca_hi ; u32 rx_stat_grbca_lo ; u32 rx_stat_grbca_hi ; u32 rx_stat_grxcf_lo ; u32 rx_stat_grxcf_hi ; u32 rx_stat_grxpf_lo ; u32 rx_stat_grxpf_hi ; u32 rx_stat_grxuo_lo ; u32 rx_stat_grxuo_hi ; u32 rx_stat_grjbr_lo ; u32 rx_stat_grjbr_hi ; u32 rx_stat_grovr_lo ; u32 rx_stat_grovr_hi ; u32 rx_stat_grflr_lo ; u32 rx_stat_grflr_hi ; u32 rx_stat_grmeg_lo ; u32 rx_stat_grmeg_hi ; u32 rx_stat_grmeb_lo ; u32 rx_stat_grmeb_hi ; u32 rx_stat_grbyt_lo ; u32 rx_stat_grbyt_hi ; u32 rx_stat_grund_lo ; u32 rx_stat_grund_hi ; u32 rx_stat_grfrg_lo ; u32 rx_stat_grfrg_hi ; u32 rx_stat_grerb_lo ; u32 rx_stat_grerb_hi ; u32 rx_stat_grfre_lo ; u32 rx_stat_grfre_hi ; u32 rx_stat_gripj_lo ; u32 rx_stat_gripj_hi ; }; struct bmac2_stats { u32 tx_stat_gtpk_lo ; u32 tx_stat_gtpk_hi ; u32 tx_stat_gtxpf_lo ; u32 tx_stat_gtxpf_hi ; u32 tx_stat_gtpp_lo ; u32 tx_stat_gtpp_hi ; u32 tx_stat_gtfcs_lo ; u32 tx_stat_gtfcs_hi ; u32 tx_stat_gtuca_lo ; u32 tx_stat_gtuca_hi ; u32 tx_stat_gtmca_lo ; u32 tx_stat_gtmca_hi ; u32 tx_stat_gtbca_lo ; u32 tx_stat_gtbca_hi ; u32 tx_stat_gtovr_lo ; u32 tx_stat_gtovr_hi ; u32 tx_stat_gtfrg_lo ; u32 tx_stat_gtfrg_hi ; u32 tx_stat_gtpkt1_lo ; u32 tx_stat_gtpkt1_hi ; u32 tx_stat_gt64_lo ; u32 tx_stat_gt64_hi ; u32 tx_stat_gt127_lo ; u32 tx_stat_gt127_hi ; u32 tx_stat_gt255_lo ; u32 tx_stat_gt255_hi ; u32 tx_stat_gt511_lo ; u32 tx_stat_gt511_hi ; u32 tx_stat_gt1023_lo ; u32 tx_stat_gt1023_hi ; u32 tx_stat_gt1518_lo ; u32 tx_stat_gt1518_hi ; u32 tx_stat_gt2047_lo ; u32 tx_stat_gt2047_hi ; u32 tx_stat_gt4095_lo ; u32 tx_stat_gt4095_hi ; u32 tx_stat_gt9216_lo ; u32 tx_stat_gt9216_hi ; u32 tx_stat_gt16383_lo ; u32 tx_stat_gt16383_hi ; u32 tx_stat_gtmax_lo ; u32 tx_stat_gtmax_hi ; u32 tx_stat_gtufl_lo ; u32 tx_stat_gtufl_hi ; u32 tx_stat_gterr_lo ; u32 tx_stat_gterr_hi ; u32 tx_stat_gtbyt_lo ; u32 tx_stat_gtbyt_hi ; u32 rx_stat_gr64_lo ; u32 rx_stat_gr64_hi ; u32 rx_stat_gr127_lo ; u32 rx_stat_gr127_hi ; u32 rx_stat_gr255_lo ; u32 rx_stat_gr255_hi ; u32 rx_stat_gr511_lo ; u32 rx_stat_gr511_hi ; u32 rx_stat_gr1023_lo ; u32 rx_stat_gr1023_hi ; u32 rx_stat_gr1518_lo ; u32 rx_stat_gr1518_hi ; u32 rx_stat_gr2047_lo ; u32 rx_stat_gr2047_hi ; u32 rx_stat_gr4095_lo ; u32 rx_stat_gr4095_hi ; u32 rx_stat_gr9216_lo ; u32 rx_stat_gr9216_hi ; u32 rx_stat_gr16383_lo ; u32 rx_stat_gr16383_hi ; u32 rx_stat_grmax_lo ; u32 rx_stat_grmax_hi ; u32 rx_stat_grpkt_lo ; u32 rx_stat_grpkt_hi ; u32 rx_stat_grfcs_lo ; u32 rx_stat_grfcs_hi ; u32 rx_stat_gruca_lo ; u32 rx_stat_gruca_hi ; u32 rx_stat_grmca_lo ; u32 rx_stat_grmca_hi ; u32 rx_stat_grbca_lo ; u32 rx_stat_grbca_hi ; u32 rx_stat_grxpf_lo ; u32 rx_stat_grxpf_hi ; u32 rx_stat_grpp_lo ; u32 rx_stat_grpp_hi ; u32 rx_stat_grxuo_lo ; u32 rx_stat_grxuo_hi ; u32 rx_stat_grjbr_lo ; u32 rx_stat_grjbr_hi ; u32 rx_stat_grovr_lo ; u32 rx_stat_grovr_hi ; u32 rx_stat_grxcf_lo ; u32 rx_stat_grxcf_hi ; u32 rx_stat_grflr_lo ; u32 rx_stat_grflr_hi ; u32 rx_stat_grpok_lo ; u32 rx_stat_grpok_hi ; u32 rx_stat_grmeg_lo ; u32 rx_stat_grmeg_hi ; u32 rx_stat_grmeb_lo ; u32 rx_stat_grmeb_hi ; u32 rx_stat_grbyt_lo ; u32 rx_stat_grbyt_hi ; u32 rx_stat_grund_lo ; u32 rx_stat_grund_hi ; u32 rx_stat_grfrg_lo ; u32 rx_stat_grfrg_hi ; u32 rx_stat_grerb_lo ; u32 rx_stat_grerb_hi ; u32 rx_stat_grfre_lo ; u32 rx_stat_grfre_hi ; u32 rx_stat_gripj_lo ; u32 rx_stat_gripj_hi ; }; struct __anonstruct_stats_tx_394 { u32 tx_gtxpok_lo ; u32 tx_gtxpok_hi ; u32 tx_gtxpf_lo ; u32 tx_gtxpf_hi ; u32 tx_gtxpp_lo ; u32 tx_gtxpp_hi ; u32 tx_gtfcs_lo ; u32 tx_gtfcs_hi ; u32 tx_gtuca_lo ; u32 tx_gtuca_hi ; u32 tx_gtmca_lo ; u32 tx_gtmca_hi ; u32 tx_gtgca_lo ; u32 tx_gtgca_hi ; u32 tx_gtpkt_lo ; u32 tx_gtpkt_hi ; u32 tx_gt64_lo ; u32 tx_gt64_hi ; u32 tx_gt127_lo ; u32 tx_gt127_hi ; u32 tx_gt255_lo ; u32 tx_gt255_hi ; u32 tx_gt511_lo ; u32 tx_gt511_hi ; u32 tx_gt1023_lo ; u32 tx_gt1023_hi ; u32 tx_gt1518_lo ; u32 tx_gt1518_hi ; u32 tx_gt2047_lo ; u32 tx_gt2047_hi ; u32 tx_gt4095_lo ; u32 tx_gt4095_hi ; u32 tx_gt9216_lo ; u32 tx_gt9216_hi ; u32 tx_gt16383_lo ; u32 tx_gt16383_hi ; u32 tx_gtufl_lo ; u32 tx_gtufl_hi ; u32 tx_gterr_lo ; u32 tx_gterr_hi ; u32 tx_gtbyt_lo ; u32 tx_gtbyt_hi ; u32 tx_collisions_lo ; u32 tx_collisions_hi ; u32 tx_singlecollision_lo ; u32 tx_singlecollision_hi ; u32 tx_multiplecollisions_lo ; u32 tx_multiplecollisions_hi ; u32 tx_deferred_lo ; u32 tx_deferred_hi ; u32 tx_excessivecollisions_lo ; u32 tx_excessivecollisions_hi ; u32 tx_latecollisions_lo ; u32 tx_latecollisions_hi ; }; struct __anonstruct_stats_rx_395 { u32 rx_gr64_lo ; u32 rx_gr64_hi ; u32 rx_gr127_lo ; u32 rx_gr127_hi ; u32 rx_gr255_lo ; u32 rx_gr255_hi ; u32 rx_gr511_lo ; u32 rx_gr511_hi ; u32 rx_gr1023_lo ; u32 rx_gr1023_hi ; u32 rx_gr1518_lo ; u32 rx_gr1518_hi ; u32 rx_gr2047_lo ; u32 rx_gr2047_hi ; u32 rx_gr4095_lo ; u32 rx_gr4095_hi ; u32 rx_gr9216_lo ; u32 rx_gr9216_hi ; u32 rx_gr16383_lo ; u32 rx_gr16383_hi ; u32 rx_grpkt_lo ; u32 rx_grpkt_hi ; u32 rx_grfcs_lo ; u32 rx_grfcs_hi ; u32 rx_gruca_lo ; u32 rx_gruca_hi ; u32 rx_grmca_lo ; u32 rx_grmca_hi ; u32 rx_grbca_lo ; u32 rx_grbca_hi ; u32 rx_grxpf_lo ; u32 rx_grxpf_hi ; u32 rx_grxpp_lo ; u32 rx_grxpp_hi ; u32 rx_grxuo_lo ; u32 rx_grxuo_hi ; u32 rx_grovr_lo ; u32 rx_grovr_hi ; u32 rx_grxcf_lo ; u32 rx_grxcf_hi ; u32 rx_grflr_lo ; u32 rx_grflr_hi ; u32 rx_grpok_lo ; u32 rx_grpok_hi ; u32 rx_grbyt_lo ; u32 rx_grbyt_hi ; u32 rx_grund_lo ; u32 rx_grund_hi ; u32 rx_grfrg_lo ; u32 rx_grfrg_hi ; u32 rx_grerb_lo ; u32 rx_grerb_hi ; u32 rx_grfre_lo ; u32 rx_grfre_hi ; u32 rx_alignmenterrors_lo ; u32 rx_alignmenterrors_hi ; u32 rx_falsecarrier_lo ; u32 rx_falsecarrier_hi ; u32 rx_llfcmsgcnt_lo ; u32 rx_llfcmsgcnt_hi ; }; struct mstat_stats { struct __anonstruct_stats_tx_394 stats_tx ; struct __anonstruct_stats_rx_395 stats_rx ; }; union mac_stats { struct emac_stats emac_stats ; struct bmac1_stats bmac1_stats ; struct bmac2_stats bmac2_stats ; struct mstat_stats mstat_stats ; }; struct mac_stx { u32 rx_stat_ifhcinbadoctets_hi ; u32 rx_stat_ifhcinbadoctets_lo ; u32 tx_stat_ifhcoutbadoctets_hi ; u32 tx_stat_ifhcoutbadoctets_lo ; u32 rx_stat_dot3statsfcserrors_hi ; u32 rx_stat_dot3statsfcserrors_lo ; u32 rx_stat_dot3statsalignmenterrors_hi ; u32 rx_stat_dot3statsalignmenterrors_lo ; u32 rx_stat_dot3statscarriersenseerrors_hi ; u32 rx_stat_dot3statscarriersenseerrors_lo ; u32 rx_stat_falsecarriererrors_hi ; u32 rx_stat_falsecarriererrors_lo ; u32 rx_stat_etherstatsundersizepkts_hi ; u32 rx_stat_etherstatsundersizepkts_lo ; u32 rx_stat_dot3statsframestoolong_hi ; u32 rx_stat_dot3statsframestoolong_lo ; u32 rx_stat_etherstatsfragments_hi ; u32 rx_stat_etherstatsfragments_lo ; u32 rx_stat_etherstatsjabbers_hi ; u32 rx_stat_etherstatsjabbers_lo ; u32 rx_stat_maccontrolframesreceived_hi ; u32 rx_stat_maccontrolframesreceived_lo ; u32 rx_stat_mac_xpf_hi ; u32 rx_stat_mac_xpf_lo ; u32 rx_stat_mac_xcf_hi ; u32 rx_stat_mac_xcf_lo ; u32 rx_stat_xoffstateentered_hi ; u32 rx_stat_xoffstateentered_lo ; u32 rx_stat_xonpauseframesreceived_hi ; u32 rx_stat_xonpauseframesreceived_lo ; u32 rx_stat_xoffpauseframesreceived_hi ; u32 rx_stat_xoffpauseframesreceived_lo ; u32 tx_stat_outxonsent_hi ; u32 tx_stat_outxonsent_lo ; u32 tx_stat_outxoffsent_hi ; u32 tx_stat_outxoffsent_lo ; u32 tx_stat_flowcontroldone_hi ; u32 tx_stat_flowcontroldone_lo ; u32 tx_stat_etherstatscollisions_hi ; u32 tx_stat_etherstatscollisions_lo ; u32 tx_stat_dot3statssinglecollisionframes_hi ; u32 tx_stat_dot3statssinglecollisionframes_lo ; u32 tx_stat_dot3statsmultiplecollisionframes_hi ; u32 tx_stat_dot3statsmultiplecollisionframes_lo ; u32 tx_stat_dot3statsdeferredtransmissions_hi ; u32 tx_stat_dot3statsdeferredtransmissions_lo ; u32 tx_stat_dot3statsexcessivecollisions_hi ; u32 tx_stat_dot3statsexcessivecollisions_lo ; u32 tx_stat_dot3statslatecollisions_hi ; u32 tx_stat_dot3statslatecollisions_lo ; u32 tx_stat_etherstatspkts64octets_hi ; u32 tx_stat_etherstatspkts64octets_lo ; u32 tx_stat_etherstatspkts65octetsto127octets_hi ; u32 tx_stat_etherstatspkts65octetsto127octets_lo ; u32 tx_stat_etherstatspkts128octetsto255octets_hi ; u32 tx_stat_etherstatspkts128octetsto255octets_lo ; u32 tx_stat_etherstatspkts256octetsto511octets_hi ; u32 tx_stat_etherstatspkts256octetsto511octets_lo ; u32 tx_stat_etherstatspkts512octetsto1023octets_hi ; u32 tx_stat_etherstatspkts512octetsto1023octets_lo ; u32 tx_stat_etherstatspkts1024octetsto1522octets_hi ; u32 tx_stat_etherstatspkts1024octetsto1522octets_lo ; u32 tx_stat_etherstatspktsover1522octets_hi ; u32 tx_stat_etherstatspktsover1522octets_lo ; u32 tx_stat_mac_2047_hi ; u32 tx_stat_mac_2047_lo ; u32 tx_stat_mac_4095_hi ; u32 tx_stat_mac_4095_lo ; u32 tx_stat_mac_9216_hi ; u32 tx_stat_mac_9216_lo ; u32 tx_stat_mac_16383_hi ; u32 tx_stat_mac_16383_lo ; u32 tx_stat_dot3statsinternalmactransmiterrors_hi ; u32 tx_stat_dot3statsinternalmactransmiterrors_lo ; u32 tx_stat_mac_ufl_hi ; u32 tx_stat_mac_ufl_lo ; }; struct host_port_stats { u32 host_port_stats_counter ; struct mac_stx mac_stx[2U] ; u32 brb_drop_hi ; u32 brb_drop_lo ; u32 not_used ; u32 pfc_frames_tx_hi ; u32 pfc_frames_tx_lo ; u32 pfc_frames_rx_hi ; u32 pfc_frames_rx_lo ; u32 eee_lpi_count_hi ; u32 eee_lpi_count_lo ; }; struct host_func_stats { u32 host_func_stats_start ; u32 total_bytes_received_hi ; u32 total_bytes_received_lo ; u32 total_bytes_transmitted_hi ; u32 total_bytes_transmitted_lo ; u32 total_unicast_packets_received_hi ; u32 total_unicast_packets_received_lo ; u32 total_multicast_packets_received_hi ; u32 total_multicast_packets_received_lo ; u32 total_broadcast_packets_received_hi ; u32 total_broadcast_packets_received_lo ; u32 total_unicast_packets_transmitted_hi ; u32 total_unicast_packets_transmitted_lo ; u32 total_multicast_packets_transmitted_hi ; u32 total_multicast_packets_transmitted_lo ; u32 total_broadcast_packets_transmitted_hi ; u32 total_broadcast_packets_transmitted_lo ; u32 valid_bytes_received_hi ; u32 valid_bytes_received_lo ; u32 host_func_stats_end ; }; struct afex_stats { u32 tx_unicast_frames_hi ; u32 tx_unicast_frames_lo ; u32 tx_unicast_bytes_hi ; u32 tx_unicast_bytes_lo ; u32 tx_multicast_frames_hi ; u32 tx_multicast_frames_lo ; u32 tx_multicast_bytes_hi ; u32 tx_multicast_bytes_lo ; u32 tx_broadcast_frames_hi ; u32 tx_broadcast_frames_lo ; u32 tx_broadcast_bytes_hi ; u32 tx_broadcast_bytes_lo ; u32 tx_frames_discarded_hi ; u32 tx_frames_discarded_lo ; u32 tx_frames_dropped_hi ; u32 tx_frames_dropped_lo ; u32 rx_unicast_frames_hi ; u32 rx_unicast_frames_lo ; u32 rx_unicast_bytes_hi ; u32 rx_unicast_bytes_lo ; u32 rx_multicast_frames_hi ; u32 rx_multicast_frames_lo ; u32 rx_multicast_bytes_hi ; u32 rx_multicast_bytes_lo ; u32 rx_broadcast_frames_hi ; u32 rx_broadcast_frames_lo ; u32 rx_broadcast_bytes_hi ; u32 rx_broadcast_bytes_lo ; u32 rx_frames_discarded_hi ; u32 rx_frames_discarded_lo ; u32 rx_frames_dropped_hi ; u32 rx_frames_dropped_lo ; }; struct atten_sp_status_block { __le32 attn_bits ; __le32 attn_bits_ack ; u8 status_block_id ; u8 reserved0 ; __le16 attn_bits_index ; __le32 reserved1 ; }; struct cstorm_eth_ag_context { u32 __reserved0[10U] ; }; struct dmae_command { u32 opcode ; u32 src_addr_lo ; u32 src_addr_hi ; u32 dst_addr_lo ; u32 dst_addr_hi ; u16 len ; u16 opcode_iov ; u32 comp_addr_lo ; u32 comp_addr_hi ; u32 comp_val ; u32 crc32 ; u32 crc32_c ; u16 crc16 ; u16 crc16_c ; u16 crc_t10 ; u16 reserved3 ; u16 xsum16 ; u16 xsum8 ; }; struct doorbell_hdr { u8 header ; }; struct hc_status_block_e1x { __le16 index_values[8U] ; __le16 running_index[2U] ; __le32 rsrv[11U] ; }; struct host_hc_status_block_e1x { struct hc_status_block_e1x sb ; }; struct hc_status_block_e2 { __le16 index_values[8U] ; __le16 running_index[2U] ; __le32 reserved[11U] ; }; struct host_hc_status_block_e2 { struct hc_status_block_e2 sb ; }; struct hc_sp_status_block { __le16 index_values[16U] ; __le16 running_index ; __le16 rsrv ; u32 rsrv1 ; }; struct host_sp_status_block { struct atten_sp_status_block atten_status_block ; struct hc_sp_status_block sp_sb ; }; struct igu_ack_register { u16 status_block_index ; u16 sb_id_and_flags ; }; struct igu_regular { u32 sb_id_and_flags ; u32 reserved_2 ; }; struct parsing_flags { __le16 flags ; }; struct timers_block_context { u32 __reserved_0 ; u32 __reserved_1 ; u32 __reserved_2 ; u32 flags ; }; struct tstorm_eth_ag_context { u32 __reserved0[14U] ; }; struct ustorm_eth_ag_context { u32 __reserved0 ; u16 __reserved1 ; u8 __reserved2 ; u8 cdu_usage ; u32 __reserved3[6U] ; }; struct xstorm_eth_ag_context { u32 reserved0 ; u16 reserved1 ; u8 reserved2 ; u8 cdu_reserved ; u32 reserved3[30U] ; }; struct doorbell_set_prod { struct doorbell_hdr header ; u8 zero_fill1 ; u16 prod ; }; struct regpair { __le32 lo ; __le32 hi ; }; struct regpair_native { u32 lo ; u32 hi ; }; struct client_init_general_data { u8 client_id ; u8 statistics_counter_id ; u8 statistics_en_flg ; u8 is_fcoe_flg ; u8 activate_flg ; u8 sp_client_id ; __le16 mtu ; u8 statistics_zero_flg ; u8 func_id ; u8 cos ; u8 traffic_type ; u8 fp_hsi_ver ; u8 reserved0[3U] ; }; struct client_init_rx_data { u8 tpa_en ; u8 vmqueue_mode_en_flg ; u8 extra_data_over_sgl_en_flg ; u8 cache_line_alignment_log_size ; u8 enable_dynamic_hc ; u8 max_sges_for_packet ; u8 client_qzone_id ; u8 drop_ip_cs_err_flg ; u8 drop_tcp_cs_err_flg ; u8 drop_ttl0_flg ; u8 drop_udp_cs_err_flg ; u8 inner_vlan_removal_enable_flg ; u8 outer_vlan_removal_enable_flg ; u8 status_block_id ; u8 rx_sb_index_number ; u8 dont_verify_rings_pause_thr_flg ; u8 max_tpa_queues ; u8 silent_vlan_removal_flg ; __le16 max_bytes_on_bd ; __le16 sge_buff_size ; u8 approx_mcast_engine_id ; u8 rss_engine_id ; struct regpair bd_page_base ; struct regpair sge_page_base ; struct regpair cqe_page_base ; u8 is_leading_rss ; u8 is_approx_mcast ; __le16 max_agg_size ; __le16 state ; __le16 cqe_pause_thr_low ; __le16 cqe_pause_thr_high ; __le16 bd_pause_thr_low ; __le16 bd_pause_thr_high ; __le16 sge_pause_thr_low ; __le16 sge_pause_thr_high ; __le16 rx_cos_mask ; __le16 silent_vlan_value ; __le16 silent_vlan_mask ; u8 handle_ptp_pkts_flg ; u8 reserved6[3U] ; __le32 reserved7 ; }; struct client_init_tx_data { u8 enforce_security_flg ; u8 tx_status_block_id ; u8 tx_sb_index_number ; u8 tss_leading_client_id ; u8 tx_switching_flg ; u8 anti_spoofing_flg ; __le16 default_vlan ; struct regpair tx_bd_page_base ; __le16 state ; u8 default_vlan_flg ; u8 force_default_pri_flg ; u8 tunnel_lso_inc_ip_id ; u8 refuse_outband_vlan_flg ; u8 tunnel_non_lso_pcsum_location ; u8 tunnel_non_lso_outer_ip_csum_location ; }; struct client_init_ramrod_data { struct client_init_general_data general ; struct client_init_rx_data rx ; struct client_init_tx_data tx ; }; struct client_update_ramrod_data { u8 client_id ; u8 func_id ; u8 inner_vlan_removal_enable_flg ; u8 inner_vlan_removal_change_flg ; u8 outer_vlan_removal_enable_flg ; u8 outer_vlan_removal_change_flg ; u8 anti_spoofing_enable_flg ; u8 anti_spoofing_change_flg ; u8 activate_flg ; u8 activate_change_flg ; __le16 default_vlan ; u8 default_vlan_enable_flg ; u8 default_vlan_change_flg ; __le16 silent_vlan_value ; __le16 silent_vlan_mask ; u8 silent_vlan_removal_flg ; u8 silent_vlan_change_flg ; u8 refuse_outband_vlan_flg ; u8 refuse_outband_vlan_change_flg ; u8 tx_switching_flg ; u8 tx_switching_change_flg ; u8 handle_ptp_pkts_flg ; u8 handle_ptp_pkts_change_flg ; __le16 reserved1 ; __le32 echo ; }; struct cstorm_eth_st_context { u32 __reserved0[4U] ; }; struct eth_classify_cmd_header { u8 cmd_general_data ; u8 func_id ; u8 client_id ; u8 reserved1 ; }; struct eth_classify_header { u8 rule_cnt ; u8 reserved0 ; __le16 reserved1 ; __le32 echo ; }; struct eth_classify_mac_cmd { struct eth_classify_cmd_header header ; __le16 reserved0 ; __le16 inner_mac ; __le16 mac_lsb ; __le16 mac_mid ; __le16 mac_msb ; __le16 reserved1 ; }; struct eth_classify_pair_cmd { struct eth_classify_cmd_header header ; __le16 reserved0 ; __le16 inner_mac ; __le16 mac_lsb ; __le16 mac_mid ; __le16 mac_msb ; __le16 vlan ; }; struct eth_classify_vlan_cmd { struct eth_classify_cmd_header header ; __le32 reserved0 ; __le32 reserved1 ; __le16 reserved2 ; __le16 vlan ; }; struct eth_classify_vxlan_cmd { struct eth_classify_cmd_header header ; __le32 vni ; __le16 inner_mac_lsb ; __le16 inner_mac_mid ; __le16 inner_mac_msb ; __le16 reserved1 ; }; union eth_classify_rule_cmd { struct eth_classify_mac_cmd mac ; struct eth_classify_vlan_cmd vlan ; struct eth_classify_pair_cmd pair ; struct eth_classify_vxlan_cmd vxlan ; }; struct eth_classify_rules_ramrod_data { struct eth_classify_header header ; union eth_classify_rule_cmd rules[16U] ; }; struct eth_common_ramrod_data { __le32 client_id ; __le32 reserved1 ; }; struct ustorm_eth_st_context { u32 reserved0[52U] ; }; struct tstorm_eth_st_context { u32 __reserved0[28U] ; }; struct xstorm_eth_st_context { u32 reserved0[60U] ; }; struct eth_context { struct ustorm_eth_st_context ustorm_st_context ; struct tstorm_eth_st_context tstorm_st_context ; struct xstorm_eth_ag_context xstorm_ag_context ; struct tstorm_eth_ag_context tstorm_ag_context ; struct cstorm_eth_ag_context cstorm_ag_context ; struct ustorm_eth_ag_context ustorm_ag_context ; struct timers_block_context timers_context ; struct xstorm_eth_st_context xstorm_st_context ; struct cstorm_eth_st_context cstorm_st_context ; }; union eth_sgl_or_raw_data { __le16 sgl[8U] ; u32 raw_data[4U] ; }; struct eth_end_agg_rx_cqe { u8 type_error_flags ; u8 reserved1 ; u8 queue_index ; u8 reserved2 ; __le32 timestamp_delta ; __le16 num_of_coalesced_segs ; __le16 pkt_len ; u8 pure_ack_count ; u8 reserved3 ; __le16 reserved4 ; union eth_sgl_or_raw_data sgl_or_raw_data ; __le32 reserved5[8U] ; }; struct eth_fast_path_rx_cqe { u8 type_error_flags ; u8 status_flags ; u8 queue_index ; u8 placement_offset ; __le32 rss_hash_result ; __le16 vlan_tag ; __le16 pkt_len_or_gro_seg_len ; __le16 len_on_bd ; struct parsing_flags pars_flags ; union eth_sgl_or_raw_data sgl_or_raw_data ; __le32 reserved1[7U] ; u32 marker ; }; struct eth_filter_rules_cmd { u8 cmd_general_data ; u8 func_id ; u8 client_id ; u8 reserved1 ; __le16 state ; __le16 reserved3 ; struct regpair reserved4 ; }; struct eth_filter_rules_ramrod_data { struct eth_classify_header header ; struct eth_filter_rules_cmd rules[16U] ; }; struct eth_halt_ramrod_data { __le32 client_id ; __le32 reserved0 ; }; struct eth_mac_addresses { __le16 dst_lo ; __le16 dst_mid ; __le16 dst_hi ; __le16 src_lo ; __le16 src_mid ; __le16 src_hi ; }; struct eth_tunnel_data { __le16 dst_lo ; __le16 dst_mid ; __le16 dst_hi ; __le16 fw_ip_hdr_csum ; __le16 pseudo_csum ; u8 ip_hdr_start_inner_w ; u8 flags ; }; union eth_mac_addr_or_tunnel_data { struct eth_mac_addresses mac_addr ; struct eth_tunnel_data tunnel_data ; }; struct eth_multicast_rules_cmd { u8 cmd_general_data ; u8 func_id ; u8 bin_id ; u8 engine_id ; __le32 reserved2 ; struct regpair reserved3 ; }; struct eth_multicast_rules_ramrod_data { struct eth_classify_header header ; struct eth_multicast_rules_cmd rules[16U] ; }; struct ramrod_data { __le32 data_lo ; __le32 data_hi ; }; struct eth_rss_update_ramrod_data { u8 rss_engine_id ; u8 rss_mode ; __le16 capabilities ; u8 rss_result_mask ; u8 reserved3 ; __le16 reserved4 ; u8 indirection_table[128U] ; __le32 rss_key[10U] ; __le32 echo ; __le32 reserved5 ; }; struct eth_rx_bd { __le32 addr_lo ; __le32 addr_hi ; }; struct common_ramrod_eth_rx_cqe { u8 ramrod_type ; u8 conn_type ; __le16 reserved1 ; __le32 conn_and_cmd_data ; struct ramrod_data protocol_data ; __le32 echo ; __le32 reserved2[11U] ; }; struct eth_rx_cqe_next_page { __le32 addr_lo ; __le32 addr_hi ; __le32 reserved[14U] ; }; union eth_rx_cqe { struct eth_fast_path_rx_cqe fast_path_cqe ; struct common_ramrod_eth_rx_cqe ramrod_cqe ; struct eth_rx_cqe_next_page next_page_cqe ; struct eth_end_agg_rx_cqe end_agg_cqe ; }; struct eth_rx_sge { __le32 addr_lo ; __le32 addr_hi ; }; struct spe_hdr { __le32 conn_and_cmd_data ; __le16 type ; __le16 reserved1 ; }; union eth_specific_data { u8 protocol_data[8U] ; struct regpair client_update_ramrod_data ; struct regpair client_init_ramrod_init_data ; struct eth_halt_ramrod_data halt_ramrod_data ; struct regpair update_data_addr ; struct eth_common_ramrod_data common_ramrod_data ; struct regpair classify_cfg_addr ; struct regpair filter_cfg_addr ; struct regpair mcast_cfg_addr ; }; struct eth_spe { struct spe_hdr hdr ; union eth_specific_data data ; }; struct eth_tx_bd { __le32 addr_lo ; __le32 addr_hi ; __le16 total_pkt_bytes ; __le16 nbytes ; u8 reserved[4U] ; }; struct eth_tx_bd_flags { u8 as_bitfield ; }; struct eth_tx_start_bd { __le32 addr_lo ; __le32 addr_hi ; __le16 nbd ; __le16 nbytes ; __le16 vlan_or_ethertype ; struct eth_tx_bd_flags bd_flags ; u8 general_data ; }; struct eth_tx_parse_bd_e1x { __le16 global_data ; u8 tcp_flags ; u8 ip_hlen_w ; __le16 total_hlen_w ; __le16 tcp_pseudo_csum ; __le16 lso_mss ; __le16 ip_id ; __le32 tcp_send_seq ; }; struct eth_tx_parse_bd_e2 { union eth_mac_addr_or_tunnel_data data ; __le32 parsing_data ; }; struct eth_tx_parse_2nd_bd { __le16 global_data ; u8 bd_type ; u8 reserved3 ; u8 tcp_flags ; u8 reserved4 ; u8 tunnel_udp_hdr_start_w ; u8 fw_ip_hdr_to_payload_w ; __le16 fw_ip_csum_wo_len_flags_frag ; __le16 hw_ip_id ; __le32 tcp_send_seq ; }; struct eth_tx_next_bd { __le32 addr_lo ; __le32 addr_hi ; u8 reserved[8U] ; }; union eth_tx_bd_types { struct eth_tx_start_bd start_bd ; struct eth_tx_bd reg_bd ; struct eth_tx_parse_bd_e1x parse_bd_e1x ; struct eth_tx_parse_bd_e2 parse_bd_e2 ; struct eth_tx_parse_2nd_bd parse_2nd_bd ; struct eth_tx_next_bd next_bd ; }; struct mac_configuration_hdr { u8 length ; u8 offset ; __le16 client_id ; __le32 echo ; }; struct mac_configuration_entry { __le16 lsb_mac_addr ; __le16 middle_mac_addr ; __le16 msb_mac_addr ; __le16 vlan_id ; u8 pf_id ; u8 flags ; __le16 reserved0 ; __le32 clients_bit_vector ; }; struct mac_configuration_cmd { struct mac_configuration_hdr hdr ; struct mac_configuration_entry config_table[64U] ; }; struct tpa_update_ramrod_data { u8 update_ipv4 ; u8 update_ipv6 ; u8 client_id ; u8 max_tpa_queues ; u8 max_sges_for_packet ; u8 complete_on_both_clients ; u8 dont_verify_rings_pause_thr_flg ; u8 tpa_mode ; __le16 sge_buff_size ; __le16 max_agg_size ; __le32 sge_page_base_lo ; __le32 sge_page_base_hi ; __le16 sge_pause_thr_low ; __le16 sge_pause_thr_high ; }; struct tstorm_eth_function_common_config { __le16 config_flags ; u8 rss_result_mask ; u8 reserved1 ; __le16 vlan_id[2U] ; }; struct tstorm_eth_mac_filter_config { u32 ucast_drop_all ; u32 ucast_accept_all ; u32 mcast_drop_all ; u32 mcast_accept_all ; u32 bcast_accept_all ; u32 vlan_filter[2U] ; u32 unmatched_unicast ; }; struct fcoe_rx_stat_params_section0 { __le32 fcoe_rx_pkt_cnt ; __le32 fcoe_rx_byte_cnt ; }; struct fcoe_rx_stat_params_section1 { __le32 fcoe_ver_cnt ; __le32 fcoe_rx_drop_pkt_cnt ; }; struct fcoe_rx_stat_params_section2 { __le32 fc_crc_cnt ; __le32 eofa_del_cnt ; __le32 miss_frame_cnt ; __le32 seq_timeout_cnt ; __le32 drop_seq_cnt ; __le32 fcoe_rx_drop_pkt_cnt ; __le32 fcp_rx_pkt_cnt ; __le32 reserved0 ; }; struct fcoe_tx_stat_params { __le32 fcoe_tx_pkt_cnt ; __le32 fcoe_tx_byte_cnt ; __le32 fcp_tx_pkt_cnt ; __le32 reserved0 ; }; struct fcoe_statistics_params { struct fcoe_tx_stat_params tx_stat ; struct fcoe_rx_stat_params_section0 rx_stat0 ; struct fcoe_rx_stat_params_section1 rx_stat1 ; struct fcoe_rx_stat_params_section2 rx_stat2 ; }; struct afex_vif_list_ramrod_data { u8 afex_vif_list_command ; u8 func_bit_map ; __le16 vif_list_index ; u8 func_to_clear ; u8 echo ; __le16 reserved1 ; }; struct cfc_del_event_data { u32 cid ; u32 reserved0 ; u32 reserved1 ; }; struct cmng_flags_per_port { u32 cmng_enables ; u32 __reserved1 ; }; struct rate_shaping_vars_per_port { u32 rs_periodic_timeout ; u32 rs_threshold ; }; struct fairness_vars_per_port { u32 upper_bound ; u32 fair_threshold ; u32 fairness_timeout ; u32 reserved0 ; }; struct safc_struct_per_port { u8 safc_timeout_usec ; u8 __reserved0 ; u16 __reserved1 ; u8 cos_to_traffic_types[4U] ; u16 cos_to_pause_mask[16U] ; }; struct cmng_struct_per_port { struct rate_shaping_vars_per_port rs_vars ; struct fairness_vars_per_port fair_vars ; struct safc_struct_per_port safc_vars ; struct cmng_flags_per_port flags ; }; struct rate_shaping_counter { u32 quota ; u16 rate ; u16 __reserved0 ; }; struct rate_shaping_vars_per_vn { struct rate_shaping_counter vn_counter ; }; struct fairness_vars_per_vn { u32 cos_credit_delta[4U] ; u32 vn_credit_delta ; u32 __reserved0 ; }; struct cmng_vnic { struct rate_shaping_vars_per_vn vnic_max_rate[4U] ; struct fairness_vars_per_vn vnic_min_rate[4U] ; }; struct cmng_init { struct cmng_struct_per_port port ; struct cmng_vnic vnic ; }; struct cmng_init_input { u32 port_rate ; u16 vnic_min_rate[4U] ; u16 vnic_max_rate[4U] ; u16 cos_min_rate[4U] ; u16 cos_to_pause_mask[4U] ; struct cmng_flags_per_port flags ; }; struct eth_event_data { u32 echo ; u32 reserved0 ; u32 reserved1 ; }; struct vf_pf_event_data { u8 vf_id ; u8 reserved0 ; u16 reserved1 ; u32 msg_addr_lo ; u32 msg_addr_hi ; }; struct vf_flr_event_data { u8 vf_id ; u8 reserved0 ; u16 reserved1 ; u32 reserved2 ; u32 reserved3 ; }; struct malicious_vf_event_data { u8 vf_id ; u8 err_id ; u16 reserved1 ; u32 reserved2 ; u32 reserved3 ; }; struct vif_list_event_data { u8 func_bit_map ; u8 echo ; __le16 reserved0 ; __le32 reserved1 ; __le32 reserved2 ; }; struct function_update_event_data { u8 echo ; u8 reserved ; __le16 reserved0 ; __le32 reserved1 ; __le32 reserved2 ; }; union event_data { struct vf_pf_event_data vf_pf_event ; struct eth_event_data eth_event ; struct cfc_del_event_data cfc_del_event ; struct vf_flr_event_data vf_flr_event ; struct malicious_vf_event_data malicious_vf_event ; struct vif_list_event_data vif_list_event ; struct function_update_event_data function_update_event ; }; struct event_ring_data { struct regpair_native base_addr ; u16 producer ; u8 sb_id ; u8 index_id ; u32 reserved0 ; }; struct event_ring_msg { u8 opcode ; u8 error ; u16 reserved1 ; union event_data data ; }; struct event_ring_next { struct regpair addr ; u32 reserved[2U] ; }; union event_ring_elem { struct event_ring_msg message ; struct event_ring_next next_page ; }; struct priority_cos { u8 priority ; u8 cos ; __le16 reserved1 ; }; struct flow_control_configuration { struct priority_cos traffic_type_to_priority_cos[8U] ; u8 dcb_enabled ; u8 dcb_version ; u8 dont_add_pri_0_en ; u8 reserved1 ; __le32 reserved2 ; }; struct function_start_data { u8 function_mode ; u8 allow_npar_tx_switching ; __le16 sd_vlan_tag ; __le16 vif_id ; u8 path_id ; u8 network_cos_mode ; u8 dmae_cmd_id ; u8 tunnel_mode ; u8 gre_tunnel_type ; u8 tunn_clss_en ; u8 inner_gre_rss_en ; u8 sd_accept_mf_clss_fail ; __le16 vxlan_dst_port ; __le16 sd_accept_mf_clss_fail_ethtype ; __le16 sd_vlan_eth_type ; u8 sd_vlan_force_pri_flg ; u8 sd_vlan_force_pri_val ; u8 sd_accept_mf_clss_fail_match_ethtype ; u8 no_added_tags ; }; struct function_update_data { u8 vif_id_change_flg ; u8 afex_default_vlan_change_flg ; u8 allowed_priorities_change_flg ; u8 network_cos_mode_change_flg ; __le16 vif_id ; __le16 afex_default_vlan ; u8 allowed_priorities ; u8 network_cos_mode ; u8 lb_mode_en_change_flg ; u8 lb_mode_en ; u8 tx_switch_suspend_change_flg ; u8 tx_switch_suspend ; u8 echo ; u8 update_tunn_cfg_flg ; u8 tunnel_mode ; u8 gre_tunnel_type ; u8 tunn_clss_en ; u8 inner_gre_rss_en ; __le16 vxlan_dst_port ; u8 sd_vlan_force_pri_change_flg ; u8 sd_vlan_force_pri_flg ; u8 sd_vlan_force_pri_val ; u8 sd_vlan_tag_change_flg ; u8 sd_vlan_eth_type_change_flg ; u8 reserved1 ; __le16 sd_vlan_tag ; __le16 sd_vlan_eth_type ; }; struct hc_index_data { u8 timeout ; u8 flags ; }; struct hc_status_block_sm { u8 __flags ; u8 timer_value ; u8 igu_sb_id ; u8 igu_seg_id ; u32 time_to_expire ; }; struct pci_entity { u8 pf_id ; u8 vnic_id ; u8 vf_id ; u8 vf_valid ; }; struct hc_sb_data { struct regpair_native host_sb_addr ; struct hc_status_block_sm state_machine[2U] ; struct pci_entity p_func ; u8 same_igu_sb_1b ; u8 dhc_qzone_id ; u8 state ; u8 rsrv0 ; struct regpair_native rsrv1[2U] ; }; struct hc_sp_status_block_data { struct regpair_native host_sb_addr ; u8 igu_sb_id ; u8 igu_seg_id ; u8 state ; u8 rsrv1 ; struct pci_entity p_func ; }; struct hc_status_block_data_e1x { struct hc_index_data index_data[8U] ; struct hc_sb_data common ; }; struct hc_status_block_data_e2 { struct hc_index_data index_data[8U] ; struct hc_sb_data common ; }; struct tstorm_per_pf_stats { struct regpair rcv_error_bytes ; }; struct per_pf_stats { struct tstorm_per_pf_stats tstorm_pf_statistics ; }; struct tstorm_per_port_stats { __le32 mac_discard ; __le32 mac_filter_discard ; __le32 brb_truncate_discard ; __le32 mf_tag_discard ; __le32 packet_drop ; __le32 reserved ; }; struct per_port_stats { struct tstorm_per_port_stats tstorm_port_statistics ; }; struct tstorm_per_queue_stats { struct regpair rcv_ucast_bytes ; __le32 rcv_ucast_pkts ; __le32 checksum_discard ; struct regpair rcv_bcast_bytes ; __le32 rcv_bcast_pkts ; __le32 pkts_too_big_discard ; struct regpair rcv_mcast_bytes ; __le32 rcv_mcast_pkts ; __le32 ttl0_discard ; __le16 no_buff_discard ; __le16 reserved0 ; __le32 reserved1 ; }; struct ustorm_per_queue_stats { struct regpair ucast_no_buff_bytes ; struct regpair mcast_no_buff_bytes ; struct regpair bcast_no_buff_bytes ; __le32 ucast_no_buff_pkts ; __le32 mcast_no_buff_pkts ; __le32 bcast_no_buff_pkts ; __le32 coalesced_pkts ; struct regpair coalesced_bytes ; __le32 coalesced_events ; __le32 coalesced_aborts ; }; struct xstorm_per_queue_stats { struct regpair ucast_bytes_sent ; struct regpair mcast_bytes_sent ; struct regpair bcast_bytes_sent ; __le32 ucast_pkts_sent ; __le32 mcast_pkts_sent ; __le32 bcast_pkts_sent ; __le32 error_drop_pkts ; }; struct per_queue_stats { struct tstorm_per_queue_stats tstorm_queue_statistics ; struct ustorm_per_queue_stats ustorm_queue_statistics ; struct xstorm_per_queue_stats xstorm_queue_statistics ; }; struct stats_counter { __le16 xstats_counter ; __le16 reserved0 ; __le32 reserved1 ; __le16 tstats_counter ; __le16 reserved2 ; __le32 reserved3 ; __le16 ustats_counter ; __le16 reserved4 ; __le32 reserved5 ; __le16 cstats_counter ; __le16 reserved6 ; __le32 reserved7 ; }; struct stats_query_entry { u8 kind ; u8 index ; __le16 funcID ; __le32 reserved ; struct regpair address ; }; struct stats_query_header { u8 cmd_num ; u8 reserved0 ; __le16 drv_stats_counter ; __le32 reserved1 ; struct regpair stats_counters_addrs ; }; struct kwqe { u32 kwqe_op_flag ; u32 kwqe_info0 ; u32 kwqe_info1 ; u32 kwqe_info2 ; u32 kwqe_info3 ; u32 kwqe_info4 ; u32 kwqe_info5 ; u32 kwqe_info6 ; }; struct kwqe_16 { u32 kwqe_info0 ; u32 kwqe_info1 ; u32 kwqe_info2 ; u32 kwqe_info3 ; }; struct cnic_ctl_completion { u32 cid ; u8 opcode ; u8 error ; }; union __anonunion_data_396 { struct cnic_ctl_completion comp ; char bytes[64U] ; }; struct cnic_ctl_info { int cmd ; union __anonunion_data_396 data ; }; struct drv_ctl_spq_credit { u32 credit_count ; }; struct drv_ctl_io { u32 cid_addr ; u32 offset ; u32 data ; dma_addr_t dma_addr ; }; struct drv_ctl_l2_ring { u32 client_id ; u32 cid ; }; struct drv_ctl_register_data { int ulp_type ; struct fcoe_capabilities fcoe_features ; }; union __anonunion_data_397 { struct drv_ctl_spq_credit credit ; struct drv_ctl_io io ; struct drv_ctl_l2_ring ring ; int ulp_type ; struct drv_ctl_register_data register_data ; char bytes[64U] ; }; struct drv_ctl_info { int cmd ; union __anonunion_data_397 data ; }; struct cnic_ops { struct module *cnic_owner ; int (*cnic_handler)(void * , void * ) ; int (*cnic_ctl)(void * , struct cnic_ctl_info * ) ; }; struct cnic_irq { unsigned int vector ; void *status_blk ; u32 status_blk_num ; u32 status_blk_num2 ; u32 irq_flags ; }; struct cnic_eth_dev { struct module *drv_owner ; u32 drv_state ; u32 chip_id ; u32 max_kwqe_pending ; struct pci_dev *pdev ; void *io_base ; void *io_base2 ; void const *iro_arr ; u32 ctx_tbl_offset ; u32 ctx_tbl_len ; int ctx_blk_size ; u32 starting_cid ; u32 max_iscsi_conn ; u32 max_fcoe_conn ; u32 max_rdma_conn ; u32 fcoe_init_cid ; u32 max_fcoe_exchanges ; u32 fcoe_wwn_port_name_hi ; u32 fcoe_wwn_port_name_lo ; u32 fcoe_wwn_node_name_hi ; u32 fcoe_wwn_node_name_lo ; u16 iscsi_l2_client_id ; u16 iscsi_l2_cid ; u8 iscsi_mac[6U] ; int num_irq ; struct cnic_irq irq_arr[8U] ; int (*drv_register_cnic)(struct net_device * , struct cnic_ops * , void * ) ; int (*drv_unregister_cnic)(struct net_device * ) ; int (*drv_submit_kwqes_32)(struct net_device * , struct kwqe ** , u32 ) ; int (*drv_submit_kwqes_16)(struct net_device * , struct kwqe_16 ** , u32 ) ; int (*drv_ctl)(struct net_device * , struct drv_ctl_info * ) ; unsigned long reserved1[2U] ; union drv_info_to_mcp *addr_drv_info_to_mcp ; }; struct mdio_if_info { int prtad ; u32 mmds ; unsigned int mode_support ; struct net_device *dev ; int (*mdio_read)(struct net_device * , int , int , u16 ) ; int (*mdio_write)(struct net_device * , int , int , u16 , u16 ) ; }; struct bnx2x_phy { u32 type ; u8 addr ; u8 def_md_devad ; u16 flags ; u16 rx_preemphasis[4U] ; u16 tx_preemphasis[4U] ; u32 mdio_ctrl ; u32 supported ; u32 media_type ; u32 ver_addr ; u16 req_flow_ctrl ; u16 req_line_speed ; u32 speed_cap_mask ; u16 req_duplex ; u16 rsrv ; u8 (*config_init)(struct bnx2x_phy * , struct link_params * , struct link_vars * ) ; u8 (*read_status)(struct bnx2x_phy * , struct link_params * , struct link_vars * ) ; void (*link_reset)(struct bnx2x_phy * , struct link_params * ) ; void (*config_loopback)(struct bnx2x_phy * , struct link_params * ) ; u8 (*format_fw_ver)(u32 , u8 * , u16 * ) ; void (*hw_reset)(struct bnx2x_phy * , struct link_params * ) ; void (*set_link_led)(struct bnx2x_phy * , struct link_params * , u8 ) ; void (*phy_specific_func)(struct bnx2x_phy * , struct link_params * , u32 ) ; }; struct link_params { u8 port ; u8 loopback_mode ; u8 mac_addr[6U] ; u16 req_duplex[2U] ; u16 req_flow_ctrl[2U] ; u16 req_line_speed[2U] ; u32 shmem_base ; u32 shmem2_base ; u32 speed_cap_mask[2U] ; u32 switch_cfg ; u32 lane_config ; u32 chip_id ; u32 feature_config_flags ; struct bnx2x_phy phy[3U] ; u8 num_phys ; u8 rsrv ; u32 eee_mode ; u16 hw_led_mode ; u32 multi_phy_config ; struct bnx2x *bp ; u16 req_fc_auto_adv ; u16 link_flags ; u32 lfa_base ; u32 link_attr_sync ; }; struct link_vars { u8 phy_flags ; u8 mac_type ; u8 phy_link_up ; u8 link_up ; u16 line_speed ; u16 duplex ; u16 flow_ctrl ; u16 ieee_fc ; u32 link_status ; u32 eee_status ; u8 fault_detected ; u8 check_kr2_recovery_cnt ; u16 periodic_flags ; u32 aeu_int_mask ; u8 rx_tx_asic_rst ; u8 turn_to_run_wc_rt ; u16 rsrv2 ; }; enum ldv_38581 { BNX2X_OBJ_TYPE_RX = 0, BNX2X_OBJ_TYPE_TX = 1, BNX2X_OBJ_TYPE_RX_TX = 2 } ; typedef enum ldv_38581 bnx2x_obj_type; struct bnx2x_raw_obj { u8 func_id ; u8 cl_id ; u32 cid ; void *rdata ; dma_addr_t rdata_mapping ; int state ; unsigned long *pstate ; bnx2x_obj_type obj_type ; int (*wait_comp)(struct bnx2x * , struct bnx2x_raw_obj * ) ; bool (*check_pending)(struct bnx2x_raw_obj * ) ; void (*clear_pending)(struct bnx2x_raw_obj * ) ; void (*set_pending)(struct bnx2x_raw_obj * ) ; }; struct bnx2x_mac_ramrod_data { u8 mac[6U] ; u8 is_inner_mac ; }; struct bnx2x_vlan_ramrod_data { u16 vlan ; }; struct bnx2x_vlan_mac_ramrod_data { u8 mac[6U] ; u8 is_inner_mac ; u16 vlan ; }; union bnx2x_classification_ramrod_data { struct bnx2x_mac_ramrod_data mac ; struct bnx2x_vlan_ramrod_data vlan ; struct bnx2x_vlan_mac_ramrod_data vlan_mac ; }; enum bnx2x_vlan_mac_cmd { BNX2X_VLAN_MAC_ADD = 0, BNX2X_VLAN_MAC_DEL = 1, BNX2X_VLAN_MAC_MOVE = 2 } ; struct bnx2x_vlan_mac_obj; struct bnx2x_vlan_mac_data { enum bnx2x_vlan_mac_cmd cmd ; unsigned long vlan_mac_flags ; struct bnx2x_vlan_mac_obj *target_obj ; union bnx2x_classification_ramrod_data u ; }; struct __anonstruct_mcast_401 { }; union bnx2x_exe_queue_cmd_data { struct bnx2x_vlan_mac_data vlan_mac ; struct __anonstruct_mcast_401 mcast ; }; struct bnx2x_exeq_elem { struct list_head link ; int cmd_len ; union bnx2x_exe_queue_cmd_data cmd_data ; }; union bnx2x_qable_obj; struct bnx2x_exe_queue_obj; struct bnx2x_exe_queue_obj { struct list_head exe_queue ; struct list_head pending_comp ; spinlock_t lock ; int exe_chunk_len ; union bnx2x_qable_obj *owner ; int (*validate)(struct bnx2x * , union bnx2x_qable_obj * , struct bnx2x_exeq_elem * ) ; int (*remove)(struct bnx2x * , union bnx2x_qable_obj * , struct bnx2x_exeq_elem * ) ; int (*optimize)(struct bnx2x * , union bnx2x_qable_obj * , struct bnx2x_exeq_elem * ) ; int (*execute)(struct bnx2x * , union bnx2x_qable_obj * , struct list_head * , unsigned long * ) ; struct bnx2x_exeq_elem *(*get)(struct bnx2x_exe_queue_obj * , struct bnx2x_exeq_elem * ) ; }; struct bnx2x_vlan_mac_registry_elem { struct list_head link ; int cam_offset ; unsigned long vlan_mac_flags ; union bnx2x_classification_ramrod_data u ; }; struct bnx2x_vlan_mac_ramrod_params { struct bnx2x_vlan_mac_obj *vlan_mac_obj ; unsigned long ramrod_flags ; struct bnx2x_vlan_mac_data user_req ; }; struct bnx2x_credit_pool_obj; struct bnx2x_vlan_mac_obj { struct bnx2x_raw_obj raw ; struct list_head head ; u8 head_reader ; bool head_exe_request ; unsigned long saved_ramrod_flags ; struct bnx2x_exe_queue_obj exe_queue ; struct bnx2x_credit_pool_obj *macs_pool ; struct bnx2x_credit_pool_obj *vlans_pool ; int ramrod_cmd ; int (*get_n_elements)(struct bnx2x * , struct bnx2x_vlan_mac_obj * , int , u8 * , u8 , u8 ) ; int (*check_add)(struct bnx2x * , struct bnx2x_vlan_mac_obj * , union bnx2x_classification_ramrod_data * ) ; struct bnx2x_vlan_mac_registry_elem *(*check_del)(struct bnx2x * , struct bnx2x_vlan_mac_obj * , union bnx2x_classification_ramrod_data * ) ; bool (*check_move)(struct bnx2x * , struct bnx2x_vlan_mac_obj * , struct bnx2x_vlan_mac_obj * , union bnx2x_classification_ramrod_data * ) ; bool (*get_credit)(struct bnx2x_vlan_mac_obj * ) ; bool (*put_credit)(struct bnx2x_vlan_mac_obj * ) ; bool (*get_cam_offset)(struct bnx2x_vlan_mac_obj * , int * ) ; bool (*put_cam_offset)(struct bnx2x_vlan_mac_obj * , int ) ; void (*set_one_rule)(struct bnx2x * , struct bnx2x_vlan_mac_obj * , struct bnx2x_exeq_elem * , int , int ) ; int (*delete_all)(struct bnx2x * , struct bnx2x_vlan_mac_obj * , unsigned long * , unsigned long * ) ; int (*restore)(struct bnx2x * , struct bnx2x_vlan_mac_ramrod_params * , struct bnx2x_vlan_mac_registry_elem ** ) ; int (*complete)(struct bnx2x * , struct bnx2x_vlan_mac_obj * , union event_ring_elem * , unsigned long * ) ; int (*wait)(struct bnx2x * , struct bnx2x_vlan_mac_obj * ) ; }; struct bnx2x_rx_mode_obj; struct bnx2x_rx_mode_ramrod_params { struct bnx2x_rx_mode_obj *rx_mode_obj ; unsigned long *pstate ; int state ; u8 cl_id ; u32 cid ; u8 func_id ; unsigned long ramrod_flags ; unsigned long rx_mode_flags ; void *rdata ; dma_addr_t rdata_mapping ; unsigned long rx_accept_flags ; unsigned long tx_accept_flags ; }; struct bnx2x_rx_mode_obj { int (*config_rx_mode)(struct bnx2x * , struct bnx2x_rx_mode_ramrod_params * ) ; int (*wait_comp)(struct bnx2x * , struct bnx2x_rx_mode_ramrod_params * ) ; }; struct bnx2x_mcast_list_elem { struct list_head link ; u8 *mac ; }; union bnx2x_mcast_config_data { u8 *mac ; u8 bin ; }; struct bnx2x_mcast_obj; struct bnx2x_mcast_ramrod_params { struct bnx2x_mcast_obj *mcast_obj ; unsigned long ramrod_flags ; struct list_head mcast_list ; int mcast_list_len ; }; enum bnx2x_mcast_cmd { BNX2X_MCAST_CMD_ADD = 0, BNX2X_MCAST_CMD_CONT = 1, BNX2X_MCAST_CMD_DEL = 2, BNX2X_MCAST_CMD_RESTORE = 3 } ; struct __anonstruct_aprox_match_403 { u64 vec[4U] ; int num_bins_set ; }; struct __anonstruct_exact_match_404 { struct list_head macs ; int num_macs_set ; }; union __anonunion_registry_402 { struct __anonstruct_aprox_match_403 aprox_match ; struct __anonstruct_exact_match_404 exact_match ; }; struct bnx2x_mcast_obj { struct bnx2x_raw_obj raw ; union __anonunion_registry_402 registry ; struct list_head pending_cmds_head ; int sched_state ; int max_cmd_len ; int total_pending_num ; u8 engine_id ; int (*config_mcast)(struct bnx2x * , struct bnx2x_mcast_ramrod_params * , enum bnx2x_mcast_cmd ) ; int (*hdl_restore)(struct bnx2x * , struct bnx2x_mcast_obj * , int , int * ) ; int (*enqueue_cmd)(struct bnx2x * , struct bnx2x_mcast_obj * , struct bnx2x_mcast_ramrod_params * , enum bnx2x_mcast_cmd ) ; void (*set_one_rule)(struct bnx2x * , struct bnx2x_mcast_obj * , int , union bnx2x_mcast_config_data * , enum bnx2x_mcast_cmd ) ; bool (*check_pending)(struct bnx2x_mcast_obj * ) ; void (*set_sched)(struct bnx2x_mcast_obj * ) ; void (*clear_sched)(struct bnx2x_mcast_obj * ) ; bool (*check_sched)(struct bnx2x_mcast_obj * ) ; int (*wait_comp)(struct bnx2x * , struct bnx2x_mcast_obj * ) ; int (*validate)(struct bnx2x * , struct bnx2x_mcast_ramrod_params * , enum bnx2x_mcast_cmd ) ; void (*revert)(struct bnx2x * , struct bnx2x_mcast_ramrod_params * , int ) ; int (*get_registry_size)(struct bnx2x_mcast_obj * ) ; void (*set_registry_size)(struct bnx2x_mcast_obj * , int ) ; }; struct bnx2x_credit_pool_obj { atomic_t credit ; int pool_sz ; u64 pool_mirror[4U] ; int base_pool_offset ; bool (*get_entry)(struct bnx2x_credit_pool_obj * , int * ) ; bool (*put_entry)(struct bnx2x_credit_pool_obj * , int ) ; bool (*get)(struct bnx2x_credit_pool_obj * , int ) ; bool (*put)(struct bnx2x_credit_pool_obj * , int ) ; int (*check)(struct bnx2x_credit_pool_obj * ) ; }; struct bnx2x_rss_config_obj; struct bnx2x_config_rss_params { struct bnx2x_rss_config_obj *rss_obj ; unsigned long ramrod_flags ; unsigned long rss_flags ; u8 rss_result_mask ; u8 ind_table[128U] ; u32 rss_key[10U] ; u16 toe_rss_bitmap ; }; struct bnx2x_rss_config_obj { struct bnx2x_raw_obj raw ; u8 engine_id ; u8 ind_table[128U] ; u8 udp_rss_v4 ; u8 udp_rss_v6 ; int (*config_rss)(struct bnx2x * , struct bnx2x_config_rss_params * ) ; }; enum bnx2x_q_state { BNX2X_Q_STATE_RESET = 0, BNX2X_Q_STATE_INITIALIZED = 1, BNX2X_Q_STATE_ACTIVE = 2, BNX2X_Q_STATE_MULTI_COS = 3, BNX2X_Q_STATE_MCOS_TERMINATED = 4, BNX2X_Q_STATE_INACTIVE = 5, BNX2X_Q_STATE_STOPPED = 6, BNX2X_Q_STATE_TERMINATED = 7, BNX2X_Q_STATE_FLRED = 8, BNX2X_Q_STATE_MAX = 9 } ; enum bnx2x_queue_cmd { BNX2X_Q_CMD_INIT = 0, BNX2X_Q_CMD_SETUP = 1, BNX2X_Q_CMD_SETUP_TX_ONLY = 2, BNX2X_Q_CMD_DEACTIVATE = 3, BNX2X_Q_CMD_ACTIVATE = 4, BNX2X_Q_CMD_UPDATE = 5, BNX2X_Q_CMD_UPDATE_TPA = 6, BNX2X_Q_CMD_HALT = 7, BNX2X_Q_CMD_CFC_DEL = 8, BNX2X_Q_CMD_TERMINATE = 9, BNX2X_Q_CMD_EMPTY = 10, BNX2X_Q_CMD_MAX = 11 } ; struct __anonstruct_tx_405 { unsigned long flags ; u16 hc_rate ; u8 fw_sb_id ; u8 sb_cq_index ; }; struct __anonstruct_rx_406 { unsigned long flags ; u16 hc_rate ; u8 fw_sb_id ; u8 sb_cq_index ; }; struct bnx2x_queue_init_params { struct __anonstruct_tx_405 tx ; struct __anonstruct_rx_406 rx ; struct eth_context *cxts[3U] ; u8 max_cos ; }; struct bnx2x_queue_terminate_params { u8 cid_index ; }; struct bnx2x_queue_cfc_del_params { u8 cid_index ; }; struct bnx2x_queue_update_params { unsigned long update_flags ; u16 def_vlan ; u16 silent_removal_value ; u16 silent_removal_mask ; u8 cid_index ; }; struct bnx2x_queue_update_tpa_params { dma_addr_t sge_map ; u8 update_ipv4 ; u8 update_ipv6 ; u8 max_tpa_queues ; u8 max_sges_pkt ; u8 complete_on_both_clients ; u8 dont_verify_thr ; u8 tpa_mode ; u8 _pad ; u16 sge_buff_sz ; u16 max_agg_sz ; u16 sge_pause_thr_low ; u16 sge_pause_thr_high ; }; struct rxq_pause_params { u16 bd_th_lo ; u16 bd_th_hi ; u16 rcq_th_lo ; u16 rcq_th_hi ; u16 sge_th_lo ; u16 sge_th_hi ; u16 pri_map ; }; struct bnx2x_general_setup_params { u8 stat_id ; u8 spcl_id ; u16 mtu ; u8 cos ; u8 fp_hsi ; }; struct bnx2x_rxq_setup_params { dma_addr_t dscr_map ; dma_addr_t sge_map ; dma_addr_t rcq_map ; dma_addr_t rcq_np_map ; u16 drop_flags ; u16 buf_sz ; u8 fw_sb_id ; u8 cl_qzone_id ; u16 tpa_agg_sz ; u16 sge_buf_sz ; u8 max_sges_pkt ; u8 max_tpa_queues ; u8 rss_engine_id ; u8 mcast_engine_id ; u8 cache_line_log ; u8 sb_cq_index ; u16 silent_removal_value ; u16 silent_removal_mask ; }; struct bnx2x_txq_setup_params { dma_addr_t dscr_map ; u8 fw_sb_id ; u8 sb_cq_index ; u8 cos ; u16 traffic_type ; u8 tss_leading_cl_id ; u16 default_vlan ; }; struct bnx2x_queue_setup_params { struct bnx2x_general_setup_params gen_params ; struct bnx2x_txq_setup_params txq_params ; struct bnx2x_rxq_setup_params rxq_params ; struct rxq_pause_params pause_params ; unsigned long flags ; }; struct bnx2x_queue_setup_tx_only_params { struct bnx2x_general_setup_params gen_params ; struct bnx2x_txq_setup_params txq_params ; unsigned long flags ; u8 cid_index ; }; struct bnx2x_queue_sp_obj; union __anonunion_params_407 { struct bnx2x_queue_update_params update ; struct bnx2x_queue_update_tpa_params update_tpa ; struct bnx2x_queue_setup_params setup ; struct bnx2x_queue_init_params init ; struct bnx2x_queue_setup_tx_only_params tx_only ; struct bnx2x_queue_terminate_params terminate ; struct bnx2x_queue_cfc_del_params cfc_del ; }; struct bnx2x_queue_state_params { struct bnx2x_queue_sp_obj *q_obj ; enum bnx2x_queue_cmd cmd ; unsigned long ramrod_flags ; union __anonunion_params_407 params ; }; struct bnx2x_queue_sp_obj { u32 cids[3U] ; u8 cl_id ; u8 func_id ; u8 max_cos ; u8 num_tx_only ; u8 next_tx_only ; enum bnx2x_q_state state ; enum bnx2x_q_state next_state ; unsigned long type ; unsigned long pending ; void *rdata ; dma_addr_t rdata_mapping ; int (*send_cmd)(struct bnx2x * , struct bnx2x_queue_state_params * ) ; int (*set_pending)(struct bnx2x_queue_sp_obj * , struct bnx2x_queue_state_params * ) ; int (*check_transition)(struct bnx2x * , struct bnx2x_queue_sp_obj * , struct bnx2x_queue_state_params * ) ; int (*complete_cmd)(struct bnx2x * , struct bnx2x_queue_sp_obj * , enum bnx2x_queue_cmd ) ; int (*wait_comp)(struct bnx2x * , struct bnx2x_queue_sp_obj * , enum bnx2x_queue_cmd ) ; }; enum bnx2x_func_state { BNX2X_F_STATE_RESET = 0, BNX2X_F_STATE_INITIALIZED = 1, BNX2X_F_STATE_STARTED = 2, BNX2X_F_STATE_TX_STOPPED = 3, BNX2X_F_STATE_MAX = 4 } ; enum bnx2x_func_cmd { BNX2X_F_CMD_HW_INIT = 0, BNX2X_F_CMD_START = 1, BNX2X_F_CMD_STOP = 2, BNX2X_F_CMD_HW_RESET = 3, BNX2X_F_CMD_AFEX_UPDATE = 4, BNX2X_F_CMD_AFEX_VIFLISTS = 5, BNX2X_F_CMD_TX_STOP = 6, BNX2X_F_CMD_TX_START = 7, BNX2X_F_CMD_SWITCH_UPDATE = 8, BNX2X_F_CMD_SET_TIMESYNC = 9, BNX2X_F_CMD_MAX = 10 } ; struct bnx2x_func_hw_init_params { u32 load_phase ; }; struct bnx2x_func_hw_reset_params { u32 reset_phase ; }; struct bnx2x_func_start_params { u16 mf_mode ; u16 sd_vlan_tag ; u8 network_cos_mode ; u8 tunnel_mode ; u8 tunn_clss_en ; u8 gre_tunnel_type ; u8 inner_gre_rss_en ; u8 class_fail ; u16 class_fail_ethtype ; u8 sd_vlan_force_pri ; u8 sd_vlan_force_pri_val ; u16 sd_vlan_eth_type ; u8 no_added_tags ; }; struct bnx2x_func_switch_update_params { unsigned long changes ; u16 vlan ; u16 vlan_eth_type ; u8 vlan_force_prio ; u8 tunnel_mode ; u8 gre_tunnel_type ; }; struct bnx2x_func_afex_update_params { u16 vif_id ; u16 afex_default_vlan ; u8 allowed_priorities ; }; struct bnx2x_func_afex_viflists_params { u16 vif_list_index ; u8 func_bit_map ; u8 afex_vif_list_command ; u8 func_to_clear ; }; struct bnx2x_func_tx_start_params { struct priority_cos traffic_type_to_priority_cos[8U] ; u8 dcb_enabled ; u8 dcb_version ; u8 dont_add_pri_0_en ; }; struct bnx2x_func_set_timesync_params { u8 drift_adjust_cmd ; u8 offset_cmd ; u8 add_sub_drift_adjust_value ; u8 drift_adjust_value ; u32 drift_adjust_period ; u64 offset_delta ; }; struct bnx2x_func_sp_obj; union __anonunion_params_408 { struct bnx2x_func_hw_init_params hw_init ; struct bnx2x_func_hw_reset_params hw_reset ; struct bnx2x_func_start_params start ; struct bnx2x_func_switch_update_params switch_update ; struct bnx2x_func_afex_update_params afex_update ; struct bnx2x_func_afex_viflists_params afex_viflists ; struct bnx2x_func_tx_start_params tx_start ; struct bnx2x_func_set_timesync_params set_timesync ; }; struct bnx2x_func_state_params { struct bnx2x_func_sp_obj *f_obj ; enum bnx2x_func_cmd cmd ; unsigned long ramrod_flags ; union __anonunion_params_408 params ; }; struct bnx2x_func_sp_drv_ops { int (*init_hw_cmn_chip)(struct bnx2x * ) ; int (*init_hw_cmn)(struct bnx2x * ) ; int (*init_hw_port)(struct bnx2x * ) ; int (*init_hw_func)(struct bnx2x * ) ; void (*reset_hw_cmn)(struct bnx2x * ) ; void (*reset_hw_port)(struct bnx2x * ) ; void (*reset_hw_func)(struct bnx2x * ) ; int (*gunzip_init)(struct bnx2x * ) ; void (*gunzip_end)(struct bnx2x * ) ; int (*init_fw)(struct bnx2x * ) ; void (*release_fw)(struct bnx2x * ) ; }; struct bnx2x_func_sp_obj { enum bnx2x_func_state state ; enum bnx2x_func_state next_state ; unsigned long pending ; void *rdata ; dma_addr_t rdata_mapping ; void *afex_rdata ; dma_addr_t afex_rdata_mapping ; struct mutex one_pending_mutex ; struct bnx2x_func_sp_drv_ops *drv ; int (*send_cmd)(struct bnx2x * , struct bnx2x_func_state_params * ) ; int (*check_transition)(struct bnx2x * , struct bnx2x_func_sp_obj * , struct bnx2x_func_state_params * ) ; int (*complete_cmd)(struct bnx2x * , struct bnx2x_func_sp_obj * , enum bnx2x_func_cmd ) ; int (*wait_comp)(struct bnx2x * , struct bnx2x_func_sp_obj * , enum bnx2x_func_cmd ) ; }; union bnx2x_qable_obj { struct bnx2x_vlan_mac_obj vlan_mac ; }; struct bnx2x_dcbx_app_params { u32 enabled ; u32 traffic_type_priority[3U] ; }; struct bnx2x_dcbx_cos_params { u32 bw_tbl ; u32 pri_bitmask ; u8 strict ; u8 pauseable ; }; struct bnx2x_dcbx_pg_params { u32 enabled ; u8 num_of_cos ; struct bnx2x_dcbx_cos_params cos_params[3U] ; }; struct bnx2x_dcbx_pfc_params { u32 enabled ; u32 priority_non_pauseable_mask ; }; struct bnx2x_dcbx_port_params { struct bnx2x_dcbx_pfc_params pfc ; struct bnx2x_dcbx_pg_params ets ; struct bnx2x_dcbx_app_params app ; }; struct bnx2x_admin_priority_app_table { u32 valid ; u32 priority ; u32 traffic_type ; u32 app_id ; }; struct bnx2x_config_dcbx_params { u32 overwrite_settings ; u32 admin_dcbx_version ; u32 admin_ets_enable ; u32 admin_pfc_enable ; u32 admin_tc_supported_tx_enable ; u32 admin_ets_configuration_tx_enable ; u32 admin_ets_recommendation_tx_enable ; u32 admin_pfc_tx_enable ; u32 admin_application_priority_tx_enable ; u32 admin_ets_willing ; u32 admin_ets_reco_valid ; u32 admin_pfc_willing ; u32 admin_app_priority_willing ; u32 admin_configuration_bw_precentage[8U] ; u32 admin_configuration_ets_pg[8U] ; u32 admin_recommendation_bw_precentage[8U] ; u32 admin_recommendation_ets_pg[8U] ; u32 admin_pfc_bitmap ; struct bnx2x_admin_priority_app_table admin_priority_app_table[4U] ; u32 admin_default_priority ; }; struct nig_stats { u32 brb_discard ; u32 brb_packet ; u32 brb_truncate ; u32 flow_ctrl_discard ; u32 flow_ctrl_octets ; u32 flow_ctrl_packet ; u32 mng_discard ; u32 mng_octet_inp ; u32 mng_octet_out ; u32 mng_packet_inp ; u32 mng_packet_out ; u32 pbf_octets ; u32 pbf_packet ; u32 safc_inp ; u32 egress_mac_pkt0_lo ; u32 egress_mac_pkt0_hi ; u32 egress_mac_pkt1_lo ; u32 egress_mac_pkt1_hi ; }; enum bnx2x_stats_event { STATS_EVENT_PMF = 0, STATS_EVENT_LINK_UP = 1, STATS_EVENT_UPDATE = 2, STATS_EVENT_STOP = 3, STATS_EVENT_MAX = 4 } ; struct bnx2x_eth_stats { u32 total_bytes_received_hi ; u32 total_bytes_received_lo ; u32 total_bytes_transmitted_hi ; u32 total_bytes_transmitted_lo ; u32 total_unicast_packets_received_hi ; u32 total_unicast_packets_received_lo ; u32 total_multicast_packets_received_hi ; u32 total_multicast_packets_received_lo ; u32 total_broadcast_packets_received_hi ; u32 total_broadcast_packets_received_lo ; u32 total_unicast_packets_transmitted_hi ; u32 total_unicast_packets_transmitted_lo ; u32 total_multicast_packets_transmitted_hi ; u32 total_multicast_packets_transmitted_lo ; u32 total_broadcast_packets_transmitted_hi ; u32 total_broadcast_packets_transmitted_lo ; u32 valid_bytes_received_hi ; u32 valid_bytes_received_lo ; u32 error_bytes_received_hi ; u32 error_bytes_received_lo ; u32 etherstatsoverrsizepkts_hi ; u32 etherstatsoverrsizepkts_lo ; u32 no_buff_discard_hi ; u32 no_buff_discard_lo ; u32 rx_stat_ifhcinbadoctets_hi ; u32 rx_stat_ifhcinbadoctets_lo ; u32 tx_stat_ifhcoutbadoctets_hi ; u32 tx_stat_ifhcoutbadoctets_lo ; u32 rx_stat_dot3statsfcserrors_hi ; u32 rx_stat_dot3statsfcserrors_lo ; u32 rx_stat_dot3statsalignmenterrors_hi ; u32 rx_stat_dot3statsalignmenterrors_lo ; u32 rx_stat_dot3statscarriersenseerrors_hi ; u32 rx_stat_dot3statscarriersenseerrors_lo ; u32 rx_stat_falsecarriererrors_hi ; u32 rx_stat_falsecarriererrors_lo ; u32 rx_stat_etherstatsundersizepkts_hi ; u32 rx_stat_etherstatsundersizepkts_lo ; u32 rx_stat_dot3statsframestoolong_hi ; u32 rx_stat_dot3statsframestoolong_lo ; u32 rx_stat_etherstatsfragments_hi ; u32 rx_stat_etherstatsfragments_lo ; u32 rx_stat_etherstatsjabbers_hi ; u32 rx_stat_etherstatsjabbers_lo ; u32 rx_stat_maccontrolframesreceived_hi ; u32 rx_stat_maccontrolframesreceived_lo ; u32 rx_stat_bmac_xpf_hi ; u32 rx_stat_bmac_xpf_lo ; u32 rx_stat_bmac_xcf_hi ; u32 rx_stat_bmac_xcf_lo ; u32 rx_stat_xoffstateentered_hi ; u32 rx_stat_xoffstateentered_lo ; u32 rx_stat_xonpauseframesreceived_hi ; u32 rx_stat_xonpauseframesreceived_lo ; u32 rx_stat_xoffpauseframesreceived_hi ; u32 rx_stat_xoffpauseframesreceived_lo ; u32 tx_stat_outxonsent_hi ; u32 tx_stat_outxonsent_lo ; u32 tx_stat_outxoffsent_hi ; u32 tx_stat_outxoffsent_lo ; u32 tx_stat_flowcontroldone_hi ; u32 tx_stat_flowcontroldone_lo ; u32 tx_stat_etherstatscollisions_hi ; u32 tx_stat_etherstatscollisions_lo ; u32 tx_stat_dot3statssinglecollisionframes_hi ; u32 tx_stat_dot3statssinglecollisionframes_lo ; u32 tx_stat_dot3statsmultiplecollisionframes_hi ; u32 tx_stat_dot3statsmultiplecollisionframes_lo ; u32 tx_stat_dot3statsdeferredtransmissions_hi ; u32 tx_stat_dot3statsdeferredtransmissions_lo ; u32 tx_stat_dot3statsexcessivecollisions_hi ; u32 tx_stat_dot3statsexcessivecollisions_lo ; u32 tx_stat_dot3statslatecollisions_hi ; u32 tx_stat_dot3statslatecollisions_lo ; u32 tx_stat_etherstatspkts64octets_hi ; u32 tx_stat_etherstatspkts64octets_lo ; u32 tx_stat_etherstatspkts65octetsto127octets_hi ; u32 tx_stat_etherstatspkts65octetsto127octets_lo ; u32 tx_stat_etherstatspkts128octetsto255octets_hi ; u32 tx_stat_etherstatspkts128octetsto255octets_lo ; u32 tx_stat_etherstatspkts256octetsto511octets_hi ; u32 tx_stat_etherstatspkts256octetsto511octets_lo ; u32 tx_stat_etherstatspkts512octetsto1023octets_hi ; u32 tx_stat_etherstatspkts512octetsto1023octets_lo ; u32 tx_stat_etherstatspkts1024octetsto1522octets_hi ; u32 tx_stat_etherstatspkts1024octetsto1522octets_lo ; u32 tx_stat_etherstatspktsover1522octets_hi ; u32 tx_stat_etherstatspktsover1522octets_lo ; u32 tx_stat_bmac_2047_hi ; u32 tx_stat_bmac_2047_lo ; u32 tx_stat_bmac_4095_hi ; u32 tx_stat_bmac_4095_lo ; u32 tx_stat_bmac_9216_hi ; u32 tx_stat_bmac_9216_lo ; u32 tx_stat_bmac_16383_hi ; u32 tx_stat_bmac_16383_lo ; u32 tx_stat_dot3statsinternalmactransmiterrors_hi ; u32 tx_stat_dot3statsinternalmactransmiterrors_lo ; u32 tx_stat_bmac_ufl_hi ; u32 tx_stat_bmac_ufl_lo ; u32 pause_frames_received_hi ; u32 pause_frames_received_lo ; u32 pause_frames_sent_hi ; u32 pause_frames_sent_lo ; u32 etherstatspkts1024octetsto1522octets_hi ; u32 etherstatspkts1024octetsto1522octets_lo ; u32 etherstatspktsover1522octets_hi ; u32 etherstatspktsover1522octets_lo ; u32 brb_drop_hi ; u32 brb_drop_lo ; u32 brb_truncate_hi ; u32 brb_truncate_lo ; u32 mac_filter_discard ; u32 mf_tag_discard ; u32 brb_truncate_discard ; u32 mac_discard ; u32 driver_xoff ; u32 rx_err_discard_pkt ; u32 rx_skb_alloc_failed ; u32 hw_csum_err ; u32 nig_timer_max ; u32 total_tpa_aggregations_hi ; u32 total_tpa_aggregations_lo ; u32 total_tpa_aggregated_frames_hi ; u32 total_tpa_aggregated_frames_lo ; u32 total_tpa_bytes_hi ; u32 total_tpa_bytes_lo ; u32 pfc_frames_received_hi ; u32 pfc_frames_received_lo ; u32 pfc_frames_sent_hi ; u32 pfc_frames_sent_lo ; u32 recoverable_error ; u32 unrecoverable_error ; u32 driver_filtered_tx_pkt ; u32 eee_tx_lpi ; }; struct bnx2x_eth_q_stats { u32 total_unicast_bytes_received_hi ; u32 total_unicast_bytes_received_lo ; u32 total_broadcast_bytes_received_hi ; u32 total_broadcast_bytes_received_lo ; u32 total_multicast_bytes_received_hi ; u32 total_multicast_bytes_received_lo ; u32 total_bytes_received_hi ; u32 total_bytes_received_lo ; u32 total_unicast_bytes_transmitted_hi ; u32 total_unicast_bytes_transmitted_lo ; u32 total_broadcast_bytes_transmitted_hi ; u32 total_broadcast_bytes_transmitted_lo ; u32 total_multicast_bytes_transmitted_hi ; u32 total_multicast_bytes_transmitted_lo ; u32 total_bytes_transmitted_hi ; u32 total_bytes_transmitted_lo ; u32 total_unicast_packets_received_hi ; u32 total_unicast_packets_received_lo ; u32 total_multicast_packets_received_hi ; u32 total_multicast_packets_received_lo ; u32 total_broadcast_packets_received_hi ; u32 total_broadcast_packets_received_lo ; u32 total_unicast_packets_transmitted_hi ; u32 total_unicast_packets_transmitted_lo ; u32 total_multicast_packets_transmitted_hi ; u32 total_multicast_packets_transmitted_lo ; u32 total_broadcast_packets_transmitted_hi ; u32 total_broadcast_packets_transmitted_lo ; u32 valid_bytes_received_hi ; u32 valid_bytes_received_lo ; u32 etherstatsoverrsizepkts_hi ; u32 etherstatsoverrsizepkts_lo ; u32 no_buff_discard_hi ; u32 no_buff_discard_lo ; u32 driver_xoff ; u32 rx_err_discard_pkt ; u32 rx_skb_alloc_failed ; u32 hw_csum_err ; u32 total_packets_received_checksum_discarded_hi ; u32 total_packets_received_checksum_discarded_lo ; u32 total_packets_received_ttl0_discarded_hi ; u32 total_packets_received_ttl0_discarded_lo ; u32 total_transmitted_dropped_packets_error_hi ; u32 total_transmitted_dropped_packets_error_lo ; u32 total_tpa_aggregations_hi ; u32 total_tpa_aggregations_lo ; u32 total_tpa_aggregated_frames_hi ; u32 total_tpa_aggregated_frames_lo ; u32 total_tpa_bytes_hi ; u32 total_tpa_bytes_lo ; u32 driver_filtered_tx_pkt ; }; struct bnx2x_eth_stats_old { u32 rx_stat_dot3statsframestoolong_hi ; u32 rx_stat_dot3statsframestoolong_lo ; }; struct bnx2x_eth_q_stats_old { u32 total_unicast_bytes_received_hi ; u32 total_unicast_bytes_received_lo ; u32 total_broadcast_bytes_received_hi ; u32 total_broadcast_bytes_received_lo ; u32 total_multicast_bytes_received_hi ; u32 total_multicast_bytes_received_lo ; u32 total_unicast_bytes_transmitted_hi ; u32 total_unicast_bytes_transmitted_lo ; u32 total_broadcast_bytes_transmitted_hi ; u32 total_broadcast_bytes_transmitted_lo ; u32 total_multicast_bytes_transmitted_hi ; u32 total_multicast_bytes_transmitted_lo ; u32 total_tpa_bytes_hi ; u32 total_tpa_bytes_lo ; u32 total_bytes_received_hi ; u32 total_bytes_received_lo ; u32 total_bytes_transmitted_hi ; u32 total_bytes_transmitted_lo ; u32 total_unicast_packets_received_hi ; u32 total_unicast_packets_received_lo ; u32 total_multicast_packets_received_hi ; u32 total_multicast_packets_received_lo ; u32 total_broadcast_packets_received_hi ; u32 total_broadcast_packets_received_lo ; u32 total_unicast_packets_transmitted_hi ; u32 total_unicast_packets_transmitted_lo ; u32 total_multicast_packets_transmitted_hi ; u32 total_multicast_packets_transmitted_lo ; u32 total_broadcast_packets_transmitted_hi ; u32 total_broadcast_packets_transmitted_lo ; u32 valid_bytes_received_hi ; u32 valid_bytes_received_lo ; u32 total_tpa_bytes_hi_old ; u32 total_tpa_bytes_lo_old ; u32 driver_xoff_old ; u32 rx_err_discard_pkt_old ; u32 rx_skb_alloc_failed_old ; u32 hw_csum_err_old ; u32 driver_filtered_tx_pkt_old ; }; struct bnx2x_net_stats_old { u32 rx_dropped ; }; struct bnx2x_fw_port_stats_old { u32 mac_filter_discard ; u32 mf_tag_discard ; u32 brb_truncate_discard ; u32 mac_discard ; }; struct vf_pf_resc_request { u8 num_rxqs ; u8 num_txqs ; u8 num_sbs ; u8 num_mac_filters ; u8 num_vlan_filters ; u8 num_mc_filters ; }; struct hw_sb_info { u8 hw_sb_id ; u8 sb_qid ; }; struct channel_tlv { u16 type ; u16 length ; }; struct vfpf_first_tlv { struct channel_tlv tl ; u32 resp_msg_offset ; }; struct pfvf_tlv { struct channel_tlv tl ; u8 status ; u8 padding[3U] ; }; struct pfvf_general_resp_tlv { struct pfvf_tlv hdr ; }; struct channel_list_end_tlv { struct channel_tlv tl ; u8 padding[4U] ; }; struct vf_pf_vfdev_info { u8 vf_id ; u8 vf_os ; u8 fp_hsi_ver ; u8 caps ; }; struct vfpf_acquire_tlv { struct vfpf_first_tlv first_tlv ; struct vf_pf_vfdev_info vfdev_info ; struct vf_pf_resc_request resc_request ; __u64 bulletin_addr ; }; struct vfpf_q_op_tlv { struct vfpf_first_tlv first_tlv ; u8 vf_qid ; u8 padding[3U] ; }; struct vfpf_rss_tlv { struct vfpf_first_tlv first_tlv ; u32 rss_flags ; u8 rss_result_mask ; u8 ind_table_size ; u8 rss_key_size ; u8 padding ; u8 ind_table[128U] ; u32 rss_key[10U] ; }; struct pf_vf_pfdev_info { u32 chip_num ; u32 pf_cap ; char fw_ver[32U] ; u16 db_size ; u8 indices_per_sb ; u8 padding ; }; struct pf_vf_resc { struct hw_sb_info hw_sbs[16U] ; u8 hw_qid[16U] ; u8 num_rxqs ; u8 num_txqs ; u8 num_sbs ; u8 num_mac_filters ; u8 num_vlan_filters ; u8 num_mc_filters ; u8 permanent_mac_addr[6U] ; u8 current_mac_addr[6U] ; u8 padding[2U] ; }; struct pfvf_acquire_resp_tlv { struct pfvf_tlv hdr ; struct pf_vf_pfdev_info pfdev_info ; struct pf_vf_resc resc ; }; struct vfpf_init_tlv { struct vfpf_first_tlv first_tlv ; __u64 sb_addr[16U] ; __u64 spq_addr ; __u64 stats_addr ; u16 stats_stride ; u32 flags ; u32 padding[2U] ; }; struct vf_pf_rxq_params { __u64 rcq_addr ; __u64 rcq_np_addr ; __u64 rxq_addr ; __u64 sge_addr ; u8 vf_sb ; u8 sb_index ; u16 hc_rate ; u16 mtu ; u16 buf_sz ; u16 flags ; u16 stat_id ; u16 sge_buf_sz ; u16 tpa_agg_sz ; u8 max_sge_pkt ; u8 drop_flags ; u8 cache_line_log ; u8 padding ; }; struct vf_pf_txq_params { __u64 txq_addr ; u8 vf_sb ; u8 sb_index ; u16 hc_rate ; u32 flags ; u16 stat_id ; u8 traffic_type ; u8 padding ; }; struct vfpf_setup_q_tlv { struct vfpf_first_tlv first_tlv ; struct vf_pf_rxq_params rxq ; struct vf_pf_txq_params txq ; u8 vf_qid ; u8 param_valid ; u8 padding[2U] ; }; struct vfpf_q_mac_vlan_filter { u32 flags ; u8 mac[6U] ; u16 vlan_tag ; }; struct vfpf_set_q_filters_tlv { struct vfpf_first_tlv first_tlv ; u32 flags ; u8 vf_qid ; u8 n_mac_vlan_filters ; u8 n_multicast ; u8 padding ; struct vfpf_q_mac_vlan_filter filters[32U] ; u8 multicast[32U][6U] ; u32 rx_mask ; }; struct vf_pf_tpa_client_info { __u64 sge_addr[16U] ; u8 update_ipv4 ; u8 update_ipv6 ; u8 max_tpa_queues ; u8 max_sges_for_packet ; u8 complete_on_both_clients ; u8 dont_verify_thr ; u8 tpa_mode ; u16 sge_buff_size ; u16 max_agg_size ; u16 sge_pause_thr_low ; u16 sge_pause_thr_high ; }; struct vfpf_tpa_tlv { struct vfpf_first_tlv first_tlv ; struct vf_pf_tpa_client_info tpa_client_info ; }; struct vfpf_close_tlv { struct vfpf_first_tlv first_tlv ; u16 vf_id ; u8 padding[2U] ; }; struct vfpf_release_tlv { struct vfpf_first_tlv first_tlv ; u16 vf_id ; u8 padding[2U] ; }; struct tlv_buffer_size { u8 tlv_buffer[1024U] ; }; union vfpf_tlvs { struct vfpf_first_tlv first_tlv ; struct vfpf_acquire_tlv acquire ; struct vfpf_init_tlv init ; struct vfpf_close_tlv close ; struct vfpf_q_op_tlv q_op ; struct vfpf_setup_q_tlv setup_q ; struct vfpf_set_q_filters_tlv set_q_filters ; struct vfpf_release_tlv release ; struct vfpf_rss_tlv update_rss ; struct vfpf_tpa_tlv update_tpa ; struct channel_list_end_tlv list_end ; struct tlv_buffer_size tlv_buf_size ; }; union pfvf_tlvs { struct pfvf_general_resp_tlv general_resp ; struct pfvf_acquire_resp_tlv acquire_resp ; struct channel_list_end_tlv list_end ; struct tlv_buffer_size tlv_buf_size ; }; struct pf_vf_bulletin_size { u8 size[512U] ; }; struct pf_vf_bulletin_content { u32 crc ; u16 version ; u16 length ; __u64 valid_bitmap ; u8 mac[6U] ; u8 mac_padding[2U] ; u16 vlan ; u8 vlan_padding[6U] ; u16 link_speed ; u8 link_speed_padding[6U] ; u32 link_flags ; u8 link_flags_padding[4U] ; }; union pf_vf_bulletin { struct pf_vf_bulletin_content content ; struct pf_vf_bulletin_size size ; }; enum channel_tlvs { CHANNEL_TLV_NONE = 0, CHANNEL_TLV_ACQUIRE = 1, CHANNEL_TLV_INIT = 2, CHANNEL_TLV_SETUP_Q = 3, CHANNEL_TLV_SET_Q_FILTERS = 4, CHANNEL_TLV_ACTIVATE_Q = 5, CHANNEL_TLV_DEACTIVATE_Q = 6, CHANNEL_TLV_TEARDOWN_Q = 7, CHANNEL_TLV_CLOSE = 8, CHANNEL_TLV_RELEASE = 9, CHANNEL_TLV_UPDATE_RSS_DEPRECATED = 10, CHANNEL_TLV_PF_RELEASE_VF = 11, CHANNEL_TLV_LIST_END = 12, CHANNEL_TLV_FLR = 13, CHANNEL_TLV_PF_SET_MAC = 14, CHANNEL_TLV_PF_SET_VLAN = 15, CHANNEL_TLV_UPDATE_RSS = 16, CHANNEL_TLV_PHYS_PORT_ID = 17, CHANNEL_TLV_UPDATE_TPA = 18, CHANNEL_TLV_FP_HSI_SUPPORT = 19, CHANNEL_TLV_MAX = 20 } ; struct sw_rx_bd { u8 *data ; dma_addr_t mapping ; }; struct sw_tx_bd { struct sk_buff *skb ; u16 first_bd ; u8 flags ; }; struct sw_rx_page { struct page *page ; dma_addr_t mapping ; unsigned int offset ; }; union db_prod { struct doorbell_set_prod data ; u32 raw ; }; union host_hc_status_block { struct host_hc_status_block_e1x *e1x_sb ; struct host_hc_status_block_e2 *e2_sb ; }; struct bnx2x_agg_info { struct sw_rx_bd first_buf ; u8 tpa_state ; u8 placement_offset ; u16 parsing_flags ; u16 vlan_tag ; u16 len_on_bd ; u32 rxhash ; enum pkt_hash_types rxhash_type ; u16 gro_size ; u16 full_page ; }; struct bnx2x_fastpath; struct bnx2x_fp_txdata { struct sw_tx_bd *tx_buf_ring ; union eth_tx_bd_types *tx_desc_ring ; dma_addr_t tx_desc_mapping ; u32 cid ; union db_prod tx_db ; u16 tx_pkt_prod ; u16 tx_pkt_cons ; u16 tx_bd_prod ; u16 tx_bd_cons ; unsigned long tx_pkt ; __le16 *tx_cons_sb ; int txq_index ; struct bnx2x_fastpath *parent_fp ; int tx_ring_size ; }; enum bnx2x_tpa_mode_t { TPA_MODE_DISABLED = 0, TPA_MODE_LRO = 1, TPA_MODE_GRO = 2 } ; struct bnx2x_alloc_pool { struct page *page ; unsigned int offset ; }; struct bnx2x_fastpath { struct bnx2x *bp ; struct napi_struct napi ; unsigned long busy_poll_state ; union host_hc_status_block status_blk ; __le16 *sb_index_values ; __le16 *sb_running_index ; u32 ustorm_rx_prods_offset ; u32 rx_buf_size ; u32 rx_frag_size ; dma_addr_t status_blk_mapping ; enum bnx2x_tpa_mode_t mode ; u8 max_cos ; struct bnx2x_fp_txdata *txdata_ptr[3U] ; struct sw_rx_bd *rx_buf_ring ; struct sw_rx_page *rx_page_ring ; struct eth_rx_bd *rx_desc_ring ; dma_addr_t rx_desc_mapping ; union eth_rx_cqe *rx_comp_ring ; dma_addr_t rx_comp_mapping ; struct eth_rx_sge *rx_sge_ring ; dma_addr_t rx_sge_mapping ; u64 sge_mask[16U] ; u32 cid ; __le16 fp_hc_idx ; u8 index ; u8 rx_queue ; u8 cl_id ; u8 cl_qzone_id ; u8 fw_sb_id ; u8 igu_sb_id ; u16 rx_bd_prod ; u16 rx_bd_cons ; u16 rx_comp_prod ; u16 rx_comp_cons ; u16 rx_sge_prod ; u16 last_max_sge ; __le16 *rx_cons_sb ; unsigned long rx_pkt ; unsigned long rx_calls ; struct bnx2x_agg_info *tpa_info ; char name[24U] ; struct bnx2x_alloc_pool page_pool ; }; struct bnx2x_common { u32 chip_id ; int flash_size ; u32 shmem_base ; u32 shmem2_base ; u32 mf_cfg_base ; u32 mf2_cfg_base ; u32 hw_config ; u32 bc_ver ; u8 int_block ; u8 chip_port_mode ; u32 boot_mode ; }; struct bnx2x_port { u32 pmf ; u32 link_config[2U] ; u32 supported[2U] ; u32 advertising[2U] ; u32 phy_addr ; struct mutex phy_mutex ; u32 port_stx ; struct nig_stats old_nig_stats ; }; union cdu_context { struct eth_context eth ; char pad[1024U] ; }; union __anonunion_mac_rdata_415 { struct mac_configuration_cmd e1x ; struct eth_classify_rules_ramrod_data e2 ; }; union __anonunion_rx_mode_rdata_416 { struct tstorm_eth_mac_filter_config e1x ; struct eth_filter_rules_ramrod_data e2 ; }; union __anonunion_mcast_rdata_417 { struct mac_configuration_cmd e1 ; struct eth_multicast_rules_ramrod_data e2 ; }; union __anonunion_q_rdata_418 { struct client_init_ramrod_data init_data ; struct client_update_ramrod_data update_data ; struct tpa_update_ramrod_data tpa_data ; }; union __anonunion_func_rdata_419 { struct function_start_data func_start ; struct flow_control_configuration pfc_config ; }; union __anonunion_func_afex_rdata_420 { struct afex_vif_list_ramrod_data viflist_data ; struct function_update_data func_update ; }; struct bnx2x_slowpath { union __anonunion_mac_rdata_415 mac_rdata ; union __anonunion_rx_mode_rdata_416 rx_mode_rdata ; union __anonunion_mcast_rdata_417 mcast_rdata ; struct eth_rss_update_ramrod_data rss_rdata ; union __anonunion_q_rdata_418 q_rdata ; union __anonunion_func_rdata_419 func_rdata ; union __anonunion_func_afex_rdata_420 func_afex_rdata ; struct dmae_command dmae[8U] ; u32 stats_comp ; union mac_stats mac_stats ; struct nig_stats nig_stats ; struct host_port_stats port_stats ; struct host_func_stats func_stats ; u32 wb_comp ; u32 wb_data[4U] ; union drv_info_to_mcp drv_info_to_mcp ; }; struct attn_route { u32 sig[5U] ; }; struct iro { u32 base ; u16 m1 ; u16 m2 ; u16 m3 ; u16 size ; }; struct hw_context { union cdu_context *vcxt ; dma_addr_t cxt_mapping ; size_t size ; }; struct bnx2x_ilt; struct bnx2x_vfdb; enum bnx2x_recovery_state { BNX2X_RECOVERY_DONE = 0, BNX2X_RECOVERY_INIT = 1, BNX2X_RECOVERY_WAIT = 2, BNX2X_RECOVERY_FAILED = 3, BNX2X_RECOVERY_NIC_LOADING = 4 } ; struct bnx2x_link_report_data { u16 line_speed ; unsigned long link_report_flags ; }; struct bnx2x_fw_stats_req { struct stats_query_header hdr ; struct stats_query_entry query[19U] ; }; struct bnx2x_fw_stats_data { struct stats_counter storm_counters ; struct per_port_stats port ; struct per_pf_stats pf ; struct fcoe_statistics_params fcoe ; struct per_queue_stats queue_stats[1U] ; }; enum sp_rtnl_flag { BNX2X_SP_RTNL_SETUP_TC = 0, BNX2X_SP_RTNL_TX_TIMEOUT = 1, BNX2X_SP_RTNL_FAN_FAILURE = 2, BNX2X_SP_RTNL_AFEX_F_UPDATE = 3, BNX2X_SP_RTNL_ENABLE_SRIOV = 4, BNX2X_SP_RTNL_VFPF_MCAST = 5, BNX2X_SP_RTNL_VFPF_CHANNEL_DOWN = 6, BNX2X_SP_RTNL_RX_MODE = 7, BNX2X_SP_RTNL_HYPERVISOR_VLAN = 8, BNX2X_SP_RTNL_TX_STOP = 9, BNX2X_SP_RTNL_GET_DRV_VERSION = 10 } ; enum bnx2x_iov_flag { BNX2X_IOV_HANDLE_VF_MSG = 0, BNX2X_IOV_HANDLE_FLR = 1 } ; struct bnx2x_prev_path_list { struct list_head list ; u8 bus ; u8 slot ; u8 path ; u8 aer ; u8 undi ; }; struct bnx2x_sp_objs { struct bnx2x_vlan_mac_obj mac_obj ; struct bnx2x_queue_sp_obj q_obj ; }; struct bnx2x_fp_stats { struct tstorm_per_queue_stats old_tclient ; struct ustorm_per_queue_stats old_uclient ; struct xstorm_per_queue_stats old_xclient ; struct bnx2x_eth_q_stats eth_q_stats ; struct bnx2x_eth_q_stats_old eth_q_stats_old ; }; struct bnx2x_vf_mbx_msg; struct raw_op; struct firmware; struct bnx2x { struct bnx2x_fastpath *fp ; struct bnx2x_sp_objs *sp_objs ; struct bnx2x_fp_stats *fp_stats ; struct bnx2x_fp_txdata *bnx2x_txq ; void *regview ; void *doorbells ; u16 db_size ; u8 pf_num ; u8 pfid ; int base_fw_ndsb ; struct mutex vf2pf_mutex ; struct bnx2x_vf_mbx_msg *vf2pf_mbox ; dma_addr_t vf2pf_mbox_mapping ; struct pfvf_acquire_resp_tlv acquire_resp ; union pf_vf_bulletin *pf2vf_bulletin ; dma_addr_t pf2vf_bulletin_mapping ; union pf_vf_bulletin shadow_bulletin ; struct pf_vf_bulletin_content old_bulletin ; u16 requested_nr_virtfn ; struct net_device *dev ; struct pci_dev *pdev ; struct iro const *iro_arr ; enum bnx2x_recovery_state recovery_state ; int is_leader ; struct msix_entry *msix_table ; int tx_ring_size ; struct host_sp_status_block *def_status_blk ; __le16 def_idx ; __le16 def_att_idx ; u32 attn_state ; struct attn_route attn_group[8U] ; struct eth_spe *spq ; dma_addr_t spq_mapping ; u16 spq_prod_idx ; struct eth_spe *spq_prod_bd ; struct eth_spe *spq_last_bd ; __le16 *dsb_sp_prod ; atomic_t cq_spq_left ; spinlock_t spq_lock ; union event_ring_elem *eq_ring ; dma_addr_t eq_mapping ; u16 eq_prod ; u16 eq_cons ; __le16 *eq_cons_sb ; atomic_t eq_spq_left ; u16 stats_pending ; u16 stats_comp ; int panic ; int msg_enable ; u32 flags ; u8 cnic_support ; bool cnic_enabled ; bool cnic_loaded ; struct cnic_eth_dev *(*cnic_probe)(struct net_device * ) ; bool fcoe_init ; int mrrs ; struct delayed_work sp_task ; struct delayed_work iov_task ; atomic_t interrupt_occurred ; struct delayed_work sp_rtnl_task ; struct delayed_work period_task ; struct timer_list timer ; int current_interval ; u16 fw_seq ; u16 fw_drv_pulse_wr_seq ; u32 func_stx ; struct link_params link_params ; struct link_vars link_vars ; u32 link_cnt ; struct bnx2x_link_report_data last_reported_link ; struct mdio_if_info mdio ; struct bnx2x_common common ; struct bnx2x_port port ; struct cmng_init cmng ; u32 mf_config[4U] ; u32 mf_ext_config ; u32 path_has_ovlan ; u16 mf_ov ; u8 mf_mode ; u8 mf_sub_mode ; u8 wol ; int rx_ring_size ; u16 tx_quick_cons_trip_int ; u16 tx_quick_cons_trip ; u16 tx_ticks_int ; u16 tx_ticks ; u16 rx_quick_cons_trip_int ; u16 rx_quick_cons_trip ; u16 rx_ticks_int ; u16 rx_ticks ; u32 lin_cnt ; u16 state ; int num_queues ; uint num_ethernet_queues ; uint num_cnic_queues ; int disable_tpa ; u32 rx_mode ; u8 igu_dsb_id ; u8 igu_base_sb ; u8 igu_sb_cnt ; u8 min_msix_vec_cnt ; u32 igu_base_addr ; dma_addr_t def_status_blk_mapping ; struct bnx2x_slowpath *slowpath ; dma_addr_t slowpath_mapping ; struct mutex drv_info_mutex ; bool drv_info_mng_owner ; u8 fw_stats_num ; void *fw_stats ; dma_addr_t fw_stats_mapping ; struct bnx2x_fw_stats_req *fw_stats_req ; dma_addr_t fw_stats_req_mapping ; int fw_stats_req_sz ; struct bnx2x_fw_stats_data *fw_stats_data ; dma_addr_t fw_stats_data_mapping ; int fw_stats_data_sz ; struct hw_context context[32U] ; struct bnx2x_ilt *ilt ; int qm_cid_count ; bool dropless_fc ; void *t2 ; dma_addr_t t2_mapping ; struct cnic_ops *cnic_ops ; void *cnic_data ; u32 cnic_tag ; struct cnic_eth_dev cnic_eth_dev ; union host_hc_status_block cnic_sb ; dma_addr_t cnic_sb_mapping ; struct eth_spe *cnic_kwq ; struct eth_spe *cnic_kwq_prod ; struct eth_spe *cnic_kwq_cons ; struct eth_spe *cnic_kwq_last ; u16 cnic_kwq_pending ; u16 cnic_spq_pending ; u8 fip_mac[6U] ; struct mutex cnic_mutex ; struct bnx2x_vlan_mac_obj iscsi_l2_mac_obj ; u8 cnic_base_cl_id ; int dmae_ready ; spinlock_t dmae_lock ; struct mutex fw_mb_mutex ; int stats_state ; struct semaphore stats_lock ; struct dmae_command stats_dmae ; int executer_idx ; u16 stats_counter ; struct bnx2x_eth_stats eth_stats ; struct host_func_stats func_stats ; struct bnx2x_eth_stats_old eth_stats_old ; struct bnx2x_net_stats_old net_stats_old ; struct bnx2x_fw_port_stats_old fw_stats_old ; bool stats_init ; struct z_stream_s *strm ; void *gunzip_buf ; dma_addr_t gunzip_mapping ; int gunzip_outlen ; struct raw_op *init_ops ; u16 *init_ops_offsets ; u32 *init_data ; u32 init_mode_flags ; u8 const *tsem_int_table_data ; u8 const *tsem_pram_data ; u8 const *usem_int_table_data ; u8 const *usem_pram_data ; u8 const *xsem_int_table_data ; u8 const *xsem_pram_data ; u8 const *csem_int_table_data ; u8 const *csem_pram_data ; char fw_ver[32U] ; struct firmware const *firmware ; struct bnx2x_vfdb *vfdb ; u16 dcb_state ; int dcbx_enabled ; bool dcbx_mode_uset ; struct bnx2x_config_dcbx_params dcbx_config_params ; struct bnx2x_dcbx_port_params dcbx_port_params ; int dcb_version ; struct bnx2x_credit_pool_obj vlans_pool ; struct bnx2x_credit_pool_obj macs_pool ; struct bnx2x_rx_mode_obj rx_mode_obj ; struct bnx2x_mcast_obj mcast_obj ; struct bnx2x_rss_config_obj rss_conf_obj ; struct bnx2x_func_sp_obj func_obj ; unsigned long sp_state ; unsigned long sp_rtnl_state ; unsigned long iov_task_state ; struct dcbx_features dcbx_local_feat ; u32 dcbx_error ; struct dcbx_features dcbx_remote_feat ; u32 dcbx_remote_flags ; int afex_def_vlan_tag ; enum mf_cfg_afex_vlan_mode afex_vlan_mode ; u32 pending_max ; u8 max_cos ; u8 prio_to_cos[8U] ; int fp_array_size ; u32 dump_preset_idx ; u8 phys_port_id[6U] ; struct ptp_clock *ptp_clock ; struct ptp_clock_info ptp_clock_info ; struct work_struct ptp_task ; struct cyclecounter cyclecounter ; struct timecounter timecounter ; bool timecounter_init_done ; struct sk_buff *ptp_tx_skb ; unsigned long ptp_tx_start ; bool hwtstamp_ioctl_called ; u16 tx_type ; u16 rx_filter ; struct bnx2x_link_report_data vf_link_vars ; }; struct bnx2x_func_init_params { dma_addr_t fw_stat_map ; dma_addr_t spq_map ; u16 func_flgs ; u16 func_id ; u16 pf_id ; u16 spq_prod ; }; struct raw_op { unsigned char op ; unsigned int offset : 24 ; u32 raw_data ; }; struct op_read { unsigned char op ; unsigned int offset : 24 ; u32 val ; }; struct op_write { unsigned char op ; unsigned int offset : 24 ; u32 val ; }; struct op_arr_write { unsigned char op ; unsigned int offset : 24 ; u16 data_off ; u16 data_len ; }; struct op_zero { unsigned char op ; unsigned int offset : 24 ; u32 len ; }; struct op_if_mode { unsigned char op ; unsigned int cmd_offset : 24 ; u32 mode_bit_map ; }; union init_op { struct op_read read ; struct op_write write ; struct op_arr_write arr_wr ; struct op_zero zero ; struct raw_op raw ; struct op_if_mode if_mode ; }; struct ilt_line { dma_addr_t page_mapping ; void *page ; u32 size ; }; struct ilt_client_info { u32 page_size ; u16 start ; u16 end ; u16 client_num ; u16 flags ; }; struct bnx2x_ilt { u32 start_line ; struct ilt_line *lines ; struct ilt_client_info clients[4U] ; }; struct src_ent { u8 opaque[56U] ; u64 next ; }; struct __anonstruct_reg_mask_422 { u32 e1 ; u32 e1h ; u32 e2 ; u32 e3 ; }; struct __anonstruct_bnx2x_blocks_parity_data_421 { u32 mask_addr ; u32 sts_clr_addr ; u32 en_mask ; struct __anonstruct_reg_mask_422 reg_mask ; char name[8U] ; }; struct __anonstruct_mcp_attn_ctl_regs_423 { u32 addr ; u32 bits ; }; struct arb_line { int l ; int add ; int ubound ; }; enum sample_bulletin_result { PFVF_BULLETIN_UNCHANGED = 0, PFVF_BULLETIN_UPDATED = 1, PFVF_BULLETIN_CRC_ERR = 2 } ; struct bnx2x_sriov { u32 first_vf_in_pf ; int pos ; int nres ; u32 cap ; u16 ctrl ; u16 total ; u16 initial ; u16 nr_virtfn ; u16 offset ; u16 stride ; u32 pgsz ; u8 link ; }; struct bnx2x_vf_bar { u64 bar ; u32 size ; }; struct bnx2x_vf_queue { struct eth_context *cxt ; struct bnx2x_vlan_mac_obj mac_obj ; struct bnx2x_vlan_mac_obj vlan_obj ; atomic_t vlan_count ; unsigned long accept_flags ; struct bnx2x_queue_sp_obj sp_obj ; u32 cid ; u16 index ; u16 sb_idx ; bool is_leading ; bool sp_initialized ; }; struct bnx2x_virtf; struct bnx2x_virtf { u16 cfg_flags ; u8 link_cfg ; u8 state ; bool flr_clnup_stage ; dma_addr_t fw_stat_map ; u16 stats_stride ; dma_addr_t spq_map ; dma_addr_t bulletin_map ; struct vf_pf_resc_request alloc_resc ; u8 sb_count ; u8 igu_base_id ; struct bnx2x_vf_queue *vfqs ; u8 index ; u8 abs_vfid ; u8 sp_cl_id ; u32 error ; unsigned int bus ; unsigned int devfn ; struct bnx2x_vf_bar bars[6U] ; unsigned long filter_state ; int leading_rss ; int mcast_list_len ; struct bnx2x_mcast_obj mcast_obj ; struct bnx2x_rss_config_obj rss_conf_obj ; struct mutex op_mutex ; enum channel_tlvs op_current ; u8 fp_hsi ; }; struct bnx2x_vf_mbx_msg { union vfpf_tlvs req ; union pfvf_tlvs resp ; }; struct bnx2x_vf_mbx { struct bnx2x_vf_mbx_msg *msg ; dma_addr_t msg_mapping ; u32 vf_addr_lo ; u32 vf_addr_hi ; struct vfpf_first_tlv first_tlv ; }; struct hw_dma { void *addr ; dma_addr_t mapping ; size_t size ; }; struct bnx2x_vfdb { struct bnx2x_virtf *vfs ; struct bnx2x_vf_queue *vfqs ; struct hw_dma context[32U] ; struct bnx2x_sriov sriov ; struct hw_dma mbx_dma ; struct bnx2x_vf_mbx mbxs[64U] ; struct hw_dma bulletin_dma ; struct hw_dma sp_dma ; u32 flrd_vfs[2U] ; u16 vf_sbs_pool ; u16 first_vf_igu_entry ; struct mutex event_mutex ; u64 event_occur ; struct mutex bulletin_mutex ; }; struct firmware { size_t size ; u8 const *data ; struct page **pages ; void *priv ; }; struct bnx2x_fw_file_section { __be32 len ; __be32 offset ; }; struct bnx2x_fw_file_hdr { struct bnx2x_fw_file_section init_ops ; struct bnx2x_fw_file_section init_ops_offsets ; struct bnx2x_fw_file_section init_data ; struct bnx2x_fw_file_section tsem_int_table_data ; struct bnx2x_fw_file_section tsem_pram_data ; struct bnx2x_fw_file_section usem_int_table_data ; struct bnx2x_fw_file_section usem_pram_data ; struct bnx2x_fw_file_section csem_int_table_data ; struct bnx2x_fw_file_section csem_pram_data ; struct bnx2x_fw_file_section xsem_int_table_data ; struct bnx2x_fw_file_section xsem_pram_data ; struct bnx2x_fw_file_section iro_arr ; struct bnx2x_fw_file_section fw_version ; }; struct bnx2x_mac_vals { u32 xmac_addr ; u32 xmac_val ; u32 emac_addr ; u32 emac_val ; u32 umac_addr[2U] ; u32 umac_val[2U] ; u32 bmac_addr ; u32 bmac_val[2U] ; }; struct __anonstruct_board_info_434 { char *name ; }; enum storms { XSTORM = 0, TSTORM = 1, CSTORM = 2, USTORM = 3, MAX_STORMS = 4 } ; struct pbf_pN_buf_regs { int pN ; u32 init_crd ; u32 crd ; u32 crd_freed ; }; struct pbf_pN_cmd_regs { int pN ; u32 lines_occup ; u32 lines_freed ; }; union __anonunion___u_438 { struct cnic_ops *__val ; char __c[1U] ; }; union __anonunion___u_440 { struct cnic_ops *__val ; char __c[1U] ; }; union __anonunion___u_442 { struct cnic_ops *__val ; char __c[1U] ; }; typedef bool ldv_func_ret_type; typedef bool ldv_func_ret_type___0; typedef bool ldv_func_ret_type___1; typedef bool ldv_func_ret_type___2; typedef bool ldv_func_ret_type___3; typedef bool ldv_func_ret_type___4; typedef int ldv_func_ret_type___5; typedef bool 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; typedef bool ldv_func_ret_type___10; typedef bool ldv_func_ret_type___11; typedef int ldv_func_ret_type___12; enum hrtimer_restart; struct bnx2x_reg_set { u8 devad ; u16 reg ; u16 val ; }; struct bnx2x_nig_brb_pfc_port_params { u32 pause_enable ; u32 llfc_out_en ; u32 llfc_enable ; u32 pkt_priority_to_cos ; u8 num_of_rx_cos_priority_mask ; u32 rx_cos_priority_mask[6U] ; u32 llfc_high_priority_classes ; u32 llfc_low_priority_classes ; }; struct bnx2x_ets_bw_params { u8 bw ; }; struct bnx2x_ets_sp_params { u8 pri ; }; enum bnx2x_cos_state { bnx2x_cos_state_strict = 0, bnx2x_cos_state_bw = 1 } ; union __anonunion_params_331 { struct bnx2x_ets_bw_params bw_params ; struct bnx2x_ets_sp_params sp_params ; }; struct bnx2x_ets_cos_params { enum bnx2x_cos_state state ; union __anonunion_params_331 params ; }; struct bnx2x_ets_params { u8 num_of_cos ; struct bnx2x_ets_cos_params cos[6U] ; }; typedef short s16; enum hrtimer_restart; enum gro_result { GRO_MERGED = 0, GRO_MERGED_FREE = 1, GRO_HELD = 2, GRO_NORMAL = 3, GRO_DROP = 4 } ; typedef enum gro_result gro_result_t; struct napi_gro_cb { void *frag0 ; unsigned int frag0_len ; int data_offset ; u16 flush ; u16 flush_id ; u16 count ; u16 gro_remcsum_start ; unsigned long age ; u16 proto ; unsigned char same_flow : 1 ; unsigned char udp_mark : 1 ; unsigned char csum_valid : 1 ; unsigned char csum_cnt : 3 ; unsigned char free : 2 ; unsigned char is_ipv6 : 1 ; __wsum csum ; struct sk_buff *last ; }; 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 ; }; union tcp_word_hdr { struct tcphdr hdr ; __be32 words[5U] ; }; enum eth_rss_hash_type { DEFAULT_HASH_TYPE = 0, IPV4_HASH_TYPE = 1, TCP_IPV4_HASH_TYPE = 2, IPV6_HASH_TYPE = 3, TCP_IPV6_HASH_TYPE = 4, VLAN_PRI_HASH_TYPE = 5, E1HOV_PRI_HASH_TYPE = 6, DSCP_HASH_TYPE = 7, MAX_ETH_RSS_HASH_TYPE = 8 } ; enum eth_rx_cqe_type { RX_ETH_CQE_TYPE_ETH_FASTPATH = 0, RX_ETH_CQE_TYPE_ETH_RAMROD = 1, RX_ETH_CQE_TYPE_ETH_START_AGG = 2, RX_ETH_CQE_TYPE_ETH_STOP_AGG = 3, MAX_ETH_RX_CQE_TYPE = 4 } ; struct ustorm_eth_rx_producers { u16 cqe_prod ; u16 bd_prod ; u16 sge_prod ; u16 reserved ; }; union __anonunion___u_410 { unsigned long __val ; char __c[1U] ; }; union __anonunion___u_412 { unsigned long __val ; char __c[1U] ; }; union __anonunion___u_414 { unsigned long __val ; char __c[1U] ; }; typedef int ldv_func_ret_type___13; typedef int ldv_func_ret_type___14; typedef int ldv_func_ret_type___15; enum hrtimer_restart; struct dump_header { u32 header_size ; u32 version ; u32 preset ; u32 dump_meta_data ; }; struct reg_addr { u32 addr ; u32 size ; u32 chips ; u32 presets ; }; struct wreg_addr { u32 addr ; u32 size ; u32 read_regs_count ; u32 const *read_regs ; u32 chips ; u32 presets ; }; struct __anonstruct_reg_mask_363 { u32 e1 ; u32 e1h ; u32 e2 ; u32 e3 ; }; struct __anonstruct_bnx2x_blocks_parity_data_362 { u32 mask_addr ; u32 sts_clr_addr ; u32 en_mask ; struct __anonstruct_reg_mask_363 reg_mask ; char name[8U] ; }; struct __anonstruct_mcp_attn_ctl_regs_364 { u32 addr ; u32 bits ; }; struct __anonstruct_bnx2x_q_stats_arr_369 { long offset ; int size ; char string[32U] ; }; struct __anonstruct_bnx2x_stats_arr_370 { long offset ; int size ; u32 flags ; char string[32U] ; }; struct __anonstruct_reg_tbl_375 { u32 hw ; u32 offset0 ; u32 offset1 ; u32 mask ; }; struct __anonstruct_mem_tbl_377 { u32 offset ; int size ; }; struct __anonstruct_prty_tbl_379 { char *name ; u32 offset ; u32 hw_mask[5U] ; }; struct code_entry { u32 sram_start_addr ; u32 code_attribute ; u32 nvm_start_addr ; }; struct crc_pair { int offset ; int size ; }; struct _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 18 ; unsigned char flags ; }; enum hrtimer_restart; enum bnx2x_stats_state { STATS_STATE_DISABLED = 0, STATS_STATE_ENABLED = 1, STATS_STATE_MAX = 2 } ; struct __anonstruct_diff_363 { u32 lo ; u32 hi ; }; struct __anonstruct_diff_365 { u32 lo ; u32 hi ; }; struct __anonstruct_bnx2x_stats_stm_366 { void (*action)(struct bnx2x * ) ; enum bnx2x_stats_state next_state ; }; enum hrtimer_restart; struct lldp_admin_mib { u32 ver_cfg_flags ; struct dcbx_features features ; }; struct lldp_remote_mib { u32 prefix_seq_num ; u32 flags ; struct dcbx_features features ; u32 suffix_seq_num ; }; struct lldp_local_mib { u32 prefix_seq_num ; u32 error ; struct dcbx_features features ; u32 suffix_seq_num ; }; struct cos_entry_help_data { u32 pri_join_mask ; u32 cos_bw ; u8 strict ; bool pausable ; }; struct cos_help_data { struct cos_entry_help_data data[3U] ; u8 num_of_cos ; }; struct pg_entry_help_data { u8 num_of_dif_pri ; u8 pg ; u32 pg_priority ; }; struct pg_help_data { struct pg_entry_help_data data[3U] ; u8 num_of_pg ; }; enum hrtimer_restart; struct tx_queue_init_ramrod_data { struct client_init_general_data general ; struct client_init_tx_data tx ; }; struct set_timesync_ramrod_data { u8 drift_adjust_cmd ; u8 offset_cmd ; u8 add_sub_drift_adjust_value ; u8 drift_adjust_value ; u32 drift_adjust_period ; struct regpair offset_delta ; }; struct bnx2x_mcast_mac_elem { struct list_head link ; u8 mac[6U] ; u8 pad[2U] ; }; union __anonunion_data_362 { struct list_head macs_head ; u32 macs_num ; int next_bin ; }; struct bnx2x_pending_mcast_cmd { struct list_head link ; int type ; union __anonunion_data_362 data ; bool done ; }; enum hrtimer_restart; struct vf_pf_channel_zone_data { u32 msg_addr_lo ; u32 msg_addr_hi ; }; struct non_trigger_vf_zone { struct vf_pf_channel_zone_data vf_pf_channel ; }; struct vf_pf_channel_zone_trigger { u8 addr_valid ; }; struct trigger_vf_zone { struct vf_pf_channel_zone_trigger vf_pf_channel ; u8 reserved0 ; u16 reserved1 ; u32 reserved2 ; }; struct cstorm_vf_zone_data { struct non_trigger_vf_zone non_trigger ; struct trigger_vf_zone trigger ; }; struct vfpf_port_phys_id_resp_tlv { struct channel_tlv tl ; u8 id[6U] ; u8 padding[2U] ; }; struct vfpf_fp_hsi_resp_tlv { struct channel_tlv tl ; u8 is_supported ; u8 padding[3U] ; }; struct bnx2x_vf_queue_construct_params { struct bnx2x_queue_state_params qstate ; struct bnx2x_queue_setup_params prep_qsetup ; }; struct bnx2x_vf_mac_vlan_filter { int type ; bool add ; u8 *mac ; u16 vid ; }; struct bnx2x_vf_mac_vlan_filters { int count ; struct bnx2x_vf_mac_vlan_filter filters[] ; }; typedef u8 bnx2x_mac_addr_t[6U]; enum hrtimer_restart; struct set_vf_state_cookie { struct bnx2x_virtf *vf ; u8 state ; }; void __builtin_prefetch(void const * , ...) ; __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static void __read_once_size(void const volatile *p , void *res , int size ) { { switch (size) { case 1: *((__u8 *)res) = *((__u8 volatile *)p); goto ldv_880; case 2: *((__u16 *)res) = *((__u16 volatile *)p); goto ldv_880; case 4: *((__u32 *)res) = *((__u32 volatile *)p); goto ldv_880; case 8: *((__u64 *)res) = *((__u64 volatile *)p); goto ldv_880; default: __asm__ volatile ("": : : "memory"); __builtin_memcpy(res, (void const *)p, (unsigned long )size); __asm__ volatile ("": : : "memory"); } ldv_880: ; return; } } 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 __set_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile ("bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void clear_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".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 void __clear_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile ("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 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 fls(int x ) { int r ; { __asm__ ("bsrl %1,%0": "=r" (r): "rm" (x), "0" (-1)); return (r + 1); } } __inline static __u32 __arch_swab32(__u32 val ) { { __asm__ ("bswapl %0": "=r" (val): "0" (val)); return (val); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } __inline static __u32 __fswab32(__u32 val ) { __u32 tmp ; { tmp = __arch_swab32(val); return (tmp); } } __inline static int __ilog2_u32(u32 n ) { int tmp ; { tmp = fls((int )n); return (tmp + -1); } } extern int printk(char const * , ...) ; extern void __might_sleep(char const * , int , int ) ; extern void __might_fault(char const * , int ) ; extern int snprintf(char * , size_t , char const * , ...) ; extern int sscanf(char const * , char const * , ...) ; extern enum system_states system_state ; bool ldv_is_err(void const *ptr ) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } __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 void __bad_percpu_size(void) ; extern void __bad_size_call_parameter(void) ; extern void warn_slowpath_null(char const * , int const ) ; extern void *memcpy(void * , void const * , size_t ) ; extern void *memset(void * , int , size_t ) ; extern size_t strlcpy(char * , char const * , size_t ) ; extern int strncmp(char const * , char const * , __kernel_size_t ) ; __inline static bool IS_ERR(void const *ptr ) ; __inline static int atomic_read(atomic_t const *v ) { int __var ; { __var = 0; return ((int )*((int const volatile *)(& v->counter))); } } __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } __inline static void atomic_add(int i , atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; addl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static void atomic_inc(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; incl %0": "+m" (v->counter)); return; } } __inline static void atomic_dec(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decl %0": "+m" (v->counter)); return; } } extern int __preempt_count ; __inline static void __preempt_count_add(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%0": "+m" (__preempt_count): "qi" (val)); } goto ldv_6059; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6059; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6059; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%0": "+m" (__preempt_count): "re" (val)); } goto ldv_6059; default: __bad_percpu_size(); } ldv_6059: ; return; } } __inline static void __preempt_count_sub(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%0": "+m" (__preempt_count): "qi" (- val)); } goto ldv_6071; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6071; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6071; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%0": "+m" (__preempt_count): "re" (- val)); } goto ldv_6071; default: __bad_percpu_size(); } ldv_6071: ; return; } } extern void __local_bh_disable_ip(unsigned long , unsigned int ) ; __inline static void local_bh_disable(void) { { __local_bh_disable_ip(0UL, 512U); return; } } extern void __local_bh_enable_ip(unsigned long , unsigned int ) ; __inline static void local_bh_enable(void) { { __local_bh_enable_ip(0UL, 512U); return; } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; 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 int lock_is_held(struct lockdep_map * ) ; extern void lockdep_rcu_suspicious(char const * , int const , char const * ) ; extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_lock_bh(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; extern void _raw_spin_unlock_bh(raw_spinlock_t * ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->__annonCompField18.rlock); } } __inline static void spin_lock(spinlock_t *lock ) { { _raw_spin_lock(& lock->__annonCompField18.rlock); return; } } __inline static void spin_lock_bh(spinlock_t *lock ) { { _raw_spin_lock_bh(& lock->__annonCompField18.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->__annonCompField18.rlock); return; } } __inline static void spin_unlock_bh(spinlock_t *lock ) { { _raw_spin_unlock_bh(& lock->__annonCompField18.rlock); return; } } __inline static s64 timespec_to_ns(struct timespec const *ts ) { { return ((long long )ts->tv_sec * 1000000000LL + (long long )ts->tv_nsec); } } extern struct timespec ns_to_timespec(s64 const ) ; extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; extern void mutex_lock_nested(struct mutex * , unsigned int ) ; extern void mutex_unlock(struct mutex * ) ; extern unsigned long volatile jiffies ; __inline static ktime_t ktime_set(s64 const secs , unsigned long const nsecs ) { ktime_t __constr_expr_0 ; long tmp ; ktime_t __constr_expr_1 ; { tmp = ldv__builtin_expect((long long )secs > 9223372035LL, 0L); if (tmp != 0L) { __constr_expr_0.tv64 = 9223372036854775807LL; return (__constr_expr_0); } else { } __constr_expr_1.tv64 = (long long )secs * 1000000000LL + (long long )nsecs; return (__constr_expr_1); } } __inline static int ktime_compare(ktime_t const cmp1 , ktime_t const cmp2 ) { { if ((long long )cmp1.tv64 < (long long )cmp2.tv64) { return (-1); } else { } if ((long long )cmp1.tv64 > (long long )cmp2.tv64) { return (1); } else { } return (0); } } __inline static bool ktime_before(ktime_t const cmp1 , ktime_t const cmp2 ) { int tmp ; { tmp = ktime_compare(cmp1, cmp2); return (tmp < 0); } } __inline static s64 ktime_divns(ktime_t const kt , s64 div ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = div < 0LL; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/ktime.h", 194); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return ((long long )kt.tv64 / div); } } __inline static s64 ktime_to_ms(ktime_t const kt ) { s64 tmp ; { tmp = ktime_divns(kt, 1000000LL); return (tmp); } } __inline static s64 ktime_ms_delta(ktime_t const later , ktime_t const earlier ) { ktime_t __constr_expr_0 ; s64 tmp ; { __constr_expr_0.tv64 = (long long )later.tv64 - (long long )earlier.tv64; tmp = ktime_to_ms(__constr_expr_0); return (tmp); } } __inline static ktime_t ns_to_ktime(u64 ns ) { ktime_t ktime_zero ; ktime_t __constr_expr_0 ; { ktime_zero.tv64 = 0LL; __constr_expr_0.tv64 = (long long )((unsigned long long )ktime_zero.tv64 + ns); return (__constr_expr_0); } } extern ktime_t ktime_get_with_offset(enum tk_offsets ) ; __inline static ktime_t ktime_get_real(void) { ktime_t tmp ; { tmp = ktime_get_with_offset(0); return (tmp); } } __inline static ktime_t ktime_get_boottime(void) { ktime_t tmp ; { tmp = ktime_get_with_offset(1); return (tmp); } } extern void synchronize_sched(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; } } __inline static void synchronize_rcu(void) { { synchronize_sched(); 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) ; extern int rcu_read_lock_held(void) ; __inline static void rcu_read_lock(void) { bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; { __rcu_read_lock(); rcu_lock_acquire(& rcu_lock_map); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 849, "rcu_read_lock() used illegally while idle"); } else { } } else { } return; } } __inline static void rcu_read_unlock(void) { bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; { tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 900, "rcu_read_unlock() used illegally while idle"); } else { } } else { } __rcu_read_unlock(); rcu_lock_release(& rcu_lock_map); return; } } extern void init_timer_key(struct timer_list * , unsigned int , char const * , struct lock_class_key * ) ; extern int mod_timer(struct timer_list * , unsigned long ) ; int ldv_mod_timer_13(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; extern int del_timer_sync(struct timer_list * ) ; int ldv_del_timer_sync_23(struct timer_list *ldv_func_arg1 ) ; extern void delayed_work_timer_fn(unsigned long ) ; extern void __init_work(struct work_struct * , int ) ; extern struct workqueue_struct *system_wq ; 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_26(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_destroy_workqueue_28(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_destroy_workqueue_29(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_destroy_workqueue_31(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_destroy_workqueue_32(struct workqueue_struct *ldv_func_arg1 ) ; extern bool queue_work_on(int , struct workqueue_struct * , struct work_struct * ) ; bool ldv_queue_work_on_5(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_7(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; extern bool queue_delayed_work_on(int , struct workqueue_struct * , struct delayed_work * , unsigned long ) ; bool ldv_queue_delayed_work_on_6(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_9(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; extern void flush_workqueue(struct workqueue_struct * ) ; void ldv_flush_workqueue_8(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_12(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_14(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_15(struct workqueue_struct *ldv_func_arg1 ) ; extern bool cancel_work_sync(struct work_struct * ) ; bool ldv_cancel_work_sync_16(struct work_struct *ldv_func_arg1 ) ; extern bool cancel_delayed_work(struct delayed_work * ) ; bool ldv_cancel_delayed_work_10(struct delayed_work *ldv_func_arg1 ) ; bool ldv_cancel_delayed_work_11(struct delayed_work *ldv_func_arg1 ) ; extern bool cancel_delayed_work_sync(struct delayed_work * ) ; bool ldv_cancel_delayed_work_sync_21(struct delayed_work *ldv_func_arg1 ) ; bool ldv_cancel_delayed_work_sync_24(struct delayed_work *ldv_func_arg1 ) ; bool ldv_cancel_delayed_work_sync_25(struct delayed_work *ldv_func_arg1 ) ; __inline static bool queue_work(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = ldv_queue_work_on_5(8192, wq, work); return (tmp); } } __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_6(8192, wq, dwork, delay); return (tmp); } } __inline static bool schedule_work(struct work_struct *work ) { bool tmp ; { tmp = queue_work(system_wq, work); 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); } } __inline static unsigned char readb(void const volatile *addr ) { unsigned char ret ; { __asm__ volatile ("movb %1,%0": "=q" (ret): "m" (*((unsigned char volatile *)addr)): "memory"); return (ret); } } __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 writeb(unsigned char val , void volatile *addr ) { { __asm__ volatile ("movb %0,%1": : "q" (val), "m" (*((unsigned char volatile *)addr)): "memory"); return; } } __inline static void writew(unsigned short val , void volatile *addr ) { { __asm__ volatile ("movw %0,%1": : "r" (val), "m" (*((unsigned short volatile *)addr)): "memory"); return; } } __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 * ) ; extern int cpu_number ; extern void kfree(void const * ) ; extern void *__kmalloc(size_t , gfp_t ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) { void *tmp___2 ; { tmp___2 = __kmalloc(size, flags); return (tmp___2); } } __inline static void *kmalloc_array(size_t n , size_t size , gfp_t flags ) { void *tmp ; { if (size != 0UL && 0xffffffffffffffffUL / size < n) { return ((void *)0); } else { } tmp = __kmalloc(n * size, flags); return (tmp); } } __inline static void *kcalloc(size_t n , size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc_array(n, size, flags | 32768U); return (tmp); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } extern void *malloc(size_t ) ; extern void *calloc(size_t , size_t ) ; extern int __VERIFIER_nondet_int(void) ; extern unsigned long __VERIFIER_nondet_ulong(void) ; extern void *__VERIFIER_nondet_pointer(void) ; extern void __VERIFIER_assume(int ) ; void *ldv_malloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = malloc(size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_zalloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_init_zalloc(size_t size ) { void *p ; void *tmp ; { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } void *ldv_memset(void *s , int c , size_t n ) { void *tmp ; { tmp = memset(s, c, n); return (tmp); } } int ldv_undef_int(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); return (tmp); } } void *ldv_undef_ptr(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); return (tmp); } } unsigned long ldv_undef_ulong(void) { unsigned long tmp ; { tmp = __VERIFIER_nondet_ulong(); return (tmp); } } __inline static void ldv_stop(void) { { LDV_STOP: ; goto LDV_STOP; } } __inline static long ldv__builtin_expect(long exp , long c ) { { return (exp); } } struct pci_dev *bnx2x_err_handler_group0 ; struct link_vars *phy_84833_group1 ; int ldv_state_variable_20 ; int pci_counter ; struct ethtool_channels *bnx2x_ethtool_ops_group5 ; struct ethtool_channels *bnx2x_vf_ethtool_ops_group1 ; int ldv_state_variable_30 ; int ldv_work_8_1 ; int ldv_state_variable_0 ; struct link_vars *phy_8073_group1 ; int ldv_irq_2_0 = 0; struct bnx2x_phy *phy_8726_group2 ; int ldv_state_variable_12 ; int ldv_irq_3_2 = 0; struct pci_dev *bnx2x_pci_driver_group1 ; struct ethtool_ringparam *bnx2x_ethtool_ops_group1 ; int ldv_state_variable_22 ; int ldv_state_variable_14 ; struct link_params *phy_serdes_group0 ; int ldv_state_variable_29 ; int ldv_state_variable_17 ; struct work_struct *ldv_work_struct_8_1 ; struct link_params *phy_8705_group0 ; struct bnx2x_phy *phy_serdes_group2 ; void *ldv_irq_data_2_3 ; int ldv_work_7_2 ; int ldv_state_variable_19 ; struct work_struct *ldv_work_struct_4_3 ; int ldv_state_variable_27 ; int ldv_state_variable_9 ; struct work_struct *ldv_work_struct_7_1 ; int ldv_work_6_0 ; struct work_struct *ldv_work_struct_6_1 ; struct link_params *phy_8481_group0 ; struct link_vars *phy_xgxs_group1 ; int ref_cnt ; int ldv_irq_line_1_1 ; void *ldv_irq_data_2_2 ; struct link_vars *phy_54618se_group1 ; struct work_struct *ldv_work_struct_4_0 ; struct ethtool_ringparam *bnx2x_vf_ethtool_ops_group0 ; struct work_struct *ldv_work_struct_8_3 ; int ldv_state_variable_7 ; struct link_vars *phy_8727_group1 ; int ldv_state_variable_23 ; int ldv_irq_3_0 = 0; int ldv_irq_2_1 = 0; void *ldv_irq_data_2_1 ; struct net_device *bnx2x_dcbnl_ops_group0 ; int ldv_irq_1_3 = 0; int ldv_irq_line_2_2 ; struct ethtool_wolinfo *bnx2x_ethtool_ops_group8 ; struct ethtool_rxnfc *bnx2x_ethtool_ops_group7 ; struct link_vars *phy_8705_group1 ; struct bnx2x *bnx2x_func_sp_drv_group0 ; int ldv_work_4_0 ; int ldv_state_variable_6 ; void *ldv_irq_data_1_0 ; void *ldv_irq_data_3_0 ; int ldv_work_5_0 ; void *ldv_irq_data_1_3 ; struct ethtool_rxnfc *bnx2x_vf_ethtool_ops_group3 ; struct work_struct *ldv_work_struct_7_2 ; struct link_params *phy_84823_group0 ; int ldv_state_variable_26 ; struct work_struct *ldv_work_struct_4_2 ; int ldv_state_variable_28 ; struct work_struct *ldv_work_struct_7_0 ; struct link_vars *phy_84834_group1 ; int LDV_IN_INTERRUPT = 1; struct link_params *phy_84833_group0 ; struct work_struct *ldv_work_struct_6_0 ; int ldv_irq_1_1 = 0; struct link_params *phy_7101_group0 ; int ldv_work_8_3 ; int ldv_irq_line_3_1 ; struct work_struct *ldv_work_struct_5_1 ; int ldv_work_5_2 ; int ldv_work_7_1 ; int ldv_state_variable_3 ; int ldv_irq_line_1_0 ; void *ldv_irq_data_3_2 ; int ldv_work_6_2 ; struct ethtool_cmd *bnx2x_ethtool_ops_group2 ; int ldv_state_variable_4 ; int ldv_irq_line_3_3 ; int ldv_state_variable_8 ; int ldv_state_variable_15 ; struct link_params *phy_8726_group0 ; struct ethtool_eee *bnx2x_ethtool_ops_group0 ; struct link_vars *phy_84823_group1 ; struct work_struct *ldv_work_struct_6_3 ; struct bnx2x_phy *phy_84833_group2 ; int ldv_work_8_0 ; struct work_struct *ldv_work_struct_5_2 ; struct link_vars *phy_8481_group1 ; struct bnx2x_phy *phy_84823_group2 ; struct link_params *phy_8706_group0 ; int ldv_state_variable_21 ; struct work_struct *ldv_work_struct_5_3 ; int ldv_state_variable_5 ; int ldv_state_variable_13 ; int ldv_irq_3_1 = 0; struct work_struct *ldv_work_struct_8_0 ; struct ethtool_pauseparam *bnx2x_ethtool_ops_group4 ; struct link_vars *phy_8726_group1 ; struct net_device *bnx2x_vf_ethtool_ops_group2 ; int ldv_timer_state_9 = 0; struct net_device *bnx2x_netdev_ops_group1 ; struct link_params *phy_xgxs_group0 ; struct bnx2x_phy *phy_54618se_group2 ; int ldv_irq_2_2 = 0; struct bnx2x_phy *phy_84834_group2 ; int ldv_state_variable_24 ; int ldv_work_7_3 ; int ldv_irq_line_2_0 ; struct bnx2x_phy *phy_8706_group2 ; struct link_params *phy_8727_group0 ; int ldv_irq_line_3_0 ; int ldv_state_variable_1 ; int ldv_work_5_3 ; int ldv_irq_line_1_2 ; int ldv_irq_line_2_3 ; int ldv_work_6_1 ; void *ldv_irq_data_3_3 ; struct link_params *phy_warpcore_group0 ; void *ldv_irq_data_1_1 ; struct ethtool_eeprom *bnx2x_ethtool_ops_group3 ; int ldv_irq_line_3_2 ; struct work_struct *ldv_work_struct_6_2 ; int ldv_state_variable_10 ; struct link_vars *phy_warpcore_group1 ; int ldv_irq_1_0 = 0; int ldv_work_7_0 ; struct bnx2x_phy *phy_warpcore_group2 ; struct ethtool_coalesce *bnx2x_ethtool_ops_group6 ; void *ldv_irq_data_3_1 ; struct work_struct *ldv_work_struct_8_2 ; struct bnx2x_phy *phy_xgxs_group2 ; int ldv_work_4_1 ; struct ethtool_dump *bnx2x_ethtool_ops_group9 ; int ldv_work_4_3 ; int ldv_state_variable_16 ; struct bnx2x_phy *phy_8705_group2 ; int ldv_irq_line_2_1 ; struct work_struct *ldv_work_struct_7_3 ; int ldv_state_variable_2 ; int ldv_state_variable_25 ; int ldv_work_5_1 ; struct bnx2x_phy *phy_8727_group2 ; struct timer_list *ldv_timer_list_9 ; void *ldv_irq_data_1_2 ; int ldv_work_6_3 ; struct link_params *phy_84834_group0 ; void *ldv_irq_data_2_0 ; struct link_vars *phy_serdes_group1 ; int ldv_work_4_2 ; int ldv_state_variable_11 ; int ldv_irq_1_2 = 0; struct bnx2x_phy *phy_8073_group2 ; int ldv_state_variable_18 ; int ldv_irq_2_3 = 0; struct work_struct *ldv_work_struct_5_0 ; struct bnx2x_phy *phy_8481_group2 ; int ldv_irq_line_1_3 ; struct link_vars *phy_7101_group1 ; struct link_vars *phy_8706_group1 ; int ldv_work_8_2 ; struct link_params *phy_8073_group0 ; struct work_struct *ldv_work_struct_4_1 ; struct net_device *bnx2x_ethtool_ops_group10 ; struct link_params *phy_54618se_group0 ; int ldv_irq_3_3 = 0; struct bnx2x_phy *phy_7101_group2 ; void activate_work_5(struct work_struct *work , int state ) ; void ldv_initialize_bnx2x_phy_20(void) ; void call_and_disable_all_7(int state ) ; void ldv_initialize_bnx2x_func_sp_drv_ops_29(void) ; void invoke_work_6(void) ; void ldv_initialize_ethtool_ops_12(void) ; void activate_pending_timer_9(struct timer_list *timer , unsigned long data , int pending_flag ) ; void work_init_5(void) ; void invoke_work_8(void) ; void ldv_initialize_bnx2x_phy_19(void) ; void ldv_initialize_bnx2x_phy_16(void) ; void call_and_disable_all_4(int state ) ; void ldv_initialize_bnx2x_phy_17(void) ; void work_init_7(void) ; void ldv_initialize_bnx2x_phy_22(void) ; void invoke_work_7(void) ; void disable_work_5(struct work_struct *work ) ; void disable_work_7(struct work_struct *work ) ; void call_and_disable_all_8(int state ) ; void call_and_disable_all_6(int state ) ; void ldv_initialize_pci_error_handlers_28(void) ; void invoke_work_4(void) ; void call_and_disable_work_5(struct work_struct *work ) ; void ldv_initialize_bnx2x_phy_25(void) ; void activate_work_8(struct work_struct *work , int state ) ; void ldv_net_device_ops_30(void) ; void ldv_initialize_bnx2x_phy_14(void) ; void activate_work_6(struct work_struct *work , int state ) ; void ldv_initialize_bnx2x_phy_21(void) ; void ldv_initialize_bnx2x_phy_18(void) ; void ldv_initialize_ethtool_ops_11(void) ; void ldv_initialize_bnx2x_phy_26(void) ; void activate_work_4(struct work_struct *work , int state ) ; void call_and_disable_work_7(struct work_struct *work ) ; void call_and_disable_all_5(int state ) ; void ldv_initialize_bnx2x_phy_13(void) ; void ldv_initialize_dcbnl_rtnl_ops_10(void) ; int reg_timer_9(struct timer_list *timer ) ; void ldv_initialize_bnx2x_phy_15(void) ; void work_init_8(void) ; void disable_suitable_timer_9(struct timer_list *timer ) ; void work_init_6(void) ; void disable_work_6(struct work_struct *work ) ; void ldv_initialize_bnx2x_phy_23(void) ; void invoke_work_5(void) ; void activate_work_7(struct work_struct *work , int state ) ; void call_and_disable_work_8(struct work_struct *work ) ; void choose_timer_9(struct timer_list *timer ) ; void disable_work_4(struct work_struct *work ) ; void work_init_4(void) ; void ldv_pci_driver_27(void) ; void disable_work_8(struct work_struct *work ) ; void call_and_disable_work_6(struct work_struct *work ) ; void ldv_initialize_bnx2x_phy_24(void) ; void call_and_disable_work_4(struct work_struct *work ) ; __inline static void *dev_get_drvdata(struct device const *dev ) { { return ((void *)dev->driver_data); } } __inline static void dev_set_drvdata(struct device *dev , void *data ) { { dev->driver_data = data; return; } } extern void dev_err(struct device const * , char const * , ...) ; extern void _dev_info(struct device const * , char const * , ...) ; extern 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); } } extern void synchronize_irq(unsigned int ) ; extern int pci_bus_read_config_word(struct pci_bus * , unsigned int , int , u16 * ) ; extern int pci_bus_read_config_dword(struct pci_bus * , unsigned int , int , u32 * ) ; extern int pci_bus_write_config_word(struct pci_bus * , unsigned int , int , u16 ) ; extern int pci_bus_write_config_dword(struct pci_bus * , unsigned int , int , u32 ) ; __inline static int pci_read_config_word(struct pci_dev const *dev , int where , u16 *val ) { int tmp ; { tmp = pci_bus_read_config_word(dev->bus, dev->devfn, where, val); return (tmp); } } __inline static int pci_read_config_dword(struct pci_dev const *dev , int where , u32 *val ) { int tmp ; { tmp = pci_bus_read_config_dword(dev->bus, dev->devfn, where, val); return (tmp); } } __inline static int pci_write_config_word(struct pci_dev const *dev , int where , u16 val ) { int tmp ; { tmp = pci_bus_write_config_word(dev->bus, dev->devfn, where, (int )val); return (tmp); } } __inline static int pci_write_config_dword(struct pci_dev const *dev , int where , u32 val ) { int tmp ; { tmp = pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); return (tmp); } } extern int pcie_capability_read_word(struct pci_dev * , int , u16 * ) ; extern int pci_enable_device(struct pci_dev * ) ; extern void pci_disable_device(struct pci_dev * ) ; extern void pci_set_master(struct pci_dev * ) ; extern void pci_intx(struct pci_dev * , int ) ; extern int pci_wait_for_pending_transaction(struct pci_dev * ) ; extern int pcie_get_minimum_link(struct pci_dev * , enum pci_bus_speed * , enum pcie_link_width * ) ; extern int pci_save_state(struct pci_dev * ) ; extern void pci_restore_state(struct pci_dev * ) ; extern int pci_set_power_state(struct pci_dev * , pci_power_t ) ; extern int pci_wake_from_d3(struct pci_dev * , bool ) ; extern ssize_t pci_read_vpd(struct pci_dev * , loff_t , size_t , void * ) ; 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_27(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_30(struct pci_driver *ldv_func_arg1 ) ; extern void put_page(struct page * ) ; extern void pci_disable_msi(struct pci_dev * ) ; extern void pci_disable_msix(struct pci_dev * ) ; __inline static int valid_dma_direction(int dma_direction ) { { return ((dma_direction == 0 || dma_direction == 1) || dma_direction == 2); } } 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 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_28394: ; goto ldv_28394; } 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; } } extern int dma_supported(struct device * , u64 ) ; extern int dma_set_mask(struct device * , u64 ) ; extern void *dma_alloc_attrs(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ) ; 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); } } __inline static int dma_set_mask_and_coherent(struct device *dev , u64 mask ) { int rc ; int tmp ; { tmp = dma_set_mask(dev, mask); rc = tmp; if (rc == 0) { dma_set_coherent_mask(dev, mask); } else { } return (rc); } } __inline static void *dma_zalloc_coherent(struct device *dev , size_t size , dma_addr_t *dma_handle , gfp_t flag ) { void *ret ; void *tmp ; { tmp = dma_alloc_attrs(dev, size, dma_handle, flag | 32768U, (struct dma_attrs *)0); ret = tmp; return (ret); } } __inline static void *pci_get_drvdata(struct pci_dev *pdev ) { void *tmp ; { tmp = dev_get_drvdata((struct device const *)(& pdev->dev)); return (tmp); } } __inline static void pci_set_drvdata(struct pci_dev *pdev , void *data ) { { dev_set_drvdata(& pdev->dev, data); return; } } extern void *pci_ioremap_bar(struct pci_dev * , int ) ; __inline static int pci_pcie_cap(struct pci_dev *dev ) { { return ((int )dev->pcie_cap); } } __inline static bool pci_is_pcie(struct pci_dev *dev ) { int tmp ; { tmp = pci_pcie_cap(dev); return (tmp != 0); } } __inline static u16 pci_vpd_lrdt_size(u8 const *lrdt ) { { return ((int )((u16 )*(lrdt + 1UL)) + ((int )((u16 )*(lrdt + 2UL)) << 8U)); } } __inline static u8 pci_vpd_info_field_size(u8 const *info_field ) { { return ((u8 )*(info_field + 2UL)); } } extern int pci_vpd_find_tag(u8 const * , unsigned int , unsigned int , u8 ) ; extern int pci_vpd_find_info_keyword(u8 const * , unsigned int , unsigned int , char const * ) ; extern int pci_enable_pcie_error_reporting(struct pci_dev * ) ; extern int pci_disable_pcie_error_reporting(struct pci_dev * ) ; extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev * ) ; extern void __const_udelay(unsigned long ) ; extern void msleep(unsigned int ) ; extern void usleep_range(unsigned long , unsigned long ) ; __inline static void sema_init(struct semaphore *sem , int val ) { struct lock_class_key __key ; struct semaphore __constr_expr_0 ; { __constr_expr_0.lock.raw_lock.val.counter = 0; __constr_expr_0.lock.magic = 3735899821U; __constr_expr_0.lock.owner_cpu = 4294967295U; __constr_expr_0.lock.owner = (void *)-1; __constr_expr_0.lock.dep_map.key = 0; __constr_expr_0.lock.dep_map.class_cache[0] = 0; __constr_expr_0.lock.dep_map.class_cache[1] = 0; __constr_expr_0.lock.dep_map.name = "(*sem).lock"; __constr_expr_0.lock.dep_map.cpu = 0; __constr_expr_0.lock.dep_map.ip = 0UL; __constr_expr_0.count = (unsigned int )val; __constr_expr_0.wait_list.next = & sem->wait_list; __constr_expr_0.wait_list.prev = & sem->wait_list; *sem = __constr_expr_0; lockdep_init_map(& sem->lock.dep_map, "semaphore->lock", & __key, 0); return; } } extern void down(struct semaphore * ) ; extern int down_interruptible(struct semaphore * ) ; extern int down_trylock(struct semaphore * ) ; extern int down_timeout(struct semaphore * , long ) ; extern void up(struct semaphore * ) ; extern void get_random_bytes(void * , int ) ; __inline static unsigned char *skb_end_pointer(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->end); } } __inline static struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb ) { unsigned char *tmp ; { tmp = skb_end_pointer((struct sk_buff const *)skb); return (& ((struct skb_shared_info *)tmp)->hwtstamps); } } __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 int pskb_may_pull(struct sk_buff *skb , unsigned int len ) { unsigned int tmp ; long tmp___0 ; long tmp___1 ; unsigned int tmp___2 ; unsigned char *tmp___3 ; { tmp = skb_headlen((struct sk_buff const *)skb); tmp___0 = ldv__builtin_expect(tmp >= len, 1L); if (tmp___0 != 0L) { return (1); } else { } tmp___1 = ldv__builtin_expect(skb->len < len, 0L); if (tmp___1 != 0L) { return (0); } else { } tmp___2 = skb_headlen((struct sk_buff const *)skb); tmp___3 = __pskb_pull_tail(skb, (int )(len - tmp___2)); return ((unsigned long )tmp___3 != (unsigned long )((unsigned char *)0U)); } } __inline static unsigned char *skb_inner_mac_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->inner_mac_header); } } __inline static unsigned char *skb_transport_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->transport_header); } } __inline static unsigned char *skb_network_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->network_header); } } extern void skb_tstamp_tx(struct sk_buff * , struct skb_shared_hwtstamps * ) ; __inline static struct mii_ioctl_data *if_mii(struct ifreq *rq ) { { return ((struct mii_ioctl_data *)(& rq->ifr_ifru)); } } extern void __napi_schedule(struct napi_struct * ) ; extern void __napi_schedule_irqoff(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 napi_schedule_irqoff(struct napi_struct *n ) { bool tmp ; { tmp = napi_schedule_prep(n); if ((int )tmp) { __napi_schedule_irqoff(n); } else { } return; } } extern void napi_hash_del(struct napi_struct * ) ; __inline static void netdev_reset_tc(struct net_device *dev ) { { dev->num_tc = 0U; memset((void *)(& dev->tc_to_txq), 0, 64UL); memset((void *)(& dev->prio_tc_map), 0, 16UL); return; } } __inline static struct netdev_queue *netdev_get_tx_queue(struct net_device const *dev , unsigned int index ) { { return ((struct netdev_queue *)dev->_tx + (unsigned long )index); } } __inline static void *netdev_priv(struct net_device const *dev ) { { return ((void *)dev + 3008U); } } extern void netif_napi_del(struct napi_struct * ) ; extern int dev_close(struct net_device * ) ; extern void free_netdev(struct net_device * ) ; void ldv_free_netdev_17(struct net_device *dev ) ; void ldv_free_netdev_19(struct net_device *dev ) ; void ldv_free_netdev_22(struct net_device *dev ) ; extern void netif_tx_wake_queue(struct netdev_queue * ) ; __inline static void netif_tx_wake_all_queues(struct net_device *dev ) { unsigned int i ; struct netdev_queue *txq ; struct netdev_queue *tmp ; { i = 0U; goto ldv_44512; ldv_44511: tmp = netdev_get_tx_queue((struct net_device const *)dev, i); txq = tmp; netif_tx_wake_queue(txq); i = i + 1U; ldv_44512: ; if (dev->num_tx_queues > i) { goto ldv_44511; } else { } return; } } __inline static void netif_tx_stop_queue(struct netdev_queue *dev_queue ) { { set_bit(0L, (unsigned long volatile *)(& dev_queue->state)); return; } } __inline static bool netif_running(struct net_device const *dev ) { int tmp ; { tmp = constant_test_bit(0L, (unsigned long const volatile *)(& dev->state)); return (tmp != 0); } } extern void __dev_kfree_skb_any(struct sk_buff * , enum skb_free_reason ) ; __inline static void dev_kfree_skb_any(struct sk_buff *skb ) { { __dev_kfree_skb_any(skb, 1); return; } } extern void netif_carrier_off(struct net_device * ) ; extern void netif_device_detach(struct net_device * ) ; extern void netif_device_attach(struct net_device * ) ; __inline static void __netif_tx_lock(struct netdev_queue *txq , int cpu ) { { spin_lock(& txq->_xmit_lock); txq->xmit_lock_owner = cpu; return; } } __inline static void __netif_tx_unlock(struct netdev_queue *txq ) { { txq->xmit_lock_owner = -1; spin_unlock(& txq->_xmit_lock); return; } } __inline static void netif_tx_disable(struct net_device *dev ) { unsigned int i ; int cpu ; int pscr_ret__ ; void const *__vpp_verify ; int pfo_ret__ ; int pfo_ret_____0 ; int pfo_ret_____1 ; int pfo_ret_____2 ; struct netdev_queue *txq ; struct netdev_queue *tmp ; { local_bh_disable(); __vpp_verify = (void const *)0; switch (4UL) { case 1UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_45074; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_45074; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_45074; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_45074; default: __bad_percpu_size(); } ldv_45074: pscr_ret__ = pfo_ret__; goto ldv_45080; case 2UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____0): "m" (cpu_number)); goto ldv_45084; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_45084; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_45084; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_45084; default: __bad_percpu_size(); } ldv_45084: pscr_ret__ = pfo_ret_____0; goto ldv_45080; case 4UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____1): "m" (cpu_number)); goto ldv_45093; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_45093; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_45093; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_45093; default: __bad_percpu_size(); } ldv_45093: pscr_ret__ = pfo_ret_____1; goto ldv_45080; case 8UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____2): "m" (cpu_number)); goto ldv_45102; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_45102; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_45102; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_45102; default: __bad_percpu_size(); } ldv_45102: pscr_ret__ = pfo_ret_____2; goto ldv_45080; default: __bad_size_call_parameter(); goto ldv_45080; } ldv_45080: cpu = pscr_ret__; i = 0U; goto ldv_45112; ldv_45111: tmp = netdev_get_tx_queue((struct net_device const *)dev, i); txq = tmp; __netif_tx_lock(txq, cpu); netif_tx_stop_queue(txq); __netif_tx_unlock(txq); i = i + 1U; ldv_45112: ; if (dev->num_tx_queues > i) { goto ldv_45111; } else { } local_bh_enable(); return; } } __inline static void netif_addr_lock_bh(struct net_device *dev ) { { spin_lock_bh(& dev->addr_list_lock); return; } } __inline static void netif_addr_unlock_bh(struct net_device *dev ) { { spin_unlock_bh(& dev->addr_list_lock); return; } } extern int register_netdev(struct net_device * ) ; int ldv_register_netdev_18(struct net_device *dev ) ; extern void unregister_netdev(struct net_device * ) ; void ldv_unregister_netdev_20(struct net_device *dev ) ; extern int dev_addr_add(struct net_device * , unsigned char const * , unsigned char ) ; extern int dev_addr_del(struct net_device * , unsigned char const * , unsigned char ) ; __inline static netdev_features_t netdev_intersect_features(netdev_features_t f1 , netdev_features_t f2 ) { { if ((f1 & 8ULL) != 0ULL) { f1 = f1 | 18ULL; } else { } if ((f2 & 8ULL) != 0ULL) { f2 = f2 | 18ULL; } else { } f1 = f1 & f2; if ((f1 & 8ULL) != 0ULL) { f1 = f1 & 0xffffffffffffffedULL; } else { } return (f1); } } extern void netdev_printk(char const * , struct net_device const * , char const * , ...) ; extern void netdev_err(struct net_device const * , char const * , ...) ; extern void netdev_info(struct net_device const * , char const * , ...) ; 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 void eth_random_addr(u8 *addr ) { { get_random_bytes((void *)addr, 6); *addr = (unsigned int )*addr & 254U; *addr = (u8 )((unsigned int )*addr | 2U); return; } } __inline static void eth_zero_addr(u8 *addr ) { { memset((void *)addr, 0, 6UL); return; } } __inline static void eth_hw_addr_random(struct net_device *dev ) { { dev->addr_assign_type = 1U; eth_random_addr(dev->dev_addr); return; } } extern void rtnl_lock(void) ; extern void rtnl_unlock(void) ; __inline static __be16 __vlan_get_protocol(struct sk_buff *skb , __be16 type , int *depth ) { unsigned int vlan_depth ; int __ret_warn_on ; long tmp ; long tmp___0 ; struct vlan_hdr *vh ; int tmp___1 ; long tmp___2 ; { vlan_depth = (unsigned int )skb->mac_len; if ((unsigned int )type == 129U || (unsigned int )type == 43144U) { if (vlan_depth != 0U) { __ret_warn_on = vlan_depth <= 3U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/if_vlan.h", 492); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return (0U); } else { } vlan_depth = vlan_depth - 4U; } else { vlan_depth = 14U; } ldv_46311: tmp___1 = pskb_may_pull(skb, vlan_depth + 4U); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { return (0U); } else { } vh = (struct vlan_hdr *)skb->data + (unsigned long )vlan_depth; type = vh->h_vlan_encapsulated_proto; vlan_depth = vlan_depth + 4U; if ((unsigned int )type == 129U || (unsigned int )type == 43144U) { goto ldv_46311; } else { } } else { } if ((unsigned long )depth != (unsigned long )((int *)0)) { *depth = (int )vlan_depth; } else { } return (type); } } __inline static __be16 vlan_get_protocol(struct sk_buff *skb ) { __be16 tmp ; { tmp = __vlan_get_protocol(skb, (int )skb->protocol, (int *)0); return (tmp); } } __inline static bool skb_vlan_tagged_multi(struct sk_buff const *skb ) { __be16 protocol ; struct vlan_ethhdr *veh ; long tmp ; { protocol = skb->protocol; if (((int )skb->vlan_tci & 4096) == 0) { tmp = ldv__builtin_expect((long )((unsigned int )protocol != 129U && (unsigned int )protocol != 43144U), 1L); if (tmp != 0L) { return (0); } else { } veh = (struct vlan_ethhdr *)skb->data; protocol = veh->h_vlan_encapsulated_proto; } else { } if ((unsigned int )protocol != 129U && (unsigned int )protocol != 43144U) { return (0); } else { } return (1); } } __inline static netdev_features_t vlan_features_check(struct sk_buff const *skb , netdev_features_t features ) { bool tmp ; { tmp = skb_vlan_tagged_multi(skb); if ((int )tmp) { features = netdev_intersect_features(features, 549755814121ULL); } else { } return (features); } } extern unsigned long long elfcorehdr_addr ; __inline static int is_kdump_kernel(void) { { return (elfcorehdr_addr != 0xffffffffffffffffULL); } } __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 ipv6hdr *ipv6_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_network_header(skb); return ((struct ipv6hdr *)tmp); } } __inline static netdev_features_t vxlan_features_check(struct sk_buff *skb , netdev_features_t features ) { u8 l4_hdr ; __be16 tmp ; struct iphdr *tmp___0 ; struct ipv6hdr *tmp___1 ; unsigned char *tmp___2 ; unsigned char *tmp___3 ; { l4_hdr = 0U; if ((unsigned int )*((unsigned char *)skb + 146UL) == 0U) { return (features); } else { } tmp = vlan_get_protocol(skb); switch ((int )tmp) { case 8: tmp___0 = ip_hdr((struct sk_buff const *)skb); l4_hdr = tmp___0->protocol; goto ldv_55696; case 56710: tmp___1 = ipv6_hdr((struct sk_buff const *)skb); l4_hdr = tmp___1->nexthdr; goto ldv_55696; default: ; return (features); } ldv_55696: ; if ((unsigned int )l4_hdr == 17U) { if ((unsigned int )*((unsigned char *)skb + 147UL) != 0U || (unsigned int )skb->__annonCompField92.inner_protocol != 22629U) { return (features & 0xffffffffe000ffe5ULL); } else { tmp___2 = skb_inner_mac_header((struct sk_buff const *)skb); tmp___3 = skb_transport_header((struct sk_buff const *)skb); if ((long )tmp___2 - (long )tmp___3 != 16L) { return (features & 0xffffffffe000ffe5ULL); } else { } } } else { } return (features); } } extern int zlib_inflate_workspacesize(void) ; extern int zlib_inflate(z_streamp , int ) ; extern int zlib_inflateEnd(z_streamp ) ; extern int zlib_inflateInit2(z_streamp , int ) ; extern void *vmalloc(unsigned long ) ; extern void vfree(void const * ) ; extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info * , struct device * ) ; extern int ptp_clock_unregister(struct ptp_clock * ) ; __inline static void timecounter_adjtime(struct timecounter *tc , s64 delta ) { { tc->nsec = tc->nsec + (unsigned long long )delta; return; } } extern void timecounter_init(struct timecounter * , struct cyclecounter const * , u64 ) ; extern u64 timecounter_read(struct timecounter * ) ; extern u64 timecounter_cyc2time(struct timecounter * , cycle_t ) ; extern int mdio_mii_ioctl(struct mdio_if_info const * , struct mii_ioctl_data * , int ) ; int bnx2x_phy_init(struct link_params *params , struct link_vars *vars ) ; int bnx2x_link_reset(struct link_params *params , struct link_vars *vars , u8 reset_ext_phy ) ; int bnx2x_lfa_reset(struct link_params *params , struct link_vars *vars ) ; int bnx2x_link_update(struct link_params *params , struct link_vars *vars ) ; int bnx2x_phy_read(struct link_params *params , u8 phy_addr , u8 devad , u16 reg , u16 *ret_val ) ; int bnx2x_phy_write(struct link_params *params , u8 phy_addr , u8 devad , u16 reg , u16 val ) ; void bnx2x_link_status_update(struct link_params *params , struct link_vars *vars ) ; void bnx2x_handle_module_detect_int(struct link_params *params ) ; int bnx2x_test_link(struct link_params *params , struct link_vars *vars , u8 is_serdes ) ; int bnx2x_common_init_phy(struct bnx2x *bp , u32 *shmem_base_path , u32 *shmem2_base_path , u32 chip_id ) ; void bnx2x_hw_reset_phy(struct link_params *params ) ; int bnx2x_phy_probe(struct link_params *params ) ; u8 bnx2x_fan_failure_det_req(struct bnx2x *bp , u32 shmem_base , u32 shmem2_base , u8 port ) ; void bnx2x_set_rx_filter(struct link_params *params , u8 en ) ; void bnx2x_init_mod_abs_int(struct bnx2x *bp , struct link_vars *vars , u32 chip_id , u32 shmem_base , u32 shmem2_base , u8 port ) ; void bnx2x_period_func(struct link_params *params , struct link_vars *vars ) ; void bnx2x_init_func_obj(struct bnx2x *bp , struct bnx2x_func_sp_obj *obj , void *rdata , dma_addr_t rdata_mapping , void *afex_rdata , dma_addr_t afex_rdata_mapping , struct bnx2x_func_sp_drv_ops *drv_iface ) ; int bnx2x_func_state_change(struct bnx2x *bp , struct bnx2x_func_state_params *params ) ; enum bnx2x_func_state bnx2x_func_get_state(struct bnx2x *bp , struct bnx2x_func_sp_obj *o ) ; void bnx2x_init_queue_obj(struct bnx2x *bp , struct bnx2x_queue_sp_obj *obj , u8 cl_id , u32 *cids , u8 cid_cnt , u8 func_id , void *rdata , dma_addr_t rdata_mapping , unsigned long type ) ; int bnx2x_queue_state_change(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) ; void bnx2x_init_mac_obj(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *mac_obj , u8 cl_id , u32 cid , u8 func_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type , struct bnx2x_credit_pool_obj *macs_pool ) ; int bnx2x_config_vlan_mac(struct bnx2x *bp , struct bnx2x_vlan_mac_ramrod_params *p ) ; int bnx2x_config_rx_mode(struct bnx2x *bp , struct bnx2x_rx_mode_ramrod_params *p ) ; int bnx2x_config_mcast(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) ; void bnx2x_dcbx_init_params(struct bnx2x *bp ) ; void bnx2x_dcbx_set_state(struct bnx2x *bp , bool dcb_on , u32 dcbx_enabled ) ; void bnx2x_dcbx_set_params(struct bnx2x *bp , u32 state ) ; void bnx2x_dcbx_pmf_update(struct bnx2x *bp ) ; struct dcbnl_rtnl_ops const bnx2x_dcbnl_ops ; int bnx2x_dcbnl_update_applist(struct bnx2x *bp , bool delall ) ; int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp ) ; int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp ) ; void bnx2x_memset_stats(struct bnx2x *bp ) ; void bnx2x_stats_init(struct bnx2x *bp ) ; void bnx2x_stats_handle(struct bnx2x *bp , enum bnx2x_stats_event event ) ; void bnx2x_save_statistics(struct bnx2x *bp ) ; void bnx2x_afex_collect_stats(struct bnx2x *bp , void *void_afex_stats , u32 stats_type ) ; void bnx2x_panic_dump(struct bnx2x *bp , bool disable_int ) ; int bnx2x_set_mac_one(struct bnx2x *bp , u8 *mac , struct bnx2x_vlan_mac_obj *obj , bool set , int mac_type , unsigned long *ramrod_flags ) ; int bnx2x_del_all_macs(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *mac_obj , int mac_type , bool wait_for_comp ) ; void bnx2x_func_init(struct bnx2x *bp , struct bnx2x_func_init_params *p ) ; void bnx2x_init_sb(struct bnx2x *bp , dma_addr_t mapping , int vfid , u8 vf_valid , int fw_sb_id , int igu_sb_id ) ; int bnx2x_get_gpio(struct bnx2x *bp , int gpio_num , u8 port ) ; int bnx2x_set_gpio(struct bnx2x *bp , int gpio_num , u32 mode , u8 port ) ; int bnx2x_set_mult_gpio(struct bnx2x *bp , u8 pins , u32 mode ) ; int bnx2x_set_gpio_int(struct bnx2x *bp , int gpio_num , u32 mode , u8 port ) ; void bnx2x_read_mf_cfg(struct bnx2x *bp ) ; int bnx2x_pretend_func(struct bnx2x *bp , u16 pretend_func_val ) ; void bnx2x_read_dmae(struct bnx2x *bp , u32 src_addr , u32 len32 ) ; void bnx2x_write_dmae(struct bnx2x *bp , dma_addr_t dma_addr , u32 dst_addr , u32 len32 ) ; void bnx2x_post_dmae(struct bnx2x *bp , struct dmae_command *dmae , int idx ) ; u32 bnx2x_dmae_opcode_add_comp(u32 opcode , u8 comp_type ) ; u32 bnx2x_dmae_opcode_clr_src_reset(u32 opcode ) ; u32 bnx2x_dmae_opcode(struct bnx2x *bp , u8 src_type , u8 dst_type , bool with_comp , u8 comp_type ) ; void bnx2x_prep_dmae_with_comp(struct bnx2x *bp , struct dmae_command *dmae , u8 src_type , u8 dst_type ) ; int bnx2x_issue_dmae_with_comp(struct bnx2x *bp , struct dmae_command *dmae , u32 *comp ) ; u32 bnx2x_flr_clnup_poll_count(struct bnx2x *bp ) ; void bnx2x_tx_hw_flushed(struct bnx2x *bp , u32 poll_count ) ; int bnx2x_send_final_clnup(struct bnx2x *bp , u8 clnup_func , u32 poll_cnt ) ; u8 bnx2x_is_pcie_pending(struct pci_dev *dev ) ; int bnx2x_flr_clnup_poll_hw_counter(struct bnx2x *bp , u32 reg , char *msg , u32 poll_cnt ) ; void bnx2x_calc_fc_adv(struct bnx2x *bp ) ; int bnx2x_sp_post(struct bnx2x *bp , int command , int cid , u32 data_hi , u32 data_lo , int cmd_type ) ; void bnx2x_update_coalesce(struct bnx2x *bp ) ; bool bnx2x_port_after_undi(struct bnx2x *bp ) ; __inline static u32 reg_poll(struct bnx2x *bp , u32 reg , u32 expected , int ms , int wait ) { u32 val ; { ldv_60968: val = readl((void const volatile *)bp->regview + (unsigned long )reg); if (val == expected) { goto ldv_60967; } else { } ms = ms - wait; msleep((unsigned int )wait); if (ms > 0) { goto ldv_60968; } else { } ldv_60967: ; return (val); } } void bnx2x_igu_clear_sb_gen(struct bnx2x *bp , u8 func , u8 idu_sb_id , bool is_pf ) ; int bnx2x_compare_fw_ver(struct bnx2x *bp , u32 load_code , bool print_err ) ; static u32 const dmae_reg_go_c[16U] = { 1056896U, 1056900U, 1056928U, 1056932U, 1056936U, 1056940U, 1056944U, 1056948U, 1056952U, 1056956U, 1056904U, 1056908U, 1056912U, 1056916U, 1056920U, 1056924U}; void bnx2x_set_ethtool_ops(struct bnx2x *bp , struct net_device *netdev ) ; void bnx2x_notify_link_changed(struct bnx2x *bp ) ; void bnx2x_set_local_cmng(struct bnx2x *bp ) ; void bnx2x_update_mng_version(struct bnx2x *bp ) ; void bnx2x_init_ptp(struct bnx2x *bp ) ; int bnx2x_configure_ptp_filters(struct bnx2x *bp ) ; void bnx2x_set_rx_ts(struct bnx2x *bp , struct sk_buff *skb ) ; __inline static void bnx2x_init_max(struct cmng_init_input const *input_data , u32 r_param , struct cmng_init *ram_data ) { u32 vnic ; struct cmng_vnic *vdata ; struct cmng_struct_per_port *pdata ; { vdata = & ram_data->vnic; pdata = & ram_data->port; pdata->rs_vars.rs_periodic_timeout = 100U; pdata->rs_vars.rs_threshold = (r_param * 2000U) / 4U; vnic = 0U; goto ldv_61141; ldv_61140: vdata->vnic_max_rate[vnic].vn_counter.rate = input_data->vnic_max_rate[vnic]; vdata->vnic_max_rate[vnic].vn_counter.quota = ((unsigned int )vdata->vnic_max_rate[vnic].vn_counter.rate * 400U) / 8U; vnic = vnic + 1U; ldv_61141: ; if (vnic <= 3U) { goto ldv_61140; } else { } return; } } __inline static void bnx2x_init_min(struct cmng_init_input const *input_data , u32 r_param , struct cmng_init *ram_data ) { u32 vnic ; u32 fair_periodic_timeout_usec ; u32 vnicWeightSum ; u32 tFair ; struct cmng_vnic *vdata ; struct cmng_struct_per_port *pdata ; { vdata = & ram_data->vnic; pdata = & ram_data->port; fair_periodic_timeout_usec = 160000U / r_param; tFair = 154214400U / (unsigned int )input_data->port_rate; pdata->fair_vars.fair_threshold = 160000U; pdata->fair_vars.upper_bound = (r_param * tFair) * 2U; pdata->fair_vars.fairness_timeout = fair_periodic_timeout_usec / 4U; vnicWeightSum = 0U; vnic = 0U; goto ldv_61155; ldv_61154: vnicWeightSum = (u32 )input_data->vnic_min_rate[vnic] + vnicWeightSum; vnic = vnic + 1U; ldv_61155: ; if (vnic <= 3U) { goto ldv_61154; } else { } if (vnicWeightSum != 0U) { vnic = 0U; goto ldv_61158; ldv_61157: vdata->vnic_min_rate[vnic].vn_credit_delta = ((unsigned int )input_data->vnic_min_rate[vnic] * (154214400U / (vnicWeightSum * 800U))) * 100U; if (vdata->vnic_min_rate[vnic].vn_credit_delta < pdata->fair_vars.fair_threshold + 32768U) { vdata->vnic_min_rate[vnic].vn_credit_delta = pdata->fair_vars.fair_threshold + 32768U; } else { } vnic = vnic + 1U; ldv_61158: ; if (vnic <= 3U) { goto ldv_61157; } else { } } else { } return; } } __inline static void bnx2x_init_fw_wrr(struct cmng_init_input const *input_data , u32 r_param , struct cmng_init *ram_data ) { u32 vnic ; u32 cos ; u32 cosWeightSum ; struct cmng_vnic *vdata ; struct cmng_struct_per_port *pdata ; u32 *ccd ; { cosWeightSum = 0U; vdata = & ram_data->vnic; pdata = & ram_data->port; cos = 0U; goto ldv_61171; ldv_61170: cosWeightSum = (u32 )input_data->cos_min_rate[cos] + cosWeightSum; cos = cos + 1U; ldv_61171: ; if (cos <= 3U) { goto ldv_61170; } else { } if (cosWeightSum != 0U) { vnic = 0U; goto ldv_61178; ldv_61177: ccd = (u32 *)(& vdata->vnic_min_rate[vnic].cos_credit_delta); cos = 0U; goto ldv_61175; ldv_61174: *(ccd + (unsigned long )cos) = ((unsigned int )input_data->cos_min_rate[cos] * (154214400U / (cosWeightSum * 800U))) * 100U; if (*(ccd + (unsigned long )cos) < pdata->fair_vars.fair_threshold + 32768U) { *(ccd + (unsigned long )cos) = pdata->fair_vars.fair_threshold + 32768U; } else { } cos = cos + 1U; ldv_61175: ; if (cos <= 3U) { goto ldv_61174; } else { } vnic = vnic + 1U; ldv_61178: ; if (vnic <= 3U) { goto ldv_61177; } else { } } else { } return; } } __inline static void bnx2x_init_safc(struct cmng_init_input const *input_data , struct cmng_init *ram_data ) { { ram_data->port.safc_vars.safc_timeout_usec = 52U; return; } } __inline static void bnx2x_init_cmng(struct cmng_init_input const *input_data , struct cmng_init *ram_data ) { u32 r_param ; { memset((void *)ram_data, 0, 200UL); ram_data->port.flags = input_data->flags; r_param = (unsigned int )input_data->port_rate / 8U; bnx2x_init_max(input_data, r_param, ram_data); bnx2x_init_min(input_data, r_param, ram_data); bnx2x_init_fw_wrr(input_data, r_param, ram_data); bnx2x_init_safc(input_data, ram_data); return; } } static struct __anonstruct_bnx2x_blocks_parity_data_421 const bnx2x_blocks_parity_data[40U] = { {1061012U, 1061004U, 134217727U, {67108863U, 67108863U, 134217727U, 134217727U}, {'P', 'X', 'P', '\000'}}, {1181064U, 1181056U, 4294967295U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'P', 'X', 'P', '2', '_', '0', '\000'}}, {1181080U, 1181072U, 33554431U, {127U, 127U, 2047U, 33554431U}, {'P', 'X', 'P', '2', '_', '1', '\000'}}, {1081504U, 1081496U, 7U, {7U, 7U, 0U, 0U}, {'H', 'C', '\000'}}, {66524U, 66516U, 4294967295U, {1073741823U, 4294967295U, 0U, 0U}, {'N', 'I', 'G', '\000'}}, {99272U, 99264U, 4294967295U, {0U, 0U, 4294967295U, 4294967295U}, {'N', 'I', 'G', '_', '0', '\000'}}, {99288U, 99280U, 65535U, {0U, 0U, 255U, 65535U}, {'N', 'I', 'G', '_', '1', '\000'}}, {1245352U, 1245344U, 2047U, {0U, 0U, 2047U, 2047U}, {'I', 'G', 'U', '\000'}}, {41880U, 41872U, 1U, {1U, 1U, 1U, 1U}, {'M', 'I', 'S', 'C', '\000'}}, {1475668U, 1475660U, 0U, {511U, 4095U, 4095U, 4095U}, {'Q', 'M', '\000'}}, {1114584U, 1114576U, 31U, {0U, 0U, 31U, 31U}, {'A', 'T', 'C', '\000'}}, {37556U, 37548U, 3U, {0U, 0U, 3U, 3U}, {'P', 'G', 'L', 'U', 'E', '_', 'B', '\000'}}, {1507728U, 1507720U, 0U, {3U, 3U, 3U, 3U}, {'D', 'O', 'R', 'Q', '\000'}}, {790584U, 790576U, 15U, {15U, 15U, 15U, 15U}, {'U', 'P', 'B', '\000'}}, {1445944U, 1445936U, 0U, {15U, 15U, 15U, 15U}, {'X', 'P', 'B', '\000'}}, {263368U, 263360U, 4U, {7U, 7U, 7U, 7U}, {'S', 'R', 'C', '\000'}}, {1052748U, 1052740U, 0U, {31U, 31U, 31U, 31U}, {'C', 'D', 'U', '\000'}}, {1065240U, 1065232U, 0U, {15U, 15U, 15U, 63U}, {'C', 'F', 'C', '\000'}}, {49320U, 49312U, 0U, {1U, 1U, 1U, 1U}, {'D', 'B', 'G', '\000'}}, {1056868U, 1056860U, 0U, {15U, 15U, 15U, 15U}, {'D', 'M', 'A', 'E', '\000'}}, {393528U, 393520U, 0U, {15U, 15U, 15U, 15U}, {'B', 'R', 'B', '1', '\000'}}, {262564U, 262556U, 64U, {255U, 255U, 255U, 255U}, {'P', 'R', 'S', '\000'}}, {1311204U, 1311196U, 0U, {0U, 262143U, 1048575U, 268435455U}, {'P', 'B', 'F', '\000'}}, {1458444U, 1458436U, 0U, {0U, 127U, 127U, 127U}, {'T', 'M', '\000'}}, {271036U, 271028U, 24U, {2047U, 2047U, 2047U, 2047U}, {'T', 'S', 'D', 'M', '\000'}}, {795324U, 795316U, 8U, {2047U, 2047U, 2047U, 2047U}, {'C', 'S', 'D', 'M', '\000'}}, {803520U, 803512U, 56U, {2047U, 2047U, 2047U, 2047U}, {'U', 'S', 'D', 'M', '\000'}}, {1467068U, 1467060U, 8U, {2047U, 2047U, 2047U, 2047U}, {'X', 'S', 'D', 'M', '\000'}}, {328172U, 328164U, 0U, {0U, 134217727U, 134217727U, 134217727U}, {'T', 'C', 'M', '\000'}}, {852468U, 852460U, 0U, {0U, 134217727U, 134217727U, 134217727U}, {'C', 'C', 'M', '\000'}}, {917988U, 917980U, 0U, {0U, 134217727U, 134217727U, 134217727U}, {'U', 'C', 'M', '\000'}}, {131780U, 131772U, 0U, {0U, 1073741823U, 1073741823U, 1073741823U}, {'X', 'C', 'M', '\000'}}, {1573152U, 1573144U, 0U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'T', 'S', 'E', 'M', '_', '0', '\000'}}, {1573168U, 1573160U, 0U, {3U, 31U, 63U, 63U}, {'T', 'S', 'E', 'M', '_', '1', '\000'}}, {3146032U, 3146024U, 0U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'U', 'S', 'E', 'M', '_', '0', '\000'}}, {3146048U, 3146040U, 0U, {3U, 31U, 31U, 31U}, {'U', 'S', 'E', 'M', '_', '1', '\000'}}, {2097456U, 2097448U, 0U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'C', 'S', 'E', 'M', '_', '0', '\000'}}, {2097472U, 2097464U, 0U, {3U, 31U, 31U, 31U}, {'C', 'S', 'E', 'M', '_', '1', '\000'}}, {2621744U, 2621736U, 0U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'X', 'S', 'E', 'M', '_', '0', '\000'}}, {2621760U, 2621752U, 0U, {3U, 31U, 63U, 63U}, {'X', 'S', 'E', 'M', '_', '1', '\000'}}}; static struct __anonstruct_mcp_attn_ctl_regs_423 const mcp_attn_ctl_regs[6U] = { {41080U, 4026531840U}, {41208U, 1879048192U}, {41224U, 1879048192U}, {41240U, 4026531840U}, {41368U, 1879048192U}, {41384U, 1879048192U}}; __inline static void bnx2x_set_mcp_parity(struct bnx2x *bp , u8 enable ) { int i ; u32 reg_val ; { i = 0; goto ldv_61230; ldv_61229: reg_val = readl((void const volatile *)bp->regview + (unsigned long )mcp_attn_ctl_regs[i].addr); if ((unsigned int )enable != 0U) { reg_val = (u32 )mcp_attn_ctl_regs[i].bits | reg_val; } else { reg_val = (u32 )(~ mcp_attn_ctl_regs[i].bits) & reg_val; } writel(reg_val, (void volatile *)bp->regview + (unsigned long )mcp_attn_ctl_regs[i].addr); i = i + 1; ldv_61230: ; if ((unsigned int )i <= 5U) { goto ldv_61229; } else { } return; } } __inline static u32 bnx2x_parity_reg_mask(struct bnx2x *bp , int idx ) { { if (bp->common.chip_id >> 16 == 5710U) { return ((u32 )bnx2x_blocks_parity_data[idx].reg_mask.e1); } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { return ((u32 )bnx2x_blocks_parity_data[idx].reg_mask.e1h); } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return ((u32 )bnx2x_blocks_parity_data[idx].reg_mask.e2); } else { return ((u32 )bnx2x_blocks_parity_data[idx].reg_mask.e3); } } } __inline static void bnx2x_enable_blocks_parity(struct bnx2x *bp ) { int i ; u32 reg_mask ; u32 tmp ; { i = 0; goto ldv_61268; ldv_61267: tmp = bnx2x_parity_reg_mask(bp, i); reg_mask = tmp; if (reg_mask != 0U) { writel((unsigned int )bnx2x_blocks_parity_data[i].en_mask & reg_mask, (void volatile *)bp->regview + (unsigned long )bnx2x_blocks_parity_data[i].mask_addr); } else { } i = i + 1; ldv_61268: ; if ((unsigned int )i <= 39U) { goto ldv_61267; } else { } bnx2x_set_mcp_parity(bp, 1); return; } } static int bnx2x_gunzip(struct bnx2x *bp , u8 const *zbuf , int len ) ; static void bnx2x_reg_wr_ind(struct bnx2x *bp , u32 addr , u32 val ) ; static void bnx2x_write_dmae_phys_len(struct bnx2x *bp , dma_addr_t phys_addr , u32 addr , u32 len ) ; static void bnx2x_init_str_wr(struct bnx2x *bp , u32 addr , u32 const *data , u32 len ) { u32 i ; { i = 0U; goto ldv_61291; ldv_61290: writel(*(data + (unsigned long )i), (void volatile *)bp->regview + (unsigned long )(i * 4U + addr)); i = i + 1U; ldv_61291: ; if (i < len) { goto ldv_61290; } else { } return; } } static void bnx2x_init_ind_wr(struct bnx2x *bp , u32 addr , u32 const *data , u32 len ) { u32 i ; { i = 0U; goto ldv_61301; ldv_61300: bnx2x_reg_wr_ind(bp, i * 4U + addr, *(data + (unsigned long )i)); i = i + 1U; ldv_61301: ; if (i < len) { goto ldv_61300; } else { } return; } } static void bnx2x_write_big_buf(struct bnx2x *bp , u32 addr , u32 len , u8 wb ) { { if (bp->dmae_ready != 0) { bnx2x_write_dmae_phys_len(bp, bp->gunzip_mapping, addr, len); } else if ((unsigned int )wb != 0U && bp->common.chip_id >> 16 == 5710U) { bnx2x_init_ind_wr(bp, addr, (u32 const *)bp->gunzip_buf, len); } else { bnx2x_init_str_wr(bp, addr, (u32 const *)bp->gunzip_buf, len); } return; } } static void bnx2x_init_fill(struct bnx2x *bp , u32 addr , int fill , u32 len , u8 wb ) { u32 buf_len ; u32 buf_len32 ; u32 i ; u32 cur_len ; u32 _min1 ; u32 _min2 ; { buf_len = 32768U < len * 4U ? 32768U : len * 4U; buf_len32 = buf_len / 4U; memset(bp->gunzip_buf, (int )((unsigned char )fill), (size_t )buf_len); i = 0U; goto ldv_61324; ldv_61323: _min1 = buf_len32; _min2 = len - i; cur_len = _min1 < _min2 ? _min1 : _min2; bnx2x_write_big_buf(bp, i * 4U + addr, cur_len, (int )wb); i = i + buf_len32; ldv_61324: ; if (i < len) { goto ldv_61323; } else { } return; } } static void bnx2x_write_big_buf_wb(struct bnx2x *bp , u32 addr , u32 len ) { { if (bp->dmae_ready != 0) { bnx2x_write_dmae_phys_len(bp, bp->gunzip_mapping, addr, len); } else if (bp->common.chip_id >> 16 == 5710U) { bnx2x_init_ind_wr(bp, addr, (u32 const *)bp->gunzip_buf, len); } else { bnx2x_init_str_wr(bp, addr, (u32 const *)bp->gunzip_buf, len); } return; } } static void bnx2x_init_wr_64(struct bnx2x *bp , u32 addr , u32 const *data , u32 len64 ) { u32 buf_len32 ; u32 len ; u64 data64 ; u32 i ; unsigned int _min1 ; u32 _min2 ; u64 *pdata ; u32 cur_len ; u32 _min1___0 ; u32 _min2___0 ; { buf_len32 = 8192U; len = len64 * 2U; data64 = 0ULL; data64 = ((unsigned long long )*(data + 1UL) << 32) + (unsigned long long )*data; _min1 = 4096U; _min2 = len64; len64 = _min1 < _min2 ? _min1 : _min2; i = 0U; goto ldv_61346; ldv_61345: pdata = (u64 *)bp->gunzip_buf + (unsigned long )i; *pdata = data64; i = i + 1U; ldv_61346: ; if (i < len64) { goto ldv_61345; } else { } i = 0U; goto ldv_61353; ldv_61352: _min1___0 = buf_len32; _min2___0 = len - i; cur_len = _min1___0 < _min2___0 ? _min1___0 : _min2___0; bnx2x_write_big_buf_wb(bp, i * 4U + addr, cur_len); i = i + buf_len32; ldv_61353: ; if (i < len) { goto ldv_61352; } else { } return; } } static u8 const *bnx2x_sel_blob(struct bnx2x *bp , u32 addr , u8 const *data ) { { if (addr > 1573887U && addr <= 1574912U) { data = bp->tsem_int_table_data; } else if (addr > 2098175U && addr <= 2099200U) { data = bp->csem_int_table_data; } else if (addr > 3146751U && addr <= 3147776U) { data = bp->usem_int_table_data; } else if (addr > 2622463U && addr <= 2623488U) { data = bp->xsem_int_table_data; } else if (addr > 1835007U && addr <= 2097152U) { data = bp->tsem_pram_data; } else if (addr > 2359295U && addr <= 2621440U) { data = bp->csem_pram_data; } else if (addr > 3407871U && addr <= 3670016U) { data = bp->usem_pram_data; } else if (addr > 2883583U && addr <= 3145728U) { data = bp->xsem_pram_data; } else { } return (data); } } static void bnx2x_init_wr_wb(struct bnx2x *bp , u32 addr , u32 const *data , u32 len ) { { if (bp->dmae_ready != 0) { memcpy(bp->gunzip_buf, (void const *)data, (size_t )(len * 4U)); bnx2x_write_big_buf_wb(bp, addr, len); } else if (bp->common.chip_id >> 16 == 5710U) { bnx2x_init_ind_wr(bp, addr, data, len); } else { bnx2x_init_str_wr(bp, addr, data, len); } return; } } static void bnx2x_wr_64(struct bnx2x *bp , u32 reg , u32 val_lo , u32 val_hi ) { u32 wb_write[2U] ; { wb_write[0] = val_lo; wb_write[1] = val_hi; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_write), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, reg, 2U); return; } } static void bnx2x_init_wr_zp(struct bnx2x *bp , u32 addr , u32 len , u32 blob_off ) { u8 const *data ; int rc ; u32 i ; u8 const *tmp ; { data = (u8 const *)0U; tmp = bnx2x_sel_blob(bp, addr, data); data = tmp + (unsigned long )(blob_off * 4U); rc = bnx2x_gunzip(bp, data, (int )len); if (rc != 0) { return; } else { } len = (u32 )bp->gunzip_outlen; i = 0U; goto ldv_61383; ldv_61382: *((u32 *)bp->gunzip_buf + (unsigned long )i) = *((u32 *)bp->gunzip_buf + (unsigned long )i); i = i + 1U; ldv_61383: ; if (i < len) { goto ldv_61382; } else { } bnx2x_write_big_buf_wb(bp, addr, len); return; } } static void bnx2x_init_block(struct bnx2x *bp , u32 block , u32 stage ) { u16 op_start ; u16 op_end ; union init_op const *op ; u32 op_idx ; u32 op_type ; u32 addr ; u32 len ; u32 const *data ; u32 const *data_base ; { op_start = *(bp->init_ops_offsets + (unsigned long )((block * 11U + stage) * 2U)); op_end = *(bp->init_ops_offsets + (unsigned long )((block * 11U + stage) * 2U + 1U)); if ((int )op_start == (int )op_end) { return; } else { } data_base = (u32 const *)bp->init_data; op_idx = (u32 )op_start; goto ldv_61412; ldv_61411: op = (union init_op const *)bp->init_ops + (unsigned long )op_idx; op_type = (u32 )op->raw.op; addr = (u32 )op->raw.offset; len = (u32 )op->arr_wr.data_len; data = data_base + (unsigned long )op->arr_wr.data_off; switch (op_type) { case 1U: readl((void const volatile *)bp->regview + (unsigned long )addr); goto ldv_61400; case 2U: writel(op->write.val, (void volatile *)bp->regview + (unsigned long )addr); goto ldv_61400; case 3U: bnx2x_init_str_wr(bp, addr, data, len); goto ldv_61400; case 7U: bnx2x_init_wr_wb(bp, addr, data, len); goto ldv_61400; case 4U: bnx2x_init_fill(bp, addr, 0, op->zero.len, 0); goto ldv_61400; case 8U: bnx2x_init_fill(bp, addr, 0, op->zero.len, 1); goto ldv_61400; case 5U: bnx2x_init_wr_zp(bp, addr, len, (u32 )op->arr_wr.data_off); goto ldv_61400; case 6U: bnx2x_init_wr_64(bp, addr, data, len); goto ldv_61400; case 10U: ; if ((bp->init_mode_flags & (u32 )op->if_mode.mode_bit_map) != (u32 )op->if_mode.mode_bit_map) { op_idx = (u32 )op->if_mode.cmd_offset + op_idx; } else { } goto ldv_61400; case 9U: ; if ((bp->init_mode_flags & (u32 )op->if_mode.mode_bit_map) == 0U) { op_idx = (u32 )op->if_mode.cmd_offset + op_idx; } else { } goto ldv_61400; default: ; goto ldv_61400; } ldv_61400: op_idx = op_idx + 1U; ldv_61412: ; if ((u32 )op_end > op_idx) { goto ldv_61411; } else { } return; } } static struct arb_line const read_arb_data[29U][4U] = { { {8, 64, 25}, {16, 64, 25}, {32, 64, 25}, {64, 64, 41}}, { {4, 8, 4}, {4, 8, 4}, {4, 8, 4}, {4, 8, 4}}, { {4, 3, 3}, {4, 3, 3}, {4, 3, 3}, {4, 3, 3}}, { {8, 3, 6}, {16, 3, 11}, {16, 3, 11}, {16, 3, 11}}, { {8, 64, 25}, {16, 64, 25}, {32, 64, 25}, {64, 64, 41}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {64, 3, 41}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {64, 3, 41}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {64, 3, 41}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {64, 3, 41}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 64, 6}, {16, 64, 11}, {32, 64, 21}, {32, 64, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 3, 6}, {16, 3, 11}, {32, 3, 21}, {32, 3, 21}}, { {8, 64, 25}, {16, 64, 41}, {32, 64, 81}, {64, 64, 120}}}; static struct arb_line const write_arb_data[13U][3U] = { { {4, 6, 3}, {4, 6, 3}, {4, 6, 3}}, { {4, 2, 3}, {4, 2, 3}, {4, 2, 3}}, { {8, 2, 6}, {16, 2, 11}, {16, 2, 11}}, { {8, 2, 6}, {16, 2, 11}, {32, 2, 21}}, { {8, 2, 6}, {16, 2, 11}, {32, 2, 21}}, { {8, 2, 6}, {16, 2, 11}, {32, 2, 21}}, { {8, 64, 25}, {16, 64, 25}, {32, 64, 25}}, { {8, 2, 6}, {16, 2, 11}, {16, 2, 11}}, { {8, 2, 6}, {16, 2, 11}, {16, 2, 11}}, { {8, 9, 6}, {16, 9, 11}, {32, 9, 21}}, { {8, 47, 19}, {16, 47, 19}, {32, 47, 21}}, { {8, 9, 6}, {16, 9, 11}, {16, 9, 11}}, { {8, 64, 25}, {16, 64, 41}, {32, 64, 81}}}; static struct arb_line const read_arb_addr[28U] = { {1180332, 1180092, 1180212}, {1180336, 1180096, 1180216}, {1180340, 1180100, 1180220}, {1180344, 1180104, 1180224}, {1180348, 1180108, 1180228}, {1180352, 1180112, 1180232}, {1180356, 1180116, 1180236}, {1180360, 1180120, 1180240}, {1180364, 1180124, 1180244}, {1180368, 1180128, 1180248}, {1180372, 1180132, 1180252}, {1180376, 1180136, 1180256}, {1180380, 1180140, 1180260}, {1180384, 1180144, 1180264}, {1180388, 1180148, 1180268}, {1180392, 1180152, 1180272}, {1180396, 1180156, 1180276}, {1180400, 1180160, 1180280}, {1180404, 1180164, 1180284}, {1180408, 1180168, 1180288}, {1180412, 1180172, 1180292}, {1180416, 1180176, 1180296}, {1180420, 1180180, 1180300}, {1180424, 1180184, 1180304}, {1180428, 1180188, 1180308}, {1180432, 1180192, 1180312}, {1180436, 1180196, 1180316}, {1180440, 1180200, 1180320}}; static struct arb_line const write_arb_addr[12U] = { {1180336, 1180096, 1180216}, {1180340, 1180100, 1180220}, {1180344, 1180104, 1180224}, {1180356, 1180116, 1180236}, {1180360, 1180120, 1180240}, {1180364, 1180124, 1180244}, {1180368, 1180128, 1180248}, {1180372, 1180132, 1180252}, {1180376, 1180136, 1180256}, {1180440, 1180200, 1180320}, {1180444, 1180204, 1180324}, {1180448, 1180208, 1180328}}; static void bnx2x_init_pxp_arb(struct bnx2x *bp , int r_order , int w_order ) { u32 val ; u32 i ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { if (r_order > 3) { tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]read order of %d order adjusted to %d\n", "bnx2x_init_pxp_arb", 480, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", r_order, 3); } else { } r_order = 3; } else { } if (w_order > 2) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write order of %d order adjusted to %d\n", "bnx2x_init_pxp_arb", 485, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", w_order, 2); } else { } w_order = 2; } else { } if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write order adjusted to 1 for FPGA\n", "bnx2x_init_pxp_arb", 489, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } w_order = 0; } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]read order %d write order %d\n", "bnx2x_init_pxp_arb", 492, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", r_order, w_order); } else { } i = 0U; goto ldv_61431; ldv_61430: writel((unsigned int )read_arb_data[i][r_order].l, (void volatile *)bp->regview + (unsigned long )read_arb_addr[i].l); writel((unsigned int )read_arb_data[i][r_order].add, (void volatile *)bp->regview + (unsigned long )read_arb_addr[i].add); writel((unsigned int )read_arb_data[i][r_order].ubound, (void volatile *)bp->regview + (unsigned long )read_arb_addr[i].ubound); i = i + 1U; ldv_61431: ; if (i <= 27U) { goto ldv_61430; } else { } i = 0U; goto ldv_61434; ldv_61433: ; if ((int )write_arb_addr[i].l == 1180444 || (int )write_arb_addr[i].l == 1180448) { writel((unsigned int )write_arb_data[i][w_order].l, (void volatile *)bp->regview + (unsigned long )write_arb_addr[i].l); writel((unsigned int )write_arb_data[i][w_order].add, (void volatile *)bp->regview + (unsigned long )write_arb_addr[i].add); writel((unsigned int )write_arb_data[i][w_order].ubound, (void volatile *)bp->regview + (unsigned long )write_arb_addr[i].ubound); } else { val = readl((void const volatile *)bp->regview + (unsigned long )write_arb_addr[i].l); writel((u32 )(write_arb_data[i][w_order].l << 10) | val, (void volatile *)bp->regview + (unsigned long )write_arb_addr[i].l); val = readl((void const volatile *)bp->regview + (unsigned long )write_arb_addr[i].add); writel((u32 )(write_arb_data[i][w_order].add << 10) | val, (void volatile *)bp->regview + (unsigned long )write_arb_addr[i].add); val = readl((void const volatile *)bp->regview + (unsigned long )write_arb_addr[i].ubound); writel((u32 )(write_arb_data[i][w_order].ubound << 7) | val, (void volatile *)bp->regview + (unsigned long )write_arb_addr[i].ubound); } i = i + 1U; ldv_61434: ; if (i <= 11U) { goto ldv_61433; } else { } val = (u32 )write_arb_data[12][w_order].add; val = (u32 )(write_arb_data[12][w_order].ubound << 10) + val; val = (u32 )(write_arb_data[12][w_order].l << 17) + val; writel(val, (void volatile *)bp->regview + 1180452U); val = (u32 )read_arb_data[28][r_order].add; val = (u32 )(read_arb_data[28][r_order].ubound << 10) + val; val = (u32 )(read_arb_data[28][r_order].l << 17) + val; writel(val, (void volatile *)bp->regview + 1180456U); writel((unsigned int )w_order, (void volatile *)bp->regview + 1179996U); writel((unsigned int )w_order, (void volatile *)bp->regview + 1180004U); writel((unsigned int )r_order, (void volatile *)bp->regview + 1180000U); writel((unsigned int )r_order, (void volatile *)bp->regview + 1180008U); if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) && r_order == 3) { writel(3584U, (void volatile *)bp->regview + 1180476U); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { writel((unsigned int )(4 << w_order), (void volatile *)bp->regview + 1180488U); } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { writel((unsigned int )(8 << w_order), (void volatile *)bp->regview + 1180488U); } else { writel((unsigned int )(24 << w_order), (void volatile *)bp->regview + 1180488U); } if (bp->common.chip_id >> 16 != 5710U) { if (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) { val = (u32 )w_order; writel(val, (void volatile *)bp->regview + 1181164U); } else { val = w_order == 0 ? 2U : 3U; writel(2U, (void volatile *)bp->regview + 1181164U); } writel(val, (void volatile *)bp->regview + 1181128U); writel(val, (void volatile *)bp->regview + 1181132U); writel(val, (void volatile *)bp->regview + 1181136U); writel(val, (void volatile *)bp->regview + 1181140U); writel(val, (void volatile *)bp->regview + 1181144U); writel(val, (void volatile *)bp->regview + 1181148U); writel(val, (void volatile *)bp->regview + 1181152U); writel(val, (void volatile *)bp->regview + 1181156U); writel(val, (void volatile *)bp->regview + 1181160U); writel(val, (void volatile *)bp->regview + 1181168U); } else { } val = readl((void const volatile *)bp->regview + 10624U); val = val & 255U; if (val <= 32U) { writel(32U, (void volatile *)bp->regview + 1181096U); } else { } return; } } static int bnx2x_ilt_line_mem_op(struct bnx2x *bp , struct ilt_line *line , u32 size , u8 memop ) { { if ((unsigned int )memop == 1U) { if ((unsigned long )line->page != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, (size_t )line->size, line->page, line->page_mapping, (struct dma_attrs *)0); line->page = (void *)0; line->page_mapping = 0ULL; } else { } return (0); } else { } line->page = dma_zalloc_coherent(& (bp->pdev)->dev, (size_t )size, & line->page_mapping, 208U); if ((unsigned long )line->page == (unsigned long )((void *)0)) { return (-1); } else { } line->size = size; return (0); } } static int bnx2x_ilt_client_mem_op(struct bnx2x *bp , int cli_num , u8 memop ) { int i ; int rc ; struct bnx2x_ilt *ilt ; struct ilt_client_info *ilt_cli ; { ilt = bp->ilt; ilt_cli = (struct ilt_client_info *)(& ilt->clients) + (unsigned long )cli_num; if ((unsigned long )ilt == (unsigned long )((struct bnx2x_ilt *)0) || (unsigned long )ilt->lines == (unsigned long )((struct ilt_line *)0)) { return (-1); } else { } if (((int )ilt_cli->flags & 3) != 0) { return (0); } else { } rc = 0; i = (int )ilt_cli->start; goto ldv_61452; ldv_61451: rc = bnx2x_ilt_line_mem_op(bp, ilt->lines + (unsigned long )i, ilt_cli->page_size, (int )memop); i = i + 1; ldv_61452: ; if ((int )ilt_cli->end >= i && rc == 0) { goto ldv_61451; } else { } return (rc); } } static int bnx2x_ilt_mem_op_cnic(struct bnx2x *bp , u8 memop ) { int rc ; { rc = 0; if ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && ! bp->cnic_enabled) { rc = bnx2x_ilt_client_mem_op(bp, 2, (int )memop); } else { } if (rc == 0) { rc = bnx2x_ilt_client_mem_op(bp, 3, (int )memop); } else { } return (rc); } } static int bnx2x_ilt_mem_op(struct bnx2x *bp , u8 memop ) { int rc ; int tmp ; { tmp = bnx2x_ilt_client_mem_op(bp, 0, (int )memop); rc = tmp; if (rc == 0) { rc = bnx2x_ilt_client_mem_op(bp, 1, (int )memop); } else { } if ((rc == 0 && (unsigned int )bp->cnic_support != 0U) && ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (int )bp->cnic_enabled)) { rc = bnx2x_ilt_client_mem_op(bp, 2, (int )memop); } else { } return (rc); } } static void bnx2x_ilt_line_wr(struct bnx2x *bp , int abs_idx , dma_addr_t page_mapping___0 ) { u32 reg ; { if (bp->common.chip_id >> 16 == 5710U) { reg = (u32 )((abs_idx + 148480) * 8); } else { reg = (u32 )((abs_idx + 151552) * 8); } bnx2x_wr_64(bp, reg, (unsigned int )(page_mapping___0 >> 12), (unsigned int )(page_mapping___0 >> 44) | 1048576U); return; } } static void bnx2x_ilt_line_init_op(struct bnx2x *bp , struct bnx2x_ilt *ilt , int idx , u8 initop ) { dma_addr_t null_mapping ; int abs_idx ; { abs_idx = (int )(ilt->start_line + (u32 )idx); switch ((int )initop) { case 2: ; case 0: bnx2x_ilt_line_wr(bp, abs_idx, (ilt->lines + (unsigned long )idx)->page_mapping); goto ldv_61480; case 1: null_mapping = 0ULL; bnx2x_ilt_line_wr(bp, abs_idx, null_mapping); goto ldv_61480; } ldv_61480: ; return; } } static void bnx2x_ilt_boundry_init_op(struct bnx2x *bp , struct ilt_client_info *ilt_cli , u32 ilt_start , u8 initop ) { u32 start_reg ; u32 end_reg ; { start_reg = 0U; end_reg = 0U; if (bp->common.chip_id >> 16 == 5710U) { switch ((int )ilt_cli->client_num) { case 0: start_reg = 1179648U; goto ldv_61491; case 1: start_reg = 1179704U; goto ldv_61491; case 2: start_reg = 1179732U; goto ldv_61491; case 3: start_reg = 1179676U; goto ldv_61491; } ldv_61491: writel((((u32 )ilt_cli->end + ilt_start) << 10) | ((u32 )ilt_cli->start + ilt_start), (void volatile *)bp->regview + (unsigned long )((u32 )((int )bp->pfid * 4) + start_reg)); } else { switch ((int )ilt_cli->client_num) { case 0: start_reg = 1181212U; end_reg = 1181216U; goto ldv_61496; case 1: start_reg = 1181236U; end_reg = 1181240U; goto ldv_61496; case 2: start_reg = 1181244U; end_reg = 1181248U; goto ldv_61496; case 3: start_reg = 1181252U; end_reg = 1181256U; goto ldv_61496; } ldv_61496: writel((u32 )ilt_cli->start + ilt_start, (void volatile *)bp->regview + (unsigned long )start_reg); writel((u32 )ilt_cli->end + ilt_start, (void volatile *)bp->regview + (unsigned long )end_reg); } return; } } static void bnx2x_ilt_client_init_op_ilt(struct bnx2x *bp , struct bnx2x_ilt *ilt , struct ilt_client_info *ilt_cli , u8 initop ) { int i ; { if ((int )ilt_cli->flags & 1) { return; } else { } i = (int )ilt_cli->start; goto ldv_61508; ldv_61507: bnx2x_ilt_line_init_op(bp, ilt, i, (int )initop); i = i + 1; ldv_61508: ; if ((int )ilt_cli->end >= i) { goto ldv_61507; } else { } bnx2x_ilt_boundry_init_op(bp, ilt_cli, ilt->start_line, (int )initop); return; } } static void bnx2x_ilt_client_init_op(struct bnx2x *bp , struct ilt_client_info *ilt_cli , u8 initop ) { struct bnx2x_ilt *ilt ; { ilt = bp->ilt; bnx2x_ilt_client_init_op_ilt(bp, ilt, ilt_cli, (int )initop); return; } } static void bnx2x_ilt_client_id_init_op(struct bnx2x *bp , int cli_num , u8 initop ) { struct bnx2x_ilt *ilt ; struct ilt_client_info *ilt_cli ; { ilt = bp->ilt; ilt_cli = (struct ilt_client_info *)(& ilt->clients) + (unsigned long )cli_num; bnx2x_ilt_client_init_op(bp, ilt_cli, (int )initop); return; } } static void bnx2x_ilt_init_op_cnic(struct bnx2x *bp , u8 initop ) { { if ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && ! bp->cnic_enabled) { bnx2x_ilt_client_id_init_op(bp, 2, (int )initop); } else { } bnx2x_ilt_client_id_init_op(bp, 3, (int )initop); return; } } static void bnx2x_ilt_init_op(struct bnx2x *bp , u8 initop ) { { bnx2x_ilt_client_id_init_op(bp, 0, (int )initop); bnx2x_ilt_client_id_init_op(bp, 1, (int )initop); if ((unsigned int )bp->cnic_support != 0U && ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (int )bp->cnic_enabled)) { bnx2x_ilt_client_id_init_op(bp, 2, (int )initop); } else { } return; } } static void bnx2x_ilt_init_client_psz(struct bnx2x *bp , int cli_num , u32 psz_reg , u8 initop ) { struct bnx2x_ilt *ilt ; struct ilt_client_info *ilt_cli ; int tmp ; { ilt = bp->ilt; ilt_cli = (struct ilt_client_info *)(& ilt->clients) + (unsigned long )cli_num; if ((int )ilt_cli->flags & 1) { return; } else { } switch ((int )initop) { case 2: ; case 0: tmp = __ilog2_u32(ilt_cli->page_size >> 12); writel((unsigned int )tmp, (void volatile *)bp->regview + (unsigned long )psz_reg); goto ldv_61541; case 1: ; goto ldv_61541; } ldv_61541: ; return; } } static void bnx2x_ilt_init_page_size(struct bnx2x *bp , u8 initop ) { { bnx2x_ilt_init_client_psz(bp, 0, 1179672U, (int )initop); bnx2x_ilt_init_client_psz(bp, 1, 1179728U, (int )initop); bnx2x_ilt_init_client_psz(bp, 2, 1179756U, (int )initop); bnx2x_ilt_init_client_psz(bp, 3, 1179700U, (int )initop); return; } } static void bnx2x_qm_init_cid_count(struct bnx2x *bp , int qm_cid_count , u8 initop ) { int port ; { port = (int )bp->pfid & 1; if (qm_cid_count > 31) { switch ((int )initop) { case 2: ; case 0: writel((unsigned int )qm_cid_count / 16U - 1U, (void volatile *)bp->regview + (unsigned long )((port + 368648) * 4)); goto ldv_61555; case 1: ; goto ldv_61555; } ldv_61555: ; } else { } return; } } static void bnx2x_qm_set_ptr_table(struct bnx2x *bp , int qm_cid_count , u32 base_reg , u32 reg ) { int i ; u32 wb_data[2U] ; { wb_data[0] = 0U; wb_data[1] = 0U; i = 0; goto ldv_61566; ldv_61565: writel(((unsigned int )(i % 16) * (unsigned int )qm_cid_count) * 4U, (void volatile *)bp->regview + (unsigned long )((u32 )(i * 4) + base_reg)); bnx2x_init_wr_wb(bp, (u32 )(i * 8) + reg, (u32 const *)(& wb_data), 2U); i = i + 1; ldv_61566: ; if (i <= 63) { goto ldv_61565; } else { } return; } } static void bnx2x_qm_init_ptr_table(struct bnx2x *bp , int qm_cid_count , u8 initop ) { { if (qm_cid_count <= 31) { return; } else { } switch ((int )initop) { case 2: ; case 0: bnx2x_qm_set_ptr_table(bp, qm_cid_count, 1476864U, 1477120U); if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { bnx2x_qm_set_ptr_table(bp, qm_cid_count, 1499392U, 1499648U); } else { } goto ldv_61575; case 1: ; goto ldv_61575; } ldv_61575: ; return; } } static void bnx2x_src_init_t2(struct bnx2x *bp , struct src_ent *t2 , dma_addr_t t2_mapping , int src_cid_count ) { int i ; int port ; { port = (int )bp->pfid & 1; i = 0; goto ldv_61586; ldv_61585: (t2 + (unsigned long )i)->next = (unsigned long long )((unsigned long )(i + 1) * 64UL) + t2_mapping; i = i + 1; ldv_61586: ; if (src_cid_count + -1 > i) { goto ldv_61585; } else { } writel((unsigned int )src_cid_count, (void volatile *)bp->regview + (unsigned long )((port + 65856) * 4)); bnx2x_wr_64(bp, (u32 )((port + 16465) * 16), (unsigned int )t2_mapping, (unsigned int )(t2_mapping >> 32)); bnx2x_wr_64(bp, (u32 )((port + 16467) * 16), (unsigned int )t2_mapping + (unsigned int )((unsigned long )(src_cid_count + -1)) * 64U, (unsigned int )(((unsigned long long )((unsigned long )(src_cid_count + -1) * 64UL) + t2_mapping) >> 32)); return; } } struct workqueue_struct *bnx2x_iov_wq ; int bnx2x_iov_init_ilt(struct bnx2x *bp , u16 line ) ; int bnx2x_iov_init_one(struct bnx2x *bp , int int_mode_param , int num_vfs_param ) ; void bnx2x_iov_remove_one(struct bnx2x *bp ) ; void bnx2x_iov_free_mem(struct bnx2x *bp ) ; int bnx2x_iov_alloc_mem(struct bnx2x *bp ) ; int bnx2x_iov_chip_cleanup(struct bnx2x *bp ) ; void bnx2x_iov_init_dq(struct bnx2x *bp ) ; void bnx2x_iov_init_dmae(struct bnx2x *bp ) ; void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp , int vf_cid , struct bnx2x_queue_sp_obj **q_obj ) ; int bnx2x_iov_eq_sp_event(struct bnx2x *bp , union event_ring_elem *elem ) ; void bnx2x_vf_mbx_schedule(struct bnx2x *bp , struct vf_pf_event_data *vfpf_event ) ; enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp ) ; int bnx2x_vfpf_acquire(struct bnx2x *bp , u8 tx_count , u8 rx_count ) ; int bnx2x_vfpf_release(struct bnx2x *bp ) ; int bnx2x_vfpf_setup_q(struct bnx2x *bp , struct bnx2x_fastpath *fp , bool is_leading ) ; int bnx2x_vfpf_config_mac(struct bnx2x *bp , u8 *addr , u8 vf_qid , bool set ) ; int bnx2x_vfpf_set_mcast(struct net_device *dev ) ; int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp ) ; __inline static int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp , struct bnx2x_fastpath *fp ) { { return ((int )((unsigned int )((unsigned long )bp->acquire_resp.resc.hw_qid[(int )fp->index] + 384UL) * 32U)); } } void bnx2x_timer_sriov(struct bnx2x *bp ) ; void *bnx2x_vf_doorbells(struct bnx2x *bp ) ; void bnx2x_vf_pci_dealloc(struct bnx2x *bp ) ; int bnx2x_vf_pci_alloc(struct bnx2x *bp ) ; int bnx2x_enable_sriov(struct bnx2x *bp ) ; void bnx2x_disable_sriov(struct bnx2x *bp ) ; void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp ) ; int bnx2x_sriov_configure(struct pci_dev *dev , int num_vfs_param ) ; void bnx2x_iov_task(struct work_struct *work ) ; void bnx2x_schedule_iov_task(struct bnx2x *bp , enum bnx2x_iov_flag flag ) ; int bnx2x_set_vf_link_state(struct net_device *dev , int idx , int link_state ) ; int bnx2x_load_count[2U][3U] ; int bnx2x_num_queues ; u32 bnx2x_send_unload_req(struct bnx2x *bp , int unload_mode ) ; void bnx2x_send_unload_done(struct bnx2x *bp , bool keep_link ) ; void bnx2x__init_func_obj(struct bnx2x *bp ) ; int bnx2x_setup_queue(struct bnx2x *bp , struct bnx2x_fastpath *fp , bool leading ) ; int bnx2x_setup_leading(struct bnx2x *bp ) ; u32 bnx2x_fw_command(struct bnx2x *bp , u32 command , u32 param ) ; int bnx2x_initial_phy_init(struct bnx2x *bp , int load_mode ) ; void bnx2x_link_set(struct bnx2x *bp ) ; void bnx2x_force_link_reset(struct bnx2x *bp ) ; u8 bnx2x_link_test(struct bnx2x *bp , u8 is_serdes ) ; void bnx2x_drv_pulse(struct bnx2x *bp ) ; void bnx2x_igu_ack_sb(struct bnx2x *bp , u8 igu_sb_id , u8 segment , u16 index , u8 op , u8 update ) ; void bnx2x_pf_disable(struct bnx2x *bp ) ; void bnx2x__link_status_update(struct bnx2x *bp ) ; void bnx2x_link_report(struct bnx2x *bp ) ; void __bnx2x_link_report(struct bnx2x *bp ) ; irqreturn_t bnx2x_msix_sp_int(int irq , void *dev_instance ) ; irqreturn_t bnx2x_interrupt(int irq , void *dev_instance ) ; int bnx2x_cnic_notify(struct bnx2x *bp , int cmd ) ; void bnx2x_setup_cnic_irq_info(struct bnx2x *bp ) ; void bnx2x_setup_cnic_info(struct bnx2x *bp ) ; void bnx2x_int_enable(struct bnx2x *bp ) ; void bnx2x_int_disable_sync(struct bnx2x *bp , int disable_hw ) ; void bnx2x_nic_init_cnic(struct bnx2x *bp ) ; void bnx2x_pre_irq_nic_init(struct bnx2x *bp ) ; void bnx2x_post_irq_nic_init(struct bnx2x *bp , u32 load_code ) ; int bnx2x_alloc_mem_cnic(struct bnx2x *bp ) ; int bnx2x_alloc_mem(struct bnx2x *bp ) ; void bnx2x_free_mem_cnic(struct bnx2x *bp ) ; void bnx2x_free_mem(struct bnx2x *bp ) ; void bnx2x_set_num_queues(struct bnx2x *bp ) ; void bnx2x_chip_cleanup(struct bnx2x *bp , int unload_mode , bool keep_link ) ; int bnx2x_acquire_hw_lock(struct bnx2x *bp , u32 resource ) ; int bnx2x_release_hw_lock(struct bnx2x *bp , u32 resource ) ; int bnx2x_release_leader_lock(struct bnx2x *bp ) ; int bnx2x_set_eth_mac(struct bnx2x *bp , bool set ) ; void bnx2x_set_rx_mode_inner(struct bnx2x *bp ) ; void bnx2x_set_pf_load(struct bnx2x *bp ) ; bool bnx2x_clear_pf_load(struct bnx2x *bp ) ; bool bnx2x_chk_parity_attn(struct bnx2x *bp , bool *global , bool print ) ; bool bnx2x_reset_is_done(struct bnx2x *bp , int engine ) ; void bnx2x_set_reset_in_progress(struct bnx2x *bp ) ; void bnx2x_set_reset_global(struct bnx2x *bp ) ; void bnx2x_disable_close_the_gate(struct bnx2x *bp ) ; int bnx2x_init_hw_func_cnic(struct bnx2x *bp ) ; void bnx2x_sp_event(struct bnx2x_fastpath *fp , union eth_rx_cqe *rr_cqe ) ; void bnx2x_ilt_set_info(struct bnx2x *bp ) ; int bnx2x_set_power_state(struct bnx2x *bp , pci_power_t state ) ; void bnx2x_fw_dump_lvl(struct bnx2x *bp , char const *lvl ) ; int bnx2x_nic_unload(struct bnx2x *bp , int unload_mode , bool keep_link ) ; int bnx2x_nic_load(struct bnx2x *bp , int load_mode ) ; netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb , struct net_device *dev ) ; int bnx2x_setup_tc(struct net_device *dev , u8 num_tc ) ; int bnx2x_get_vf_config(struct net_device *dev , int vfidx , struct ifla_vf_info *ivi ) ; int bnx2x_set_vf_mac(struct net_device *dev , int vfidx , u8 *mac ) ; int bnx2x_set_vf_vlan(struct net_device *dev , int vfidx , u16 vlan , u8 qos ) ; u16 bnx2x_select_queue(struct net_device *dev , struct sk_buff *skb , void *accel_priv , u16 (*fallback)(struct net_device * , struct sk_buff * ) ) ; int bnx2x_change_mac_addr(struct net_device *dev , void *p ) ; int bnx2x_suspend(struct pci_dev *pdev , pm_message_t state ) ; int bnx2x_resume(struct pci_dev *pdev ) ; void bnx2x_free_irq(struct bnx2x *bp ) ; void bnx2x_free_fp_mem(struct bnx2x *bp ) ; void bnx2x_init_rx_rings(struct bnx2x *bp ) ; void bnx2x_init_rx_rings_cnic(struct bnx2x *bp ) ; void bnx2x_free_skbs(struct bnx2x *bp ) ; void bnx2x_netif_stop(struct bnx2x *bp , int disable_hw ) ; int bnx2x_load_cnic(struct bnx2x *bp ) ; int bnx2x_enable_msix(struct bnx2x *bp ) ; int bnx2x_enable_msi(struct bnx2x *bp ) ; int bnx2x_low_latency_recv(struct napi_struct *napi ) ; int bnx2x_alloc_mem_bp(struct bnx2x *bp ) ; void bnx2x_free_mem_bp(struct bnx2x *bp ) ; int bnx2x_change_mtu(struct net_device *dev , int new_mtu ) ; int bnx2x_fcoe_get_wwn(struct net_device *dev , u64 *wwn , int type ) ; netdev_features_t bnx2x_fix_features(struct net_device *dev , netdev_features_t features ) ; int bnx2x_set_features(struct net_device *dev , netdev_features_t features ) ; void bnx2x_tx_timeout(struct net_device *dev ) ; __inline static void bnx2x_update_fpsb_idx(struct bnx2x_fastpath *fp ) { { __asm__ volatile ("": : : "memory"); fp->fp_hc_idx = *(fp->sb_running_index); return; } } __inline static void bnx2x_igu_ack_sb_gen(struct bnx2x *bp , u8 igu_sb_id , u8 segment , u16 index , u8 op , u8 update , u32 igu_addr ) { struct igu_regular cmd_data ; long tmp ; { cmd_data.sb_id_and_flags = 0U; cmd_data.reserved_2 = 0U; cmd_data.sb_id_and_flags = (u32 )((((int )index | ((int )segment << 21)) | ((int )update << 24)) | ((int )op << 25)); tmp = ldv__builtin_expect((bp->msg_enable & 512) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]write 0x%08x to IGU addr 0x%x\n", "bnx2x_igu_ack_sb_gen", 644, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cmd_data.sb_id_and_flags, igu_addr); } else { } writel(cmd_data.sb_id_and_flags, (void volatile *)bp->regview + (unsigned long )igu_addr); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); return; } } __inline static void bnx2x_hc_ack_sb(struct bnx2x *bp , u8 sb_id , u8 storm , u16 index , u8 op , u8 update ) { u32 hc_addr ; struct igu_ack_register igu_ack ; { hc_addr = (u32 )((((int )bp->pfid & 1) + 33804) * 32); igu_ack.status_block_index = index; igu_ack.sb_id_and_flags = (u16 )((((int )((short )sb_id) | (int )((short )((int )storm << 5))) | (int )((short )((int )update << 8))) | (int )((short )((int )op << 9))); writel(*((u32 *)(& igu_ack)), (void volatile *)bp->regview + (unsigned long )hc_addr); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); return; } } __inline static void bnx2x_ack_sb(struct bnx2x *bp , u8 igu_sb_id , u8 storm , u16 index , u8 op , u8 update ) { u8 segment ; { if ((unsigned int )bp->common.int_block == 0U) { bnx2x_hc_ack_sb(bp, (int )igu_sb_id, (int )storm, (int )index, (int )op, (int )update); } else { if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0) { segment = storm; } else if ((int )bp->igu_dsb_id != (int )igu_sb_id) { segment = 1U; } else if ((unsigned int )storm == 4U) { segment = 2U; } else { segment = 1U; } bnx2x_igu_ack_sb(bp, (int )igu_sb_id, (int )segment, (int )index, (int )op, (int )update); } return; } } __inline static u16 bnx2x_hc_ack_int(struct bnx2x *bp ) { u32 hc_addr ; u32 result ; unsigned int tmp ; { hc_addr = (u32 )((((int )bp->pfid & 1) + 33804) * 32 + 24); tmp = readl((void const volatile *)bp->regview + (unsigned long )hc_addr); result = tmp; __asm__ volatile ("": : : "memory"); return ((u16 )result); } } __inline static u16 bnx2x_igu_ack_int(struct bnx2x *bp ) { u32 igu_addr ; u32 result ; unsigned int tmp ; long tmp___0 ; { igu_addr = 4468000U; tmp = readl((void const volatile *)bp->regview + (unsigned long )igu_addr); result = tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 512) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]read 0x%08x from IGU addr 0x%x\n", "bnx2x_igu_ack_int", 709, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", result, igu_addr); } else { } __asm__ volatile ("": : : "memory"); return ((u16 )result); } } __inline static u16 bnx2x_ack_int(struct bnx2x *bp ) { u16 tmp ; u16 tmp___0 ; { __asm__ volatile ("": : : "memory"); if ((unsigned int )bp->common.int_block == 0U) { tmp = bnx2x_hc_ack_int(bp); return (tmp); } else { tmp___0 = bnx2x_igu_ack_int(bp); return (tmp___0); } } } __inline static int bnx2x_has_tx_work_unload(struct bnx2x_fp_txdata *txdata ) { { __asm__ volatile ("": : : "memory"); return ((int )txdata->tx_pkt_prod != (int )txdata->tx_pkt_cons); } } __inline static int bnx2x_tx_queue_has_work(struct bnx2x_fp_txdata *txdata ) { u16 hw_cons ; { __asm__ volatile ("": : : "memory"); hw_cons = *(txdata->tx_cons_sb); return ((int )txdata->tx_pkt_cons != (int )hw_cons); } } __inline static bool bnx2x_has_tx_work(struct bnx2x_fastpath *fp ) { u8 cos ; int tmp ; { cos = 0U; goto ldv_62267; ldv_62266: tmp = bnx2x_tx_queue_has_work(fp->txdata_ptr[(int )cos]); if (tmp != 0) { return (1); } else { } cos = (u8 )((int )cos + 1); ldv_62267: ; if ((int )fp->max_cos > (int )cos) { goto ldv_62266; } else { } return (0); } } __inline static int bnx2x_has_rx_work(struct bnx2x_fastpath *fp ) { u16 cons ; union eth_rx_cqe *cqe ; struct eth_fast_path_rx_cqe *cqe_fp ; { cons = (unsigned int )fp->rx_comp_cons & 4095U; cqe = fp->rx_comp_ring + (unsigned long )cons; cqe_fp = & cqe->fast_path_cqe; return (cqe_fp->marker == 0U); } } __inline static void bnx2x_tx_disable(struct bnx2x *bp ) { { netif_tx_disable(bp->dev); netif_carrier_off(bp->dev); return; } } __inline static void bnx2x_free_rx_sge(struct bnx2x *bp , struct bnx2x_fastpath *fp , u16 index ) { struct sw_rx_page *sw_buf ; struct page *page ; struct eth_rx_sge *sge ; { sw_buf = fp->rx_page_ring + (unsigned long )index; page = sw_buf->page; sge = fp->rx_sge_ring + (unsigned long )index; if ((unsigned long )page == (unsigned long )((struct page *)0)) { return; } else { } dma_unmap_page(& (bp->pdev)->dev, sw_buf->mapping, 4096UL, 2); put_page(page); sw_buf->page = (struct page *)0; sge->addr_hi = 0U; sge->addr_lo = 0U; return; } } __inline static void bnx2x_del_all_napi_cnic(struct bnx2x *bp ) { int i ; { i = (int )bp->num_ethernet_queues; goto ldv_62292; ldv_62291: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { napi_hash_del(& (bp->fp + (unsigned long )i)->napi); netif_napi_del(& (bp->fp + (unsigned long )i)->napi); } i = i + 1; ldv_62292: ; if (bp->num_queues > i) { goto ldv_62291; } else { } return; } } __inline static void bnx2x_del_all_napi(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_62299; ldv_62298: napi_hash_del(& (bp->fp + (unsigned long )i)->napi); netif_napi_del(& (bp->fp + (unsigned long )i)->napi); i = i + 1; ldv_62299: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62298; } else { } return; } } int bnx2x_set_int_mode(struct bnx2x *bp ) ; __inline static void bnx2x_disable_msi(struct bnx2x *bp ) { { if ((bp->flags & 32U) != 0U) { pci_disable_msix(bp->pdev); bp->flags = bp->flags & 4293918687U; } else if ((bp->flags & 64U) != 0U) { pci_disable_msi(bp->pdev); bp->flags = bp->flags & 4294967231U; } else { } return; } } __inline static int func_by_vn(struct bnx2x *bp , int vn ) { { return (vn * 2 + ((int )bp->pfid & 1)); } } __inline static void bnx2x_free_rx_mem_pool(struct bnx2x *bp , struct bnx2x_alloc_pool *pool ) { { if ((unsigned long )pool->page == (unsigned long )((struct page *)0)) { return; } else { } put_page(pool->page); pool->page = (struct page *)0; return; } } __inline static void bnx2x_free_rx_sge_range(struct bnx2x *bp , struct bnx2x_fastpath *fp , int last ) { int i ; { if ((unsigned int )fp->mode == 0U) { return; } else { } i = 0; goto ldv_62360; ldv_62359: bnx2x_free_rx_sge(bp, fp, (int )((u16 )i)); i = i + 1; ldv_62360: ; if (i < last) { goto ldv_62359; } else { } bnx2x_free_rx_mem_pool(bp, & fp->page_pool); return; } } __inline static u8 bnx2x_stats_id(struct bnx2x_fastpath *fp ) { struct bnx2x *bp ; { bp = fp->bp; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { return ((int )bp->cnic_base_cl_id + (int )((u8 )((int )bp->pf_num >> 1))); } else { } return (fp->cl_id); } else { } return ((unsigned int )fp->cl_id + ((unsigned int )bp->pfid & 1U) * 16U); } } __inline static void bnx2x_init_vlan_mac_fp_objs(struct bnx2x_fastpath *fp , bnx2x_obj_type obj_type ) { struct bnx2x *bp ; { bp = fp->bp; bnx2x_init_mac_obj(bp, & (bp->sp_objs + (unsigned long )fp->index)->mac_obj, (int )fp->cl_id, fp->cid, (int )bp->pfid, (void *)(& (bp->slowpath)->mac_rdata), bp->slowpath_mapping, 0, & bp->sp_state, obj_type, & bp->macs_pool); return; } } __inline static u8 bnx2x_fp_qzone_id(struct bnx2x_fastpath *fp ) { { if ((fp->bp)->common.chip_id >> 16 == 5710U || ((fp->bp)->common.chip_id >> 16 == 5711U || (fp->bp)->common.chip_id >> 16 == 5712U)) { return ((unsigned int )fp->cl_id + ((unsigned int )(fp->bp)->pfid & 1U) * 28U); } else { return (fp->cl_id); } } } __inline static void bnx2x_init_txdata(struct bnx2x *bp , struct bnx2x_fp_txdata *txdata , u32 cid , int txq_index , __le16 *tx_cons_sb , struct bnx2x_fastpath *fp ) { long tmp ; { txdata->cid = cid; txdata->txq_index = txq_index; txdata->tx_cons_sb = tx_cons_sb; txdata->parent_fp = fp; txdata->tx_ring_size = (uint )fp->index != (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues ? bp->tx_ring_size : 4078; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]created tx data cid %d, txq %d\n", "bnx2x_init_txdata", 1131, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", txdata->cid, txdata->txq_index); } else { } return; } } __inline static u8 bnx2x_cnic_eth_cl_id(struct bnx2x *bp , u8 cl_idx ) { { return ((unsigned int )((int )bp->cnic_base_cl_id + (int )cl_idx) + (unsigned int )((u8 )((int )bp->pf_num >> 1)) * 2U); } } __inline static u8 bnx2x_cnic_fw_sb_id(struct bnx2x *bp ) { { return ((u8 )bp->base_fw_ndsb); } } __inline static u8 bnx2x_cnic_igu_sb_id(struct bnx2x *bp ) { { return (bp->igu_base_sb); } } __inline static int bnx2x_clean_tx_queue(struct bnx2x *bp , struct bnx2x_fp_txdata *txdata ) { int cnt ; int tmp ; { cnt = 1000; goto ldv_62423; ldv_62422: ; if (cnt == 0) { printk("\vbnx2x: [%s:%d(%s)]timeout waiting for queue[%d]: txdata->tx_pkt_prod(%d) != txdata->tx_pkt_cons(%d)\n", "bnx2x_clean_tx_queue", 1160, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", txdata->txq_index, (int )txdata->tx_pkt_prod, (int )txdata->tx_pkt_cons); goto ldv_62421; } else { } cnt = cnt - 1; usleep_range(1000UL, 2000UL); ldv_62423: tmp = bnx2x_has_tx_work_unload(txdata); if (tmp != 0) { goto ldv_62422; } else { } ldv_62421: ; return (0); } } int bnx2x_get_link_cfg_idx(struct bnx2x *bp ) ; __inline static void __storm_memset_struct(struct bnx2x *bp , u32 addr , size_t size , u32 *data ) { int i ; { i = 0; goto ldv_62434; ldv_62433: writel(*(data + (unsigned long )i), (void volatile *)bp->regview + (unsigned long )((u32 )(i * 4) + addr)); i = i + 1; ldv_62434: ; if ((size_t )i < size / 4UL) { goto ldv_62433; } else { } return; } } __inline static bool bnx2x_wait_sp_comp(struct bnx2x *bp , unsigned long mask ) { int tout ; int tmp ; { tout = 5000; goto ldv_62442; ldv_62441: __asm__ volatile ("mfence": : : "memory"); netif_addr_lock_bh(bp->dev); if ((bp->sp_state & mask) == 0UL) { netif_addr_unlock_bh(bp->dev); return (1); } else { } netif_addr_unlock_bh(bp->dev); usleep_range(1000UL, 2000UL); ldv_62442: tmp = tout; tout = tout - 1; if (tmp != 0) { goto ldv_62441; } else { } __asm__ volatile ("mfence": : : "memory"); netif_addr_lock_bh(bp->dev); if ((bp->sp_state & mask) != 0UL) { printk("\vbnx2x: [%s:%d(%s)]Filtering completion timed out. sp_state 0x%lx, mask 0x%lx\n", "bnx2x_wait_sp_comp", 1212, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->sp_state, mask); netif_addr_unlock_bh(bp->dev); return (0); } else { } netif_addr_unlock_bh(bp->dev); return (1); } } void bnx2x_set_ctx_validation(struct bnx2x *bp , struct eth_context *cxt , u32 cid ) ; void bnx2x_update_coalesce_sb_index(struct bnx2x *bp , u8 fw_sb_id , u8 sb_index , u8 disable , u16 usec ) ; void bnx2x_acquire_phy_lock(struct bnx2x *bp ) ; void bnx2x_release_phy_lock(struct bnx2x *bp ) ; __inline static u16 bnx2x_extract_max_cfg(struct bnx2x *bp , u32 mf_cfg ) { u16 max_cfg ; long tmp ; { max_cfg = (u16 )(mf_cfg >> 24); if ((unsigned int )max_cfg == 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 67108896) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Max BW configured to 0 - using 100 instead\n", "bnx2x_extract_max_cfg", 1249, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } max_cfg = 100U; } else { } return (max_cfg); } } void bnx2x_get_iscsi_info(struct bnx2x *bp ) ; __inline static void bnx2x_link_sync_notify(struct bnx2x *bp ) { int func ; int vn ; { vn = 0; goto ldv_62478; ldv_62477: ; if ((int )bp->pfid >> 1 == vn) { goto ldv_62476; } else { } func = func_by_vn(bp, vn); writel(1U, (void volatile *)bp->regview + (unsigned long )((func + 10252) * 4)); ldv_62476: vn = vn + 1; ldv_62478: ; if (((unsigned int )bp->common.chip_port_mode == 0U ? 2 : 4) > vn) { goto ldv_62477; } else { } return; } } int bnx2x_drain_tx_queues(struct bnx2x *bp ) ; void bnx2x_squeeze_objects(struct bnx2x *bp ) ; void bnx2x_schedule_sp_rtnl(struct bnx2x *bp , enum sp_rtnl_flag flag , u32 verbose ) ; extern int request_firmware(struct firmware const ** , char const * , struct device * ) ; extern void release_firmware(struct firmware const * ) ; static char version[95U] = { 'B', 'r', 'o', 'a', 'd', 'c', 'o', 'm', ' ', 'N', 'e', 't', 'X', 't', 'r', 'e', 'm', 'e', ' ', 'I', 'I', ' ', '5', '7', '7', '1', 'x', '/', '5', '7', '8', 'x', 'x', ' ', '1', '0', '/', '2', '0', '-', 'G', 'i', 'g', 'a', 'b', 'i', 't', ' ', 'E', 't', 'h', 'e', 'r', 'n', 'e', 't', ' ', 'D', 'r', 'i', 'v', 'e', 'r', ' ', 'b', 'n', 'x', '2', 'x', ' ', '1', '.', '7', '1', '0', '.', '5', '1', '-', '0', ' ', '(', '2', '0', '1', '4', '/', '0', '2', '/', '1', '0', ')', '\n', '\000'}; static int disable_tpa ; static int int_mode ; static int dropless_fc ; static int mrrs = -1; static int debug ; static struct workqueue_struct *bnx2x_wq ; static struct __anonstruct_board_info_434 board_info[21U] = { {(char *)"Broadcom NetXtreme II BCM57710 10 Gigabit PCIe [Everest]"}, {(char *)"Broadcom NetXtreme II BCM57711 10 Gigabit PCIe"}, {(char *)"Broadcom NetXtreme II BCM57711E 10 Gigabit PCIe"}, {(char *)"Broadcom NetXtreme II BCM57712 10 Gigabit Ethernet"}, {(char *)"Broadcom NetXtreme II BCM57712 10 Gigabit Ethernet Multi Function"}, {(char *)"Broadcom NetXtreme II BCM57712 10 Gigabit Ethernet Virtual Function"}, {(char *)"Broadcom NetXtreme II BCM57800 10 Gigabit Ethernet"}, {(char *)"Broadcom NetXtreme II BCM57800 10 Gigabit Ethernet Multi Function"}, {(char *)"Broadcom NetXtreme II BCM57800 10 Gigabit Ethernet Virtual Function"}, {(char *)"Broadcom NetXtreme II BCM57810 10 Gigabit Ethernet"}, {(char *)"Broadcom NetXtreme II BCM57810 10 Gigabit Ethernet Multi Function"}, {(char *)"Broadcom NetXtreme II BCM57810 10 Gigabit Ethernet Virtual Function"}, {(char *)"Broadcom NetXtreme II BCM57840 10 Gigabit Ethernet"}, {(char *)"Broadcom NetXtreme II BCM57840 20 Gigabit Ethernet"}, {(char *)"Broadcom NetXtreme II BCM57840 10/20 Gigabit Ethernet Multi Function"}, {(char *)"Broadcom NetXtreme II BCM57840 10/20 Gigabit Ethernet Virtual Function"}, {(char *)"Broadcom NetXtreme II BCM57811 10 Gigabit Ethernet"}, {(char *)"Broadcom NetXtreme II BCM57811 10 Gigabit Ethernet Multi Function"}, {(char *)"Broadcom NetXtreme II BCM57840 10/20 Gigabit Ethernet"}, {(char *)"Broadcom NetXtreme II BCM57840 10/20 Gigabit Ethernet Multi Function"}, {(char *)"Broadcom NetXtreme II BCM57840 10/20 Gigabit Ethernet Virtual Function"}}; static struct pci_device_id const bnx2x_pci_tbl[22U] = { {5348U, 5710U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5348U, 5711U, 4294967295U, 4294967295U, 0U, 0U, 1UL}, {5348U, 5712U, 4294967295U, 4294967295U, 0U, 0U, 2UL}, {5348U, 5730U, 4294967295U, 4294967295U, 0U, 0U, 3UL}, {5348U, 5731U, 4294967295U, 4294967295U, 0U, 0U, 4UL}, {5348U, 5743U, 4294967295U, 4294967295U, 0U, 0U, 5UL}, {5348U, 5770U, 4294967295U, 4294967295U, 0U, 0U, 6UL}, {5348U, 5797U, 4294967295U, 4294967295U, 0U, 0U, 7UL}, {5348U, 5801U, 4294967295U, 4294967295U, 0U, 0U, 8UL}, {5348U, 5774U, 4294967295U, 4294967295U, 0U, 0U, 9UL}, {5348U, 5806U, 4294967295U, 4294967295U, 0U, 0U, 10UL}, {5348U, 5773U, 4294967295U, 4294967295U, 0U, 0U, 18UL}, {5348U, 5793U, 4294967295U, 4294967295U, 0U, 0U, 12UL}, {5348U, 5794U, 4294967295U, 4294967295U, 0U, 0U, 13UL}, {5348U, 5807U, 4294967295U, 4294967295U, 0U, 0U, 11UL}, {5348U, 5803U, 4294967295U, 4294967295U, 0U, 0U, 19UL}, {5348U, 5796U, 4294967295U, 4294967295U, 0U, 0U, 14UL}, {5348U, 5805U, 4294967295U, 4294967295U, 0U, 0U, 15UL}, {5348U, 5693U, 4294967295U, 4294967295U, 0U, 0U, 16UL}, {5348U, 5694U, 4294967295U, 4294967295U, 0U, 0U, 17UL}, {5348U, 5695U, 4294967295U, 4294967295U, 0U, 0U, 20UL}, {0U, 0U, 0U, 0U, 0U, 0U, 0UL}}; struct pci_device_id const __mod_pci__bnx2x_pci_tbl_device_table[22U] ; static struct semaphore bnx2x_prev_sem = {{{{0}}, 3735899821U, 4294967295U, (void *)-1, {0, {0, 0}, "(bnx2x_prev_sem).lock", 0, 0UL}}, 1U, {& bnx2x_prev_sem.wait_list, & bnx2x_prev_sem.wait_list}}; static struct list_head bnx2x_prev_list = {& bnx2x_prev_list, & bnx2x_prev_list}; static struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *dev ) ; static u32 bnx2x_rx_ustorm_prods_offset(struct bnx2x_fastpath *fp ) ; static int bnx2x_set_storm_rx_mode(struct bnx2x *bp ) ; static int bnx2x_hwtstamp_ioctl(struct bnx2x *bp , struct ifreq *ifr ) ; static void __storm_memset_dma_mapping(struct bnx2x *bp , u32 addr , dma_addr_t mapping ) { { writel((unsigned int )mapping, (void volatile *)bp->regview + (unsigned long )addr); writel((unsigned int )(mapping >> 32), (void volatile *)bp->regview + (unsigned long )(addr + 4U)); return; } } static void storm_memset_spq_addr(struct bnx2x *bp , dma_addr_t mapping , u16 abs_fid ) { u32 addr ; { addr = ((unsigned int )(bp->iro_arr + 30UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 30UL)->m1)) + 2752512U; __storm_memset_dma_mapping(bp, addr, mapping); return; } } static void storm_memset_vf_to_pf(struct bnx2x *bp , u16 abs_fid , u16 pf_id ) { { writeb((int )((unsigned char )pf_id), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 48UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 48UL)->m1)) + 4325376U)); writeb((int )((unsigned char )pf_id), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 154UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 154UL)->m1)) + 4259840U)); writeb((int )((unsigned char )pf_id), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 108UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 108UL)->m1)) + 4390912U)); writeb((int )((unsigned char )pf_id), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 183UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 183UL)->m1)) + 4194304U)); return; } } static void storm_memset_func_en(struct bnx2x *bp , u16 abs_fid , u8 enable ) { { writeb((int )enable, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 47UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 47UL)->m1)) + 4325376U)); writeb((int )enable, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 153UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 153UL)->m1)) + 4259840U)); writeb((int )enable, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 107UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 107UL)->m1)) + 4390912U)); writeb((int )enable, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 182UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 182UL)->m1)) + 4194304U)); return; } } static void storm_memset_eq_data(struct bnx2x *bp , struct event_ring_data *eq_data , u16 pfid ) { size_t size ; u32 addr ; { size = 16UL; addr = ((unsigned int )(bp->iro_arr + 157UL)->base + ((unsigned int )(((int )pfid & 1) * (int )(bp->iro_arr + 157UL)->m2) + (unsigned int )(((int )pfid >> 1) * (int )(bp->iro_arr + 157UL)->m1))) + 4259840U; __storm_memset_struct(bp, addr, size, (u32 *)eq_data); return; } } static void storm_memset_eq_prod(struct bnx2x *bp , u16 eq_prod , u16 pfid ) { u32 addr ; { addr = ((unsigned int )(bp->iro_arr + 158UL)->base + ((unsigned int )(((int )pfid & 1) * (int )(bp->iro_arr + 158UL)->m2) + (unsigned int )(((int )pfid >> 1) * (int )(bp->iro_arr + 158UL)->m1))) + 4259840U; writew((int )eq_prod, (void volatile *)bp->regview + (unsigned long )addr); return; } } static void bnx2x_reg_wr_ind(struct bnx2x *bp , u32 addr , u32 val ) { { pci_write_config_dword((struct pci_dev const *)bp->pdev, 120, addr); pci_write_config_dword((struct pci_dev const *)bp->pdev, 128, val); pci_write_config_dword((struct pci_dev const *)bp->pdev, 120, 0U); return; } } static u32 bnx2x_reg_rd_ind(struct bnx2x *bp , u32 addr ) { u32 val ; { pci_write_config_dword((struct pci_dev const *)bp->pdev, 120, addr); pci_read_config_dword((struct pci_dev const *)bp->pdev, 128, & val); pci_write_config_dword((struct pci_dev const *)bp->pdev, 120, 0U); return (val); } } static void bnx2x_dp_dmae(struct bnx2x *bp , struct dmae_command *dmae , int msglvl ) { u32 src_type ; int i ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; { src_type = dmae->opcode & 1U; switch (dmae->opcode & 6U) { case 2U: ; if (src_type == 0U) { tmp = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]DMAE: opcode 0x%08x\nsrc [%x:%08x], len [%d*4], dst [%x:%08x]\ncomp_addr [%x:%08x], comp_val 0x%08x\n", "bnx2x_dp_dmae", 400, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo, (int )dmae->len, dmae->dst_addr_hi, dmae->dst_addr_lo, dmae->comp_addr_hi, dmae->comp_addr_lo, dmae->comp_val); } else { } } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DMAE: opcode 0x%08x\nsrc [%08x], len [%d*4], dst [%x:%08x]\ncomp_addr [%x:%08x], comp_val 0x%08x\n", "bnx2x_dp_dmae", 408, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dmae->opcode, dmae->src_addr_lo >> 2, (int )dmae->len, dmae->dst_addr_hi, dmae->dst_addr_lo, dmae->comp_addr_hi, dmae->comp_addr_lo, dmae->comp_val); } else { } } goto ldv_62775; case 4U: ; if (src_type == 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DMAE: opcode 0x%08x\nsrc [%x:%08x], len [%d*4], dst_addr [%08x]\ncomp_addr [%x:%08x], comp_val 0x%08x\n", "bnx2x_dp_dmae", 418, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo, (int )dmae->len, dmae->dst_addr_lo >> 2, dmae->comp_addr_hi, dmae->comp_addr_lo, dmae->comp_val); } else { } } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DMAE: opcode 0x%08x\nsrc [%08x], len [%d*4], dst [%08x]\ncomp_addr [%x:%08x], comp_val 0x%08x\n", "bnx2x_dp_dmae", 426, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dmae->opcode, dmae->src_addr_lo >> 2, (int )dmae->len, dmae->dst_addr_lo >> 2, dmae->comp_addr_hi, dmae->comp_addr_lo, dmae->comp_val); } else { } } goto ldv_62775; default: ; if (src_type == 0U) { tmp___3 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DMAE: opcode 0x%08x\nsrc_addr [%x:%08x] len [%d * 4] dst_addr [none]\ncomp_addr [%x:%08x] comp_val 0x%08x\n", "bnx2x_dp_dmae", 435, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo, (int )dmae->len, dmae->comp_addr_hi, dmae->comp_addr_lo, dmae->comp_val); } else { } } else { tmp___4 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DMAE: opcode 0x%08x\nsrc_addr [%08x] len [%d * 4] dst_addr [none]\ncomp_addr [%x:%08x] comp_val 0x%08x\n", "bnx2x_dp_dmae", 442, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dmae->opcode, dmae->src_addr_lo >> 2, (int )dmae->len, dmae->comp_addr_hi, dmae->comp_addr_lo, dmae->comp_val); } else { } } goto ldv_62775; } ldv_62775: i = 0; goto ldv_62779; ldv_62778: tmp___5 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DMAE RAW [%02d]: 0x%08x\n", "bnx2x_dp_dmae", 448, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, *((u32 *)dmae + (unsigned long )i)); } else { } i = i + 1; ldv_62779: ; if ((unsigned int )i <= 13U) { goto ldv_62778; } else { } return; } } void bnx2x_post_dmae(struct bnx2x *bp , struct dmae_command *dmae , int idx ) { u32 cmd_offset ; int i ; { cmd_offset = (u32 )((unsigned long )idx) * 56U + 1057792U; i = 0; goto ldv_62789; ldv_62788: writel(*((u32 *)dmae + (unsigned long )i), (void volatile *)bp->regview + (unsigned long )((u32 )(i * 4) + cmd_offset)); i = i + 1; ldv_62789: ; if ((unsigned int )i <= 13U) { goto ldv_62788; } else { } writel(1U, (void volatile *)bp->regview + (unsigned long )dmae_reg_go_c[idx]); return; } } u32 bnx2x_dmae_opcode_add_comp(u32 opcode , u8 comp_type ) { { return (((u32 )((int )comp_type << 3) | opcode) | 16U); } } u32 bnx2x_dmae_opcode_clr_src_reset(u32 opcode ) { { return (opcode & 4294959103U); } } u32 bnx2x_dmae_opcode(struct bnx2x *bp , u8 src_type , u8 dst_type , bool with_comp , u8 comp_type ) { u32 opcode ; { opcode = 0U; opcode = (u32 )((int )src_type | ((int )dst_type << 1)) | opcode; opcode = opcode | 24576U; opcode = ((int )bp->pfid & 1 ? 2048U : 0U) | opcode; opcode = (u32 )((((int )bp->pfid >> 1) << 15) | (((int )bp->pfid >> 1) << 17)) | opcode; opcode = opcode | 1048576U; opcode = opcode | 1024U; if ((int )with_comp) { opcode = bnx2x_dmae_opcode_add_comp(opcode, (int )comp_type); } else { } return (opcode); } } void bnx2x_prep_dmae_with_comp(struct bnx2x *bp , struct dmae_command *dmae , u8 src_type , u8 dst_type ) { { memset((void *)dmae, 0, 56UL); dmae->opcode = bnx2x_dmae_opcode(bp, (int )src_type, (int )dst_type, 1, 0); dmae->comp_addr_lo = (unsigned int )bp->slowpath_mapping + 4412U; dmae->comp_addr_hi = (unsigned int )((bp->slowpath_mapping + 4412ULL) >> 32); dmae->comp_val = 1624297646U; return; } } int bnx2x_issue_dmae_with_comp(struct bnx2x *bp , struct dmae_command *dmae , u32 *comp ) { int cnt ; int rc ; { cnt = (bp->common.chip_id & 61440U) > 20480U ? 400000 : 4000; rc = 0; bnx2x_dp_dmae(bp, dmae, 524288); spin_lock_bh(& bp->dmae_lock); *comp = 0U; bnx2x_post_dmae(bp, dmae, ((int )bp->pfid & 1) * 8 + ((int )bp->pfid >> 1)); __const_udelay(21475UL); goto ldv_62822; ldv_62821: ; if (cnt == 0 || ((unsigned int )bp->recovery_state != 0U && (unsigned int )bp->recovery_state != 4U)) { printk("\vbnx2x: [%s:%d(%s)]DMAE timeout!\n", "bnx2x_issue_dmae_with_comp", 545, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -1; goto unlock; } else { } cnt = cnt - 1; __const_udelay(214750UL); ldv_62822: ; if ((*comp & 2147483647U) != 1624297646U) { goto ldv_62821; } else { } if ((int )*comp < 0) { printk("\vbnx2x: [%s:%d(%s)]DMAE PCI error!\n", "bnx2x_issue_dmae_with_comp", 553, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -2; } else { } unlock: spin_unlock_bh(& bp->dmae_lock); return (rc); } } void bnx2x_write_dmae(struct bnx2x *bp , dma_addr_t dma_addr , u32 dst_addr , u32 len32 ) { int rc ; struct dmae_command dmae ; u32 *data ; { if (bp->dmae_ready == 0) { data = (u32 *)(& (bp->slowpath)->wb_data); if (bp->common.chip_id >> 16 == 5710U) { bnx2x_init_ind_wr(bp, dst_addr, (u32 const *)data, len32); } else { bnx2x_init_str_wr(bp, dst_addr, (u32 const *)data, len32); } return; } else { } bnx2x_prep_dmae_with_comp(bp, & dmae, 0, 2); dmae.src_addr_lo = (unsigned int )dma_addr; dmae.src_addr_hi = (unsigned int )(dma_addr >> 32); dmae.dst_addr_lo = dst_addr >> 2; dmae.dst_addr_hi = 0U; dmae.len = (u16 )len32; rc = bnx2x_issue_dmae_with_comp(bp, & dmae, & (bp->slowpath)->wb_comp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]DMAE returned failure %d\n", "bnx2x_write_dmae", 593, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } return; } } void bnx2x_read_dmae(struct bnx2x *bp , u32 src_addr , u32 len32 ) { int rc ; struct dmae_command dmae ; u32 *data ; int i ; { if (bp->dmae_ready == 0) { data = (u32 *)(& (bp->slowpath)->wb_data); if (bp->common.chip_id >> 16 == 5710U) { i = 0; goto ldv_62844; ldv_62843: *(data + (unsigned long )i) = bnx2x_reg_rd_ind(bp, (u32 )(i * 4) + src_addr); i = i + 1; ldv_62844: ; if ((u32 )i < len32) { goto ldv_62843; } else { } } else { i = 0; goto ldv_62847; ldv_62846: *(data + (unsigned long )i) = readl((void const volatile *)bp->regview + (unsigned long )((u32 )(i * 4) + src_addr)); i = i + 1; ldv_62847: ; if ((u32 )i < len32) { goto ldv_62846; } else { } } return; } else { } bnx2x_prep_dmae_with_comp(bp, & dmae, 1, 1); dmae.src_addr_lo = src_addr >> 2; dmae.src_addr_hi = 0U; dmae.dst_addr_lo = (unsigned int )bp->slowpath_mapping + 4416U; dmae.dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 4416ULL) >> 32); dmae.len = (u16 )len32; rc = bnx2x_issue_dmae_with_comp(bp, & dmae, & (bp->slowpath)->wb_comp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]DMAE returned failure %d\n", "bnx2x_read_dmae", 632, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } return; } } static void bnx2x_write_dmae_phys_len(struct bnx2x *bp , dma_addr_t phys_addr , u32 addr , u32 len ) { int dmae_wr_max ; int offset ; { dmae_wr_max = bp->common.chip_id >> 16 == 5710U ? 1024 : 8192; offset = 0; goto ldv_62859; ldv_62858: bnx2x_write_dmae(bp, (dma_addr_t )offset + phys_addr, addr + (u32 )offset, (u32 )dmae_wr_max); offset = dmae_wr_max * 4 + offset; len = len - (u32 )dmae_wr_max; ldv_62859: ; if ((u32 )dmae_wr_max < len) { goto ldv_62858; } else { } bnx2x_write_dmae(bp, (dma_addr_t )offset + phys_addr, addr + (u32 )offset, len); return; } } __inline static int bnx2x_get_assert_list_entry(struct bnx2x *bp , enum storms storm , int entry ) { { switch ((unsigned int )storm) { case 0U: ; return ((int )((unsigned int )(bp->iro_arr + 50UL)->base + (unsigned int )((int )(bp->iro_arr + 50UL)->m1 * entry))); case 1U: ; return ((int )((unsigned int )(bp->iro_arr + 101UL)->base + (unsigned int )((int )(bp->iro_arr + 101UL)->m1 * entry))); case 2U: ; return ((int )((unsigned int )(bp->iro_arr + 151UL)->base + (unsigned int )((int )(bp->iro_arr + 151UL)->m1 * entry))); case 3U: ; return ((int )((unsigned int )(bp->iro_arr + 180UL)->base + (unsigned int )((int )(bp->iro_arr + 180UL)->m1 * entry))); case 4U: ; default: printk("\vbnx2x: [%s:%d(%s)]unknown storm\n", "bnx2x_get_assert_list_entry", 681, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } return (-22); } } static int bnx2x_mc_assert(struct bnx2x *bp ) { char last_idx ; int i ; int j ; int rc ; enum storms storm ; u32 regs[4U] ; u32 bar_storm_intmem[4U] ; u32 storm_assert_list_index[4U] ; char *storms_string[4U] ; unsigned char tmp ; int tmp___0 ; { rc = 0; bar_storm_intmem[0] = 4325376U; bar_storm_intmem[1] = 4390912U; bar_storm_intmem[2] = 4259840U; bar_storm_intmem[3] = 4194304U; storm_assert_list_index[0] = (bp->iro_arr + 51UL)->base; storm_assert_list_index[1] = (bp->iro_arr + 102UL)->base; storm_assert_list_index[2] = (bp->iro_arr + 152UL)->base; storm_assert_list_index[3] = (bp->iro_arr + 181UL)->base; storms_string[0] = (char *)"XSTORM"; storms_string[1] = (char *)"TSTORM"; storms_string[2] = (char *)"CSTORM"; storms_string[3] = (char *)"USTORM"; storm = 0; goto ldv_62899; ldv_62898: tmp = readb((void const volatile *)bp->regview + (unsigned long )(bar_storm_intmem[(unsigned int )storm] + storm_assert_list_index[(unsigned int )storm])); last_idx = (char )tmp; if ((int )((signed char )last_idx) != 0) { printk("\vbnx2x: [%s:%d(%s)]%s_ASSERT_LIST_INDEX 0x%x\n", "bnx2x_mc_assert", 716, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", storms_string[(unsigned int )storm], (int )last_idx); } else { } i = 0; goto ldv_62897; ldv_62896: j = 0; goto ldv_62893; ldv_62892: tmp___0 = bnx2x_get_assert_list_entry(bp, storm, i); regs[j] = readl((void const volatile *)(bp->regview + ((unsigned long )(bar_storm_intmem[(unsigned int )storm] + (u32 )tmp___0) + (unsigned long )j * 4UL))); j = j + 1; ldv_62893: ; if (j <= 3) { goto ldv_62892; } else { } if (regs[0] != 0U) { printk("\vbnx2x: [%s:%d(%s)]%s_ASSERT_INDEX 0x%x = 0x%08x 0x%08x 0x%08x 0x%08x\n", "bnx2x_mc_assert", 732, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", storms_string[(unsigned int )storm], i, regs[3], regs[2], regs[1], regs[0]); rc = rc + 1; } else { goto ldv_62895; } i = i + 1; ldv_62897: ; if (i <= 49) { goto ldv_62896; } else { } ldv_62895: storm = (enum storms )((unsigned int )storm + 1U); ldv_62899: ; if ((unsigned int )storm <= 3U) { goto ldv_62898; } else { } printk("\vbnx2x: [%s:%d(%s)]Chip Revision: %s, FW Version: %d_%d_%d\n", "bnx2x_mc_assert", 746, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->common.chip_id >> 16 != 5710U ? (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U ? ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U ? (char *)"everest2" : (char *)"everest3") : (char *)"everest1h") : (char *)"everest1", 7, 10, 51); return (rc); } } void bnx2x_fw_dump_lvl(struct bnx2x *bp , char const *lvl ) { u32 addr ; u32 val ; u32 mark ; u32 offset ; __be32 data[9U] ; int word ; u32 trace_shmem_base ; unsigned int tmp ; unsigned int tmp___0 ; __u32 tmp___1 ; unsigned int tmp___2 ; __u32 tmp___3 ; { if ((bp->flags & 512U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]NO MCP - can not dump\n", "bnx2x_fw_dump_lvl", 763, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } netdev_printk(lvl, (struct net_device const *)bp->dev, "bc %d.%d.%d\n", (bp->common.bc_ver & 16711680U) >> 16, (bp->common.bc_ver & 65280U) >> 8, bp->common.bc_ver & 255U); val = readl((void const volatile *)bp->regview + 544796U); tmp = readl((void const volatile *)bp->regview + 544796U); if (tmp == val) { printk("\vbnx2x: [%s:%d(%s)]%sMCP PC at 0x%x\n", "bnx2x_fw_dump_lvl", 773, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", lvl, val); } else { } if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->pf_num & 1) == 0) { trace_shmem_base = bp->common.shmem_base; } else { trace_shmem_base = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 52UL))); } if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) ? 657408U : 3803136U) > trace_shmem_base || (u32 )((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) ? 655360 : 3801088) + (bp->common.chip_id >> 16 != 5710U ? (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U ? 131072 : 163840) : 65536)) <= trace_shmem_base) { printk("\vbnx2x: [%s:%d(%s)]Unable to dump trace buffer (mark %x)\n", "bnx2x_fw_dump_lvl", 785, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", trace_shmem_base); return; } else { } addr = trace_shmem_base - 2048U; mark = readl((void const volatile *)bp->regview + (unsigned long )addr); if (mark != 1414677314U) { printk("\vbnx2x: [%s:%d(%s)]Trace buffer signature is missing.", "bnx2x_fw_dump_lvl", 794, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } addr = addr + 4U; mark = readl((void const volatile *)bp->regview + (unsigned long )addr); mark = ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) ? 655360U : 3801088U) + ((mark + 3U) & 4294967292U)) - 134217728U; if (mark >= trace_shmem_base || addr + 4U > mark) { printk("\vbnx2x: [%s:%d(%s)]Mark doesn\'t fall inside Trace Buffer\n", "bnx2x_fw_dump_lvl", 803, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } printk("%sbegin fw dump (mark 0x%x)\n", lvl, mark); printk("%s", lvl); offset = mark; goto ldv_62917; ldv_62916: word = 0; goto ldv_62914; ldv_62913: tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )((u32 )(word * 4) + offset)); tmp___1 = __fswab32(tmp___0); data[word] = tmp___1; word = word + 1; ldv_62914: ; if (word <= 7) { goto ldv_62913; } else { } data[8] = 0U; printk("%s", (char *)(& data)); offset = offset + 32U; ldv_62917: ; if (offset < trace_shmem_base) { goto ldv_62916; } else { } offset = addr + 4U; goto ldv_62923; ldv_62922: word = 0; goto ldv_62920; ldv_62919: tmp___2 = readl((void const volatile *)bp->regview + (unsigned long )((u32 )(word * 4) + offset)); tmp___3 = __fswab32(tmp___2); data[word] = tmp___3; word = word + 1; ldv_62920: ; if (word <= 7) { goto ldv_62919; } else { } data[8] = 0U; printk("%s", (char *)(& data)); offset = offset + 32U; ldv_62923: ; if (offset <= mark) { goto ldv_62922; } else { } printk("%send of fw dump\n", lvl); return; } } static void bnx2x_fw_dump(struct bnx2x *bp ) { { bnx2x_fw_dump_lvl(bp, "\v"); return; } } static void bnx2x_hc_int_disable(struct bnx2x *bp ) { int port ; u32 addr ; u32 val ; unsigned int tmp ; long tmp___0 ; unsigned int tmp___1 ; { port = (int )bp->pfid & 1; addr = port != 0 ? 1081348U : 1081344U; tmp = readl((void const volatile *)bp->regview + (unsigned long )addr); val = tmp; if (bp->common.chip_id >> 16 == 5710U) { writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 270402) * 4)); val = val & 4294967269U; } else { val = val & 4294967265U; } tmp___0 = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write %x to HC %d (addr 0x%x)\n", "bnx2x_hc_int_disable", 861, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val, port, addr); } else { } __asm__ volatile ("": : : "memory"); writel(val, (void volatile *)bp->regview + (unsigned long )addr); tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )addr); if (tmp___1 != val) { printk("\vbnx2x: [%s:%d(%s)]BUG! Proper val not read from IGU!\n", "bnx2x_hc_int_disable", 868, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static void bnx2x_igu_int_disable(struct bnx2x *bp ) { u32 val ; unsigned int tmp ; long tmp___0 ; unsigned int tmp___1 ; { tmp = readl((void const volatile *)bp->regview + 1245524U); val = tmp; val = val & 4294967281U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write %x to IGU\n", "bnx2x_igu_int_disable", 879, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } __asm__ volatile ("": : : "memory"); writel(val, (void volatile *)bp->regview + 1245524U); tmp___1 = readl((void const volatile *)bp->regview + 1245524U); if (tmp___1 != val) { printk("\vbnx2x: [%s:%d(%s)]BUG! Proper val not read from IGU!\n", "bnx2x_igu_int_disable", 886, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static void bnx2x_int_disable(struct bnx2x *bp ) { { if ((unsigned int )bp->common.int_block == 0U) { bnx2x_hc_int_disable(bp); } else { bnx2x_igu_int_disable(bp); } return; } } void bnx2x_panic_dump(struct bnx2x *bp , bool disable_int ) { int i ; u16 j ; struct hc_sp_status_block_data sp_sb_data ; int func ; long tmp ; struct host_sp_status_block *def_sb ; int data_size ; int cstorm_offset ; struct bnx2x_fastpath *fp ; int loop ; struct hc_status_block_data_e2 sb_data_e2 ; struct hc_status_block_data_e1x sb_data_e1x ; struct hc_status_block_sm *hc_sm_p ; struct hc_index_data *hc_index_p ; u8 data_size___0 ; u8 cos ; u32 *sb_data_p ; struct bnx2x_fp_txdata txdata ; { func = (int )bp->pfid; if ((bp->flags & 4194304U) == 0U && (int )disable_int) { bnx2x_int_disable(bp); } else { } bp->stats_state = 0; bp->eth_stats.unrecoverable_error = bp->eth_stats.unrecoverable_error + 1U; tmp = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]stats_state - DISABLED\n", "bnx2x_panic_dump", 912, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } printk("\vbnx2x: [%s:%d(%s)]begin crash dump -----------------\n", "bnx2x_panic_dump", 914, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); if ((bp->flags & 4194304U) == 0U) { def_sb = bp->def_status_blk; printk("\vbnx2x: [%s:%d(%s)]def_idx(0x%x) def_att_idx(0x%x) attn_state(0x%x) spq_prod_idx(0x%x) next_stats_cnt(0x%x)\n", "bnx2x_panic_dump", 924, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->def_idx, (int )bp->def_att_idx, bp->attn_state, (int )bp->spq_prod_idx, (int )bp->stats_counter); printk("\vbnx2x: [%s:%d(%s)]DSB: attn bits(0x%x) ack(0x%x) id(0x%x) idx(0x%x)\n", "bnx2x_panic_dump", 929, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", def_sb->atten_status_block.attn_bits, def_sb->atten_status_block.attn_bits_ack, (int )def_sb->atten_status_block.status_block_id, (int )def_sb->atten_status_block.attn_bits_index); printk("\vbnx2x: [%s:%d(%s)] def (", "bnx2x_panic_dump", 930, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); i = 0; goto ldv_62956; ldv_62955: printk("0x%x%s", (int )def_sb->sp_sb.index_values[i], i == 15 ? (char *)") " : (char *)" "); i = i + 1; ldv_62956: ; if (i <= 15) { goto ldv_62955; } else { } data_size = 4; cstorm_offset = (int )((unsigned int )(bp->iro_arr + 146UL)->base + (unsigned int )((int )(bp->iro_arr + 146UL)->m1 * func)); i = 0; goto ldv_62959; ldv_62958: *((u32 *)(& sp_sb_data) + (unsigned long )i) = readl((void const volatile *)(bp->regview + ((unsigned long )(cstorm_offset + 4259840) + (unsigned long )i * 4UL))); i = i + 1; ldv_62959: ; if (i < data_size) { goto ldv_62958; } else { } printk("igu_sb_id(0x%x) igu_seg_id(0x%x) pf_id(0x%x) vnic_id(0x%x) vf_id(0x%x) vf_valid (0x%x) state(0x%x)\n", (int )sp_sb_data.igu_sb_id, (int )sp_sb_data.igu_seg_id, (int )sp_sb_data.p_func.pf_id, (int )sp_sb_data.p_func.vnic_id, (int )sp_sb_data.p_func.vf_id, (int )sp_sb_data.p_func.vf_valid, (int )sp_sb_data.state); } else { } i = 0; goto ldv_62993; ldv_62992: fp = bp->fp + (unsigned long )i; hc_sm_p = bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) ? (struct hc_status_block_sm *)(& sb_data_e1x.common.state_machine) : (struct hc_status_block_sm *)(& sb_data_e2.common.state_machine); hc_index_p = bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) ? (struct hc_index_data *)(& sb_data_e1x.index_data) : (struct hc_index_data *)(& sb_data_e2.index_data); if ((unsigned long )bp->fp == (unsigned long )((struct bnx2x_fastpath *)0)) { goto ldv_62971; } else { } if ((unsigned long )fp->rx_cons_sb == (unsigned long )((__le16 *)0U)) { goto ldv_62972; } else { } printk("\vbnx2x: [%s:%d(%s)]fp%d: rx_bd_prod(0x%x) rx_bd_cons(0x%x) rx_comp_prod(0x%x) rx_comp_cons(0x%x) *rx_cons_sb(0x%x)\n", "bnx2x_panic_dump", 981, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (int )fp->rx_bd_prod, (int )fp->rx_bd_cons, (int )fp->rx_comp_prod, (int )fp->rx_comp_cons, (int )*(fp->rx_cons_sb)); printk("\vbnx2x: [%s:%d(%s)] rx_sge_prod(0x%x) last_max_sge(0x%x) fp_hc_idx(0x%x)\n", "bnx2x_panic_dump", 984, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->rx_sge_prod, (int )fp->last_max_sge, (int )fp->fp_hc_idx); cos = 0U; goto ldv_62976; ldv_62975: ; if ((unsigned long )fp->txdata_ptr[(int )cos] == (unsigned long )((struct bnx2x_fp_txdata *)0)) { goto ldv_62973; } else { } txdata = *(fp->txdata_ptr[(int )cos]); if ((unsigned long )txdata.tx_cons_sb == (unsigned long )((__le16 *)0U)) { goto ldv_62974; } else { } printk("\vbnx2x: [%s:%d(%s)]fp%d: tx_pkt_prod(0x%x) tx_pkt_cons(0x%x) tx_bd_prod(0x%x) tx_bd_cons(0x%x) *tx_cons_sb(0x%x)\n", "bnx2x_panic_dump", 1001, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (int )txdata.tx_pkt_prod, (int )txdata.tx_pkt_cons, (int )txdata.tx_bd_prod, (int )txdata.tx_bd_cons, (int )*(txdata.tx_cons_sb)); ldv_62974: cos = (u8 )((int )cos + 1); ldv_62976: ; if ((int )fp->max_cos > (int )cos) { goto ldv_62975; } else { } ldv_62973: loop = 8; if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { goto ldv_62972; } else { } printk("\vbnx2x: [%s:%d(%s)] run indexes (", "bnx2x_panic_dump", 1012, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); j = 0U; goto ldv_62978; ldv_62977: printk("0x%x%s", (int )*(fp->sb_running_index + (unsigned long )j), (unsigned int )j == 1U ? (char *)")" : (char *)" "); j = (u16 )((int )j + 1); ldv_62978: ; if ((unsigned int )j <= 1U) { goto ldv_62977; } else { } printk("\vbnx2x: [%s:%d(%s)] indexes (", "bnx2x_panic_dump", 1018, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); j = 0U; goto ldv_62981; ldv_62980: printk("0x%x%s", (int )*(fp->sb_index_values + (unsigned long )j), (int )j == loop + -1 ? (char *)")" : (char *)" "); j = (u16 )((int )j + 1); ldv_62981: ; if ((int )j < loop) { goto ldv_62980; } else { } if ((bp->flags & 4194304U) != 0U) { goto ldv_62972; } else { } data_size___0 = 64U; data_size___0 = (u8 )((unsigned int )data_size___0 / 4U); sb_data_p = bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) ? (u32 *)(& sb_data_e1x) : (u32 *)(& sb_data_e2); j = 0U; goto ldv_62984; ldv_62983: *(sb_data_p + (unsigned long )j) = readl((void const volatile *)(bp->regview + ((unsigned long )(((unsigned int )(bp->iro_arr + 137UL)->base + (unsigned int )((int )fp->fw_sb_id * (int )(bp->iro_arr + 137UL)->m1)) + 4259840U) + (unsigned long )j * 4UL))); j = (u16 )((int )j + 1); ldv_62984: ; if ((int )((unsigned short )data_size___0) > (int )j) { goto ldv_62983; } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { printk("pf_id(0x%x) vf_id(0x%x) vf_valid(0x%x) vnic_id(0x%x) same_igu_sb_1b(0x%x) state(0x%x)\n", (int )sb_data_e2.common.p_func.pf_id, (int )sb_data_e2.common.p_func.vf_id, (int )sb_data_e2.common.p_func.vf_valid, (int )sb_data_e2.common.p_func.vnic_id, (int )sb_data_e2.common.same_igu_sb_1b, (int )sb_data_e2.common.state); } else { printk("pf_id(0x%x) vf_id(0x%x) vf_valid(0x%x) vnic_id(0x%x) same_igu_sb_1b(0x%x) state(0x%x)\n", (int )sb_data_e1x.common.p_func.pf_id, (int )sb_data_e1x.common.p_func.vf_id, (int )sb_data_e1x.common.p_func.vf_valid, (int )sb_data_e1x.common.p_func.vnic_id, (int )sb_data_e1x.common.same_igu_sb_1b, (int )sb_data_e1x.common.state); } j = 0U; goto ldv_62987; ldv_62986: printk("SM[%d] __flags (0x%x) igu_sb_id (0x%x) igu_seg_id(0x%x) time_to_expire (0x%x) timer_value(0x%x)\n", (int )j, (int )(hc_sm_p + (unsigned long )j)->__flags, (int )(hc_sm_p + (unsigned long )j)->igu_sb_id, (int )(hc_sm_p + (unsigned long )j)->igu_seg_id, (hc_sm_p + (unsigned long )j)->time_to_expire, (int )(hc_sm_p + (unsigned long )j)->timer_value); j = (u16 )((int )j + 1); ldv_62987: ; if ((unsigned int )j <= 1U) { goto ldv_62986; } else { } j = 0U; goto ldv_62990; ldv_62989: printk("INDEX[%d] flags (0x%x) timeout (0x%x)\n", (int )j, (int )(hc_index_p + (unsigned long )j)->flags, (int )(hc_index_p + (unsigned long )j)->timeout); j = (u16 )((int )j + 1); ldv_62990: ; if ((int )j < loop) { goto ldv_62989; } else { } ldv_62972: i = i + 1; ldv_62993: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62992; } else { } ldv_62971: ; if ((bp->flags & 4194304U) == 0U) { bnx2x_fw_dump(bp); bnx2x_mc_assert(bp); } else { } printk("\vbnx2x: [%s:%d(%s)]end crash dump -----------------\n", "bnx2x_panic_dump", 1177, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } } static void bnx2x_pbf_pN_buf_flushed(struct bnx2x *bp , struct pbf_pN_buf_regs *regs , u32 poll_count ) { u32 init_crd ; u32 crd ; u32 crd_start ; u32 crd_freed ; u32 crd_freed_start ; u32 cur_cnt ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; u32 tmp___5 ; long tmp___6 ; { cur_cnt = poll_count; crd_freed_start = readl((void const volatile *)bp->regview + (unsigned long )regs->crd_freed); crd_freed = crd_freed_start; crd_start = readl((void const volatile *)bp->regview + (unsigned long )regs->crd); crd = crd_start; init_crd = readl((void const volatile *)bp->regview + (unsigned long )regs->init_crd); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]INIT CREDIT[%d] : %x\n", "bnx2x_pbf_pN_buf_flushed", 1214, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, init_crd); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]CREDIT[%d] : s:%x\n", "bnx2x_pbf_pN_buf_flushed", 1215, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, crd); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]CREDIT_FREED[%d]: s:%x\n", "bnx2x_pbf_pN_buf_flushed", 1216, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, crd_freed); } else { } goto ldv_63017; ldv_63016: tmp___5 = cur_cnt; cur_cnt = cur_cnt - 1U; if (tmp___5 != 0U) { __const_udelay(214750UL); crd = readl((void const volatile *)bp->regview + (unsigned long )regs->crd); crd_freed = readl((void const volatile *)bp->regview + (unsigned long )regs->crd_freed); } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PBF tx buffer[%d] timed out\n", "bnx2x_pbf_pN_buf_flushed", 1226, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]CREDIT[%d] : c:%x\n", "bnx2x_pbf_pN_buf_flushed", 1228, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, crd); } else { } tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]CREDIT_FREED[%d]: c:%x\n", "bnx2x_pbf_pN_buf_flushed", 1230, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, crd_freed); } else { } goto ldv_63015; } ldv_63017: ; if (crd != init_crd && (unsigned int )((int )crd_freed - (int )crd_freed_start) < init_crd - crd_start) { goto ldv_63016; } else { } ldv_63015: tmp___6 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Waited %d*%d usec for PBF tx buffer[%d]\n", "bnx2x_pbf_pN_buf_flushed", 1235, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", poll_count - cur_cnt, 50, regs->pN); } else { } return; } } static void bnx2x_pbf_pN_cmd_flushed(struct bnx2x *bp , struct pbf_pN_cmd_regs *regs , u32 poll_count ) { u32 occup ; u32 to_free ; u32 freed ; u32 freed_start ; u32 cur_cnt ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; u32 tmp___4 ; long tmp___5 ; { cur_cnt = poll_count; to_free = readl((void const volatile *)bp->regview + (unsigned long )regs->lines_occup); occup = to_free; freed_start = readl((void const volatile *)bp->regview + (unsigned long )regs->lines_freed); freed = freed_start; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]OCCUPANCY[%d] : s:%x\n", "bnx2x_pbf_pN_cmd_flushed", 1248, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, occup); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]LINES_FREED[%d] : s:%x\n", "bnx2x_pbf_pN_cmd_flushed", 1249, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, freed); } else { } goto ldv_63031; ldv_63030: tmp___4 = cur_cnt; cur_cnt = cur_cnt - 1U; if (tmp___4 != 0U) { __const_udelay(214750UL); occup = readl((void const volatile *)bp->regview + (unsigned long )regs->lines_occup); freed = readl((void const volatile *)bp->regview + (unsigned long )regs->lines_freed); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PBF cmd queue[%d] timed out\n", "bnx2x_pbf_pN_cmd_flushed", 1258, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN); } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]OCCUPANCY[%d] : s:%x\n", "bnx2x_pbf_pN_cmd_flushed", 1260, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, occup); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]LINES_FREED[%d] : s:%x\n", "bnx2x_pbf_pN_cmd_flushed", 1262, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", regs->pN, freed); } else { } goto ldv_63029; } ldv_63031: ; if (occup != 0U && (unsigned int )((int )freed - (int )freed_start) < to_free) { goto ldv_63030; } else { } ldv_63029: tmp___5 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Waited %d*%d usec for PBF cmd queue[%d]\n", "bnx2x_pbf_pN_cmd_flushed", 1267, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", poll_count - cur_cnt, 50, regs->pN); } else { } return; } } static u32 bnx2x_flr_clnup_reg_poll(struct bnx2x *bp , u32 reg , u32 expected , u32 poll_count ) { u32 cur_cnt ; u32 val ; u32 tmp ; { cur_cnt = poll_count; goto ldv_63041; ldv_63040: __const_udelay(214750UL); ldv_63041: val = readl((void const volatile *)bp->regview + (unsigned long )reg); if (val != expected) { tmp = cur_cnt; cur_cnt = cur_cnt - 1U; if (tmp != 0U) { goto ldv_63040; } else { goto ldv_63042; } } else { } ldv_63042: ; return (val); } } int bnx2x_flr_clnup_poll_hw_counter(struct bnx2x *bp , u32 reg , char *msg , u32 poll_cnt ) { u32 val ; u32 tmp ; { tmp = bnx2x_flr_clnup_reg_poll(bp, reg, 0U, poll_cnt); val = tmp; if (val != 0U) { printk("\vbnx2x: [%s:%d(%s)]%s usage count=%d\n", "bnx2x_flr_clnup_poll_hw_counter", 1287, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", msg, val); return (1); } else { } return (0); } } u32 bnx2x_flr_clnup_poll_count(struct bnx2x *bp ) { { if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) == 0U) { return (400000U); } else { } if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) != 0U) { return (24000U); } else { } return (200U); } } void bnx2x_tx_hw_flushed(struct bnx2x *bp , u32 poll_count ) { struct pbf_pN_cmd_regs cmd_regs[3U] ; struct pbf_pN_buf_regs buf_regs[3U] ; int i ; { cmd_regs[0].pN = 0; cmd_regs[0].lines_occup = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311660U : 1311484U; cmd_regs[0].lines_freed = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311632U : 1311472U; cmd_regs[1].pN = 1; cmd_regs[1].lines_occup = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311664U : 1311488U; cmd_regs[1].lines_freed = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311636U : 1311476U; cmd_regs[2].pN = 4; cmd_regs[2].lines_occup = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311656U : 1311492U; cmd_regs[2].lines_freed = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311628U : 1311480U; buf_regs[0].pN = 0; buf_regs[0].init_crd = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1425968U : 1310928U; buf_regs[0].crd = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311548U : 1311232U; buf_regs[0].crd_freed = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311576U : 1311496U; buf_regs[1].pN = 1; buf_regs[1].init_crd = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1425972U : 1310932U; buf_regs[1].crd = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311552U : 1311240U; buf_regs[1].crd_freed = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311580U : 1311500U; buf_regs[2].pN = 4; buf_regs[2].init_crd = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1425992U : 1310944U; buf_regs[2].crd = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311544U : 1311248U; buf_regs[2].crd_freed = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 1311572U : 1311504U; i = 0; goto ldv_63064; ldv_63063: bnx2x_pbf_pN_cmd_flushed(bp, (struct pbf_pN_cmd_regs *)(& cmd_regs) + (unsigned long )i, poll_count); i = i + 1; ldv_63064: ; if ((unsigned int )i <= 2U) { goto ldv_63063; } else { } i = 0; goto ldv_63069; ldv_63068: bnx2x_pbf_pN_buf_flushed(bp, (struct pbf_pN_buf_regs *)(& buf_regs) + (unsigned long )i, poll_count); i = i + 1; ldv_63069: ; if ((unsigned int )i <= 2U) { goto ldv_63068; } else { } return; } } int bnx2x_send_final_clnup(struct bnx2x *bp , u8 clnup_func , u32 poll_cnt ) { u32 op_gen_command ; u32 comp_addr ; int ret ; unsigned int tmp ; long tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; u32 tmp___3 ; { op_gen_command = 0U; comp_addr = ((unsigned int )(bp->iro_arr + 163UL)->base + (unsigned int )((int )clnup_func * (int )(bp->iro_arr + 163UL)->m1)) + 4259840U; ret = 0; tmp = readl((void const volatile *)bp->regview + (unsigned long )comp_addr); if (tmp != 0U) { printk("\vbnx2x: [%s:%d(%s)]Cleanup complete was not 0 before sending\n", "bnx2x_send_final_clnup", 1387, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (1); } else { } op_gen_command = ((u32 )(bp->iro_arr + 66UL)->base & 31U) | op_gen_command; op_gen_command = ((u32 )((bp->iro_arr + 67UL)->base << 5) & 255U) | op_gen_command; op_gen_command = ((u32 )((int )clnup_func << 8) & 65535U) | op_gen_command; op_gen_command = op_gen_command | 65536U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]sending FW Final cleanup\n", "bnx2x_send_final_clnup", 1396, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(op_gen_command, (void volatile *)bp->regview + 1467588U); tmp___3 = bnx2x_flr_clnup_reg_poll(bp, comp_addr, 1U, poll_cnt); if (tmp___3 != 1U) { printk("\vbnx2x: [%s:%d(%s)]FW final cleanup did not succeed\n", "bnx2x_send_final_clnup", 1400, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )comp_addr); printk("\rbnx2x: [%s:%d(%s)]At timeout completion address contained %x\n", "bnx2x_send_final_clnup", 1402, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tmp___1); } else { } bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_send_final_clnup", 1403, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); return (1); } else { } writel(0U, (void volatile *)bp->regview + (unsigned long )comp_addr); return (ret); } } u8 bnx2x_is_pcie_pending(struct pci_dev *dev ) { u16 status ; { pcie_capability_read_word(dev, 10, & status); return ((unsigned int )((u8 )status) & 32U); } } static int bnx2x_poll_hw_usage_counters(struct bnx2x *bp , u32 poll_cnt ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = bnx2x_flr_clnup_poll_hw_counter(bp, 1065248U, (char *)"CFC PF usage counter timed out", poll_cnt); if (tmp != 0) { return (1); } else { } tmp___0 = bnx2x_flr_clnup_poll_hw_counter(bp, 1507792U, (char *)"DQ PF usage counter timed out", poll_cnt); if (tmp___0 != 0) { return (1); } else { } tmp___1 = bnx2x_flr_clnup_poll_hw_counter(bp, (u32 )(((int )bp->pfid + 374800) * 4), (char *)"QM PF usage counter timed out", poll_cnt); if (tmp___1 != 0) { return (1); } else { } tmp___2 = bnx2x_flr_clnup_poll_hw_counter(bp, (u32 )((((int )bp->pfid & 1) + 364618) * 4), (char *)"Timers VNIC usage counter timed out", poll_cnt); if (tmp___2 != 0) { return (1); } else { } tmp___3 = bnx2x_flr_clnup_poll_hw_counter(bp, (u32 )((((int )bp->pfid & 1) + 364584) * 4), (char *)"Timers NUM_SCANS usage counter timed out", poll_cnt); if (tmp___3 != 0) { return (1); } else { } tmp___4 = bnx2x_flr_clnup_poll_hw_counter(bp, dmae_reg_go_c[((int )bp->pfid & 1) * 8 + ((int )bp->pfid >> 1)], (char *)"DMAE command register timed out", poll_cnt); if (tmp___4 != 0) { return (1); } else { } return (0); } } static void bnx2x_hw_enable_status(struct bnx2x *bp ) { u32 val ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { val = readl((void const volatile *)bp->regview + 1065252U); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]CFC_REG_WEAK_ENABLE_PF is 0x%x\n", "bnx2x_hw_enable_status", 1472, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val = readl((void const volatile *)bp->regview + 1311464U); tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PBF_REG_DISABLE_PF is 0x%x\n", "bnx2x_hw_enable_status", 1475, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val = readl((void const volatile *)bp->regview + 1245504U); tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]IGU_REG_PCI_PF_MSI_EN is 0x%x\n", "bnx2x_hw_enable_status", 1478, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val = readl((void const volatile *)bp->regview + 1245508U); tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]IGU_REG_PCI_PF_MSIX_EN is 0x%x\n", "bnx2x_hw_enable_status", 1481, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val = readl((void const volatile *)bp->regview + 1245512U); tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]IGU_REG_PCI_PF_MSIX_FUNC_MASK is 0x%x\n", "bnx2x_hw_enable_status", 1484, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val = readl((void const volatile *)bp->regview + 37976U); tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PGLUE_B_REG_SHADOW_BME_PF_7_0_CLR is 0x%x\n", "bnx2x_hw_enable_status", 1487, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val = readl((void const volatile *)bp->regview + 37912U); tmp___5 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PGLUE_B_REG_FLR_REQUEST_PF_7_0_CLR is 0x%x\n", "bnx2x_hw_enable_status", 1490, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val = readl((void const volatile *)bp->regview + 37932U); tmp___6 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER is 0x%x\n", "bnx2x_hw_enable_status", 1494, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } return; } } static int bnx2x_pf_flr_clnup(struct bnx2x *bp ) { u32 poll_cnt ; u32 tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; u8 tmp___4 ; { tmp = bnx2x_flr_clnup_poll_count(bp); poll_cnt = tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Cleanup after FLR PF[%d]\n", "bnx2x_pf_flr_clnup", 1501, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->pf_num); } else { } writel(1U, (void volatile *)bp->regview + 37936U); tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Polling usage counters\n", "bnx2x_pf_flr_clnup", 1507, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___2 = bnx2x_poll_hw_usage_counters(bp, poll_cnt); if (tmp___2 != 0) { return (-16); } else { } tmp___3 = bnx2x_send_final_clnup(bp, (int )bp->pfid, poll_cnt); if (tmp___3 != 0) { return (-16); } else { } bnx2x_tx_hw_flushed(bp, poll_cnt); msleep(100U); tmp___4 = bnx2x_is_pcie_pending(bp->pdev); if ((unsigned int )tmp___4 != 0U) { printk("\vbnx2x: [%s:%d(%s)]PCIE Transactions still pending\n", "bnx2x_pf_flr_clnup", 1527, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_hw_enable_status(bp); writel(1U, (void volatile *)bp->regview + 37932U); return (0); } } static void bnx2x_hc_int_enable(struct bnx2x *bp ) { int port ; u32 addr ; u32 val ; unsigned int tmp ; bool msix ; bool single_msix ; bool msi ; long tmp___0 ; long tmp___1 ; { port = (int )bp->pfid & 1; addr = port != 0 ? 1081348U : 1081344U; tmp = readl((void const volatile *)bp->regview + (unsigned long )addr); val = tmp; msix = (bp->flags & 32U) != 0U; single_msix = (bp->flags & 1048576U) != 0U; msi = (bp->flags & 64U) != 0U; if ((int )msix) { val = val & 4294967285U; val = val | 20U; if ((int )single_msix) { val = val | 2U; } else { } } else if ((int )msi) { val = val & 4294967287U; val = val | 22U; } else { val = val | 30U; if (bp->common.chip_id >> 16 != 5710U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write %x to HC %d (addr 0x%x)\n", "bnx2x_hc_int_enable", 1570, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val, port, addr); } else { } writel(val, (void volatile *)bp->regview + (unsigned long )addr); val = val & 4294967291U; } else { } } if (bp->common.chip_id >> 16 == 5710U) { writel(131071U, (void volatile *)bp->regview + (unsigned long )((port + 270402) * 4)); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write %x to HC %d (addr 0x%x) mode %s\n", "bnx2x_hc_int_enable", 1583, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val, port, addr, (int )msix ? (char *)"MSI-X" : ((int )msi ? (char *)"MSI" : (char *)"INTx")); } else { } writel(val, (void volatile *)bp->regview + (unsigned long )addr); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); if (bp->common.chip_id >> 16 != 5710U) { if ((unsigned int )bp->mf_mode != 0U) { val = (u32 )((1 << (((int )bp->pfid >> 1) + 4)) | 60943); if (bp->port.pmf != 0U) { val = val | 4352U; } else { } } else { val = 65535U; } writel(val, (void volatile *)bp->regview + (unsigned long )(port * 8 + 1081412)); writel(val, (void volatile *)bp->regview + (unsigned long )((port + 135176) * 8)); } else { } __asm__ volatile ("": : : "memory"); return; } } static void bnx2x_igu_int_enable(struct bnx2x *bp ) { u32 val ; bool msix ; bool single_msix ; bool msi ; long tmp ; { msix = (bp->flags & 32U) != 0U; single_msix = (bp->flags & 1048576U) != 0U; msi = (bp->flags & 64U) != 0U; val = readl((void const volatile *)bp->regview + 1245524U); if ((int )msix) { val = val & 4294967275U; val = val | 10U; if ((int )single_msix) { val = val | 16U; } else { } } else if ((int )msi) { val = val & 4294967291U; val = val | 26U; } else { val = val & 4294967293U; val = val | 28U; } if (! msix || (int )single_msix) { writel(val, (void volatile *)bp->regview + 1245524U); bnx2x_ack_int(bp); } else { } val = val | 1U; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]write 0x%x to IGU mode %s\n", "bnx2x_igu_int_enable", 1648, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val, (int )msix ? (char *)"MSI-X" : ((int )msi ? (char *)"MSI" : (char *)"INTx")); } else { } writel(val, (void volatile *)bp->regview + 1245524U); if ((val & 4U) != 0U) { pci_intx(bp->pdev, 1); } else { } __asm__ volatile ("": : : "memory"); if ((unsigned int )bp->mf_mode != 0U) { val = (u32 )((1 << (((int )bp->pfid >> 1) + 4)) | 60943); if (bp->port.pmf != 0U) { val = val | 4352U; } else { } } else { val = 65535U; } writel(val, (void volatile *)bp->regview + 1245444U); writel(val, (void volatile *)bp->regview + 1245492U); __asm__ volatile ("": : : "memory"); return; } } void bnx2x_int_enable(struct bnx2x *bp ) { { if ((unsigned int )bp->common.int_block == 0U) { bnx2x_hc_int_enable(bp); } else { bnx2x_igu_int_enable(bp); } return; } } void bnx2x_int_disable_sync(struct bnx2x *bp , int disable_hw ) { int msix ; int i ; int offset ; int tmp ; { msix = (bp->flags & 32U) != 0U; if (disable_hw != 0) { bnx2x_int_disable(bp); } else { } if (msix != 0) { synchronize_irq((bp->msix_table)->vector); offset = 1; if ((unsigned int )bp->cnic_support != 0U) { offset = offset + 1; } else { } i = 0; goto ldv_63127; ldv_63126: tmp = offset; offset = offset + 1; synchronize_irq((bp->msix_table + (unsigned long )tmp)->vector); i = i + 1; ldv_63127: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_63126; } else { } } else { synchronize_irq((bp->pdev)->irq); } ldv_cancel_delayed_work_10(& bp->sp_task); ldv_cancel_delayed_work_11(& bp->period_task); ldv_flush_workqueue_12(bnx2x_wq); return; } } static bool bnx2x_trylock_hw_lock(struct bnx2x *bp , u32 resource ) { u32 lock_status ; u32 resource_bit ; int func ; u32 hw_lock_control_reg ; long tmp ; long tmp___0 ; long tmp___1 ; { resource_bit = (u32 )(1 << (int )resource); func = (int )bp->pfid; tmp = ldv__builtin_expect((bp->msg_enable & 8224) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Trying to take a lock on resource %d\n", "bnx2x_trylock_hw_lock", 1722, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", resource); } else { } if (resource > 31U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8224) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n", "bnx2x_trylock_hw_lock", 1728, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", resource, 31); } else { } return (0); } else { } if (func <= 5) { hw_lock_control_reg = (u32 )((func + 5282) * 8); } else { hw_lock_control_reg = (u32 )((func + 5235) * 8); } writel(resource_bit, (void volatile *)bp->regview + (unsigned long )(hw_lock_control_reg + 4U)); lock_status = readl((void const volatile *)bp->regview + (unsigned long )hw_lock_control_reg); if ((lock_status & resource_bit) != 0U) { return (1); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 8224) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to get a lock on resource %d\n", "bnx2x_trylock_hw_lock", 1745, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", resource); } else { } return (0); } } static int bnx2x_get_leader_lock_resource(struct bnx2x *bp ) { { if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) { return (9); } else { return (8); } } } static bool bnx2x_trylock_leader_lock(struct bnx2x *bp ) { int tmp ; bool tmp___0 ; { tmp = bnx2x_get_leader_lock_resource(bp); tmp___0 = bnx2x_trylock_hw_lock(bp, (u32 )tmp); return (tmp___0); } } static void bnx2x_cnic_cfc_comp(struct bnx2x *bp , int cid , u8 err ) ; static int bnx2x_schedule_sp_task(struct bnx2x *bp ) { bool tmp ; { atomic_set(& bp->interrupt_occurred, 1); __asm__ volatile ("": : : "memory"); tmp = queue_delayed_work(bnx2x_wq, & bp->sp_task, 0UL); return ((int )tmp); } } void bnx2x_sp_event(struct bnx2x_fastpath *fp , union eth_rx_cqe *rr_cqe ) { struct bnx2x *bp ; int cid ; int command ; enum bnx2x_queue_cmd drv_cmd ; struct bnx2x_queue_sp_obj *q_obj ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; int tmp___7 ; int tmp___8 ; long tmp___9 ; int tmp___10 ; { bp = fp->bp; cid = (int )rr_cqe->ramrod_cqe.conn_and_cmd_data & 131071; command = (int )(rr_cqe->ramrod_cqe.conn_and_cmd_data >> 24); drv_cmd = 11; q_obj = & (bp->sp_objs + (unsigned long )fp->index)->q_obj; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]fp %d cid %d got ramrod #%d state is %x type is %d\n", "bnx2x_sp_event", 1809, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index, cid, command, (int )bp->state, (int )rr_cqe->ramrod_cqe.ramrod_type); } else { } if (cid > 1023 && cid <= 2047) { bnx2x_iov_set_queue_sp_obj(bp, cid, & q_obj); } else { } switch (command) { case 5: tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got UPDATE ramrod. CID %d\n", "bnx2x_sp_event", 1820, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } drv_cmd = 5; goto ldv_63162; case 1: tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got MULTI[%d] setup ramrod\n", "bnx2x_sp_event", 1825, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } drv_cmd = 1; goto ldv_63162; case 4: tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got MULTI[%d] tx-only setup ramrod\n", "bnx2x_sp_event", 1830, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } drv_cmd = 2; goto ldv_63162; case 2: tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got MULTI[%d] halt ramrod\n", "bnx2x_sp_event", 1835, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } drv_cmd = 7; goto ldv_63162; case 7: tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got MULTI[%d] terminate ramrod\n", "bnx2x_sp_event", 1840, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } drv_cmd = 9; goto ldv_63162; case 6: tmp___5 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got MULTI[%d] empty ramrod\n", "bnx2x_sp_event", 1845, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } drv_cmd = 10; goto ldv_63162; case 8: tmp___6 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got tpa update ramrod CID=%d\n", "bnx2x_sp_event", 1850, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } drv_cmd = 6; goto ldv_63162; default: printk("\vbnx2x: [%s:%d(%s)]unexpected MC reply (%d) on fp[%d]\n", "bnx2x_sp_event", 1856, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", command, (int )fp->index); return; } ldv_63162: ; if ((unsigned int )drv_cmd != 11U) { tmp___7 = (*(q_obj->complete_cmd))(bp, q_obj, drv_cmd); if (tmp___7 != 0) { return; } else { } } else { } __asm__ volatile ("": : : "memory"); atomic_inc(& bp->cq_spq_left); __asm__ volatile ("": : : "memory"); tmp___9 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___9 != 0L) { tmp___8 = atomic_read((atomic_t const *)(& bp->cq_spq_left)); printk("\rbnx2x: [%s:%d(%s)]bp->cq_spq_left %x\n", "bnx2x_sp_event", 1880, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tmp___8); } else { } if ((unsigned int )drv_cmd == 5U && (uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { tmp___10 = constant_test_bit(12L, (unsigned long const volatile *)(& bp->sp_state)); if (tmp___10 != 0) { __asm__ volatile ("": : : "memory"); set_bit(13L, (unsigned long volatile *)(& bp->sp_state)); __asm__ volatile ("sfence": : : "memory"); clear_bit(12L, (unsigned long volatile *)(& bp->sp_state)); __asm__ volatile ("": : : "memory"); bnx2x_schedule_sp_task(bp); } else { } } else { } return; } } irqreturn_t bnx2x_interrupt(int irq , void *dev_instance ) { struct bnx2x *bp ; void *tmp ; u16 status ; u16 tmp___0 ; u16 mask ; int i ; u8 cos ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct bnx2x_fastpath *fp ; struct cnic_ops *c_ops ; struct cnic_ops *________p1 ; struct cnic_ops *_________p1 ; union __anonunion___u_438 __u ; bool __warned ; int tmp___4 ; int tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; { tmp = netdev_priv((struct net_device const *)dev_instance); bp = (struct bnx2x *)tmp; tmp___0 = bnx2x_ack_int(bp); status = tmp___0; tmp___2 = ldv__builtin_expect((unsigned int )status == 0U, 0L); if (tmp___2 != 0L) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 512) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]not our interrupt!\n", "bnx2x_interrupt", 1916, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 512) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got an interrupt status 0x%x\n", "bnx2x_interrupt", 1919, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )status); } else { } i = 0; goto ldv_63185; ldv_63184: fp = bp->fp + (unsigned long )i; mask = (u16 )(2 << ((int )fp->index + (int )bp->cnic_support)); if ((unsigned int )((int )status & (int )mask) != 0U) { cos = 0U; goto ldv_63182; ldv_63181: __builtin_prefetch((void const *)(fp->txdata_ptr[(int )cos])->tx_cons_sb); cos = (u8 )((int )cos + 1); ldv_63182: ; if ((int )fp->max_cos > (int )cos) { goto ldv_63181; } else { } __builtin_prefetch((void const *)fp->sb_running_index); napi_schedule_irqoff(& (bp->fp + (unsigned long )fp->index)->napi); status = (u16 )(~ ((int )((short )mask)) & (int )((short )status)); } else { } i = i + 1; ldv_63185: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_63184; } else { } if ((unsigned int )bp->cnic_support != 0U) { mask = 2U; if ((((unsigned int )mask | 1U) & (unsigned int )status) != 0U) { c_ops = (struct cnic_ops *)0; rcu_read_lock(); __read_once_size((void const volatile *)(& bp->cnic_ops), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned) { tmp___5 = rcu_read_lock_held(); if (tmp___5 == 0) { __warned = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 1946, "suspicious rcu_dereference_check() usage"); } else { } } else { } c_ops = ________p1; if ((unsigned long )c_ops != (unsigned long )((struct cnic_ops *)0) && (bp->cnic_eth_dev.drv_state & 32U) != 0U) { (*(c_ops->cnic_handler))(bp->cnic_data, (void *)0); } else { } rcu_read_unlock(); status = (u16 )(~ ((int )((short )mask)) & (int )((short )status)); } else { } } else { } tmp___6 = ldv__builtin_expect((long )status & 1L, 0L); if (tmp___6 != 0L) { bnx2x_schedule_sp_task(bp); status = (unsigned int )status & 65534U; if ((unsigned int )status == 0U) { return (1); } else { } } else { } tmp___8 = ldv__builtin_expect((unsigned int )status != 0U, 0L); if (tmp___8 != 0L) { tmp___7 = ldv__builtin_expect((bp->msg_enable & 512) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got an unknown interrupt! (status 0x%x)\n", "bnx2x_interrupt", 1970, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )status); } else { } } else { } return (1); } } int bnx2x_acquire_hw_lock(struct bnx2x *bp , u32 resource ) { u32 lock_status ; u32 resource_bit ; int func ; u32 hw_lock_control_reg ; int cnt ; { resource_bit = (u32 )(1 << (int )resource); func = (int )bp->pfid; if (resource > 31U) { printk("\vbnx2x: [%s:%d(%s)]resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n", "bnx2x_acquire_hw_lock", 1992, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", resource, 31); return (-22); } else { } if (func <= 5) { hw_lock_control_reg = (u32 )((func + 5282) * 8); } else { hw_lock_control_reg = (u32 )((func + 5235) * 8); } lock_status = readl((void const volatile *)bp->regview + (unsigned long )hw_lock_control_reg); if ((lock_status & resource_bit) != 0U) { printk("\vbnx2x: [%s:%d(%s)]lock_status 0x%x resource_bit 0x%x\n", "bnx2x_acquire_hw_lock", 2007, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", lock_status, resource_bit); return (-17); } else { } cnt = 0; goto ldv_63209; ldv_63208: writel(resource_bit, (void volatile *)bp->regview + (unsigned long )(hw_lock_control_reg + 4U)); lock_status = readl((void const volatile *)bp->regview + (unsigned long )hw_lock_control_reg); if ((lock_status & resource_bit) != 0U) { return (0); } else { } usleep_range(5000UL, 10000UL); cnt = cnt + 1; ldv_63209: ; if (cnt <= 999) { goto ldv_63208; } else { } printk("\vbnx2x: [%s:%d(%s)]Timeout\n", "bnx2x_acquire_hw_lock", 2021, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-11); } } int bnx2x_release_leader_lock(struct bnx2x *bp ) { int tmp ; int tmp___0 ; { tmp = bnx2x_get_leader_lock_resource(bp); tmp___0 = bnx2x_release_hw_lock(bp, (u32 )tmp); return (tmp___0); } } int bnx2x_release_hw_lock(struct bnx2x *bp , u32 resource ) { u32 lock_status ; u32 resource_bit ; int func ; u32 hw_lock_control_reg ; { resource_bit = (u32 )(1 << (int )resource); func = (int )bp->pfid; if (resource > 31U) { printk("\vbnx2x: [%s:%d(%s)]resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n", "bnx2x_release_hw_lock", 2040, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", resource, 31); return (-22); } else { } if (func <= 5) { hw_lock_control_reg = (u32 )((func + 5282) * 8); } else { hw_lock_control_reg = (u32 )((func + 5235) * 8); } lock_status = readl((void const volatile *)bp->regview + (unsigned long )hw_lock_control_reg); if ((lock_status & resource_bit) == 0U) { printk("\vbnx2x: [%s:%d(%s)]lock_status 0x%x resource_bit 0x%x. Unlock was called but lock wasn\'t taken!\n", "bnx2x_release_hw_lock", 2055, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", lock_status, resource_bit); return (-14); } else { } writel(resource_bit, (void volatile *)bp->regview + (unsigned long )hw_lock_control_reg); return (0); } } int bnx2x_get_gpio(struct bnx2x *bp , int gpio_num , u8 port ) { int gpio_port ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; int gpio_shift ; u32 gpio_mask ; u32 gpio_reg ; int value ; { tmp = readl((void const volatile *)bp->regview + 66452U); if (tmp != 0U) { tmp___0 = readl((void const volatile *)bp->regview + 66456U); if (tmp___0 != 0U) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } gpio_port = tmp___1 ^ (int )port; gpio_shift = (gpio_port != 0 ? 4 : 0) + gpio_num; gpio_mask = (u32 )(1 << gpio_shift); if (gpio_num > 3) { printk("\vbnx2x: [%s:%d(%s)]Invalid GPIO %d\n", "bnx2x_get_gpio", 2075, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", gpio_num); return (-22); } else { } gpio_reg = readl((void const volatile *)bp->regview + 42128U); if ((gpio_reg & gpio_mask) == gpio_mask) { value = 1; } else { value = 0; } return (value); } } int bnx2x_set_gpio(struct bnx2x *bp , int gpio_num , u32 mode , u8 port ) { int gpio_port ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; int gpio_shift ; u32 gpio_mask ; u32 gpio_reg ; unsigned int tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; { tmp = readl((void const volatile *)bp->regview + 66452U); if (tmp != 0U) { tmp___0 = readl((void const volatile *)bp->regview + 66456U); if (tmp___0 != 0U) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } gpio_port = tmp___1 ^ (int )port; gpio_shift = (gpio_port != 0 ? 4 : 0) + gpio_num; gpio_mask = (u32 )(1 << gpio_shift); if (gpio_num > 3) { printk("\vbnx2x: [%s:%d(%s)]Invalid GPIO %d\n", "bnx2x_set_gpio", 2102, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", gpio_num); return (-22); } else { } bnx2x_acquire_hw_lock(bp, 1U); tmp___2 = readl((void const volatile *)bp->regview + 42128U); gpio_reg = tmp___2 & 4278190080U; switch (mode) { case 0U: tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set GPIO %d (shift %d) -> output low\n", "bnx2x_set_gpio", 2114, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", gpio_num, gpio_shift); } else { } gpio_reg = ~ (gpio_mask << 24) & gpio_reg; gpio_reg = (gpio_mask << 16) | gpio_reg; goto ldv_63246; case 1U: tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set GPIO %d (shift %d) -> output high\n", "bnx2x_set_gpio", 2123, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", gpio_num, gpio_shift); } else { } gpio_reg = ~ (gpio_mask << 24) & gpio_reg; gpio_reg = (gpio_mask << 8) | gpio_reg; goto ldv_63246; case 2U: tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set GPIO %d (shift %d) -> input\n", "bnx2x_set_gpio", 2132, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", gpio_num, gpio_shift); } else { } gpio_reg = (gpio_mask << 24) | gpio_reg; goto ldv_63246; default: ; goto ldv_63246; } ldv_63246: writel(gpio_reg, (void volatile *)bp->regview + 42128U); bnx2x_release_hw_lock(bp, 1U); return (0); } } int bnx2x_set_mult_gpio(struct bnx2x *bp , u8 pins , u32 mode ) { u32 gpio_reg ; int rc ; long tmp ; long tmp___0 ; long tmp___1 ; { gpio_reg = 0U; rc = 0; bnx2x_acquire_hw_lock(bp, 1U); gpio_reg = readl((void const volatile *)bp->regview + 42128U); gpio_reg = (u32 )(~ ((int )pins << 24)) & gpio_reg; gpio_reg = (u32 )(~ ((int )pins << 16)) & gpio_reg; gpio_reg = (u32 )(~ ((int )pins << 8)) & gpio_reg; switch (mode) { case 0U: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set GPIO 0x%x -> output low\n", "bnx2x_set_mult_gpio", 2163, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pins); } else { } gpio_reg = (u32 )((int )pins << 16) | gpio_reg; goto ldv_63259; case 1U: tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set GPIO 0x%x -> output high\n", "bnx2x_set_mult_gpio", 2169, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pins); } else { } gpio_reg = (u32 )((int )pins << 8) | gpio_reg; goto ldv_63259; case 2U: tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set GPIO 0x%x -> input\n", "bnx2x_set_mult_gpio", 2175, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pins); } else { } gpio_reg = (u32 )((int )pins << 24) | gpio_reg; goto ldv_63259; default: printk("\vbnx2x: [%s:%d(%s)]Invalid GPIO mode assignment %d\n", "bnx2x_set_mult_gpio", 2181, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", mode); rc = -22; goto ldv_63259; } ldv_63259: ; if (rc == 0) { writel(gpio_reg, (void volatile *)bp->regview + 42128U); } else { } bnx2x_release_hw_lock(bp, 1U); return (rc); } } int bnx2x_set_gpio_int(struct bnx2x *bp , int gpio_num , u32 mode , u8 port ) { int gpio_port ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; int gpio_shift ; u32 gpio_mask ; u32 gpio_reg ; long tmp___2 ; long tmp___3 ; { tmp = readl((void const volatile *)bp->regview + 66452U); if (tmp != 0U) { tmp___0 = readl((void const volatile *)bp->regview + 66456U); if (tmp___0 != 0U) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } gpio_port = tmp___1 ^ (int )port; gpio_shift = (gpio_port != 0 ? 4 : 0) + gpio_num; gpio_mask = (u32 )(1 << gpio_shift); if (gpio_num > 3) { printk("\vbnx2x: [%s:%d(%s)]Invalid GPIO %d\n", "bnx2x_set_gpio_int", 2205, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", gpio_num); return (-22); } else { } bnx2x_acquire_hw_lock(bp, 1U); gpio_reg = readl((void const volatile *)bp->regview + 42132U); switch (mode) { case 0U: tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Clear GPIO INT %d (shift %d) -> output low\n", "bnx2x_set_gpio_int", 2217, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", gpio_num, gpio_shift); } else { } gpio_reg = ~ (gpio_mask << 16) & gpio_reg; gpio_reg = (gpio_mask << 24) | gpio_reg; goto ldv_63275; case 1U: tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set GPIO INT %d (shift %d) -> output high\n", "bnx2x_set_gpio_int", 2226, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", gpio_num, gpio_shift); } else { } gpio_reg = ~ (gpio_mask << 24) & gpio_reg; gpio_reg = (gpio_mask << 16) | gpio_reg; goto ldv_63275; default: ; goto ldv_63275; } ldv_63275: writel(gpio_reg, (void volatile *)bp->regview + 42132U); bnx2x_release_hw_lock(bp, 1U); return (0); } } static int bnx2x_set_spio(struct bnx2x *bp , int spio , u32 mode ) { u32 spio_reg ; unsigned int tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { if (spio != 16 && spio != 32) { printk("\vbnx2x: [%s:%d(%s)]Invalid SPIO 0x%x\n", "bnx2x_set_spio", 2248, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", spio); return (-22); } else { } bnx2x_acquire_hw_lock(bp, 2U); tmp = readl((void const volatile *)bp->regview + 42236U); spio_reg = tmp & 4278190080U; switch (mode) { case 0U: tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set SPIO 0x%x -> output low\n", "bnx2x_set_spio", 2258, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", spio); } else { } spio_reg = (u32 )(~ (spio << 24)) & spio_reg; spio_reg = (u32 )(spio << 16) | spio_reg; goto ldv_63286; case 1U: tmp___1 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set SPIO 0x%x -> output high\n", "bnx2x_set_spio", 2265, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", spio); } else { } spio_reg = (u32 )(~ (spio << 24)) & spio_reg; spio_reg = (u32 )(spio << 8) | spio_reg; goto ldv_63286; case 2U: tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set SPIO 0x%x -> input\n", "bnx2x_set_spio", 2272, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", spio); } else { } spio_reg = (u32 )(spio << 24) | spio_reg; goto ldv_63286; default: ; goto ldv_63286; } ldv_63286: writel(spio_reg, (void volatile *)bp->regview + 42236U); bnx2x_release_hw_lock(bp, 2U); return (0); } } void bnx2x_calc_fc_adv(struct bnx2x *bp ) { u8 cfg_idx ; int tmp ; { tmp = bnx2x_get_link_cfg_idx(bp); cfg_idx = (u8 )tmp; bp->port.advertising[(int )cfg_idx] = bp->port.advertising[(int )cfg_idx] & 4294942719U; switch ((int )bp->link_vars.ieee_fc & 384) { case 384: bp->port.advertising[(int )cfg_idx] = bp->port.advertising[(int )cfg_idx] | 24576U; goto ldv_63295; case 256: bp->port.advertising[(int )cfg_idx] = bp->port.advertising[(int )cfg_idx] | 16384U; goto ldv_63295; default: ; goto ldv_63295; } ldv_63295: ; return; } } static void bnx2x_set_requested_fc(struct bnx2x *bp ) { { if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) && (bp->dev)->mtu > 5000U) { bp->link_params.req_fc_auto_adv = 256U; } else { bp->link_params.req_fc_auto_adv = 768U; } return; } } static void bnx2x_init_dropless_fc(struct bnx2x *bp ) { u32 pause_enabled ; long tmp ; { pause_enabled = 0U; if ((bp->common.chip_id >> 16 != 5710U && (int )bp->dropless_fc) && (unsigned int )bp->link_vars.link_up != 0U) { if (((int )bp->link_vars.flow_ctrl & 256) != 0) { pause_enabled = 1U; } else { } writel(pause_enabled, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 187UL)->base + (unsigned int )(((int )bp->pfid & 1) * (int )(bp->iro_arr + 187UL)->m1)) + 4194304U)); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 36) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]dropless_fc is %s\n", "bnx2x_init_dropless_fc", 2335, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", pause_enabled != 0U ? (char *)"enabled" : (char *)"disabled"); } else { } return; } } int bnx2x_initial_phy_init(struct bnx2x *bp , int load_mode ) { int rc ; int cfx_idx ; int tmp ; u16 req_line_speed ; struct link_params *lp ; struct link_params *lp___0 ; { tmp = bnx2x_get_link_cfg_idx(bp); cfx_idx = tmp; req_line_speed = bp->link_params.req_line_speed[cfx_idx]; if ((bp->flags & 512U) == 0U) { bnx2x_set_requested_fc(bp); bnx2x_acquire_phy_lock(bp); if (load_mode == 2) { lp = & bp->link_params; lp->loopback_mode = 3U; if ((unsigned int )lp->req_line_speed[cfx_idx] <= 19999U) { if ((lp->speed_cap_mask[cfx_idx] & 8388608U) != 0U) { lp->req_line_speed[cfx_idx] = 20000U; } else if ((lp->speed_cap_mask[cfx_idx] & 4194304U) != 0U) { lp->req_line_speed[cfx_idx] = 10000U; } else { lp->req_line_speed[cfx_idx] = 1000U; } } else { } } else { } if (load_mode == 3) { lp___0 = & bp->link_params; lp___0->loopback_mode = 5U; } else { } rc = bnx2x_phy_init(& bp->link_params, & bp->link_vars); bnx2x_release_phy_lock(bp); bnx2x_init_dropless_fc(bp); bnx2x_calc_fc_adv(bp); if ((unsigned int )bp->link_vars.link_up != 0U) { bnx2x_stats_handle(bp, 1); bnx2x_link_report(bp); } else { } queue_delayed_work(bnx2x_wq, & bp->period_task, 0UL); bp->link_params.req_line_speed[cfx_idx] = req_line_speed; return (rc); } else { } printk("\vbnx2x: [%s:%d(%s)]Bootcode is missing - can not initialize link\n", "bnx2x_initial_phy_init", 2387, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } } void bnx2x_link_set(struct bnx2x *bp ) { { if ((bp->flags & 512U) == 0U) { bnx2x_acquire_phy_lock(bp); bnx2x_phy_init(& bp->link_params, & bp->link_vars); bnx2x_release_phy_lock(bp); bnx2x_init_dropless_fc(bp); bnx2x_calc_fc_adv(bp); } else { printk("\vbnx2x: [%s:%d(%s)]Bootcode is missing - can not set link\n", "bnx2x_link_set", 2402, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } return; } } static void bnx2x__link_reset(struct bnx2x *bp ) { { if ((bp->flags & 512U) == 0U) { bnx2x_acquire_phy_lock(bp); bnx2x_lfa_reset(& bp->link_params, & bp->link_vars); bnx2x_release_phy_lock(bp); } else { printk("\vbnx2x: [%s:%d(%s)]Bootcode is missing - can not reset link\n", "bnx2x__link_reset", 2412, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } return; } } void bnx2x_force_link_reset(struct bnx2x *bp ) { { bnx2x_acquire_phy_lock(bp); bnx2x_link_reset(& bp->link_params, & bp->link_vars, 1); bnx2x_release_phy_lock(bp); return; } } u8 bnx2x_link_test(struct bnx2x *bp , u8 is_serdes ) { u8 rc ; int tmp ; { rc = 0U; if ((bp->flags & 512U) == 0U) { bnx2x_acquire_phy_lock(bp); tmp = bnx2x_test_link(& bp->link_params, & bp->link_vars, (int )is_serdes); rc = (u8 )tmp; bnx2x_release_phy_lock(bp); } else { printk("\vbnx2x: [%s:%d(%s)]Bootcode is missing - can not test link\n", "bnx2x_link_test", 2432, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } return (rc); } } static void bnx2x_calc_vn_min(struct bnx2x *bp , struct cmng_init_input *input ) { int all_zero ; int vn ; u32 vn_cfg ; u32 vn_min_rate ; long tmp ; long tmp___0 ; { all_zero = 1; vn = 0; goto ldv_63342; ldv_63341: vn_cfg = bp->mf_config[vn]; vn_min_rate = ((vn_cfg & 16711680U) >> 16) * 100U; if ((int )vn_cfg & 1) { vn_min_rate = 0U; } else if (vn_min_rate == 0U) { vn_min_rate = 100U; } else { all_zero = 0; } input->vnic_min_rate[vn] = (u16 )vn_min_rate; vn = vn + 1; ldv_63342: ; if (((unsigned int )bp->common.chip_port_mode == 0U ? 2 : 4) > vn) { goto ldv_63341; } else { } if ((unsigned int )bp->dcb_state == 1U && bp->dcbx_port_params.ets.enabled != 0U) { input->flags.cmng_enables = input->flags.cmng_enables & 4294967294U; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Fairness will be disabled due to ETS\n", "bnx2x_calc_vn_min", 2473, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else if (all_zero != 0) { input->flags.cmng_enables = input->flags.cmng_enables & 4294967294U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]All MIN values are zeroes fairness will be disabled\n", "bnx2x_calc_vn_min", 2478, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { input->flags.cmng_enables = input->flags.cmng_enables | 1U; } return; } } static void bnx2x_calc_vn_max(struct bnx2x *bp , int vn , struct cmng_init_input *input ) { u16 vn_max_rate ; u32 vn_cfg ; u32 maxCfg ; u16 tmp ; long tmp___0 ; { vn_cfg = bp->mf_config[vn]; if ((int )vn_cfg & 1) { vn_max_rate = 0U; } else { tmp = bnx2x_extract_max_cfg(bp, vn_cfg); maxCfg = (u32 )tmp; if ((unsigned int )bp->mf_mode == 2U) { vn_max_rate = (u16 )(((u32 )bp->link_vars.line_speed * maxCfg) / 100U); } else { vn_max_rate = (unsigned int )((u16 )maxCfg) * 100U; } } tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]vn %d: vn_max_rate %d\n", "bnx2x_calc_vn_max", 2503, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vn, (int )vn_max_rate); } else { } input->vnic_max_rate[vn] = vn_max_rate; return; } } static int bnx2x_get_cmng_fns_mode(struct bnx2x *bp ) { { if ((bp->common.chip_id & 61440U) > 20480U) { return (0); } else { } if ((unsigned int )bp->mf_mode != 0U) { return (1); } else { } return (0); } } void bnx2x_read_mf_cfg(struct bnx2x *bp ) { int vn ; int n ; int func ; long tmp ; long tmp___0 ; { n = (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1; if ((bp->flags & 512U) != 0U) { return; } else { } vn = 0; goto ldv_63365; ldv_63364: func = (vn * 2 + ((int )bp->pfid & 1)) * n + (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); if (func > 7) { goto ldv_63363; } else { } bp->mf_config[vn] = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 36UL))); vn = vn + 1; ldv_63365: ; if (((unsigned int )bp->common.chip_port_mode == 0U ? 2 : 4) > vn) { goto ldv_63364; } else { } ldv_63363: ; if ((bp->mf_config[(int )bp->pfid >> 1] & 8U) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]mf_cfg function disabled\n", "bnx2x_read_mf_cfg", 2546, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->flags = bp->flags | 2048U; } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]mf_cfg function enabled\n", "bnx2x_read_mf_cfg", 2549, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->flags = bp->flags & 4294965247U; } return; } } static void bnx2x_cmng_fns_init(struct bnx2x *bp , u8 read_cfg , u8 cmng_type ) { struct cmng_init_input input ; int vn ; long tmp ; { memset((void *)(& input), 0, 44UL); input.port_rate = (u32 )bp->link_vars.line_speed; if ((unsigned int )cmng_type == 1U && input.port_rate != 0U) { if ((unsigned int )read_cfg != 0U) { bnx2x_read_mf_cfg(bp); } else { } bnx2x_calc_vn_min(bp, & input); if (bp->port.pmf != 0U) { vn = 0; goto ldv_63375; ldv_63374: bnx2x_calc_vn_max(bp, vn, & input); vn = vn + 1; ldv_63375: ; if (((unsigned int )bp->common.chip_port_mode == 0U ? 2 : 4) > vn) { goto ldv_63374; } else { } } else { } input.flags.cmng_enables = input.flags.cmng_enables | 2U; bnx2x_init_cmng((struct cmng_init_input const *)(& input), & bp->cmng); return; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]rate shaping and fairness are disabled\n", "bnx2x_cmng_fns_init", 2586, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static void storm_memset_cmng(struct bnx2x *bp , struct cmng_init *cmng , u8 port ) { int vn ; size_t size ; u32 addr ; int func ; int tmp ; { size = 72UL; addr = ((unsigned int )(bp->iro_arr + 43UL)->base + (unsigned int )((int )port * (int )(bp->iro_arr + 43UL)->m1)) + 4325376U; __storm_memset_struct(bp, addr, size, (u32 *)(& cmng->port)); vn = 0; goto ldv_63388; ldv_63387: tmp = func_by_vn(bp, vn); func = tmp; addr = ((unsigned int )(bp->iro_arr + 44UL)->base + (unsigned int )((int )(bp->iro_arr + 44UL)->m1 * func)) + 4325376U; size = 8UL; __storm_memset_struct(bp, addr, size, (u32 *)(& cmng->vnic.vnic_max_rate) + (unsigned long )vn); addr = ((unsigned int )(bp->iro_arr + 45UL)->base + (unsigned int )((int )(bp->iro_arr + 45UL)->m1 * func)) + 4325376U; size = 24UL; __storm_memset_struct(bp, addr, size, (u32 *)(& cmng->vnic.vnic_min_rate) + (unsigned long )vn); vn = vn + 1; ldv_63388: ; if (((unsigned int )bp->common.chip_port_mode == 0U ? 2 : 4) > vn) { goto ldv_63387; } else { } return; } } void bnx2x_set_local_cmng(struct bnx2x *bp ) { int cmng_fns ; int tmp ; long tmp___0 ; { tmp = bnx2x_get_cmng_fns_mode(bp); cmng_fns = tmp; if (cmng_fns != 0) { bnx2x_cmng_fns_init(bp, 0, (int )((u8 )cmng_fns)); storm_memset_cmng(bp, & bp->cmng, (int )bp->pfid & 1); } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]single function mode without fairness\n", "bnx2x_set_local_cmng", 2629, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } return; } } static void bnx2x_link_attn(struct bnx2x *bp ) { struct host_port_stats *pstats ; { bnx2x_stats_handle(bp, 3); bnx2x_link_update(& bp->link_params, & bp->link_vars); bnx2x_init_dropless_fc(bp); if ((unsigned int )bp->link_vars.link_up != 0U) { if ((unsigned int )bp->link_vars.mac_type != 1U) { pstats = & (bp->slowpath)->port_stats; memset((void *)(& pstats->mac_stx), 0, 304UL); } else { } if ((unsigned int )bp->state == 12288U) { bnx2x_stats_handle(bp, 1); } else { } } else { } if ((unsigned int )bp->link_vars.link_up != 0U && (unsigned int )bp->link_vars.line_speed != 0U) { bnx2x_set_local_cmng(bp); } else { } __bnx2x_link_report(bp); if ((unsigned int )bp->mf_mode != 0U) { bnx2x_link_sync_notify(bp); } else { } return; } } void bnx2x__link_status_update(struct bnx2x *bp ) { { if ((unsigned int )bp->state != 12288U) { return; } else { } if ((bp->flags & 4194304U) == 0U) { bnx2x_dcbx_pmf_update(bp); bnx2x_link_status_update(& bp->link_params, & bp->link_vars); if ((unsigned int )bp->link_vars.link_up != 0U) { bnx2x_stats_handle(bp, 1); } else { bnx2x_stats_handle(bp, 3); } bnx2x_link_report(bp); } else { bp->port.supported[0] = bp->port.supported[0] | 62703U; bp->port.advertising[0] = bp->port.supported[0]; bp->link_params.bp = bp; bp->link_params.port = (unsigned int )bp->pfid & 1U; bp->link_params.req_duplex[0] = 1U; bp->link_params.req_flow_ctrl[0] = 1024U; bp->link_params.req_line_speed[0] = 10000U; bp->link_params.speed_cap_mask[0] = 8323072U; bp->link_params.switch_cfg = 16777216U; bp->link_vars.mac_type = 2U; bp->link_vars.line_speed = 10000U; bp->link_vars.link_status = 21U; bp->link_vars.link_up = 1U; bp->link_vars.duplex = 1U; bp->link_vars.flow_ctrl = 1024U; __bnx2x_link_report(bp); bnx2x_sample_bulletin(bp); bnx2x_stats_handle(bp, 1); } return; } } static int bnx2x_afex_func_update(struct bnx2x *bp , u16 vifid , u16 vlan_val , u8 allowed_prio ) { struct bnx2x_func_state_params func_params ; struct bnx2x_func_afex_update_params *f_update_params ; int tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; f_update_params = & func_params.params.afex_update; func_params.f_obj = & bp->func_obj; func_params.cmd = 4; f_update_params->vif_id = vifid; f_update_params->afex_default_vlan = vlan_val; f_update_params->allowed_priorities = allowed_prio; tmp = bnx2x_func_state_change(bp, & func_params); if (tmp < 0) { bnx2x_fw_command(bp, 3556769792U, 0U); } else { } return (0); } } static int bnx2x_afex_handle_vif_list_cmd(struct bnx2x *bp , u8 cmd_type , u16 vif_index , u8 func_bit_map ) { struct bnx2x_func_state_params func_params ; struct bnx2x_func_afex_viflists_params *update_params ; int rc ; u32 drv_msg_code ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; update_params = & func_params.params.afex_viflists; if ((unsigned int )cmd_type != 1U && (unsigned int )cmd_type != 0U) { printk("\vbnx2x: [%s:%d(%s)]BUG! afex_handle_vif_list_cmd invalid type 0x%x\n", "bnx2x_afex_handle_vif_list_cmd", 2762, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cmd_type); } else { } func_params.f_obj = & bp->func_obj; func_params.cmd = 5; update_params->afex_vif_list_command = cmd_type; update_params->vif_list_index = vif_index; update_params->func_bit_map = (unsigned int )cmd_type != 1U ? func_bit_map : 0U; update_params->func_to_clear = 0U; drv_msg_code = (unsigned int )cmd_type == 1U ? 3506438144U : 3523215360U; rc = bnx2x_func_state_change(bp, & func_params); if (rc < 0) { bnx2x_fw_command(bp, drv_msg_code, 0U); } else { } return (0); } } static void bnx2x_handle_afex_cmd(struct bnx2x *bp , u32 cmd ) { struct afex_stats afex_stats ; u32 func ; u32 mf_config ; u16 vlan_val ; u32 vlan_prio ; u16 vif_id ; u8 allowed_prio ; u8 vlan_mode ; u32 addr_to_write ; u32 vifid ; u32 addrs ; u32 stats_type ; u32 i ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; struct cmng_init_input cmng_input ; struct rate_shaping_vars_per_vn m_rs_vn ; size_t size ; u32 addr ; unsigned int tmp___3 ; unsigned int tmp___4 ; unsigned int tmp___5 ; unsigned int tmp___6 ; int tmp___7 ; { func = (u32 )bp->pf_num; if ((cmd & 1048576U) != 0U) { vifid = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 34UL) * 4UL))); tmp = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]afex: got MCP req LISTGET_REQ for vifid 0x%x\n", "bnx2x_handle_afex_cmd", 2803, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vifid); } else { } bnx2x_afex_handle_vif_list_cmd(bp, 1, (int )((u16 )vifid), 0); } else { } if ((cmd & 2097152U) != 0U) { vifid = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 34UL) * 4UL))); addrs = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 38UL) * 4UL))); tmp___0 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]afex: got MCP req LISTSET_REQ for vifid 0x%x addrs 0x%x\n", "bnx2x_handle_afex_cmd", 2812, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vifid, addrs); } else { } bnx2x_afex_handle_vif_list_cmd(bp, 0, (int )((u16 )vifid), (int )((u8 )addrs)); } else { } if ((cmd & 4194304U) != 0U) { addr_to_write = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 30UL) * 4UL))); stats_type = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 34UL) * 4UL))); tmp___1 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]afex: got MCP req STATSGET_REQ, write to addr 0x%x\n", "bnx2x_handle_afex_cmd", 2825, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", addr_to_write); } else { } bnx2x_afex_collect_stats(bp, (void *)(& afex_stats), stats_type); i = 0U; goto ldv_63440; ldv_63439: writel(*((u32 *)(& afex_stats) + (unsigned long )i), (void volatile *)(bp->regview + ((unsigned long )addr_to_write + (unsigned long )i * 4UL))); i = i + 1U; ldv_63440: ; if (i <= 31U) { goto ldv_63439; } else { } bnx2x_fw_command(bp, 3539992576U, 0U); } else { } if ((cmd & 8388608U) != 0U) { mf_config = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 36UL))); bp->mf_config[(int )bp->pfid >> 1] = mf_config; tmp___2 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]afex: got MCP req VIFSET_REQ, mf_config 0x%x\n", "bnx2x_handle_afex_cmd", 2843, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", mf_config); } else { } if ((mf_config & 8U) == 0U) { size = 8UL; addr = ((unsigned int )(bp->iro_arr + 44UL)->base + (unsigned int )((int )bp->pfid * (int )(bp->iro_arr + 44UL)->m1)) + 4325376U; bp->mf_config[(int )bp->pfid >> 1] = mf_config; bnx2x_calc_vn_max(bp, (int )bp->pfid >> 1, & cmng_input); m_rs_vn.vn_counter.rate = cmng_input.vnic_max_rate[(int )bp->pfid >> 1]; m_rs_vn.vn_counter.quota = (u32 )(((int )m_rs_vn.vn_counter.rate * 400) / 8); __storm_memset_struct(bp, addr, size, (u32 *)(& m_rs_vn)); tmp___3 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 48UL))); vif_id = (u16 )tmp___3; tmp___4 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 48UL))); vlan_val = (u16 )((tmp___4 & 268369920U) >> 16); vlan_prio = (mf_config & 768U) >> 8; vlan_val = ((int )((u16 )vlan_prio) << 13U) | (int )vlan_val; tmp___5 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 52UL))); vlan_mode = (u8 )((tmp___5 & 983040U) >> 16); tmp___6 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 52UL))); allowed_prio = (u8 )tmp___6; tmp___7 = bnx2x_afex_func_update(bp, (int )vif_id, (int )vlan_val, (int )allowed_prio); if (tmp___7 != 0) { return; } else { } bp->afex_def_vlan_tag = (int )vlan_val; bp->afex_vlan_mode = (enum mf_cfg_afex_vlan_mode )vlan_mode; } else { bnx2x_link_report(bp); bnx2x_afex_func_update(bp, 65535, 0, 0); bp->afex_def_vlan_tag = -1; } } else { } return; } } static void bnx2x_handle_update_svid_cmd(struct bnx2x *bp ) { struct bnx2x_func_switch_update_params *switch_update_params ; struct bnx2x_func_state_params func_params ; int func ; u32 val ; unsigned int tmp ; int tmp___0 ; long tmp___1 ; { memset((void *)(& func_params), 0, 64UL); switch_update_params = & func_params.params.switch_update; func_params.f_obj = & bp->func_obj; func_params.cmd = 8; if ((unsigned int )bp->mf_mode == 1U && (unsigned int )bp->mf_sub_mode == 1U) { func = (int )bp->pf_num; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 48UL))); val = tmp & 65535U; if (val != 65535U) { bp->mf_ov = (u16 )val; } else { printk("\vbnx2x: [%s:%d(%s)]Got an SVID event, but no tag is configured in shmem\n", "bnx2x_handle_update_svid_cmd", 2929, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); goto fail; } writel((unsigned int )bp->mf_ov, (void volatile *)bp->regview + (unsigned long )((((int )bp->pfid & 1) + 11296) * 8)); __set_bit(2L, (unsigned long volatile *)(& switch_update_params->changes)); switch_update_params->vlan = bp->mf_ov; tmp___0 = bnx2x_func_state_change(bp, & func_params); if (tmp___0 < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to configure FW of S-tag Change to %02x\n", "bnx2x_handle_update_svid_cmd", 2944, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->mf_ov); goto fail; } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Configured S-tag %02x\n", "bnx2x_handle_update_svid_cmd", 2948, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->mf_ov); } else { } bnx2x_fw_command(bp, 196608U, 0U); return; } else { } fail: bnx2x_fw_command(bp, 262144U, 0U); return; } } static void bnx2x_pmf_update(struct bnx2x *bp ) { int port ; u32 val ; long tmp ; { port = (int )bp->pfid & 1; bp->port.pmf = 1U; tmp = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]pmf %d\n", "bnx2x_pmf_update", 2966, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->port.pmf); } else { } __asm__ volatile ("mfence": : : "memory"); queue_delayed_work(bnx2x_wq, & bp->period_task, 0UL); bnx2x_dcbx_pmf_update(bp); val = (u32 )((1 << (((int )bp->pfid >> 1) + 4)) | 65295); if ((unsigned int )bp->common.int_block == 0U) { writel(val, (void volatile *)bp->regview + (unsigned long )(port * 8 + 1081412)); writel(val, (void volatile *)bp->regview + (unsigned long )((port + 135176) * 8)); } else if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(val, (void volatile *)bp->regview + 1245444U); writel(val, (void volatile *)bp->regview + 1245492U); } else { } bnx2x_stats_handle(bp, 0); return; } } u32 bnx2x_fw_command(struct bnx2x *bp , u32 command , u32 param ) { int mb_idx ; u32 seq ; u32 rc ; u32 cnt ; u8 delay ; long tmp ; u32 tmp___0 ; long tmp___1 ; { mb_idx = ((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1); rc = 0U; cnt = 1U; delay = (bp->common.chip_id & 61440U) > 20480U ? 100U : 10U; mutex_lock_nested(& bp->fw_mb_mutex, 0U); bp->fw_seq = (u16 )((int )bp->fw_seq + 1); seq = (u32 )bp->fw_seq; writel(param, (void volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )mb_idx * 44UL) + 1672UL))); writel(command | seq, (void volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )mb_idx * 44UL) + 1668UL))); tmp = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]wrote command (%x) to FW MB param 0x%08x\n", "bnx2x_fw_command", 3015, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", command | seq, param); } else { } ldv_63472: msleep((unsigned int )delay); rc = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )mb_idx * 44UL) + 1676UL))); if ((rc & 65535U) != seq) { tmp___0 = cnt; cnt = cnt + 1U; if (tmp___0 <= 499U) { goto ldv_63472; } else { goto ldv_63473; } } else { } ldv_63473: tmp___1 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)][after %d ms] read (%x) seq is (%x) from FW MB\n", "bnx2x_fw_command", 3027, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (u32 )delay * cnt, rc, seq); } else { } if ((rc & 65535U) == seq) { rc = rc & 4294901760U; } else { printk("\vbnx2x: [%s:%d(%s)]FW failed to respond!\n", "bnx2x_fw_command", 3034, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_fw_dump(bp); rc = 0U; } mutex_unlock(& bp->fw_mb_mutex); return (rc); } } static void storm_memset_func_cfg(struct bnx2x *bp , struct tstorm_eth_function_common_config *tcfg , u16 abs_fid ) { size_t size ; u32 addr ; { size = 8UL; addr = ((unsigned int )(bp->iro_arr + 205UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 205UL)->m1)) + 4390912U; __storm_memset_struct(bp, addr, size, (u32 *)tcfg); return; } } void bnx2x_func_init(struct bnx2x *bp , struct bnx2x_func_init_params *p ) { struct tstorm_eth_function_common_config tcfg ; { if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { tcfg.config_flags = 0U; tcfg.rss_result_mask = (unsigned char)0; tcfg.reserved1 = (unsigned char)0; tcfg.vlan_id[0] = (unsigned short)0; tcfg.vlan_id[1] = (unsigned short)0; storm_memset_func_cfg(bp, & tcfg, (int )p->func_id); } else { } storm_memset_vf_to_pf(bp, (int )p->func_id, (int )p->pf_id); storm_memset_func_en(bp, (int )p->func_id, 1); if (((int )p->func_flgs & 16) != 0) { storm_memset_spq_addr(bp, p->spq_map, (int )p->func_id); writel((unsigned int )p->spq_prod, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 31UL)->base + (unsigned int )((int )p->func_id * (int )(bp->iro_arr + 31UL)->m1)) + 2752512U)); } else { } return; } } static unsigned long bnx2x_get_common_flags(struct bnx2x *bp , struct bnx2x_fastpath *fp , bool zero_stats ) { unsigned long flags ; { flags = 0UL; __set_bit(5L, (unsigned long volatile *)(& flags)); __set_bit(3L, (unsigned long volatile *)(& flags)); if ((int )zero_stats) { __set_bit(4L, (unsigned long volatile *)(& flags)); } else { } if ((bp->flags & 262144U) != 0U) { __set_bit(16L, (unsigned long volatile *)(& flags)); } else { } __set_bit(22L, (unsigned long volatile *)(& flags)); __set_bit(23L, (unsigned long volatile *)(& flags)); return (flags); } } static unsigned long bnx2x_get_q_flags(struct bnx2x *bp , struct bnx2x_fastpath *fp , bool leading ) { unsigned long flags ; unsigned long tmp ; { flags = 0UL; if ((unsigned int )bp->mf_mode == 1U) { __set_bit(6L, (unsigned long volatile *)(& flags)); } else { } if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { __set_bit(12L, (unsigned long volatile *)(& flags)); __set_bit(20L, (unsigned long volatile *)(& flags)); } else { } if ((unsigned int )fp->mode != 0U) { __set_bit(0L, (unsigned long volatile *)(& flags)); __set_bit(1L, (unsigned long volatile *)(& flags)); if ((unsigned int )fp->mode == 2U) { __set_bit(2L, (unsigned long volatile *)(& flags)); } else { } } else { } if ((int )leading) { __set_bit(13L, (unsigned long volatile *)(& flags)); __set_bit(14L, (unsigned long volatile *)(& flags)); } else { } __set_bit(7L, (unsigned long volatile *)(& flags)); if ((unsigned int )bp->mf_mode == 3U) { __set_bit(19L, (unsigned long volatile *)(& flags)); } else { } tmp = bnx2x_get_common_flags(bp, fp, 1); return (tmp | flags); } } static void bnx2x_pf_q_prep_general(struct bnx2x *bp , struct bnx2x_fastpath *fp , struct bnx2x_general_setup_params *gen_init , u8 cos ) { { gen_init->stat_id = bnx2x_stats_id(fp); gen_init->spcl_id = fp->cl_id; if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { gen_init->mtu = 2500U; } else { gen_init->mtu = (u16 )(bp->dev)->mtu; } gen_init->cos = cos; gen_init->fp_hsi = 2U; return; } } static void bnx2x_pf_rx_q_prep(struct bnx2x *bp , struct bnx2x_fastpath *fp , struct rxq_pause_params *pause , struct bnx2x_rxq_setup_params *rxq_init ) { u8 max_sge ; u16 sge_sz ; u16 tpa_agg_size ; int __ret_warn_on ; long tmp ; u32 __min1 ; u32 __min1___0 ; u32 __min2 ; u32 __min2___0 ; u32 __min1___1 ; u32 __min2___1 ; int __ret_warn_on___0 ; long tmp___0 ; int __ret_warn_on___1 ; long tmp___1 ; int _max1 ; int _max2 ; int _min1 ; int _min2 ; u64 __max1 ; int _max1___0 ; int _max2___0 ; int _min1___0 ; int _min2___0 ; u64 __max2 ; int _max1___1 ; int _max2___1 ; int _min1___1 ; int _min2___1 ; { max_sge = 0U; sge_sz = 0U; tpa_agg_size = 0U; if ((unsigned int )fp->mode != 0U) { pause->sge_th_lo = ((bp->common.chip_id >> 16 == 5710U ? 32U : 64U) + (unsigned int )((u16 )(((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024 : 512) - (bp->common.chip_id >> 16 == 5710U ? 32 : 64)) / 2))) + (unsigned int )((u16 )(((unsigned long )((bp->common.chip_id >> 16 == 5710U ? 32 : 64) + ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024 : 512) - (bp->common.chip_id >> 16 == 5710U ? 32 : 64)) / 2) + 509UL) / 510UL)) * 2U; pause->sge_th_hi = (((bp->common.chip_id >> 16 == 5710U ? 32U : 64U) + (unsigned int )((u16 )(((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024 : 512) - (bp->common.chip_id >> 16 == 5710U ? 32 : 64)) / 2))) + (unsigned int )((u16 )(((unsigned long )((bp->common.chip_id >> 16 == 5710U ? 32 : 64) + ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024 : 512) - (bp->common.chip_id >> 16 == 5710U ? 32 : 64)) / 2) + 509UL) / 510UL)) * 2U) + 100U; __ret_warn_on = (int )bp->dropless_fc && (unsigned int )((int )pause->sge_th_hi + 16) > 1020U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 3186); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __min1___0 = 8U; __min2 = 17U; __min1 = (__min1___0 < __min2 ? __min1___0 : __min2) * 4096U; __min2___0 = 65535U; tpa_agg_size = (u16 )(__min1 < __min2___0 ? __min1 : __min2___0); max_sge = (u8 )(((bp->dev)->mtu + 4095U) >> 12); max_sge = max_sge; __min1___1 = 4096U; __min2___1 = 65535U; sge_sz = (unsigned short )(__min1___1 < __min2___1 ? __min1___1 : __min2___1); } else { } if (bp->common.chip_id >> 16 != 5710U) { pause->bd_th_lo = ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U); pause->bd_th_hi = (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 100U; pause->rcq_th_lo = ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 17U : 9U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U); pause->rcq_th_hi = (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 17U : 9U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 100U; __ret_warn_on___0 = (int )bp->dropless_fc && (int )pause->bd_th_hi + 16 > bp->rx_ring_size; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 3209); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); __ret_warn_on___1 = (int )bp->dropless_fc && (unsigned int )((int )pause->rcq_th_hi + 16) > 4032U; tmp___1 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 3212); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); pause->pri_map = 1U; } else { } rxq_init->dscr_map = fp->rx_desc_mapping; rxq_init->sge_map = fp->rx_sge_mapping; rxq_init->rcq_map = fp->rx_comp_mapping; rxq_init->rcq_np_map = fp->rx_comp_mapping + 4096ULL; _max1 = 6; _min1 = 8; _min2 = 6; _max2 = _min1 < _min2 ? _min1 : _min2; _max1___0 = 6; _min1___0 = 8; _min2___0 = 6; _max2___0 = _min1___0 < _min2___0 ? _min1___0 : _min2___0; __max1 = (u64 )(1UL << (_max1___0 > _max2___0 ? _max1___0 : _max2___0)); __max2 = 320ULL; rxq_init->buf_sz = (unsigned int )(((int )((u16 )fp->rx_buf_size) - (int )((u16 )(1UL << (_max1 > _max2 ? _max1 : _max2)))) - (int )((u16 )(__max1 > __max2 ? __max1 : __max2))) - 2U; rxq_init->cl_qzone_id = fp->cl_qzone_id; rxq_init->tpa_agg_sz = tpa_agg_size; rxq_init->sge_buf_sz = sge_sz; rxq_init->max_sges_pkt = max_sge; rxq_init->rss_engine_id = bp->pfid; rxq_init->mcast_engine_id = bp->pfid; rxq_init->max_tpa_queues = bp->common.chip_id >> 16 == 5710U ? 32U : 64U; _max1___1 = 6; _min1___1 = 8; _min2___1 = 6; _max2___1 = _min1___1 < _min2___1 ? _min1___1 : _min2___1; rxq_init->cache_line_log = (u8 )(_max1___1 > _max2___1 ? _max1___1 : _max2___1); rxq_init->fw_sb_id = fp->fw_sb_id; if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { rxq_init->sb_cq_index = 4U; } else { rxq_init->sb_cq_index = 1U; } if ((unsigned int )bp->mf_mode == 3U) { rxq_init->silent_removal_value = (u16 )bp->afex_def_vlan_tag; rxq_init->silent_removal_mask = 4095U; } else { } return; } } static void bnx2x_pf_tx_q_prep(struct bnx2x *bp , struct bnx2x_fastpath *fp , struct bnx2x_txq_setup_params *txq_init , u8 cos ) { { txq_init->dscr_map = (fp->txdata_ptr[(int )cos])->tx_desc_mapping; txq_init->sb_cq_index = (unsigned int )cos + 5U; txq_init->traffic_type = 0U; txq_init->fw_sb_id = fp->fw_sb_id; txq_init->tss_leading_cl_id = (bp->fp)->cl_id; if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { txq_init->sb_cq_index = 6U; txq_init->traffic_type = 1U; } else { } return; } } static void bnx2x_pf_init(struct bnx2x *bp ) { struct bnx2x_func_init_params func_init ; struct event_ring_data eq_data ; u16 flags ; int tmp ; { func_init.fw_stat_map = 0ULL; func_init.spq_map = 0ULL; func_init.func_flgs = (unsigned short)0; func_init.func_id = (unsigned short)0; func_init.pf_id = (unsigned short)0; func_init.spq_prod = (unsigned short)0; eq_data.base_addr.lo = 0U; eq_data.base_addr.hi = 0U; eq_data.producer = (unsigned short)0; eq_data.sb_id = (unsigned char)0; eq_data.index_id = (unsigned char)0; eq_data.reserved0 = 0U; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(0U, (void volatile *)bp->regview + (unsigned long )((unsigned int )bp->common.chip_port_mode == 0U ? ((int )bp->pfid + 311872) * 4 : (((int )bp->pfid >> 1) + 311872) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )((unsigned int )bp->common.chip_port_mode == 0U ? ((int )bp->pfid + 311876) * 4 : (((int )bp->pfid >> 1) + 311876) * 4)); } else { } flags = 50U; flags = (u16 )((((bp->dev)->features & 32768ULL) != 0ULL ? 8 : 0) | (int )((short )flags)); func_init.func_flgs = flags; func_init.pf_id = (u16 )bp->pfid; func_init.func_id = (u16 )bp->pfid; func_init.spq_map = bp->spq_mapping; func_init.spq_prod = bp->spq_prod_idx; bnx2x_func_init(bp, & func_init); memset((void *)(& bp->cmng), 0, 72UL); bp->link_vars.line_speed = 10000U; tmp = bnx2x_get_cmng_fns_mode(bp); bnx2x_cmng_fns_init(bp, 1, (int )((u8 )tmp)); if (bp->port.pmf != 0U) { storm_memset_cmng(bp, & bp->cmng, (int )bp->pfid & 1); } else { } eq_data.base_addr.hi = (unsigned int )(bp->eq_mapping >> 32); eq_data.base_addr.lo = (unsigned int )bp->eq_mapping; eq_data.producer = bp->eq_prod; eq_data.index_id = 7U; eq_data.sb_id = 222U; storm_memset_eq_data(bp, & eq_data, (int )bp->pfid); return; } } static void bnx2x_e1h_disable(struct bnx2x *bp ) { int port ; { port = (int )bp->pfid & 1; bnx2x_tx_disable(bp); writel(0U, (void volatile *)bp->regview + (unsigned long )(port * 8 + 90364)); return; } } static void bnx2x_e1h_enable(struct bnx2x *bp ) { int port ; { port = (int )bp->pfid & 1; if (((unsigned int )bp->mf_mode != 1U || (unsigned int )bp->mf_sub_mode != 1U) || (bp->mf_config[(int )bp->pfid >> 1] & 6U) != 0U) { writel(1U, (void volatile *)bp->regview + (unsigned long )(port * 8 + 90364)); } else { } netif_tx_wake_all_queues(bp->dev); return; } } static void bnx2x_drv_info_ether_stat(struct bnx2x *bp ) { struct eth_stats_info *ether_stat ; struct bnx2x_vlan_mac_obj *mac_obj ; int i ; { ether_stat = & (bp->slowpath)->drv_info_to_mcp.ether_stat; mac_obj = & (bp->sp_objs)->mac_obj; strlcpy((char *)(& ether_stat->version), "1.710.51-0", 12UL); i = 0; goto ldv_63585; ldv_63584: memset((void *)(& ether_stat->mac_local) + (unsigned long )i, 0, 1UL); i = i + 1; ldv_63585: ; if (i <= 2) { goto ldv_63584; } else { } (*(mac_obj->get_n_elements))(bp, & (bp->sp_objs)->mac_obj, 3, (u8 *)(& ether_stat->mac_local) + 2UL, 2, 6); ether_stat->mtu_size = (bp->dev)->mtu; if (((bp->dev)->features & 17179869184ULL) != 0ULL) { ether_stat->feature_flags = ether_stat->feature_flags | 1U; } else { } if (((bp->dev)->features & 65536ULL) != 0ULL) { ether_stat->feature_flags = ether_stat->feature_flags | 2U; } else { } ether_stat->feature_flags = ether_stat->feature_flags | bp->common.boot_mode; ether_stat->promiscuous_mode = ((bp->dev)->flags & 256U) != 0U; ether_stat->txq_size = (u32 )bp->tx_ring_size; ether_stat->rxq_size = (u32 )bp->rx_ring_size; ether_stat->vf_cnt = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) ? (u32 )(bp->vfdb)->sriov.nr_virtfn : 0U; return; } } static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp ) { struct bnx2x_dcbx_app_params *app ; struct fcoe_stats_info *fcoe_stat ; struct tstorm_per_queue_stats *fcoe_q_tstorm_stats ; struct xstorm_per_queue_stats *fcoe_q_xstorm_stats ; struct fcoe_statistics_params *fw_fcoe_stat ; { app = & bp->dcbx_port_params.app; fcoe_stat = & (bp->slowpath)->drv_info_to_mcp.fcoe_stat; if (! bp->cnic_loaded) { return; } else { } memcpy((void *)(& fcoe_stat->mac_local) + 2U, (void const *)(& bp->fip_mac), 6UL); fcoe_stat->qos_priority = app->traffic_type_priority[1]; if ((bp->flags & 32768U) == 0U) { fcoe_q_tstorm_stats = & (bp->fw_stats_data)->queue_stats[(uint )bp->num_queues - bp->num_cnic_queues].tstorm_queue_statistics; fcoe_q_xstorm_stats = & (bp->fw_stats_data)->queue_stats[(uint )bp->num_queues - bp->num_cnic_queues].xstorm_queue_statistics; fw_fcoe_stat = & (bp->fw_stats_data)->fcoe; fcoe_stat->rx_bytes_lo = fcoe_stat->rx_bytes_lo + fw_fcoe_stat->rx_stat0.fcoe_rx_byte_cnt; fcoe_stat->rx_bytes_hi = fcoe_stat->rx_bytes_hi + (fcoe_stat->rx_bytes_lo < fw_fcoe_stat->rx_stat0.fcoe_rx_byte_cnt ? 1U : 0U); fcoe_stat->rx_bytes_lo = fcoe_stat->rx_bytes_lo + fcoe_q_tstorm_stats->rcv_ucast_bytes.lo; fcoe_stat->rx_bytes_hi = fcoe_stat->rx_bytes_hi + (fcoe_q_tstorm_stats->rcv_ucast_bytes.hi + (fcoe_stat->rx_bytes_lo < fcoe_q_tstorm_stats->rcv_ucast_bytes.lo ? 1U : 0U)); fcoe_stat->rx_bytes_lo = fcoe_stat->rx_bytes_lo + fcoe_q_tstorm_stats->rcv_bcast_bytes.lo; fcoe_stat->rx_bytes_hi = fcoe_stat->rx_bytes_hi + (fcoe_q_tstorm_stats->rcv_bcast_bytes.hi + (fcoe_stat->rx_bytes_lo < fcoe_q_tstorm_stats->rcv_bcast_bytes.lo ? 1U : 0U)); fcoe_stat->rx_bytes_lo = fcoe_stat->rx_bytes_lo + fcoe_q_tstorm_stats->rcv_mcast_bytes.lo; fcoe_stat->rx_bytes_hi = fcoe_stat->rx_bytes_hi + (fcoe_q_tstorm_stats->rcv_mcast_bytes.hi + (fcoe_stat->rx_bytes_lo < fcoe_q_tstorm_stats->rcv_mcast_bytes.lo ? 1U : 0U)); fcoe_stat->rx_frames_lo = fcoe_stat->rx_frames_lo + fw_fcoe_stat->rx_stat0.fcoe_rx_pkt_cnt; fcoe_stat->rx_frames_hi = fcoe_stat->rx_frames_hi + (fcoe_stat->rx_frames_lo < fw_fcoe_stat->rx_stat0.fcoe_rx_pkt_cnt ? 1U : 0U); fcoe_stat->rx_frames_lo = fcoe_stat->rx_frames_lo + fcoe_q_tstorm_stats->rcv_ucast_pkts; fcoe_stat->rx_frames_hi = fcoe_stat->rx_frames_hi + (fcoe_stat->rx_frames_lo < fcoe_q_tstorm_stats->rcv_ucast_pkts ? 1U : 0U); fcoe_stat->rx_frames_lo = fcoe_stat->rx_frames_lo + fcoe_q_tstorm_stats->rcv_bcast_pkts; fcoe_stat->rx_frames_hi = fcoe_stat->rx_frames_hi + (fcoe_stat->rx_frames_lo < fcoe_q_tstorm_stats->rcv_bcast_pkts ? 1U : 0U); fcoe_stat->rx_frames_lo = fcoe_stat->rx_frames_lo + fcoe_q_tstorm_stats->rcv_mcast_pkts; fcoe_stat->rx_frames_hi = fcoe_stat->rx_frames_hi + (fcoe_stat->rx_frames_lo < fcoe_q_tstorm_stats->rcv_mcast_pkts ? 1U : 0U); fcoe_stat->tx_bytes_lo = fcoe_stat->tx_bytes_lo + fw_fcoe_stat->tx_stat.fcoe_tx_byte_cnt; fcoe_stat->tx_bytes_hi = fcoe_stat->tx_bytes_hi + (fcoe_stat->tx_bytes_lo < fw_fcoe_stat->tx_stat.fcoe_tx_byte_cnt ? 1U : 0U); fcoe_stat->tx_bytes_lo = fcoe_stat->tx_bytes_lo + fcoe_q_xstorm_stats->ucast_bytes_sent.lo; fcoe_stat->tx_bytes_hi = fcoe_stat->tx_bytes_hi + (fcoe_q_xstorm_stats->ucast_bytes_sent.hi + (fcoe_stat->tx_bytes_lo < fcoe_q_xstorm_stats->ucast_bytes_sent.lo ? 1U : 0U)); fcoe_stat->tx_bytes_lo = fcoe_stat->tx_bytes_lo + fcoe_q_xstorm_stats->bcast_bytes_sent.lo; fcoe_stat->tx_bytes_hi = fcoe_stat->tx_bytes_hi + (fcoe_q_xstorm_stats->bcast_bytes_sent.hi + (fcoe_stat->tx_bytes_lo < fcoe_q_xstorm_stats->bcast_bytes_sent.lo ? 1U : 0U)); fcoe_stat->tx_bytes_lo = fcoe_stat->tx_bytes_lo + fcoe_q_xstorm_stats->mcast_bytes_sent.lo; fcoe_stat->tx_bytes_hi = fcoe_stat->tx_bytes_hi + (fcoe_q_xstorm_stats->mcast_bytes_sent.hi + (fcoe_stat->tx_bytes_lo < fcoe_q_xstorm_stats->mcast_bytes_sent.lo ? 1U : 0U)); fcoe_stat->tx_frames_lo = fcoe_stat->tx_frames_lo + fw_fcoe_stat->tx_stat.fcoe_tx_pkt_cnt; fcoe_stat->tx_frames_hi = fcoe_stat->tx_frames_hi + (fcoe_stat->tx_frames_lo < fw_fcoe_stat->tx_stat.fcoe_tx_pkt_cnt ? 1U : 0U); fcoe_stat->tx_frames_lo = fcoe_stat->tx_frames_lo + fcoe_q_xstorm_stats->ucast_pkts_sent; fcoe_stat->tx_frames_hi = fcoe_stat->tx_frames_hi + (fcoe_stat->tx_frames_lo < fcoe_q_xstorm_stats->ucast_pkts_sent ? 1U : 0U); fcoe_stat->tx_frames_lo = fcoe_stat->tx_frames_lo + fcoe_q_xstorm_stats->bcast_pkts_sent; fcoe_stat->tx_frames_hi = fcoe_stat->tx_frames_hi + (fcoe_stat->tx_frames_lo < fcoe_q_xstorm_stats->bcast_pkts_sent ? 1U : 0U); fcoe_stat->tx_frames_lo = fcoe_stat->tx_frames_lo + fcoe_q_xstorm_stats->mcast_pkts_sent; fcoe_stat->tx_frames_hi = fcoe_stat->tx_frames_hi + (fcoe_stat->tx_frames_lo < fcoe_q_xstorm_stats->mcast_pkts_sent ? 1U : 0U); } else { } bnx2x_cnic_notify(bp, 5); return; } } static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp ) { struct bnx2x_dcbx_app_params *app ; struct iscsi_stats_info *iscsi_stat ; { app = & bp->dcbx_port_params.app; iscsi_stat = & (bp->slowpath)->drv_info_to_mcp.iscsi_stat; if (! bp->cnic_loaded) { return; } else { } memcpy((void *)(& iscsi_stat->mac_local) + 2U, (void const *)(& bp->cnic_eth_dev.iscsi_mac), 6UL); iscsi_stat->qos_priority = app->traffic_type_priority[2]; bnx2x_cnic_notify(bp, 6); return; } } static void bnx2x_config_mf_bw(struct bnx2x *bp ) { { if ((unsigned int )bp->link_vars.link_up != 0U) { bnx2x_cmng_fns_init(bp, 1, 1); bnx2x_link_sync_notify(bp); } else { } storm_memset_cmng(bp, & bp->cmng, (int )bp->pfid & 1); return; } } static void bnx2x_set_mf_bw(struct bnx2x *bp ) { { bnx2x_config_mf_bw(bp); bnx2x_fw_command(bp, 3774873600U, 0U); return; } } static void bnx2x_handle_eee_event(struct bnx2x *bp ) { long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]EEE - LLDP event\n", "bnx2x_handle_eee_event", 3554, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_fw_command(bp, 3657433088U, 0U); return; } } static void bnx2x_handle_drv_info_req(struct bnx2x *bp ) { enum drv_info_opcode op_code ; u32 drv_info_ctl ; unsigned int tmp ; bool release ; int wait ; long tmp___0 ; u32 bit ; u32 indication ; unsigned int tmp___1 ; unsigned int tmp___2 ; long tmp___3 ; { tmp = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 264UL))); drv_info_ctl = tmp; release = 0; if ((drv_info_ctl & 255U) != 2U) { bnx2x_fw_command(bp, 3640655872U, 0U); return; } else { } op_code = (enum drv_info_opcode )((drv_info_ctl & 65280U) >> 8); mutex_lock_nested(& bp->drv_info_mutex, 0U); memset((void *)(& (bp->slowpath)->drv_info_to_mcp), 0, 316UL); switch ((unsigned int )op_code) { case 0U: bnx2x_drv_info_ether_stat(bp); goto ldv_63618; case 1U: bnx2x_drv_info_fcoe_stat(bp); goto ldv_63618; case 2U: bnx2x_drv_info_iscsi_stat(bp); goto ldv_63618; default: bnx2x_fw_command(bp, 3640655872U, 0U); goto out; } ldv_63618: writel((unsigned int )bp->slowpath_mapping + 4432U, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 256UL))); writel((unsigned int )((bp->slowpath_mapping + 4432ULL) >> 32), (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 260UL))); bnx2x_fw_command(bp, 3623878656U, 0U); if (bp->common.shmem2_base == 0U) { goto _L; } else { tmp___2 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___2 <= 412U) { _L: /* CIL Label */ tmp___0 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Management does not support indication\n", "bnx2x_handle_drv_info_req", 3614, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else if (! bp->drv_info_mng_owner) { bit = (u32 )(1 << ((int )bp->pf_num >> 1)); wait = 0; goto ldv_63628; ldv_63627: tmp___1 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 412UL))); indication = tmp___1; if ((indication & bit) != 0U) { writel(~ bit & indication, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 412UL))); release = 1; goto ldv_63626; } else { } msleep(20U); wait = wait + 1; ldv_63628: ; if (wait <= 24) { goto ldv_63627; } else { } ldv_63626: ; } else { } } if (! release) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Management did not release indication\n", "bnx2x_handle_drv_info_req", 3633, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->drv_info_mng_owner = 1; } else { } out: mutex_unlock(& bp->drv_info_mutex); return; } } static u32 bnx2x_update_mng_version_utility(u8 *version___0 , bool bnx2x_format ) { u8 vals[4U] ; int i ; int tmp ; { i = 0; if ((int )bnx2x_format) { i = sscanf((char const *)version___0, "1.%c%hhd.%hhd.%hhd", (u8 *)(& vals), (u8 *)(& vals) + 1UL, (u8 *)(& vals) + 2UL, (u8 *)(& vals) + 3UL); if (i > 0) { vals[0] = (unsigned int )vals[0] + 208U; } else { } } else { i = sscanf((char const *)version___0, "%hhd.%hhd.%hhd.%hhd", (u8 *)(& vals), (u8 *)(& vals) + 1UL, (u8 *)(& vals) + 2UL, (u8 *)(& vals) + 3UL); } goto ldv_63636; ldv_63635: tmp = i; i = i + 1; vals[tmp] = 0U; ldv_63636: ; if (i <= 3) { goto ldv_63635; } else { } return ((u32 )(((((int )vals[0] << 24) | ((int )vals[1] << 16)) | ((int )vals[2] << 8)) | (int )vals[3])); } } void bnx2x_update_mng_version(struct bnx2x *bp ) { u32 iscsiver ; u32 fcoever ; u32 ethver ; int idx ; u8 *version___0 ; unsigned int tmp ; long tmp___0 ; { iscsiver = 0U; fcoever = 0U; ethver = 0U; idx = ((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1); if (bp->common.shmem2_base == 0U) { return; } else { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp <= 364U) { return; } else { } } mutex_lock_nested(& bp->drv_info_mutex, 0U); if ((int )bp->drv_info_mng_owner) { goto out; } else { } if ((unsigned int )bp->state != 12288U) { goto out; } else { } ethver = bnx2x_update_mng_version_utility((u8 *)"1.710.51-0", 1); if (! bp->cnic_loaded) { goto out; } else { } memset((void *)(& (bp->slowpath)->drv_info_to_mcp), 0, 316UL); bnx2x_drv_info_iscsi_stat(bp); version___0 = (u8 *)(& (bp->slowpath)->drv_info_to_mcp.iscsi_stat.version); iscsiver = bnx2x_update_mng_version_utility(version___0, 0); memset((void *)(& (bp->slowpath)->drv_info_to_mcp), 0, 316UL); bnx2x_drv_info_fcoe_stat(bp); version___0 = (u8 *)(& (bp->slowpath)->drv_info_to_mcp.fcoe_stat.version); fcoever = bnx2x_update_mng_version_utility(version___0, 0); out: writel(ethver, (void volatile *)(bp->regview + (((unsigned long )bp->common.shmem2_base + (unsigned long )idx * 12UL) + 364UL))); writel(iscsiver, (void volatile *)(bp->regview + (((unsigned long )bp->common.shmem2_base + (unsigned long )idx * 12UL) + 368UL))); writel(fcoever, (void volatile *)(bp->regview + (((unsigned long )bp->common.shmem2_base + (unsigned long )idx * 12UL) + 372UL))); mutex_unlock(& bp->drv_info_mutex); tmp___0 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting driver version: ETH [%08x] iSCSI [%08x] FCoE [%08x]\n", "bnx2x_update_mng_version", 3707, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ethver, iscsiver, fcoever); } else { } return; } } static void bnx2x_oem_event(struct bnx2x *bp , u32 event ) { u32 cmd_ok ; u32 cmd_fail ; long tmp ; long tmp___0 ; long tmp___1 ; { if ((event & 65280U) != 0U && (event & 112U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]Received simultaneous events %08x\n", "bnx2x_oem_event", 3717, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", event); return; } else { } if ((event & 65280U) != 0U) { cmd_fail = 822083584U; cmd_ok = 805306368U; } else { cmd_fail = 131072U; cmd_ok = 65536U; } tmp = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]oem_event 0x%x\n", "bnx2x_oem_event", 3729, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", event); } else { } if ((event & 272U) != 0U) { if ((bp->mf_config[(int )bp->pfid >> 1] & 8U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]mf_cfg function disabled\n", "bnx2x_oem_event", 3738, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->flags = bp->flags | 2048U; bnx2x_e1h_disable(bp); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]mf_cfg function enabled\n", "bnx2x_oem_event", 3743, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->flags = bp->flags & 4294965247U; bnx2x_e1h_enable(bp); } event = event & 4294967023U; } else { } if ((event & 544U) != 0U) { bnx2x_config_mf_bw(bp); event = event & 4294966751U; } else { } if (event != 0U) { bnx2x_fw_command(bp, cmd_fail, 0U); } else { bnx2x_fw_command(bp, cmd_ok, 0U); } return; } } static struct eth_spe *bnx2x_sp_get_next(struct bnx2x *bp ) { struct eth_spe *next_spe ; long tmp ; { next_spe = bp->spq_prod_bd; if ((unsigned long )bp->spq_prod_bd == (unsigned long )bp->spq_last_bd) { bp->spq_prod_bd = bp->spq; bp->spq_prod_idx = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]end of spq\n", "bnx2x_sp_get_next", 3774, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { bp->spq_prod_bd = bp->spq_prod_bd + 1; bp->spq_prod_idx = (u16 )((int )bp->spq_prod_idx + 1); } return (next_spe); } } static void bnx2x_sp_prod_update(struct bnx2x *bp ) { int func ; { func = (int )bp->pfid; __asm__ volatile ("mfence": : : "memory"); writew((int )bp->spq_prod_idx, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 31UL)->base + (unsigned int )((int )(bp->iro_arr + 31UL)->m1 * func)) + 4325376U)); __asm__ volatile ("": : : "memory"); return; } } static bool bnx2x_is_contextless_ramrod(int cmd , int cmd_type ) { { if ((((((cmd_type == 8 || cmd == 3) || cmd == 9) || cmd == 10) || cmd == 11) || cmd == 13) || cmd == 12) { return (1); } else { return (0); } } } int bnx2x_sp_post(struct bnx2x *bp , int command , int cid , u32 data_hi , u32 data_lo , int cmd_type ) { struct eth_spe *spe ; u16 type ; bool common ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; { tmp = bnx2x_is_contextless_ramrod(command, cmd_type); common = tmp; spin_lock_bh(& bp->spq_lock); if ((int )common) { tmp___0 = atomic_read((atomic_t const *)(& bp->eq_spq_left)); if (tmp___0 == 0) { printk("\vbnx2x: [%s:%d(%s)]BUG! EQ ring full!\n", "bnx2x_sp_post", 3851, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); spin_unlock_bh(& bp->spq_lock); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_sp_post", 3853, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); return (-16); } else { } } else { tmp___1 = atomic_read((atomic_t const *)(& bp->cq_spq_left)); if (tmp___1 == 0) { printk("\vbnx2x: [%s:%d(%s)]BUG! SPQ ring full!\n", "bnx2x_sp_post", 3857, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); spin_unlock_bh(& bp->spq_lock); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_sp_post", 3859, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); return (-16); } else { } } spe = bnx2x_sp_get_next(bp); spe->hdr.conn_and_cmd_data = (unsigned int )((command << 24) | (((((int )bp->pfid & 1) << 23) | (((int )bp->pfid >> 1) << 17)) | cid)); if ((cmd_type & 65280) == 0) { type = (unsigned int )((u16 )cmd_type) & 255U; type = (u16 )((int )((short )((int )bp->pfid << 8)) | (int )((short )type)); } else { type = (u16 )cmd_type; } spe->hdr.type = type; spe->data.update_data_addr.hi = data_hi; spe->data.update_data_addr.lo = data_lo; if ((int )common) { atomic_dec(& bp->eq_spq_left); } else { atomic_dec(& bp->cq_spq_left); } tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___4 != 0L) { tmp___2 = atomic_read((atomic_t const *)(& bp->eq_spq_left)); tmp___3 = atomic_read((atomic_t const *)(& bp->cq_spq_left)); printk("\rbnx2x: [%s:%d(%s)]SPQE[%x] (%x:%x) (cmd, common?) (%d,%d) hw_cid %x data (%x:%x) type(0x%x) left (CQ, EQ) (%x,%x)\n", "bnx2x_sp_post", 3904, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->spq_prod_idx, (unsigned int )(bp->spq_mapping >> 32), (unsigned int )((long )((void *)bp->spq_prod_bd + (unsigned long )((unsigned int )bp->spq_mapping))) - (unsigned int )((long )bp->spq), command, (int )common, ((((int )bp->pfid & 1) << 23) | (((int )bp->pfid >> 1) << 17)) | cid, data_hi, data_lo, (int )type, tmp___3, tmp___2); } else { } bnx2x_sp_prod_update(bp); spin_unlock_bh(& bp->spq_lock); return (0); } } static int bnx2x_acquire_alr(struct bnx2x *bp ) { u32 j ; u32 val ; int rc ; { rc = 0; __might_sleep("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 3917, 0); j = 0U; goto ldv_63688; ldv_63687: writel(2147483648U, (void volatile *)bp->regview + 524444U); val = readl((void const volatile *)bp->regview + 524444U); if ((int )val < 0) { goto ldv_63686; } else { } usleep_range(5000UL, 10000UL); j = j + 1U; ldv_63688: ; if (j <= 999U) { goto ldv_63687; } else { } ldv_63686: ; if ((int )val >= 0) { printk("\vbnx2x: [%s:%d(%s)]Cannot acquire MCP access lock register\n", "bnx2x_acquire_alr", 3927, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -16; } else { } return (rc); } } static void bnx2x_release_alr(struct bnx2x *bp ) { { writel(0U, (void volatile *)bp->regview + 524444U); return; } } static u16 bnx2x_update_dsb_idx(struct bnx2x *bp ) { struct host_sp_status_block *def_sb ; u16 rc ; { def_sb = bp->def_status_blk; rc = 0U; __asm__ volatile ("": : : "memory"); if ((int )bp->def_att_idx != (int )def_sb->atten_status_block.attn_bits_index) { bp->def_att_idx = def_sb->atten_status_block.attn_bits_index; rc = (u16 )((unsigned int )rc | 1U); } else { } if ((int )bp->def_idx != (int )def_sb->sp_sb.running_index) { bp->def_idx = def_sb->sp_sb.running_index; rc = (u16 )((unsigned int )rc | 2U); } else { } __asm__ volatile ("": : : "memory"); return (rc); } } static void bnx2x_attn_int_asserted(struct bnx2x *bp , u32 asserted ) { int port ; u32 aeu_addr ; u32 nig_int_mask_addr ; u32 aeu_mask ; u32 nig_mask ; u32 reg_addr ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; long tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; u32 cnt ; u32 igu_acked ; long tmp___14 ; { port = (int )bp->pfid & 1; aeu_addr = port != 0 ? 41060U : 41056U; nig_int_mask_addr = port != 0 ? 66356U : 66352U; nig_mask = 0U; if ((bp->attn_state & asserted) != 0U) { printk("\vbnx2x: [%s:%d(%s)]IGU OLD_ERROR\n", "bnx2x_attn_int_asserted", 3980, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_acquire_hw_lock(bp, (u32 )(port + 3)); aeu_mask = readl((void const volatile *)bp->regview + (unsigned long )aeu_addr); tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]aeu_mask %x newly asserted %x\n", "bnx2x_attn_int_asserted", 3986, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", aeu_mask, asserted); } else { } aeu_mask = ~ (asserted & 1023U) & aeu_mask; tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]new mask %x\n", "bnx2x_attn_int_asserted", 3988, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", aeu_mask); } else { } writel(aeu_mask, (void volatile *)bp->regview + (unsigned long )aeu_addr); bnx2x_release_hw_lock(bp, (u32 )(port + 3)); tmp___1 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]attn_state %x\n", "bnx2x_attn_int_asserted", 3993, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->attn_state); } else { } bp->attn_state = bp->attn_state | asserted; tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]new state %x\n", "bnx2x_attn_int_asserted", 3995, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->attn_state); } else { } if ((asserted & 65280U) != 0U) { if (((long )asserted & 256L) != 0L) { bnx2x_acquire_phy_lock(bp); nig_mask = readl((void const volatile *)bp->regview + (unsigned long )nig_int_mask_addr); if (nig_mask != 0U) { writel(0U, (void volatile *)bp->regview + (unsigned long )nig_int_mask_addr); bnx2x_link_attn(bp); } else { } } else { } if (((long )asserted & 512L) != 0L) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ATTN_SW_TIMER_4_FUNC!\n", "bnx2x_attn_int_asserted", 4017, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if (((long )asserted & 1024L) != 0L) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]GPIO_2_FUNC!\n", "bnx2x_attn_int_asserted", 4020, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if (((long )asserted & 2048L) != 0L) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]GPIO_3_FUNC!\n", "bnx2x_attn_int_asserted", 4023, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if (((long )asserted & 4096L) != 0L) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]GPIO_4_FUNC!\n", "bnx2x_attn_int_asserted", 4026, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if (port == 0) { if (((long )asserted & 8192L) != 0L) { tmp___7 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ATTN_GENERAL_ATTN_1!\n", "bnx2x_attn_int_asserted", 4030, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(0U, (void volatile *)bp->regview + 40964U); } else { } if (((long )asserted & 16384L) != 0L) { tmp___8 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ATTN_GENERAL_ATTN_2!\n", "bnx2x_attn_int_asserted", 4034, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(0U, (void volatile *)bp->regview + 40968U); } else { } if (((long )asserted & 32768L) != 0L) { tmp___9 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ATTN_GENERAL_ATTN_3!\n", "bnx2x_attn_int_asserted", 4038, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(0U, (void volatile *)bp->regview + 40972U); } else { } } else { if (((long )asserted & 8192L) != 0L) { tmp___10 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___10 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ATTN_GENERAL_ATTN_4!\n", "bnx2x_attn_int_asserted", 4043, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(0U, (void volatile *)bp->regview + 40976U); } else { } if (((long )asserted & 16384L) != 0L) { tmp___11 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ATTN_GENERAL_ATTN_5!\n", "bnx2x_attn_int_asserted", 4047, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(0U, (void volatile *)bp->regview + 40980U); } else { } if (((long )asserted & 32768L) != 0L) { tmp___12 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___12 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ATTN_GENERAL_ATTN_6!\n", "bnx2x_attn_int_asserted", 4051, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(0U, (void volatile *)bp->regview + 40984U); } else { } } } else { } if ((unsigned int )bp->common.int_block == 0U) { reg_addr = (u32 )((port + 33804) * 32 + 12); } else { reg_addr = 4467976U; } tmp___13 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___13 != 0L) { printk("\rbnx2x: [%s:%d(%s)]about to mask 0x%08x at %s addr 0x%x\n", "bnx2x_attn_int_asserted", 4065, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", asserted, (unsigned int )bp->common.int_block == 0U ? (char *)"HC" : (char *)"IGU", reg_addr); } else { } writel(asserted, (void volatile *)bp->regview + (unsigned long )reg_addr); if (((long )asserted & 256L) != 0L) { if ((unsigned int )bp->common.int_block != 0U) { cnt = 0U; ldv_63711: igu_acked = readl((void const volatile *)bp->regview + 1245448U); if (((long )igu_acked & 256L) == 0L) { cnt = cnt + 1U; if (cnt <= 99U) { goto ldv_63711; } else { goto ldv_63712; } } else { } ldv_63712: ; if (igu_acked == 0U) { tmp___14 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___14 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to verify IGU ack on time\n", "bnx2x_attn_int_asserted", 4082, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } __asm__ volatile ("": : : "memory"); } else { } writel(nig_mask, (void volatile *)bp->regview + (unsigned long )nig_int_mask_addr); bnx2x_release_phy_lock(bp); } else { } return; } } static void bnx2x_fan_failure(struct bnx2x *bp ) { int port ; u32 ext_phy_config ; { port = (int )bp->pfid & 1; ext_phy_config = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 436UL))); ext_phy_config = ext_phy_config & 4294902015U; ext_phy_config = ext_phy_config | 64768U; writel(ext_phy_config, (void volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 436UL))); netdev_err((struct net_device const *)bp->dev, "Fan Failure on Network Controller has caused the driver to shutdown the card to prevent permanent damage.\nPlease contact OEM Support for assistance\n"); bnx2x_schedule_sp_rtnl(bp, 2, 0U); return; } } static void bnx2x_attn_int_deasserted0(struct bnx2x *bp , u32 attn ) { int port ; int reg_offset ; u32 val ; { port = (int )bp->pfid & 1; reg_offset = port != 0 ? 41228 : 41068; if ((attn & 32768U) != 0U) { val = readl((void const volatile *)bp->regview + (unsigned long )reg_offset); val = val & 4294934527U; writel(val, (void volatile *)bp->regview + (unsigned long )reg_offset); printk("\vbnx2x: [%s:%d(%s)]SPIO5 hw attention\n", "bnx2x_attn_int_deasserted0", 4130, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_hw_reset_phy(& bp->link_params); bnx2x_fan_failure(bp); } else { } if ((bp->link_vars.aeu_int_mask & attn) != 0U && bp->port.pmf != 0U) { bnx2x_acquire_phy_lock(bp); bnx2x_handle_module_detect_int(& bp->link_params); bnx2x_release_phy_lock(bp); } else { } if ((attn & 2852651008U) != 0U) { val = readl((void const volatile *)bp->regview + (unsigned long )reg_offset); val = ~ (attn & 2852651008U) & val; writel(val, (void volatile *)bp->regview + (unsigned long )reg_offset); printk("\vbnx2x: [%s:%d(%s)]FATAL HW block attention set0 0x%x\n", "bnx2x_attn_int_deasserted0", 4150, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attn & 2852651008U); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_attn_int_deasserted0", 4151, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); } else { } return; } } static void bnx2x_attn_int_deasserted1(struct bnx2x *bp , u32 attn ) { u32 val ; int port ; int reg_offset ; { if ((attn & 8192U) != 0U) { val = readl((void const volatile *)bp->regview + 1507704U); printk("\vbnx2x: [%s:%d(%s)]DB hw attention 0x%x\n", "bnx2x_attn_int_deasserted1", 4162, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); if ((val & 2U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]FATAL error from DORQ\n", "bnx2x_attn_int_deasserted1", 4165, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((attn & 2862615208U) != 0U) { port = (int )bp->pfid & 1; reg_offset = port != 0 ? 41244 : 41084; val = readl((void const volatile *)bp->regview + (unsigned long )reg_offset); val = ~ (attn & 2862615208U) & val; writel(val, (void volatile *)bp->regview + (unsigned long )reg_offset); printk("\vbnx2x: [%s:%d(%s)]FATAL HW block attention set1 0x%x\n", "bnx2x_attn_int_deasserted1", 4181, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attn & 2862615208U); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_attn_int_deasserted1", 4182, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); } else { } return; } } static void bnx2x_attn_int_deasserted2(struct bnx2x *bp , u32 attn ) { u32 val ; int port ; int reg_offset ; { if ((attn & 128U) != 0U) { val = readl((void const volatile *)bp->regview + 1065216U); printk("\vbnx2x: [%s:%d(%s)]CFC hw attention 0x%x\n", "bnx2x_attn_int_deasserted2", 4193, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); if ((val & 2U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]FATAL error from CFC\n", "bnx2x_attn_int_deasserted2", 4196, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((attn & 8U) != 0U) { val = readl((void const volatile *)bp->regview + 1060972U); printk("\vbnx2x: [%s:%d(%s)]PXP hw attention-0 0x%x\n", "bnx2x_attn_int_deasserted2", 4201, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); if ((val & 98304U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]FATAL error from PXP\n", "bnx2x_attn_int_deasserted2", 4204, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { val = readl((void const volatile *)bp->regview + 1060988U); printk("\vbnx2x: [%s:%d(%s)]PXP hw attention-1 0x%x\n", "bnx2x_attn_int_deasserted2", 4208, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } } else { } if ((attn & 35362U) != 0U) { port = (int )bp->pfid & 1; reg_offset = port != 0 ? 41260 : 41100; val = readl((void const volatile *)bp->regview + (unsigned long )reg_offset); val = ~ (attn & 35362U) & val; writel(val, (void volatile *)bp->regview + (unsigned long )reg_offset); printk("\vbnx2x: [%s:%d(%s)]FATAL HW block attention set2 0x%x\n", "bnx2x_attn_int_deasserted2", 4225, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attn & 35362U); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_attn_int_deasserted2", 4226, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); } else { } return; } } static void bnx2x_attn_int_deasserted3(struct bnx2x *bp , u32 attn ) { u32 val ; int func ; unsigned int tmp ; unsigned int tmp___0 ; { if ((attn & 524256U) != 0U) { if ((int )((unsigned long )attn >> ((int )bp->pfid + 106) % 32) & 1) { func = (int )bp->pfid; writel(0U, (void volatile *)bp->regview + (unsigned long )((func + 10252) * 4)); bnx2x_read_mf_cfg(bp); bp->mf_config[(int )bp->pfid >> 1] = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )bp->pf_num * 24UL) + 36UL))); val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) * 44UL) + 1700UL))); if ((val & 65392U) != 0U) { bnx2x_oem_event(bp, val & 65392U); } else { } if ((val & 4U) != 0U) { bnx2x_set_mf_bw(bp); } else { } if ((val & 67108864U) != 0U) { bnx2x_handle_drv_info_req(bp); } else { } if ((val & 2U) != 0U) { bnx2x_schedule_iov_task(bp, 1); } else { } if (bp->port.pmf == 0U && (int )val & 1) { bnx2x_pmf_update(bp); } else { } if ((bp->port.pmf != 0U && (val & 65536U) != 0U) && bp->dcbx_enabled > 0) { bnx2x_dcbx_set_params(bp, 1U); } else { } if ((val & 66060288U) != 0U) { bnx2x_handle_afex_cmd(bp, val & 66060288U); } else { } if ((val & 134217728U) != 0U) { bnx2x_handle_eee_event(bp); } else { } if ((val & 128U) != 0U) { bnx2x_handle_update_svid_cmd(bp); } else { } if ((int )bp->link_vars.periodic_flags & 1) { bnx2x_acquire_phy_lock(bp); bp->link_vars.periodic_flags = (unsigned int )bp->link_vars.periodic_flags & 65534U; bnx2x_release_phy_lock(bp); if ((unsigned int )bp->mf_mode != 0U) { bnx2x_link_sync_notify(bp); } else { } bnx2x_link_report(bp); } else { } bnx2x__link_status_update(bp); } else if (((unsigned long )attn & 480UL) != 0UL) { printk("\vbnx2x: [%s:%d(%s)]MC assert!\n", "bnx2x_attn_int_deasserted3", 4297, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_mc_assert(bp); writel(0U, (void volatile *)bp->regview + 41000U); writel(0U, (void volatile *)bp->regview + 40996U); writel(0U, (void volatile *)bp->regview + 40992U); writel(0U, (void volatile *)bp->regview + 40988U); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_attn_int_deasserted3", 4303, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); } else if (((unsigned long )attn & 512UL) != 0UL) { printk("\vbnx2x: [%s:%d(%s)]MCP assert!\n", "bnx2x_attn_int_deasserted3", 4307, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); writel(0U, (void volatile *)bp->regview + 41004U); bnx2x_fw_dump(bp); } else { printk("\vbnx2x: [%s:%d(%s)]Unknown HW assert! (attn 0x%x)\n", "bnx2x_attn_int_deasserted3", 4312, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attn); } } else { } if ((attn & 4292870144U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]LATCHED attention 0x%08x (masked)\n", "bnx2x_attn_int_deasserted3", 4316, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attn); if (((unsigned long )attn & 67108864UL) != 0UL) { if (bp->common.chip_id >> 16 != 5710U) { tmp = readl((void const volatile *)bp->regview + 41924U); val = tmp; } else { val = 0U; } printk("\vbnx2x: [%s:%d(%s)]GRC time-out 0x%08x\n", "bnx2x_attn_int_deasserted3", 4320, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } if (((unsigned long )attn & 199229440UL) != 0UL) { if (bp->common.chip_id >> 16 != 5710U) { tmp___0 = readl((void const volatile *)bp->regview + 41920U); val = tmp___0; } else { val = 0U; } printk("\vbnx2x: [%s:%d(%s)]GRC reserved 0x%08x\n", "bnx2x_attn_int_deasserted3", 4325, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } writel(2047U, (void volatile *)bp->regview + 42076U); } else { } return; } } void bnx2x_set_reset_global(struct bnx2x *bp ) { u32 val ; { bnx2x_acquire_hw_lock(bp, 11U); val = readl((void const volatile *)bp->regview + 42100U); writel(val | 262144U, (void volatile *)bp->regview + 42100U); bnx2x_release_hw_lock(bp, 11U); return; } } static void bnx2x_clear_reset_global(struct bnx2x *bp ) { u32 val ; { bnx2x_acquire_hw_lock(bp, 11U); val = readl((void const volatile *)bp->regview + 42100U); writel(val & 4294705151U, (void volatile *)bp->regview + 42100U); bnx2x_release_hw_lock(bp, 11U); return; } } static bool bnx2x_reset_is_global(struct bnx2x *bp ) { u32 val ; unsigned int tmp ; long tmp___0 ; { tmp = readl((void const volatile *)bp->regview + 42100U); val = tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]GEN_REG_VAL=0x%08x\n", "bnx2x_reset_is_global", 4392, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } return ((val & 262144U) != 0U); } } static void bnx2x_set_reset_done(struct bnx2x *bp ) { u32 val ; u32 bit ; { bit = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 131072U : 65536U; bnx2x_acquire_hw_lock(bp, 11U); val = readl((void const volatile *)bp->regview + 42100U); val = ~ bit & val; writel(val, (void volatile *)bp->regview + 42100U); bnx2x_release_hw_lock(bp, 11U); return; } } void bnx2x_set_reset_in_progress(struct bnx2x *bp ) { u32 val ; u32 bit ; { bit = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 131072U : 65536U; bnx2x_acquire_hw_lock(bp, 11U); val = readl((void const volatile *)bp->regview + 42100U); val = val | bit; writel(val, (void volatile *)bp->regview + 42100U); bnx2x_release_hw_lock(bp, 11U); return; } } bool bnx2x_reset_is_done(struct bnx2x *bp , int engine ) { u32 val ; unsigned int tmp ; u32 bit ; { tmp = readl((void const volatile *)bp->regview + 42100U); val = tmp; bit = engine != 0 ? 131072U : 65536U; return ((val & bit) == 0U); } } void bnx2x_set_pf_load(struct bnx2x *bp ) { u32 val1 ; u32 val ; u32 mask ; u32 shift ; long tmp ; { mask = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 65280U : 255U; shift = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 8U : 0U; bnx2x_acquire_hw_lock(bp, 11U); val = readl((void const volatile *)bp->regview + 42100U); tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Old GEN_REG_VAL=0x%08x\n", "bnx2x_set_pf_load", 4465, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val1 = (val & mask) >> (int )shift; val1 = (u32 )(1 << (int )bp->pf_num) | val1; val = ~ mask & val; val = ((val1 << (int )shift) & mask) | val; writel(val, (void volatile *)bp->regview + 42100U); bnx2x_release_hw_lock(bp, 11U); return; } } bool bnx2x_clear_pf_load(struct bnx2x *bp ) { u32 val1 ; u32 val ; u32 mask ; u32 shift ; long tmp ; { mask = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 65280U : 255U; shift = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 8U : 0U; bnx2x_acquire_hw_lock(bp, 11U); val = readl((void const volatile *)bp->regview + 42100U); tmp = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Old GEN_REG_VAL=0x%08x\n", "bnx2x_clear_pf_load", 4502, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val1 = (val & mask) >> (int )shift; val1 = (u32 )(~ (1 << (int )bp->pf_num)) & val1; val = ~ mask & val; val = ((val1 << (int )shift) & mask) | val; writel(val, (void volatile *)bp->regview + 42100U); bnx2x_release_hw_lock(bp, 11U); return (val1 != 0U); } } static bool bnx2x_get_load_status(struct bnx2x *bp , int engine ) { u32 mask ; u32 shift ; u32 val ; unsigned int tmp ; long tmp___0 ; long tmp___1 ; { mask = engine != 0 ? 65280U : 255U; shift = engine != 0 ? 8U : 0U; tmp = readl((void const volatile *)bp->regview + 42100U); val = tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 8224) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]GLOB_REG=0x%08x\n", "bnx2x_get_load_status", 4534, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } val = (val & mask) >> (int )shift; tmp___1 = ldv__builtin_expect((bp->msg_enable & 8224) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]load mask for engine %d = 0x%x\n", "bnx2x_get_load_status", 4539, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", engine, val); } else { } return (val != 0U); } } static void _print_parity(struct bnx2x *bp , u32 reg ) { unsigned int tmp ; { tmp = readl((void const volatile *)bp->regview + (unsigned long )reg); printk(" [0x%08x] ", tmp); return; } } static void _print_next_block(int idx , char const *blk ) { { printk("%s%s", idx != 0 ? (char *)", " : (char *)"", blk); return; } } static bool bnx2x_check_blocks_with_parity0(struct bnx2x *bp , u32 sig , int *par_num , bool print ) { u32 cur_bit ; bool res ; int i ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { res = 0; i = 0; goto ldv_63828; ldv_63827: cur_bit = (u32 )(1UL << i); if ((sig & cur_bit) != 0U) { res = ((int )res | 1) != 0; if ((int )print) { switch (cur_bit) { case 262144U: tmp = *par_num; *par_num = *par_num + 1; _print_next_block(tmp, "BRB"); _print_parity(bp, 393516U); goto ldv_63820; case 1048576U: tmp___0 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___0, "PARSER"); _print_parity(bp, 262552U); goto ldv_63820; case 16777216U: tmp___1 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___1, "TSDM"); _print_parity(bp, 271024U); goto ldv_63820; case 4194304U: tmp___2 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___2, "SEARCHER"); _print_parity(bp, 263356U); goto ldv_63820; case 67108864U: tmp___3 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___3, "TCM"); _print_parity(bp, 328160U); goto ldv_63820; case 268435456U: tmp___4 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___4, "TSEMI"); _print_parity(bp, 1573140U); _print_parity(bp, 1573156U); goto ldv_63820; case 1073741824U: tmp___5 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___5, "XPB"); _print_parity(bp, 1445932U); goto ldv_63820; } ldv_63820: ; } else { } sig = ~ cur_bit & sig; } else { } i = i + 1; ldv_63828: ; if (sig != 0U) { goto ldv_63827; } else { } return (res); } } static bool bnx2x_check_blocks_with_parity1(struct bnx2x *bp , u32 sig , int *par_num , bool *global , bool print ) { u32 cur_bit ; bool res ; int i ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; { res = 0; i = 0; goto ldv_63858; ldv_63857: cur_bit = (u32 )(1UL << i); if ((sig & cur_bit) != 0U) { res = ((int )res | 1) != 0; switch (cur_bit) { case 1U: ; if ((int )print) { tmp = *par_num; *par_num = *par_num + 1; _print_next_block(tmp, "PBF"); _print_parity(bp, 1311192U); } else { } goto ldv_63841; case 4U: ; if ((int )print) { tmp___0 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___0, "QM"); _print_parity(bp, 1475656U); } else { } goto ldv_63841; case 16U: ; if ((int )print) { tmp___1 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___1, "TM"); _print_parity(bp, 1458432U); } else { } goto ldv_63841; case 64U: ; if ((int )print) { tmp___2 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___2, "XSDM"); _print_parity(bp, 1467056U); } else { } goto ldv_63841; case 256U: ; if ((int )print) { tmp___3 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___3, "XCM"); _print_parity(bp, 131768U); } else { } goto ldv_63841; case 1024U: ; if ((int )print) { tmp___4 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___4, "XSEMI"); _print_parity(bp, 2621732U); _print_parity(bp, 2621748U); } else { } goto ldv_63841; case 4096U: ; if ((int )print) { tmp___5 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___5, "DOORBELLQ"); _print_parity(bp, 1507716U); } else { } goto ldv_63841; case 16384U: ; if ((int )print) { tmp___6 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___6, "NIG"); if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { _print_parity(bp, 66512U); } else { _print_parity(bp, 99260U); _print_parity(bp, 99276U); } } else { } goto ldv_63841; case 65536U: ; if ((int )print) { tmp___7 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___7, "VAUX PCI CORE"); } else { } *global = 1; goto ldv_63841; case 262144U: ; if ((int )print) { tmp___8 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___8, "DEBUG"); _print_parity(bp, 49308U); } else { } goto ldv_63841; case 1048576U: ; if ((int )print) { tmp___9 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___9, "USDM"); _print_parity(bp, 803508U); } else { } goto ldv_63841; case 4194304U: ; if ((int )print) { tmp___10 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___10, "UCM"); _print_parity(bp, 917976U); } else { } goto ldv_63841; case 16777216U: ; if ((int )print) { tmp___11 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___11, "USEMI"); _print_parity(bp, 3146020U); _print_parity(bp, 3146036U); } else { } goto ldv_63841; case 67108864U: ; if ((int )print) { tmp___12 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___12, "UPB"); _print_parity(bp, 790572U); } else { } goto ldv_63841; case 268435456U: ; if ((int )print) { tmp___13 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___13, "CSDM"); _print_parity(bp, 795312U); } else { } goto ldv_63841; case 1073741824U: ; if ((int )print) { tmp___14 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___14, "CCM"); _print_parity(bp, 852456U); } else { } goto ldv_63841; } ldv_63841: sig = ~ cur_bit & sig; } else { } i = i + 1; ldv_63858: ; if (sig != 0U) { goto ldv_63857; } else { } return (res); } } static bool bnx2x_check_blocks_with_parity2(struct bnx2x *bp , u32 sig , int *par_num , bool print ) { u32 cur_bit ; bool res ; int i ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; { res = 0; i = 0; goto ldv_63879; ldv_63878: cur_bit = (u32 )(1UL << i); if ((sig & cur_bit) != 0U) { res = 1; if ((int )print) { switch (cur_bit) { case 1U: tmp = *par_num; *par_num = *par_num + 1; _print_next_block(tmp, "CSEMI"); _print_parity(bp, 2097444U); _print_parity(bp, 2097460U); goto ldv_63870; case 4U: tmp___0 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___0, "PXP"); _print_parity(bp, 1061000U); _print_parity(bp, 1181052U); _print_parity(bp, 1181068U); goto ldv_63870; case 16U: tmp___1 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___1, "PXPPCICLOCKCLIENT"); goto ldv_63870; case 64U: tmp___2 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___2, "CFC"); _print_parity(bp, 1065228U); goto ldv_63870; case 256U: tmp___3 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___3, "CDU"); _print_parity(bp, 1052736U); goto ldv_63870; case 1024U: tmp___4 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___4, "DMAE"); _print_parity(bp, 1056856U); goto ldv_63870; case 4096U: tmp___5 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___5, "IGU"); if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { _print_parity(bp, 1081492U); } else { _print_parity(bp, 1245340U); } goto ldv_63870; case 16384U: tmp___6 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___6, "MISC"); _print_parity(bp, 41868U); goto ldv_63870; } ldv_63870: ; } else { } sig = ~ cur_bit & sig; } else { } i = i + 1; ldv_63879: ; if (sig != 0U) { goto ldv_63878; } else { } return (res); } } static bool bnx2x_check_blocks_with_parity3(struct bnx2x *bp , u32 sig , int *par_num , bool *global , bool print ) { bool res ; u32 cur_bit ; int i ; int tmp ; int tmp___0 ; int tmp___1 ; { res = 0; i = 0; goto ldv_63897; ldv_63896: cur_bit = (u32 )(1UL << i); if ((sig & cur_bit) != 0U) { switch (cur_bit) { case 268435456U: ; if ((int )print) { tmp = *par_num; *par_num = *par_num + 1; _print_next_block(tmp, "MCP ROM"); } else { } *global = 1; res = 1; goto ldv_63892; case 536870912U: ; if ((int )print) { tmp___0 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___0, "MCP UMP RX"); } else { } *global = 1; res = 1; goto ldv_63892; case 1073741824U: ; if ((int )print) { tmp___1 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___1, "MCP UMP TX"); } else { } *global = 1; res = 1; goto ldv_63892; case 2147483648U: *par_num = *par_num + 1; writel(1024U, (void volatile *)bp->regview + 42076U); goto ldv_63892; } ldv_63892: sig = ~ cur_bit & sig; } else { } i = i + 1; ldv_63897: ; if (sig != 0U) { goto ldv_63896; } else { } return (res); } } static bool bnx2x_check_blocks_with_parity4(struct bnx2x *bp , u32 sig , int *par_num , bool print ) { u32 cur_bit ; bool res ; int i ; int tmp ; int tmp___0 ; { res = 0; i = 0; goto ldv_63912; ldv_63911: cur_bit = (u32 )(1UL << i); if ((sig & cur_bit) != 0U) { res = 1; if ((int )print) { switch (cur_bit) { case 8U: tmp = *par_num; *par_num = *par_num + 1; _print_next_block(tmp, "PGLUE_B"); _print_parity(bp, 37544U); goto ldv_63909; case 32U: tmp___0 = *par_num; *par_num = *par_num + 1; _print_next_block(tmp___0, "ATC"); _print_parity(bp, 1114572U); goto ldv_63909; } ldv_63909: ; } else { } sig = ~ cur_bit & sig; } else { } i = i + 1; ldv_63912: ; if (sig != 0U) { goto ldv_63911; } else { } return (res); } } static bool bnx2x_parity_attn(struct bnx2x *bp , bool *global , bool print , u32 *sig ) { bool res ; int par_num ; long tmp ; bool tmp___0 ; bool tmp___1 ; bool tmp___2 ; bool tmp___3 ; bool tmp___4 ; { res = 0; if (((((*sig & 1431568384U) != 0U || (*(sig + 1UL) & 1431655765U) != 0U) || (*(sig + 2UL) & 21845U) != 0U) || (*(sig + 3UL) & 4026531840U) != 0U) || (*(sig + 4UL) & 40U) != 0U) { par_num = 0; tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Was parity error: HW block parity attention:\n[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x [4]:0x%08x\n", "bnx2x_parity_attn", 4939, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", *sig & 1431568384U, *(sig + 1UL) & 1431655765U, *(sig + 2UL) & 21845U, *(sig + 3UL) & 4026531840U, *(sig + 4UL) & 40U); } else { } if ((int )print) { if (((((*sig & 1431568384U) != 0U || (*(sig + 1UL) & 1431655765U) != 0U) || (*(sig + 2UL) & 21845U) != 0U) || (*(sig + 4UL) & 40U) != 0U) || (*(sig + 3UL) & 1879048192U) != 0U) { netdev_err((struct net_device const *)bp->dev, "Parity errors detected in blocks: "); } else { print = 0; } } else { } tmp___0 = bnx2x_check_blocks_with_parity0(bp, *sig & 1431568384U, & par_num, (int )print); res = ((int )res | (int )tmp___0) != 0; tmp___1 = bnx2x_check_blocks_with_parity1(bp, *(sig + 1UL) & 1431655765U, & par_num, global, (int )print); res = ((int )res | (int )tmp___1) != 0; tmp___2 = bnx2x_check_blocks_with_parity2(bp, *(sig + 2UL) & 21845U, & par_num, (int )print); res = ((int )res | (int )tmp___2) != 0; tmp___3 = bnx2x_check_blocks_with_parity3(bp, *(sig + 3UL) & 4026531840U, & par_num, global, (int )print); res = ((int )res | (int )tmp___3) != 0; tmp___4 = bnx2x_check_blocks_with_parity4(bp, *(sig + 4UL) & 40U, & par_num, (int )print); res = ((int )res | (int )tmp___4) != 0; if ((int )print) { printk("\n"); } else { } } else { } return (res); } } bool bnx2x_chk_parity_attn(struct bnx2x *bp , bool *global , bool print ) { struct attn_route attn ; unsigned int tmp ; int port ; unsigned int tmp___0 ; bool tmp___1 ; { attn.sig[0] = 0U; tmp = 1U; while (1) { if (tmp >= 5U) { break; } else { } attn.sig[tmp] = 0U; tmp = tmp + 1U; } port = (int )bp->pfid & 1; attn.sig[0] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10507) * 4)); attn.sig[1] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10510) * 4)); attn.sig[2] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10513) * 4)); attn.sig[3] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10516) * 4)); tmp___0 = readl((void const volatile *)(bp->regview + (port == 0 ? 41080UL : 41240UL))); attn.sig[3] = attn.sig[3] & (tmp___0 | 268435455U); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { attn.sig[4] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10688) * 4)); } else { } tmp___1 = bnx2x_parity_attn(bp, global, (int )print, (u32 *)(& attn.sig)); return (tmp___1); } } static void bnx2x_attn_int_deasserted4(struct bnx2x *bp , u32 attn ) { u32 val ; { if ((attn & 4U) != 0U) { val = readl((void const volatile *)bp->regview + 37532U); printk("\vbnx2x: [%s:%d(%s)]PGLUE hw attention 0x%x\n", "bnx2x_attn_int_deasserted4", 5017, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); if ((int )val & 1) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR\n", "bnx2x_attn_int_deasserted4", 5019, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 2U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_INCORRECT_RCV_BEHAVIOR\n", "bnx2x_attn_int_deasserted4", 5021, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 4U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN\n", "bnx2x_attn_int_deasserted4", 5023, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 8U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_VF_LENGTH_VIOLATION_ATTN\n", "bnx2x_attn_int_deasserted4", 5025, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 16U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_VF_GRC_SPACE_VIOLATION_ATTN\n", "bnx2x_attn_int_deasserted4", 5028, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 32U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_VF_MSIX_BAR_VIOLATION_ATTN\n", "bnx2x_attn_int_deasserted4", 5031, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 64U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_TCPL_ERROR_ATTN\n", "bnx2x_attn_int_deasserted4", 5033, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 128U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_TCPL_IN_TWO_RCBS_ATTN\n", "bnx2x_attn_int_deasserted4", 5035, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 256U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]PGLUE_B_PGLUE_B_INT_STS_REG_CSSNOOP_FIFO_OVERFLOW\n", "bnx2x_attn_int_deasserted4", 5037, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((attn & 16U) != 0U) { val = readl((void const volatile *)bp->regview + 1114560U); printk("\vbnx2x: [%s:%d(%s)]ATC hw attention 0x%x\n", "bnx2x_attn_int_deasserted4", 5041, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); if ((int )val & 1) { printk("\vbnx2x: [%s:%d(%s)]ATC_ATC_INT_STS_REG_ADDRESS_ERROR\n", "bnx2x_attn_int_deasserted4", 5043, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 2U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]ATC_ATC_INT_STS_REG_ATC_TCPL_TO_NOT_PEND\n", "bnx2x_attn_int_deasserted4", 5045, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 4U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]ATC_ATC_INT_STS_REG_ATC_GPA_MULTIPLE_HITS\n", "bnx2x_attn_int_deasserted4", 5047, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 8U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]ATC_ATC_INT_STS_REG_ATC_RCPL_TO_EMPTY_CNT\n", "bnx2x_attn_int_deasserted4", 5049, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 16U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]ATC_ATC_INT_STS_REG_ATC_TCPL_ERROR\n", "bnx2x_attn_int_deasserted4", 5051, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((val & 32U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]ATC_ATC_INT_STS_REG_ATC_IREQ_LESS_THAN_STU\n", "bnx2x_attn_int_deasserted4", 5053, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((attn & 40U) != 0U) { printk("\vbnx2x: [%s:%d(%s)]FATAL parity attention set4 0x%x\n", "bnx2x_attn_int_deasserted4", 5060, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attn & 40U); } else { } return; } } static void bnx2x_attn_int_deasserted(struct bnx2x *bp , u32 deasserted ) { struct attn_route attn ; struct attn_route *group_mask ; int port ; int index ; u32 reg_addr ; u32 val ; u32 aeu_mask ; bool global ; bool tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { port = (int )bp->pfid & 1; global = 0; bnx2x_acquire_alr(bp); tmp = bnx2x_chk_parity_attn(bp, & global, 1); if ((int )tmp) { bp->recovery_state = 1; schedule_delayed_work(& bp->sp_rtnl_task, 0UL); bnx2x_int_disable(bp); bnx2x_release_alr(bp); return; } else { } attn.sig[0] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10507) * 4)); attn.sig[1] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10510) * 4)); attn.sig[2] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10513) * 4)); attn.sig[3] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10516) * 4)); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { attn.sig[4] = readl((void const volatile *)bp->regview + (unsigned long )((port + 10688) * 4)); } else { attn.sig[4] = 0U; } tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]attn: %08x %08x %08x %08x %08x\n", "bnx2x_attn_int_deasserted", 5105, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attn.sig[0], attn.sig[1], attn.sig[2], attn.sig[3], attn.sig[4]); } else { } index = 0; goto ldv_63950; ldv_63949: ; if (((u32 )(1 << index) & deasserted) != 0U) { group_mask = (struct attn_route *)(& bp->attn_group) + (unsigned long )index; tmp___1 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]group[%d]: %08x %08x %08x %08x %08x\n", "bnx2x_attn_int_deasserted", 5115, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", index, group_mask->sig[0], group_mask->sig[1], group_mask->sig[2], group_mask->sig[3], group_mask->sig[4]); } else { } bnx2x_attn_int_deasserted4(bp, attn.sig[4] & group_mask->sig[4]); bnx2x_attn_int_deasserted3(bp, attn.sig[3] & group_mask->sig[3]); bnx2x_attn_int_deasserted1(bp, attn.sig[1] & group_mask->sig[1]); bnx2x_attn_int_deasserted2(bp, attn.sig[2] & group_mask->sig[2]); bnx2x_attn_int_deasserted0(bp, attn.sig[0] & group_mask->sig[0]); } else { } index = index + 1; ldv_63950: ; if (index <= 7) { goto ldv_63949; } else { } bnx2x_release_alr(bp); if ((unsigned int )bp->common.int_block == 0U) { reg_addr = (u32 )((port + 33804) * 32 + 16); } else { reg_addr = 4467984U; } val = ~ deasserted; tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]about to mask 0x%08x at %s addr 0x%x\n", "bnx2x_attn_int_deasserted", 5140, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val, (unsigned int )bp->common.int_block == 0U ? (char *)"HC" : (char *)"IGU", reg_addr); } else { } writel(val, (void volatile *)bp->regview + (unsigned long )reg_addr); if ((~ bp->attn_state & deasserted) != 0U) { printk("\vbnx2x: [%s:%d(%s)]IGU OLD_ERROR\n", "bnx2x_attn_int_deasserted", 5144, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } reg_addr = port != 0 ? 41060U : 41056U; bnx2x_acquire_hw_lock(bp, (u32 )(port + 3)); aeu_mask = readl((void const volatile *)bp->regview + (unsigned long )reg_addr); tmp___3 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]aeu_mask %x newly deasserted %x\n", "bnx2x_attn_int_deasserted", 5153, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", aeu_mask, deasserted); } else { } aeu_mask = (deasserted & 1023U) | aeu_mask; tmp___4 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]new mask %x\n", "bnx2x_attn_int_deasserted", 5155, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", aeu_mask); } else { } writel(aeu_mask, (void volatile *)bp->regview + (unsigned long )reg_addr); bnx2x_release_hw_lock(bp, (u32 )(port + 3)); tmp___5 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]attn_state %x\n", "bnx2x_attn_int_deasserted", 5160, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->attn_state); } else { } bp->attn_state = bp->attn_state & ~ deasserted; tmp___6 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]new state %x\n", "bnx2x_attn_int_deasserted", 5162, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->attn_state); } else { } return; } } static void bnx2x_attn_int(struct bnx2x *bp ) { u32 attn_bits ; u32 attn_ack ; u32 attn_state ; u32 asserted ; u32 deasserted ; long tmp ; { attn_bits = (bp->def_status_blk)->atten_status_block.attn_bits; attn_ack = (bp->def_status_blk)->atten_status_block.attn_bits_ack; attn_state = bp->attn_state; asserted = (~ attn_ack & attn_bits) & ~ attn_state; deasserted = (~ attn_bits & attn_ack) & attn_state; tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]attn_bits %x attn_ack %x asserted %x deasserted %x\n", "bnx2x_attn_int", 5180, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attn_bits, attn_ack, asserted, deasserted); } else { } if ((~ (attn_bits ^ attn_ack) & (attn_bits ^ attn_state)) != 0U) { printk("\vbnx2x: [%s:%d(%s)]BAD attention state\n", "bnx2x_attn_int", 5183, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (asserted != 0U) { bnx2x_attn_int_asserted(bp, asserted); } else { } if (deasserted != 0U) { bnx2x_attn_int_deasserted(bp, deasserted); } else { } return; } } void bnx2x_igu_ack_sb(struct bnx2x *bp , u8 igu_sb_id , u8 segment , u16 index , u8 op , u8 update ) { u32 igu_addr ; { igu_addr = bp->igu_base_addr; igu_addr = (u32 )(((int )igu_sb_id + 1024) * 8) + igu_addr; bnx2x_igu_ack_sb_gen(bp, (int )igu_sb_id, (int )segment, (int )index, (int )op, (int )update, igu_addr); return; } } static void bnx2x_update_eq_prod(struct bnx2x *bp , u16 prod ) { { storm_memset_eq_prod(bp, (int )prod, (int )bp->pfid); __asm__ volatile ("": : : "memory"); return; } } static int bnx2x_cnic_handle_cfc_del(struct bnx2x *bp , u32 cid , union event_ring_elem *elem ) { u8 err ; long tmp ; long tmp___0 ; { err = elem->message.error; if (bp->cnic_eth_dev.starting_cid == 0U || (bp->cnic_eth_dev.starting_cid > cid && (u32 )bp->cnic_eth_dev.iscsi_l2_cid != cid)) { return (1); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]got delete ramrod for CNIC CID %d\n", "bnx2x_cnic_handle_cfc_del", 5219, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } tmp___0 = ldv__builtin_expect((unsigned int )err != 0U, 0L); if (tmp___0 != 0L) { printk("\vbnx2x: [%s:%d(%s)]got delete ramrod for CNIC CID %d with error!\n", "bnx2x_cnic_handle_cfc_del", 5224, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); bnx2x_panic_dump(bp, 0); } else { } bnx2x_cnic_cfc_comp(bp, (int )cid, (int )err); return (0); } } static void bnx2x_handle_mcast_eqe(struct bnx2x *bp ) { struct bnx2x_mcast_ramrod_params rparam ; int rc ; bool tmp ; { memset((void *)(& rparam), 0, 40UL); rparam.mcast_obj = & bp->mcast_obj; netif_addr_lock_bh(bp->dev); (*(bp->mcast_obj.raw.clear_pending))(& bp->mcast_obj.raw); tmp = (*(bp->mcast_obj.check_pending))(& bp->mcast_obj); if ((int )tmp) { rc = bnx2x_config_mcast(bp, & rparam, 1); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to send pending mcast commands: %d\n", "bnx2x_handle_mcast_eqe", 5250, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } } else { } netif_addr_unlock_bh(bp->dev); return; } } static void bnx2x_handle_classification_eqe(struct bnx2x *bp , union event_ring_elem *elem ) { unsigned long ramrod_flags ; int rc ; u32 cid ; struct bnx2x_vlan_mac_obj *vlan_mac_obj ; long tmp ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; long tmp___0 ; long tmp___1 ; { ramrod_flags = 0UL; rc = 0; cid = elem->message.data.eth_event.echo & 131071U; __set_bit(6L, (unsigned long volatile *)(& ramrod_flags)); switch (elem->message.data.eth_event.echo >> 17) { case 0U: tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Got SETUP_MAC completions\n", "bnx2x_handle_classification_eqe", 5270, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((int )bp->cnic_loaded) { __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; if (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U) == cid) { vlan_mac_obj = & bp->iscsi_l2_mac_obj; } else { vlan_mac_obj = & (bp->sp_objs + (unsigned long )cid)->mac_obj; } } else { vlan_mac_obj = & (bp->sp_objs + (unsigned long )cid)->mac_obj; } goto ldv_64005; case 9U: tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Got SETUP_MCAST completions\n", "bnx2x_handle_classification_eqe", 5278, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_handle_mcast_eqe(bp); return; default: printk("\vbnx2x: [%s:%d(%s)]Unsupported classification command: %d\n", "bnx2x_handle_classification_eqe", 5286, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", elem->message.data.eth_event.echo); return; } ldv_64005: rc = (*(vlan_mac_obj->complete))(bp, vlan_mac_obj, elem, & ramrod_flags); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to schedule new commands: %d\n", "bnx2x_handle_classification_eqe", 5293, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else if (rc > 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Scheduled next pending commands...\n", "bnx2x_handle_classification_eqe", 5295, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } return; } } static void bnx2x_set_iscsi_eth_rx_mode(struct bnx2x *bp , bool start ) ; static void bnx2x_handle_rx_mode_eqe(struct bnx2x *bp ) { int tmp ; int tmp___0 ; int tmp___1 ; { netif_addr_lock_bh(bp->dev); clear_bit(3L, (unsigned long volatile *)(& bp->sp_state)); tmp___1 = test_and_clear_bit(4L, (unsigned long volatile *)(& bp->sp_state)); if (tmp___1 != 0) { bnx2x_set_storm_rx_mode(bp); } else { tmp___0 = test_and_clear_bit(5L, (unsigned long volatile *)(& bp->sp_state)); if (tmp___0 != 0) { bnx2x_set_iscsi_eth_rx_mode(bp, 1); } else { tmp = test_and_clear_bit(6L, (unsigned long volatile *)(& bp->sp_state)); if (tmp != 0) { bnx2x_set_iscsi_eth_rx_mode(bp, 0); } else { } } } netif_addr_unlock_bh(bp->dev); return; } } static void bnx2x_after_afex_vif_lists(struct bnx2x *bp , union event_ring_elem *elem ) { long tmp ; long tmp___0 ; { if ((unsigned int )elem->message.data.vif_list_event.echo == 1U) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]afex: ramrod completed VIF LIST_GET, addrs 0x%x\n", "bnx2x_after_afex_vif_lists", 5325, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )elem->message.data.vif_list_event.func_bit_map); } else { } bnx2x_fw_command(bp, 3506438144U, (u32 )elem->message.data.vif_list_event.func_bit_map); } else if ((unsigned int )elem->message.data.vif_list_event.echo == 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]afex: ramrod completed VIF LIST_SET\n", "bnx2x_after_afex_vif_lists", 5330, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_fw_command(bp, 3523215360U, 0U); } else { } return; } } static void bnx2x_after_function_update(struct bnx2x *bp ) { int q ; int rc ; struct bnx2x_fastpath *fp ; struct bnx2x_queue_state_params queue_params ; struct bnx2x_queue_update_params *q_update_params ; { queue_params.q_obj = (struct bnx2x_queue_sp_obj *)0; queue_params.cmd = 0; queue_params.ramrod_flags = 0UL; queue_params.params.setup.gen_params.stat_id = (unsigned char)0; queue_params.params.setup.gen_params.spcl_id = (unsigned char)0; queue_params.params.setup.gen_params.mtu = (unsigned short)0; queue_params.params.setup.gen_params.cos = (unsigned char)0; queue_params.params.setup.gen_params.fp_hsi = (unsigned char)0; queue_params.params.setup.txq_params.dscr_map = 0ULL; queue_params.params.setup.txq_params.fw_sb_id = (unsigned char)0; queue_params.params.setup.txq_params.sb_cq_index = (unsigned char)0; queue_params.params.setup.txq_params.cos = (unsigned char)0; queue_params.params.setup.txq_params.traffic_type = (unsigned short)0; queue_params.params.setup.txq_params.tss_leading_cl_id = (unsigned char)0; queue_params.params.setup.txq_params.default_vlan = (unsigned short)0; queue_params.params.setup.rxq_params.dscr_map = 0ULL; queue_params.params.setup.rxq_params.sge_map = 0ULL; queue_params.params.setup.rxq_params.rcq_map = 0ULL; queue_params.params.setup.rxq_params.rcq_np_map = 0ULL; queue_params.params.setup.rxq_params.drop_flags = (unsigned short)0; queue_params.params.setup.rxq_params.buf_sz = (unsigned short)0; queue_params.params.setup.rxq_params.fw_sb_id = (unsigned char)0; queue_params.params.setup.rxq_params.cl_qzone_id = (unsigned char)0; queue_params.params.setup.rxq_params.tpa_agg_sz = (unsigned short)0; queue_params.params.setup.rxq_params.sge_buf_sz = (unsigned short)0; queue_params.params.setup.rxq_params.max_sges_pkt = (unsigned char)0; queue_params.params.setup.rxq_params.max_tpa_queues = (unsigned char)0; queue_params.params.setup.rxq_params.rss_engine_id = (unsigned char)0; queue_params.params.setup.rxq_params.mcast_engine_id = (unsigned char)0; queue_params.params.setup.rxq_params.cache_line_log = (unsigned char)0; queue_params.params.setup.rxq_params.sb_cq_index = (unsigned char)0; queue_params.params.setup.rxq_params.silent_removal_value = (unsigned short)0; queue_params.params.setup.rxq_params.silent_removal_mask = (unsigned short)0; queue_params.params.setup.pause_params.bd_th_lo = (unsigned short)0; queue_params.params.setup.pause_params.bd_th_hi = (unsigned short)0; queue_params.params.setup.pause_params.rcq_th_lo = (unsigned short)0; queue_params.params.setup.pause_params.rcq_th_hi = (unsigned short)0; queue_params.params.setup.pause_params.sge_th_lo = (unsigned short)0; queue_params.params.setup.pause_params.sge_th_hi = (unsigned short)0; queue_params.params.setup.pause_params.pri_map = (unsigned short)0; queue_params.params.setup.flags = 0UL; q_update_params = & queue_params.params.update; queue_params.cmd = 5; __set_bit(10L, (unsigned long volatile *)(& q_update_params->update_flags)); __set_bit(11L, (unsigned long volatile *)(& q_update_params->update_flags)); __set_bit(2L, (unsigned long volatile *)(& queue_params.ramrod_flags)); if ((unsigned int )bp->afex_vlan_mode == 1U) { q_update_params->silent_removal_value = 0U; q_update_params->silent_removal_mask = 0U; } else { q_update_params->silent_removal_value = (unsigned int )((u16 )bp->afex_def_vlan_tag) & 4095U; q_update_params->silent_removal_mask = 4095U; } q = 0; goto ldv_64029; ldv_64028: fp = bp->fp + (unsigned long )q; queue_params.q_obj = & (bp->sp_objs + (unsigned long )fp->index)->q_obj; rc = bnx2x_queue_state_change(bp, & queue_params); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to config silent vlan rem for Q %d\n", "bnx2x_after_function_update", 5373, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", q); } else { } q = q + 1; ldv_64029: ; if ((uint )q < bp->num_ethernet_queues) { goto ldv_64028; } else { } if ((bp->flags & 32768U) == 0U && (int )bp->cnic_enabled) { fp = bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues); queue_params.q_obj = & (bp->sp_objs + (unsigned long )fp->index)->q_obj; __clear_bit(2L, (unsigned long volatile *)(& queue_params.ramrod_flags)); __asm__ volatile ("": : : "memory"); set_bit(12L, (unsigned long volatile *)(& bp->sp_state)); __asm__ volatile ("": : : "memory"); rc = bnx2x_queue_state_change(bp, & queue_params); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to config silent vlan rem for Q %d\n", "bnx2x_after_function_update", 5392, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", q); } else { } } else { bnx2x_link_report(bp); bnx2x_fw_command(bp, 3556769792U, 0U); } return; } } static struct bnx2x_queue_sp_obj *bnx2x_cid_to_q_obj(struct bnx2x *bp , u32 cid ) { long tmp ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]retrieving fp from cid %d\n", "bnx2x_cid_to_q_obj", 5403, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } if ((int )bp->cnic_loaded) { __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; if ((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) + 1U == cid) { return (& (bp->sp_objs + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->q_obj); } else { return (& (bp->sp_objs + (unsigned long )(cid % ((uint )bp->num_queues - bp->num_cnic_queues)))->q_obj); } } else { return (& (bp->sp_objs + (unsigned long )(cid % ((uint )bp->num_queues - bp->num_cnic_queues)))->q_obj); } } } static void bnx2x_eq_int(struct bnx2x *bp ) { u16 hw_cons ; u16 sw_cons ; u16 sw_prod ; union event_ring_elem *elem ; u8 echo ; u32 cid ; u8 opcode ; int rc ; int spqe_cnt ; struct bnx2x_queue_sp_obj *q_obj ; struct bnx2x_func_sp_obj *f_obj ; struct bnx2x_raw_obj *rss_raw ; int tmp ; long tmp___0 ; long tmp___1 ; u16 tmp___2 ; long tmp___3 ; long tmp___4 ; int tmp___5 ; int tmp___6 ; long tmp___7 ; int tmp___8 ; long tmp___9 ; int tmp___10 ; long tmp___11 ; int tmp___12 ; int cmd ; long tmp___13 ; long tmp___14 ; int tmp___15 ; long tmp___16 ; int tmp___17 ; long tmp___18 ; int tmp___19 ; long tmp___20 ; long tmp___21 ; long tmp___22 ; long tmp___23 ; { spqe_cnt = 0; f_obj = & bp->func_obj; rss_raw = & bp->rss_conf_obj.raw; hw_cons = *(bp->eq_cons_sb); if (((unsigned long )hw_cons & 255UL) == 255UL) { hw_cons = (u16 )((int )hw_cons + 1); } else { } sw_cons = bp->eq_cons; sw_prod = bp->eq_prod; tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { tmp = atomic_read((atomic_t const *)(& bp->eq_spq_left)); printk("\rbnx2x: [%s:%d(%s)]EQ: hw_cons %u sw_cons %u bp->eq_spq_left %x\n", "bnx2x_eq_int", 5441, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )hw_cons, (int )sw_cons, tmp); } else { } goto ldv_64091; ldv_64090: elem = bp->eq_ring + ((unsigned long )sw_cons & 255UL); rc = bnx2x_iov_eq_sp_event(bp, elem); if (rc == 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_iov_eq_sp_event returned %d\n", "bnx2x_eq_int", 5451, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } goto next_spqe; } else { } cid = elem->message.data.cfc_del_event.cid & 131071U; opcode = elem->message.opcode; switch ((int )opcode) { case 0: bnx2x_vf_mbx_schedule(bp, & elem->message.data.vf_pf_event); goto ldv_64062; case 5: tmp___3 = ldv__builtin_expect((bp->msg_enable & 1179648) == 1179648, 0L); if (tmp___3 != 0L) { tmp___2 = bp->stats_comp; bp->stats_comp = (u16 )((int )bp->stats_comp + 1); printk("\rbnx2x: [%s:%d(%s)]got statistics comp event %d\n", "bnx2x_eq_int", 5470, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tmp___2); } else { } goto next_spqe; case 3: tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got delete ramrod for MULTI[%d]\n", "bnx2x_eq_int", 5481, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } if ((int )bp->cnic_loaded) { tmp___5 = bnx2x_cnic_handle_cfc_del(bp, cid, elem); if (tmp___5 == 0) { goto next_spqe; } else { } } else { } q_obj = bnx2x_cid_to_q_obj(bp, cid); tmp___6 = (*(q_obj->complete_cmd))(bp, q_obj, 8); if (tmp___6 != 0) { goto ldv_64065; } else { } goto next_spqe; case 6: tmp___7 = ldv__builtin_expect((bp->msg_enable & 135266304) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got STOP TRAFFIC\n", "bnx2x_eq_int", 5495, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_dcbx_set_params(bp, 2U); tmp___8 = (*(f_obj->complete_cmd))(bp, f_obj, 6); if (tmp___8 != 0) { goto ldv_64065; } else { } goto next_spqe; case 7: tmp___9 = ldv__builtin_expect((bp->msg_enable & 135266304) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got START TRAFFIC\n", "bnx2x_eq_int", 5503, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_dcbx_set_params(bp, 3U); tmp___10 = (*(f_obj->complete_cmd))(bp, f_obj, 7); if (tmp___10 != 0) { goto ldv_64065; } else { } goto next_spqe; case 12: echo = elem->message.data.function_update_event.echo; if ((unsigned int )echo == 0U) { tmp___11 = ldv__builtin_expect((bp->msg_enable & 1048608) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got FUNC_SWITCH_UPDATE ramrod\n", "bnx2x_eq_int", 5514, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___12 = (*(f_obj->complete_cmd))(bp, f_obj, 8); if (tmp___12 != 0) { goto ldv_64065; } else { } } else { cmd = 3; tmp___13 = ldv__builtin_expect((bp->msg_enable & 1114112) != 0, 0L); if (tmp___13 != 0L) { printk("\rbnx2x: [%s:%d(%s)]AFEX: ramrod completed FUNCTION_UPDATE\n", "bnx2x_eq_int", 5523, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } (*(f_obj->complete_cmd))(bp, f_obj, 4); bnx2x_schedule_sp_rtnl(bp, (enum sp_rtnl_flag )cmd, 0U); } goto next_spqe; case 13: (*(f_obj->complete_cmd))(bp, f_obj, 5); bnx2x_after_afex_vif_lists(bp, elem); goto next_spqe; case 1: tmp___14 = ldv__builtin_expect((bp->msg_enable & 1048608) != 0, 0L); if (tmp___14 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got FUNC_START ramrod\n", "bnx2x_eq_int", 5543, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___15 = (*(f_obj->complete_cmd))(bp, f_obj, 1); if (tmp___15 != 0) { goto ldv_64065; } else { } goto next_spqe; case 2: tmp___16 = ldv__builtin_expect((bp->msg_enable & 1048608) != 0, 0L); if (tmp___16 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got FUNC_STOP ramrod\n", "bnx2x_eq_int", 5551, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___17 = (*(f_obj->complete_cmd))(bp, f_obj, 2); if (tmp___17 != 0) { goto ldv_64065; } else { } goto next_spqe; case 18: tmp___18 = ldv__builtin_expect((bp->msg_enable & 17825792) != 0, 0L); if (tmp___18 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got set_timesync ramrod completion\n", "bnx2x_eq_int", 5559, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___19 = (*(f_obj->complete_cmd))(bp, f_obj, 9); if (tmp___19 != 0) { goto ldv_64065; } else { } goto next_spqe; } ldv_64065: ; switch ((int )opcode | (int )bp->state) { case 12299: ; case 8203: cid = elem->message.data.eth_event.echo & 131071U; tmp___20 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___20 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got RSS_UPDATE ramrod. CID %d\n", "bnx2x_eq_int", 5574, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cid); } else { } (*(rss_raw->clear_pending))(rss_raw); goto ldv_64076; case 12302: ; case 57358: ; case 16398: ; case 12303: ; case 57359: ; case 16399: tmp___21 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___21 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got (un)set mac ramrod\n", "bnx2x_eq_int", 5588, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_handle_classification_eqe(bp, elem); goto ldv_64076; case 12305: ; case 57361: ; case 16401: tmp___22 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___22 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got mcast ramrod\n", "bnx2x_eq_int", 5598, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_handle_mcast_eqe(bp); goto ldv_64076; case 12304: ; case 57360: ; case 16400: tmp___23 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___23 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got rx_mode ramrod\n", "bnx2x_eq_int", 5608, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_handle_rx_mode_eqe(bp); goto ldv_64076; default: printk("\vbnx2x: [%s:%d(%s)]Unknown EQ event %d, bp->state 0x%x\n", "bnx2x_eq_int", 5614, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )elem->message.opcode, (int )bp->state); } ldv_64076: ; next_spqe: spqe_cnt = spqe_cnt + 1; ldv_64062: sw_prod = ((unsigned long )sw_prod & 255UL) == 254UL ? (unsigned int )sw_prod + 2U : (unsigned int )sw_prod + 1U; sw_cons = ((unsigned long )sw_cons & 255UL) == 254UL ? (unsigned int )sw_cons + 2U : (unsigned int )sw_cons + 1U; ldv_64091: ; if ((int )sw_cons != (int )hw_cons) { goto ldv_64090; } else { } __asm__ volatile ("": : : "memory"); atomic_add(spqe_cnt, & bp->eq_spq_left); bp->eq_cons = sw_cons; bp->eq_prod = sw_prod; __asm__ volatile ("": : : "memory"); bnx2x_update_eq_prod(bp, (int )bp->eq_prod); return; } } static void bnx2x_sp_task(struct work_struct *work ) { struct bnx2x *bp ; struct work_struct const *__mptr ; long tmp ; u16 status ; u16 tmp___0 ; long tmp___1 ; long tmp___2 ; struct bnx2x_fastpath *fp ; int tmp___3 ; bool tmp___4 ; long tmp___5 ; long tmp___6 ; int tmp___7 ; int tmp___8 ; { __mptr = (struct work_struct const *)work; bp = (struct bnx2x *)__mptr + 0xfffffffffffffab0UL; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]sp task invoked\n", "bnx2x_sp_task", 5636, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } __asm__ volatile ("": : : "memory"); tmp___7 = atomic_read((atomic_t const *)(& bp->interrupt_occurred)); if (tmp___7 != 0) { tmp___0 = bnx2x_update_dsb_idx(bp); status = tmp___0; tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]status %x\n", "bnx2x_sp_task", 5645, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )status); } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]setting interrupt_occurred to 0\n", "bnx2x_sp_task", 5646, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } atomic_set(& bp->interrupt_occurred, 0); if ((int )status & 1) { bnx2x_attn_int(bp); status = (unsigned int )status & 65534U; } else { } if (((int )status & 2) != 0) { fp = bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues); if ((int )bp->fcoe_init) { tmp___3 = bnx2x_has_rx_work(fp); if (tmp___3 != 0) { local_bh_disable(); napi_schedule(& (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->napi); local_bh_enable(); } else { tmp___4 = bnx2x_has_tx_work(fp); if ((int )tmp___4) { local_bh_disable(); napi_schedule(& (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->napi); local_bh_enable(); } else { } } } else { } bnx2x_eq_int(bp); bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 0, (int )bp->def_idx, 2, 1); status = (unsigned int )status & 65533U; } else { } tmp___6 = ldv__builtin_expect((unsigned int )status != 0U, 0L); if (tmp___6 != 0L) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]got an unknown interrupt! (status 0x%x)\n", "bnx2x_sp_task", 5680, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )status); } else { } } else { } bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 4, (int )bp->def_att_idx, 0, 1); } else { } tmp___8 = test_and_clear_bit(13L, (unsigned long volatile *)(& bp->sp_state)); if (tmp___8 != 0) { bnx2x_link_report(bp); bnx2x_fw_command(bp, 3556769792U, 0U); } else { } return; } } irqreturn_t bnx2x_msix_sp_int(int irq , void *dev_instance ) { struct net_device *dev ; struct bnx2x *bp ; void *tmp ; struct cnic_ops *c_ops ; struct cnic_ops *________p1 ; struct cnic_ops *_________p1 ; union __anonunion___u_440 __u ; bool __warned ; int tmp___0 ; int tmp___1 ; { dev = (struct net_device *)dev_instance; tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 0, 0, 1, 0); if ((int )bp->cnic_loaded) { rcu_read_lock(); __read_once_size((void const volatile *)(& bp->cnic_ops), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_held(); if (tmp___1 == 0) { __warned = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 5712, "suspicious rcu_dereference_check() usage"); } else { } } else { } c_ops = ________p1; if ((unsigned long )c_ops != (unsigned long )((struct cnic_ops *)0)) { (*(c_ops->cnic_handler))(bp->cnic_data, (void *)0); } else { } rcu_read_unlock(); } else { } bnx2x_schedule_sp_task(bp); return (1); } } void bnx2x_drv_pulse(struct bnx2x *bp ) { { writel((unsigned int )bp->fw_drv_pulse_wr_seq, (void volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) * 44UL) + 1684UL))); return; } } static void bnx2x_timer(unsigned long data ) { struct bnx2x *bp ; bool tmp ; int tmp___0 ; int mb_idx ; u16 drv_pulse ; u16 mcp_pulse ; unsigned int tmp___1 ; { bp = (struct bnx2x *)data; tmp = netif_running((struct net_device const *)bp->dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } if ((bp->flags & 4194304U) == 0U && (bp->flags & 512U) == 0U) { mb_idx = ((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1); bp->fw_drv_pulse_wr_seq = (u16 )((int )bp->fw_drv_pulse_wr_seq + 1); bp->fw_drv_pulse_wr_seq = (unsigned int )bp->fw_drv_pulse_wr_seq & 32767U; drv_pulse = bp->fw_drv_pulse_wr_seq; bnx2x_drv_pulse(bp); tmp___1 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )mb_idx * 44UL) + 1688UL))); mcp_pulse = (unsigned int )((u16 )tmp___1) & 32767U; if ((((int )drv_pulse - (int )mcp_pulse) & 32767) > 5) { printk("\vbnx2x: [%s:%d(%s)]MFW seems hanged: drv_pulse (0x%x) != mcp_pulse (0x%x)\n", "bnx2x_timer", 5761, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )drv_pulse, (int )mcp_pulse); } else { } } else { } if ((unsigned int )bp->state == 12288U) { bnx2x_stats_handle(bp, 2); } else { } if ((bp->flags & 4194304U) != 0U) { bnx2x_timer_sriov(bp); } else { } ldv_mod_timer_13(& bp->timer, (unsigned long )bp->current_interval + (unsigned long )jiffies); return; } } static void bnx2x_fill(struct bnx2x *bp , u32 addr , int fill , u32 len ) { u32 i ; { if ((len & 3U) == 0U && (addr & 3U) == 0U) { i = 0U; goto ldv_64138; ldv_64137: writel((unsigned int )fill, (void volatile *)bp->regview + (unsigned long )(addr + i)); i = i + 4U; ldv_64138: ; if (i < len) { goto ldv_64137; } else { } } else { i = 0U; goto ldv_64141; ldv_64140: writeb((int )((unsigned char )fill), (void volatile *)bp->regview + (unsigned long )(addr + i)); i = i + 1U; ldv_64141: ; if (i < len) { goto ldv_64140; } else { } } return; } } static void bnx2x_wr_fp_sb_data(struct bnx2x *bp , int fw_sb_id , u32 *sb_data_p , u32 data_size ) { int index ; { index = 0; goto ldv_64151; ldv_64150: writel(*(sb_data_p + (unsigned long )index), (void volatile *)(bp->regview + ((unsigned long )(((unsigned int )(bp->iro_arr + 137UL)->base + (unsigned int )((int )(bp->iro_arr + 137UL)->m1 * fw_sb_id)) + 4259840U) + (unsigned long )index * 4UL))); index = index + 1; ldv_64151: ; if ((u32 )index < data_size) { goto ldv_64150; } else { } return; } } static void bnx2x_zero_fp_sb(struct bnx2x *bp , int fw_sb_id ) { u32 *sb_data_p ; u32 data_size ; struct hc_status_block_data_e2 sb_data_e2 ; struct hc_status_block_data_e1x sb_data_e1x ; { data_size = 0U; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { memset((void *)(& sb_data_e2), 0, 64UL); sb_data_e2.common.state = 0U; sb_data_e2.common.p_func.vf_valid = 0U; sb_data_p = (u32 *)(& sb_data_e2); data_size = 16U; } else { memset((void *)(& sb_data_e1x), 0, 64UL); sb_data_e1x.common.state = 0U; sb_data_e1x.common.p_func.vf_valid = 0U; sb_data_p = (u32 *)(& sb_data_e1x); data_size = 16U; } bnx2x_wr_fp_sb_data(bp, fw_sb_id, sb_data_p, data_size); bnx2x_fill(bp, ((unsigned int )(bp->iro_arr + 136UL)->base + (unsigned int )((int )(bp->iro_arr + 136UL)->m1 * fw_sb_id)) + 4259840U, 0, (u32 )(bp->iro_arr + 136UL)->size); bnx2x_fill(bp, ((unsigned int )(bp->iro_arr + 141UL)->base + (unsigned int )((int )(bp->iro_arr + 141UL)->m1 * fw_sb_id)) + 4259840U, 0, (u32 )(bp->iro_arr + 141UL)->size); return; } } static void bnx2x_wr_sp_sb_data(struct bnx2x *bp , struct hc_sp_status_block_data *sp_sb_data ) { int func ; int i ; { func = (int )bp->pfid; i = 0; goto ldv_64168; ldv_64167: writel(*((u32 *)sp_sb_data + (unsigned long )i), (void volatile *)(bp->regview + ((unsigned long )(((unsigned int )(bp->iro_arr + 146UL)->base + (unsigned int )((int )(bp->iro_arr + 146UL)->m1 * func)) + 4259840U) + (unsigned long )i * 4UL))); i = i + 1; ldv_64168: ; if ((unsigned int )i <= 3U) { goto ldv_64167; } else { } return; } } static void bnx2x_zero_sp_sb(struct bnx2x *bp ) { int func ; struct hc_sp_status_block_data sp_sb_data ; { func = (int )bp->pfid; memset((void *)(& sp_sb_data), 0, 16UL); sp_sb_data.state = 0U; sp_sb_data.p_func.vf_valid = 0U; bnx2x_wr_sp_sb_data(bp, & sp_sb_data); bnx2x_fill(bp, ((unsigned int )(bp->iro_arr + 145UL)->base + (unsigned int )((int )(bp->iro_arr + 145UL)->m1 * func)) + 4259840U, 0, (u32 )(bp->iro_arr + 145UL)->size); bnx2x_fill(bp, ((unsigned int )(bp->iro_arr + 148UL)->base + (unsigned int )((int )(bp->iro_arr + 148UL)->m1 * func)) + 4259840U, 0, (u32 )(bp->iro_arr + 148UL)->size); return; } } static void bnx2x_setup_ndsb_state_machine(struct hc_status_block_sm *hc_sm , int igu_sb_id , int igu_seg_id ) { { hc_sm->igu_sb_id = (u8 )igu_sb_id; hc_sm->igu_seg_id = (u8 )igu_seg_id; hc_sm->timer_value = 255U; hc_sm->time_to_expire = 4294967295U; return; } } static void bnx2x_map_sb_state_machines(struct hc_index_data *index_data ) { { (index_data + 1UL)->flags = (unsigned int )(index_data + 1UL)->flags & 254U; (index_data + 4UL)->flags = (unsigned int )(index_data + 4UL)->flags & 254U; (index_data + 5UL)->flags = (unsigned int )(index_data + 5UL)->flags & 254U; (index_data + 6UL)->flags = (unsigned int )(index_data + 6UL)->flags & 254U; (index_data + 7UL)->flags = (unsigned int )(index_data + 7UL)->flags & 254U; (index_data + 1UL)->flags = (index_data + 1UL)->flags; (index_data + 4UL)->flags = (u8 )((unsigned int )(index_data + 4UL)->flags | 1U); (index_data + 5UL)->flags = (u8 )((unsigned int )(index_data + 5UL)->flags | 1U); (index_data + 6UL)->flags = (u8 )((unsigned int )(index_data + 6UL)->flags | 1U); (index_data + 7UL)->flags = (u8 )((unsigned int )(index_data + 7UL)->flags | 1U); return; } } void bnx2x_init_sb(struct bnx2x *bp , dma_addr_t mapping , int vfid , u8 vf_valid , int fw_sb_id , int igu_sb_id ) { int igu_seg_id ; struct hc_status_block_data_e2 sb_data_e2 ; struct hc_status_block_data_e1x sb_data_e1x ; struct hc_status_block_sm *hc_sm_p ; int data_size ; u32 *sb_data_p ; long tmp ; { if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0) { igu_seg_id = 0; } else { igu_seg_id = 0; } bnx2x_zero_fp_sb(bp, fw_sb_id); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { memset((void *)(& sb_data_e2), 0, 64UL); sb_data_e2.common.state = 1U; sb_data_e2.common.p_func.pf_id = bp->pfid; sb_data_e2.common.p_func.vf_id = (u8 )vfid; sb_data_e2.common.p_func.vf_valid = vf_valid; sb_data_e2.common.p_func.vnic_id = (u8 )((int )bp->pfid >> 1); sb_data_e2.common.same_igu_sb_1b = 1U; sb_data_e2.common.host_sb_addr.hi = (unsigned int )(mapping >> 32); sb_data_e2.common.host_sb_addr.lo = (unsigned int )mapping; hc_sm_p = (struct hc_status_block_sm *)(& sb_data_e2.common.state_machine); sb_data_p = (u32 *)(& sb_data_e2); data_size = 16; bnx2x_map_sb_state_machines((struct hc_index_data *)(& sb_data_e2.index_data)); } else { memset((void *)(& sb_data_e1x), 0, 64UL); sb_data_e1x.common.state = 1U; sb_data_e1x.common.p_func.pf_id = bp->pfid; sb_data_e1x.common.p_func.vf_id = 255U; sb_data_e1x.common.p_func.vf_valid = 0U; sb_data_e1x.common.p_func.vnic_id = (u8 )((int )bp->pfid >> 1); sb_data_e1x.common.same_igu_sb_1b = 1U; sb_data_e1x.common.host_sb_addr.hi = (unsigned int )(mapping >> 32); sb_data_e1x.common.host_sb_addr.lo = (unsigned int )mapping; hc_sm_p = (struct hc_status_block_sm *)(& sb_data_e1x.common.state_machine); sb_data_p = (u32 *)(& sb_data_e1x); data_size = 16; bnx2x_map_sb_state_machines((struct hc_index_data *)(& sb_data_e1x.index_data)); } bnx2x_setup_ndsb_state_machine(hc_sm_p, igu_sb_id, igu_seg_id); bnx2x_setup_ndsb_state_machine(hc_sm_p + 1UL, igu_sb_id, igu_seg_id); tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Init FW SB %d\n", "bnx2x_init_sb", 5963, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", fw_sb_id); } else { } bnx2x_wr_fp_sb_data(bp, fw_sb_id, sb_data_p, (u32 )data_size); return; } } static void bnx2x_update_coalesce_sb(struct bnx2x *bp , u8 fw_sb_id , u16 tx_usec , u16 rx_usec ) { { bnx2x_update_coalesce_sb_index(bp, (int )fw_sb_id, 1, 0, (int )rx_usec); bnx2x_update_coalesce_sb_index(bp, (int )fw_sb_id, 5, 0, (int )tx_usec); bnx2x_update_coalesce_sb_index(bp, (int )fw_sb_id, 6, 0, (int )tx_usec); bnx2x_update_coalesce_sb_index(bp, (int )fw_sb_id, 7, 0, (int )tx_usec); return; } } static void bnx2x_init_def_sb(struct bnx2x *bp ) { struct host_sp_status_block *def_sb ; dma_addr_t mapping ; int igu_sp_sb_index ; int igu_seg_id ; int port ; int func ; int reg_offset ; int reg_offset_en5 ; u64 section ; int index ; struct hc_sp_status_block_data sp_sb_data ; int sindex ; { def_sb = bp->def_status_blk; mapping = bp->def_status_blk_mapping; port = (int )bp->pfid & 1; func = (int )bp->pfid; memset((void *)(& sp_sb_data), 0, 16UL); if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0) { igu_sp_sb_index = 16; igu_seg_id = 0; } else { igu_sp_sb_index = (int )bp->igu_dsb_id; igu_seg_id = 1; } section = mapping; def_sb->atten_status_block.status_block_id = (u8 )igu_sp_sb_index; bp->attn_state = 0U; reg_offset = port != 0 ? 41228 : 41068; reg_offset_en5 = port != 0 ? 42672 : 42632; index = 0; goto ldv_64223; ldv_64222: sindex = 0; goto ldv_64220; ldv_64219: bp->attn_group[index].sig[sindex] = readl((void const volatile *)bp->regview + (unsigned long )((index * 4 + sindex) * 4 + reg_offset)); sindex = sindex + 1; ldv_64220: ; if (sindex <= 3) { goto ldv_64219; } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { bp->attn_group[index].sig[4] = readl((void const volatile *)bp->regview + (unsigned long )(index * 4 + reg_offset_en5)); } else { bp->attn_group[index].sig[4] = 0U; } index = index + 1; ldv_64223: ; if (index <= 7) { goto ldv_64222; } else { } if ((unsigned int )bp->common.int_block == 0U) { reg_offset = port != 0 ? 1081376 : 1081368; writel((unsigned int )section, (void volatile *)bp->regview + (unsigned long )reg_offset); writel((unsigned int )(section >> 32), (void volatile *)(bp->regview + ((unsigned long )reg_offset + 4UL))); } else if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel((unsigned int )section, (void volatile *)bp->regview + 1245472U); writel((unsigned int )(section >> 32), (void volatile *)bp->regview + 1245468U); } else { } section = mapping + 16ULL; bnx2x_zero_sp_sb(bp); sp_sb_data.state = 1U; sp_sb_data.host_sb_addr.lo = (unsigned int )section; sp_sb_data.host_sb_addr.hi = (unsigned int )(section >> 32); sp_sb_data.igu_sb_id = (u8 )igu_sp_sb_index; sp_sb_data.igu_seg_id = (u8 )igu_seg_id; sp_sb_data.p_func.pf_id = (u8 )func; sp_sb_data.p_func.vnic_id = (u8 )((int )bp->pfid >> 1); sp_sb_data.p_func.vf_id = 255U; bnx2x_wr_sp_sb_data(bp, & sp_sb_data); bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 0, 0, 0, 0); return; } } void bnx2x_update_coalesce(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_64230; ldv_64229: bnx2x_update_coalesce_sb(bp, (int )(bp->fp + (unsigned long )i)->fw_sb_id, (int )bp->tx_ticks, (int )bp->rx_ticks); i = i + 1; ldv_64230: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_64229; } else { } return; } } static void bnx2x_init_sp_ring(struct bnx2x *bp ) { struct lock_class_key __key ; { spinlock_check(& bp->spq_lock); __raw_spin_lock_init(& bp->spq_lock.__annonCompField18.rlock, "&(&bp->spq_lock)->rlock", & __key); atomic_set(& bp->cq_spq_left, 8); bp->spq_prod_idx = 0U; bp->dsb_sp_prod = (__le16 *)(& (bp->def_status_blk)->sp_sb.index_values) + 3UL; bp->spq_prod_bd = bp->spq; bp->spq_last_bd = bp->spq_prod_bd + 255UL; return; } } static void bnx2x_init_eq_ring(struct bnx2x *bp ) { int i ; union event_ring_elem *elem ; int __min1 ; int __min2 ; { i = 1; goto ldv_64242; ldv_64241: elem = bp->eq_ring + ((unsigned long )i * 256UL + 0xffffffffffffffffUL); elem->next_page.addr.hi = (unsigned int )(bp->eq_mapping >> 32); elem->next_page.addr.lo = (unsigned int )bp->eq_mapping; i = i + 1; ldv_64242: ; if (i <= 1) { goto ldv_64241; } else { } bp->eq_cons = 0U; bp->eq_prod = 256U; bp->eq_cons_sb = (__le16 *)(& (bp->def_status_blk)->sp_sb.index_values) + 7UL; __min1 = 247; __min2 = 256; atomic_set(& bp->eq_spq_left, (__min1 < __min2 ? __min1 : __min2) + -1); return; } } static int bnx2x_set_q_rx_mode(struct bnx2x *bp , u8 cl_id , unsigned long rx_mode_flags , unsigned long rx_accept_flags , unsigned long tx_accept_flags , unsigned long ramrod_flags ) { struct bnx2x_rx_mode_ramrod_params ramrod_param ; int rc ; { memset((void *)(& ramrod_param), 0, 80UL); ramrod_param.cid = 0U; ramrod_param.cl_id = cl_id; ramrod_param.rx_mode_obj = & bp->rx_mode_obj; ramrod_param.func_id = bp->pfid; ramrod_param.pstate = & bp->sp_state; ramrod_param.state = 3; ramrod_param.rdata = (void *)(& (bp->slowpath)->rx_mode_rdata); ramrod_param.rdata_mapping = bp->slowpath_mapping + 1032ULL; set_bit(3L, (unsigned long volatile *)(& bp->sp_state)); ramrod_param.ramrod_flags = ramrod_flags; ramrod_param.rx_mode_flags = rx_mode_flags; ramrod_param.rx_accept_flags = rx_accept_flags; ramrod_param.tx_accept_flags = tx_accept_flags; rc = bnx2x_config_rx_mode(bp, & ramrod_param); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Set rx_mode %d failed\n", "bnx2x_set_q_rx_mode", 6144, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->rx_mode); return (rc); } else { } return (0); } } static int bnx2x_fill_accept_flags(struct bnx2x *bp , u32 rx_mode , unsigned long *rx_accept_flags , unsigned long *tx_accept_flags ) { { *rx_accept_flags = 0UL; *tx_accept_flags = 0UL; switch (rx_mode) { case 0U: ; goto ldv_64265; case 1U: __set_bit(0L, (unsigned long volatile *)rx_accept_flags); __set_bit(1L, (unsigned long volatile *)rx_accept_flags); __set_bit(4L, (unsigned long volatile *)rx_accept_flags); __set_bit(0L, (unsigned long volatile *)tx_accept_flags); __set_bit(1L, (unsigned long volatile *)tx_accept_flags); __set_bit(4L, (unsigned long volatile *)tx_accept_flags); goto ldv_64265; case 2U: __set_bit(0L, (unsigned long volatile *)rx_accept_flags); __set_bit(3L, (unsigned long volatile *)rx_accept_flags); __set_bit(4L, (unsigned long volatile *)rx_accept_flags); __set_bit(0L, (unsigned long volatile *)tx_accept_flags); __set_bit(3L, (unsigned long volatile *)tx_accept_flags); __set_bit(4L, (unsigned long volatile *)tx_accept_flags); goto ldv_64265; case 3U: __set_bit(5L, (unsigned long volatile *)rx_accept_flags); __set_bit(0L, (unsigned long volatile *)rx_accept_flags); __set_bit(3L, (unsigned long volatile *)rx_accept_flags); __set_bit(4L, (unsigned long volatile *)rx_accept_flags); __set_bit(3L, (unsigned long volatile *)tx_accept_flags); __set_bit(4L, (unsigned long volatile *)tx_accept_flags); if ((unsigned int )bp->mf_mode == 2U) { __set_bit(2L, (unsigned long volatile *)tx_accept_flags); } else { __set_bit(0L, (unsigned long volatile *)tx_accept_flags); } goto ldv_64265; default: printk("\vbnx2x: [%s:%d(%s)]Unknown rx_mode: %d\n", "bnx2x_fill_accept_flags", 6209, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rx_mode); return (-22); } ldv_64265: ; if (rx_mode != 0U) { __set_bit(6L, (unsigned long volatile *)rx_accept_flags); __set_bit(6L, (unsigned long volatile *)tx_accept_flags); } else { } return (0); } } static int bnx2x_set_storm_rx_mode(struct bnx2x *bp ) { unsigned long rx_mode_flags ; unsigned long ramrod_flags ; unsigned long rx_accept_flags ; unsigned long tx_accept_flags ; int rc ; int tmp ; { rx_mode_flags = 0UL; ramrod_flags = 0UL; rx_accept_flags = 0UL; tx_accept_flags = 0UL; if ((bp->flags & 32768U) == 0U) { __set_bit(0L, (unsigned long volatile *)(& rx_mode_flags)); } else { } rc = bnx2x_fill_accept_flags(bp, bp->rx_mode, & rx_accept_flags, & tx_accept_flags); if (rc != 0) { return (rc); } else { } __set_bit(1L, (unsigned long volatile *)(& ramrod_flags)); __set_bit(0L, (unsigned long volatile *)(& ramrod_flags)); tmp = bnx2x_set_q_rx_mode(bp, (int )(bp->fp)->cl_id, rx_mode_flags, rx_accept_flags, tx_accept_flags, ramrod_flags); return (tmp); } } static void bnx2x_init_internal_common(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_64284; ldv_64283: writel(0U, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 212UL)->base + (unsigned int )(i * 4)) + 4194304U)); i = i + 1; ldv_64284: ; if ((int )((unsigned short )(bp->iro_arr + 212UL)->size) >> 2 > i) { goto ldv_64283; } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writeb((unsigned int )((unsigned char )((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0)) == 0U, (void volatile *)bp->regview + (unsigned long )((unsigned int )(bp->iro_arr + 161UL)->base + 4259840U)); } else { } return; } } static void bnx2x_init_internal(struct bnx2x *bp , u32 load_code ) { { switch (load_code) { case 269484032U: ; case 269680640U: bnx2x_init_internal_common(bp); case 269549568U: ; case 269615104U: ; goto ldv_64294; default: printk("\vbnx2x: [%s:%d(%s)]Unknown load_code (0x%x) from MCP\n", "bnx2x_init_internal", 6280, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", load_code); goto ldv_64294; } ldv_64294: ; return; } } __inline static u8 bnx2x_fp_igu_sb_id(struct bnx2x_fastpath *fp ) { { return (((int )(fp->bp)->igu_base_sb + (int )fp->index) + (int )(fp->bp)->cnic_support); } } __inline static u8 bnx2x_fp_fw_sb_id(struct bnx2x_fastpath *fp ) { { return (((int )((u8 )(fp->bp)->base_fw_ndsb) + (int )fp->index) + (int )(fp->bp)->cnic_support); } } static u8 bnx2x_fp_cl_id(struct bnx2x_fastpath *fp ) { u8 tmp ; { if ((fp->bp)->common.chip_id >> 16 == 5710U || ((fp->bp)->common.chip_id >> 16 == 5711U || (fp->bp)->common.chip_id >> 16 == 5712U)) { return (((int )((u8 )((int )(fp->bp)->pfid >> 1)) << 2U) + (int )fp->index); } else { tmp = bnx2x_fp_igu_sb_id(fp); return (tmp); } } } static void bnx2x_init_eth_fp(struct bnx2x *bp , int fp_idx ) { struct bnx2x_fastpath *fp ; u8 cos ; unsigned long q_type ; u32 cids[3U] ; unsigned int tmp ; long tmp___0 ; long tmp___1 ; { fp = bp->fp + (unsigned long )fp_idx; q_type = 0UL; cids[0] = 0U; tmp = 1U; while (1) { if (tmp >= 3U) { break; } else { } cids[tmp] = 0U; tmp = tmp + 1U; } fp->rx_queue = (u8 )fp_idx; fp->cid = (u32 )fp_idx; fp->cl_id = bnx2x_fp_cl_id(fp); fp->fw_sb_id = bnx2x_fp_fw_sb_id(fp); fp->igu_sb_id = bnx2x_fp_igu_sb_id(fp); fp->cl_qzone_id = bnx2x_fp_qzone_id(fp); fp->ustorm_rx_prods_offset = bnx2x_rx_ustorm_prods_offset(fp); fp->rx_cons_sb = fp->sb_index_values + 1UL; __set_bit(0L, (unsigned long volatile *)(& q_type)); __set_bit(1L, (unsigned long volatile *)(& q_type)); tmp___0 = ldv__builtin_expect((unsigned int )fp->max_cos > 3U, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c"), "i" (6327), "i" (12UL)); ldv_64314: ; goto ldv_64314; } else { } cos = 0U; goto ldv_64316; ldv_64315: bnx2x_init_txdata(bp, fp->txdata_ptr[(int )cos], fp->cid + (uint )cos * ((uint )bp->num_queues - bp->num_cnic_queues), (int )((uint )fp->index + (uint )cos * ((uint )bp->num_queues - bp->num_cnic_queues)), fp->sb_index_values + ((unsigned long )cos + 5UL), fp); cids[(int )cos] = (fp->txdata_ptr[(int )cos])->cid; cos = (u8 )((int )cos + 1); ldv_64316: ; if ((int )fp->max_cos > (int )cos) { goto ldv_64315; } else { } if ((bp->flags & 4194304U) != 0U) { return; } else { } bnx2x_init_sb(bp, fp->status_blk_mapping, 255, 0, (int )fp->fw_sb_id, (int )fp->igu_sb_id); bnx2x_update_fpsb_idx(fp); bnx2x_init_queue_obj(bp, & (bp->sp_objs + (unsigned long )fp->index)->q_obj, (int )fp->cl_id, (u32 *)(& cids), (int )fp->max_cos, (int )bp->pfid, (void *)(& (bp->slowpath)->q_rdata), bp->slowpath_mapping + 2512ULL, q_type); bnx2x_init_vlan_mac_fp_objs(fp, 2); tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]queue[%d]: bnx2x_init_sb(%p,%p) cl_id %d fw_sb %d igu_sb %d\n", "bnx2x_init_eth_fp", 6357, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", fp_idx, bp, fp->status_blk.e2_sb, (int )fp->cl_id, (int )fp->fw_sb_id, (int )fp->igu_sb_id); } else { } return; } } static void bnx2x_init_tx_ring_one(struct bnx2x_fp_txdata *txdata ) { int i ; struct eth_tx_next_bd *tx_next_bd ; { i = 1; goto ldv_64325; ldv_64324: tx_next_bd = & (txdata->tx_desc_ring + ((unsigned long )i * 256UL + 0xffffffffffffffffUL))->next_bd; tx_next_bd->addr_hi = (unsigned int )((txdata->tx_desc_mapping + (dma_addr_t )((i % 16) * 4096)) >> 32); tx_next_bd->addr_lo = (unsigned int )txdata->tx_desc_mapping + (unsigned int )((i % 16) * 4096); i = i + 1; ldv_64325: ; if (i <= 16) { goto ldv_64324; } else { } *(txdata->tx_cons_sb) = 0U; txdata->tx_db.data.header.header = (unsigned int )txdata->tx_db.data.header.header & 253U; txdata->tx_db.data.header.header = (u8 )((unsigned int )txdata->tx_db.data.header.header | 2U); txdata->tx_db.data.zero_fill1 = 0U; txdata->tx_db.data.prod = 0U; txdata->tx_pkt_prod = 0U; txdata->tx_pkt_cons = 0U; txdata->tx_bd_prod = 0U; txdata->tx_bd_cons = 0U; txdata->tx_pkt = 0UL; return; } } static void bnx2x_init_tx_rings_cnic(struct bnx2x *bp ) { int i ; { i = (int )bp->num_ethernet_queues; goto ldv_64333; ldv_64332: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_init_tx_ring_one((bp->fp + (unsigned long )i)->txdata_ptr[0]); } i = i + 1; ldv_64333: ; if (bp->num_queues > i) { goto ldv_64332; } else { } return; } } static void bnx2x_init_tx_rings(struct bnx2x *bp ) { int i ; u8 cos ; { i = 0; goto ldv_64344; ldv_64343: cos = 0U; goto ldv_64341; ldv_64340: bnx2x_init_tx_ring_one((bp->fp + (unsigned long )i)->txdata_ptr[(int )cos]); cos = (u8 )((int )cos + 1); ldv_64341: ; if ((int )(bp->fp + (unsigned long )i)->max_cos > (int )cos) { goto ldv_64340; } else { } i = i + 1; ldv_64344: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_64343; } else { } return; } } static void bnx2x_init_fcoe_fp(struct bnx2x *bp ) { struct bnx2x_fastpath *fp ; unsigned long q_type ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; long tmp ; long tmp___0 ; long tmp___1 ; { fp = bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues); q_type = 0UL; (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->rx_queue = (u8 )bp->num_ethernet_queues; (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->cl_id = bnx2x_cnic_eth_cl_id(bp, 1); __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->cid = (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) + 1U; (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->fw_sb_id = 222U; (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->igu_sb_id = bp->igu_dsb_id; (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->rx_cons_sb = (__le16 *)(& (bp->def_status_blk)->sp_sb.index_values) + 4UL; bnx2x_init_txdata(bp, (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->txdata_ptr[0], fp->cid, (int )(((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos), (__le16 *)(& (bp->def_status_blk)->sp_sb.index_values) + 6UL, fp); tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]created fcoe tx data (fp index %d)\n", "bnx2x_init_fcoe_fp", 6423, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index); } else { } (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->cl_qzone_id = bnx2x_fp_qzone_id(fp); (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->ustorm_rx_prods_offset = bnx2x_rx_ustorm_prods_offset(fp); __set_bit(0L, (unsigned long volatile *)(& q_type)); __set_bit(1L, (unsigned long volatile *)(& q_type)); tmp___0 = ldv__builtin_expect((unsigned int )fp->max_cos != 1U, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c"), "i" (6436), "i" (12UL)); ldv_64360: ; goto ldv_64360; } else { } bnx2x_init_queue_obj(bp, & (bp->sp_objs + (unsigned long )fp->index)->q_obj, (int )fp->cl_id, & fp->cid, 1, (int )bp->pfid, (void *)(& (bp->slowpath)->q_rdata), bp->slowpath_mapping + 2512ULL, q_type); tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]queue[%d]: bnx2x_init_sb(%p,%p) cl_id %d fw_sb %d igu_sb %d\n", "bnx2x_init_fcoe_fp", 6445, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index, bp, fp->status_blk.e2_sb, (int )fp->cl_id, (int )fp->fw_sb_id, (int )fp->igu_sb_id); } else { } return; } } void bnx2x_nic_init_cnic(struct bnx2x *bp ) { u8 tmp ; u8 tmp___0 ; { if ((bp->flags & 32768U) == 0U) { bnx2x_init_fcoe_fp(bp); } else { } tmp = bnx2x_cnic_igu_sb_id(bp); tmp___0 = bnx2x_cnic_fw_sb_id(bp); bnx2x_init_sb(bp, bp->cnic_sb_mapping, 255, 0, (int )tmp___0, (int )tmp); __asm__ volatile ("lfence": : : "memory"); bnx2x_init_rx_rings_cnic(bp); bnx2x_init_tx_rings_cnic(bp); __asm__ volatile ("mfence": : : "memory"); __asm__ volatile ("": : : "memory"); return; } } void bnx2x_pre_irq_nic_init(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_64369; ldv_64368: bnx2x_init_eth_fp(bp, i); i = i + 1; ldv_64369: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_64368; } else { } __asm__ volatile ("lfence": : : "memory"); bnx2x_init_rx_rings(bp); bnx2x_init_tx_rings(bp); if ((bp->flags & 4194304U) == 0U) { bnx2x_init_mod_abs_int(bp, & bp->link_vars, bp->common.chip_id, bp->common.shmem_base, bp->common.shmem2_base, (int )bp->pfid & 1); bnx2x_init_def_sb(bp); bnx2x_update_dsb_idx(bp); bnx2x_init_sp_ring(bp); } else { bnx2x_memset_stats(bp); } return; } } void bnx2x_post_irq_nic_init(struct bnx2x *bp , u32 load_code ) { unsigned int tmp ; { bnx2x_init_eq_ring(bp); bnx2x_init_internal(bp, load_code); bnx2x_pf_init(bp); bnx2x_stats_init(bp); __asm__ volatile ("mfence": : : "memory"); __asm__ volatile ("": : : "memory"); bnx2x_int_enable(bp); tmp = readl((void const volatile *)bp->regview + (unsigned long )((((int )bp->pfid & 1) + 10507) * 4)); bnx2x_attn_int_deasserted0(bp, tmp & 32768U); return; } } static int bnx2x_gunzip_init(struct bnx2x *bp ) { void *tmp ; int tmp___0 ; { bp->gunzip_buf = dma_alloc_attrs(& (bp->pdev)->dev, 32768UL, & bp->gunzip_mapping, 208U, (struct dma_attrs *)0); if ((unsigned long )bp->gunzip_buf == (unsigned long )((void *)0)) { goto gunzip_nomem1; } else { } tmp = kmalloc(96UL, 208U); bp->strm = (struct z_stream_s *)tmp; if ((unsigned long )bp->strm == (unsigned long )((struct z_stream_s *)0)) { goto gunzip_nomem2; } else { } tmp___0 = zlib_inflate_workspacesize(); (bp->strm)->workspace = vmalloc((unsigned long )tmp___0); if ((unsigned long )(bp->strm)->workspace == (unsigned long )((void *)0)) { goto gunzip_nomem3; } else { } return (0); gunzip_nomem3: kfree((void const *)bp->strm); bp->strm = (struct z_stream_s *)0; gunzip_nomem2: dma_free_attrs(& (bp->pdev)->dev, 32768UL, bp->gunzip_buf, bp->gunzip_mapping, (struct dma_attrs *)0); bp->gunzip_buf = (void *)0; gunzip_nomem1: printk("\vbnx2x: [%s:%d(%s)]Cannot allocate firmware buffer for un-compression\n", "bnx2x_gunzip_init", 6542, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } } static void bnx2x_gunzip_end(struct bnx2x *bp ) { { if ((unsigned long )bp->strm != (unsigned long )((struct z_stream_s *)0)) { vfree((void const *)(bp->strm)->workspace); kfree((void const *)bp->strm); bp->strm = (struct z_stream_s *)0; } else { } if ((unsigned long )bp->gunzip_buf != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, 32768UL, bp->gunzip_buf, bp->gunzip_mapping, (struct dma_attrs *)0); bp->gunzip_buf = (void *)0; } else { } return; } } static int bnx2x_gunzip(struct bnx2x *bp , u8 const *zbuf , int len ) { int n ; int rc ; int tmp ; { if (((unsigned int )((unsigned char )*zbuf) != 31U || (unsigned int )((unsigned char )*(zbuf + 1UL)) != 139U) || (unsigned int )((unsigned char )*(zbuf + 2UL)) != 8U) { printk("\vbnx2x: [%s:%d(%s)]Bad gzip header\n", "bnx2x_gunzip", 6567, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } n = 10; if (((int )*(zbuf + 3UL) & 8) != 0) { goto ldv_64394; ldv_64393: ; ldv_64394: tmp = n; n = n + 1; if ((unsigned int )((unsigned char )*(zbuf + (unsigned long )tmp)) != 0U && n < len) { goto ldv_64393; } else { } } else { } (bp->strm)->next_in = zbuf + (unsigned long )n; (bp->strm)->avail_in = (uLong )(len - n); (bp->strm)->next_out = (Byte *)bp->gunzip_buf; (bp->strm)->avail_out = 32768UL; rc = zlib_inflateInit2(bp->strm, -15); if (rc != 0) { return (rc); } else { } rc = zlib_inflate(bp->strm, 5); if (rc != 0 && rc != 1) { netdev_err((struct net_device const *)bp->dev, "Firmware decompression error: %s\n", (bp->strm)->msg); } else { } bp->gunzip_outlen = (int )(32768U - (unsigned int )(bp->strm)->avail_out); if ((bp->gunzip_outlen & 3) != 0) { netdev_err((struct net_device const *)bp->dev, "Firmware decompression error: gunzip_outlen (%d) not aligned\n", bp->gunzip_outlen); } else { } bp->gunzip_outlen = bp->gunzip_outlen >> 2; zlib_inflateEnd(bp->strm); if (rc == 1) { return (0); } else { } return (rc); } } static void bnx2x_lb_pckt(struct bnx2x *bp ) { u32 wb_write[3U] ; { wb_write[0] = 1431655765U; wb_write[1] = 1431655765U; wb_write[2] = 32U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_write), 12UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, 67584U, 3U); wb_write[0] = 150994944U; wb_write[1] = 1431655765U; wb_write[2] = 16U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_write), 12UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, 67584U, 3U); return; } } static int bnx2x_int_mem_test(struct bnx2x *bp ) { int factor ; int count ; int i ; u32 val ; long tmp ; long tmp___0 ; { val = 0U; if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) != 0U) { factor = 120; } else if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) == 0U) { factor = 200; } else { factor = 1; } writel(0U, (void volatile *)bp->regview + 270904U); writel(0U, (void volatile *)bp->regview + 327712U); writel(1U, (void volatile *)bp->regview + 1065040U); writel(0U, (void volatile *)bp->regview + 65720U); writel(0U, (void volatile *)bp->regview + 262428U); bnx2x_lb_pckt(bp); count = factor * 1000; goto ldv_64409; ldv_64408: bnx2x_read_dmae(bp, 67552U, 2U); val = *((u32 *)(& (bp->slowpath)->wb_data)); if (val == 16U) { goto ldv_64407; } else { } usleep_range(10000UL, 20000UL); count = count - 1; ldv_64409: ; if (count != 0) { goto ldv_64408; } else { } ldv_64407: ; if (val != 16U) { printk("\vbnx2x: [%s:%d(%s)]NIG timeout val = 0x%x\n", "bnx2x_int_mem_test", 6674, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); return (-1); } else { } count = factor * 1000; goto ldv_64413; ldv_64412: val = readl((void const volatile *)bp->regview + 262436U); if (val == 1U) { goto ldv_64411; } else { } usleep_range(10000UL, 20000UL); count = count - 1; ldv_64413: ; if (count != 0) { goto ldv_64412; } else { } ldv_64411: ; if (val != 1U) { printk("\vbnx2x: [%s:%d(%s)]PRS timeout val = 0x%x\n", "bnx2x_int_mem_test", 6689, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); return (-2); } else { } writel(3U, (void volatile *)bp->regview + 42376U); msleep(50U); writel(3U, (void volatile *)bp->regview + 42372U); msleep(50U); bnx2x_init_block(bp, 1U, 0U); bnx2x_init_block(bp, 16U, 0U); tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]part2\n", "bnx2x_int_mem_test", 6701, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(0U, (void volatile *)bp->regview + 270904U); writel(0U, (void volatile *)bp->regview + 327712U); writel(1U, (void volatile *)bp->regview + 1065040U); writel(0U, (void volatile *)bp->regview + 65720U); writel(0U, (void volatile *)bp->regview + 262428U); i = 0; goto ldv_64415; ldv_64414: bnx2x_lb_pckt(bp); i = i + 1; ldv_64415: ; if (i <= 9) { goto ldv_64414; } else { } count = factor * 1000; goto ldv_64419; ldv_64418: bnx2x_read_dmae(bp, 67552U, 2U); val = *((u32 *)(& (bp->slowpath)->wb_data)); if (val == 176U) { goto ldv_64417; } else { } usleep_range(10000UL, 20000UL); count = count - 1; ldv_64419: ; if (count != 0) { goto ldv_64418; } else { } ldv_64417: ; if (val != 176U) { printk("\vbnx2x: [%s:%d(%s)]NIG timeout val = 0x%x\n", "bnx2x_int_mem_test", 6730, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); return (-3); } else { } val = readl((void const volatile *)bp->regview + 262436U); if (val != 2U) { printk("\vbnx2x: [%s:%d(%s)]PRS timeout val = 0x%x\n", "bnx2x_int_mem_test", 6737, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } writel(1U, (void volatile *)bp->regview + 262428U); msleep((unsigned int )(factor * 10)); val = readl((void const volatile *)bp->regview + 262436U); if (val != 3U) { printk("\vbnx2x: [%s:%d(%s)]PRS timeout val = 0x%x\n", "bnx2x_int_mem_test", 6747, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } i = 0; goto ldv_64421; ldv_64420: readl((void const volatile *)bp->regview + 66788U); i = i + 1; ldv_64421: ; if (i <= 10) { goto ldv_64420; } else { } val = readl((void const volatile *)bp->regview + 66784U); if (val != 1U) { printk("\vbnx2x: [%s:%d(%s)]clear of NIG failed\n", "bnx2x_int_mem_test", 6754, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-4); } else { } writel(3U, (void volatile *)bp->regview + 42376U); msleep(50U); writel(3U, (void volatile *)bp->regview + 42372U); msleep(50U); bnx2x_init_block(bp, 1U, 0U); bnx2x_init_block(bp, 16U, 0U); if ((unsigned int )bp->cnic_support == 0U) { writel(1U, (void volatile *)bp->regview + 262456U); } else { } writel(2147483647U, (void volatile *)bp->regview + 270904U); writel(1U, (void volatile *)bp->regview + 327712U); writel(0U, (void volatile *)bp->regview + 1065040U); writel(1U, (void volatile *)bp->regview + 65720U); tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]done\n", "bnx2x_int_mem_test", 6775, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } } static void bnx2x_enable_blocks_attention(struct bnx2x *bp ) { u32 val ; { writel(0U, (void volatile *)bp->regview + 1060980U); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(64U, (void volatile *)bp->regview + 1060996U); } else { writel(0U, (void volatile *)bp->regview + 1060996U); } writel(0U, (void volatile *)bp->regview + 1507712U); writel(0U, (void volatile *)bp->regview + 1065224U); writel(64512U, (void volatile *)bp->regview + 393512U); writel(0U, (void volatile *)bp->regview + 1475652U); writel(0U, (void volatile *)bp->regview + 1458428U); writel(0U, (void volatile *)bp->regview + 1467036U); writel(0U, (void volatile *)bp->regview + 1467052U); writel(0U, (void volatile *)bp->regview + 131764U); writel(0U, (void volatile *)bp->regview + 803488U); writel(0U, (void volatile *)bp->regview + 803504U); writel(0U, (void volatile *)bp->regview + 917972U); writel(0U, (void volatile *)bp->regview + 790568U); writel(0U, (void volatile *)bp->regview + 795292U); writel(0U, (void volatile *)bp->regview + 795308U); writel(0U, (void volatile *)bp->regview + 852452U); val = 5767168U; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { val = val | 25165824U; } else { } writel(val, (void volatile *)bp->regview + 1181048U); writel(0U, (void volatile *)bp->regview + 271004U); writel(0U, (void volatile *)bp->regview + 271020U); writel(0U, (void volatile *)bp->regview + 328156U); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(2047U, (void volatile *)bp->regview + 1573136U); } else { } writel(0U, (void volatile *)bp->regview + 1052732U); writel(0U, (void volatile *)bp->regview + 1056852U); writel(24U, (void volatile *)bp->regview + 1311188U); return; } } static void bnx2x_reset_common(struct bnx2x *bp ) { u32 val ; { val = 5120U; writel(3556769663U, (void volatile *)bp->regview + 42376U); if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { val = val | 16777216U; val = val | 33554432U; } else { } writel(val, (void volatile *)bp->regview + 42392U); return; } } static void bnx2x_setup_dmae(struct bnx2x *bp ) { struct lock_class_key __key ; { bp->dmae_ready = 0; spinlock_check(& bp->dmae_lock); __raw_spin_lock_init(& bp->dmae_lock.__annonCompField18.rlock, "&(&bp->dmae_lock)->rlock", & __key); return; } } static void bnx2x_init_pxp(struct bnx2x *bp ) { u16 devctl ; int r_order ; int w_order ; long tmp ; long tmp___0 ; { pcie_capability_read_word(bp->pdev, 8, & devctl); tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]read 0x%x from devctl\n", "bnx2x_init_pxp", 6868, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )devctl); } else { } w_order = ((int )devctl & 224) >> 5; if (bp->mrrs == -1) { r_order = ((int )devctl & 28672) >> 12; } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]force read order to %d\n", "bnx2x_init_pxp", 6873, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->mrrs); } else { } r_order = bp->mrrs; } bnx2x_init_pxp_arb(bp, r_order, w_order); return; } } static void bnx2x_setup_fan_failure_detection(struct bnx2x *bp ) { int is_required ; u32 val ; int port ; unsigned int tmp ; u8 tmp___0 ; long tmp___1 ; { if ((bp->flags & 512U) != 0U) { return; } else { } is_required = 0; tmp = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 32UL))); val = tmp & 1572864U; if (val == 1048576U) { is_required = 1; } else if (val == 0U) { port = 0; goto ldv_64449; ldv_64448: tmp___0 = bnx2x_fan_failure_det_req(bp, bp->common.shmem_base, bp->common.shmem2_base, (int )((u8 )port)); is_required = (int )tmp___0 | is_required; port = port + 1; ldv_64449: ; if (port <= 1) { goto ldv_64448; } else { } } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]fan detection setting: %d\n", "bnx2x_setup_fan_failure_detection", 6911, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", is_required); } else { } if (is_required == 0) { return; } else { } bnx2x_set_spio(bp, 32, 2U); val = readl((void const volatile *)bp->regview + 42240U); val = val | 2097152U; writel(val, (void volatile *)bp->regview + 42240U); val = readl((void const volatile *)bp->regview + 41656U); val = val | 32U; writel(val, (void volatile *)bp->regview + 41656U); return; } } void bnx2x_pf_disable(struct bnx2x *bp ) { u32 val ; unsigned int tmp ; { tmp = readl((void const volatile *)bp->regview + 1245524U); val = tmp; val = val & 4294967294U; writel(val, (void volatile *)bp->regview + 1245524U); writel(0U, (void volatile *)bp->regview + 37932U); writel(0U, (void volatile *)bp->regview + 1065252U); return; } } static void bnx2x__common_init_phy(struct bnx2x *bp ) { u32 shmem_base[2U] ; u32 shmem2_base[2U] ; unsigned int tmp ; { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp > (unsigned int )(((unsigned long )bp->pfid & 1UL) + 79UL) * 4U) { return; } else { } shmem_base[0] = bp->common.shmem_base; shmem2_base[0] = bp->common.shmem2_base; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { shmem_base[1] = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 52UL))); shmem2_base[1] = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 56UL))); } else { } bnx2x_acquire_phy_lock(bp); bnx2x_common_init_phy(bp, (u32 *)(& shmem_base), (u32 *)(& shmem2_base), bp->common.chip_id); bnx2x_release_phy_lock(bp); return; } } static void bnx2x_config_endianity(struct bnx2x *bp , u32 val ) { { writel(val, (void volatile *)bp->regview + 1180052U); writel(val, (void volatile *)bp->regview + 1180056U); writel(val, (void volatile *)bp->regview + 1180060U); writel(val, (void volatile *)bp->regview + 1180064U); writel(val, (void volatile *)bp->regview + 1180068U); writel(0U, (void volatile *)bp->regview + 1180072U); writel(val, (void volatile *)bp->regview + 1180664U); writel(val, (void volatile *)bp->regview + 1180668U); writel(val, (void volatile *)bp->regview + 1180672U); writel(val, (void volatile *)bp->regview + 1180676U); return; } } static void bnx2x_set_endianity(struct bnx2x *bp ) { { bnx2x_config_endianity(bp, 0U); return; } } static void bnx2x_reset_endianity(struct bnx2x *bp ) { { bnx2x_config_endianity(bp, 0U); return; } } static int bnx2x_init_hw_common(struct bnx2x *bp ) { u32 val ; long tmp ; u8 abs_func_id ; struct ilt_client_info ilt_cli ; struct bnx2x_ilt ilt ; int _max1 ; int _max2 ; int _min1 ; int _min2 ; int _max1___0 ; int _max2___0 ; int _min1___0 ; int _min2___0 ; int factor ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]starting common init func %d\n", "bnx2x_init_hw_common", 7001, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->pf_num); } else { } bnx2x_acquire_hw_lock(bp, 5U); bnx2x_reset_common(bp); writel(4294967295U, (void volatile *)bp->regview + 42372U); val = 65532U; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { val = val | 16777216U; val = val | 33554432U; } else { } writel(val, (void volatile *)bp->regview + 42388U); bnx2x_release_hw_lock(bp, 5U); bnx2x_init_block(bp, 12U, 0U); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { abs_func_id = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; goto ldv_64479; ldv_64478: ; if ((int )bp->pf_num == (int )abs_func_id) { writel(1U, (void volatile *)bp->regview + 37932U); goto ldv_64477; } else { } bnx2x_pretend_func(bp, (int )abs_func_id); bnx2x_pf_disable(bp); bnx2x_pretend_func(bp, (int )bp->pf_num); ldv_64477: abs_func_id = (unsigned int )abs_func_id + 2U; ldv_64479: ; if ((unsigned int )abs_func_id <= 7U) { goto ldv_64478; } else { } } else { } bnx2x_init_block(bp, 18U, 0U); if (bp->common.chip_id >> 16 == 5710U) { writel(0U, (void volatile *)bp->regview + 1060980U); } else { } bnx2x_init_block(bp, 17U, 0U); bnx2x_init_pxp(bp); bnx2x_set_endianity(bp); bnx2x_ilt_init_page_size(bp, 0); if (((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) != 0U) && (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { writel(1U, (void volatile *)bp->regview + 1181096U); } else { } msleep(100U); val = readl((void const volatile *)bp->regview + 1180084U); if (val != 1U) { printk("\vbnx2x: [%s:%d(%s)]PXP2 CFG failed\n", "bnx2x_init_hw_common", 7069, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } val = readl((void const volatile *)bp->regview + 1180528U); if (val != 1U) { printk("\vbnx2x: [%s:%d(%s)]PXP2 RD_INIT failed\n", "bnx2x_init_hw_common", 7074, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { memset((void *)(& ilt_cli), 0, 12UL); memset((void *)(& ilt), 0, 64UL); ilt_cli.start = 0U; ilt_cli.end = 3071U; ilt_cli.client_num = 3U; bnx2x_pretend_func(bp, bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )(((unsigned int )((u16 )bp->pf_num) & 1U) + 6U) : 6); bnx2x_ilt_client_init_op_ilt(bp, & ilt, & ilt_cli, 1); bnx2x_pretend_func(bp, (int )bp->pf_num); _max1 = 6; _min1 = 8; _min2 = 6; _max2 = _min1 < _min2 ? _min1 : _min2; writel((unsigned int )((_max1 > _max2 ? _max1 : _max2) + -5), (void volatile *)bp->regview + 1181104U); _max1___0 = 6; _min1___0 = 8; _min2___0 = 6; _max2___0 = _min1___0 < _min2___0 ? _min1___0 : _min2___0; writel((unsigned int )((_max1___0 > _max2___0 ? _max1___0 : _max2___0) + -5), (void volatile *)bp->regview + 1181996U); writel(1U, (void volatile *)bp->regview + 1182000U); } else { } writel(0U, (void volatile *)bp->regview + 1180464U); writel(0U, (void volatile *)bp->regview + 1180532U); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { factor = (bp->common.chip_id & 61440U) <= 20480U || (bp->common.chip_id & 4096U) != 0U ? ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) != 0U ? 400 : 0) : 1000; bnx2x_init_block(bp, 15U, 0U); bnx2x_init_block(bp, 0U, 0U); ldv_64502: msleep(200U); val = readl((void const volatile *)bp->regview + 1114300U); tmp___0 = factor; factor = factor - 1; if (tmp___0 != 0 && val != 1U) { goto ldv_64502; } else { } if (val != 1U) { printk("\vbnx2x: [%s:%d(%s)]ATC_INIT failed\n", "bnx2x_init_hw_common", 7193, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } } else { } bnx2x_init_block(bp, 8U, 0U); bnx2x_iov_init_dmae(bp); bp->dmae_ready = 1; bnx2x_init_fill(bp, 1835008U, 0, 8U, 1); bnx2x_init_block(bp, 21U, 0U); bnx2x_init_block(bp, 25U, 0U); bnx2x_init_block(bp, 2U, 0U); bnx2x_init_block(bp, 29U, 0U); bnx2x_read_dmae(bp, 2629632U, 3U); bnx2x_read_dmae(bp, 2105344U, 3U); bnx2x_read_dmae(bp, 1576960U, 3U); bnx2x_read_dmae(bp, 3153920U, 3U); bnx2x_init_block(bp, 19U, 0U); bnx2x_qm_init_ptr_table(bp, bp->qm_cid_count, 0); writel(1U, (void volatile *)bp->regview + 1475624U); writel(0U, (void volatile *)bp->regview + 1475624U); if ((unsigned int )bp->cnic_support != 0U) { bnx2x_init_block(bp, 22U, 0U); } else { } bnx2x_init_block(bp, 9U, 0U); if ((bp->common.chip_id & 61440U) <= 20480U) { writel(0U, (void volatile *)bp->regview + 1507712U); } else { } bnx2x_init_block(bp, 1U, 0U); bnx2x_init_block(bp, 16U, 0U); writel(15U, (void volatile *)bp->regview + 262452U); if (bp->common.chip_id >> 16 != 5710U) { writel(bp->path_has_ovlan, (void volatile *)bp->regview + 262600U); } else { } if ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && ((((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) || ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 != 4096U : (bp->common.chip_id & 61440U) != 4096U))) { if ((unsigned int )bp->mf_mode == 3U) { writel(14U, (void volatile *)bp->regview + 262712U); writel(10U, (void volatile *)bp->regview + 262740U); writel(6U, (void volatile *)bp->regview + 262728U); writel(35110U, (void volatile *)bp->regview + 262612U); writel(4U, (void volatile *)bp->regview + 262700U); } else { writel(bp->path_has_ovlan != 0U ? 7U : 6U, (void volatile *)bp->regview + 262712U); } } else { } bnx2x_init_block(bp, 23U, 0U); bnx2x_init_block(bp, 5U, 0U); bnx2x_init_block(bp, 27U, 0U); bnx2x_init_block(bp, 31U, 0U); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(3U, (void volatile *)bp->regview + 1807420U); writel(3U, (void volatile *)bp->regview + 2855996U); msleep(20U); } else { } bnx2x_init_block(bp, 24U, 0U); bnx2x_init_block(bp, 28U, 0U); bnx2x_init_block(bp, 6U, 0U); bnx2x_init_block(bp, 32U, 0U); writel(2147483648U, (void volatile *)bp->regview + 42376U); writel(2147483648U, (void volatile *)bp->regview + 42372U); bnx2x_init_block(bp, 26U, 0U); bnx2x_init_block(bp, 30U, 0U); bnx2x_init_block(bp, 14U, 0U); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { if ((unsigned int )bp->mf_mode == 3U) { writel(14U, (void volatile *)bp->regview + 1425576U); writel(10U, (void volatile *)bp->regview + 1425604U); writel(6U, (void volatile *)bp->regview + 1425592U); writel(35110U, (void volatile *)bp->regview + 1425552U); writel(4U, (void volatile *)bp->regview + 1425564U); } else { writel(bp->path_has_ovlan != 0U ? 7U : 6U, (void volatile *)bp->regview + 1425576U); } } else { } writel(1U, (void volatile *)bp->regview + 263324U); bnx2x_init_block(bp, 20U, 0U); if ((unsigned int )bp->cnic_support != 0U) { writel(1663587954U, (void volatile *)bp->regview + 263256U); writel(616100556U, (void volatile *)bp->regview + 263260U); writel(574287771U, (void volatile *)bp->regview + 263264U); writel(637541946U, (void volatile *)bp->regview + 263268U); writel(2062094614U, (void volatile *)bp->regview + 263272U); writel(1558520587U, (void volatile *)bp->regview + 263276U); writel(697141983U, (void volatile *)bp->regview + 263280U); writel(1857093385U, (void volatile *)bp->regview + 263284U); writel(405862447U, (void volatile *)bp->regview + 263288U); writel(31747047U, (void volatile *)bp->regview + 263292U); } else { } writel(0U, (void volatile *)bp->regview + 263324U); bnx2x_init_block(bp, 3U, 0U); val = 67109888U; writel(val, (void volatile *)bp->regview + 1052704U); bnx2x_init_block(bp, 4U, 0U); writel(2047U, (void volatile *)bp->regview + 1065036U); writel(0U, (void volatile *)bp->regview + 1065224U); writel(537001984U, (void volatile *)bp->regview + 1065040U); bnx2x_init_block(bp, 10U, 0U); if ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && (bp->flags & 512U) != 0U) { writel(54U, (void volatile *)bp->regview + 1245528U); } else { } bnx2x_init_block(bp, 11U, 0U); bnx2x_init_block(bp, 33U, 0U); writel(4294967295U, (void volatile *)bp->regview + 10260U); writel(4294967295U, (void volatile *)bp->regview + 14368U); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(262400U, (void volatile *)bp->regview + 10260U); writel(268697856U, (void volatile *)bp->regview + 10324U); writel(268697856U, (void volatile *)bp->regview + 10332U); } else { } bnx2x_init_block(bp, 13U, 0U); if (bp->common.chip_id >> 16 != 5710U) { if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { writel((unsigned int )bp->mf_mode != 0U, (void volatile *)bp->regview + 90148U); } else { } } else { } if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { writel((unsigned int )bp->mf_mode == 1U, (void volatile *)bp->regview + 90328U); } else { } if ((bp->common.chip_id & 61440U) > 20480U) { msleep(200U); } else { } val = reg_poll(bp, 1065076U, 1U, 100, 10); if (val != 1U) { printk("\vbnx2x: [%s:%d(%s)]CFC LL_INIT failed\n", "bnx2x_init_hw_common", 7390, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } val = reg_poll(bp, 1065080U, 1U, 100, 10); if (val != 1U) { printk("\vbnx2x: [%s:%d(%s)]CFC AC_INIT failed\n", "bnx2x_init_hw_common", 7395, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } val = reg_poll(bp, 1065084U, 1U, 100, 10); if (val != 1U) { printk("\vbnx2x: [%s:%d(%s)]CFC CAM_INIT failed\n", "bnx2x_init_hw_common", 7400, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } writel(0U, (void volatile *)bp->regview + 1065040U); if (bp->common.chip_id >> 16 == 5710U) { bnx2x_read_dmae(bp, 67552U, 2U); val = *((u32 *)(& (bp->slowpath)->wb_data)); if (val == 0U) { tmp___1 = bnx2x_int_mem_test(bp); if (tmp___1 != 0) { printk("\vbnx2x: [%s:%d(%s)]internal mem self test failed\n", "bnx2x_init_hw_common", 7413, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } } else { } } else { } bnx2x_setup_fan_failure_detection(bp); readl((void const volatile *)bp->regview + 1181040U); bnx2x_enable_blocks_attention(bp); bnx2x_enable_blocks_parity(bp); if ((bp->flags & 512U) == 0U) { if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { bnx2x__common_init_phy(bp); } else { } } else { printk("\vbnx2x: [%s:%d(%s)]Bootcode is missing - can not initialize link\n", "bnx2x_init_hw_common", 7430, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } return (0); } } static int bnx2x_init_hw_common_chip(struct bnx2x *bp ) { int rc ; int tmp ; { tmp = bnx2x_init_hw_common(bp); rc = tmp; if (rc != 0) { return (rc); } else { } if ((bp->flags & 512U) == 0U) { bnx2x__common_init_phy(bp); } else { } return (0); } } static int bnx2x_init_hw_port(struct bnx2x *bp ) { int port ; int init_phase ; u32 low ; u32 high ; u32 val ; u32 reg ; long tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; u32 reg_addr ; { port = (int )bp->pfid & 1; init_phase = port != 0 ? 2 : 1; tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]starting port init port %d\n", "bnx2x_init_hw_port", 7461, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", port); } else { } writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 16588) * 4)); bnx2x_init_block(bp, 12U, (u32 )init_phase); bnx2x_init_block(bp, 18U, (u32 )init_phase); bnx2x_init_block(bp, 17U, (u32 )init_phase); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(1U, (void volatile *)bp->regview + 37932U); } else { } bnx2x_init_block(bp, 0U, (u32 )init_phase); bnx2x_init_block(bp, 8U, (u32 )init_phase); bnx2x_init_block(bp, 15U, (u32 )init_phase); bnx2x_init_block(bp, 19U, (u32 )init_phase); bnx2x_init_block(bp, 21U, (u32 )init_phase); bnx2x_init_block(bp, 25U, (u32 )init_phase); bnx2x_init_block(bp, 2U, (u32 )init_phase); bnx2x_init_block(bp, 29U, (u32 )init_phase); bnx2x_qm_init_cid_count(bp, bp->qm_cid_count, 0); if ((unsigned int )bp->cnic_support != 0U) { bnx2x_init_block(bp, 22U, (u32 )init_phase); writel(20U, (void volatile *)bp->regview + (unsigned long )((port + 364559) * 4)); writel(31U, (void volatile *)bp->regview + (unsigned long )((port + 364562) * 4)); } else { } bnx2x_init_block(bp, 9U, (u32 )init_phase); bnx2x_init_block(bp, 1U, (u32 )init_phase); if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { if ((unsigned int )bp->mf_mode != 0U) { low = (bp->flags & 4U) != 0U ? 160U : 246U; } else if ((bp->dev)->mtu > 4096U) { if ((bp->flags & 4U) != 0U) { low = 160U; } else { val = (bp->dev)->mtu; low = (val / 64U + ((val & 63U) != 0U ? 1U : 0U)) + 96U; } } else { low = (bp->flags & 4U) != 0U ? 80U : 160U; } high = low + 56U; writel(low, (void volatile *)bp->regview + (unsigned long )((port + 98330) * 4)); writel(high, (void volatile *)bp->regview + (unsigned long )((port + 98334) * 4)); } else { } if ((unsigned int )bp->common.chip_port_mode == 0U) { writel(40U, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 393792UL : 393704UL))); } else { } bnx2x_init_block(bp, 16U, (u32 )init_phase); if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { if ((unsigned int )bp->mf_mode == 3U) { writel(14U, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 262800UL : 262768UL))); writel(6U, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 262816UL : 262784UL))); writel(10U, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 262828UL : 262796UL))); } else { writel(bp->path_has_ovlan != 0U ? 7U : 6U, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 262800UL : 262768UL))); } } else { } bnx2x_init_block(bp, 23U, (u32 )init_phase); bnx2x_init_block(bp, 5U, (u32 )init_phase); bnx2x_init_block(bp, 27U, (u32 )init_phase); bnx2x_init_block(bp, 31U, (u32 )init_phase); bnx2x_init_block(bp, 24U, (u32 )init_phase); bnx2x_init_block(bp, 28U, (u32 )init_phase); bnx2x_init_block(bp, 6U, (u32 )init_phase); bnx2x_init_block(bp, 32U, (u32 )init_phase); bnx2x_init_block(bp, 26U, (u32 )init_phase); bnx2x_init_block(bp, 30U, (u32 )init_phase); bnx2x_init_block(bp, 14U, (u32 )init_phase); if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 327685) * 4)); writel(565U, (void volatile *)bp->regview + (unsigned long )((port + 327737) * 4)); writel(1096U, (void volatile *)bp->regview + (unsigned long )((port + 327732) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )((port + 327681) * 4)); __const_udelay(214750UL); writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 327681) * 4)); } else { } if ((unsigned int )bp->cnic_support != 0U) { bnx2x_init_block(bp, 20U, (u32 )init_phase); } else { } bnx2x_init_block(bp, 3U, (u32 )init_phase); bnx2x_init_block(bp, 4U, (u32 )init_phase); if (bp->common.chip_id >> 16 == 5710U) { writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 135176) * 8)); writel(0U, (void volatile *)bp->regview + (unsigned long )(port * 8 + 1081412)); } else { } bnx2x_init_block(bp, 10U, (u32 )init_phase); bnx2x_init_block(bp, 11U, (u32 )init_phase); bnx2x_init_block(bp, 33U, (u32 )init_phase); val = (unsigned int )bp->mf_mode != 0U ? 247U : 7U; val = (bp->common.chip_id >> 16 == 5710U ? 0U : 16U) | val; writel(val, (void volatile *)bp->regview + (unsigned long )((port + 10264) * 4)); reg = port != 0 ? 41368U : 41208U; tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )reg); writel(tmp___0 & 2147483647U, (void volatile *)bp->regview + (unsigned long )reg); reg = port != 0 ? 41384U : 41224U; tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )reg); writel(tmp___1 & 2147483647U, (void volatile *)bp->regview + (unsigned long )reg); bnx2x_init_block(bp, 13U, (u32 )init_phase); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { if ((unsigned int )bp->mf_mode == 3U) { writel(14U, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 98700UL : 98360UL))); } else { writel((unsigned int )bp->mf_mode == 1U ? 7U : 6U, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 98700UL : 98360UL))); } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { writel((unsigned int )bp->mf_mode != 0U, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 99860UL : 90148UL))); } else { } } else { } if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { writel(1U, (void volatile *)bp->regview + (unsigned long )((port + 16568) * 4)); } else { } if (bp->common.chip_id >> 16 != 5710U) { writel((unsigned int )bp->mf_mode == 1U ? 1U : 2U, (void volatile *)bp->regview + (unsigned long )((port + 22546) * 4)); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { val = 0U; switch ((int )bp->mf_mode) { case 1: val = 1U; goto ldv_64519; case 2: ; case 3: val = 2U; goto ldv_64519; } ldv_64519: writel(val, (void volatile *)(bp->regview + ((int )bp->pfid & 1 ? 90244UL : 90240UL))); } else { } writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 22658) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 22578) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )((port + 22576) * 4)); } else { } val = readl((void const volatile *)bp->regview + 41656U); if ((val & 32U) != 0U) { reg_addr = port != 0 ? 41228U : 41068U; val = readl((void const volatile *)bp->regview + (unsigned long )reg_addr); val = val | 32768U; writel(val, (void volatile *)bp->regview + (unsigned long )reg_addr); } else { } return (0); } } static void bnx2x_ilt_wr(struct bnx2x *bp , u32 index , dma_addr_t addr ) { int reg ; u32 wb_write[2U] ; { if (bp->common.chip_id >> 16 == 5710U) { reg = (int )((index + 148480U) * 8U); } else { reg = (int )((index + 151552U) * 8U); } wb_write[0] = (unsigned int )(addr >> 12); wb_write[1] = (unsigned int )(addr >> 44) | 1048576U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_write), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, (u32 )reg, 2U); return; } } void bnx2x_igu_clear_sb_gen(struct bnx2x *bp , u8 func , u8 idu_sb_id , bool is_pf ) { u32 data ; u32 ctl ; u32 cnt ; u32 igu_addr_data ; u32 igu_addr_ctl ; u32 igu_addr_ack ; u32 sb_bit ; u32 func_encode ; u32 addr_encode ; long tmp ; long tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; unsigned int tmp___3 ; { cnt = 100U; igu_addr_data = 1245476U; igu_addr_ctl = 1245484U; igu_addr_ack = (u32 )(((int )((unsigned int )idu_sb_id / 32U) + 311424) * 4); sb_bit = (u32 )(1 << ((int )idu_sb_id & 31)); func_encode = (u32 )((int )func | ((int )is_pf << 6)); addr_encode = (u32 )((int )idu_sb_id + 1280); if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0) { return; } else { } data = 3758096384U; ctl = ((func_encode << 12) | addr_encode) | 1048576U; tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]write 0x%08x to IGU(via GRC) addr 0x%x\n", "bnx2x_igu_clear_sb_gen", 7718, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", data, igu_addr_data); } else { } writel(data, (void volatile *)bp->regview + (unsigned long )igu_addr_data); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write 0x%08x to IGU(via GRC) addr 0x%x\n", "bnx2x_igu_clear_sb_gen", 7723, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ctl, igu_addr_ctl); } else { } writel(ctl, (void volatile *)bp->regview + (unsigned long )igu_addr_ctl); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); goto ldv_64547; ldv_64546: msleep(20U); ldv_64547: tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )igu_addr_ack); if ((tmp___1 & sb_bit) == 0U) { cnt = cnt - 1U; if (cnt != 0U) { goto ldv_64546; } else { goto ldv_64548; } } else { } ldv_64548: tmp___3 = readl((void const volatile *)bp->regview + (unsigned long )igu_addr_ack); if ((tmp___3 & sb_bit) == 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unable to finish IGU cleanup: idu_sb_id %d offset %d bit %d (cnt %d)\n", "bnx2x_igu_clear_sb_gen", 7735, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )idu_sb_id, (int )((unsigned int )idu_sb_id / 32U), (int )idu_sb_id & 31, cnt); } else { } } else { } return; } } static void bnx2x_igu_clear_sb(struct bnx2x *bp , u8 idu_sb_id ) { { bnx2x_igu_clear_sb_gen(bp, (int )bp->pfid, (int )idu_sb_id, 1); return; } } static void bnx2x_clear_func_ilt(struct bnx2x *bp , u32 func ) { u32 i ; u32 base ; { base = func * 384U; i = base; goto ldv_64560; ldv_64559: bnx2x_ilt_wr(bp, i, 0ULL); i = i + 1U; ldv_64560: ; if (base + 384U > i) { goto ldv_64559; } else { } return; } } static void bnx2x_init_searcher(struct bnx2x *bp ) { int port ; { port = (int )bp->pfid & 1; bnx2x_src_init_t2(bp, (struct src_ent *)bp->t2, bp->t2_mapping, 1024); writel(10U, (void volatile *)bp->regview + (unsigned long )((port + 65792) * 4)); return; } } __inline static int bnx2x_func_switch_update(struct bnx2x *bp , int suspend ) { int rc ; struct bnx2x_func_state_params func_params ; struct bnx2x_func_switch_update_params *switch_update_params ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; switch_update_params = & func_params.params.switch_update; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); __set_bit(7L, (unsigned long volatile *)(& func_params.ramrod_flags)); func_params.f_obj = & bp->func_obj; func_params.cmd = 8; __set_bit(0L, (unsigned long volatile *)(& switch_update_params->changes)); if (suspend != 0) { __set_bit(1L, (unsigned long volatile *)(& switch_update_params->changes)); } else { } rc = bnx2x_func_state_change(bp, & func_params); return (rc); } } static int bnx2x_reset_nic_mode(struct bnx2x *bp ) { int rc ; int i ; int port ; int vlan_en ; int mac_en[8U] ; unsigned int tmp ; unsigned int tmp___0 ; long tmp___1 ; { port = (int )bp->pfid & 1; vlan_en = 0; if ((unsigned int )bp->mf_mode == 0U) { bnx2x_set_rx_filter(& bp->link_params, 0); } else { tmp = readl((void const volatile *)(bp->regview + (port != 0 ? 90372UL : 90364UL))); vlan_en = (int )tmp; writel(0U, (void volatile *)(bp->regview + (port != 0 ? 90372UL : 90364UL))); i = 0; goto ldv_64582; ldv_64581: tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )(port != 0 ? (i + 22616) * 4 : (i + 22608) * 4)); mac_en[i] = (int )tmp___0; writel(0U, (void volatile *)bp->regview + (unsigned long )(port != 0 ? (i + 22616) * 4 : (i + 22608) * 4)); i = i + 1; ldv_64582: ; if (i <= 7) { goto ldv_64581; } else { } } writel(0U, (void volatile *)(bp->regview + (port != 0 ? 99060UL : 99064UL))); rc = bnx2x_func_switch_update(bp, 1); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Can\'t suspend tx-switching!\n", "bnx2x_reset_nic_mode", 7821, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } writel(0U, (void volatile *)bp->regview + 262456U); if ((unsigned int )bp->mf_mode == 0U) { bnx2x_set_rx_filter(& bp->link_params, 1); } else { writel((unsigned int )vlan_en, (void volatile *)(bp->regview + (port != 0 ? 90372UL : 90364UL))); i = 0; goto ldv_64586; ldv_64585: writel((unsigned int )mac_en[i], (void volatile *)bp->regview + (unsigned long )(port != 0 ? (i + 22616) * 4 : (i + 22608) * 4)); i = i + 1; ldv_64586: ; if (i <= 7) { goto ldv_64585; } else { } } writel(1U, (void volatile *)(bp->regview + (port != 0 ? 99060UL : 99064UL))); rc = bnx2x_func_switch_update(bp, 0); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Can\'t resume tx-switching!\n", "bnx2x_reset_nic_mode", 7849, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]NIC MODE disabled\n", "bnx2x_reset_nic_mode", 7853, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } } int bnx2x_init_hw_func_cnic(struct bnx2x *bp ) { int rc ; { bnx2x_ilt_init_op_cnic(bp, 0); if ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && ! bp->cnic_enabled) { bnx2x_init_searcher(bp); rc = bnx2x_reset_nic_mode(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Can\'t change NIC mode!\n", "bnx2x_init_hw_func_cnic", 7870, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (rc); } else { } return (0); } } static void bnx2x_clean_pglue_errors(struct bnx2x *bp ) { { if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(1U << (int )bp->pf_num, (void volatile *)bp->regview + 38000U); } else { } return; } } static int bnx2x_init_hw_func(struct bnx2x *bp ) { int port ; int func ; int init_phase ; struct bnx2x_ilt *ilt ; u16 cdu_ilt_start ; u32 addr ; u32 val ; u32 main_mem_base ; u32 main_mem_size ; u32 main_mem_prty_clr ; int i ; int main_mem_width ; int rc ; long tmp ; int tmp___0 ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; long tmp___1 ; long tmp___2 ; u32 pf_conf ; int num_segs ; int sb_idx ; int prod_offset ; int dsb_idx ; long tmp___3 ; { port = (int )bp->pfid & 1; func = (int )bp->pfid; init_phase = func + 3; ilt = bp->ilt; tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]starting func init func %d\n", "bnx2x_init_hw_func", 7902, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", func); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { rc = bnx2x_pf_flr_clnup(bp); if (rc != 0) { bnx2x_fw_dump(bp); return (rc); } else { } } else { } if ((unsigned int )bp->common.int_block == 0U) { addr = port != 0 ? 1081348U : 1081344U; val = readl((void const volatile *)bp->regview + (unsigned long )addr); val = val | 128U; writel(val, (void volatile *)bp->regview + (unsigned long )addr); } else { } bnx2x_init_block(bp, 18U, (u32 )init_phase); bnx2x_init_block(bp, 17U, (u32 )init_phase); ilt = bp->ilt; cdu_ilt_start = ilt->clients[0].start; if ((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0)) { cdu_ilt_start = (unsigned int )cdu_ilt_start + 32U; } else { } tmp___0 = bnx2x_iov_init_ilt(bp, (int )cdu_ilt_start); cdu_ilt_start = (u16 )tmp___0; cdu_ilt_start = ilt->clients[0].start; i = 0; goto ldv_64622; ldv_64621: (ilt->lines + (unsigned long )((int )cdu_ilt_start + i))->page = (void *)bp->context[i].vcxt; (ilt->lines + (unsigned long )((int )cdu_ilt_start + i))->page_mapping = bp->context[i].cxt_mapping; (ilt->lines + (unsigned long )((int )cdu_ilt_start + i))->size = (u32 )bp->context[i].size; i = i + 1; ldv_64622: __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; if ((unsigned long )i < ((unsigned long )(bp->num_ethernet_queues * 3U + (uint )bp->cnic_support * (((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) - ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos) + 2U)) + 31UL) / 32UL) { goto ldv_64621; } else { } bnx2x_ilt_init_op(bp, 0); if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (int )bp->cnic_enabled) { bnx2x_init_searcher(bp); writel(0U, (void volatile *)bp->regview + 262456U); tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]NIC MODE disabled\n", "bnx2x_init_hw_func", 7947, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { writel(1U, (void volatile *)bp->regview + 262456U); tmp___2 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]NIC MODE configured\n", "bnx2x_init_hw_func", 7951, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { pf_conf = 1U; if ((bp->flags & 32U) == 0U) { pf_conf = pf_conf | 16U; } else { } msleep(20U); writel(1U, (void volatile *)bp->regview + 37932U); writel(pf_conf, (void volatile *)bp->regview + 1245524U); } else { } bp->dmae_ready = 1; bnx2x_init_block(bp, 15U, (u32 )init_phase); bnx2x_clean_pglue_errors(bp); bnx2x_init_block(bp, 0U, (u32 )init_phase); bnx2x_init_block(bp, 8U, (u32 )init_phase); bnx2x_init_block(bp, 13U, (u32 )init_phase); bnx2x_init_block(bp, 20U, (u32 )init_phase); bnx2x_init_block(bp, 12U, (u32 )init_phase); bnx2x_init_block(bp, 21U, (u32 )init_phase); bnx2x_init_block(bp, 25U, (u32 )init_phase); bnx2x_init_block(bp, 2U, (u32 )init_phase); bnx2x_init_block(bp, 29U, (u32 )init_phase); bnx2x_init_block(bp, 24U, (u32 )init_phase); bnx2x_init_block(bp, 28U, (u32 )init_phase); bnx2x_init_block(bp, 6U, (u32 )init_phase); bnx2x_init_block(bp, 32U, (u32 )init_phase); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(1U, (void volatile *)bp->regview + 1500940U); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel((unsigned int )func + 64U, (void volatile *)bp->regview + 1573760U); writel((unsigned int )func + 64U, (void volatile *)bp->regview + 3146624U); writel((unsigned int )func + 64U, (void volatile *)bp->regview + 2098048U); writel((unsigned int )func + 64U, (void volatile *)bp->regview + 2622336U); } else { } bnx2x_init_block(bp, 19U, (u32 )init_phase); bnx2x_init_block(bp, 22U, (u32 )init_phase); bnx2x_init_block(bp, 9U, (u32 )init_phase); writel(1U, (void volatile *)bp->regview + 1507336U); bnx2x_iov_init_dq(bp); bnx2x_init_block(bp, 1U, (u32 )init_phase); bnx2x_init_block(bp, 16U, (u32 )init_phase); bnx2x_init_block(bp, 23U, (u32 )init_phase); bnx2x_init_block(bp, 5U, (u32 )init_phase); bnx2x_init_block(bp, 27U, (u32 )init_phase); bnx2x_init_block(bp, 31U, (u32 )init_phase); bnx2x_init_block(bp, 26U, (u32 )init_phase); bnx2x_init_block(bp, 30U, (u32 )init_phase); bnx2x_init_block(bp, 14U, (u32 )init_phase); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(0U, (void volatile *)bp->regview + 1311464U); } else { } bnx2x_init_block(bp, 3U, (u32 )init_phase); bnx2x_init_block(bp, 4U, (u32 )init_phase); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(1U, (void volatile *)bp->regview + 1065252U); } else { } if ((unsigned int )bp->mf_mode != 0U) { if (((unsigned int )bp->mf_mode != 1U || (unsigned int )bp->mf_sub_mode != 1U) || (bp->mf_config[(int )bp->pfid >> 1] & 6U) != 0U) { writel(1U, (void volatile *)bp->regview + (unsigned long )(port * 8 + 90364)); writel((unsigned int )bp->mf_ov, (void volatile *)bp->regview + (unsigned long )((port + 11296) * 8)); } else { } } else { } bnx2x_init_block(bp, 33U, (u32 )init_phase); if ((unsigned int )bp->common.int_block == 0U) { if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { writel(0U, (void volatile *)bp->regview + (unsigned long )((func + 10252) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 135176) * 8)); writel(0U, (void volatile *)bp->regview + (unsigned long )(port * 8 + 1081412)); } else { } bnx2x_init_block(bp, 10U, (u32 )init_phase); } else { writel(0U, (void volatile *)bp->regview + (unsigned long )((func + 10252) * 4)); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(0U, (void volatile *)bp->regview + 1245492U); writel(0U, (void volatile *)bp->regview + 1245444U); } else { } bnx2x_init_block(bp, 11U, (u32 )init_phase); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { dsb_idx = 0; num_segs = (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0 ? 2 : 1; sb_idx = 0; goto ldv_64633; ldv_64632: prod_offset = ((int )bp->igu_base_sb + sb_idx) * num_segs; i = 0; goto ldv_64630; ldv_64629: addr = (u32 )(((prod_offset + i) + 313344) * 4); writel(0U, (void volatile *)bp->regview + (unsigned long )addr); i = i + 1; ldv_64630: ; if (i < num_segs) { goto ldv_64629; } else { } bnx2x_ack_sb(bp, (int )bp->igu_base_sb + (int )((u8 )sb_idx), 0, 0, 2, 1); bnx2x_igu_clear_sb(bp, (int )bp->igu_base_sb + (int )((u8 )sb_idx)); sb_idx = sb_idx + 1; ldv_64633: ; if ((int )bp->igu_sb_cnt > sb_idx) { goto ldv_64632; } else { } num_segs = (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0 ? 5 : 2; if ((unsigned int )bp->common.chip_port_mode == 0U) { dsb_idx = (int )bp->pfid; } else { dsb_idx = (int )bp->pfid >> 1; } prod_offset = (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0 ? dsb_idx + 128 : dsb_idx + 136; i = 0; goto ldv_64636; ldv_64635: addr = (u32 )(((prod_offset + i) + 313344) * 4); writel(0U, (void volatile *)bp->regview + (unsigned long )addr); i = i + 4; ldv_64636: ; if (num_segs * 4 > i) { goto ldv_64635; } else { } if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0) { bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 0, 0, 2, 1); bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 1, 0, 2, 1); bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 2, 0, 2, 1); bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 3, 0, 2, 1); bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 4, 0, 2, 1); } else { bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 0, 0, 2, 1); bnx2x_ack_sb(bp, (int )bp->igu_dsb_id, 4, 0, 2, 1); } bnx2x_igu_clear_sb(bp, (int )bp->igu_dsb_id); writel(0U, (void volatile *)bp->regview + 1245532U); writel(0U, (void volatile *)bp->regview + 1245536U); writel(0U, (void volatile *)bp->regview + 1245540U); writel(0U, (void volatile *)bp->regview + 1245544U); writel(0U, (void volatile *)bp->regview + 1245496U); writel(0U, (void volatile *)bp->regview + 1245500U); } else { } } writel(4294967295U, (void volatile *)bp->regview + 8468U); writel(4294967295U, (void volatile *)bp->regview + 8480U); if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { main_mem_size = 76U; main_mem_base = (((u32 )bp->pfid & 1U) * main_mem_size + 270848U) * 4U; main_mem_prty_clr = 1081496U; main_mem_width = 8; val = readl((void const volatile *)bp->regview + (unsigned long )main_mem_prty_clr); if (val != 0U) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Hmmm... Parity errors in HC block during function init (0x%x)!\n", "bnx2x_init_hw_func", 8177, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } } else { } i = (int )main_mem_base; goto ldv_64639; ldv_64638: bnx2x_read_dmae(bp, (u32 )i, (u32 )(main_mem_width / 4)); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, (u32 )i, (u32 )(main_mem_width / 4)); i = i + main_mem_width; ldv_64639: ; if ((u32 )i < main_mem_size * 4U + main_mem_base) { goto ldv_64638; } else { } readl((void const volatile *)bp->regview + (unsigned long )main_mem_prty_clr); } else { } bnx2x_phy_probe(& bp->link_params); return (0); } } void bnx2x_free_mem_cnic(struct bnx2x *bp ) { { bnx2x_ilt_mem_op_cnic(bp, 1); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { if ((unsigned long )bp->cnic_sb.e2_sb != (unsigned long )((struct host_hc_status_block_e2 *)0)) { dma_free_attrs(& (bp->pdev)->dev, 64UL, (void *)bp->cnic_sb.e2_sb, bp->cnic_sb_mapping, (struct dma_attrs *)0); bp->cnic_sb.e2_sb = (struct host_hc_status_block_e2 *)0; bp->cnic_sb_mapping = 0ULL; } else { } } else if ((unsigned long )bp->cnic_sb.e1x_sb != (unsigned long )((struct host_hc_status_block_e1x *)0)) { dma_free_attrs(& (bp->pdev)->dev, 64UL, (void *)bp->cnic_sb.e1x_sb, bp->cnic_sb_mapping, (struct dma_attrs *)0); bp->cnic_sb.e1x_sb = (struct host_hc_status_block_e1x *)0; bp->cnic_sb_mapping = 0ULL; } else { } if ((unsigned long )bp->t2 != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, 65536UL, bp->t2, bp->t2_mapping, (struct dma_attrs *)0); bp->t2 = (void *)0; bp->t2_mapping = 0ULL; } else { } return; } } void bnx2x_free_mem(struct bnx2x *bp ) { int i ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; { if ((unsigned long )bp->fw_stats != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, (size_t )(bp->fw_stats_data_sz + bp->fw_stats_req_sz), bp->fw_stats, bp->fw_stats_mapping, (struct dma_attrs *)0); bp->fw_stats = (void *)0; bp->fw_stats_mapping = 0ULL; } else { } if ((bp->flags & 4194304U) != 0U) { return; } else { } if ((unsigned long )bp->def_status_blk != (unsigned long )((struct host_sp_status_block *)0)) { dma_free_attrs(& (bp->pdev)->dev, 56UL, (void *)bp->def_status_blk, bp->def_status_blk_mapping, (struct dma_attrs *)0); bp->def_status_blk = (struct host_sp_status_block *)0; bp->def_status_blk_mapping = 0ULL; } else { } if ((unsigned long )bp->slowpath != (unsigned long )((struct bnx2x_slowpath *)0)) { dma_free_attrs(& (bp->pdev)->dev, 4748UL, (void *)bp->slowpath, bp->slowpath_mapping, (struct dma_attrs *)0); bp->slowpath = (struct bnx2x_slowpath *)0; bp->slowpath_mapping = 0ULL; } else { } i = 0; goto ldv_64657; ldv_64656: ; if ((unsigned long )bp->context[i].vcxt != (unsigned long )((union cdu_context *)0)) { dma_free_attrs(& (bp->pdev)->dev, bp->context[i].size, (void *)bp->context[i].vcxt, bp->context[i].cxt_mapping, (struct dma_attrs *)0); bp->context[i].vcxt = (union cdu_context *)0; bp->context[i].cxt_mapping = 0ULL; } else { } i = i + 1; ldv_64657: __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; if ((unsigned long )i < ((unsigned long )(bp->num_ethernet_queues * 3U + (uint )bp->cnic_support * (((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) - ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos) + 2U)) + 31UL) / 32UL) { goto ldv_64656; } else { } bnx2x_ilt_mem_op(bp, 1); if ((unsigned long )(bp->ilt)->lines != (unsigned long )((struct ilt_line *)0)) { kfree((void const *)(bp->ilt)->lines); (bp->ilt)->lines = (struct ilt_line *)0; } else { } if ((unsigned long )bp->spq != (unsigned long )((struct eth_spe *)0)) { dma_free_attrs(& (bp->pdev)->dev, 4096UL, (void *)bp->spq, bp->spq_mapping, (struct dma_attrs *)0); bp->spq = (struct eth_spe *)0; bp->spq_mapping = 0ULL; } else { } if ((unsigned long )bp->eq_ring != (unsigned long )((union event_ring_elem *)0)) { dma_free_attrs(& (bp->pdev)->dev, 4096UL, (void *)bp->eq_ring, bp->eq_mapping, (struct dma_attrs *)0); bp->eq_ring = (union event_ring_elem *)0; bp->eq_mapping = 0ULL; } else { } if ((unsigned long )bp->t2 != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, 65536UL, bp->t2, bp->t2_mapping, (struct dma_attrs *)0); bp->t2 = (void *)0; bp->t2_mapping = 0ULL; } else { } bnx2x_iov_free_mem(bp); return; } } int bnx2x_alloc_mem_cnic(struct bnx2x *bp ) { void *x ; void *tmp ; long tmp___0 ; void *x___0 ; void *tmp___1 ; long tmp___2 ; void *x___1 ; void *tmp___3 ; long tmp___4 ; int tmp___5 ; { if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { tmp = dma_zalloc_coherent(& (bp->pdev)->dev, 64UL, & bp->cnic_sb_mapping, 208U); x = tmp; if ((unsigned long )x != (unsigned long )((void *)0)) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem_cnic", 8260, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->cnic_sb_mapping, x); } else { } } else { } bp->cnic_sb.e2_sb = (struct host_hc_status_block_e2 *)x; if ((unsigned long )bp->cnic_sb.e2_sb == (unsigned long )((struct host_hc_status_block_e2 *)0)) { goto alloc_mem_err; } else { } } else { tmp___1 = dma_zalloc_coherent(& (bp->pdev)->dev, 64UL, & bp->cnic_sb_mapping, 208U); x___0 = tmp___1; if ((unsigned long )x___0 != (unsigned long )((void *)0)) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem_cnic", 8265, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->cnic_sb_mapping, x___0); } else { } } else { } bp->cnic_sb.e1x_sb = (struct host_hc_status_block_e1x *)x___0; if ((unsigned long )bp->cnic_sb.e1x_sb == (unsigned long )((struct host_hc_status_block_e1x *)0)) { goto alloc_mem_err; } else { } } if (((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && ! bp->cnic_enabled) && (unsigned long )bp->t2 == (unsigned long )((void *)0)) { tmp___3 = dma_zalloc_coherent(& (bp->pdev)->dev, 65536UL, & bp->t2_mapping, 208U); x___1 = tmp___3; if ((unsigned long )x___1 != (unsigned long )((void *)0)) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem_cnic", 8272, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->t2_mapping, x___1); } else { } } else { } bp->t2 = x___1; if ((unsigned long )bp->t2 == (unsigned long )((void *)0)) { goto alloc_mem_err; } else { } } else { } bp->cnic_eth_dev.addr_drv_info_to_mcp = & (bp->slowpath)->drv_info_to_mcp; tmp___5 = bnx2x_ilt_mem_op_cnic(bp, 0); if (tmp___5 != 0) { goto alloc_mem_err; } else { } return (0); alloc_mem_err: bnx2x_free_mem_cnic(bp); printk("\vbnx2x: [%s:%d(%s)]Can\'t allocate memory\n", "bnx2x_alloc_mem_cnic", 8288, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } } int bnx2x_alloc_mem(struct bnx2x *bp ) { int i ; int allocated ; int context_size ; void *x ; void *tmp ; long tmp___0 ; void *x___0 ; void *tmp___1 ; long tmp___2 ; void *x___1 ; void *tmp___3 ; long tmp___4 ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; int _min1 ; int _min2 ; void *x___2 ; void *tmp___5 ; long tmp___6 ; void *tmp___7 ; int tmp___8 ; int tmp___9 ; void *x___3 ; void *tmp___10 ; long tmp___11 ; void *x___4 ; void *tmp___12 ; long tmp___13 ; { if (((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (int )bp->cnic_enabled) && (unsigned long )bp->t2 == (unsigned long )((void *)0)) { tmp = dma_zalloc_coherent(& (bp->pdev)->dev, 65536UL, & bp->t2_mapping, 208U); x = tmp; if ((unsigned long )x != (unsigned long )((void *)0)) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem", 8298, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->t2_mapping, x); } else { } } else { } bp->t2 = x; if ((unsigned long )bp->t2 == (unsigned long )((void *)0)) { goto alloc_mem_err; } else { } } else { } tmp___1 = dma_zalloc_coherent(& (bp->pdev)->dev, 56UL, & bp->def_status_blk_mapping, 208U); x___0 = tmp___1; if ((unsigned long )x___0 != (unsigned long )((void *)0)) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem", 8304, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->def_status_blk_mapping, x___0); } else { } } else { } bp->def_status_blk = (struct host_sp_status_block *)x___0; if ((unsigned long )bp->def_status_blk == (unsigned long )((struct host_sp_status_block *)0)) { goto alloc_mem_err; } else { } tmp___3 = dma_zalloc_coherent(& (bp->pdev)->dev, 4748UL, & bp->slowpath_mapping, 208U); x___1 = tmp___3; if ((unsigned long )x___1 != (unsigned long )((void *)0)) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem", 8309, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->slowpath_mapping, x___1); } else { } } else { } bp->slowpath = (struct bnx2x_slowpath *)x___1; if ((unsigned long )bp->slowpath == (unsigned long )((struct bnx2x_slowpath *)0)) { goto alloc_mem_err; } else { } __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; context_size = (int )((bp->num_ethernet_queues * 3U + (uint )bp->cnic_support * (((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) - ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos) + 2U)) * 1024U); i = 0; allocated = 0; goto ldv_64698; ldv_64697: _min1 = 32768; _min2 = context_size - allocated; bp->context[i].size = (size_t )(_min1 < _min2 ? _min1 : _min2); tmp___5 = dma_zalloc_coherent(& (bp->pdev)->dev, bp->context[i].size, & bp->context[i].cxt_mapping, 208U); x___2 = tmp___5; if ((unsigned long )x___2 != (unsigned long )((void *)0)) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem", 8332, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->context[i].cxt_mapping, x___2); } else { } } else { } bp->context[i].vcxt = (union cdu_context *)x___2; if ((unsigned long )bp->context[i].vcxt == (unsigned long )((union cdu_context *)0)) { goto alloc_mem_err; } else { } allocated = (int )((unsigned int )bp->context[i].size + (unsigned int )allocated); i = i + 1; ldv_64698: ; if (allocated < context_size) { goto ldv_64697; } else { } tmp___7 = kcalloc(256UL, 24UL, 208U); (bp->ilt)->lines = (struct ilt_line *)tmp___7; if ((unsigned long )(bp->ilt)->lines == (unsigned long )((struct ilt_line *)0)) { goto alloc_mem_err; } else { } tmp___8 = bnx2x_ilt_mem_op(bp, 0); if (tmp___8 != 0) { goto alloc_mem_err; } else { } tmp___9 = bnx2x_iov_alloc_mem(bp); if (tmp___9 != 0) { goto alloc_mem_err; } else { } tmp___10 = dma_zalloc_coherent(& (bp->pdev)->dev, 4096UL, & bp->spq_mapping, 208U); x___3 = tmp___10; if ((unsigned long )x___3 != (unsigned long )((void *)0)) { tmp___11 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem", 8349, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->spq_mapping, x___3); } else { } } else { } bp->spq = (struct eth_spe *)x___3; if ((unsigned long )bp->spq == (unsigned long )((struct eth_spe *)0)) { goto alloc_mem_err; } else { } tmp___12 = dma_zalloc_coherent(& (bp->pdev)->dev, 4096UL, & bp->eq_mapping, 208U); x___4 = tmp___12; if ((unsigned long )x___4 != (unsigned long )((void *)0)) { tmp___13 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___13 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_mem", 8355, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->eq_mapping, x___4); } else { } } else { } bp->eq_ring = (union event_ring_elem *)x___4; if ((unsigned long )bp->eq_ring == (unsigned long )((union event_ring_elem *)0)) { goto alloc_mem_err; } else { } return (0); alloc_mem_err: bnx2x_free_mem(bp); printk("\vbnx2x: [%s:%d(%s)]Can\'t allocate memory\n", "bnx2x_alloc_mem", 8363, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } } int bnx2x_set_mac_one(struct bnx2x *bp , u8 *mac , struct bnx2x_vlan_mac_obj *obj , bool set , int mac_type , unsigned long *ramrod_flags ) { int rc ; struct bnx2x_vlan_mac_ramrod_params ramrod_param ; int tmp ; long tmp___0 ; { memset((void *)(& ramrod_param), 0, 56UL); ramrod_param.vlan_mac_obj = obj; ramrod_param.ramrod_flags = *ramrod_flags; tmp = constant_test_bit(6L, (unsigned long const volatile *)ramrod_flags); if (tmp == 0) { memcpy((void *)(& ramrod_param.user_req.u.mac.mac), (void const *)mac, 6UL); __set_bit((long )mac_type, (unsigned long volatile *)(& ramrod_param.user_req.vlan_mac_flags)); if ((int )set) { ramrod_param.user_req.cmd = 0; } else { ramrod_param.user_req.cmd = 1; } } else { } rc = bnx2x_config_vlan_mac(bp, & ramrod_param); if (rc == -17) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to schedule ADD operations: %d\n", "bnx2x_set_mac_one", 8400, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } rc = 0; } else if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]%s MAC failed\n", "bnx2x_set_mac_one", 8404, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )set ? (char *)"Set" : (char *)"Del"); } else { } return (rc); } } int bnx2x_del_all_macs(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *mac_obj , int mac_type , bool wait_for_comp ) { int rc ; unsigned long ramrod_flags ; unsigned long vlan_mac_flags ; { ramrod_flags = 0UL; vlan_mac_flags = 0UL; if ((int )wait_for_comp) { __set_bit(2L, (unsigned long volatile *)(& ramrod_flags)); } else { } __set_bit((long )mac_type, (unsigned long volatile *)(& vlan_mac_flags)); rc = (*(mac_obj->delete_all))(bp, mac_obj, & vlan_mac_flags, & ramrod_flags); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to delete MACs: %d\n", "bnx2x_del_all_macs", 8425, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } return (rc); } } int bnx2x_set_eth_mac(struct bnx2x *bp , bool set ) { unsigned long ramrod_flags ; long tmp ; int tmp___0 ; int tmp___1 ; { if ((bp->flags & 4194304U) == 0U) { ramrod_flags = 0UL; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Adding Eth MAC\n", "bnx2x_set_eth_mac", 8435, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } __set_bit(2L, (unsigned long volatile *)(& ramrod_flags)); tmp___0 = bnx2x_set_mac_one(bp, (bp->dev)->dev_addr, & (bp->sp_objs)->mac_obj, (int )set, 1, & ramrod_flags); return (tmp___0); } else { tmp___1 = bnx2x_vfpf_config_mac(bp, (bp->dev)->dev_addr, (int )(bp->fp)->index, (int )set); return (tmp___1); } } } int bnx2x_setup_leading(struct bnx2x *bp ) { int tmp ; int tmp___0 ; { if ((bp->flags & 4194304U) == 0U) { tmp = bnx2x_setup_queue(bp, bp->fp, 1); return (tmp); } else { tmp___0 = bnx2x_vfpf_setup_q(bp, bp->fp, 1); return (tmp___0); } } } int bnx2x_set_int_mode(struct bnx2x *bp ) { int rc ; long tmp ; long tmp___0 ; long tmp___1 ; { rc = 0; if ((bp->flags & 4194304U) != 0U && int_mode != 0) { printk("\vbnx2x: [%s:%d(%s)]VF not loaded since interrupt mode not msix\n", "bnx2x_set_int_mode", 8466, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } switch (int_mode) { case 0: rc = bnx2x_enable_msix(bp); if (rc == 0) { return (0); } else { } if (rc != 0 && (bp->flags & 4194304U) != 0U) { return (rc); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Failed to enable multiple MSI-X (%d), set number of queues to %d\n", bp->num_queues, bp->num_cnic_queues + 1U); } else { } case 2: bnx2x_enable_msi(bp); case 1: bp->num_ethernet_queues = 1U; bp->num_queues = (int )(bp->num_ethernet_queues + bp->num_cnic_queues); tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "set number of queues to 1\n"); } else { } goto ldv_64742; default: tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "unknown value in int_mode module parameter\n"); } else { } return (-22); } ldv_64742: ; return (0); } } __inline static u16 bnx2x_cid_ilt_lines(struct bnx2x *bp ) { int __y ; int __y___0 ; int __y___1 ; int __y___2 ; { if ((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0)) { return (64U); } else { } __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; return ((u16 )(((unsigned long )(bp->num_ethernet_queues * 3U + (uint )bp->cnic_support * (((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) - ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos) + 2U)) + 31UL) / 32UL)); } } void bnx2x_ilt_set_info(struct bnx2x *bp ) { struct ilt_client_info *ilt_client ; struct bnx2x_ilt *ilt ; u16 line ; long tmp ; u16 tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; long tmp___6 ; int tmp___7 ; long tmp___8 ; long tmp___9 ; { ilt = bp->ilt; line = 0U; ilt->start_line = (u32 )((int )bp->pfid * 384); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]ilt starts at line %d\n", "bnx2x_ilt_set_info", 8520, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ilt->start_line); } else { } ilt_client = (struct ilt_client_info *)(& ilt->clients); ilt_client->client_num = 0U; ilt_client->page_size = 32768U; ilt_client->flags = 2U; ilt_client->start = line; tmp___0 = bnx2x_cid_ilt_lines(bp); line = (int )tmp___0 + (int )line; if ((unsigned int )bp->cnic_support != 0U) { line = (unsigned int )line + 72U; } else { } ilt_client->end = (unsigned int )line + 65535U; tmp___2 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___2 != 0L) { tmp___1 = __ilog2_u32(ilt_client->page_size >> 12); printk("\rbnx2x: [%s:%d(%s)]ilt client[CDU]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n", "bnx2x_ilt_set_info", 8539, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ilt_client->start, (int )ilt_client->end, ilt_client->page_size, (int )ilt_client->flags, tmp___1); } else { } if (bp->qm_cid_count > 31) { ilt_client = (struct ilt_client_info *)(& ilt->clients) + 1UL; ilt_client->client_num = 1U; ilt_client->page_size = 4096U; ilt_client->flags = 0U; ilt_client->start = line; line = (int )((u16 )(((bp->qm_cid_count + 64) * 64 + -1) / 4096)) + (int )line; ilt_client->end = (unsigned int )line + 65535U; tmp___4 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___4 != 0L) { tmp___3 = __ilog2_u32(ilt_client->page_size >> 12); printk("\rbnx2x: [%s:%d(%s)]ilt client[QM]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n", "bnx2x_ilt_set_info", 8561, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ilt_client->start, (int )ilt_client->end, ilt_client->page_size, (int )ilt_client->flags, tmp___3); } else { } } else { } if ((unsigned int )bp->cnic_support != 0U) { ilt_client = (struct ilt_client_info *)(& ilt->clients) + 2UL; ilt_client->client_num = 2U; ilt_client->page_size = 4096U; ilt_client->flags = 0U; ilt_client->start = line; line = (unsigned int )line + 16U; ilt_client->end = (unsigned int )line + 65535U; tmp___6 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___6 != 0L) { tmp___5 = __ilog2_u32(ilt_client->page_size >> 12); printk("\rbnx2x: [%s:%d(%s)]ilt client[SRC]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n", "bnx2x_ilt_set_info", 8580, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ilt_client->start, (int )ilt_client->end, ilt_client->page_size, (int )ilt_client->flags, tmp___5); } else { } ilt_client = (struct ilt_client_info *)(& ilt->clients) + 3UL; ilt_client->client_num = 3U; ilt_client->page_size = 4096U; ilt_client->flags = 0U; ilt_client->start = line; line = (unsigned int )line + 5U; ilt_client->end = (unsigned int )line + 65535U; tmp___8 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___8 != 0L) { tmp___7 = __ilog2_u32(ilt_client->page_size >> 12); printk("\rbnx2x: [%s:%d(%s)]ilt client[TM]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n", "bnx2x_ilt_set_info", 8597, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ilt_client->start, (int )ilt_client->end, ilt_client->page_size, (int )ilt_client->flags, tmp___7); } else { } } else { } tmp___9 = ldv__builtin_expect((unsigned int )line > 256U, 0L); if (tmp___9 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c"), "i" (8600), "i" (12UL)); ldv_64762: ; goto ldv_64762; } else { } return; } } static void bnx2x_pf_q_prep_init(struct bnx2x *bp , struct bnx2x_fastpath *fp , struct bnx2x_queue_init_params *init_params ) { u8 cos ; int cxt_index ; int cxt_offset ; u8 tmp ; long tmp___0 ; { if ((uint )fp->index != (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { __set_bit(9L, (unsigned long volatile *)(& init_params->rx.flags)); __set_bit(9L, (unsigned long volatile *)(& init_params->tx.flags)); __set_bit(10L, (unsigned long volatile *)(& init_params->rx.flags)); __set_bit(10L, (unsigned long volatile *)(& init_params->tx.flags)); init_params->rx.hc_rate = (unsigned int )bp->rx_ticks != 0U ? (u16 )(1000000 / (int )bp->rx_ticks) : 0U; init_params->tx.hc_rate = (unsigned int )bp->tx_ticks != 0U ? (u16 )(1000000 / (int )bp->tx_ticks) : 0U; tmp = fp->fw_sb_id; init_params->tx.fw_sb_id = tmp; init_params->rx.fw_sb_id = tmp; init_params->rx.sb_cq_index = 1U; init_params->tx.sb_cq_index = 5U; } else { } init_params->max_cos = fp->max_cos; tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]fp: %d setting queue params max cos to: %d\n", "bnx2x_pf_q_prep_init", 8653, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index, (int )init_params->max_cos); } else { } cos = 0U; goto ldv_64773; ldv_64772: cxt_index = (int )((fp->txdata_ptr[(int )cos])->cid / 32U); cxt_offset = (int )((fp->txdata_ptr[(int )cos])->cid - (unsigned int )((unsigned long )cxt_index) * 32U); init_params->cxts[(int )cos] = & (bp->context[cxt_index].vcxt + (unsigned long )cxt_offset)->eth; cos = (u8 )((int )cos + 1); ldv_64773: ; if ((int )init_params->max_cos > (int )cos) { goto ldv_64772; } else { } return; } } static int bnx2x_setup_tx_only(struct bnx2x *bp , struct bnx2x_fastpath *fp , struct bnx2x_queue_state_params *q_params , struct bnx2x_queue_setup_tx_only_params *tx_only_params , int tx_index , bool leading ) { long tmp ; int tmp___0 ; { memset((void *)tx_only_params, 0, 48UL); q_params->cmd = 2; tx_only_params->flags = bnx2x_get_common_flags(bp, fp, 0); tx_only_params->cid_index = (u8 )tx_index; bnx2x_pf_q_prep_general(bp, fp, & tx_only_params->gen_params, (int )((u8 )tx_index)); bnx2x_pf_tx_q_prep(bp, fp, & tx_only_params->txq_params, (int )((u8 )tx_index)); tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]preparing to send tx-only ramrod for connection: cos %d, primary cid %d, cid %d, client id %d, sp-client id %d, flags %lx\n", "bnx2x_setup_tx_only", 8691, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tx_index, (q_params->q_obj)->cids[0], (q_params->q_obj)->cids[tx_index], (int )(q_params->q_obj)->cl_id, (int )tx_only_params->gen_params.spcl_id, tx_only_params->flags); } else { } tmp___0 = bnx2x_queue_state_change(bp, q_params); return (tmp___0); } } int bnx2x_setup_queue(struct bnx2x *bp , struct bnx2x_fastpath *fp , bool leading ) { struct bnx2x_queue_state_params q_params ; struct bnx2x_queue_setup_params *setup_params ; struct bnx2x_queue_setup_tx_only_params *tx_only_params ; int rc ; u8 tx_index ; long tmp ; long tmp___0 ; { q_params.q_obj = (struct bnx2x_queue_sp_obj *)0; q_params.cmd = 0; q_params.ramrod_flags = 0UL; q_params.params.setup.gen_params.stat_id = (unsigned char)0; q_params.params.setup.gen_params.spcl_id = (unsigned char)0; q_params.params.setup.gen_params.mtu = (unsigned short)0; q_params.params.setup.gen_params.cos = (unsigned char)0; q_params.params.setup.gen_params.fp_hsi = (unsigned char)0; q_params.params.setup.txq_params.dscr_map = 0ULL; q_params.params.setup.txq_params.fw_sb_id = (unsigned char)0; q_params.params.setup.txq_params.sb_cq_index = (unsigned char)0; q_params.params.setup.txq_params.cos = (unsigned char)0; q_params.params.setup.txq_params.traffic_type = (unsigned short)0; q_params.params.setup.txq_params.tss_leading_cl_id = (unsigned char)0; q_params.params.setup.txq_params.default_vlan = (unsigned short)0; q_params.params.setup.rxq_params.dscr_map = 0ULL; q_params.params.setup.rxq_params.sge_map = 0ULL; q_params.params.setup.rxq_params.rcq_map = 0ULL; q_params.params.setup.rxq_params.rcq_np_map = 0ULL; q_params.params.setup.rxq_params.drop_flags = (unsigned short)0; q_params.params.setup.rxq_params.buf_sz = (unsigned short)0; q_params.params.setup.rxq_params.fw_sb_id = (unsigned char)0; q_params.params.setup.rxq_params.cl_qzone_id = (unsigned char)0; q_params.params.setup.rxq_params.tpa_agg_sz = (unsigned short)0; q_params.params.setup.rxq_params.sge_buf_sz = (unsigned short)0; q_params.params.setup.rxq_params.max_sges_pkt = (unsigned char)0; q_params.params.setup.rxq_params.max_tpa_queues = (unsigned char)0; q_params.params.setup.rxq_params.rss_engine_id = (unsigned char)0; q_params.params.setup.rxq_params.mcast_engine_id = (unsigned char)0; q_params.params.setup.rxq_params.cache_line_log = (unsigned char)0; q_params.params.setup.rxq_params.sb_cq_index = (unsigned char)0; q_params.params.setup.rxq_params.silent_removal_value = (unsigned short)0; q_params.params.setup.rxq_params.silent_removal_mask = (unsigned short)0; q_params.params.setup.pause_params.bd_th_lo = (unsigned short)0; q_params.params.setup.pause_params.bd_th_hi = (unsigned short)0; q_params.params.setup.pause_params.rcq_th_lo = (unsigned short)0; q_params.params.setup.pause_params.rcq_th_hi = (unsigned short)0; q_params.params.setup.pause_params.sge_th_lo = (unsigned short)0; q_params.params.setup.pause_params.sge_th_hi = (unsigned short)0; q_params.params.setup.pause_params.pri_map = (unsigned short)0; q_params.params.setup.flags = 0UL; setup_params = & q_params.params.setup; tx_only_params = & q_params.params.tx_only; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]setting up queue %d\n", "bnx2x_setup_queue", 8719, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index); } else { } if ((uint )fp->index != (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { bnx2x_ack_sb(bp, (int )fp->igu_sb_id, 0, 0, 0, 0); } else { } q_params.q_obj = & (bp->sp_objs + (unsigned long )fp->index)->q_obj; __set_bit(2L, (unsigned long volatile *)(& q_params.ramrod_flags)); bnx2x_pf_q_prep_init(bp, fp, & q_params.params.init); q_params.cmd = 0; rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Queue(%d) INIT failed\n", "bnx2x_setup_queue", 8739, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index); return (rc); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]init complete\n", "bnx2x_setup_queue", 8743, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } memset((void *)setup_params, 0, 112UL); setup_params->flags = bnx2x_get_q_flags(bp, fp, (int )leading); bnx2x_pf_q_prep_general(bp, fp, & setup_params->gen_params, 0); bnx2x_pf_rx_q_prep(bp, fp, & setup_params->pause_params, & setup_params->rxq_params); bnx2x_pf_tx_q_prep(bp, fp, & setup_params->txq_params, 0); q_params.cmd = 1; if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { bp->fcoe_init = 1; } else { } rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Queue(%d) SETUP failed\n", "bnx2x_setup_queue", 8770, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index); return (rc); } else { } tx_index = 1U; goto ldv_64796; ldv_64795: rc = bnx2x_setup_tx_only(bp, fp, & q_params, tx_only_params, (int )tx_index, (int )leading); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Queue(%d.%d) TX_ONLY_SETUP failed\n", "bnx2x_setup_queue", 8784, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index, (int )tx_index); return (rc); } else { } tx_index = (u8 )((int )tx_index + 1); ldv_64796: ; if ((int )fp->max_cos > (int )tx_index) { goto ldv_64795; } else { } return (rc); } } static int bnx2x_stop_queue(struct bnx2x *bp , int index ) { struct bnx2x_fastpath *fp ; struct bnx2x_fp_txdata *txdata ; struct bnx2x_queue_state_params q_params ; int rc ; int tx_index ; long tmp ; long tmp___0 ; int tmp___1 ; { fp = bp->fp + (unsigned long )index; q_params.q_obj = (struct bnx2x_queue_sp_obj *)0; q_params.cmd = 0; q_params.ramrod_flags = 0UL; q_params.params.setup.gen_params.stat_id = (unsigned char)0; q_params.params.setup.gen_params.spcl_id = (unsigned char)0; q_params.params.setup.gen_params.mtu = (unsigned short)0; q_params.params.setup.gen_params.cos = (unsigned char)0; q_params.params.setup.gen_params.fp_hsi = (unsigned char)0; q_params.params.setup.txq_params.dscr_map = 0ULL; q_params.params.setup.txq_params.fw_sb_id = (unsigned char)0; q_params.params.setup.txq_params.sb_cq_index = (unsigned char)0; q_params.params.setup.txq_params.cos = (unsigned char)0; q_params.params.setup.txq_params.traffic_type = (unsigned short)0; q_params.params.setup.txq_params.tss_leading_cl_id = (unsigned char)0; q_params.params.setup.txq_params.default_vlan = (unsigned short)0; q_params.params.setup.rxq_params.dscr_map = 0ULL; q_params.params.setup.rxq_params.sge_map = 0ULL; q_params.params.setup.rxq_params.rcq_map = 0ULL; q_params.params.setup.rxq_params.rcq_np_map = 0ULL; q_params.params.setup.rxq_params.drop_flags = (unsigned short)0; q_params.params.setup.rxq_params.buf_sz = (unsigned short)0; q_params.params.setup.rxq_params.fw_sb_id = (unsigned char)0; q_params.params.setup.rxq_params.cl_qzone_id = (unsigned char)0; q_params.params.setup.rxq_params.tpa_agg_sz = (unsigned short)0; q_params.params.setup.rxq_params.sge_buf_sz = (unsigned short)0; q_params.params.setup.rxq_params.max_sges_pkt = (unsigned char)0; q_params.params.setup.rxq_params.max_tpa_queues = (unsigned char)0; q_params.params.setup.rxq_params.rss_engine_id = (unsigned char)0; q_params.params.setup.rxq_params.mcast_engine_id = (unsigned char)0; q_params.params.setup.rxq_params.cache_line_log = (unsigned char)0; q_params.params.setup.rxq_params.sb_cq_index = (unsigned char)0; q_params.params.setup.rxq_params.silent_removal_value = (unsigned short)0; q_params.params.setup.rxq_params.silent_removal_mask = (unsigned short)0; q_params.params.setup.pause_params.bd_th_lo = (unsigned short)0; q_params.params.setup.pause_params.bd_th_hi = (unsigned short)0; q_params.params.setup.pause_params.rcq_th_lo = (unsigned short)0; q_params.params.setup.pause_params.rcq_th_hi = (unsigned short)0; q_params.params.setup.pause_params.sge_th_lo = (unsigned short)0; q_params.params.setup.pause_params.sge_th_hi = (unsigned short)0; q_params.params.setup.pause_params.pri_map = (unsigned short)0; q_params.params.setup.flags = 0UL; tmp = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]stopping queue %d cid %d\n", "bnx2x_stop_queue", 8799, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", index, fp->cid); } else { } q_params.q_obj = & (bp->sp_objs + (unsigned long )fp->index)->q_obj; __set_bit(2L, (unsigned long volatile *)(& q_params.ramrod_flags)); tx_index = 1; goto ldv_64809; ldv_64808: txdata = fp->txdata_ptr[tx_index]; tmp___0 = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]stopping tx-only queue %d\n", "bnx2x_stop_queue", 8814, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", txdata->txq_index); } else { } q_params.cmd = 9; memset((void *)(& q_params.params.terminate), 0, 1UL); q_params.params.terminate.cid_index = (u8 )tx_index; rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { return (rc); } else { } q_params.cmd = 8; memset((void *)(& q_params.params.cfc_del), 0, 1UL); q_params.params.cfc_del.cid_index = (u8 )tx_index; rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { return (rc); } else { } tx_index = tx_index + 1; ldv_64809: ; if ((int )fp->max_cos > tx_index) { goto ldv_64808; } else { } q_params.cmd = 7; rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { return (rc); } else { } q_params.cmd = 9; memset((void *)(& q_params.params.terminate), 0, 1UL); q_params.params.terminate.cid_index = 0U; rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { return (rc); } else { } q_params.cmd = 8; memset((void *)(& q_params.params.cfc_del), 0, 1UL); q_params.params.cfc_del.cid_index = 0U; tmp___1 = bnx2x_queue_state_change(bp, & q_params); return (tmp___1); } } static void bnx2x_reset_func(struct bnx2x *bp ) { int port ; int func ; int i ; struct bnx2x_fastpath *fp ; u8 tmp ; unsigned int tmp___0 ; struct ilt_client_info ilt_cli ; { port = (int )bp->pfid & 1; func = (int )bp->pfid; writeb(0, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 47UL)->base + (unsigned int )((int )(bp->iro_arr + 47UL)->m1 * func)) + 4325376U)); writeb(0, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 153UL)->base + (unsigned int )((int )(bp->iro_arr + 153UL)->m1 * func)) + 4259840U)); writeb(0, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 107UL)->base + (unsigned int )((int )(bp->iro_arr + 107UL)->m1 * func)) + 4390912U)); writeb(0, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 182UL)->base + (unsigned int )((int )(bp->iro_arr + 182UL)->m1 * func)) + 4194304U)); i = 0; goto ldv_64819; ldv_64818: fp = bp->fp + (unsigned long )i; writeb(0, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 138UL)->base + (unsigned int )((int )fp->fw_sb_id * (int )(bp->iro_arr + 138UL)->m1)) + 4259840U)); i = i + 1; ldv_64819: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_64818; } else { } if ((int )bp->cnic_loaded) { tmp = bnx2x_cnic_fw_sb_id(bp); writeb(0, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 138UL)->base + (unsigned int )((int )tmp * (int )(bp->iro_arr + 138UL)->m1)) + 4259840U)); } else { } writeb(0, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 147UL)->base + (unsigned int )((int )(bp->iro_arr + 147UL)->m1 * func)) + 4259840U)); i = 0; goto ldv_64822; ldv_64821: writel(0U, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 32UL)->base + (unsigned int )((int )(bp->iro_arr + 32UL)->m1 * func)) + 4325376U)); i = i + 1; ldv_64822: ; if ((int )((unsigned int )((unsigned short )(bp->iro_arr + 32UL)->size) / 4U) > i) { goto ldv_64821; } else { } if ((unsigned int )bp->common.int_block == 0U) { writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 135176) * 8)); writel(0U, (void volatile *)bp->regview + (unsigned long )(port * 8 + 1081412)); } else { writel(0U, (void volatile *)bp->regview + 1245492U); writel(0U, (void volatile *)bp->regview + 1245444U); } if ((int )bp->cnic_loaded) { writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 364549) * 4)); i = 0; goto ldv_64826; ldv_64825: usleep_range(10000UL, 20000UL); tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )((port + 364596) * 4)); if (tmp___0 == 0U) { goto ldv_64824; } else { } i = i + 1; ldv_64826: ; if (i <= 199) { goto ldv_64825; } else { } ldv_64824: ; } else { } bnx2x_clear_func_ilt(bp, (u32 )func); if ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && (unsigned int )((int )bp->pfid >> 1) == 3U) { memset((void *)(& ilt_cli), 0, 12UL); ilt_cli.start = 0U; ilt_cli.end = 3071U; ilt_cli.client_num = 3U; bnx2x_ilt_boundry_init_op(bp, & ilt_cli, 0U, 1); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { bnx2x_pf_disable(bp); } else { } bp->dmae_ready = 0; return; } } static void bnx2x_reset_port(struct bnx2x *bp ) { int port ; u32 val ; long tmp ; { port = (int )bp->pfid & 1; bnx2x__link_reset(bp); writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 16588) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 16529) * 4)); writel(0U, (void volatile *)(bp->regview + (port != 0 ? 66268UL : 66140UL))); writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 10264) * 4)); msleep(100U); val = readl((void const volatile *)bp->regview + (unsigned long )((port + 98341) * 4)); if (val != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]BRB1 is not empty %d blocks are occupied\n", "bnx2x_reset_port", 8963, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } } else { } return; } } static int bnx2x_reset_hw(struct bnx2x *bp , u32 load_code ) { struct bnx2x_func_state_params func_params ; int tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); func_params.f_obj = & bp->func_obj; func_params.cmd = 3; func_params.params.hw_init.load_phase = load_code; tmp = bnx2x_func_state_change(bp, & func_params); return (tmp); } } static int bnx2x_func_stop(struct bnx2x *bp ) { struct bnx2x_func_state_params func_params ; int rc ; int tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); func_params.f_obj = & bp->func_obj; func_params.cmd = 2; rc = bnx2x_func_state_change(bp, & func_params); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]FUNC_STOP ramrod failed. Running a dry transaction\n", "bnx2x_func_stop", 9004, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); __set_bit(3L, (unsigned long volatile *)(& func_params.ramrod_flags)); tmp = bnx2x_func_state_change(bp, & func_params); return (tmp); } else { } return (0); } } u32 bnx2x_send_unload_req(struct bnx2x *bp , int unload_mode ) { u32 reset_code ; int port ; u32 emac_base ; u8 *mac_addr ; struct pci_dev *pdev ; u32 val ; u16 pmc ; u8 entry ; int path ; long tmp ; long tmp___0 ; { reset_code = 0U; port = (int )bp->pfid & 1; if (unload_mode == 0) { reset_code = 536936448U; } else if ((bp->flags & 8U) != 0U) { reset_code = 537001984U; } else if ((unsigned int )bp->wol != 0U) { emac_base = port != 0 ? 33792U : 32768U; mac_addr = (bp->dev)->dev_addr; pdev = bp->pdev; entry = (unsigned int )((u8 )(((int )bp->pfid >> 1) + 1)) * 8U; val = (u32 )(((int )*mac_addr << 8) | (int )*(mac_addr + 1UL)); writel(val, (void volatile *)bp->regview + (unsigned long )(((u32 )entry + emac_base) + 16U)); val = (u32 )(((((int )*(mac_addr + 2UL) << 24) | ((int )*(mac_addr + 3UL) << 16)) | ((int )*(mac_addr + 4UL) << 8)) | (int )*(mac_addr + 5UL)); writel(val, (void volatile *)bp->regview + (unsigned long )(((u32 )entry + emac_base) + 20U)); pci_read_config_word((struct pci_dev const *)pdev, (int )pdev->pm_cap + 4, & pmc); pmc = (u16 )((unsigned int )pmc | 33024U); pci_write_config_word((struct pci_dev const *)pdev, (int )pdev->pm_cap + 4, (int )pmc); reset_code = 536870912U; } else { reset_code = 536936448U; } if ((bp->flags & 512U) == 0U) { reset_code = bnx2x_fw_command(bp, reset_code, 0U); } else { path = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0; tmp = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]NO MCP - load counts[%d] %d, %d, %d\n", "bnx2x_send_unload_req", 9070, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", path, bnx2x_load_count[path][0], bnx2x_load_count[path][1], bnx2x_load_count[path][2]); } else { } bnx2x_load_count[path][0] = bnx2x_load_count[path][0] - 1; bnx2x_load_count[path][port + 1] = bnx2x_load_count[path][port + 1] - 1; tmp___0 = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]NO MCP - new load counts[%d] %d, %d, %d\n", "bnx2x_send_unload_req", 9075, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", path, bnx2x_load_count[path][0], bnx2x_load_count[path][1], bnx2x_load_count[path][2]); } else { } if (bnx2x_load_count[path][0] == 0) { reset_code = 537919488U; } else if (bnx2x_load_count[path][port + 1] == 0) { reset_code = 537985024U; } else { reset_code = 538050560U; } } return (reset_code); } } void bnx2x_send_unload_done(struct bnx2x *bp , bool keep_link ) { u32 reset_param ; { reset_param = (int )keep_link ? 2U : 0U; if ((bp->flags & 512U) == 0U) { bnx2x_fw_command(bp, 553648128U, reset_param); } else { } return; } } static int bnx2x_func_wait_started(struct bnx2x *bp ) { int tout ; int msix ; enum bnx2x_func_state tmp ; int tmp___0 ; struct bnx2x_func_state_params func_params ; long tmp___1 ; int tmp___2 ; enum bnx2x_func_state tmp___3 ; { tout = 50; msix = (bp->flags & 32U) != 0U; if (bp->port.pmf == 0U) { return (0); } else { } if (msix != 0) { synchronize_irq((bp->msix_table)->vector); } else { synchronize_irq((bp->pdev)->irq); } ldv_flush_workqueue_14(bnx2x_wq); ldv_flush_workqueue_15(bnx2x_iov_wq); goto ldv_64870; ldv_64869: msleep(20U); ldv_64870: tmp = bnx2x_func_get_state(bp, & bp->func_obj); if ((unsigned int )tmp != 2U) { tmp___0 = tout; tout = tout - 1; if (tmp___0 != 0) { goto ldv_64869; } else { goto ldv_64871; } } else { } ldv_64871: tmp___3 = bnx2x_func_get_state(bp, & bp->func_obj); if ((unsigned int )tmp___3 != 2U) { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; tmp___1 = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Hmmm... Unexpected function state! Forcing STARTED-->TX_STOPPED-->STARTED\n", "bnx2x_func_wait_started", 9150, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } func_params.f_obj = & bp->func_obj; __set_bit(3L, (unsigned long volatile *)(& func_params.ramrod_flags)); func_params.cmd = 6; bnx2x_func_state_change(bp, & func_params); func_params.cmd = 7; tmp___2 = bnx2x_func_state_change(bp, & func_params); return (tmp___2); } else { } return (0); } } static void bnx2x_disable_ptp(struct bnx2x *bp ) { int port ; { port = (int )bp->pfid & 1; writel(0U, (void volatile *)(bp->regview + (port != 0 ? 100308UL : 100268UL))); writel(2047U, (void volatile *)(bp->regview + (port != 0 ? 100296UL : 100256UL))); writel(16383U, (void volatile *)(bp->regview + (port != 0 ? 100300UL : 100260UL))); writel(2047U, (void volatile *)(bp->regview + (port != 0 ? 100344UL : 100336UL))); writel(16383U, (void volatile *)(bp->regview + (port != 0 ? 100348UL : 100340UL))); writel(0U, (void volatile *)(bp->regview + (port != 0 ? 100272UL : 100232UL))); return; } } static void bnx2x_stop_ptp(struct bnx2x *bp ) { long tmp ; { ldv_cancel_work_sync_16(& bp->ptp_task); if ((unsigned long )bp->ptp_tx_skb != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(bp->ptp_tx_skb); bp->ptp_tx_skb = (struct sk_buff *)0; } else { } bnx2x_disable_ptp(bp); tmp = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]PTP stop ended successfully\n", "bnx2x_stop_ptp", 9208, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } void bnx2x_chip_cleanup(struct bnx2x *bp , int unload_mode , bool keep_link ) { int port ; int i ; int rc ; u8 cos ; struct bnx2x_mcast_ramrod_params rparam ; u32 reset_code ; struct bnx2x_fastpath *fp ; int tmp ; int tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; { port = (int )bp->pfid & 1; rc = 0; rparam.mcast_obj = (struct bnx2x_mcast_obj *)0; rparam.ramrod_flags = 0UL; rparam.mcast_list.next = 0; rparam.mcast_list.prev = 0; rparam.mcast_list_len = 0; i = 0; goto ldv_64899; ldv_64898: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { fp = bp->fp + (unsigned long )i; cos = 0U; goto ldv_64896; ldv_64895: rc = bnx2x_clean_tx_queue(bp, fp->txdata_ptr[(int )cos]); cos = (u8 )((int )cos + 1); ldv_64896: ; if ((int )fp->max_cos > (int )cos) { goto ldv_64895; } else { } } i = i + 1; ldv_64899: ; if (bp->num_queues > i) { goto ldv_64898; } else { } usleep_range(1000UL, 2000UL); rc = bnx2x_del_all_macs(bp, & (bp->sp_objs)->mac_obj, 1, 0); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to delete all ETH macs: %d\n", "bnx2x_chip_cleanup", 9238, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } rc = bnx2x_del_all_macs(bp, & (bp->sp_objs)->mac_obj, 0, 1); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to schedule DEL commands for UC MACs list: %d\n", "bnx2x_chip_cleanup", 9245, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } if (bp->common.chip_id >> 16 != 5710U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(port * 8 + 90364)); } else { } netif_addr_lock_bh(bp->dev); tmp = constant_test_bit(3L, (unsigned long const volatile *)(& bp->sp_state)); if (tmp != 0) { set_bit(4L, (unsigned long volatile *)(& bp->sp_state)); } else { bnx2x_set_storm_rx_mode(bp); } rparam.mcast_obj = & bp->mcast_obj; rc = bnx2x_config_mcast(bp, & rparam, 2); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to send DEL multicast command: %d\n", "bnx2x_chip_cleanup", 9266, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } netif_addr_unlock_bh(bp->dev); bnx2x_iov_chip_cleanup(bp); reset_code = bnx2x_send_unload_req(bp, unload_mode); rc = bnx2x_func_wait_started(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]bnx2x_func_wait_started failed\n", "bnx2x_chip_cleanup", 9285, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } i = 0; goto ldv_64904; ldv_64903: tmp___0 = bnx2x_stop_queue(bp, i); if (tmp___0 != 0) { goto unload_error; } else { } i = i + 1; ldv_64904: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_64903; } else { } if ((int )bp->cnic_loaded) { i = (int )bp->num_ethernet_queues; goto ldv_64908; ldv_64907: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { tmp___1 = bnx2x_stop_queue(bp, i); if (tmp___1 != 0) { goto unload_error; } else { } } i = i + 1; ldv_64908: ; if (bp->num_queues > i) { goto ldv_64907; } else { } } else { } tmp___2 = bnx2x_wait_sp_comp(bp, 0xffffffffffffffffUL); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { printk("\vbnx2x: [%s:%d(%s)]Hmmm... Common slow path ramrods got stuck!\n", "bnx2x_chip_cleanup", 9316, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } unload_error: rc = bnx2x_func_stop(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Function stop failed!\n", "bnx2x_chip_cleanup", 9323, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((bp->flags & 67108864U) != 0U) { bnx2x_stop_ptp(bp); } else { } bnx2x_netif_stop(bp, 1); bnx2x_del_all_napi(bp); if ((int )bp->cnic_loaded) { bnx2x_del_all_napi_cnic(bp); } else { } bnx2x_free_irq(bp); rc = bnx2x_reset_hw(bp, reset_code); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]HW_RESET failed\n", "bnx2x_chip_cleanup", 9350, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_send_unload_done(bp, (int )keep_link); return; } } void bnx2x_disable_close_the_gate(struct bnx2x *bp ) { u32 val ; long tmp ; int port ; u32 addr ; { tmp = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Disabling \"close the gates\"\n", "bnx2x_disable_close_the_gate", 9360, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (bp->common.chip_id >> 16 == 5710U) { port = (int )bp->pfid & 1; addr = port != 0 ? 41060U : 41056U; val = readl((void const volatile *)bp->regview + (unsigned long )addr); val = val & 4294966527U; writel(val, (void volatile *)bp->regview + (unsigned long )addr); } else { val = readl((void const volatile *)bp->regview + 42524U); val = val & 4294967292U; writel(val, (void volatile *)bp->regview + 42524U); } return; } } static void bnx2x_set_234_gates(struct bnx2x *bp , bool close ) { u32 val ; long tmp ; { if (bp->common.chip_id >> 16 != 5710U) { writel((unsigned int )close, (void volatile *)bp->regview + 1061028U); writel((unsigned int )close, (void volatile *)bp->regview + 1061032U); } else { } if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { val = readl((void const volatile *)bp->regview + 1081348U); writel(! close ? val | 1U : val & 4294967294U, (void volatile *)bp->regview + 1081348U); val = readl((void const volatile *)bp->regview + 1081344U); writel(! close ? val | 1U : val & 4294967294U, (void volatile *)bp->regview + 1081344U); } else { val = readl((void const volatile *)bp->regview + 1245184U); writel(! close ? val | 1U : val & 4294967294U, (void volatile *)bp->regview + 1245184U); } tmp = ldv__builtin_expect((bp->msg_enable & 8224) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]%s gates #2, #3 and #4\n", "bnx2x_set_234_gates", 9414, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )close ? (char *)"closing" : (char *)"opening"); } else { } __asm__ volatile ("": : : "memory"); return; } } static void bnx2x_clp_reset_prep(struct bnx2x *bp , u32 *magic_val ) { u32 val ; unsigned int tmp ; { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.mf_cfg_base); val = tmp; *magic_val = val & 2147483648U; writel(val | 2147483648U, (void volatile *)bp->regview + (unsigned long )bp->common.mf_cfg_base); return; } } static void bnx2x_clp_reset_done(struct bnx2x *bp , u32 magic_val ) { u32 val ; unsigned int tmp ; { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.mf_cfg_base); val = tmp; writel((val & 2147483647U) | magic_val, (void volatile *)bp->regview + (unsigned long )bp->common.mf_cfg_base); return; } } static void bnx2x_reset_mcp_prep(struct bnx2x *bp , u32 *magic_val ) { u32 shmem ; u32 validity_offset ; long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 8224) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Starting\n", "bnx2x_reset_mcp_prep", 9455, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (bp->common.chip_id >> 16 != 5710U) { bnx2x_clp_reset_prep(bp, magic_val); } else { } shmem = readl((void const volatile *)bp->regview + 41652U); validity_offset = ((u32 )bp->pfid & 1U) * 4U; if (shmem != 0U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(shmem + validity_offset)); } else { } return; } } static void bnx2x_mcp_wait_one(struct bnx2x *bp ) { { if ((bp->common.chip_id & 61440U) > 20480U) { msleep(1000U); } else { msleep(100U); } return; } } static int bnx2x_init_shmem(struct bnx2x *bp ) { int cnt ; u32 val ; int tmp ; { cnt = 0; val = 0U; ldv_64948: bp->common.shmem_base = readl((void const volatile *)bp->regview + 41652U); if (bp->common.shmem_base != 0U) { val = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + ((unsigned long )bp->pfid & 1UL) * 4UL))); if ((val & 2097152U) != 0U) { return (0); } else { } } else { } bnx2x_mcp_wait_one(bp); tmp = cnt; cnt = cnt + 1; if (tmp <= 49) { goto ldv_64948; } else { } printk("\vbnx2x: [%s:%d(%s)]BAD MCP validity signature\n", "bnx2x_init_shmem", 9509, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-19); } } static int bnx2x_reset_mcp_comp(struct bnx2x *bp , u32 magic_val ) { int rc ; int tmp ; { tmp = bnx2x_init_shmem(bp); rc = tmp; if (bp->common.chip_id >> 16 != 5710U) { bnx2x_clp_reset_done(bp, magic_val); } else { } return (rc); } } static void bnx2x_pxp_prep(struct bnx2x *bp ) { { if (bp->common.chip_id >> 16 != 5710U) { writel(0U, (void volatile *)bp->regview + 1180524U); writel(0U, (void volatile *)bp->regview + 1180080U); __asm__ volatile ("": : : "memory"); } else { } return; } } static void bnx2x_process_kill_chip_reset(struct bnx2x *bp , bool global ) { u32 not_reset_mask1 ; u32 reset_mask1 ; u32 not_reset_mask2 ; u32 reset_mask2 ; u32 global_bits2 ; u32 stay_reset2 ; { global_bits2 = 384U; not_reset_mask1 = 738197504U; not_reset_mask2 = 3861119U; stay_reset2 = 12582912U; reset_mask1 = 4294967295U; if (bp->common.chip_id >> 16 == 5710U) { reset_mask2 = 65535U; } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { reset_mask2 = 131071U; } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { reset_mask2 = 1048575U; } else { reset_mask2 = 67108863U; } if (! global) { reset_mask2 = ~ global_bits2 & reset_mask2; } else { } writel(~ not_reset_mask2 & reset_mask2, (void volatile *)bp->regview + 42392U); writel(~ not_reset_mask1 & reset_mask1, (void volatile *)bp->regview + 42376U); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); writel(~ stay_reset2 & reset_mask2, (void volatile *)bp->regview + 42388U); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); writel(reset_mask1, (void volatile *)bp->regview + 42372U); __asm__ volatile ("": : : "memory"); return; } } static int bnx2x_er_poll_igu_vq(struct bnx2x *bp ) { u32 cnt ; u32 pend_bits ; u32 tmp ; { cnt = 1000U; pend_bits = 0U; ldv_64975: pend_bits = readl((void const volatile *)bp->regview + 1245952U); if (pend_bits == 0U) { goto ldv_64974; } else { } usleep_range(1000UL, 2000UL); tmp = cnt; cnt = cnt - 1U; if (tmp != 0U) { goto ldv_64975; } else { } ldv_64974: ; if (cnt == 0U) { printk("\vbnx2x: [%s:%d(%s)]Still pending IGU requests pend_bits=%x!\n", "bnx2x_er_poll_igu_vq", 9667, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", pend_bits); return (-16); } else { } return (0); } } static int bnx2x_process_kill(struct bnx2x *bp , bool global ) { int cnt ; u32 val ; u32 sr_cnt ; u32 blk_cnt ; u32 port_is_idle_0 ; u32 port_is_idle_1 ; u32 pgl_exp_rom2 ; u32 tags_63_32 ; int tmp ; int tmp___0 ; int tmp___1 ; { cnt = 1000; val = 0U; tags_63_32 = 0U; ldv_64990: sr_cnt = readl((void const volatile *)bp->regview + 1180692U); blk_cnt = readl((void const volatile *)bp->regview + 1180696U); port_is_idle_0 = readl((void const volatile *)bp->regview + 1180700U); port_is_idle_1 = readl((void const volatile *)bp->regview + 1180704U); pgl_exp_rom2 = readl((void const volatile *)bp->regview + 1181704U); if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { tags_63_32 = readl((void const volatile *)bp->regview + 37444U); } else { } if (((((sr_cnt == 126U && blk_cnt == 160U) && (int )port_is_idle_0 & 1) && (int )port_is_idle_1 & 1) && pgl_exp_rom2 == 4294967295U) && ((((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) || tags_63_32 == 4294967295U)) { goto ldv_64989; } else { } usleep_range(1000UL, 2000UL); tmp = cnt; cnt = cnt - 1; if (tmp > 0) { goto ldv_64990; } else { } ldv_64989: ; if (cnt <= 0) { printk("\vbnx2x: [%s:%d(%s)]Tetris buffer didn\'t get empty or there are still outstanding read requests after 1s!\n", "bnx2x_process_kill", 9701, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); printk("\vbnx2x: [%s:%d(%s)]sr_cnt=0x%08x, blk_cnt=0x%08x, port_is_idle_0=0x%08x, port_is_idle_1=0x%08x, pgl_exp_rom2=0x%08x\n", "bnx2x_process_kill", 9704, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", sr_cnt, blk_cnt, port_is_idle_0, port_is_idle_1, pgl_exp_rom2); return (-11); } else { } __asm__ volatile ("": : : "memory"); bnx2x_set_234_gates(bp, 1); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { tmp___0 = bnx2x_er_poll_igu_vq(bp); if (tmp___0 != 0) { return (-11); } else { } } else { } writel(0U, (void volatile *)bp->regview + 42020U); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); usleep_range(1000UL, 2000UL); if ((int )global) { bnx2x_reset_mcp_prep(bp, & val); } else { } bnx2x_pxp_prep(bp); __asm__ volatile ("": : : "memory"); bnx2x_process_kill_chip_reset(bp, (int )global); __asm__ volatile ("": : : "memory"); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(127U, (void volatile *)bp->regview + 37948U); } else { } if ((int )global) { tmp___1 = bnx2x_reset_mcp_comp(bp, val); if (tmp___1 != 0) { return (-11); } else { } } else { } bnx2x_set_234_gates(bp, 0); return (0); } } static int bnx2x_leader_reset(struct bnx2x *bp ) { int rc ; bool global ; bool tmp ; u32 load_code ; int tmp___0 ; { rc = 0; tmp = bnx2x_reset_is_global(bp); global = tmp; if (! global && (bp->flags & 512U) == 0U) { load_code = bnx2x_fw_command(bp, 268435456U, 4106U); if (load_code == 0U) { printk("\vbnx2x: [%s:%d(%s)]MCP response failure, aborting\n", "bnx2x_leader_reset", 9777, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -11; goto exit_leader_reset; } else { } if (load_code != 269680640U && load_code != 269484032U) { printk("\vbnx2x: [%s:%d(%s)]MCP unexpected resp, aborting\n", "bnx2x_leader_reset", 9783, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -11; goto exit_leader_reset2; } else { } load_code = bnx2x_fw_command(bp, 285212672U, 0U); if (load_code == 0U) { printk("\vbnx2x: [%s:%d(%s)]MCP response failure, aborting\n", "bnx2x_leader_reset", 9789, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -11; goto exit_leader_reset2; } else { } } else { } tmp___0 = bnx2x_process_kill(bp, (int )global); if (tmp___0 != 0) { printk("\vbnx2x: [%s:%d(%s)]Something bad had happen on engine %d! Aii!\n", "bnx2x_leader_reset", 9798, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); rc = -11; goto exit_leader_reset2; } else { } bnx2x_set_reset_done(bp); if ((int )global) { bnx2x_clear_reset_global(bp); } else { } exit_leader_reset2: ; if (! global && (bp->flags & 512U) == 0U) { bnx2x_fw_command(bp, 537001984U, 0U); bnx2x_fw_command(bp, 553648128U, 0U); } else { } exit_leader_reset: bp->is_leader = 0; bnx2x_release_leader_lock(bp); __asm__ volatile ("mfence": : : "memory"); return (rc); } } static void bnx2x_recovery_failed(struct bnx2x *bp ) { { netdev_err((struct net_device const *)bp->dev, "Recovery has failed. Power cycle is needed.\n"); netif_device_detach(bp->dev); bnx2x_set_reset_in_progress(bp); bnx2x_set_power_state(bp, 3); bp->recovery_state = 3; __asm__ volatile ("mfence": : : "memory"); return; } } static void bnx2x_parity_recover(struct bnx2x *bp ) { bool global ; u32 error_recovered ; u32 error_unrecovered ; bool is_parity ; long tmp ; long tmp___0 ; int __ret_warn_on ; long tmp___1 ; bool tmp___2 ; int tmp___3 ; long tmp___4 ; int other_engine ; bool other_load_status ; bool tmp___5 ; bool load_status ; bool tmp___6 ; int tmp___7 ; bool tmp___8 ; bool tmp___9 ; int tmp___10 ; bool tmp___11 ; int tmp___12 ; { global = 0; tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Handling parity\n", "bnx2x_parity_recover", 9856, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } ldv_65021: ; switch ((unsigned int )bp->recovery_state) { case 1U: tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]State is BNX2X_RECOVERY_INIT\n", "bnx2x_parity_recover", 9860, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } is_parity = bnx2x_chk_parity_attn(bp, & global, 0); __ret_warn_on = ! is_parity; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 9862); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___2 = bnx2x_trylock_leader_lock(bp); if ((int )tmp___2) { bnx2x_set_reset_in_progress(bp); if ((int )global) { bnx2x_set_reset_global(bp); } else { } bp->is_leader = 1; } else { } tmp___3 = bnx2x_nic_unload(bp, 2, 0); if (tmp___3 != 0) { return; } else { } bp->recovery_state = 2; __asm__ volatile ("mfence": : : "memory"); goto ldv_65015; case 2U: tmp___4 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]State is BNX2X_RECOVERY_WAIT\n", "bnx2x_parity_recover", 9894, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (bp->is_leader != 0) { other_engine = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 0 : 1; tmp___5 = bnx2x_get_load_status(bp, other_engine); other_load_status = tmp___5; tmp___6 = bnx2x_get_load_status(bp, bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); load_status = tmp___6; global = bnx2x_reset_is_global(bp); if ((int )load_status || ((int )global && (int )other_load_status)) { schedule_delayed_work(& bp->sp_rtnl_task, 25UL); return; } else { tmp___7 = bnx2x_leader_reset(bp); if (tmp___7 != 0) { bnx2x_recovery_failed(bp); return; } else { } goto ldv_65015; } } else { tmp___11 = bnx2x_reset_is_done(bp, bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); if (tmp___11) { tmp___12 = 0; } else { tmp___12 = 1; } if (tmp___12) { tmp___8 = bnx2x_trylock_leader_lock(bp); if ((int )tmp___8) { bp->is_leader = 1; goto ldv_65015; } else { } schedule_delayed_work(& bp->sp_rtnl_task, 25UL); return; } else { tmp___9 = bnx2x_reset_is_global(bp); if ((int )tmp___9) { schedule_delayed_work(& bp->sp_rtnl_task, 25UL); return; } else { } error_recovered = bp->eth_stats.recoverable_error; error_unrecovered = bp->eth_stats.unrecoverable_error; bp->recovery_state = 4; tmp___10 = bnx2x_nic_load(bp, 0); if (tmp___10 != 0) { error_unrecovered = error_unrecovered + 1U; netdev_err((struct net_device const *)bp->dev, "Recovery failed. Power cycle needed\n"); netif_device_detach(bp->dev); bnx2x_set_power_state(bp, 3); __asm__ volatile ("mfence": : : "memory"); } else { bp->recovery_state = 0; error_recovered = error_recovered + 1U; __asm__ volatile ("mfence": : : "memory"); } bp->eth_stats.recoverable_error = error_recovered; bp->eth_stats.unrecoverable_error = error_unrecovered; return; } } default: ; return; } ldv_65015: ; goto ldv_65021; } } static int bnx2x_close(struct net_device *dev ) ; static void bnx2x_sp_rtnl_task(struct work_struct *work ) { struct bnx2x *bp ; struct work_struct const *__mptr ; bool tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; long tmp___5 ; int tmp___6 ; long tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; long tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; { __mptr = (struct work_struct const *)work; bp = (struct bnx2x *)__mptr + 0xfffffffffffff8e8UL; rtnl_lock(); tmp = netif_running((struct net_device const *)bp->dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { rtnl_unlock(); return; } else { } tmp___1 = ldv__builtin_expect((unsigned int )bp->recovery_state != 0U, 0L); if (tmp___1 != 0L) { bp->sp_rtnl_state = 0UL; __asm__ volatile ("mfence": : : "memory"); bnx2x_parity_recover(bp); rtnl_unlock(); return; } else { } tmp___2 = test_and_clear_bit(1L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___2 != 0) { bp->sp_rtnl_state = 0UL; __asm__ volatile ("mfence": : : "memory"); bnx2x_nic_unload(bp, 0, 1); bnx2x_nic_load(bp, 0); rtnl_unlock(); return; } else { } tmp___3 = test_and_clear_bit(0L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___3 != 0) { bnx2x_setup_tc(bp->dev, (int )bp->dcbx_port_params.ets.num_of_cos); } else { } tmp___4 = test_and_clear_bit(3L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___4 != 0) { bnx2x_after_function_update(bp); } else { } tmp___6 = test_and_clear_bit(2L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___6 != 0) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]fan failure detected. Unloading driver\n", "bnx2x_sp_rtnl_task", 10073, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } netif_device_detach(bp->dev); bnx2x_close(bp->dev); rtnl_unlock(); return; } else { } tmp___8 = test_and_clear_bit(5L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___8 != 0) { tmp___7 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]sending set mcast vf pf channel message from rtnl sp-task\n", "bnx2x_sp_rtnl_task", 10082, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_vfpf_set_mcast(bp->dev); } else { } tmp___10 = test_and_clear_bit(6L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___10 != 0) { tmp___9 = constant_test_bit(2L, (unsigned long const volatile *)(& (bp->dev)->state)); if (tmp___9 == 0) { bnx2x_tx_disable(bp); printk("\vbnx2x: [%s:%d(%s)]PF indicated channel is not servicable anymore. This means this VF device is no longer operational\n", "bnx2x_sp_rtnl_task", 10089, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } tmp___12 = test_and_clear_bit(7L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___12 != 0) { tmp___11 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Handling Rx Mode setting\n", "bnx2x_sp_rtnl_task", 10094, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_set_rx_mode_inner(bp); } else { } tmp___13 = test_and_clear_bit(8L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___13 != 0) { bnx2x_pf_set_vfs_vlan(bp); } else { } tmp___14 = test_and_clear_bit(9L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___14 != 0) { bnx2x_dcbx_stop_hw_tx(bp); bnx2x_dcbx_resume_hw_tx(bp); } else { } tmp___15 = test_and_clear_bit(10L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___15 != 0) { bnx2x_update_mng_version(bp); } else { } rtnl_unlock(); if ((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0)) { tmp___16 = test_and_clear_bit(4L, (unsigned long volatile *)(& bp->sp_rtnl_state)); if (tmp___16 != 0) { bnx2x_disable_sriov(bp); bnx2x_enable_sriov(bp); } else { } } else { } return; } } static void bnx2x_period_task(struct work_struct *work ) { struct bnx2x *bp ; struct work_struct const *__mptr ; bool tmp ; int tmp___0 ; { __mptr = (struct work_struct const *)work; bp = (struct bnx2x *)__mptr + 0xfffffffffffff808UL; tmp = netif_running((struct net_device const *)bp->dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto period_task_exit; } else { } if ((bp->common.chip_id & 61440U) > 20480U) { printk("\vbnx2x: [%s:%d(%s)]period task called on emulation, ignoring\n", "bnx2x_period_task", 10132, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); goto period_task_exit; } else { } bnx2x_acquire_phy_lock(bp); __asm__ volatile ("mfence": : : "memory"); if (bp->port.pmf != 0U) { bnx2x_period_func(& bp->link_params, & bp->link_vars); queue_delayed_work(bnx2x_wq, & bp->period_task, 250UL); } else { } bnx2x_release_phy_lock(bp); period_task_exit: ; return; } } static u32 bnx2x_get_pretend_reg(struct bnx2x *bp ) { u32 base ; u32 stride ; { base = 1181300U; stride = 1181304U - base; return ((u32 )bp->pf_num * stride + base); } } static bool bnx2x_prev_unload_close_umac(struct bnx2x *bp , u8 port , u32 reset_reg , struct bnx2x_mac_vals *vals ) { u32 mask ; u32 base_addr ; long tmp ; { mask = (u32 )(1048576 << (int )port); if ((mask & reset_reg) == 0U) { return (0); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Disable umac Rx %02x\n", (int )port); } else { } base_addr = (unsigned int )port != 0U ? 1442816U : 1441792U; vals->umac_addr[(int )port] = base_addr + 8U; vals->umac_val[(int )port] = readl((void const volatile *)bp->regview + (unsigned long )vals->umac_addr[(int )port]); writel(0U, (void volatile *)bp->regview + (unsigned long )vals->umac_addr[(int )port]); return (1); } } static void bnx2x_prev_unload_close_mac(struct bnx2x *bp , struct bnx2x_mac_vals *vals ) { u32 val ; u32 base_addr ; u32 offset ; u32 mask ; u32 reset_reg ; bool mac_stopped ; u8 port ; u32 wb_data[2U] ; long tmp ; long tmp___0 ; long tmp___1 ; bool tmp___2 ; bool tmp___3 ; { mac_stopped = 0; port = (unsigned int )bp->pfid & 1U; memset((void *)vals, 0, 44UL); reset_reg = readl((void const volatile *)bp->regview + 42384U); if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { val = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 16442) * 4)); mask = (u32 )(1 << (int )port); if ((mask & reset_reg) != 0U && val != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Disable bmac Rx\n"); } else { } base_addr = (int )bp->pfid & 1 ? 69632U : 68608U; offset = 0U; wb_data[0] = readl((void const volatile *)bp->regview + (unsigned long )(base_addr + offset)); wb_data[1] = readl((void const volatile *)bp->regview + (unsigned long )((base_addr + offset) + 4U)); vals->bmac_addr = base_addr + offset; vals->bmac_val[0] = wb_data[0]; vals->bmac_val[1] = wb_data[1]; wb_data[0] = wb_data[0] & 4294967293U; writel(wb_data[0], (void volatile *)bp->regview + (unsigned long )vals->bmac_addr); writel(wb_data[1], (void volatile *)bp->regview + (unsigned long )(vals->bmac_addr + 4U)); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Disable emac Rx\n"); } else { } vals->emac_addr = (u32 )((((int )bp->pfid & 1) + 16399) * 4); vals->emac_val = readl((void const volatile *)bp->regview + (unsigned long )vals->emac_addr); writel(0U, (void volatile *)bp->regview + (unsigned long )vals->emac_addr); mac_stopped = 1; } else { if ((reset_reg & 4194304U) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Disable xmac Rx\n"); } else { } base_addr = (int )bp->pfid & 1 ? 1456128U : 1454080U; val = readl((void const volatile *)bp->regview + (unsigned long )(base_addr + 116U)); writel(val & 4294967293U, (void volatile *)bp->regview + (unsigned long )(base_addr + 116U)); writel(val | 2U, (void volatile *)bp->regview + (unsigned long )(base_addr + 116U)); vals->xmac_addr = base_addr; vals->xmac_val = readl((void const volatile *)bp->regview + (unsigned long )vals->xmac_addr); writel(0U, (void volatile *)bp->regview + (unsigned long )vals->xmac_addr); mac_stopped = 1; } else { } tmp___2 = bnx2x_prev_unload_close_umac(bp, 0, reset_reg, vals); mac_stopped = ((int )mac_stopped | (int )tmp___2) != 0; tmp___3 = bnx2x_prev_unload_close_umac(bp, 1, reset_reg, vals); mac_stopped = ((int )mac_stopped | (int )tmp___3) != 0; } if ((int )mac_stopped) { msleep(20U); } else { } return; } } static bool bnx2x_prev_is_after_undi(struct bnx2x *bp ) { unsigned int tmp ; long tmp___0 ; unsigned int tmp___1 ; { tmp = readl((void const volatile *)bp->regview + 42368U); if ((tmp & 524288U) == 0U) { return (0); } else { } tmp___1 = readl((void const volatile *)bp->regview + 1507372U); if (tmp___1 == 7U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "UNDI previously loaded\n"); } else { } return (1); } else { } return (0); } } static void bnx2x_prev_unload_undi_inc(struct bnx2x *bp , u8 inc ) { u16 rcq ; u16 bd ; u32 addr ; u32 tmp_reg ; long tmp ; { if ((unsigned int )bp->pfid <= 1U) { addr = (u32 )((((int )bp->pfid & 1) << 4) + 4396296); } else { addr = (u32 )((((int )bp->pfid + -2) << 4) + 4397128); } tmp_reg = readl((void const volatile *)bp->regview + (unsigned long )addr); rcq = (int )((u16 )tmp_reg) + (int )((u16 )inc); bd = (int )((u16 )(tmp_reg >> 16)) + (int )((u16 )inc); tmp_reg = (u32 )(((int )bd << 16) | (int )rcq); writel(tmp_reg, (void volatile *)bp->regview + (unsigned long )addr); tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "UNDI producer [%d/%d][%08x] rings bd -> 0x%04x, rcq -> 0x%04x\n", (int )bp->pfid & 1, (int )bp->pfid, addr, (int )bd, (int )rcq); } else { } return; } } static int bnx2x_prev_mcp_done(struct bnx2x *bp ) { u32 rc ; u32 tmp ; { tmp = bnx2x_fw_command(bp, 553648128U, 2U); rc = tmp; if (rc == 0U) { printk("\vbnx2x: [%s:%d(%s)]MCP response failure, aborting\n", "bnx2x_prev_mcp_done", 10307, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } return (0); } } static struct bnx2x_prev_path_list *bnx2x_prev_path_get_entry(struct bnx2x *bp ) { struct bnx2x_prev_path_list *tmp_list ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)bnx2x_prev_list.next; tmp_list = (struct bnx2x_prev_path_list *)__mptr; goto ldv_65089; ldv_65088: ; if (((((bp->pdev)->devfn >> 3) & 31U) == (unsigned int )tmp_list->slot && (int )((bp->pdev)->bus)->number == (int )tmp_list->bus) && (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) == (int )tmp_list->path) { return (tmp_list); } else { } __mptr___0 = (struct list_head const *)tmp_list->list.next; tmp_list = (struct bnx2x_prev_path_list *)__mptr___0; ldv_65089: ; if ((unsigned long )(& tmp_list->list) != (unsigned long )(& bnx2x_prev_list)) { goto ldv_65088; } else { } return ((struct bnx2x_prev_path_list *)0); } } static int bnx2x_prev_path_mark_eeh(struct bnx2x *bp ) { struct bnx2x_prev_path_list *tmp_list ; int rc ; { rc = down_interruptible(& bnx2x_prev_sem); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Received %d when tried to take lock\n", "bnx2x_prev_path_mark_eeh", 10335, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } tmp_list = bnx2x_prev_path_get_entry(bp); if ((unsigned long )tmp_list != (unsigned long )((struct bnx2x_prev_path_list *)0)) { tmp_list->aer = 1U; rc = 0; } else { printk("\vbnx2x: [%s:%d(%s)]path %d: Entry does not exist for eeh; Flow occurs before initial insmod is over ?\n", "bnx2x_prev_path_mark_eeh", 10345, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); } up(& bnx2x_prev_sem); return (rc); } } static bool bnx2x_prev_is_path_marked(struct bnx2x *bp ) { struct bnx2x_prev_path_list *tmp_list ; bool rc ; int tmp ; long tmp___0 ; long tmp___1 ; { rc = 0; tmp = down_trylock(& bnx2x_prev_sem); if (tmp != 0) { return (0); } else { } tmp_list = bnx2x_prev_path_get_entry(bp); if ((unsigned long )tmp_list != (unsigned long )((struct bnx2x_prev_path_list *)0)) { if ((unsigned int )tmp_list->aer != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Path %d was marked by AER\n", "bnx2x_prev_is_path_marked", 10365, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); } else { } } else { rc = 1; tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Path %d was already cleaned from previous drivers\n", bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); } else { } } } else { } up(& bnx2x_prev_sem); return (rc); } } bool bnx2x_port_after_undi(struct bnx2x *bp ) { struct bnx2x_prev_path_list *entry ; bool val ; { down(& bnx2x_prev_sem); entry = bnx2x_prev_path_get_entry(bp); val = (bool )((unsigned long )entry != (unsigned long )((struct bnx2x_prev_path_list *)0) && ((int )entry->undi >> ((int )bp->pfid & 1)) & 1); up(& bnx2x_prev_sem); return (val); } } static int bnx2x_prev_mark_path(struct bnx2x *bp , bool after_undi ) { struct bnx2x_prev_path_list *tmp_list ; int rc ; long tmp ; void *tmp___0 ; long tmp___1 ; { rc = down_interruptible(& bnx2x_prev_sem); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Received %d when tried to take lock\n", "bnx2x_prev_mark_path", 10400, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } tmp_list = bnx2x_prev_path_get_entry(bp); if ((unsigned long )tmp_list != (unsigned long )((struct bnx2x_prev_path_list *)0)) { if ((unsigned int )tmp_list->aer == 0U) { printk("\vbnx2x: [%s:%d(%s)]Re-Marking the path.\n", "bnx2x_prev_mark_path", 10408, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Removing AER indication from path %d\n", "bnx2x_prev_mark_path", 10411, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); } else { } tmp_list->aer = 0U; } up(& bnx2x_prev_sem); return (0); } else { } up(& bnx2x_prev_sem); tmp___0 = kmalloc(24UL, 208U); tmp_list = (struct bnx2x_prev_path_list *)tmp___0; if ((unsigned long )tmp_list == (unsigned long )((struct bnx2x_prev_path_list *)0)) { printk("\vbnx2x: [%s:%d(%s)]Failed to allocate \'bnx2x_prev_path_list\'\n", "bnx2x_prev_mark_path", 10422, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } else { } tmp_list->bus = ((bp->pdev)->bus)->number; tmp_list->slot = (unsigned int )((u8 )((bp->pdev)->devfn >> 3)) & 31U; tmp_list->path = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; tmp_list->aer = 0U; tmp_list->undi = (int )after_undi ? (u8 )(1 << ((int )bp->pfid & 1)) : 0U; rc = down_interruptible(& bnx2x_prev_sem); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Received %d when tried to take lock\n", "bnx2x_prev_mark_path", 10434, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); kfree((void const *)tmp_list); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Marked path [%d] - finished previous unload\n", "bnx2x_prev_mark_path", 10438, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); } else { } list_add(& tmp_list->list, & bnx2x_prev_list); up(& bnx2x_prev_sem); } return (rc); } } static int bnx2x_do_flr(struct bnx2x *bp ) { struct pci_dev *dev ; long tmp ; int tmp___0 ; long tmp___1 ; { dev = bp->pdev; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "FLR not supported in E1/E1H\n"); } else { } return (-22); } else { } if (bp->common.bc_ver <= 459282U) { printk("\vbnx2x: [%s:%d(%s)]FLR not supported by BC_VER: 0x%x\n", "bnx2x_do_flr", 10458, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->common.bc_ver); return (-22); } else { } tmp___0 = pci_wait_for_pending_transaction(dev); if (tmp___0 == 0) { dev_err((struct device const *)(& dev->dev), "transaction is not cleared; proceeding with reset anyway\n"); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Initiating FLR\n"); } else { } bnx2x_fw_command(bp, 33554432U, 0U); return (0); } } static int bnx2x_prev_unload_uncommon(struct bnx2x *bp ) { int rc ; long tmp ; int tmp___0 ; bool tmp___1 ; long tmp___2 ; bool tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Uncommon unload Flow\n"); } else { } tmp___1 = bnx2x_prev_is_path_marked(bp); if ((int )tmp___1) { tmp___0 = bnx2x_prev_mcp_done(bp); return (tmp___0); } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___2 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Path is unmarked\n"); } else { } tmp___3 = bnx2x_prev_is_after_undi(bp); if ((int )tmp___3) { goto out; } else { } rc = bnx2x_compare_fw_ver(bp, 269615104U, 0); if (rc == 0) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___4 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "FW version matches our own. Attempting FLR\n"); } else { } rc = bnx2x_do_flr(bp); } else { } if (rc == 0) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___5 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "FLR successful\n"); } else { } return (0); } else { } tmp___6 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___6 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Could not FLR\n"); } else { } out: rc = bnx2x_prev_mcp_done(bp); if (rc == 0) { rc = 1; } else { } return (rc); } } static int bnx2x_prev_unload_common(struct bnx2x *bp ) { u32 reset_reg ; u32 tmp_reg ; u32 rc ; bool prev_undi ; struct bnx2x_mac_vals mac_vals ; long tmp ; int tmp___0 ; bool tmp___1 ; u32 timer_count ; bool tmp___2 ; u32 prev_brb ; long tmp___3 ; int tmp___4 ; int tmp___5 ; { tmp_reg = 0U; prev_undi = 0; tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Common unload Flow\n"); } else { } memset((void *)(& mac_vals), 0, 44UL); tmp___1 = bnx2x_prev_is_path_marked(bp); if ((int )tmp___1) { tmp___0 = bnx2x_prev_mcp_done(bp); return (tmp___0); } else { } reset_reg = readl((void const volatile *)bp->regview + 42368U); if ((int )reset_reg & 1) { timer_count = 1000U; bnx2x_prev_unload_close_mac(bp, & mac_vals); bnx2x_set_rx_filter(& bp->link_params, 0); bp->link_params.port = (u8 )((unsigned int )bp->link_params.port ^ 1U); bnx2x_set_rx_filter(& bp->link_params, 0); bp->link_params.port = (u8 )((unsigned int )bp->link_params.port ^ 1U); tmp___2 = bnx2x_prev_is_after_undi(bp); if ((int )tmp___2) { prev_undi = 1; writel(0U, (void volatile *)bp->regview + 1507372U); readl((void const volatile *)bp->regview + 66484U); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { writel(0U, (void volatile *)bp->regview + 37932U); } else { } tmp_reg = readl((void const volatile *)bp->regview + 393360U); goto ldv_65137; ldv_65136: prev_brb = tmp_reg; tmp_reg = readl((void const volatile *)bp->regview + 393360U); if (tmp_reg == 0U) { goto ldv_65135; } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___3 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "BRB still has 0x%08x\n", tmp_reg); } else { } if (prev_brb > tmp_reg) { timer_count = 1000U; } else { timer_count = timer_count - 1U; } if ((int )prev_undi) { bnx2x_prev_unload_undi_inc(bp, 1); } else { } __const_udelay(42950UL); ldv_65137: ; if (timer_count != 0U) { goto ldv_65136; } else { } ldv_65135: ; if (timer_count == 0U) { printk("\vbnx2x: [%s:%d(%s)]Failed to empty BRB, hope for the best\n", "bnx2x_prev_unload_common", 10585, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } bnx2x_reset_common(bp); if (mac_vals.xmac_addr != 0U) { writel(mac_vals.xmac_val, (void volatile *)bp->regview + (unsigned long )mac_vals.xmac_addr); } else { } if (mac_vals.umac_addr[0] != 0U) { writel(mac_vals.umac_val[0], (void volatile *)bp->regview + (unsigned long )mac_vals.umac_addr[0]); } else { } if (mac_vals.umac_addr[1] != 0U) { writel(mac_vals.umac_val[1], (void volatile *)bp->regview + (unsigned long )mac_vals.umac_addr[1]); } else { } if (mac_vals.emac_addr != 0U) { writel(mac_vals.emac_val, (void volatile *)bp->regview + (unsigned long )mac_vals.emac_addr); } else { } if (mac_vals.bmac_addr != 0U) { writel(mac_vals.bmac_val[0], (void volatile *)bp->regview + (unsigned long )mac_vals.bmac_addr); writel(mac_vals.bmac_val[1], (void volatile *)bp->regview + (unsigned long )(mac_vals.bmac_addr + 4U)); } else { } tmp___4 = bnx2x_prev_mark_path(bp, (int )prev_undi); rc = (u32 )tmp___4; if (rc != 0U) { bnx2x_prev_mcp_done(bp); return ((int )rc); } else { } tmp___5 = bnx2x_prev_mcp_done(bp); return (tmp___5); } } static int bnx2x_prev_unload(struct bnx2x *bp ) { int time_counter ; u32 rc ; u32 fw ; u32 hw_lock_reg ; u32 hw_lock_val ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; unsigned int tmp___4 ; int aer ; int tmp___5 ; struct bnx2x_prev_path_list *tmp___6 ; struct bnx2x_prev_path_list *tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; long tmp___11 ; bool tmp___12 ; long tmp___13 ; { time_counter = 10; tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Entering Previous Unload Flow\n"); } else { } bnx2x_clean_pglue_errors(bp); hw_lock_reg = (u32 )((unsigned int )bp->pfid <= 5U ? ((int )bp->pfid + 5282) * 8 : ((int )bp->pfid + 5235) * 8); hw_lock_val = readl((void const volatile *)bp->regview + (unsigned long )hw_lock_reg); if (hw_lock_val != 0U) { if ((hw_lock_val & 12U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Release Previously held NVRAM lock\n"); } else { } writel((unsigned int )(32L << ((int )bp->pfid & 1)), (void volatile *)bp->regview + 549920U); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Release Previously held hw lock\n"); } else { } writel(4294967295U, (void volatile *)bp->regview + (unsigned long )hw_lock_reg); } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___2 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "No need to release hw/nvram locks\n"); } else { } } tmp___4 = readl((void const volatile *)bp->regview + 524444U); if ((int )tmp___4 < 0) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___3 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Release previously held alr\n"); } else { } bnx2x_release_alr(bp); } else { } ldv_65150: aer = 0; fw = bnx2x_fw_command(bp, 536936448U, 0U); if (fw == 0U) { printk("\vbnx2x: [%s:%d(%s)]MCP response failure, aborting\n", "bnx2x_prev_unload", 10652, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = 4294967280U; goto ldv_65149; } else { } tmp___5 = down_interruptible(& bnx2x_prev_sem); rc = (u32 )tmp___5; if (rc != 0U) { printk("\vbnx2x: [%s:%d(%s)]Cannot check for AER; Received %d when tried to take lock\n", "bnx2x_prev_unload", 10660, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { tmp___6 = bnx2x_prev_path_get_entry(bp); if ((unsigned long )tmp___6 != (unsigned long )((struct bnx2x_prev_path_list *)0)) { tmp___7 = bnx2x_prev_path_get_entry(bp); if ((unsigned int )tmp___7->aer != 0U) { tmp___8 = 1; } else { tmp___8 = 0; } } else { tmp___8 = 0; } aer = tmp___8; up(& bnx2x_prev_sem); } if (fw == 537919488U || aer != 0) { tmp___9 = bnx2x_prev_unload_common(bp); rc = (u32 )tmp___9; goto ldv_65149; } else { } tmp___10 = bnx2x_prev_unload_uncommon(bp); rc = (u32 )tmp___10; if (rc != 1U) { goto ldv_65149; } else { } msleep(20U); time_counter = time_counter - 1; if (time_counter != 0) { goto ldv_65150; } else { } ldv_65149: ; if (time_counter == 0 || rc != 0U) { tmp___11 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___11 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Unloading previous driver did not occur, Possibly due to MF UNDI\n"); } else { } rc = 4294966779U; } else { } tmp___12 = bnx2x_port_after_undi(bp); if ((int )tmp___12) { bp->link_params.feature_config_flags = bp->link_params.feature_config_flags | 16384U; } else { } tmp___13 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___13 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Finished Previous Unload Flow [%d]\n", rc); } else { } return ((int )rc); } } static void bnx2x_get_common_hwinfo(struct bnx2x *bp ) { u32 val ; u32 val2 ; u32 val3 ; u32 val4 ; u32 id ; u32 boot_mode ; u16 pmc ; unsigned int tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; unsigned int tmp___3 ; long tmp___4 ; long tmp___5 ; unsigned int tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; unsigned int tmp___10 ; long tmp___11 ; unsigned int tmp___12 ; long tmp___13 ; { val = readl((void const volatile *)bp->regview + 41992U); id = val << 16; val = readl((void const volatile *)bp->regview + 41996U); id = ((val << 12) & 65535U) | id; val = readl((void const volatile *)bp->regview + 9276U); id = (((val >> 24) << 4) & 255U) | id; val = readl((void const volatile *)bp->regview + 41984U); id = (val & 15U) | id; bp->common.chip_id = id; tmp = readl((void const volatile *)bp->regview + 44128U); if ((tmp & 2U) != 0U) { if (bp->common.chip_id >> 16 == 5774U) { bp->common.chip_id = (bp->common.chip_id & 65535U) | 373096448U; } else if (bp->common.chip_id >> 16 == 5806U) { bp->common.chip_id = (bp->common.chip_id & 65535U) | 373161984U; } else { } bp->common.chip_id = bp->common.chip_id | 1U; } else { } bp->db_size = 8U; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { val = readl((void const volatile *)bp->regview + 42784U); if ((val & 1U) == 0U) { val = readl((void const volatile *)bp->regview + 42832U); } else { val = (val >> 1) & 1U; } tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "chip is in %s\n", val != 0U ? (char *)"4_PORT_MODE" : (char *)"2_PORT_MODE"); } else { } bp->common.chip_port_mode = val == 0U; if ((unsigned int )bp->common.chip_port_mode == 0U) { bp->pfid = (u8 )((int )bp->pf_num >> 1); } else { bp->pfid = (unsigned int )bp->pf_num & 6U; } } else { bp->common.chip_port_mode = 2U; bp->pfid = bp->pf_num; } tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "pf_id: %x", (int )bp->pfid); } else { } bp->link_params.chip_id = bp->common.chip_id; tmp___2 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___2 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "chip ID is 0x%x\n", id); } else { } tmp___3 = readl((void const volatile *)bp->regview + 10356U); val = tmp___3 & 85U; if (((int )bp->common.chip_id & 1 || (bp->common.chip_id >> 16 == 5710U && val != 0U)) || ((bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) && val == 85U)) { bp->flags = bp->flags | 4U; tmp___4 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___4 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "single port device\n"); } else { } } else { } val = readl((void const volatile *)bp->regview + 549932U); bp->common.flash_size = 131072 << ((int )val & 7); tmp___5 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___5 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "flash_size 0x%x (%d)\n", bp->common.flash_size, bp->common.flash_size); } else { } bnx2x_init_shmem(bp); bp->common.shmem2_base = readl((void const volatile *)(bp->regview + ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 42084UL : 42080UL))); bp->link_params.shmem_base = bp->common.shmem_base; bp->link_params.shmem2_base = bp->common.shmem2_base; tmp___6 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___6 > (unsigned int )(((unsigned long )bp->pfid & 1UL) + 79UL) * 4U) { bp->link_params.lfa_base = readl((void const volatile *)bp->regview + (unsigned long )(bp->common.shmem2_base + (unsigned int )(((unsigned long )bp->pfid & 1UL) + 79UL) * 4U)); } else { bp->link_params.lfa_base = 0U; } tmp___7 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___7 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "shmem offset 0x%x shmem2 offset 0x%x\n", bp->common.shmem_base, bp->common.shmem2_base); } else { } if (bp->common.shmem_base == 0U) { tmp___8 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___8 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "MCP not active\n"); } else { } bp->flags = bp->flags | 512U; return; } else { } bp->common.hw_config = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 28UL))); tmp___9 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___9 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "hw_config 0x%08x\n", bp->common.hw_config); } else { } bp->link_params.hw_led_mode = (u16 )((bp->common.hw_config & 983040U) >> 16); bp->link_params.feature_config_flags = 0U; val = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 852UL))); if ((val & 2U) != 0U) { bp->link_params.feature_config_flags = bp->link_params.feature_config_flags | 1U; } else { bp->link_params.feature_config_flags = bp->link_params.feature_config_flags & 4294967294U; } tmp___10 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 8UL))); val = tmp___10 >> 8; bp->common.bc_ver = val; tmp___11 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___11 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "bc_ver %X\n", val); } else { } if (val <= 262655U) { printk("\vbnx2x: [%s:%d(%s)]This driver needs bc_ver %X but found %X, please upgrade BC\n", "bnx2x_get_common_hwinfo", 10817, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", 262656, val); } else { } bp->link_params.feature_config_flags = bp->link_params.feature_config_flags | (val > 327685U ? 4U : 0U); bp->link_params.feature_config_flags = bp->link_params.feature_config_flags | (val > 328243U ? 8U : 0U); bp->link_params.feature_config_flags = bp->link_params.feature_config_flags | (val > 458753U ? 256U : 0U); bp->link_params.feature_config_flags = bp->link_params.feature_config_flags | (val > 458771U ? 1024U : 0U); bp->link_params.feature_config_flags = bp->link_params.feature_config_flags | (val > 459264U ? 8192U : 0U); bp->flags = bp->flags | (val > 459264U ? 131072U : 0U); bp->flags = bp->flags | (val > 459272U ? 524288U : 0U); bp->flags = bp->flags | (val > 459776U ? 2097152U : 0U); bp->flags = bp->flags | (val > 460814U ? 8388608U : 0U); tmp___12 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + ((unsigned long )bp->pfid & 1UL) * 116UL) + 864UL))); boot_mode = tmp___12 & 7U; switch (boot_mode) { case 0U: bp->common.boot_mode = 4U; goto ldv_65163; case 3U: bp->common.boot_mode = 8U; goto ldv_65163; case 4U: bp->common.boot_mode = 12U; goto ldv_65163; case 7U: bp->common.boot_mode = 0U; goto ldv_65163; } ldv_65163: pci_read_config_word((struct pci_dev const *)bp->pdev, (int )(bp->pdev)->pm_cap + 2, & pmc); bp->flags = bp->flags | ((int )((short )pmc) < 0 ? 0U : 8U); tmp___13 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___13 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "%sWoL capable\n", (bp->flags & 8U) != 0U ? (char *)"not " : (char *)""); } else { } val = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 12UL))); val2 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 16UL))); val3 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 20UL))); val4 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 24UL))); _dev_info((struct device const *)(& (bp->pdev)->dev), "part number %X-%X-%X-%X\n", val, val2, val3, val4); return; } } static int bnx2x_get_igu_cam_info(struct bnx2x *bp ) { int pfid ; int igu_sb_id ; u32 val ; u8 fid ; u8 igu_sb_cnt ; int vn ; int __min1 ; int __min2 ; { pfid = (int )bp->pfid; igu_sb_cnt = 0U; bp->igu_base_sb = 255U; if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0) { vn = (int )bp->pfid >> 1; igu_sb_cnt = bp->igu_sb_cnt; bp->igu_base_sb = (unsigned int )bp->common.chip_port_mode == 0U ? (unsigned int )((u8 )pfid) * 16U : (unsigned int )((u8 )vn) * 16U; bp->igu_dsb_id = (unsigned int )bp->common.chip_port_mode == 0U ? (unsigned int )((u8 )pfid) + 64U : (unsigned int )((u8 )vn) + 64U; return (0); } else { } igu_sb_id = 0; goto ldv_65178; ldv_65177: val = readl((void const volatile *)bp->regview + (unsigned long )((igu_sb_id + 312320) * 4)); if ((val & 1U) == 0U) { goto ldv_65176; } else { } fid = (u8 )((val & 16256U) >> 7); if (((int )fid & 64) != 0) { if (((int )fid & 7) != pfid) { goto ldv_65176; } else { } if ((val & 126U) >> 1 == 0U) { bp->igu_dsb_id = (u8 )igu_sb_id; } else { if ((unsigned int )bp->igu_base_sb == 255U) { bp->igu_base_sb = (u8 )igu_sb_id; } else { } igu_sb_cnt = (u8 )((int )igu_sb_cnt + 1); } } else { } ldv_65176: igu_sb_id = igu_sb_id + 1; ldv_65178: ; if (igu_sb_id <= 135) { goto ldv_65177; } else { } __min1 = (int )bp->igu_sb_cnt; __min2 = (int )igu_sb_cnt; bp->igu_sb_cnt = (u8 )(__min1 < __min2 ? __min1 : __min2); if ((unsigned int )igu_sb_cnt == 0U) { printk("\vbnx2x: [%s:%d(%s)]CAM configuration error\n", "bnx2x_get_igu_cam_info", 10937, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } return (0); } } static void bnx2x_link_settings_supported(struct bnx2x *bp , u32 switch_cfg ) { int cfg_size ; int idx ; int port ; unsigned int tmp ; unsigned int tmp___0 ; long tmp___1 ; long tmp___2 ; { cfg_size = 0; port = (int )bp->pfid & 1; bp->port.supported[0] = 0U; bp->port.supported[1] = 0U; switch ((int )bp->link_params.num_phys) { case 1: bp->port.supported[0] = bp->link_params.phy[0].supported; cfg_size = 1; goto ldv_65192; case 2: bp->port.supported[0] = bp->link_params.phy[1].supported; cfg_size = 1; goto ldv_65192; case 3: ; if ((bp->link_params.multi_phy_config & 8U) != 0U) { bp->port.supported[1] = bp->link_params.phy[1].supported; bp->port.supported[0] = bp->link_params.phy[2].supported; } else { bp->port.supported[0] = bp->link_params.phy[1].supported; bp->port.supported[1] = bp->link_params.phy[2].supported; } cfg_size = 2; goto ldv_65192; } ldv_65192: ; if (bp->port.supported[0] == 0U && bp->port.supported[1] == 0U) { tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 412UL))); tmp___0 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 436UL))); printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. BAD phy config. PHY1 config 0x%x, PHY2 config 0x%x\n", "bnx2x_link_settings_supported", 10982, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tmp___0, tmp); return; } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bp->port.phy_addr = readl((void const volatile *)bp->regview + 43468U); } else { switch (switch_cfg) { case 0U: bp->port.phy_addr = readl((void const volatile *)bp->regview + (unsigned long )(port * 16 + 66420)); goto ldv_65197; case 16777216U: bp->port.phy_addr = readl((void const volatile *)bp->regview + (unsigned long )(port * 24 + 66368)); goto ldv_65197; default: printk("\vbnx2x: [%s:%d(%s)]BAD switch_cfg link_config 0x%x\n", "bnx2x_link_settings_supported", 11000, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->port.link_config[0]); return; } ldv_65197: ; } tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "phy_addr 0x%x\n", bp->port.phy_addr); } else { } idx = 0; goto ldv_65201; ldv_65200: ; if ((bp->link_params.speed_cap_mask[idx] & 131072U) == 0U) { bp->port.supported[idx] = bp->port.supported[idx] & 4294967294U; } else { } if ((bp->link_params.speed_cap_mask[idx] & 65536U) == 0U) { bp->port.supported[idx] = bp->port.supported[idx] & 4294967293U; } else { } if ((bp->link_params.speed_cap_mask[idx] & 262144U) == 0U) { bp->port.supported[idx] = bp->port.supported[idx] & 4294967291U; } else { } if ((bp->link_params.speed_cap_mask[idx] & 524288U) == 0U) { bp->port.supported[idx] = bp->port.supported[idx] & 4294967287U; } else { } if ((bp->link_params.speed_cap_mask[idx] & 1048576U) == 0U) { bp->port.supported[idx] = bp->port.supported[idx] & 4294967247U; } else { } if ((bp->link_params.speed_cap_mask[idx] & 2097152U) == 0U) { bp->port.supported[idx] = bp->port.supported[idx] & 4294934527U; } else { } if ((bp->link_params.speed_cap_mask[idx] & 4194304U) == 0U) { bp->port.supported[idx] = bp->port.supported[idx] & 4294963199U; } else { } if ((bp->link_params.speed_cap_mask[idx] & 8388608U) == 0U) { bp->port.supported[idx] = bp->port.supported[idx] & 4290772991U; } else { } idx = idx + 1; ldv_65201: ; if (idx < cfg_size) { goto ldv_65200; } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___2 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "supported 0x%x 0x%x\n", bp->port.supported[0], bp->port.supported[1]); } else { } return; } } static void bnx2x_link_settings_requested(struct bnx2x *bp ) { u32 link_config ; u32 idx ; u32 cfg_size ; long tmp ; { cfg_size = 0U; bp->port.advertising[0] = 0U; bp->port.advertising[1] = 0U; switch ((int )bp->link_params.num_phys) { case 1: ; case 2: cfg_size = 1U; goto ldv_65211; case 3: cfg_size = 2U; goto ldv_65211; } ldv_65211: idx = 0U; goto ldv_65227; ldv_65226: bp->link_params.req_duplex[idx] = 1U; link_config = bp->port.link_config[idx]; switch (link_config & 983040U) { case 0U: ; if ((bp->port.supported[idx] & 64U) != 0U) { bp->link_params.req_line_speed[idx] = 0U; bp->port.advertising[idx] = bp->port.advertising[idx] | bp->port.supported[idx]; if (bp->link_params.phy[1].type == 3328U) { bp->port.advertising[idx] = bp->port.advertising[idx] | 12U; } else { } } else { bp->link_params.req_line_speed[idx] = 10000U; bp->port.advertising[idx] = bp->port.advertising[idx] | 5120U; goto ldv_65214; } goto ldv_65215; case 65536U: ; if ((bp->port.supported[idx] & 2U) != 0U) { bp->link_params.req_line_speed[idx] = 10U; bp->port.advertising[idx] = bp->port.advertising[idx] | 130U; } else { printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", "bnx2x_link_settings_requested", 11095, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", link_config, bp->link_params.speed_cap_mask[idx]); return; } goto ldv_65215; case 131072U: ; if ((int )bp->port.supported[idx] & 1) { bp->link_params.req_line_speed[idx] = 10U; bp->link_params.req_duplex[idx] = 0U; bp->port.advertising[idx] = bp->port.advertising[idx] | 129U; } else { printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", "bnx2x_link_settings_requested", 11112, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", link_config, bp->link_params.speed_cap_mask[idx]); return; } goto ldv_65215; case 262144U: ; if ((bp->port.supported[idx] & 8U) != 0U) { bp->link_params.req_line_speed[idx] = 100U; bp->port.advertising[idx] = bp->port.advertising[idx] | 136U; } else { printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", "bnx2x_link_settings_requested", 11128, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", link_config, bp->link_params.speed_cap_mask[idx]); return; } goto ldv_65215; case 196608U: ; if ((bp->port.supported[idx] & 4U) != 0U) { bp->link_params.req_line_speed[idx] = 100U; bp->link_params.req_duplex[idx] = 0U; bp->port.advertising[idx] = bp->port.advertising[idx] | 132U; } else { printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", "bnx2x_link_settings_requested", 11146, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", link_config, bp->link_params.speed_cap_mask[idx]); return; } goto ldv_65215; case 327680U: ; if ((bp->port.supported[idx] & 32U) != 0U) { bp->link_params.req_line_speed[idx] = 1000U; bp->port.advertising[idx] = bp->port.advertising[idx] | 160U; } else if ((bp->port.supported[idx] & 131072U) != 0U) { bp->link_params.req_line_speed[idx] = 1000U; bp->port.advertising[idx] = bp->port.advertising[idx] | 131072U; } else { printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", "bnx2x_link_settings_requested", 11168, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", link_config, bp->link_params.speed_cap_mask[idx]); return; } goto ldv_65215; case 393216U: ; if ((bp->port.supported[idx] & 32768U) != 0U) { bp->link_params.req_line_speed[idx] = 2500U; bp->port.advertising[idx] = bp->port.advertising[idx] | 32896U; } else { printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", "bnx2x_link_settings_requested", 11184, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", link_config, bp->link_params.speed_cap_mask[idx]); return; } goto ldv_65215; case 458752U: ; if ((bp->port.supported[idx] & 4096U) != 0U) { bp->link_params.req_line_speed[idx] = 10000U; bp->port.advertising[idx] = bp->port.advertising[idx] | 5120U; } else if ((bp->port.supported[idx] & 524288U) != 0U) { bp->link_params.req_line_speed[idx] = 10000U; bp->port.advertising[idx] = bp->port.advertising[idx] | 525312U; } else { printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", "bnx2x_link_settings_requested", 11207, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", link_config, bp->link_params.speed_cap_mask[idx]); return; } goto ldv_65215; case 524288U: bp->link_params.req_line_speed[idx] = 20000U; goto ldv_65215; default: printk("\vbnx2x: [%s:%d(%s)]NVRAM config error. BAD link speed link_config 0x%x\n", "bnx2x_link_settings_requested", 11217, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", link_config); bp->link_params.req_line_speed[idx] = 0U; bp->port.advertising[idx] = bp->port.supported[idx]; goto ldv_65215; } ldv_65215: bp->link_params.req_flow_ctrl[idx] = (unsigned int )((u16 )link_config) & 1792U; if ((unsigned int )bp->link_params.req_flow_ctrl[idx] == 0U) { if ((bp->port.supported[idx] & 64U) == 0U) { bp->link_params.req_flow_ctrl[idx] = 1024U; } else { bnx2x_set_requested_fc(bp); } } else { } tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "req_line_speed %d req_duplex %d req_flow_ctrl 0x%x advertising 0x%x\n", (int )bp->link_params.req_line_speed[idx], (int )bp->link_params.req_duplex[idx], (int )bp->link_params.req_flow_ctrl[idx], bp->port.advertising[idx]); } else { } ldv_65214: idx = idx + 1U; ldv_65227: ; if (idx < cfg_size) { goto ldv_65226; } else { } return; } } static void bnx2x_set_mac_buf(u8 *mac_buf , u32 mac_lo , u16 mac_hi ) { __be16 mac_hi_be ; __u16 tmp ; __be32 mac_lo_be ; __u32 tmp___0 ; { tmp = __fswab16((int )mac_hi); mac_hi_be = tmp; tmp___0 = __fswab32(mac_lo); mac_lo_be = tmp___0; memcpy((void *)mac_buf, (void const *)(& mac_hi_be), 2UL); memcpy((void *)mac_buf + 2U, (void const *)(& mac_lo_be), 4UL); return; } } static void bnx2x_get_port_hwinfo(struct bnx2x *bp ) { int port ; u32 config ; u32 ext_phy_type ; u32 ext_phy_config ; u32 eee_mode ; unsigned int tmp ; unsigned int tmp___0 ; long tmp___1 ; unsigned int tmp___2 ; { port = (int )bp->pfid & 1; bp->link_params.bp = bp; bp->link_params.port = (u8 )port; bp->link_params.lane_config = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 432UL))); tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 440UL))); bp->link_params.speed_cap_mask[0] = tmp & 4294901760U; tmp___0 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 404UL))); bp->link_params.speed_cap_mask[1] = tmp___0 & 4294901760U; bp->port.link_config[0] = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 116UL) + 888UL))); bp->port.link_config[1] = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 116UL) + 896UL))); bp->link_params.multi_phy_config = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 408UL))); config = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 116UL) + 856UL))); bp->wol = (u8 )((bp->flags & 8U) == 0U && (config & 16777216U) != 0U); if ((config & 3072U) == 1024U && (unsigned int )bp->mf_mode == 0U) { bp->flags = bp->flags | 16384U; } else { } if ((config & 3072U) == 2048U && (unsigned int )bp->mf_mode == 0U) { bp->flags = bp->flags | 32768U; } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "lane_config 0x%08x speed_cap_mask0 0x%08x link_config0 0x%08x\n", bp->link_params.lane_config, bp->link_params.speed_cap_mask[0], bp->port.link_config[0]); } else { } bp->link_params.switch_cfg = bp->port.link_config[0] & 50331648U; bnx2x_phy_probe(& bp->link_params); bnx2x_link_settings_supported(bp, bp->link_params.switch_cfg); bnx2x_link_settings_requested(bp); ext_phy_config = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 436UL))); ext_phy_type = ext_phy_config & 65280U; if (ext_phy_type == 0U) { bp->mdio.prtad = (int )bp->port.phy_addr; } else if (ext_phy_type != 64768U && ext_phy_type != 65280U) { bp->mdio.prtad = (int )ext_phy_config & 255; } else { } tmp___2 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 116UL) + 904UL))); eee_mode = tmp___2 & 255U; if (eee_mode != 0U) { bp->link_params.eee_mode = 3489660928U; } else { bp->link_params.eee_mode = 0U; } return; } } void bnx2x_get_iscsi_info(struct bnx2x *bp ) { u32 no_flags ; int port ; u32 max_iscsi_conn ; unsigned int tmp ; long tmp___0 ; { no_flags = 16384U; port = (int )bp->pfid & 1; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 52UL) + 1112UL))); max_iscsi_conn = tmp ^ 505290270U; if ((unsigned int )bp->cnic_support == 0U) { bp->flags = bp->flags | no_flags; return; } else { } bp->cnic_eth_dev.max_iscsi_conn = max_iscsi_conn >> 16; tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "max_iscsi_conn 0x%x\n", bp->cnic_eth_dev.max_iscsi_conn); } else { } if (bp->cnic_eth_dev.max_iscsi_conn == 0U) { bp->flags = bp->flags | no_flags; } else { } return; } } static void bnx2x_get_ext_wwn_info(struct bnx2x *bp , int func ) { { bp->cnic_eth_dev.fcoe_wwn_port_name_hi = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 248UL))); bp->cnic_eth_dev.fcoe_wwn_port_name_lo = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 252UL))); bp->cnic_eth_dev.fcoe_wwn_node_name_hi = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 256UL))); bp->cnic_eth_dev.fcoe_wwn_node_name_lo = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 260UL))); return; } } static int bnx2x_shared_fcoe_funcs(struct bnx2x *bp ) { u8 count ; u8 fid ; u32 cfg ; unsigned int tmp ; u32 cfg___0 ; unsigned int tmp___0 ; int port ; int port_cnt ; u32 lic ; unsigned int tmp___1 ; { count = 0U; if ((unsigned int )bp->mf_mode != 0U) { fid = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; goto ldv_65262; ldv_65261: ; if ((unsigned int )bp->mf_mode == 1U) { tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )fid * 24UL) + 36UL))); cfg = tmp; if ((cfg & 1U) == 0U && (cfg & 6U) == 0U) { count = (u8 )((int )count + 1); } else { } } else { tmp___0 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )fid * 40UL) + 228UL))); cfg___0 = tmp___0; if ((int )cfg___0 & 1 && (cfg___0 & 8U) != 0U) { count = (u8 )((int )count + 1); } else { } } fid = (unsigned int )fid + 2U; ldv_65262: ; if ((unsigned int )fid <= 7U) { goto ldv_65261; } else { } } else { port_cnt = (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1; port = 0; goto ldv_65268; ldv_65267: tmp___1 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 52UL) + 1120UL))); lic = tmp___1 ^ 505290270U; if (lic != 0U) { count = (u8 )((int )count + 1); } else { } port = port + 1; ldv_65268: ; if (port < port_cnt) { goto ldv_65267; } else { } } return ((int )count); } } static void bnx2x_get_fcoe_info(struct bnx2x *bp ) { int port ; int func ; u32 max_fcoe_conn ; unsigned int tmp ; u8 num_fcoe_func ; int tmp___0 ; long tmp___1 ; { port = (int )bp->pfid & 1; func = (int )bp->pf_num; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 52UL) + 1120UL))); max_fcoe_conn = tmp ^ 505290270U; tmp___0 = bnx2x_shared_fcoe_funcs(bp); num_fcoe_func = (u8 )tmp___0; if ((unsigned int )bp->cnic_support == 0U) { bp->flags = bp->flags | 32768U; return; } else { } bp->cnic_eth_dev.max_fcoe_conn = max_fcoe_conn >> 16; bp->cnic_eth_dev.max_fcoe_exchanges = 4096U; if ((unsigned int )num_fcoe_func != 0U) { bp->cnic_eth_dev.max_fcoe_exchanges = bp->cnic_eth_dev.max_fcoe_exchanges / (u32 )num_fcoe_func; } else { } if ((unsigned int )bp->mf_mode == 0U) { bp->cnic_eth_dev.fcoe_wwn_port_name_hi = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 184UL))); bp->cnic_eth_dev.fcoe_wwn_port_name_lo = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 188UL))); bp->cnic_eth_dev.fcoe_wwn_node_name_hi = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 192UL))); bp->cnic_eth_dev.fcoe_wwn_node_name_lo = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 196UL))); } else if ((unsigned int )bp->mf_mode != 1U) { if ((bp->mf_ext_config & 8U) != 0U) { bnx2x_get_ext_wwn_info(bp, func); } else { } } else if ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U && (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U))) { bnx2x_get_ext_wwn_info(bp, func); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn); } else { } if (bp->cnic_eth_dev.max_fcoe_conn == 0U) { bp->flags = bp->flags | 32768U; } else { } return; } } static void bnx2x_get_cnic_info(struct bnx2x *bp ) { { bnx2x_get_iscsi_info(bp); bnx2x_get_fcoe_info(bp); return; } } static void bnx2x_get_cnic_mac_hwinfo(struct bnx2x *bp ) { u32 val ; u32 val2 ; int func ; int port ; u8 *iscsi_mac ; u8 *fip_mac ; u32 cfg ; unsigned int tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; bool tmp___6 ; int tmp___7 ; bool tmp___8 ; int tmp___9 ; { func = (int )bp->pf_num; port = (int )bp->pfid & 1; iscsi_mac = (u8 *)(& bp->cnic_eth_dev.iscsi_mac); fip_mac = (u8 *)(& bp->fip_mac); if ((unsigned int )bp->mf_mode != 0U) { if ((unsigned int )bp->mf_mode != 1U) { tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 228UL))); cfg = tmp; if ((cfg & 4U) != 0U) { val2 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 232UL))); val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 236UL))); bnx2x_set_mac_buf(iscsi_mac, val, (int )((u16 )val2)); tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Read iSCSI MAC: %pM\n", iscsi_mac); } else { } } else { bp->flags = bp->flags | 24576U; } if ((cfg & 8U) != 0U) { val2 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 240UL))); val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 40UL) + 244UL))); bnx2x_set_mac_buf(fip_mac, val, (int )((u16 )val2)); tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Read FCoE L2 MAC: %pM\n", fip_mac); } else { } } else { bp->flags = bp->flags | 32768U; } bp->mf_ext_config = cfg; } else if ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U) { memcpy((void *)iscsi_mac, (void const *)(bp->dev)->dev_addr, 6UL); tmp___2 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___2 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "SD ISCSI MODE\n"); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___3 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Read iSCSI MAC: %pM\n", iscsi_mac); } else { } } else if ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U) { memcpy((void *)fip_mac, (void const *)(bp->dev)->dev_addr, 6UL); tmp___4 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___4 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "SD FCoE MODE\n"); } else { } tmp___5 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___5 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Read FIP MAC: %pM\n", fip_mac); } else { } } else { } if ((unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U) { memcpy((void *)(bp->dev)->dev_addr, (void const *)fip_mac, 6UL); } else { } } else { val2 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 76UL))); val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 80UL))); bnx2x_set_mac_buf(iscsi_mac, val, (int )((u16 )val2)); val2 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 176UL))); val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 180UL))); bnx2x_set_mac_buf(fip_mac, val, (int )((u16 )val2)); } tmp___6 = is_valid_ether_addr((u8 const *)iscsi_mac); if (tmp___6) { tmp___7 = 0; } else { tmp___7 = 1; } if (tmp___7) { bp->flags = bp->flags | 24576U; eth_zero_addr(iscsi_mac); } else { } tmp___8 = is_valid_ether_addr((u8 const *)fip_mac); if (tmp___8) { tmp___9 = 0; } else { tmp___9 = 1; } if (tmp___9) { bp->flags = bp->flags | 32768U; eth_zero_addr((u8 *)(& bp->fip_mac)); } else { } return; } } static void bnx2x_get_mac_hwinfo(struct bnx2x *bp ) { u32 val ; u32 val2 ; int func ; int port ; bool tmp ; int tmp___0 ; { func = (int )bp->pf_num; port = (int )bp->pfid & 1; eth_zero_addr((bp->dev)->dev_addr); if ((bp->flags & 512U) != 0U) { printk("\vbnx2x: [%s:%d]warning: random MAC workaround active\n", "bnx2x_get_mac_hwinfo", 11601); eth_hw_addr_random(bp->dev); } else if ((unsigned int )bp->mf_mode != 0U) { val2 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 40UL))); val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 44UL))); if (val2 != 65535U && val != 4294967295U) { bnx2x_set_mac_buf((bp->dev)->dev_addr, val, (int )((u16 )val2)); } else { } if ((unsigned int )bp->cnic_support != 0U) { bnx2x_get_cnic_mac_hwinfo(bp); } else { } } else { val2 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 68UL))); val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 72UL))); bnx2x_set_mac_buf((bp->dev)->dev_addr, val, (int )((u16 )val2)); if ((unsigned int )bp->cnic_support != 0U) { bnx2x_get_cnic_mac_hwinfo(bp); } else { } } if ((bp->flags & 512U) == 0U) { val2 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 68UL))); val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 72UL))); bnx2x_set_mac_buf((u8 *)(& bp->phys_port_id), val, (int )((u16 )val2)); bp->flags = bp->flags | 16777216U; } else { } memcpy((void *)(& bp->link_params.mac_addr), (void const *)(bp->dev)->dev_addr, 6UL); tmp = is_valid_ether_addr((u8 const *)(bp->dev)->dev_addr); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { dev_err((struct device const *)(& (bp->pdev)->dev), "bad Ethernet MAC address configuration: %pM\nchange it manually before bringing up the appropriate network interface\n", (bp->dev)->dev_addr); } else { } return; } } static bool bnx2x_get_dropless_info(struct bnx2x *bp ) { int tmp ; u32 cfg ; { if ((bp->flags & 4194304U) != 0U) { return (0); } else { } if ((unsigned int )bp->mf_mode != 0U && (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U))) { tmp = (int )bp->pf_num; cfg = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )tmp * 40UL) + 228UL))); cfg = (cfg & 128U) != 0U; } else { tmp = (int )bp->pfid & 1; cfg = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )tmp * 400UL) + 124UL))); cfg = cfg & 1U; } return (cfg != 0U); } } static void validate_set_si_mode(struct bnx2x *bp ) { u8 func ; u32 val ; long tmp ; { func = bp->pf_num; val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 40UL))); if (val != 65535U) { bp->mf_mode = 2U; bp->mf_config[(int )bp->pfid >> 1] = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 36UL))); } else { tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "illegal MAC address for SI\n"); } else { } } return; } } static int bnx2x_get_hwinfo(struct bnx2x *bp ) { int func ; int vn ; u32 val ; u32 val2 ; int rc ; unsigned int tmp ; int tout ; long tmp___0 ; unsigned int tmp___1 ; unsigned int tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; unsigned int tmp___6 ; long tmp___7 ; unsigned int tmp___8 ; long tmp___9 ; unsigned int tmp___10 ; unsigned int tmp___11 ; long tmp___12 ; long tmp___13 ; long tmp___14 ; long tmp___15 ; unsigned int tmp___16 ; long tmp___17 ; long tmp___18 ; long tmp___19 ; u8 other_port ; u8 other_func ; u8 __min1 ; u8 __min2 ; { func = (int )bp->pf_num; val = 0U; val2 = 0U; rc = 0; tmp = readl((void const volatile *)bp->regview + 41992U); if (tmp == 4294967295U) { dev_err((struct device const *)(& (bp->pdev)->dev), "Chip read returns all Fs. Preventing probe from continuing\n"); return (-22); } else { } bnx2x_get_common_hwinfo(bp); if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { bp->common.int_block = 0U; bp->igu_dsb_id = 16U; bp->igu_base_sb = 0U; } else { bp->common.int_block = 1U; bnx2x_acquire_hw_lock(bp, 5U); val = readl((void const volatile *)bp->regview + 1245184U); if ((val & 2U) != 0U) { tout = 5000; tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "FORCING Normal Mode\n"); } else { } val = val & 4294967293U; writel(val, (void volatile *)bp->regview + 1245184U); writel(127U, (void volatile *)bp->regview + 1245528U); goto ldv_65318; ldv_65317: tout = tout - 1; usleep_range(1000UL, 2000UL); ldv_65318: ; if (tout != 0) { tmp___1 = readl((void const volatile *)bp->regview + 1245528U); if (tmp___1 != 0U) { goto ldv_65317; } else { goto ldv_65319; } } else { } ldv_65319: tmp___2 = readl((void const volatile *)bp->regview + 1245528U); if (tmp___2 != 0U) { dev_err((struct device const *)(& (bp->pdev)->dev), "FORCING Normal Mode failed!!!\n"); bnx2x_release_hw_lock(bp, 5U); return (-1); } else { } } else { } if ((val & 2U) != 0U) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___3 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "IGU Backward Compatible Mode\n"); } else { } bp->common.int_block = (u8 )((unsigned int )bp->common.int_block | 2U); } else { tmp___4 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___4 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "IGU Normal Mode\n"); } else { } } rc = bnx2x_get_igu_cam_info(bp); bnx2x_release_hw_lock(bp, 5U); if (rc != 0) { return (rc); } else { } } if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { bp->base_fw_ndsb = ((int )bp->pfid & 1) * 16 + (((int )bp->pfid >> 1) << 2); } else { bp->base_fw_ndsb = (int )bp->igu_base_sb; } tmp___5 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___5 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "igu_dsb_id %d igu_base_sb %d igu_sb_cnt %d\nbase_fw_ndsb %d\n", (int )bp->igu_dsb_id, (int )bp->igu_base_sb, (int )bp->igu_sb_cnt, bp->base_fw_ndsb); } else { } bp->mf_ov = 0U; bp->mf_mode = 0U; bp->mf_sub_mode = 0U; vn = (int )bp->pfid >> 1; if (bp->common.chip_id >> 16 != 5710U && (bp->flags & 512U) == 0U) { tmp___7 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___7 != 0L) { tmp___6 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); _dev_info((struct device const *)(& (bp->pdev)->dev), "shmem2base 0x%x, size %d, mfcfg offset %d\n", bp->common.shmem2_base, tmp___6, 16U); } else { } if (bp->common.shmem2_base != 0U) { tmp___8 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___8 > 16U) { bp->common.mf_cfg_base = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 16UL))); } else { bp->common.mf_cfg_base = bp->common.shmem_base + 2020U; } } else { bp->common.mf_cfg_base = bp->common.shmem_base + 2020U; } if (bp->common.mf_cfg_base != 0U) { val = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 852UL))); val = val & 1792U; switch (val) { case 768U: validate_set_si_mode(bp); goto ldv_65321; case 1024U: ; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { tmp___10 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 40UL))); if (tmp___10 != 65535U) { if (bp->common.shmem2_base != 0U) { tmp___11 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___11 > 116U) { bp->mf_mode = 3U; bp->mf_config[vn] = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 36UL))); } else { goto _L___0; } } else { goto _L___0; } } else { goto _L___0; } } else { _L___0: /* CIL Label */ tmp___9 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___9 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "can not configure afex mode\n"); } else { } } goto ldv_65321; case 0U: val = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.mf_cfg_base + 48UL))); val = val & 65535U; if (val != 65535U) { bp->mf_mode = 1U; bp->mf_config[vn] = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 36UL))); } else { tmp___12 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___12 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "illegal OV for SD\n"); } else { } } goto ldv_65321; case 1536U: bp->mf_mode = 1U; bp->mf_sub_mode = 1U; bp->mf_config[vn] = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 36UL))); goto ldv_65321; case 256U: bp->mf_config[vn] = 0U; goto ldv_65321; case 1792U: val2 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 36UL))); val2 = val2 & 3840U; switch (val2) { case 0U: validate_set_si_mode(bp); bp->mf_sub_mode = 2U; goto ldv_65328; default: bp->mf_config[vn] = 0U; tmp___13 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___13 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "unknown extended MF mode 0x%x\n", val); } else { } } ldv_65328: ; goto ldv_65321; default: bp->mf_config[vn] = 0U; tmp___14 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___14 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "unknown MF mode 0x%x\n", val); } else { } } ldv_65321: ; } else { } tmp___15 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___15 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "%s function mode\n", (unsigned int )bp->mf_mode != 0U ? (char *)"multi" : (char *)"single"); } else { } switch ((int )bp->mf_mode) { case 1: tmp___16 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )func * 24UL) + 48UL))); val = tmp___16 & 65535U; if (val != 65535U) { bp->mf_ov = (u16 )val; bp->path_has_ovlan = 1U; tmp___17 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___17 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "MF OV for func %d is %d (0x%04x)\n", func, (int )bp->mf_ov, (int )bp->mf_ov); } else { } } else if ((unsigned int )bp->mf_sub_mode == 1U) { dev_err((struct device const *)(& (bp->pdev)->dev), "Unexpected - no valid MF OV for func %d in UFP mode\n", func); bp->path_has_ovlan = 1U; } else { dev_err((struct device const *)(& (bp->pdev)->dev), "No valid MF OV for func %d, aborting\n", func); return (-1); } goto ldv_65332; case 3: tmp___18 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___18 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "func %d is in MF afex mode\n", func); } else { } goto ldv_65332; case 2: tmp___19 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___19 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "func %d is in MF switch-independent mode\n", func); } else { } goto ldv_65332; default: ; if (vn != 0) { dev_err((struct device const *)(& (bp->pdev)->dev), "VN %d is in a single function mode, aborting\n", vn); return (-1); } else { } goto ldv_65332; } ldv_65332: ; if ((((unsigned int )bp->common.chip_port_mode == 0U && bp->path_has_ovlan == 0U) && (unsigned int )bp->mf_mode == 0U) && bp->common.mf_cfg_base != 0U) { other_port = ((int )bp->pfid & 1) == 0; other_func = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U) + (unsigned int )other_port * 2U; val = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )other_func * 24UL) + 48UL))); if (val != 65535U) { bp->path_has_ovlan = 1U; } else { } } else { } } else { } if ((bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) && (unsigned int )bp->mf_mode != 0U) { __min1 = bp->igu_sb_cnt; __min2 = 4U; bp->igu_sb_cnt = (u8 )((int )__min1 < (int )__min2 ? __min1 : __min2); } else { } bnx2x_get_port_hwinfo(bp); bnx2x_get_mac_hwinfo(bp); bnx2x_get_cnic_info(bp); return (rc); } } static void bnx2x_read_fwinfo(struct bnx2x *bp ) { int cnt ; int i ; int block_end ; int rodi ; char vpd_start[129U] ; char str_id_reg[5U] ; char str_id_cap[5U] ; char *vpd_data ; char *vpd_extended_data ; u8 len ; ssize_t tmp ; u16 tmp___0 ; void *tmp___1 ; ssize_t tmp___2 ; int tmp___3 ; int tmp___4 ; { vpd_extended_data = (char *)0; tmp = pci_read_vpd(bp->pdev, 0LL, 128UL, (void *)(& vpd_start)); cnt = (int )tmp; memset((void *)(& bp->fw_ver), 0, 32UL); if (cnt <= 127) { goto out_not_found; } else { } i = pci_vpd_find_tag((u8 const *)(& vpd_start), 0U, 128U, 144); if (i < 0) { goto out_not_found; } else { } tmp___0 = pci_vpd_lrdt_size((u8 const *)(& vpd_start) + (unsigned long )i); block_end = (i + 3) + (int )tmp___0; i = i + 3; if (block_end > 128) { tmp___1 = kmalloc((size_t )block_end, 208U); vpd_extended_data = (char *)tmp___1; if ((unsigned long )vpd_extended_data == (unsigned long )((char *)0)) { goto out_not_found; } else { } memcpy((void *)vpd_extended_data, (void const *)(& vpd_start), 128UL); tmp___2 = pci_read_vpd(bp->pdev, 128LL, (size_t )(block_end + -128), (void *)vpd_extended_data + 128U); cnt = (int )tmp___2; if (block_end + -128 > cnt) { goto out_not_found; } else { } vpd_data = vpd_extended_data; } else { vpd_data = (char *)(& vpd_start); } rodi = pci_vpd_find_info_keyword((u8 const *)vpd_data, (unsigned int )i, (unsigned int )block_end, "MN"); if (rodi < 0) { goto out_not_found; } else { } len = pci_vpd_info_field_size((u8 const *)vpd_data + (unsigned long )rodi); if ((unsigned int )len != 4U) { goto out_not_found; } else { } rodi = rodi + 3; snprintf((char *)(& str_id_reg), 5UL, "%04x", 4136); snprintf((char *)(& str_id_cap), 5UL, "%04X", 4136); tmp___3 = strncmp((char const *)(& str_id_reg), (char const *)vpd_data + (unsigned long )rodi, 4UL); if (tmp___3 == 0) { goto _L; } else { tmp___4 = strncmp((char const *)(& str_id_cap), (char const *)vpd_data + (unsigned long )rodi, 4UL); if (tmp___4 == 0) { _L: /* CIL Label */ rodi = pci_vpd_find_info_keyword((u8 const *)vpd_data, (unsigned int )i, (unsigned int )block_end, "V0"); if (rodi >= 0) { len = pci_vpd_info_field_size((u8 const *)vpd_data + (unsigned long )rodi); rodi = rodi + 3; if ((unsigned int )len <= 31U && (int )len + rodi <= 128) { memcpy((void *)(& bp->fw_ver), (void const *)vpd_data + (unsigned long )rodi, (size_t )len); bp->fw_ver[(int )len] = 32; } else { } } else { } kfree((void const *)vpd_extended_data); return; } else { } } out_not_found: kfree((void const *)vpd_extended_data); return; } } static void bnx2x_set_modes_bitmap(struct bnx2x *bp ) { u32 flags ; { flags = 0U; if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) != 0U) { flags = flags | 2U; } else if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) == 0U) { flags = flags | 4U; } else { flags = flags | 1U; } if ((unsigned int )bp->common.chip_port_mode == 0U) { flags = flags | 64U; } else { flags = flags | 32U; } if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { flags = flags | 8U; } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { flags = flags | 16U; if ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U) { flags = flags | 4096U; } else { flags = flags | 24576U; } } else { } if ((unsigned int )bp->mf_mode != 0U) { flags = flags | 256U; switch ((int )bp->mf_mode) { case 1: flags = flags | 512U; goto ldv_65360; case 2: flags = flags | 1024U; goto ldv_65360; case 3: flags = flags | 2048U; goto ldv_65360; } ldv_65360: ; } else { flags = flags | 128U; } flags = flags | 65536U; bp->init_mode_flags = flags; return; } } static int bnx2x_init_bp(struct bnx2x *bp ) { int func ; int rc ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___3 ; struct lock_class_key __key___4 ; atomic_long_t __constr_expr_1 ; struct lock_class_key __key___5 ; struct lock_class_key __key___6 ; atomic_long_t __constr_expr_2 ; struct lock_class_key __key___7 ; struct lock_class_key __key___8 ; atomic_long_t __constr_expr_3 ; struct lock_class_key __key___9 ; unsigned int tmp ; long tmp___0 ; int tmp___1 ; bool tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; unsigned int tmp___5 ; unsigned int tmp___6 ; long tmp___7 ; long tmp___8 ; { __mutex_init(& bp->port.phy_mutex, "&bp->port.phy_mutex", & __key); __mutex_init(& bp->fw_mb_mutex, "&bp->fw_mb_mutex", & __key___0); __mutex_init(& bp->drv_info_mutex, "&bp->drv_info_mutex", & __key___1); sema_init(& bp->stats_lock, 1); bp->drv_info_mng_owner = 0; __init_work(& bp->sp_task.work, 0); __constr_expr_0.counter = 137438953408L; bp->sp_task.work.data = __constr_expr_0; lockdep_init_map(& bp->sp_task.work.lockdep_map, "(&(&bp->sp_task)->work)", & __key___2, 0); INIT_LIST_HEAD(& bp->sp_task.work.entry); bp->sp_task.work.func = & bnx2x_sp_task; init_timer_key(& bp->sp_task.timer, 2097152U, "(&(&bp->sp_task)->timer)", & __key___3); bp->sp_task.timer.function = & delayed_work_timer_fn; bp->sp_task.timer.data = (unsigned long )(& bp->sp_task); __init_work(& bp->sp_rtnl_task.work, 0); __constr_expr_1.counter = 137438953408L; bp->sp_rtnl_task.work.data = __constr_expr_1; lockdep_init_map(& bp->sp_rtnl_task.work.lockdep_map, "(&(&bp->sp_rtnl_task)->work)", & __key___4, 0); INIT_LIST_HEAD(& bp->sp_rtnl_task.work.entry); bp->sp_rtnl_task.work.func = & bnx2x_sp_rtnl_task; init_timer_key(& bp->sp_rtnl_task.timer, 2097152U, "(&(&bp->sp_rtnl_task)->timer)", & __key___5); bp->sp_rtnl_task.timer.function = & delayed_work_timer_fn; bp->sp_rtnl_task.timer.data = (unsigned long )(& bp->sp_rtnl_task); __init_work(& bp->period_task.work, 0); __constr_expr_2.counter = 137438953408L; bp->period_task.work.data = __constr_expr_2; lockdep_init_map(& bp->period_task.work.lockdep_map, "(&(&bp->period_task)->work)", & __key___6, 0); INIT_LIST_HEAD(& bp->period_task.work.entry); bp->period_task.work.func = & bnx2x_period_task; init_timer_key(& bp->period_task.timer, 2097152U, "(&(&bp->period_task)->timer)", & __key___7); bp->period_task.timer.function = & delayed_work_timer_fn; bp->period_task.timer.data = (unsigned long )(& bp->period_task); __init_work(& bp->iov_task.work, 0); __constr_expr_3.counter = 137438953408L; bp->iov_task.work.data = __constr_expr_3; lockdep_init_map(& bp->iov_task.work.lockdep_map, "(&(&bp->iov_task)->work)", & __key___8, 0); INIT_LIST_HEAD(& bp->iov_task.work.entry); bp->iov_task.work.func = & bnx2x_iov_task; init_timer_key(& bp->iov_task.timer, 2097152U, "(&(&bp->iov_task)->timer)", & __key___9); bp->iov_task.timer.function = & delayed_work_timer_fn; bp->iov_task.timer.data = (unsigned long )(& bp->iov_task); if ((bp->flags & 4194304U) == 0U) { rc = bnx2x_get_hwinfo(bp); if (rc != 0) { return (rc); } else { } } else { eth_zero_addr((bp->dev)->dev_addr); } bnx2x_set_modes_bitmap(bp); rc = bnx2x_alloc_mem_bp(bp); if (rc != 0) { return (rc); } else { } bnx2x_read_fwinfo(bp); func = (int )bp->pfid; if ((bp->flags & 4194304U) == 0U && (bp->flags & 512U) == 0U) { tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) * 44UL) + 1668UL))); bp->fw_seq = (u16 )tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "fw_seq 0x%08x\n", (int )bp->fw_seq); } else { } rc = bnx2x_prev_unload(bp); if (rc != 0) { bnx2x_free_mem_bp(bp); return (rc); } else { } } else { } if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) != 0U) { dev_err((struct device const *)(& (bp->pdev)->dev), "FPGA detected\n"); } else { } if ((bp->flags & 512U) != 0U && func == 0) { dev_err((struct device const *)(& (bp->pdev)->dev), "MCP disabled, must load devices in order!\n"); } else { } bp->disable_tpa = disable_tpa; bp->disable_tpa = bp->disable_tpa | ((((unsigned int )bp->mf_mode == 1U && ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U || (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U)) || ((unsigned int )bp->mf_mode == 2U && ((bp->mf_ext_config & 14U) == 4U || (bp->mf_ext_config & 14U) == 8U))) || ((unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U)); tmp___1 = is_kdump_kernel(); bp->disable_tpa = bp->disable_tpa | tmp___1; if (bp->disable_tpa != 0) { (bp->dev)->hw_features = (bp->dev)->hw_features & 0xffffffffffff7fffULL; (bp->dev)->features = (bp->dev)->features & 0xffffffffffff7fffULL; } else { } if (bp->common.chip_id >> 16 == 5710U) { bp->dropless_fc = 0; } else { tmp___2 = bnx2x_get_dropless_info(bp); bp->dropless_fc = ((int )tmp___2 | dropless_fc) != 0; } bp->mrrs = mrrs; bp->tx_ring_size = (((unsigned int )bp->mf_mode == 1U && ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U || (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U)) || ((unsigned int )bp->mf_mode == 2U && ((bp->mf_ext_config & 14U) == 4U || (bp->mf_ext_config & 14U) == 8U))) || ((unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U) ? 0 : 4078; if ((bp->flags & 4194304U) != 0U) { bp->rx_ring_size = 4078; } else { } bp->tx_ticks = 48U; bp->rx_ticks = 24U; bp->current_interval = (bp->common.chip_id & 61440U) > 20480U ? 1250 : 250; reg_timer_9(& bp->timer); bp->timer.expires = (unsigned long )bp->current_interval + (unsigned long )jiffies; bp->timer.data = (unsigned long )bp; bp->timer.function = & bnx2x_timer; if (bp->common.shmem2_base != 0U) { tmp___3 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___3 > 40U) { if (bp->common.shmem2_base != 0U) { tmp___4 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___4 > 100U) { tmp___5 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 40UL))); if (tmp___5 != 0U) { tmp___6 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 100UL))); if (tmp___6 != 0U) { bnx2x_dcbx_set_state(bp, 1, 2U); bnx2x_dcbx_init_params(bp); } else { bnx2x_dcbx_set_state(bp, 0, 0U); } } else { bnx2x_dcbx_set_state(bp, 0, 0U); } } else { bnx2x_dcbx_set_state(bp, 0, 0U); } } else { bnx2x_dcbx_set_state(bp, 0, 0U); } } else { bnx2x_dcbx_set_state(bp, 0, 0U); } } else { bnx2x_dcbx_set_state(bp, 0, 0U); } if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { bp->cnic_base_cl_id = 16U; } else { bp->cnic_base_cl_id = 136U; } if ((bp->flags & 4194304U) != 0U) { bp->max_cos = 1U; } else if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { bp->max_cos = 3U; } else if (((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) || ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U))) { bp->max_cos = 2U; } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { bp->max_cos = 3U; } else { printk("\vbnx2x: [%s:%d(%s)]unknown chip %x revision %x\n", "bnx2x_init_bp", 12184, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->common.chip_id >> 16, (bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 : bp->common.chip_id & 61440U); } tmp___7 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___7 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "set bp->max_cos to %d\n", (int )bp->max_cos); } else { } if ((bp->flags & 4194304U) != 0U) { bp->min_msix_vec_cnt = 1U; } else if ((unsigned int )bp->cnic_support != 0U) { bp->min_msix_vec_cnt = 3U; } else { bp->min_msix_vec_cnt = 2U; } tmp___8 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___8 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "bp->min_msix_vec_cnt %d", (int )bp->min_msix_vec_cnt); } else { } bp->dump_preset_idx = 1U; if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { bp->flags = bp->flags | 67108864U; } else { } return (rc); } } static int bnx2x_open(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; int rc ; int other_engine ; bool other_load_status ; bool load_status ; bool global ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; bool tmp___4 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; bp->stats_init = 1; netif_carrier_off(dev); bnx2x_set_power_state(bp, 0); if ((bp->flags & 4194304U) == 0U) { other_engine = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 0 : 1; global = 0; other_load_status = bnx2x_get_load_status(bp, other_engine); load_status = bnx2x_get_load_status(bp, bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); tmp___2 = bnx2x_reset_is_done(bp, bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { goto _L; } else { tmp___4 = bnx2x_chk_parity_attn(bp, & global, 1); if ((int )tmp___4) { _L: /* CIL Label */ if ((int )global) { bnx2x_set_reset_global(bp); } else { } if (! load_status && (! global || ! other_load_status)) { tmp___0 = bnx2x_trylock_leader_lock(bp); if ((int )tmp___0) { tmp___1 = bnx2x_leader_reset(bp); if (tmp___1 == 0) { netdev_info((struct net_device const *)bp->dev, "Recovered in open\n"); goto ldv_65393; } else { } } else { } } else { } bnx2x_set_power_state(bp, 3); bp->recovery_state = 3; printk("\vbnx2x: [%s:%d(%s)]Recovery flow hasn\'t been properly completed yet. Try again later.\nIf you still see this message after a few retries then power cycle is required.\n", "bnx2x_open", 12270, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-11); ldv_65393: ; } else { } } } else { } bp->recovery_state = 0; rc = bnx2x_nic_load(bp, 1); if (rc != 0) { return (rc); } else { } return (0); } } static int bnx2x_close(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; bnx2x_nic_unload(bp, 1, 0); return (0); } } static int bnx2x_init_mcast_macs_list(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p ) { int mc_count ; struct bnx2x_mcast_list_elem *mc_mac ; void *tmp ; struct netdev_hw_addr *ha ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { mc_count = (bp->dev)->mc.count; tmp = kcalloc((size_t )mc_count, 24UL, 32U); mc_mac = (struct bnx2x_mcast_list_elem *)tmp; if ((unsigned long )mc_mac == (unsigned long )((struct bnx2x_mcast_list_elem *)0)) { return (-12); } else { } INIT_LIST_HEAD(& p->mcast_list); __mptr = (struct list_head const *)(bp->dev)->mc.list.next; ha = (struct netdev_hw_addr *)__mptr; goto ldv_65411; ldv_65410: mc_mac->mac = (u8 *)(& ha->addr); list_add_tail(& mc_mac->link, & p->mcast_list); mc_mac = mc_mac + 1; __mptr___0 = (struct list_head const *)ha->list.next; ha = (struct netdev_hw_addr *)__mptr___0; ldv_65411: ; if ((unsigned long )(& ha->list) != (unsigned long )(& (bp->dev)->mc.list)) { goto ldv_65410; } else { } p->mcast_list_len = mc_count; return (0); } } static void bnx2x_free_mcast_macs_list(struct bnx2x_mcast_ramrod_params *p ) { struct bnx2x_mcast_list_elem *mc_mac ; struct list_head const *__mptr ; int __ret_warn_on ; long tmp ; { __mptr = (struct list_head const *)p->mcast_list.next; mc_mac = (struct bnx2x_mcast_list_elem *)__mptr; __ret_warn_on = (unsigned long )mc_mac == (unsigned long )((struct bnx2x_mcast_list_elem *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 12326); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); kfree((void const *)mc_mac); return; } } static int bnx2x_set_uc_list(struct bnx2x *bp ) { int rc ; struct net_device *dev ; struct netdev_hw_addr *ha ; struct bnx2x_vlan_mac_obj *mac_obj ; unsigned long ramrod_flags ; struct list_head const *__mptr ; long tmp ; struct list_head const *__mptr___0 ; int tmp___0 ; { dev = bp->dev; mac_obj = & (bp->sp_objs)->mac_obj; ramrod_flags = 0UL; rc = bnx2x_del_all_macs(bp, mac_obj, 0, 0); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to schedule DELETE operations: %d\n", "bnx2x_set_uc_list", 12348, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } __mptr = (struct list_head const *)dev->uc.list.next; ha = (struct netdev_hw_addr *)__mptr; goto ldv_65435; ldv_65434: rc = bnx2x_set_mac_one(bp, (u8 *)(& ha->addr), mac_obj, 1, 0, & ramrod_flags); if (rc == -17) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to schedule ADD operations: %d\n", "bnx2x_set_uc_list", 12357, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } rc = 0; } else if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to schedule ADD operations: %d\n", "bnx2x_set_uc_list", 12364, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } __mptr___0 = (struct list_head const *)ha->list.next; ha = (struct netdev_hw_addr *)__mptr___0; ldv_65435: ; if ((unsigned long )(& ha->list) != (unsigned long )(& dev->uc.list)) { goto ldv_65434; } else { } __set_bit(6L, (unsigned long volatile *)(& ramrod_flags)); tmp___0 = bnx2x_set_mac_one(bp, (u8 *)0U, mac_obj, 0, 0, & ramrod_flags); return (tmp___0); } } static int bnx2x_set_mc_list(struct bnx2x *bp ) { struct net_device *dev ; struct bnx2x_mcast_ramrod_params rparam ; int rc ; { dev = bp->dev; rparam.mcast_obj = (struct bnx2x_mcast_obj *)0; rparam.ramrod_flags = 0UL; rparam.mcast_list.next = 0; rparam.mcast_list.prev = 0; rparam.mcast_list_len = 0; rc = 0; rparam.mcast_obj = & bp->mcast_obj; rc = bnx2x_config_mcast(bp, & rparam, 2); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to clear multicast configuration: %d\n", "bnx2x_set_mc_list", 12386, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } if (dev->mc.count != 0) { rc = bnx2x_init_mcast_macs_list(bp, & rparam); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to create multicast MACs list: %d\n", "bnx2x_set_mc_list", 12395, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } rc = bnx2x_config_mcast(bp, & rparam, 0); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to set a new multicast configuration: %d\n", "bnx2x_set_mc_list", 12404, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } bnx2x_free_mcast_macs_list(& rparam); } else { } return (rc); } } static void bnx2x_set_rx_mode(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((unsigned int )bp->state != 12288U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]state is %x, returning\n", "bnx2x_set_rx_mode", 12418, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->state); } else { } return; } else { bnx2x_schedule_sp_rtnl(bp, 7, 32U); } return; } } void bnx2x_set_rx_mode_inner(struct bnx2x *bp ) { u32 rx_mode ; long tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { rx_mode = 1U; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]dev->flags = %x\n", "bnx2x_set_rx_mode_inner", 12431, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->dev)->flags); } else { } netif_addr_lock_bh(bp->dev); if (((bp->dev)->flags & 256U) != 0U) { rx_mode = 3U; } else if (((bp->dev)->flags & 512U) != 0U || ((bp->dev)->mc.count > 64 && bp->common.chip_id >> 16 == 5710U)) { rx_mode = 2U; } else if ((bp->flags & 4194304U) == 0U) { tmp___0 = bnx2x_set_mc_list(bp); if (tmp___0 < 0) { rx_mode = 2U; } else { } netif_addr_unlock_bh(bp->dev); tmp___1 = bnx2x_set_uc_list(bp); if (tmp___1 < 0) { rx_mode = 3U; } else { } netif_addr_lock_bh(bp->dev); } else { bnx2x_schedule_sp_rtnl(bp, 5, 0U); } bp->rx_mode = rx_mode; if (((unsigned int )bp->mf_mode == 1U && (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U) || ((unsigned int )bp->mf_mode == 2U && (bp->mf_ext_config & 14U) == 4U)) { bp->rx_mode = 0U; } else { } tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)(& bp->sp_state)); if (tmp___2 != 0) { set_bit(4L, (unsigned long volatile *)(& bp->sp_state)); netif_addr_unlock_bh(bp->dev); return; } else { } if ((bp->flags & 4194304U) == 0U) { bnx2x_set_storm_rx_mode(bp); netif_addr_unlock_bh(bp->dev); } else { netif_addr_unlock_bh(bp->dev); bnx2x_vfpf_storm_rx_mode(bp); } return; } } static int bnx2x_mdio_read(struct net_device *netdev , int prtad , int devad , u16 addr ) { struct bnx2x *bp ; void *tmp ; u16 value ; int rc ; long tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]mdio_read: prtad 0x%x, devad 0x%x, addr 0x%x\n", "bnx2x_mdio_read", 12495, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prtad, devad, (int )addr); } else { } devad = devad != -1 ? devad : 3; bnx2x_acquire_phy_lock(bp); rc = bnx2x_phy_read(& bp->link_params, (int )((u8 )prtad), (int )((u8 )devad), (int )addr, & value); bnx2x_release_phy_lock(bp); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]mdio_read_val 0x%x rc = 0x%x\n", "bnx2x_mdio_read", 12503, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )value, rc); } else { } if (rc == 0) { rc = (int )value; } else { } return (rc); } } static int bnx2x_mdio_write(struct net_device *netdev , int prtad , int devad , u16 addr , u16 value ) { struct bnx2x *bp ; void *tmp ; int rc ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]mdio_write: prtad 0x%x, devad 0x%x, addr 0x%x, value 0x%x\n", "bnx2x_mdio_write", 12519, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prtad, devad, (int )addr, (int )value); } else { } devad = devad != -1 ? devad : 3; bnx2x_acquire_phy_lock(bp); rc = bnx2x_phy_write(& bp->link_params, (int )((u8 )prtad), (int )((u8 )devad), (int )addr, (int )value); bnx2x_release_phy_lock(bp); return (rc); } } static int bnx2x_ioctl(struct net_device *dev , struct ifreq *ifr , int cmd ) { struct bnx2x *bp ; void *tmp ; struct mii_ioctl_data *mdio ; struct mii_ioctl_data *tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = if_mii(ifr); mdio = tmp___0; tmp___1 = netif_running((struct net_device const *)dev); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { return (-11); } else { } switch (cmd) { case 35248: tmp___3 = bnx2x_hwtstamp_ioctl(bp, ifr); return (tmp___3); default: tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ioctl: phy id 0x%x, reg 0x%x, val_in 0x%x\n", "bnx2x_ioctl", 12544, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )mdio->phy_id, (int )mdio->reg_num, (int )mdio->val_in); } else { } tmp___5 = mdio_mii_ioctl((struct mdio_if_info const *)(& bp->mdio), mdio, cmd); return (tmp___5); } } } static void poll_bnx2x(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; int i ; struct bnx2x_fastpath *fp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; i = 0; goto ldv_65491; ldv_65490: fp = bp->fp + (unsigned long )i; napi_schedule(& (bp->fp + (unsigned long )fp->index)->napi); i = i + 1; ldv_65491: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_65490; } else { } return; } } static int bnx2x_validate_addr(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; bool tmp___0 ; int tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((bp->flags & 4194304U) != 0U) { bnx2x_sample_bulletin(bp); } else { } tmp___0 = is_valid_ether_addr((u8 const *)dev->dev_addr); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { printk("\vbnx2x: [%s:%d(%s)]Non-valid Ethernet address\n", "bnx2x_validate_addr", 12571, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-99); } else { } return (0); } } static int bnx2x_get_phys_port_id(struct net_device *netdev , struct netdev_phys_item_id *ppid ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; if ((bp->flags & 16777216U) == 0U) { return (-95); } else { } ppid->id_len = 6U; memcpy((void *)(& ppid->id), (void const *)(& bp->phys_port_id), (size_t )ppid->id_len); return (0); } } static netdev_features_t bnx2x_features_check(struct sk_buff *skb , struct net_device *dev , netdev_features_t features ) { netdev_features_t tmp ; { features = vlan_features_check((struct sk_buff const *)skb, features); tmp = vxlan_features_check(skb, features); return (tmp); } } static struct net_device_ops const bnx2x_netdev_ops = {0, 0, & bnx2x_open, & bnx2x_close, & bnx2x_start_xmit, & bnx2x_select_queue, 0, & bnx2x_set_rx_mode, & bnx2x_change_mac_addr, & bnx2x_validate_addr, & bnx2x_ioctl, 0, & bnx2x_change_mtu, 0, & bnx2x_tx_timeout, 0, 0, 0, 0, & poll_bnx2x, 0, 0, & bnx2x_low_latency_recv, & bnx2x_set_vf_mac, & bnx2x_set_vf_vlan, 0, 0, & bnx2x_get_vf_config, & bnx2x_set_vf_link_state, 0, 0, 0, 0, & bnx2x_setup_tc, 0, 0, 0, 0, 0, 0, & bnx2x_fcoe_get_wwn, 0, 0, 0, & bnx2x_fix_features, & bnx2x_set_features, 0, 0, 0, 0, 0, 0, 0, 0, 0, & bnx2x_get_phys_port_id, 0, 0, 0, 0, 0, 0, 0, & bnx2x_features_check, 0, 0}; static int bnx2x_set_coherency_mask(struct bnx2x *bp ) { struct device *dev ; int tmp ; int tmp___0 ; { dev = & (bp->pdev)->dev; tmp = dma_set_mask_and_coherent(dev, 0xffffffffffffffffULL); if (tmp != 0) { tmp___0 = dma_set_mask_and_coherent(dev, 4294967295ULL); if (tmp___0 != 0) { dev_err((struct device const *)dev, "System does not support DMA, aborting\n"); return (-5); } else { } } else { } return (0); } } static void bnx2x_disable_pcie_error_reporting(struct bnx2x *bp ) { { if ((bp->flags & 33554432U) != 0U) { pci_disable_pcie_error_reporting(bp->pdev); bp->flags = bp->flags & 4261412863U; } else { } return; } } static int bnx2x_init_dev(struct bnx2x *bp , struct pci_dev *pdev , struct net_device *dev , unsigned long board_type ) { int rc ; u32 pci_cfg_dword ; bool chip_is_e1x ; int tmp ; bool tmp___0 ; int tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; { chip_is_e1x = (bool )((board_type == 0UL || board_type == 1UL) || board_type == 2UL); dev->dev.parent = & pdev->dev; bp->dev = dev; bp->pdev = pdev; rc = pci_enable_device(pdev); if (rc != 0) { dev_err((struct device const *)(& (bp->pdev)->dev), "Cannot enable PCI device, aborting\n"); goto err_out; } else { } if ((pdev->resource[0].flags & 512UL) == 0UL) { dev_err((struct device const *)(& (bp->pdev)->dev), "Cannot find PCI device base address, aborting\n"); rc = -19; goto err_out_disable; } else { } if ((bp->flags & 4194304U) == 0U && (pdev->resource[2].flags & 512UL) == 0UL) { dev_err((struct device const *)(& (bp->pdev)->dev), "Cannot find second PCI device base address, aborting\n"); rc = -19; goto err_out_disable; } else { } pci_read_config_dword((struct pci_dev const *)pdev, 8, & pci_cfg_dword); if ((pci_cfg_dword & 255U) == 255U) { printk("\vbnx2x: PCI device error, probably due to fan failure, aborting\n"); rc = -19; goto err_out_disable; } else { } tmp = atomic_read((atomic_t const *)(& pdev->enable_cnt)); if (tmp == 1) { rc = pci_request_regions(pdev, "bnx2x"); if (rc != 0) { dev_err((struct device const *)(& (bp->pdev)->dev), "Cannot obtain PCI resources, aborting\n"); goto err_out_disable; } else { } pci_set_master(pdev); pci_save_state(pdev); } else { } if ((bp->flags & 4194304U) == 0U) { if ((unsigned int )pdev->pm_cap == 0U) { dev_err((struct device const *)(& (bp->pdev)->dev), "Cannot find power management capability, aborting\n"); rc = -5; goto err_out_release; } else { } } else { } tmp___0 = pci_is_pcie(pdev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { dev_err((struct device const *)(& (bp->pdev)->dev), "Not PCI Express, aborting\n"); rc = -5; goto err_out_release; } else { } rc = bnx2x_set_coherency_mask(bp); if (rc != 0) { goto err_out_release; } else { } dev->mem_start = (unsigned long )pdev->resource[0].start; dev->base_addr = dev->mem_start; dev->mem_end = (unsigned long )pdev->resource[0].end; dev->irq = (int )pdev->irq; bp->regview = pci_ioremap_bar(pdev, 0); if ((unsigned long )bp->regview == (unsigned long )((void *)0)) { dev_err((struct device const *)(& (bp->pdev)->dev), "Cannot map register space, aborting\n"); rc = -12; goto err_out_release; } else { } if ((int )chip_is_e1x) { bp->pf_num = (unsigned int )((u8 )pdev->devfn) & 7U; } else { pci_read_config_dword((struct pci_dev const *)bp->pdev, 152, & pci_cfg_dword); bp->pf_num = (unsigned char )(((long )pci_cfg_dword & 458752L) >> 16); } tmp___2 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___2 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "me reg PF num: %d\n", (int )bp->pf_num); } else { } pci_write_config_dword((struct pci_dev const *)bp->pdev, 120, 0U); pdev->needs_freset = 1U; rc = pci_enable_pcie_error_reporting(pdev); if (rc == 0) { bp->flags = bp->flags | 33554432U; } else { tmp___3 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___3 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Failed To configure PCIe AER [%d]\n", rc); } else { } } if ((bp->flags & 4194304U) == 0U) { writel(0U, (void volatile *)bp->regview + 1180980U); writel(0U, (void volatile *)bp->regview + 1180984U); writel(0U, (void volatile *)bp->regview + 1180988U); writel(0U, (void volatile *)bp->regview + 1180992U); if ((int )chip_is_e1x) { writel(0U, (void volatile *)bp->regview + 1180996U); writel(0U, (void volatile *)bp->regview + 1181000U); writel(0U, (void volatile *)bp->regview + 1181004U); writel(0U, (void volatile *)bp->regview + 1181008U); } else { } if (! chip_is_e1x) { writel(1U, (void volatile *)bp->regview + 37936U); } else { } } else { } dev->watchdog_timeo = 1250; dev->netdev_ops = & bnx2x_netdev_ops; bnx2x_set_ethtool_ops(bp, dev); dev->priv_flags = dev->priv_flags | 131072U; dev->hw_features = 25771491475ULL; if (! chip_is_e1x) { dev->hw_features = dev->hw_features | 121634816ULL; dev->hw_enc_features = 123273235ULL; } else { } dev->vlan_features = 1638451ULL; dev->features = (dev->features | dev->hw_features) | 256ULL; dev->features = dev->features | 32ULL; dev->hw_features = dev->hw_features | 68719476736ULL; dev->dcbnl_ops = & bnx2x_dcbnl_ops; bp->mdio.prtad = -1; bp->mdio.mmds = 0U; bp->mdio.mode_support = 6U; bp->mdio.dev = dev; bp->mdio.mdio_read = & bnx2x_mdio_read; bp->mdio.mdio_write = & bnx2x_mdio_write; return (0); err_out_release: tmp___4 = atomic_read((atomic_t const *)(& pdev->enable_cnt)); if (tmp___4 == 1) { pci_release_regions(pdev); } else { } err_out_disable: pci_disable_device(pdev); err_out: ; return (rc); } } static int bnx2x_check_firmware(struct bnx2x *bp ) { struct firmware const *firmware ; struct bnx2x_fw_file_hdr *fw_hdr ; struct bnx2x_fw_file_section *sections ; u32 offset ; u32 len ; u32 num_ops ; __be16 *ops_offsets ; int i ; u8 const *fw_ver ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u16 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; { firmware = bp->firmware; if ((unsigned long )firmware->size <= 103UL) { printk("\vbnx2x: [%s:%d(%s)]Wrong FW size\n", "bnx2x_check_firmware", 12864, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } fw_hdr = (struct bnx2x_fw_file_hdr *)firmware->data; sections = (struct bnx2x_fw_file_section *)fw_hdr; i = 0; goto ldv_65542; ldv_65541: tmp = __fswab32((sections + (unsigned long )i)->offset); offset = tmp; tmp___0 = __fswab32((sections + (unsigned long )i)->len); len = tmp___0; if ((unsigned long )(offset + len) > (unsigned long )firmware->size) { printk("\vbnx2x: [%s:%d(%s)]Section %d length is out of bounds\n", "bnx2x_check_firmware", 12877, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i); return (-22); } else { } i = i + 1; ldv_65542: ; if ((unsigned int )i <= 12U) { goto ldv_65541; } else { } tmp___1 = __fswab32(fw_hdr->init_ops_offsets.offset); offset = tmp___1; ops_offsets = (__be16 *)firmware->data + (unsigned long )offset; tmp___2 = __fswab32(fw_hdr->init_ops.len); num_ops = tmp___2 / 8U; i = 0; goto ldv_65545; ldv_65544: tmp___3 = __fswab16((int )*(ops_offsets + (unsigned long )i)); if ((u32 )tmp___3 > num_ops) { printk("\vbnx2x: [%s:%d(%s)]Section offset %d is out of bounds\n", "bnx2x_check_firmware", 12889, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i); return (-22); } else { } i = i + 1; ldv_65545: tmp___4 = __fswab32(fw_hdr->init_ops_offsets.len); if ((unsigned int )i < tmp___4 / 2U) { goto ldv_65544; } else { } tmp___5 = __fswab32(fw_hdr->fw_version.offset); offset = tmp___5; fw_ver = firmware->data + (unsigned long )offset; if ((((unsigned int )((unsigned char )*fw_ver) != 7U || (unsigned int )((unsigned char )*(fw_ver + 1UL)) != 10U) || (unsigned int )((unsigned char )*(fw_ver + 2UL)) != 51U) || (unsigned int )((unsigned char )*(fw_ver + 3UL)) != 0U) { printk("\vbnx2x: [%s:%d(%s)]Bad FW version:%d.%d.%d.%d. Should be %d.%d.%d.%d\n", "bnx2x_check_firmware", 12906, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )*fw_ver, (int )*(fw_ver + 1UL), (int )*(fw_ver + 2UL), (int )*(fw_ver + 3UL), 7, 10, 51, 0); return (-22); } else { } return (0); } } static void be32_to_cpu_n(u8 const *_source , u8 *_target , u32 n ) { __be32 const *source ; u32 *target ; u32 i ; __u32 tmp ; { source = (__be32 const *)_source; target = (u32 *)_target; i = 0U; goto ldv_65556; ldv_65555: tmp = __fswab32(*(source + (unsigned long )i)); *(target + (unsigned long )i) = tmp; i = i + 1U; ldv_65556: ; if (n / 4U > i) { goto ldv_65555; } else { } return; } } static void bnx2x_prep_ops(u8 const *_source , u8 *_target , u32 n ) { __be32 const *source ; struct raw_op *target ; u32 i ; u32 j ; u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; { source = (__be32 const *)_source; target = (struct raw_op *)_target; i = 0U; j = 0U; goto ldv_65569; ldv_65568: tmp___0 = __fswab32(*(source + (unsigned long )j)); tmp = tmp___0; (target + (unsigned long )i)->op = (unsigned char )(tmp >> 24); (target + (unsigned long )i)->offset = tmp & 16777215U; tmp___1 = __fswab32(*(source + (unsigned long )(j + 1U))); (target + (unsigned long )i)->raw_data = tmp___1; i = i + 1U; j = j + 2U; ldv_65569: ; if (n / 8U > i) { goto ldv_65568; } else { } return; } } static void bnx2x_prep_iro(u8 const *_source , u8 *_target , u32 n ) { __be32 const *source ; struct iro *target ; u32 i ; u32 j ; u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; { source = (__be32 const *)_source; target = (struct iro *)_target; i = 0U; j = 0U; goto ldv_65582; ldv_65581: tmp___0 = __fswab32(*(source + (unsigned long )j)); (target + (unsigned long )i)->base = tmp___0; j = j + 1U; tmp___1 = __fswab32(*(source + (unsigned long )j)); tmp = tmp___1; (target + (unsigned long )i)->m1 = (u16 )(tmp >> 16); (target + (unsigned long )i)->m2 = (u16 )tmp; j = j + 1U; tmp___2 = __fswab32(*(source + (unsigned long )j)); tmp = tmp___2; (target + (unsigned long )i)->m3 = (u16 )(tmp >> 16); (target + (unsigned long )i)->size = (u16 )tmp; j = j + 1U; i = i + 1U; ldv_65582: ; if (n / 12U > i) { goto ldv_65581; } else { } return; } } static void be16_to_cpu_n(u8 const *_source , u8 *_target , u32 n ) { __be16 const *source ; u16 *target ; u32 i ; __u16 tmp ; { source = (__be16 const *)_source; target = (u16 *)_target; i = 0U; goto ldv_65593; ldv_65592: tmp = __fswab16((int )*(source + (unsigned long )i)); *(target + (unsigned long )i) = tmp; i = i + 1U; ldv_65593: ; if (n / 2U > i) { goto ldv_65592; } else { } return; } } static int bnx2x_init_firmware(struct bnx2x *bp ) { char const *fw_file_name ; struct bnx2x_fw_file_hdr *fw_hdr ; int rc ; long tmp ; u32 len ; __u32 tmp___0 ; void *tmp___1 ; __u32 tmp___2 ; u32 len___0 ; __u32 tmp___3 ; void *tmp___4 ; __u32 tmp___5 ; u32 len___1 ; __u32 tmp___6 ; void *tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u32 tmp___12 ; __u32 tmp___13 ; __u32 tmp___14 ; __u32 tmp___15 ; __u32 tmp___16 ; u32 len___2 ; __u32 tmp___17 ; void *tmp___18 ; __u32 tmp___19 ; { if ((unsigned long )bp->firmware != (unsigned long )((struct firmware const *)0)) { return (0); } else { } if (bp->common.chip_id >> 16 == 5710U) { fw_file_name = "bnx2x/bnx2x-e1-7.10.51.0.fw"; } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { fw_file_name = "bnx2x/bnx2x-e1h-7.10.51.0.fw"; } else if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { fw_file_name = "bnx2x/bnx2x-e2-7.10.51.0.fw"; } else { printk("\vbnx2x: [%s:%d(%s)]Unsupported chip revision\n", "bnx2x_init_firmware", 13000, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Loading %s\n", fw_file_name); } else { } rc = request_firmware(& bp->firmware, fw_file_name, & (bp->pdev)->dev); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Can\'t load firmware file %s\n", "bnx2x_init_firmware", 13008, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", fw_file_name); goto request_firmware_exit; } else { } rc = bnx2x_check_firmware(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Corrupt firmware file %s\n", "bnx2x_init_firmware", 13014, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", fw_file_name); goto request_firmware_exit; } else { } fw_hdr = (struct bnx2x_fw_file_hdr *)(bp->firmware)->data; tmp___0 = __fswab32(fw_hdr->init_data.len); len = tmp___0; tmp___1 = kmalloc((size_t )len, 208U); bp->init_data = (u32 *)tmp___1; if ((unsigned long )bp->init_data == (unsigned long )((u32 *)0U)) { goto request_firmware_exit; } else { } tmp___2 = __fswab32(fw_hdr->init_data.offset); be32_to_cpu_n((bp->firmware)->data + (unsigned long )tmp___2, (u8 *)bp->init_data, len); tmp___3 = __fswab32(fw_hdr->init_ops.len); len___0 = tmp___3; tmp___4 = kmalloc((size_t )len___0, 208U); bp->init_ops = (struct raw_op *)tmp___4; if ((unsigned long )bp->init_ops == (unsigned long )((struct raw_op *)0)) { goto init_ops_alloc_err; } else { } tmp___5 = __fswab32(fw_hdr->init_ops.offset); bnx2x_prep_ops((bp->firmware)->data + (unsigned long )tmp___5, (u8 *)bp->init_ops, len___0); tmp___6 = __fswab32(fw_hdr->init_ops_offsets.len); len___1 = tmp___6; tmp___7 = kmalloc((size_t )len___1, 208U); bp->init_ops_offsets = (u16 *)tmp___7; if ((unsigned long )bp->init_ops_offsets == (unsigned long )((u16 *)0U)) { goto init_offsets_alloc_err; } else { } tmp___8 = __fswab32(fw_hdr->init_ops_offsets.offset); be16_to_cpu_n((bp->firmware)->data + (unsigned long )tmp___8, (u8 *)bp->init_ops_offsets, len___1); tmp___9 = __fswab32(fw_hdr->tsem_int_table_data.offset); bp->tsem_int_table_data = (bp->firmware)->data + (unsigned long )tmp___9; tmp___10 = __fswab32(fw_hdr->tsem_pram_data.offset); bp->tsem_pram_data = (bp->firmware)->data + (unsigned long )tmp___10; tmp___11 = __fswab32(fw_hdr->usem_int_table_data.offset); bp->usem_int_table_data = (bp->firmware)->data + (unsigned long )tmp___11; tmp___12 = __fswab32(fw_hdr->usem_pram_data.offset); bp->usem_pram_data = (bp->firmware)->data + (unsigned long )tmp___12; tmp___13 = __fswab32(fw_hdr->xsem_int_table_data.offset); bp->xsem_int_table_data = (bp->firmware)->data + (unsigned long )tmp___13; tmp___14 = __fswab32(fw_hdr->xsem_pram_data.offset); bp->xsem_pram_data = (bp->firmware)->data + (unsigned long )tmp___14; tmp___15 = __fswab32(fw_hdr->csem_int_table_data.offset); bp->csem_int_table_data = (bp->firmware)->data + (unsigned long )tmp___15; tmp___16 = __fswab32(fw_hdr->csem_pram_data.offset); bp->csem_pram_data = (bp->firmware)->data + (unsigned long )tmp___16; tmp___17 = __fswab32(fw_hdr->iro_arr.len); len___2 = tmp___17; tmp___18 = kmalloc((size_t )len___2, 208U); bp->iro_arr = (struct iro const *)tmp___18; if ((unsigned long )bp->iro_arr == (unsigned long )((struct iro const *)0)) { goto iro_alloc_err; } else { } tmp___19 = __fswab32(fw_hdr->iro_arr.offset); bnx2x_prep_iro((bp->firmware)->data + (unsigned long )tmp___19, (u8 *)bp->iro_arr, len___2); return (0); iro_alloc_err: kfree((void const *)bp->init_ops_offsets); init_offsets_alloc_err: kfree((void const *)bp->init_ops); init_ops_alloc_err: kfree((void const *)bp->init_data); request_firmware_exit: release_firmware(bp->firmware); bp->firmware = (struct firmware const *)0; return (rc); } } static void bnx2x_release_firmware(struct bnx2x *bp ) { { kfree((void const *)bp->init_ops_offsets); kfree((void const *)bp->init_ops); kfree((void const *)bp->init_data); release_firmware(bp->firmware); bp->firmware = (struct firmware const *)0; return; } } static struct bnx2x_func_sp_drv_ops bnx2x_func_sp_drv = {& bnx2x_init_hw_common_chip, & bnx2x_init_hw_common, & bnx2x_init_hw_port, & bnx2x_init_hw_func, & bnx2x_reset_common, & bnx2x_reset_port, & bnx2x_reset_func, & bnx2x_gunzip_init, & bnx2x_gunzip_end, & bnx2x_init_firmware, & bnx2x_release_firmware}; void bnx2x__init_func_obj(struct bnx2x *bp ) { { bnx2x_setup_dmae(bp); bnx2x_init_func_obj(bp, & bp->func_obj, (void *)(& (bp->slowpath)->func_rdata), bp->slowpath_mapping + 2632ULL, (void *)(& (bp->slowpath)->func_afex_rdata), bp->slowpath_mapping + 2672ULL, & bnx2x_func_sp_drv); return; } } static int bnx2x_set_qm_cid_count(struct bnx2x *bp ) { int cid_count ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; int __y___3 ; { __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; cid_count = (int )((uint )(((int )bp->igu_sb_cnt - (int )bp->cnic_support) * 3) + (uint )bp->cnic_support * (((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) - ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos) + 2U)); if ((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0)) { cid_count = cid_count + 1024; } else { } if ((unsigned int )bp->cnic_support != 0U) { cid_count = cid_count + 2304; } else { } __y___3 = 1024; return ((((__y___3 + -1) + cid_count) / __y___3) * __y___3); } } static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev , int cnic_cnt ) { int index ; u16 control ; { control = 0U; if ((unsigned int )pdev->msix_cap == 0U) { _dev_info((struct device const *)(& pdev->dev), "no msix capability found\n"); return (cnic_cnt + 1); } else { } _dev_info((struct device const *)(& pdev->dev), "msix capability found\n"); pci_read_config_word((struct pci_dev const *)pdev, (int )pdev->msix_cap + 2, & control); index = (int )control & 2047; return (index); } } static int set_max_cos_est(int chip_id ) { { switch (chip_id) { case 0: ; case 1: ; case 2: ; return (3); case 3: ; case 4: ; return (2); case 6: ; case 7: ; case 9: ; case 10: ; case 12: ; case 13: ; case 18: ; case 19: ; case 14: ; case 16: ; case 17: ; return (3); case 5: ; case 8: ; case 11: ; case 15: ; case 20: ; return (1); default: printk("\vbnx2x: Unknown board_type (%d), aborting\n", chip_id); return (-19); } } } static int set_is_vf(int chip_id ) { { switch (chip_id) { case 5: ; case 8: ; case 11: ; case 15: ; case 20: ; return (1); default: ; return (0); } } } static int bnx2x_send_update_drift_ramrod(struct bnx2x *bp , int drift_dir , int best_val , int best_period ) { struct bnx2x_func_state_params func_params ; struct bnx2x_func_set_timesync_params *set_timesync_params ; int tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; set_timesync_params = & func_params.params.set_timesync; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); __set_bit(7L, (unsigned long volatile *)(& func_params.ramrod_flags)); func_params.f_obj = & bp->func_obj; func_params.cmd = 9; set_timesync_params->drift_adjust_cmd = 1U; set_timesync_params->offset_cmd = 0U; set_timesync_params->add_sub_drift_adjust_value = drift_dir != 0; set_timesync_params->drift_adjust_value = (u8 )best_val; set_timesync_params->drift_adjust_period = (u32 )best_period; tmp = bnx2x_func_state_change(bp, & func_params); return (tmp); } } static int bnx2x_ptp_adjfreq(struct ptp_clock_info *ptp , s32 ppb ) { struct bnx2x *bp ; struct ptp_clock_info const *__mptr ; int rc ; int drift_dir ; int val ; int period ; int period1 ; int period2 ; int dif ; int dif1 ; int dif2 ; int best_dif ; int best_period ; int best_val ; long tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; long tmp___3 ; { __mptr = (struct ptp_clock_info const *)ptp; bp = (struct bnx2x *)__mptr + 0xffffffffffffdef0UL; drift_dir = 1; best_dif = 31000000; best_period = 0; best_val = 0; tmp = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]PTP adjfreq called, ppb = %d\n", "bnx2x_ptp_adjfreq", 13246, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ppb); } else { } tmp___1 = netif_running((struct net_device const *)bp->dev); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PTP adjfreq called while the interface is down\n", "bnx2x_ptp_adjfreq", 13250, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-14); } else { } if (ppb < 0) { ppb = - ppb; drift_dir = 0; } else { } if (ppb == 0) { best_val = 1; best_period = 33554431; } else if (ppb > 30999999) { best_val = 31; best_period = 1; } else { val = 0; goto ldv_65701; ldv_65700: ; if ((val & 7) == 0) { goto ldv_65699; } else { } period1 = (val * 1000000) / ppb; period2 = period1 + 1; if (period1 != 0) { dif1 = ppb - (val * 1000000) / period1; } else { dif1 = 31000000; } if (dif1 < 0) { dif1 = - dif1; } else { } dif2 = ppb - (val * 1000000) / period2; if (dif2 < 0) { dif2 = - dif2; } else { } dif = dif1 < dif2 ? dif1 : dif2; period = dif1 < dif2 ? period1 : period2; if (dif < best_dif) { best_dif = dif; best_val = val; best_period = period; } else { } ldv_65699: val = val + 1; ldv_65701: ; if (val <= 31) { goto ldv_65700; } else { } } rc = bnx2x_send_update_drift_ramrod(bp, drift_dir, best_val, best_period); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to set drift\n", "bnx2x_ptp_adjfreq", 13296, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-14); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Configured val = %d, period = %d\n", "bnx2x_ptp_adjfreq", 13301, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", best_val, best_period); } else { } return (0); } } static int bnx2x_ptp_adjtime(struct ptp_clock_info *ptp , s64 delta ) { struct bnx2x *bp ; struct ptp_clock_info const *__mptr ; long tmp ; { __mptr = (struct ptp_clock_info const *)ptp; bp = (struct bnx2x *)__mptr + 0xffffffffffffdef0UL; tmp = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]PTP adjtime called, delta = %llx\n", "bnx2x_ptp_adjtime", 13310, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", delta); } else { } timecounter_adjtime(& bp->timecounter, delta); return (0); } } static int bnx2x_ptp_gettime(struct ptp_clock_info *ptp , struct timespec *ts ) { struct bnx2x *bp ; struct ptp_clock_info const *__mptr ; u64 ns ; long tmp ; { __mptr = (struct ptp_clock_info const *)ptp; bp = (struct bnx2x *)__mptr + 0xffffffffffffdef0UL; ns = timecounter_read(& bp->timecounter); tmp = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]PTP gettime called, ns = %llu\n", "bnx2x_ptp_gettime", 13324, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ns); } else { } *ts = ns_to_timespec((s64 const )ns); return (0); } } static int bnx2x_ptp_settime(struct ptp_clock_info *ptp , struct timespec const *ts ) { struct bnx2x *bp ; struct ptp_clock_info const *__mptr ; u64 ns ; s64 tmp ; long tmp___0 ; { __mptr = (struct ptp_clock_info const *)ptp; bp = (struct bnx2x *)__mptr + 0xffffffffffffdef0UL; tmp = timespec_to_ns(ts); ns = (u64 )tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PTP settime called, ns = %llu\n", "bnx2x_ptp_settime", 13339, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ns); } else { } timecounter_init(& bp->timecounter, (struct cyclecounter const *)(& bp->cyclecounter), ns); return (0); } } static int bnx2x_ptp_enable(struct ptp_clock_info *ptp , struct ptp_clock_request *rq , int on ) { struct bnx2x *bp ; struct ptp_clock_info const *__mptr ; { __mptr = (struct ptp_clock_info const *)ptp; bp = (struct bnx2x *)__mptr + 0xffffffffffffdef0UL; printk("\vbnx2x: [%s:%d(%s)]PHC ancillary features are not supported\n", "bnx2x_ptp_enable", 13353, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-524); } } static void bnx2x_register_phc(struct bnx2x *bp ) { bool tmp ; { bp->ptp_clock_info.owner = & __this_module; snprintf((char *)(& bp->ptp_clock_info.name), 16UL, "%s", (char *)(& (bp->dev)->name)); bp->ptp_clock_info.max_adj = 31000000; bp->ptp_clock_info.n_alarm = 0; bp->ptp_clock_info.n_ext_ts = 0; bp->ptp_clock_info.n_per_out = 0; bp->ptp_clock_info.pps = 0; bp->ptp_clock_info.adjfreq = & bnx2x_ptp_adjfreq; bp->ptp_clock_info.adjtime = & bnx2x_ptp_adjtime; bp->ptp_clock_info.gettime64 = & bnx2x_ptp_gettime; bp->ptp_clock_info.settime64 = & bnx2x_ptp_settime; bp->ptp_clock_info.enable = & bnx2x_ptp_enable; bp->ptp_clock = ptp_clock_register(& bp->ptp_clock_info, & (bp->pdev)->dev); tmp = IS_ERR((void const *)bp->ptp_clock); if ((int )tmp) { bp->ptp_clock = (struct ptp_clock *)0; printk("\vbnx2x: [%s:%d(%s)]PTP clock registeration failed\n", "bnx2x_register_phc", 13376, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static int bnx2x_init_one(struct pci_dev *pdev , struct pci_device_id const *ent ) { struct net_device *dev ; struct bnx2x *bp ; enum pcie_link_width pcie_width ; enum pci_bus_speed pcie_speed ; int rc ; int max_non_def_sbs ; int rx_count ; int tx_count ; int rss_count ; int doorbell_size ; int max_cos_est ; bool is_vf ; int cnic_cnt ; ktime_t now ; ktime_t tmp ; ktime_t fw_ready_time ; ktime_t tmp___0 ; s64 tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; void *tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; long tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; long tmp___14 ; int tmp___15 ; int tmp___16 ; { dev = (struct net_device *)0; tmp___3 = is_kdump_kernel(); if (tmp___3 != 0) { tmp = ktime_get_boottime(); now = tmp; tmp___0 = ktime_set(5LL, 0UL); fw_ready_time = tmp___0; tmp___2 = ktime_before(now, fw_ready_time); if ((int )tmp___2) { tmp___1 = ktime_ms_delta(fw_ready_time, now); msleep((unsigned int )tmp___1); } else { } } else { } max_cos_est = set_max_cos_est((int )ent->driver_data); if (max_cos_est < 0) { return (max_cos_est); } else { } tmp___4 = set_is_vf((int )ent->driver_data); is_vf = tmp___4 != 0; cnic_cnt = (int )is_vf ? 0 : 1; max_non_def_sbs = bnx2x_get_num_non_def_sbs(pdev, cnic_cnt); max_non_def_sbs = (int )is_vf + max_non_def_sbs; rss_count = max_non_def_sbs - cnic_cnt; if (rss_count <= 0) { return (-22); } else { } rx_count = rss_count + cnic_cnt; tx_count = rss_count * max_cos_est + cnic_cnt; dev = alloc_etherdev_mqs(8760, (unsigned int )tx_count, (unsigned int )rx_count); if ((unsigned long )dev == (unsigned long )((struct net_device *)0)) { return (-12); } else { } tmp___5 = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp___5; bp->flags = 0U; if ((int )is_vf) { bp->flags = bp->flags | 4194304U; } else { } bp->igu_sb_cnt = (u8 )max_non_def_sbs; bp->igu_base_addr = (bp->flags & 4194304U) != 0U ? 0U : 4456448U; bp->msg_enable = debug; bp->cnic_support = (u8 )cnic_cnt; bp->cnic_probe = & bnx2x_cnic_probe; pci_set_drvdata(pdev, (void *)dev); rc = bnx2x_init_dev(bp, pdev, dev, ent->driver_data); if (rc < 0) { ldv_free_netdev_17(dev); return (rc); } else { } tmp___6 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___6 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "This is a %s function\n", (bp->flags & 4194304U) == 0U ? (char *)"physical" : (char *)"virtual"); } else { } tmp___7 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___7 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Cnic support is %s\n", (unsigned int )bp->cnic_support != 0U ? (char *)"on" : (char *)"off"); } else { } tmp___8 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___8 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Max num of status blocks %d\n", max_non_def_sbs); } else { } tmp___9 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___9 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Allocated netdev with %d tx and %d rx queues\n", tx_count, rx_count); } else { } rc = bnx2x_init_bp(bp); if (rc != 0) { goto init_one_exit; } else { } if ((bp->flags & 4194304U) != 0U) { bp->doorbells = bnx2x_vf_doorbells(bp); rc = bnx2x_vf_pci_alloc(bp); if (rc != 0) { goto init_one_exit; } else { } } else { __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; doorbell_size = (int )(((uint )(((int )bp->igu_sb_cnt - (int )bp->cnic_support) * 3) + (uint )bp->cnic_support * (((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) - ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos) + 2U)) * 8U); if ((resource_size_t )doorbell_size > (pdev->resource[2].start != 0ULL || pdev->resource[2].end != pdev->resource[2].start ? (pdev->resource[2].end - pdev->resource[2].start) + 1ULL : 0ULL)) { dev_err((struct device const *)(& (bp->pdev)->dev), "Cannot map doorbells, bar size too small, aborting\n"); rc = -12; goto init_one_exit; } else { } bp->doorbells = ioremap_nocache(pdev->resource[2].start, (unsigned long )doorbell_size); } if ((unsigned long )bp->doorbells == (unsigned long )((void *)0)) { dev_err((struct device const *)(& (bp->pdev)->dev), "Cannot map doorbell space, aborting\n"); rc = -12; goto init_one_exit; } else { } if ((bp->flags & 4194304U) != 0U) { rc = bnx2x_vfpf_acquire(bp, (int )((u8 )tx_count), (int )((u8 )rx_count)); if (rc != 0) { goto init_one_exit; } else { } } else { } rc = bnx2x_iov_init_one(bp, int_mode, 64); if (rc != 0) { goto init_one_exit; } else { } bp->qm_cid_count = bnx2x_set_qm_cid_count(bp); tmp___10 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___10 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "qm_cid_count %d\n", bp->qm_cid_count); } else { } if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { bp->flags = bp->flags | 32768U; } else { } bnx2x_set_num_queues(bp); rc = bnx2x_set_int_mode(bp); if (rc != 0) { dev_err((struct device const *)(& pdev->dev), "Cannot set interrupts\n"); goto init_one_exit; } else { } tmp___11 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___11 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "set interrupts successfully\n"); } else { } rc = ldv_register_netdev_18(dev); if (rc != 0) { dev_err((struct device const *)(& pdev->dev), "Cannot register net device\n"); goto init_one_exit; } else { } tmp___12 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___12 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "device name after netdev register %s\n", (char *)(& dev->name)); } else { } if ((bp->flags & 32768U) == 0U) { rtnl_lock(); dev_addr_add(bp->dev, (unsigned char const *)(& bp->fip_mac), 2); rtnl_unlock(); } else { } tmp___15 = pcie_get_minimum_link(bp->pdev, & pcie_speed, & pcie_width); if ((tmp___15 != 0 || (unsigned int )pcie_speed == 255U) || (unsigned int )pcie_width == 255U) { tmp___13 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___13 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Failed to determine PCI Express Bandwidth\n"); } else { } } else { tmp___14 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___14 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "%s (%c%d) PCI-E x%d %s found at mem %lx, IRQ %d, node addr %pM\n", board_info[ent->driver_data].name, (bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) + 65U : ((bp->common.chip_id & 61440U) >> 12) + 65U, (bp->common.chip_id & 4080U) >> 4, (unsigned int )pcie_width, (unsigned int )pcie_speed != 20U ? ((unsigned int )pcie_speed != 21U ? ((unsigned int )pcie_speed == 22U ? (char *)"8.0GHz" : (char *)"Unknown") : (char *)"5.0GHz") : (char *)"2.5GHz", dev->base_addr, (bp->pdev)->irq, dev->dev_addr); } else { } } bnx2x_register_phc(bp); return (0); init_one_exit: bnx2x_disable_pcie_error_reporting(bp); if ((unsigned long )bp->regview != (unsigned long )((void *)0)) { iounmap((void volatile *)bp->regview); } else { } if ((bp->flags & 4194304U) == 0U && (unsigned long )bp->doorbells != (unsigned long )((void *)0)) { iounmap((void volatile *)bp->doorbells); } else { } ldv_free_netdev_19(dev); tmp___16 = atomic_read((atomic_t const *)(& pdev->enable_cnt)); if (tmp___16 == 1) { pci_release_regions(pdev); } else { } pci_disable_device(pdev); return (rc); } } static void __bnx2x_remove(struct pci_dev *pdev , struct net_device *dev , struct bnx2x *bp , bool remove_netdev ) { int tmp ; { if ((unsigned long )bp->ptp_clock != (unsigned long )((struct ptp_clock *)0)) { ptp_clock_unregister(bp->ptp_clock); bp->ptp_clock = (struct ptp_clock *)0; } else { } if ((bp->flags & 32768U) == 0U) { rtnl_lock(); dev_addr_del(bp->dev, (unsigned char const *)(& bp->fip_mac), 2); rtnl_unlock(); } else { } bnx2x_dcbnl_update_applist(bp, 1); if (((bp->flags & 4194304U) == 0U && (bp->flags & 512U) == 0U) && (bp->flags & 8388608U) != 0U) { bnx2x_fw_command(bp, 3674210304U, 0U); } else { } if ((int )remove_netdev) { ldv_unregister_netdev_20(dev); } else { rtnl_lock(); dev_close(dev); rtnl_unlock(); } bnx2x_iov_remove_one(bp); if ((bp->flags & 4194304U) == 0U) { bnx2x_set_power_state(bp, 0); bnx2x_reset_endianity(bp); } else { } bnx2x_disable_msi(bp); if ((bp->flags & 4194304U) == 0U) { bnx2x_set_power_state(bp, 3); } else { } ldv_cancel_delayed_work_sync_21(& bp->sp_rtnl_task); if ((bp->flags & 4194304U) != 0U) { bnx2x_vfpf_release(bp); } else { } if ((unsigned int )system_state == 3U) { pci_wake_from_d3(pdev, (unsigned int )bp->wol != 0U); pci_set_power_state(pdev, 3); } else { } bnx2x_disable_pcie_error_reporting(bp); if ((int )remove_netdev) { if ((unsigned long )bp->regview != (unsigned long )((void *)0)) { iounmap((void volatile *)bp->regview); } else { } if ((bp->flags & 4194304U) == 0U) { if ((unsigned long )bp->doorbells != (unsigned long )((void *)0)) { iounmap((void volatile *)bp->doorbells); } else { } bnx2x_release_firmware(bp); } else { bnx2x_vf_pci_dealloc(bp); } bnx2x_free_mem_bp(bp); ldv_free_netdev_22(dev); tmp = atomic_read((atomic_t const *)(& pdev->enable_cnt)); if (tmp == 1) { pci_release_regions(pdev); } else { } pci_disable_device(pdev); } else { } return; } } static void bnx2x_remove_one(struct pci_dev *pdev ) { struct net_device *dev ; void *tmp ; struct bnx2x *bp ; void *tmp___0 ; { tmp = pci_get_drvdata(pdev); dev = (struct net_device *)tmp; if ((unsigned long )dev == (unsigned long )((struct net_device *)0)) { dev_err((struct device const *)(& pdev->dev), "BAD net device from bnx2x_init_one\n"); return; } else { } tmp___0 = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp___0; __bnx2x_remove(pdev, dev, bp, 1); return; } } static int bnx2x_eeh_nic_unload(struct bnx2x *bp ) { int tmp ; { bp->state = 16384U; bp->rx_mode = 0U; if ((int )bp->cnic_loaded) { bnx2x_cnic_notify(bp, 1); } else { } bnx2x_tx_disable(bp); bnx2x_del_all_napi(bp); if ((int )bp->cnic_loaded) { bnx2x_del_all_napi_cnic(bp); } else { } netdev_reset_tc(bp->dev); ldv_del_timer_sync_23(& bp->timer); ldv_cancel_delayed_work_sync_24(& bp->sp_task); ldv_cancel_delayed_work_sync_25(& bp->period_task); tmp = down_timeout(& bp->stats_lock, 25L); if (tmp == 0) { bp->stats_state = 0; up(& bp->stats_lock); } else { } bnx2x_save_statistics(bp); netif_carrier_off(bp->dev); return (0); } } static pci_ers_result_t bnx2x_io_error_detected(struct pci_dev *pdev , pci_channel_state_t state ) { struct net_device *dev ; void *tmp ; struct bnx2x *bp ; void *tmp___0 ; bool tmp___1 ; { tmp = pci_get_drvdata(pdev); dev = (struct net_device *)tmp; tmp___0 = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp___0; rtnl_lock(); printk("\vbnx2x: [%s:%d(%s)]IO error detected\n", "bnx2x_io_error_detected", 13743, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); netif_device_detach(dev); if (state == 3U) { rtnl_unlock(); return (4U); } else { } tmp___1 = netif_running((struct net_device const *)dev); if ((int )tmp___1) { bnx2x_eeh_nic_unload(bp); } else { } bnx2x_prev_path_mark_eeh(bp); pci_disable_device(pdev); rtnl_unlock(); return (3U); } } static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev ) { struct net_device *dev ; void *tmp ; struct bnx2x *bp ; void *tmp___0 ; int i ; int tmp___1 ; bool tmp___2 ; u32 v ; unsigned int tmp___3 ; bool tmp___4 ; long tmp___5 ; int tmp___6 ; { tmp = pci_get_drvdata(pdev); dev = (struct net_device *)tmp; tmp___0 = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp___0; rtnl_lock(); printk("\vbnx2x: [%s:%d(%s)]IO slot reset initializing...\n", "bnx2x_io_slot_reset", 13778, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); tmp___1 = pci_enable_device(pdev); if (tmp___1 != 0) { dev_err((struct device const *)(& pdev->dev), "Cannot re-enable PCI device after reset\n"); rtnl_unlock(); return (4U); } else { } pci_set_master(pdev); pci_restore_state(pdev); pci_save_state(pdev); tmp___2 = netif_running((struct net_device const *)dev); if ((int )tmp___2) { bnx2x_set_power_state(bp, 0); } else { } tmp___4 = netif_running((struct net_device const *)dev); if ((int )tmp___4) { printk("\vbnx2x: [%s:%d(%s)]IO slot reset --> driver unload\n", "bnx2x_io_slot_reset", 13794, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_init_shmem(bp); if ((bp->flags & 4194304U) == 0U) { if (bp->common.shmem2_base != 0U) { tmp___3 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___3 > 224U) { v = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 56UL) * 4UL))); writel(v & 4294967293U, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 56UL) * 4UL))); } else { } } else { } } else { } bnx2x_drain_tx_queues(bp); bnx2x_send_unload_req(bp, 2); bnx2x_netif_stop(bp, 1); bnx2x_free_irq(bp); bnx2x_send_unload_done(bp, 1); bp->sp_state = 0UL; bp->port.pmf = 0U; bnx2x_prev_unload(bp); bnx2x_squeeze_objects(bp); bnx2x_free_skbs(bp); i = 0; goto ldv_65801; ldv_65800: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_free_rx_sge_range(bp, bp->fp + (unsigned long )i, 1024); } i = i + 1; ldv_65801: ; if (bp->num_queues > i) { goto ldv_65800; } else { } bnx2x_free_fp_mem(bp); bnx2x_free_mem(bp); bp->state = 0U; } else { } rtnl_unlock(); if ((bp->flags & 33554432U) != 0U) { tmp___6 = pci_cleanup_aer_uncorrect_error_status(pdev); if (tmp___6 != 0) { printk("\vbnx2x: [%s:%d(%s)]pci_cleanup_aer_uncorrect_error_status failed\n", "bnx2x_io_slot_reset", 13838, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { tmp___5 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pci_cleanup_aer_uncorrect_error_status succeeded\n", "bnx2x_io_slot_reset", 13840, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } } else { } return (5U); } } static void bnx2x_io_resume(struct pci_dev *pdev ) { struct net_device *dev ; void *tmp ; struct bnx2x *bp ; void *tmp___0 ; unsigned int tmp___1 ; bool tmp___2 ; { tmp = pci_get_drvdata(pdev); dev = (struct net_device *)tmp; tmp___0 = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp___0; if ((unsigned int )bp->recovery_state != 0U) { netdev_err((struct net_device const *)bp->dev, "Handling parity error recovery. Try again later\n"); return; } else { } rtnl_lock(); tmp___1 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) * 44UL) + 1668UL))); bp->fw_seq = (u16 )tmp___1; tmp___2 = netif_running((struct net_device const *)dev); if ((int )tmp___2) { bnx2x_nic_load(bp, 0); } else { } netif_device_attach(dev); rtnl_unlock(); return; } } static struct pci_error_handlers const bnx2x_err_handler = {(pci_ers_result_t (*)(struct pci_dev * , enum pci_channel_state ))(& bnx2x_io_error_detected), 0, 0, & bnx2x_io_slot_reset, 0, & bnx2x_io_resume}; static void bnx2x_shutdown(struct pci_dev *pdev ) { struct net_device *dev ; void *tmp ; struct bnx2x *bp ; void *tmp___0 ; { tmp = pci_get_drvdata(pdev); dev = (struct net_device *)tmp; if ((unsigned long )dev == (unsigned long )((struct net_device *)0)) { return; } else { } tmp___0 = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp___0; if ((unsigned long )bp == (unsigned long )((struct bnx2x *)0)) { return; } else { } rtnl_lock(); netif_device_detach(dev); rtnl_unlock(); __bnx2x_remove(pdev, dev, bp, 0); return; } } static struct pci_driver bnx2x_pci_driver = {{0, 0}, "bnx2x", (struct pci_device_id const *)(& bnx2x_pci_tbl), & bnx2x_init_one, & bnx2x_remove_one, & bnx2x_suspend, 0, 0, & bnx2x_resume, & bnx2x_shutdown, & bnx2x_sriov_configure, & bnx2x_err_handler, {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 int bnx2x_init(void) { int ret ; struct lock_class_key __key ; char const *__lock_name ; struct workqueue_struct *tmp ; struct lock_class_key __key___0 ; char const *__lock_name___0 ; struct workqueue_struct *tmp___0 ; { printk("\016bnx2x: %s", (char *)(& version)); __lock_name = "\"%s\"\"bnx2x\""; tmp = __alloc_workqueue_key("%s", 131082U, 1, & __key, __lock_name, (char *)"bnx2x"); bnx2x_wq = tmp; if ((unsigned long )bnx2x_wq == (unsigned long )((struct workqueue_struct *)0)) { printk("\vbnx2x: Cannot create workqueue\n"); return (-12); } else { } __lock_name___0 = "\"%s\"\"bnx2x_iov\""; tmp___0 = __alloc_workqueue_key("%s", 131082U, 1, & __key___0, __lock_name___0, (char *)"bnx2x_iov"); bnx2x_iov_wq = tmp___0; if ((unsigned long )bnx2x_iov_wq == (unsigned long )((struct workqueue_struct *)0)) { printk("\vbnx2x: Cannot create iov workqueue\n"); ldv_destroy_workqueue_26(bnx2x_wq); return (-12); } else { } ret = ldv___pci_register_driver_27(& bnx2x_pci_driver, & __this_module, "bnx2x"); if (ret != 0) { printk("\vbnx2x: Cannot register driver\n"); ldv_destroy_workqueue_28(bnx2x_wq); ldv_destroy_workqueue_29(bnx2x_iov_wq); } else { } return (ret); } } static void bnx2x_cleanup(void) { struct list_head *pos ; struct list_head *q ; struct bnx2x_prev_path_list *tmp ; struct list_head const *__mptr ; { ldv_pci_unregister_driver_30(& bnx2x_pci_driver); ldv_destroy_workqueue_31(bnx2x_wq); ldv_destroy_workqueue_32(bnx2x_iov_wq); pos = bnx2x_prev_list.next; q = pos->next; goto ldv_65834; ldv_65833: __mptr = (struct list_head const *)pos; tmp = (struct bnx2x_prev_path_list *)__mptr; list_del(pos); kfree((void const *)tmp); pos = q; q = pos->next; ldv_65834: ; if ((unsigned long )pos != (unsigned long )(& bnx2x_prev_list)) { goto ldv_65833; } else { } return; } } void bnx2x_notify_link_changed(struct bnx2x *bp ) { { writel(1U, (void volatile *)(bp->regview + ((unsigned long )bp->pfid + 10252UL) * 4UL)); return; } } static int bnx2x_set_iscsi_eth_mac_addr(struct bnx2x *bp ) { unsigned long ramrod_flags ; int tmp ; { ramrod_flags = 0UL; __set_bit(2L, (unsigned long volatile *)(& ramrod_flags)); tmp = bnx2x_set_mac_one(bp, (u8 *)(& bp->cnic_eth_dev.iscsi_mac), & bp->iscsi_l2_mac_obj, 1, 2, & ramrod_flags); return (tmp); } } static void bnx2x_cnic_sp_post(struct bnx2x *bp , int count ) { struct eth_spe *spe ; int cxt_index ; int cxt_offset ; long tmp ; u16 type ; u8 cmd ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; int __y___3 ; int __y___4 ; int __y___5 ; int __y___6 ; int __y___7 ; int __y___8 ; int __y___9 ; int __y___10 ; int tmp___0 ; int tmp___1 ; long tmp___2 ; { spin_lock_bh(& bp->spq_lock); tmp = ldv__builtin_expect((int )bp->cnic_spq_pending < count, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c"), "i" (14003), "i" (12UL)); ldv_65860: ; goto ldv_65860; } else { } bp->cnic_spq_pending = (int )bp->cnic_spq_pending - (int )((u16 )count); goto ldv_65890; ldv_65889: type = (unsigned int )(bp->cnic_kwq_cons)->hdr.type & 255U; cmd = (u8 )((bp->cnic_kwq_cons)->hdr.conn_and_cmd_data >> 24); if ((unsigned int )type == 0U) { if ((unsigned int )cmd == 1U) { __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; cxt_index = (int )((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) / 32U); __y___3 = 8; __y___4 = 8; __y___5 = 8; __y___6 = 8; cxt_offset = (int )((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___3) + 4294967295U) / (uint )__y___3) * (uint )__y___3 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___4) + 4294967295U) / (uint )__y___4) * (uint )__y___4 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___5) + 4294967295U) / (uint )__y___5) * (uint )__y___5 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___6) + 4294967295U) / (uint )__y___6) * (uint )__y___6 + 8U) & 15U) == 8U ? 16U : 0U)) - (unsigned int )((unsigned long )cxt_index) * 32U); __y___7 = 8; __y___8 = 8; __y___9 = 8; __y___10 = 8; bnx2x_set_ctx_validation(bp, & (bp->context[cxt_index].vcxt + (unsigned long )cxt_offset)->eth, ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___7) + 4294967295U) / (uint )__y___7) * (uint )__y___7 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___8) + 4294967295U) / (uint )__y___8) * (uint )__y___8 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___9) + 4294967295U) / (uint )__y___9) * (uint )__y___9 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___10) + 4294967295U) / (uint )__y___10) * (uint )__y___10 + 8U) & 15U) == 8U ? 16U : 0U)); } else { } } else { } if ((unsigned int )type == 0U) { tmp___0 = atomic_read((atomic_t const *)(& bp->cq_spq_left)); if (tmp___0 == 0) { goto ldv_65887; } else { atomic_dec(& bp->cq_spq_left); } } else if ((unsigned int )type == 8U) { tmp___1 = atomic_read((atomic_t const *)(& bp->eq_spq_left)); if (tmp___1 == 0) { goto ldv_65887; } else { atomic_dec(& bp->eq_spq_left); } } else if ((unsigned int )type == 3U || (unsigned int )type == 4U) { if ((u32 )bp->cnic_spq_pending >= bp->cnic_eth_dev.max_kwqe_pending) { goto ldv_65887; } else { bp->cnic_spq_pending = (u16 )((int )bp->cnic_spq_pending + 1); } } else { printk("\vbnx2x: [%s:%d(%s)]Unknown SPE type: %d\n", "bnx2x_cnic_sp_post", 14053, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )type); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_cnic_sp_post", 14054, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); goto ldv_65887; } spe = bnx2x_sp_get_next(bp); *spe = *(bp->cnic_kwq_cons); tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pending on SPQ %d, on KWQ %d count %d\n", "bnx2x_cnic_sp_post", 14062, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->cnic_spq_pending, (int )bp->cnic_kwq_pending, count); } else { } if ((unsigned long )bp->cnic_kwq_cons == (unsigned long )bp->cnic_kwq_last) { bp->cnic_kwq_cons = bp->cnic_kwq; } else { bp->cnic_kwq_cons = bp->cnic_kwq_cons + 1; } bp->cnic_kwq_pending = (u16 )((int )bp->cnic_kwq_pending - 1); ldv_65890: ; if ((unsigned int )bp->cnic_kwq_pending != 0U) { goto ldv_65889; } else { } ldv_65887: bnx2x_sp_prod_update(bp); spin_unlock_bh(& bp->spq_lock); return; } } static int bnx2x_cnic_sp_queue(struct net_device *dev , struct kwqe_16 **kwqes , u32 count ) { struct bnx2x *bp ; void *tmp ; int i ; struct eth_spe *spe ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((unsigned int )bp->recovery_state != 0U && (unsigned int )bp->recovery_state != 4U) { printk("\vbnx2x: [%s:%d(%s)]Handling parity error recovery. Try again later\n", "bnx2x_cnic_sp_queue", 14088, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-11); } else { } spin_lock_bh(& bp->spq_lock); i = 0; goto ldv_65902; ldv_65901: spe = (struct eth_spe *)*(kwqes + (unsigned long )i); if ((unsigned int )bp->cnic_kwq_pending == 255U) { goto ldv_65900; } else { } *(bp->cnic_kwq_prod) = *spe; bp->cnic_kwq_pending = (u16 )((int )bp->cnic_kwq_pending + 1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]L5 SPQE %x %x %x:%x pos %d\n", "bnx2x_cnic_sp_queue", 14108, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", spe->hdr.conn_and_cmd_data, (int )spe->hdr.type, spe->data.update_data_addr.hi, spe->data.update_data_addr.lo, (int )bp->cnic_kwq_pending); } else { } if ((unsigned long )bp->cnic_kwq_prod == (unsigned long )bp->cnic_kwq_last) { bp->cnic_kwq_prod = bp->cnic_kwq; } else { bp->cnic_kwq_prod = bp->cnic_kwq_prod + 1; } i = i + 1; ldv_65902: ; if ((u32 )i < count) { goto ldv_65901; } else { } ldv_65900: spin_unlock_bh(& bp->spq_lock); if ((u32 )bp->cnic_spq_pending < bp->cnic_eth_dev.max_kwqe_pending) { bnx2x_cnic_sp_post(bp, 0); } else { } return (i); } } static int bnx2x_cnic_ctl_send(struct bnx2x *bp , struct cnic_ctl_info *ctl ) { struct cnic_ops *c_ops ; int rc ; bool __warned ; int tmp ; int tmp___0 ; { rc = 0; mutex_lock_nested(& bp->cnic_mutex, 0U); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = lock_is_held(& bp->cnic_mutex.dep_map); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 14131, "suspicious rcu_dereference_protected() usage"); } else { } } else { } c_ops = bp->cnic_ops; if ((unsigned long )c_ops != (unsigned long )((struct cnic_ops *)0)) { rc = (*(c_ops->cnic_ctl))(bp->cnic_data, ctl); } else { } mutex_unlock(& bp->cnic_mutex); return (rc); } } static int bnx2x_cnic_ctl_send_bh(struct bnx2x *bp , struct cnic_ctl_info *ctl ) { struct cnic_ops *c_ops ; int rc ; struct cnic_ops *________p1 ; struct cnic_ops *_________p1 ; union __anonunion___u_442 __u ; bool __warned ; int tmp ; int tmp___0 ; { rc = 0; rcu_read_lock(); __read_once_size((void const volatile *)(& bp->cnic_ops), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_held(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", 14145, "suspicious rcu_dereference_check() usage"); } else { } } else { } c_ops = ________p1; if ((unsigned long )c_ops != (unsigned long )((struct cnic_ops *)0)) { rc = (*(c_ops->cnic_ctl))(bp->cnic_data, ctl); } else { } rcu_read_unlock(); return (rc); } } int bnx2x_cnic_notify(struct bnx2x *bp , int cmd ) { struct cnic_ctl_info ctl ; int tmp ; { ctl.cmd = 0; ctl.data.bytes[0] = (char)0; ctl.data.bytes[1] = (char)0; ctl.data.bytes[2] = (char)0; ctl.data.bytes[3] = (char)0; ctl.data.bytes[4] = (char)0; ctl.data.bytes[5] = (char)0; ctl.data.bytes[6] = (char)0; ctl.data.bytes[7] = (char)0; ctl.data.bytes[8] = (char)0; ctl.data.bytes[9] = (char)0; ctl.data.bytes[10] = (char)0; ctl.data.bytes[11] = (char)0; ctl.data.bytes[12] = (char)0; ctl.data.bytes[13] = (char)0; ctl.data.bytes[14] = (char)0; ctl.data.bytes[15] = (char)0; ctl.data.bytes[16] = (char)0; ctl.data.bytes[17] = (char)0; ctl.data.bytes[18] = (char)0; ctl.data.bytes[19] = (char)0; ctl.data.bytes[20] = (char)0; ctl.data.bytes[21] = (char)0; ctl.data.bytes[22] = (char)0; ctl.data.bytes[23] = (char)0; ctl.data.bytes[24] = (char)0; ctl.data.bytes[25] = (char)0; ctl.data.bytes[26] = (char)0; ctl.data.bytes[27] = (char)0; ctl.data.bytes[28] = (char)0; ctl.data.bytes[29] = (char)0; ctl.data.bytes[30] = (char)0; ctl.data.bytes[31] = (char)0; ctl.data.bytes[32] = (char)0; ctl.data.bytes[33] = (char)0; ctl.data.bytes[34] = (char)0; ctl.data.bytes[35] = (char)0; ctl.data.bytes[36] = (char)0; ctl.data.bytes[37] = (char)0; ctl.data.bytes[38] = (char)0; ctl.data.bytes[39] = (char)0; ctl.data.bytes[40] = (char)0; ctl.data.bytes[41] = (char)0; ctl.data.bytes[42] = (char)0; ctl.data.bytes[43] = (char)0; ctl.data.bytes[44] = (char)0; ctl.data.bytes[45] = (char)0; ctl.data.bytes[46] = (char)0; ctl.data.bytes[47] = (char)0; ctl.data.bytes[48] = (char)0; ctl.data.bytes[49] = (char)0; ctl.data.bytes[50] = (char)0; ctl.data.bytes[51] = (char)0; ctl.data.bytes[52] = (char)0; ctl.data.bytes[53] = (char)0; ctl.data.bytes[54] = (char)0; ctl.data.bytes[55] = (char)0; ctl.data.bytes[56] = (char)0; ctl.data.bytes[57] = (char)0; ctl.data.bytes[58] = (char)0; ctl.data.bytes[59] = (char)0; ctl.data.bytes[60] = (char)0; ctl.data.bytes[61] = (char)0; ctl.data.bytes[62] = (char)0; ctl.data.bytes[63] = (char)0; ctl.cmd = cmd; tmp = bnx2x_cnic_ctl_send(bp, & ctl); return (tmp); } } static void bnx2x_cnic_cfc_comp(struct bnx2x *bp , int cid , u8 err ) { struct cnic_ctl_info ctl ; { ctl.cmd = 0; ctl.data.bytes[0] = (char)0; ctl.data.bytes[1] = (char)0; ctl.data.bytes[2] = (char)0; ctl.data.bytes[3] = (char)0; ctl.data.bytes[4] = (char)0; ctl.data.bytes[5] = (char)0; ctl.data.bytes[6] = (char)0; ctl.data.bytes[7] = (char)0; ctl.data.bytes[8] = (char)0; ctl.data.bytes[9] = (char)0; ctl.data.bytes[10] = (char)0; ctl.data.bytes[11] = (char)0; ctl.data.bytes[12] = (char)0; ctl.data.bytes[13] = (char)0; ctl.data.bytes[14] = (char)0; ctl.data.bytes[15] = (char)0; ctl.data.bytes[16] = (char)0; ctl.data.bytes[17] = (char)0; ctl.data.bytes[18] = (char)0; ctl.data.bytes[19] = (char)0; ctl.data.bytes[20] = (char)0; ctl.data.bytes[21] = (char)0; ctl.data.bytes[22] = (char)0; ctl.data.bytes[23] = (char)0; ctl.data.bytes[24] = (char)0; ctl.data.bytes[25] = (char)0; ctl.data.bytes[26] = (char)0; ctl.data.bytes[27] = (char)0; ctl.data.bytes[28] = (char)0; ctl.data.bytes[29] = (char)0; ctl.data.bytes[30] = (char)0; ctl.data.bytes[31] = (char)0; ctl.data.bytes[32] = (char)0; ctl.data.bytes[33] = (char)0; ctl.data.bytes[34] = (char)0; ctl.data.bytes[35] = (char)0; ctl.data.bytes[36] = (char)0; ctl.data.bytes[37] = (char)0; ctl.data.bytes[38] = (char)0; ctl.data.bytes[39] = (char)0; ctl.data.bytes[40] = (char)0; ctl.data.bytes[41] = (char)0; ctl.data.bytes[42] = (char)0; ctl.data.bytes[43] = (char)0; ctl.data.bytes[44] = (char)0; ctl.data.bytes[45] = (char)0; ctl.data.bytes[46] = (char)0; ctl.data.bytes[47] = (char)0; ctl.data.bytes[48] = (char)0; ctl.data.bytes[49] = (char)0; ctl.data.bytes[50] = (char)0; ctl.data.bytes[51] = (char)0; ctl.data.bytes[52] = (char)0; ctl.data.bytes[53] = (char)0; ctl.data.bytes[54] = (char)0; ctl.data.bytes[55] = (char)0; ctl.data.bytes[56] = (char)0; ctl.data.bytes[57] = (char)0; ctl.data.bytes[58] = (char)0; ctl.data.bytes[59] = (char)0; ctl.data.bytes[60] = (char)0; ctl.data.bytes[61] = (char)0; ctl.data.bytes[62] = (char)0; ctl.data.bytes[63] = (char)0; ctl.cmd = 3; ctl.data.comp.cid = (u32 )cid; ctl.data.comp.error = err; bnx2x_cnic_ctl_send_bh(bp, & ctl); bnx2x_cnic_sp_post(bp, 0); return; } } static void bnx2x_set_iscsi_eth_rx_mode(struct bnx2x *bp , bool start ) { unsigned long accept_flags ; unsigned long ramrod_flags ; u8 cl_id ; u8 tmp ; int sched_state ; int tmp___0 ; { accept_flags = 0UL; ramrod_flags = 0UL; tmp = bnx2x_cnic_eth_cl_id(bp, 0); cl_id = tmp; sched_state = 6; if ((int )start) { __set_bit(0L, (unsigned long volatile *)(& accept_flags)); __set_bit(3L, (unsigned long volatile *)(& accept_flags)); __set_bit(4L, (unsigned long volatile *)(& accept_flags)); __set_bit(6L, (unsigned long volatile *)(& accept_flags)); clear_bit(6L, (unsigned long volatile *)(& bp->sp_state)); sched_state = 5; } else { clear_bit(5L, (unsigned long volatile *)(& bp->sp_state)); } tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)(& bp->sp_state)); if (tmp___0 != 0) { set_bit((long )sched_state, (unsigned long volatile *)(& bp->sp_state)); } else { __set_bit(1L, (unsigned long volatile *)(& ramrod_flags)); bnx2x_set_q_rx_mode(bp, (int )cl_id, 0UL, accept_flags, 0UL, ramrod_flags); } return; } } static int bnx2x_drv_ctl(struct net_device *dev , struct drv_ctl_info *ctl ) { struct bnx2x *bp ; void *tmp ; int rc ; u32 index ; dma_addr_t addr ; int count ; struct cnic_eth_dev *cp ; unsigned long sp_bits ; bool tmp___0 ; int tmp___1 ; unsigned long sp_bits___0 ; bool tmp___2 ; int tmp___3 ; int count___0 ; int ulp_type ; int idx ; u32 cap ; unsigned int tmp___4 ; int path ; int port ; int i ; u32 scratch_offset ; u32 *host_addr ; unsigned int tmp___5 ; int ulp_type___0 ; int idx___0 ; u32 cap___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; rc = 0; switch (ctl->cmd) { case 260: index = ctl->data.io.offset; addr = ctl->data.io.dma_addr; bnx2x_ilt_wr(bp, index, addr); goto ldv_65955; case 261: count = (int )ctl->data.credit.credit_count; bnx2x_cnic_sp_post(bp, count); goto ldv_65955; case 262: cp = & bp->cnic_eth_dev; sp_bits = 0UL; bnx2x_init_mac_obj(bp, & bp->iscsi_l2_mac_obj, (int )((u8 )cp->iscsi_l2_client_id), (u32 )cp->iscsi_l2_cid, (int )bp->pfid, (void *)(& (bp->slowpath)->mac_rdata), bp->slowpath_mapping, 0, & bp->sp_state, 0, & bp->macs_pool); rc = bnx2x_set_iscsi_eth_mac_addr(bp); if (rc != 0) { goto ldv_65955; } else { } __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); netif_addr_lock_bh(dev); bnx2x_set_iscsi_eth_rx_mode(bp, 1); netif_addr_unlock_bh(dev); __set_bit(3L, (unsigned long volatile *)(& sp_bits)); __set_bit(5L, (unsigned long volatile *)(& sp_bits)); tmp___0 = bnx2x_wait_sp_comp(bp, sp_bits); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { printk("\vbnx2x: [%s:%d(%s)]rx_mode completion timed out!\n", "bnx2x_drv_ctl", 14273, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } goto ldv_65955; case 263: sp_bits___0 = 0UL; netif_addr_lock_bh(dev); bnx2x_set_iscsi_eth_rx_mode(bp, 0); netif_addr_unlock_bh(dev); __set_bit(3L, (unsigned long volatile *)(& sp_bits___0)); __set_bit(6L, (unsigned long volatile *)(& sp_bits___0)); tmp___2 = bnx2x_wait_sp_comp(bp, sp_bits___0); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { printk("\vbnx2x: [%s:%d(%s)]rx_mode completion timed out!\n", "bnx2x_drv_ctl", 14292, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); rc = bnx2x_del_all_macs(bp, & bp->iscsi_l2_mac_obj, 2, 1); goto ldv_65955; case 268: count___0 = (int )ctl->data.credit.credit_count; __asm__ volatile ("": : : "memory"); atomic_add(count___0, & bp->cq_spq_left); __asm__ volatile ("": : : "memory"); goto ldv_65955; case 270: ulp_type = ctl->data.register_data.ulp_type; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { idx = ((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1); tmp___4 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )idx + 56UL) * 4UL))); cap = tmp___4; path = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0; port = (int )bp->pfid & 1; if (ulp_type == 1) { cap = cap | 8U; } else if (ulp_type == 2) { cap = cap | 4U; } else { } writel(cap, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )idx + 56UL) * 4UL))); if (ulp_type != 2) { goto ldv_65955; } else if (bp->common.shmem2_base == 0U) { goto ldv_65955; } else { tmp___5 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___5 <= 196U) { goto ldv_65955; } else if ((bp->flags & 524288U) == 0U) { goto ldv_65955; } else { } } scratch_offset = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 196UL))); if (scratch_offset == 0U) { goto ldv_65955; } else { } scratch_offset = (u32 )(((unsigned long )path * 2UL + (unsigned long )port) + 1UL) * 16U + scratch_offset; host_addr = (u32 *)(& ctl->data.register_data.fcoe_features); i = 0; goto ldv_65976; ldv_65975: writel(*(host_addr + (unsigned long )(i / 4)), (void volatile *)bp->regview + (unsigned long )(scratch_offset + (u32 )i)); i = i + 4; ldv_65976: ; if ((unsigned int )i <= 15U) { goto ldv_65975; } else { } } else { } bnx2x_schedule_sp_rtnl(bp, 10, 0U); goto ldv_65955; case 271: ulp_type___0 = ctl->data.ulp_type; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { idx___0 = ((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1); cap___0 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )idx___0 + 56UL) * 4UL))); if (ulp_type___0 == 1) { cap___0 = cap___0 & 4294967287U; } else if (ulp_type___0 == 2) { cap___0 = cap___0 & 4294967291U; } else { } writel(cap___0, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )idx___0 + 56UL) * 4UL))); } else { } bnx2x_schedule_sp_rtnl(bp, 10, 0U); goto ldv_65955; default: printk("\vbnx2x: [%s:%d(%s)]unknown command %x\n", "bnx2x_drv_ctl", 14370, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ctl->cmd); rc = -22; } ldv_65955: ; return (rc); } } void bnx2x_setup_cnic_irq_info(struct bnx2x *bp ) { struct cnic_eth_dev *cp ; u8 tmp ; u8 tmp___0 ; { cp = & bp->cnic_eth_dev; if ((bp->flags & 32U) != 0U) { cp->drv_state = cp->drv_state | 2U; cp->irq_arr[0].irq_flags = cp->irq_arr[0].irq_flags | 1U; cp->irq_arr[0].vector = (bp->msix_table + 1UL)->vector; } else { cp->drv_state = cp->drv_state & 4294967293U; cp->irq_arr[0].irq_flags = cp->irq_arr[0].irq_flags & 4294967294U; } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { cp->irq_arr[0].status_blk = (void *)bp->cnic_sb.e2_sb; } else { cp->irq_arr[0].status_blk = (void *)bp->cnic_sb.e1x_sb; } tmp = bnx2x_cnic_fw_sb_id(bp); cp->irq_arr[0].status_blk_num = (u32 )tmp; tmp___0 = bnx2x_cnic_igu_sb_id(bp); cp->irq_arr[0].status_blk_num2 = (u32 )tmp___0; cp->irq_arr[1].status_blk = (void *)bp->def_status_blk; cp->irq_arr[1].status_blk_num = 222U; cp->irq_arr[1].status_blk_num2 = 16U; cp->num_irq = 2; return; } } void bnx2x_setup_cnic_info(struct bnx2x *bp ) { struct cnic_eth_dev *cp ; u16 tmp ; u16 tmp___0 ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; int __y___3 ; int __y___4 ; int __y___5 ; int __y___6 ; long tmp___1 ; { cp = & bp->cnic_eth_dev; tmp = bnx2x_cid_ilt_lines(bp); cp->ctx_tbl_offset = (u32 )((int )bp->pfid * 384 + (int )tmp); tmp___0 = bnx2x_cid_ilt_lines(bp); cp->starting_cid = (u32 )tmp___0 * 32U; __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; cp->fcoe_init_cid = (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) + 1U; __y___3 = 8; __y___4 = 8; __y___5 = 8; __y___6 = 8; cp->iscsi_l2_cid = ((unsigned int )((u16 )((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___3) + 4294967295U) / (uint )__y___3) * (uint )__y___3)) + (((unsigned int )((u16 )((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___4) + 4294967295U) / (uint )__y___4) * (uint )__y___4)) + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___5) + 4294967295U) / (uint )__y___5) * (uint )__y___5 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___6) + 4294967295U) / (uint )__y___6) * (uint )__y___6 + 8U) & 15U) == 8U ? 16U : 0U); tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_1st_NON_L2_ETH_CID(bp) %x, cp->starting_cid %x, cp->fcoe_init_cid %x, cp->iscsi_l2_cid %x\n", "bnx2x_setup_cnic_info", 14415, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos, cp->starting_cid, cp->fcoe_init_cid, (int )cp->iscsi_l2_cid); } else { } if ((bp->flags & 8192U) != 0U) { cp->drv_state = cp->drv_state | 4U; } else { } return; } } extern void __compiletime_assert_14469(void) ; static int bnx2x_register_cnic(struct net_device *dev , struct cnic_ops *ops , void *data ) { struct bnx2x *bp ; void *tmp ; struct cnic_eth_dev *cp ; int rc ; long tmp___0 ; void *tmp___1 ; bool __cond ; struct cnic_ops *__var ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; cp = & bp->cnic_eth_dev; tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Register_cnic called\n", "bnx2x_register_cnic", 14428, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((unsigned long )ops == (unsigned long )((struct cnic_ops *)0)) { printk("\vbnx2x: [%s:%d(%s)]NULL ops received\n", "bnx2x_register_cnic", 14431, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } if ((unsigned int )bp->cnic_support == 0U) { printk("\vbnx2x: [%s:%d(%s)]Can\'t register CNIC when not supported\n", "bnx2x_register_cnic", 14436, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-95); } else { } if (! bp->cnic_loaded) { rc = bnx2x_load_cnic(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]CNIC-related load failed\n", "bnx2x_register_cnic", 14443, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } } else { } bp->cnic_enabled = 1; tmp___1 = kzalloc(4096UL, 208U); bp->cnic_kwq = (struct eth_spe *)tmp___1; if ((unsigned long )bp->cnic_kwq == (unsigned long )((struct eth_spe *)0)) { return (-12); } else { } bp->cnic_kwq_cons = bp->cnic_kwq; bp->cnic_kwq_prod = bp->cnic_kwq; bp->cnic_kwq_last = bp->cnic_kwq + 255UL; bp->cnic_spq_pending = 0U; bp->cnic_kwq_pending = 0U; bp->cnic_data = data; cp->num_irq = 0; cp->drv_state = cp->drv_state | 1U; cp->iro_arr = (void const *)bp->iro_arr; bnx2x_setup_cnic_irq_info(bp); __cond = 0; if ((int )__cond) { __compiletime_assert_14469(); } else { } __asm__ volatile ("": : : "memory"); __var = (struct cnic_ops *)0; *((struct cnic_ops * volatile *)(& bp->cnic_ops)) = ops; bnx2x_schedule_sp_rtnl(bp, 10, 0U); return (0); } } static int bnx2x_unregister_cnic(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; struct cnic_eth_dev *cp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; cp = & bp->cnic_eth_dev; mutex_lock_nested(& bp->cnic_mutex, 0U); cp->drv_state = 0U; bp->cnic_ops = (struct cnic_ops *)0; mutex_unlock(& bp->cnic_mutex); synchronize_rcu(); bp->cnic_enabled = 0; kfree((void const *)bp->cnic_kwq); bp->cnic_kwq = (struct eth_spe *)0; return (0); } } static struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; struct cnic_eth_dev *cp ; u16 tmp___0 ; u16 tmp___1 ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; u8 tmp___2 ; int __y___3 ; int __y___4 ; int __y___5 ; int __y___6 ; long tmp___3 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; cp = & bp->cnic_eth_dev; if ((bp->flags & 16384U) != 0U && (bp->flags & 32768U) != 0U) { return ((struct cnic_eth_dev *)0); } else { } cp->drv_owner = & __this_module; cp->chip_id = bp->common.chip_id & 4294967280U; cp->pdev = bp->pdev; cp->io_base = bp->regview; cp->io_base2 = bp->doorbells; cp->max_kwqe_pending = 8U; cp->ctx_blk_size = 32768; tmp___0 = bnx2x_cid_ilt_lines(bp); cp->ctx_tbl_offset = (u32 )((int )bp->pfid * 384 + (int )tmp___0); cp->ctx_tbl_len = 72U; tmp___1 = bnx2x_cid_ilt_lines(bp); cp->starting_cid = (u32 )tmp___1 * 32U; cp->drv_submit_kwqes_16 = & bnx2x_cnic_sp_queue; cp->drv_ctl = & bnx2x_drv_ctl; cp->drv_register_cnic = & bnx2x_register_cnic; cp->drv_unregister_cnic = & bnx2x_unregister_cnic; __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; cp->fcoe_init_cid = (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) + 1U; tmp___2 = bnx2x_cnic_eth_cl_id(bp, 0); cp->iscsi_l2_client_id = (u16 )tmp___2; __y___3 = 8; __y___4 = 8; __y___5 = 8; __y___6 = 8; cp->iscsi_l2_cid = ((unsigned int )((u16 )((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___3) + 4294967295U) / (uint )__y___3) * (uint )__y___3)) + (((unsigned int )((u16 )((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___4) + 4294967295U) / (uint )__y___4) * (uint )__y___4)) + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___5) + 4294967295U) / (uint )__y___5) * (uint )__y___5 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___6) + 4294967295U) / (uint )__y___6) * (uint )__y___6 + 8U) & 15U) == 8U ? 16U : 0U); if ((bp->flags & 8192U) != 0U) { cp->drv_state = cp->drv_state | 4U; } else { } if ((bp->flags & 16384U) != 0U) { cp->drv_state = cp->drv_state | 8U; } else { } if ((bp->flags & 32768U) != 0U) { cp->drv_state = cp->drv_state | 16U; } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___3 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "page_size %d, tbl_offset %d, tbl_lines %d, starting cid %d\n", cp->ctx_blk_size, cp->ctx_tbl_offset, cp->ctx_tbl_len, cp->starting_cid); } else { } return (cp); } } static u32 bnx2x_rx_ustorm_prods_offset(struct bnx2x_fastpath *fp ) { struct bnx2x *bp ; u32 offset ; int tmp ; { bp = fp->bp; offset = 4194304U; if ((bp->flags & 4194304U) != 0U) { tmp = bnx2x_vf_ustorm_prods_offset(bp, fp); return ((u32 )tmp); } else if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { offset = ((unsigned int )(bp->iro_arr + 216UL)->base + (unsigned int )((int )fp->cl_qzone_id * (int )(bp->iro_arr + 216UL)->m1)) + offset; } else { offset = ((unsigned int )(bp->iro_arr + 215UL)->base + ((unsigned int )((int )fp->cl_id * (int )(bp->iro_arr + 215UL)->m2) + (unsigned int )(((int )bp->pfid & 1) * (int )(bp->iro_arr + 215UL)->m1))) + offset; } return (offset); } } int bnx2x_pretend_func(struct bnx2x *bp , u16 pretend_func_val ) { u32 pretend_reg ; { if ((bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) && (unsigned int )pretend_func_val > 7U) { return (-1); } else { } pretend_reg = bnx2x_get_pretend_reg(bp); writel((unsigned int )pretend_func_val, (void volatile *)bp->regview + (unsigned long )pretend_reg); readl((void const volatile *)bp->regview + (unsigned long )pretend_reg); return (0); } } static void bnx2x_ptp_task(struct work_struct *work ) { struct bnx2x *bp ; struct work_struct const *__mptr ; int port ; u32 val_seq ; u64 timestamp ; u64 ns ; struct skb_shared_hwtstamps shhwtstamps ; unsigned int tmp ; unsigned int tmp___0 ; long tmp___1 ; long tmp___2 ; { __mptr = (struct work_struct const *)work; bp = (struct bnx2x *)__mptr + 0xffffffffffffde88UL; port = (int )bp->pfid & 1; val_seq = readl((void const volatile *)(bp->regview + (port != 0 ? 100332UL : 100320UL))); if ((val_seq & 65536U) != 0U) { tmp = readl((void const volatile *)(bp->regview + (port != 0 ? 100328UL : 100316UL))); timestamp = (u64 )tmp; timestamp = timestamp << 32; tmp___0 = readl((void const volatile *)(bp->regview + (port != 0 ? 100324UL : 100312UL))); timestamp = (u64 )tmp___0 | timestamp; writel(65536U, (void volatile *)(bp->regview + (port != 0 ? 100332UL : 100320UL))); ns = timecounter_cyc2time(& bp->timecounter, timestamp); memset((void *)(& shhwtstamps), 0, 8UL); shhwtstamps.hwtstamp = ns_to_ktime(ns); skb_tstamp_tx(bp->ptp_tx_skb, & shhwtstamps); dev_kfree_skb_any(bp->ptp_tx_skb); bp->ptp_tx_skb = (struct sk_buff *)0; tmp___1 = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Tx timestamp, timestamp cycles = %llu, ns = %llu\n", "bnx2x_ptp_task", 14608, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", timestamp, ns); } else { } } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]There is no valid Tx timestamp yet\n", "bnx2x_ptp_task", 14610, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } schedule_work(& bp->ptp_task); } return; } } void bnx2x_set_rx_ts(struct bnx2x *bp , struct sk_buff *skb ) { int port ; u64 timestamp ; u64 ns ; unsigned int tmp ; unsigned int tmp___0 ; struct skb_shared_hwtstamps *tmp___1 ; long tmp___2 ; { port = (int )bp->pfid & 1; tmp = readl((void const volatile *)(bp->regview + (port != 0 ? 100208UL : 100184UL))); timestamp = (u64 )tmp; timestamp = timestamp << 32; tmp___0 = readl((void const volatile *)(bp->regview + (port != 0 ? 100204UL : 100180UL))); timestamp = (u64 )tmp___0 | timestamp; writel(65536U, (void volatile *)(bp->regview + (port != 0 ? 100212UL : 100188UL))); ns = timecounter_cyc2time(& bp->timecounter, timestamp); tmp___1 = skb_hwtstamps(skb); tmp___1->hwtstamp = ns_to_ktime(ns); tmp___2 = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Rx timestamp, timestamp cycles = %llu, ns = %llu\n", "bnx2x_set_rx_ts", 14636, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", timestamp, ns); } else { } return; } } static cycle_t bnx2x_cyclecounter_read(struct cyclecounter const *cc ) { struct bnx2x *bp ; struct cyclecounter const *__mptr ; int port ; u32 wb_data[2U] ; u64 phc_cycles ; long tmp ; { __mptr = cc; bp = (struct bnx2x *)__mptr + 0xffffffffffffde38UL; port = (int )bp->pfid & 1; bnx2x_read_dmae(bp, port != 0 ? 100440U : 100384U, 2U); memcpy((void *)(& wb_data), (void const *)(& (bp->slowpath)->wb_data), 8UL); phc_cycles = (u64 )wb_data[1]; phc_cycles = (phc_cycles << 32) + (u64 )wb_data[0]; tmp = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]PHC read cycles = %llu\n", "bnx2x_cyclecounter_read", 14652, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", phc_cycles); } else { } return (phc_cycles); } } static void bnx2x_init_cyclecounter(struct bnx2x *bp ) { { memset((void *)(& bp->cyclecounter), 0, 24UL); bp->cyclecounter.read = & bnx2x_cyclecounter_read; bp->cyclecounter.mask = 0xffffffffffffffffULL; bp->cyclecounter.shift = 1U; bp->cyclecounter.mult = 1U; return; } } static int bnx2x_send_reset_timesync_ramrod(struct bnx2x *bp ) { struct bnx2x_func_state_params func_params ; struct bnx2x_func_set_timesync_params *set_timesync_params ; int tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; set_timesync_params = & func_params.params.set_timesync; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); __set_bit(7L, (unsigned long volatile *)(& func_params.ramrod_flags)); func_params.f_obj = & bp->func_obj; func_params.cmd = 9; set_timesync_params->drift_adjust_cmd = 2U; set_timesync_params->offset_cmd = 0U; tmp = bnx2x_func_state_change(bp, & func_params); return (tmp); } } static int bnx2x_enable_ptp_packets(struct bnx2x *bp ) { struct bnx2x_queue_state_params q_params ; int rc ; int i ; struct bnx2x_fastpath *fp ; { memset((void *)(& q_params), 0, 136UL); __set_bit(2L, (unsigned long volatile *)(& q_params.ramrod_flags)); q_params.cmd = 5; __set_bit(14L, (unsigned long volatile *)(& q_params.params.update.update_flags)); __set_bit(15L, (unsigned long volatile *)(& q_params.params.update.update_flags)); i = 0; goto ldv_66106; ldv_66105: fp = bp->fp + (unsigned long )i; q_params.q_obj = & (bp->sp_objs + (unsigned long )fp->index)->q_obj; rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to enable PTP packets\n", "bnx2x_enable_ptp_packets", 14710, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } i = i + 1; ldv_66106: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_66105; } else { } return (0); } } int bnx2x_configure_ptp_filters(struct bnx2x *bp ) { int port ; int rc ; { port = (int )bp->pfid & 1; if (! bp->hwtstamp_ioctl_called) { return (0); } else { } switch ((int )bp->tx_type) { case 1: bp->flags = bp->flags | 134217728U; writel(1706U, (void volatile *)(bp->regview + (port != 0 ? 100344UL : 100336UL))); writel(16110U, (void volatile *)(bp->regview + (port != 0 ? 100348UL : 100340UL))); goto ldv_66114; case 2: printk("\vbnx2x: [%s:%d(%s)]One-step timestamping is not supported\n", "bnx2x_configure_ptp_filters", 14735, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-34); } ldv_66114: ; switch ((int )bp->rx_filter) { case 0: ; goto ldv_66118; case 1: ; case 2: bp->rx_filter = 0U; goto ldv_66118; case 3: ; case 4: ; case 5: bp->rx_filter = 3U; writel(2030U, (void volatile *)(bp->regview + (port != 0 ? 100296UL : 100256UL))); writel(16382U, (void volatile *)(bp->regview + (port != 0 ? 100300UL : 100260UL))); goto ldv_66118; case 6: ; case 7: ; case 8: bp->rx_filter = 6U; writel(2026U, (void volatile *)(bp->regview + (port != 0 ? 100296UL : 100256UL))); writel(16366U, (void volatile *)(bp->regview + (port != 0 ? 100300UL : 100260UL))); goto ldv_66118; case 9: ; case 10: ; case 11: bp->rx_filter = 9U; writel(1727U, (void volatile *)(bp->regview + (port != 0 ? 100296UL : 100256UL))); writel(16127U, (void volatile *)(bp->regview + (port != 0 ? 100300UL : 100260UL))); goto ldv_66118; case 12: ; case 13: ; case 14: bp->rx_filter = 12U; writel(1706U, (void volatile *)(bp->regview + (port != 0 ? 100296UL : 100256UL))); writel(16110U, (void volatile *)(bp->regview + (port != 0 ? 100300UL : 100260UL))); goto ldv_66118; } ldv_66118: rc = bnx2x_enable_ptp_packets(bp); if (rc != 0) { return (rc); } else { } writel(1U, (void volatile *)(bp->regview + (port != 0 ? 100308UL : 100268UL))); return (0); } } static int bnx2x_hwtstamp_ioctl(struct bnx2x *bp , struct ifreq *ifr ) { struct hwtstamp_config config ; int rc ; long tmp ; unsigned long tmp___0 ; long tmp___1 ; unsigned long tmp___2 ; { tmp = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]HWTSTAMP IOCTL called\n", "bnx2x_hwtstamp_ioctl", 14806, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___0 = copy_from_user((void *)(& config), (void const *)ifr->ifr_ifru.ifru_data, 12UL); if (tmp___0 != 0UL) { return (-14); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Requested tx_type: %d, requested rx_filters = %d\n", "bnx2x_hwtstamp_ioctl", 14812, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", config.tx_type, config.rx_filter); } else { } if (config.flags != 0) { printk("\vbnx2x: [%s:%d(%s)]config.flags is reserved for future use\n", "bnx2x_hwtstamp_ioctl", 14815, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } bp->hwtstamp_ioctl_called = 1; bp->tx_type = (u16 )config.tx_type; bp->rx_filter = (u16 )config.rx_filter; rc = bnx2x_configure_ptp_filters(bp); if (rc != 0) { return (rc); } else { } config.rx_filter = (int )bp->rx_filter; tmp___2 = copy_to_user(ifr->ifr_ifru.ifru_data, (void const *)(& config), 12UL); return (tmp___2 != 0UL ? -14 : 0); } } static int bnx2x_configure_ptp(struct bnx2x *bp ) { int rc ; int port ; u32 wb_data[2U] ; { port = (int )bp->pfid & 1; writel(2047U, (void volatile *)(bp->regview + (port != 0 ? 100296UL : 100256UL))); writel(16383U, (void volatile *)(bp->regview + (port != 0 ? 100300UL : 100260UL))); writel(2047U, (void volatile *)(bp->regview + (port != 0 ? 100344UL : 100336UL))); writel(16383U, (void volatile *)(bp->regview + (port != 0 ? 100348UL : 100340UL))); writel(0U, (void volatile *)(bp->regview + (port != 0 ? 100308UL : 100268UL))); writel(63U, (void volatile *)(bp->regview + (port != 0 ? 100272UL : 100232UL))); wb_data[0] = 0U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, 100352U, 2U); rc = bnx2x_send_reset_timesync_ramrod(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to reset PHC drift register\n", "bnx2x_configure_ptp", 14865, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-14); } else { } writel(65536U, (void volatile *)(bp->regview + (port != 0 ? 100212UL : 100188UL))); writel(65536U, (void volatile *)(bp->regview + (port != 0 ? 100332UL : 100320UL))); return (0); } } void bnx2x_init_ptp(struct bnx2x *bp ) { int rc ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; ktime_t tmp ; long tmp___0 ; { rc = bnx2x_configure_ptp(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Stopping PTP initialization\n", "bnx2x_init_ptp", 14886, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } __init_work(& bp->ptp_task, 0); __constr_expr_0.counter = 137438953408L; bp->ptp_task.data = __constr_expr_0; lockdep_init_map(& bp->ptp_task.lockdep_map, "(&bp->ptp_task)", & __key, 0); INIT_LIST_HEAD(& bp->ptp_task.entry); bp->ptp_task.func = & bnx2x_ptp_task; if (! bp->timecounter_init_done) { bnx2x_init_cyclecounter(bp); tmp = ktime_get_real(); timecounter_init(& bp->timecounter, (struct cyclecounter const *)(& bp->cyclecounter), (u64 )tmp.tv64); bp->timecounter_init_done = 1; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 16777216) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PTP initialization ended successfully\n", "bnx2x_init_ptp", 14904, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } int ldv_retval_2 ; int ldv_retval_5 ; int ldv_retval_0 ; int ldv_retval_6 ; int ldv_retval_1 ; extern int ldv_suspend_late_27(void) ; extern void ldv_initialize(void) ; extern int ldv_resume_early_27(void) ; extern int ldv_release_28(void) ; extern int ldv_ndo_init_30(void) ; extern int ldv_ndo_uninit_30(void) ; extern int ldv_suspend_28(void) ; int ldv_retval_4 ; void ldv_check_final_state(void) ; int ldv_retval_3 ; int ldv_retval_7 ; extern int ldv_probe_28(void) ; void activate_work_5(struct work_struct *work , int state ) { { if (ldv_work_5_0 == 0) { ldv_work_struct_5_0 = work; ldv_work_5_0 = state; return; } else { } if (ldv_work_5_1 == 0) { ldv_work_struct_5_1 = work; ldv_work_5_1 = state; return; } else { } if (ldv_work_5_2 == 0) { ldv_work_struct_5_2 = work; ldv_work_5_2 = state; return; } else { } if (ldv_work_5_3 == 0) { ldv_work_struct_5_3 = work; ldv_work_5_3 = state; return; } else { } return; } } void call_and_disable_all_7(int state ) { { if (ldv_work_7_0 == state) { call_and_disable_work_7(ldv_work_struct_7_0); } else { } if (ldv_work_7_1 == state) { call_and_disable_work_7(ldv_work_struct_7_1); } else { } if (ldv_work_7_2 == state) { call_and_disable_work_7(ldv_work_struct_7_2); } else { } if (ldv_work_7_3 == state) { call_and_disable_work_7(ldv_work_struct_7_3); } else { } return; } } void ldv_initialize_bnx2x_func_sp_drv_ops_29(void) { void *tmp ; { tmp = ldv_init_zalloc(8760UL); bnx2x_func_sp_drv_group0 = (struct bnx2x *)tmp; return; } } void invoke_work_6(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_6_0 == 2 || ldv_work_6_0 == 3) { ldv_work_6_0 = 4; bnx2x_period_task(ldv_work_struct_6_0); ldv_work_6_0 = 1; } else { } goto ldv_66196; case 1: ; if (ldv_work_6_1 == 2 || ldv_work_6_1 == 3) { ldv_work_6_1 = 4; bnx2x_period_task(ldv_work_struct_6_0); ldv_work_6_1 = 1; } else { } goto ldv_66196; case 2: ; if (ldv_work_6_2 == 2 || ldv_work_6_2 == 3) { ldv_work_6_2 = 4; bnx2x_period_task(ldv_work_struct_6_0); ldv_work_6_2 = 1; } else { } goto ldv_66196; case 3: ; if (ldv_work_6_3 == 2 || ldv_work_6_3 == 3) { ldv_work_6_3 = 4; bnx2x_period_task(ldv_work_struct_6_0); ldv_work_6_3 = 1; } else { } goto ldv_66196; default: ldv_stop(); } ldv_66196: ; 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; } } void work_init_5(void) { { ldv_work_5_0 = 0; ldv_work_5_1 = 0; ldv_work_5_2 = 0; ldv_work_5_3 = 0; return; } } void invoke_work_8(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_8_0 == 2 || ldv_work_8_0 == 3) { ldv_work_8_0 = 4; bnx2x_ptp_task(ldv_work_struct_8_0); ldv_work_8_0 = 1; } else { } goto ldv_66215; case 1: ; if (ldv_work_8_1 == 2 || ldv_work_8_1 == 3) { ldv_work_8_1 = 4; bnx2x_ptp_task(ldv_work_struct_8_0); ldv_work_8_1 = 1; } else { } goto ldv_66215; case 2: ; if (ldv_work_8_2 == 2 || ldv_work_8_2 == 3) { ldv_work_8_2 = 4; bnx2x_ptp_task(ldv_work_struct_8_0); ldv_work_8_2 = 1; } else { } goto ldv_66215; case 3: ; if (ldv_work_8_3 == 2 || ldv_work_8_3 == 3) { ldv_work_8_3 = 4; bnx2x_ptp_task(ldv_work_struct_8_0); ldv_work_8_3 = 1; } else { } goto ldv_66215; default: ldv_stop(); } ldv_66215: ; return; } } void call_and_disable_all_4(int state ) { { if (ldv_work_4_0 == state) { call_and_disable_work_4(ldv_work_struct_4_0); } else { } if (ldv_work_4_1 == state) { call_and_disable_work_4(ldv_work_struct_4_1); } else { } if (ldv_work_4_2 == state) { call_and_disable_work_4(ldv_work_struct_4_2); } else { } if (ldv_work_4_3 == state) { call_and_disable_work_4(ldv_work_struct_4_3); } else { } return; } } void work_init_7(void) { { ldv_work_7_0 = 0; ldv_work_7_1 = 0; ldv_work_7_2 = 0; ldv_work_7_3 = 0; return; } } void invoke_work_7(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_7_0 == 2 || ldv_work_7_0 == 3) { ldv_work_7_0 = 4; bnx2x_iov_task(ldv_work_struct_7_0); ldv_work_7_0 = 1; } else { } goto ldv_66232; case 1: ; if (ldv_work_7_1 == 2 || ldv_work_7_1 == 3) { ldv_work_7_1 = 4; bnx2x_iov_task(ldv_work_struct_7_0); ldv_work_7_1 = 1; } else { } goto ldv_66232; case 2: ; if (ldv_work_7_2 == 2 || ldv_work_7_2 == 3) { ldv_work_7_2 = 4; bnx2x_iov_task(ldv_work_struct_7_0); ldv_work_7_2 = 1; } else { } goto ldv_66232; case 3: ; if (ldv_work_7_3 == 2 || ldv_work_7_3 == 3) { ldv_work_7_3 = 4; bnx2x_iov_task(ldv_work_struct_7_0); ldv_work_7_3 = 1; } else { } goto ldv_66232; default: ldv_stop(); } ldv_66232: ; return; } } void disable_work_5(struct work_struct *work ) { { if ((ldv_work_5_0 == 3 || ldv_work_5_0 == 2) && (unsigned long )ldv_work_struct_5_0 == (unsigned long )work) { ldv_work_5_0 = 1; } else { } if ((ldv_work_5_1 == 3 || ldv_work_5_1 == 2) && (unsigned long )ldv_work_struct_5_1 == (unsigned long )work) { ldv_work_5_1 = 1; } else { } if ((ldv_work_5_2 == 3 || ldv_work_5_2 == 2) && (unsigned long )ldv_work_struct_5_2 == (unsigned long )work) { ldv_work_5_2 = 1; } else { } if ((ldv_work_5_3 == 3 || ldv_work_5_3 == 2) && (unsigned long )ldv_work_struct_5_3 == (unsigned long )work) { ldv_work_5_3 = 1; } else { } return; } } void disable_work_7(struct work_struct *work ) { { if ((ldv_work_7_0 == 3 || ldv_work_7_0 == 2) && (unsigned long )ldv_work_struct_7_0 == (unsigned long )work) { ldv_work_7_0 = 1; } else { } if ((ldv_work_7_1 == 3 || ldv_work_7_1 == 2) && (unsigned long )ldv_work_struct_7_1 == (unsigned long )work) { ldv_work_7_1 = 1; } else { } if ((ldv_work_7_2 == 3 || ldv_work_7_2 == 2) && (unsigned long )ldv_work_struct_7_2 == (unsigned long )work) { ldv_work_7_2 = 1; } else { } if ((ldv_work_7_3 == 3 || ldv_work_7_3 == 2) && (unsigned long )ldv_work_struct_7_3 == (unsigned long )work) { ldv_work_7_3 = 1; } else { } return; } } void call_and_disable_all_8(int state ) { { if (ldv_work_8_0 == state) { call_and_disable_work_8(ldv_work_struct_8_0); } else { } if (ldv_work_8_1 == state) { call_and_disable_work_8(ldv_work_struct_8_1); } else { } if (ldv_work_8_2 == state) { call_and_disable_work_8(ldv_work_struct_8_2); } else { } if (ldv_work_8_3 == state) { call_and_disable_work_8(ldv_work_struct_8_3); } else { } return; } } void call_and_disable_all_6(int state ) { { if (ldv_work_6_0 == state) { call_and_disable_work_6(ldv_work_struct_6_0); } else { } if (ldv_work_6_1 == state) { call_and_disable_work_6(ldv_work_struct_6_1); } else { } if (ldv_work_6_2 == state) { call_and_disable_work_6(ldv_work_struct_6_2); } else { } if (ldv_work_6_3 == state) { call_and_disable_work_6(ldv_work_struct_6_3); } else { } return; } } void ldv_initialize_pci_error_handlers_28(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); bnx2x_err_handler_group0 = (struct pci_dev *)tmp; 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; bnx2x_sp_task(ldv_work_struct_4_0); ldv_work_4_0 = 1; } else { } goto ldv_66258; case 1: ; if (ldv_work_4_1 == 2 || ldv_work_4_1 == 3) { ldv_work_4_1 = 4; bnx2x_sp_task(ldv_work_struct_4_0); ldv_work_4_1 = 1; } else { } goto ldv_66258; case 2: ; if (ldv_work_4_2 == 2 || ldv_work_4_2 == 3) { ldv_work_4_2 = 4; bnx2x_sp_task(ldv_work_struct_4_0); ldv_work_4_2 = 1; } else { } goto ldv_66258; case 3: ; if (ldv_work_4_3 == 2 || ldv_work_4_3 == 3) { ldv_work_4_3 = 4; bnx2x_sp_task(ldv_work_struct_4_0); ldv_work_4_3 = 1; } else { } goto ldv_66258; default: ldv_stop(); } ldv_66258: ; return; } } void call_and_disable_work_5(struct work_struct *work ) { { if ((ldv_work_5_0 == 2 || ldv_work_5_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_5_0) { bnx2x_sp_rtnl_task(work); ldv_work_5_0 = 1; return; } else { } if ((ldv_work_5_1 == 2 || ldv_work_5_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_5_1) { bnx2x_sp_rtnl_task(work); ldv_work_5_1 = 1; return; } else { } if ((ldv_work_5_2 == 2 || ldv_work_5_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_5_2) { bnx2x_sp_rtnl_task(work); ldv_work_5_2 = 1; return; } else { } if ((ldv_work_5_3 == 2 || ldv_work_5_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_5_3) { bnx2x_sp_rtnl_task(work); ldv_work_5_3 = 1; return; } else { } return; } } void activate_work_8(struct work_struct *work , int state ) { { if (ldv_work_8_0 == 0) { ldv_work_struct_8_0 = work; ldv_work_8_0 = state; return; } else { } if (ldv_work_8_1 == 0) { ldv_work_struct_8_1 = work; ldv_work_8_1 = state; return; } else { } if (ldv_work_8_2 == 0) { ldv_work_struct_8_2 = work; ldv_work_8_2 = state; return; } else { } if (ldv_work_8_3 == 0) { ldv_work_struct_8_3 = work; ldv_work_8_3 = state; return; } else { } return; } } void ldv_net_device_ops_30(void) { void *tmp ; { tmp = ldv_init_zalloc(3008UL); bnx2x_netdev_ops_group1 = (struct net_device *)tmp; return; } } void activate_work_6(struct work_struct *work , int state ) { { if (ldv_work_6_0 == 0) { ldv_work_struct_6_0 = work; ldv_work_6_0 = state; return; } else { } if (ldv_work_6_1 == 0) { ldv_work_struct_6_1 = work; ldv_work_6_1 = state; return; } else { } if (ldv_work_6_2 == 0) { ldv_work_struct_6_2 = work; ldv_work_6_2 = state; return; } else { } if (ldv_work_6_3 == 0) { ldv_work_struct_6_3 = work; ldv_work_6_3 = state; return; } else { } return; } } void activate_work_4(struct work_struct *work , int state ) { { if (ldv_work_4_0 == 0) { ldv_work_struct_4_0 = work; ldv_work_4_0 = state; return; } else { } if (ldv_work_4_1 == 0) { ldv_work_struct_4_1 = work; ldv_work_4_1 = state; return; } else { } if (ldv_work_4_2 == 0) { ldv_work_struct_4_2 = work; ldv_work_4_2 = state; return; } else { } if (ldv_work_4_3 == 0) { ldv_work_struct_4_3 = work; ldv_work_4_3 = state; return; } else { } return; } } void call_and_disable_work_7(struct work_struct *work ) { { if ((ldv_work_7_0 == 2 || ldv_work_7_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_7_0) { bnx2x_iov_task(work); ldv_work_7_0 = 1; return; } else { } if ((ldv_work_7_1 == 2 || ldv_work_7_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_7_1) { bnx2x_iov_task(work); ldv_work_7_1 = 1; return; } else { } if ((ldv_work_7_2 == 2 || ldv_work_7_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_7_2) { bnx2x_iov_task(work); ldv_work_7_2 = 1; return; } else { } if ((ldv_work_7_3 == 2 || ldv_work_7_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_7_3) { bnx2x_iov_task(work); ldv_work_7_3 = 1; return; } else { } return; } } void call_and_disable_all_5(int state ) { { if (ldv_work_5_0 == state) { call_and_disable_work_5(ldv_work_struct_5_0); } else { } if (ldv_work_5_1 == state) { call_and_disable_work_5(ldv_work_struct_5_1); } else { } if (ldv_work_5_2 == state) { call_and_disable_work_5(ldv_work_struct_5_2); } else { } if (ldv_work_5_3 == state) { call_and_disable_work_5(ldv_work_struct_5_3); } else { } return; } } int reg_timer_9(struct timer_list *timer ) { { ldv_timer_list_9 = timer; ldv_timer_state_9 = 1; return (0); } } void work_init_8(void) { { ldv_work_8_0 = 0; ldv_work_8_1 = 0; ldv_work_8_2 = 0; ldv_work_8_3 = 0; return; } } void disable_suitable_timer_9(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_9) { ldv_timer_state_9 = 0; return; } else { } return; } } void work_init_6(void) { { ldv_work_6_0 = 0; ldv_work_6_1 = 0; ldv_work_6_2 = 0; ldv_work_6_3 = 0; return; } } void disable_work_6(struct work_struct *work ) { { if ((ldv_work_6_0 == 3 || ldv_work_6_0 == 2) && (unsigned long )ldv_work_struct_6_0 == (unsigned long )work) { ldv_work_6_0 = 1; } else { } if ((ldv_work_6_1 == 3 || ldv_work_6_1 == 2) && (unsigned long )ldv_work_struct_6_1 == (unsigned long )work) { ldv_work_6_1 = 1; } else { } if ((ldv_work_6_2 == 3 || ldv_work_6_2 == 2) && (unsigned long )ldv_work_struct_6_2 == (unsigned long )work) { ldv_work_6_2 = 1; } else { } if ((ldv_work_6_3 == 3 || ldv_work_6_3 == 2) && (unsigned long )ldv_work_struct_6_3 == (unsigned long )work) { ldv_work_6_3 = 1; } else { } return; } } void invoke_work_5(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_5_0 == 2 || ldv_work_5_0 == 3) { ldv_work_5_0 = 4; bnx2x_sp_rtnl_task(ldv_work_struct_5_0); ldv_work_5_0 = 1; } else { } goto ldv_66312; case 1: ; if (ldv_work_5_1 == 2 || ldv_work_5_1 == 3) { ldv_work_5_1 = 4; bnx2x_sp_rtnl_task(ldv_work_struct_5_0); ldv_work_5_1 = 1; } else { } goto ldv_66312; case 2: ; if (ldv_work_5_2 == 2 || ldv_work_5_2 == 3) { ldv_work_5_2 = 4; bnx2x_sp_rtnl_task(ldv_work_struct_5_0); ldv_work_5_2 = 1; } else { } goto ldv_66312; case 3: ; if (ldv_work_5_3 == 2 || ldv_work_5_3 == 3) { ldv_work_5_3 = 4; bnx2x_sp_rtnl_task(ldv_work_struct_5_0); ldv_work_5_3 = 1; } else { } goto ldv_66312; default: ldv_stop(); } ldv_66312: ; return; } } void activate_work_7(struct work_struct *work , int state ) { { if (ldv_work_7_0 == 0) { ldv_work_struct_7_0 = work; ldv_work_7_0 = state; return; } else { } if (ldv_work_7_1 == 0) { ldv_work_struct_7_1 = work; ldv_work_7_1 = state; return; } else { } if (ldv_work_7_2 == 0) { ldv_work_struct_7_2 = work; ldv_work_7_2 = state; return; } else { } if (ldv_work_7_3 == 0) { ldv_work_struct_7_3 = work; ldv_work_7_3 = state; return; } else { } return; } } void call_and_disable_work_8(struct work_struct *work ) { { if ((ldv_work_8_0 == 2 || ldv_work_8_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_8_0) { bnx2x_ptp_task(work); ldv_work_8_0 = 1; return; } else { } if ((ldv_work_8_1 == 2 || ldv_work_8_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_8_1) { bnx2x_ptp_task(work); ldv_work_8_1 = 1; return; } else { } if ((ldv_work_8_2 == 2 || ldv_work_8_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_8_2) { bnx2x_ptp_task(work); ldv_work_8_2 = 1; return; } else { } if ((ldv_work_8_3 == 2 || ldv_work_8_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_8_3) { bnx2x_ptp_task(work); ldv_work_8_3 = 1; return; } else { } return; } } void choose_timer_9(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_9 = 2; return; } } void disable_work_4(struct work_struct *work ) { { if ((ldv_work_4_0 == 3 || ldv_work_4_0 == 2) && (unsigned long )ldv_work_struct_4_0 == (unsigned long )work) { ldv_work_4_0 = 1; } else { } if ((ldv_work_4_1 == 3 || ldv_work_4_1 == 2) && (unsigned long )ldv_work_struct_4_1 == (unsigned long )work) { ldv_work_4_1 = 1; } else { } if ((ldv_work_4_2 == 3 || ldv_work_4_2 == 2) && (unsigned long )ldv_work_struct_4_2 == (unsigned long )work) { ldv_work_4_2 = 1; } else { } if ((ldv_work_4_3 == 3 || ldv_work_4_3 == 2) && (unsigned long )ldv_work_struct_4_3 == (unsigned long )work) { ldv_work_4_3 = 1; } else { } return; } } void work_init_4(void) { { ldv_work_4_0 = 0; ldv_work_4_1 = 0; ldv_work_4_2 = 0; ldv_work_4_3 = 0; return; } } void ldv_pci_driver_27(void) { void *tmp ; { tmp = ldv_init_zalloc(2976UL); bnx2x_pci_driver_group1 = (struct pci_dev *)tmp; return; } } void disable_work_8(struct work_struct *work ) { { if ((ldv_work_8_0 == 3 || ldv_work_8_0 == 2) && (unsigned long )ldv_work_struct_8_0 == (unsigned long )work) { ldv_work_8_0 = 1; } else { } if ((ldv_work_8_1 == 3 || ldv_work_8_1 == 2) && (unsigned long )ldv_work_struct_8_1 == (unsigned long )work) { ldv_work_8_1 = 1; } else { } if ((ldv_work_8_2 == 3 || ldv_work_8_2 == 2) && (unsigned long )ldv_work_struct_8_2 == (unsigned long )work) { ldv_work_8_2 = 1; } else { } if ((ldv_work_8_3 == 3 || ldv_work_8_3 == 2) && (unsigned long )ldv_work_struct_8_3 == (unsigned long )work) { ldv_work_8_3 = 1; } else { } return; } } void call_and_disable_work_6(struct work_struct *work ) { { if ((ldv_work_6_0 == 2 || ldv_work_6_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_6_0) { bnx2x_period_task(work); ldv_work_6_0 = 1; return; } else { } if ((ldv_work_6_1 == 2 || ldv_work_6_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_6_1) { bnx2x_period_task(work); ldv_work_6_1 = 1; return; } else { } if ((ldv_work_6_2 == 2 || ldv_work_6_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_6_2) { bnx2x_period_task(work); ldv_work_6_2 = 1; return; } else { } if ((ldv_work_6_3 == 2 || ldv_work_6_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_6_3) { bnx2x_period_task(work); ldv_work_6_3 = 1; return; } else { } return; } } void call_and_disable_work_4(struct work_struct *work ) { { if ((ldv_work_4_0 == 2 || ldv_work_4_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_0) { bnx2x_sp_task(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) { bnx2x_sp_task(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) { bnx2x_sp_task(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) { bnx2x_sp_task(work); ldv_work_4_3 = 1; return; } else { } return; } } void ldv_main_exported_25(void) ; void ldv_main_exported_21(void) ; void ldv_main_exported_26(void) ; void ldv_main_exported_17(void) ; void ldv_main_exported_20(void) ; void ldv_main_exported_15(void) ; void ldv_main_exported_14(void) ; void ldv_main_exported_22(void) ; void ldv_main_exported_18(void) ; void ldv_main_exported_24(void) ; void ldv_main_exported_23(void) ; void ldv_main_exported_13(void) ; void ldv_main_exported_16(void) ; void ldv_main_exported_19(void) ; void ldv_main_exported_10(void) ; void ldv_main_exported_11(void) ; void ldv_main_exported_12(void) ; int main(void) { void *ldvarg39 ; void *tmp ; int ldvarg51 ; u8 *ldvarg32 ; void *tmp___0 ; u8 ldvarg41 ; int ldvarg43 ; u16 ldvarg42 ; int ldvarg56 ; netdev_features_t ldvarg49 ; struct sk_buff *ldvarg50 ; void *tmp___1 ; struct napi_struct *ldvarg46 ; void *tmp___2 ; struct ifreq *ldvarg57 ; void *tmp___3 ; netdev_features_t ldvarg37 ; struct ifla_vf_info *ldvarg53 ; void *tmp___4 ; struct netdev_phys_item_id *ldvarg55 ; void *tmp___5 ; int ldvarg36 ; struct sk_buff *ldvarg40 ; void *tmp___6 ; struct sk_buff *ldvarg44 ; void *tmp___7 ; netdev_features_t ldvarg45 ; void *ldvarg35 ; void *tmp___8 ; u16 (*ldvarg38)(struct net_device * , struct sk_buff * ) ; int ldvarg33 ; u64 *ldvarg48 ; void *tmp___9 ; int ldvarg54 ; int ldvarg52 ; u8 ldvarg34 ; int ldvarg47 ; pm_message_t ldvarg70 ; struct pci_device_id *ldvarg71 ; void *tmp___10 ; int ldvarg69 ; enum pci_channel_state ldvarg73 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; { tmp = ldv_init_zalloc(1UL); ldvarg39 = tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg32 = (u8 *)tmp___0; tmp___1 = ldv_init_zalloc(232UL); ldvarg50 = (struct sk_buff *)tmp___1; tmp___2 = ldv_init_zalloc(280UL); ldvarg46 = (struct napi_struct *)tmp___2; tmp___3 = ldv_init_zalloc(40UL); ldvarg57 = (struct ifreq *)tmp___3; tmp___4 = ldv_init_zalloc(64UL); ldvarg53 = (struct ifla_vf_info *)tmp___4; tmp___5 = ldv_init_zalloc(33UL); ldvarg55 = (struct netdev_phys_item_id *)tmp___5; tmp___6 = ldv_init_zalloc(232UL); ldvarg40 = (struct sk_buff *)tmp___6; tmp___7 = ldv_init_zalloc(232UL); ldvarg44 = (struct sk_buff *)tmp___7; tmp___8 = ldv_init_zalloc(1UL); ldvarg35 = tmp___8; tmp___9 = ldv_init_zalloc(8UL); ldvarg48 = (u64 *)tmp___9; tmp___10 = ldv_init_zalloc(32UL); ldvarg71 = (struct pci_device_id *)tmp___10; ldv_initialize(); ldv_memset((void *)(& ldvarg51), 0, 4UL); ldv_memset((void *)(& ldvarg41), 0, 1UL); ldv_memset((void *)(& ldvarg43), 0, 4UL); ldv_memset((void *)(& ldvarg42), 0, 2UL); ldv_memset((void *)(& ldvarg56), 0, 4UL); ldv_memset((void *)(& ldvarg49), 0, 8UL); ldv_memset((void *)(& ldvarg37), 0, 8UL); ldv_memset((void *)(& ldvarg36), 0, 4UL); ldv_memset((void *)(& ldvarg45), 0, 8UL); ldv_memset((void *)(& ldvarg38), 0, 8UL); ldv_memset((void *)(& ldvarg33), 0, 4UL); ldv_memset((void *)(& ldvarg54), 0, 4UL); ldv_memset((void *)(& ldvarg52), 0, 4UL); ldv_memset((void *)(& ldvarg34), 0, 1UL); ldv_memset((void *)(& ldvarg47), 0, 4UL); ldv_memset((void *)(& ldvarg70), 0, 4UL); ldv_memset((void *)(& ldvarg69), 0, 4UL); ldv_memset((void *)(& ldvarg73), 0, 4UL); ldv_state_variable_11 = 0; ldv_state_variable_21 = 0; work_init_7(); ldv_state_variable_7 = 1; ldv_state_variable_26 = 0; ldv_state_variable_17 = 0; ldv_state_variable_2 = 1; ldv_state_variable_22 = 0; ldv_state_variable_1 = 1; ldv_state_variable_18 = 0; ref_cnt = 0; ldv_state_variable_0 = 1; ldv_state_variable_30 = 0; ldv_state_variable_23 = 0; ldv_state_variable_16 = 0; ldv_state_variable_13 = 0; ldv_state_variable_29 = 0; ldv_state_variable_27 = 0; ldv_state_variable_25 = 0; work_init_6(); ldv_state_variable_6 = 1; ldv_state_variable_28 = 0; ldv_state_variable_3 = 1; ldv_state_variable_9 = 1; ldv_state_variable_12 = 0; ldv_state_variable_20 = 0; ldv_state_variable_14 = 0; ldv_state_variable_15 = 0; work_init_8(); ldv_state_variable_8 = 1; work_init_4(); ldv_state_variable_4 = 1; ldv_state_variable_24 = 0; ldv_state_variable_19 = 0; ldv_state_variable_10 = 0; work_init_5(); ldv_state_variable_5 = 1; ldv_66529: tmp___11 = __VERIFIER_nondet_int(); switch (tmp___11) { case 0: ; if (ldv_state_variable_11 != 0) { ldv_main_exported_11(); } else { } goto ldv_66435; case 1: ; if (ldv_state_variable_21 != 0) { ldv_main_exported_21(); } else { } goto ldv_66435; case 2: ; if (ldv_state_variable_7 != 0) { invoke_work_7(); } else { } goto ldv_66435; case 3: ; if (ldv_state_variable_26 != 0) { ldv_main_exported_26(); } else { } goto ldv_66435; case 4: ; if (ldv_state_variable_17 != 0) { ldv_main_exported_17(); } else { } goto ldv_66435; case 5: ; goto ldv_66435; case 6: ; if (ldv_state_variable_22 != 0) { ldv_main_exported_22(); } else { } goto ldv_66435; case 7: ; goto ldv_66435; case 8: ; if (ldv_state_variable_18 != 0) { ldv_main_exported_18(); } else { } goto ldv_66435; case 9: ; if (ldv_state_variable_0 != 0) { tmp___12 = __VERIFIER_nondet_int(); switch (tmp___12) { case 0: ; if (ldv_state_variable_0 == 3 && ref_cnt == 0) { bnx2x_cleanup(); ldv_state_variable_0 = 2; goto ldv_final; } else { } goto ldv_66447; case 1: ; if (ldv_state_variable_0 == 1) { ldv_retval_0 = bnx2x_init(); if (ldv_retval_0 == 0) { ldv_state_variable_0 = 3; ldv_state_variable_19 = 1; ldv_initialize_bnx2x_phy_19(); ldv_state_variable_10 = 1; ldv_initialize_dcbnl_rtnl_ops_10(); ldv_state_variable_24 = 1; ldv_initialize_bnx2x_phy_24(); ldv_state_variable_20 = 1; ldv_initialize_bnx2x_phy_20(); ldv_state_variable_15 = 1; ldv_initialize_bnx2x_phy_15(); ldv_state_variable_14 = 1; ldv_initialize_bnx2x_phy_14(); ldv_state_variable_12 = 1; ldv_initialize_ethtool_ops_12(); ldv_state_variable_28 = 1; ldv_initialize_pci_error_handlers_28(); ldv_state_variable_25 = 1; ldv_initialize_bnx2x_phy_25(); ldv_state_variable_29 = 1; ldv_initialize_bnx2x_func_sp_drv_ops_29(); ldv_state_variable_16 = 1; ldv_initialize_bnx2x_phy_16(); ldv_state_variable_13 = 1; ldv_initialize_bnx2x_phy_13(); ldv_state_variable_23 = 1; ldv_initialize_bnx2x_phy_23(); ldv_state_variable_18 = 1; ldv_initialize_bnx2x_phy_18(); ldv_state_variable_22 = 1; ldv_initialize_bnx2x_phy_22(); ldv_state_variable_17 = 1; ldv_initialize_bnx2x_phy_17(); ldv_state_variable_26 = 1; ldv_initialize_bnx2x_phy_26(); ldv_state_variable_21 = 1; ldv_initialize_bnx2x_phy_21(); ldv_state_variable_11 = 1; ldv_initialize_ethtool_ops_11(); } else { } if (ldv_retval_0 != 0) { ldv_state_variable_0 = 2; goto ldv_final; } else { } } else { } goto ldv_66447; default: ldv_stop(); } ldv_66447: ; } else { } goto ldv_66435; case 10: ; if (ldv_state_variable_30 != 0) { tmp___13 = __VERIFIER_nondet_int(); switch (tmp___13) { case 0: ; if (ldv_state_variable_30 == 1) { bnx2x_ioctl(bnx2x_netdev_ops_group1, ldvarg57, ldvarg56); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_ioctl(bnx2x_netdev_ops_group1, ldvarg57, ldvarg56); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_ioctl(bnx2x_netdev_ops_group1, ldvarg57, ldvarg56); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 1: ; if (ldv_state_variable_30 == 1) { bnx2x_get_phys_port_id(bnx2x_netdev_ops_group1, ldvarg55); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_get_phys_port_id(bnx2x_netdev_ops_group1, ldvarg55); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_get_phys_port_id(bnx2x_netdev_ops_group1, ldvarg55); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 2: ; if (ldv_state_variable_30 == 1) { bnx2x_get_vf_config(bnx2x_netdev_ops_group1, ldvarg54, ldvarg53); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_get_vf_config(bnx2x_netdev_ops_group1, ldvarg54, ldvarg53); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_get_vf_config(bnx2x_netdev_ops_group1, ldvarg54, ldvarg53); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 3: ; if (ldv_state_variable_30 == 1) { bnx2x_set_vf_link_state(bnx2x_netdev_ops_group1, ldvarg52, ldvarg51); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_set_vf_link_state(bnx2x_netdev_ops_group1, ldvarg52, ldvarg51); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_set_vf_link_state(bnx2x_netdev_ops_group1, ldvarg52, ldvarg51); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 4: ; if (ldv_state_variable_30 == 2) { ldv_retval_2 = bnx2x_open(bnx2x_netdev_ops_group1); if (ldv_retval_2 == 0) { ldv_state_variable_30 = 3; } else { } } else { } goto ldv_66452; case 5: ; if (ldv_state_variable_30 == 3) { bnx2x_start_xmit(ldvarg50, bnx2x_netdev_ops_group1); ldv_state_variable_30 = 3; } else { } goto ldv_66452; case 6: ; if (ldv_state_variable_30 == 1) { bnx2x_fix_features(bnx2x_netdev_ops_group1, ldvarg49); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_fix_features(bnx2x_netdev_ops_group1, ldvarg49); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_fix_features(bnx2x_netdev_ops_group1, ldvarg49); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 7: ; if (ldv_state_variable_30 == 1) { bnx2x_fcoe_get_wwn(bnx2x_netdev_ops_group1, ldvarg48, ldvarg47); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_fcoe_get_wwn(bnx2x_netdev_ops_group1, ldvarg48, ldvarg47); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_fcoe_get_wwn(bnx2x_netdev_ops_group1, ldvarg48, ldvarg47); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 8: ; if (ldv_state_variable_30 == 3) { bnx2x_close(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 9: ; if (ldv_state_variable_30 == 1) { bnx2x_set_rx_mode(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_set_rx_mode(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_set_rx_mode(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 10: ; if (ldv_state_variable_30 == 1) { bnx2x_validate_addr(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_validate_addr(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_validate_addr(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 11: ; if (ldv_state_variable_30 == 1) { bnx2x_low_latency_recv(ldvarg46); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_low_latency_recv(ldvarg46); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_low_latency_recv(ldvarg46); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 12: ; if (ldv_state_variable_30 == 1) { bnx2x_features_check(ldvarg44, bnx2x_netdev_ops_group1, ldvarg45); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_features_check(ldvarg44, bnx2x_netdev_ops_group1, ldvarg45); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_features_check(ldvarg44, bnx2x_netdev_ops_group1, ldvarg45); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 13: ; if (ldv_state_variable_30 == 1) { bnx2x_set_vf_vlan(bnx2x_netdev_ops_group1, ldvarg43, (int )ldvarg42, (int )ldvarg41); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_set_vf_vlan(bnx2x_netdev_ops_group1, ldvarg43, (int )ldvarg42, (int )ldvarg41); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_set_vf_vlan(bnx2x_netdev_ops_group1, ldvarg43, (int )ldvarg42, (int )ldvarg41); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 14: ; if (ldv_state_variable_30 == 1) { poll_bnx2x(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { poll_bnx2x(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { poll_bnx2x(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 15: ; if (ldv_state_variable_30 == 1) { bnx2x_select_queue(bnx2x_netdev_ops_group1, ldvarg40, ldvarg39, ldvarg38); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_select_queue(bnx2x_netdev_ops_group1, ldvarg40, ldvarg39, ldvarg38); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_select_queue(bnx2x_netdev_ops_group1, ldvarg40, ldvarg39, ldvarg38); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 16: ; if (ldv_state_variable_30 == 1) { bnx2x_set_features(bnx2x_netdev_ops_group1, ldvarg37); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_set_features(bnx2x_netdev_ops_group1, ldvarg37); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_set_features(bnx2x_netdev_ops_group1, ldvarg37); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 17: ; if (ldv_state_variable_30 == 3) { bnx2x_change_mtu(bnx2x_netdev_ops_group1, ldvarg36); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_change_mtu(bnx2x_netdev_ops_group1, ldvarg36); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 18: ; if (ldv_state_variable_30 == 1) { bnx2x_change_mac_addr(bnx2x_netdev_ops_group1, ldvarg35); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_change_mac_addr(bnx2x_netdev_ops_group1, ldvarg35); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_change_mac_addr(bnx2x_netdev_ops_group1, ldvarg35); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 19: ; if (ldv_state_variable_30 == 1) { bnx2x_setup_tc(bnx2x_netdev_ops_group1, (int )ldvarg34); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_setup_tc(bnx2x_netdev_ops_group1, (int )ldvarg34); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_setup_tc(bnx2x_netdev_ops_group1, (int )ldvarg34); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 20: ; if (ldv_state_variable_30 == 1) { bnx2x_set_vf_mac(bnx2x_netdev_ops_group1, ldvarg33, ldvarg32); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_set_vf_mac(bnx2x_netdev_ops_group1, ldvarg33, ldvarg32); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_set_vf_mac(bnx2x_netdev_ops_group1, ldvarg33, ldvarg32); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 21: ; if (ldv_state_variable_30 == 1) { bnx2x_tx_timeout(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 3) { bnx2x_tx_timeout(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 3; } else { } if (ldv_state_variable_30 == 2) { bnx2x_tx_timeout(bnx2x_netdev_ops_group1); ldv_state_variable_30 = 2; } else { } goto ldv_66452; case 22: ; if (ldv_state_variable_30 == 1) { ldv_retval_1 = ldv_ndo_init_30(); if (ldv_retval_1 == 0) { ldv_state_variable_30 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_66452; case 23: ; if (ldv_state_variable_30 == 2) { ldv_ndo_uninit_30(); ldv_state_variable_30 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_66452; default: ldv_stop(); } ldv_66452: ; } else { } goto ldv_66435; case 11: ; if (ldv_state_variable_23 != 0) { ldv_main_exported_23(); } else { } goto ldv_66435; case 12: ; if (ldv_state_variable_16 != 0) { ldv_main_exported_16(); } else { } goto ldv_66435; case 13: ; if (ldv_state_variable_13 != 0) { ldv_main_exported_13(); } else { } goto ldv_66435; case 14: ; if (ldv_state_variable_29 != 0) { tmp___14 = __VERIFIER_nondet_int(); switch (tmp___14) { case 0: ; if (ldv_state_variable_29 == 1) { bnx2x_gunzip_end(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 1: ; if (ldv_state_variable_29 == 1) { bnx2x_gunzip_init(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 2: ; if (ldv_state_variable_29 == 1) { bnx2x_init_hw_func(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 3: ; if (ldv_state_variable_29 == 1) { bnx2x_release_firmware(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 4: ; if (ldv_state_variable_29 == 1) { bnx2x_reset_port(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 5: ; if (ldv_state_variable_29 == 1) { bnx2x_init_hw_port(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 6: ; if (ldv_state_variable_29 == 1) { bnx2x_reset_common(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 7: ; if (ldv_state_variable_29 == 1) { bnx2x_init_firmware(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 8: ; if (ldv_state_variable_29 == 1) { bnx2x_reset_func(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 9: ; if (ldv_state_variable_29 == 1) { bnx2x_init_hw_common(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; case 10: ; if (ldv_state_variable_29 == 1) { bnx2x_init_hw_common_chip(bnx2x_func_sp_drv_group0); ldv_state_variable_29 = 1; } else { } goto ldv_66482; default: ldv_stop(); } ldv_66482: ; } else { } goto ldv_66435; case 15: ; if (ldv_state_variable_27 != 0) { tmp___15 = __VERIFIER_nondet_int(); switch (tmp___15) { case 0: ; if (ldv_state_variable_27 == 1) { ldv_retval_7 = bnx2x_init_one(bnx2x_pci_driver_group1, (struct pci_device_id const *)ldvarg71); if (ldv_retval_7 == 0) { ldv_state_variable_27 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_66496; case 1: ; if (ldv_state_variable_27 == 2 && pci_counter == 0) { ldv_retval_6 = bnx2x_suspend(bnx2x_pci_driver_group1, ldvarg70); if (ldv_retval_6 == 0) { ldv_state_variable_27 = 3; } else { } } else { } goto ldv_66496; case 2: ; if (ldv_state_variable_27 == 4) { ldv_retval_5 = bnx2x_resume(bnx2x_pci_driver_group1); if (ldv_retval_5 == 0) { ldv_state_variable_27 = 2; } else { } } else { } if (ldv_state_variable_27 == 3) { ldv_retval_5 = bnx2x_resume(bnx2x_pci_driver_group1); if (ldv_retval_5 == 0) { ldv_state_variable_27 = 2; } else { } } else { } if (ldv_state_variable_27 == 5) { ldv_retval_5 = bnx2x_resume(bnx2x_pci_driver_group1); if (ldv_retval_5 == 0) { ldv_state_variable_27 = 2; } else { } } else { } goto ldv_66496; case 3: ; if (ldv_state_variable_27 == 4) { bnx2x_shutdown(bnx2x_pci_driver_group1); ldv_state_variable_27 = 4; } else { } if (ldv_state_variable_27 == 3) { bnx2x_shutdown(bnx2x_pci_driver_group1); ldv_state_variable_27 = 3; } else { } if (ldv_state_variable_27 == 2) { bnx2x_shutdown(bnx2x_pci_driver_group1); ldv_state_variable_27 = 2; } else { } if (ldv_state_variable_27 == 5) { bnx2x_shutdown(bnx2x_pci_driver_group1); ldv_state_variable_27 = 5; } else { } goto ldv_66496; case 4: ; if (ldv_state_variable_27 == 4) { bnx2x_sriov_configure(bnx2x_pci_driver_group1, ldvarg69); ldv_state_variable_27 = 4; } else { } if (ldv_state_variable_27 == 1) { bnx2x_sriov_configure(bnx2x_pci_driver_group1, ldvarg69); ldv_state_variable_27 = 1; } else { } if (ldv_state_variable_27 == 3) { bnx2x_sriov_configure(bnx2x_pci_driver_group1, ldvarg69); ldv_state_variable_27 = 3; } else { } if (ldv_state_variable_27 == 2) { bnx2x_sriov_configure(bnx2x_pci_driver_group1, ldvarg69); ldv_state_variable_27 = 2; } else { } if (ldv_state_variable_27 == 5) { bnx2x_sriov_configure(bnx2x_pci_driver_group1, ldvarg69); ldv_state_variable_27 = 5; } else { } goto ldv_66496; case 5: ; if (ldv_state_variable_27 == 4) { bnx2x_remove_one(bnx2x_pci_driver_group1); ldv_state_variable_27 = 1; } else { } if (ldv_state_variable_27 == 3) { bnx2x_remove_one(bnx2x_pci_driver_group1); ldv_state_variable_27 = 1; } else { } if (ldv_state_variable_27 == 2) { bnx2x_remove_one(bnx2x_pci_driver_group1); ldv_state_variable_27 = 1; } else { } if (ldv_state_variable_27 == 5) { bnx2x_remove_one(bnx2x_pci_driver_group1); ldv_state_variable_27 = 1; } else { } goto ldv_66496; case 6: ; if (ldv_state_variable_27 == 3) { ldv_retval_4 = ldv_suspend_late_27(); if (ldv_retval_4 == 0) { ldv_state_variable_27 = 4; } else { } } else { } goto ldv_66496; case 7: ; if (ldv_state_variable_27 == 4) { ldv_retval_3 = ldv_resume_early_27(); if (ldv_retval_3 == 0) { ldv_state_variable_27 = 5; } else { } } else { } if (ldv_state_variable_27 == 3) { ldv_retval_3 = ldv_resume_early_27(); if (ldv_retval_3 == 0) { ldv_state_variable_27 = 5; } else { } } else { } goto ldv_66496; default: ldv_stop(); } ldv_66496: ; } else { } goto ldv_66435; case 16: ; if (ldv_state_variable_25 != 0) { ldv_main_exported_25(); } else { } goto ldv_66435; case 17: ; if (ldv_state_variable_6 != 0) { invoke_work_6(); } else { } goto ldv_66435; case 18: ; if (ldv_state_variable_28 != 0) { tmp___16 = __VERIFIER_nondet_int(); switch (tmp___16) { case 0: ; if (ldv_state_variable_28 == 3) { bnx2x_io_resume(bnx2x_err_handler_group0); ldv_state_variable_28 = 2; } else { } goto ldv_66509; case 1: ; if (ldv_state_variable_28 == 1) { bnx2x_io_slot_reset(bnx2x_err_handler_group0); ldv_state_variable_28 = 1; } else { } if (ldv_state_variable_28 == 3) { bnx2x_io_slot_reset(bnx2x_err_handler_group0); ldv_state_variable_28 = 3; } else { } if (ldv_state_variable_28 == 2) { bnx2x_io_slot_reset(bnx2x_err_handler_group0); ldv_state_variable_28 = 2; } else { } goto ldv_66509; case 2: ; if (ldv_state_variable_28 == 1) { bnx2x_io_error_detected(bnx2x_err_handler_group0, (pci_channel_state_t )ldvarg73); ldv_state_variable_28 = 1; } else { } if (ldv_state_variable_28 == 3) { bnx2x_io_error_detected(bnx2x_err_handler_group0, (pci_channel_state_t )ldvarg73); ldv_state_variable_28 = 3; } else { } if (ldv_state_variable_28 == 2) { bnx2x_io_error_detected(bnx2x_err_handler_group0, (pci_channel_state_t )ldvarg73); ldv_state_variable_28 = 2; } else { } goto ldv_66509; case 3: ; if (ldv_state_variable_28 == 2) { ldv_suspend_28(); ldv_state_variable_28 = 3; } else { } goto ldv_66509; case 4: ; if (ldv_state_variable_28 == 3) { ldv_release_28(); ldv_state_variable_28 = 1; ref_cnt = ref_cnt - 1; } else { } if (ldv_state_variable_28 == 2) { ldv_release_28(); ldv_state_variable_28 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_66509; case 5: ; if (ldv_state_variable_28 == 1) { ldv_probe_28(); ldv_state_variable_28 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_66509; default: ldv_stop(); } ldv_66509: ; } else { } goto ldv_66435; case 19: ; goto ldv_66435; case 20: ; if (ldv_state_variable_9 != 0) { choose_timer_9(ldv_timer_list_9); } else { } goto ldv_66435; case 21: ; if (ldv_state_variable_12 != 0) { ldv_main_exported_12(); } else { } goto ldv_66435; case 22: ; if (ldv_state_variable_20 != 0) { ldv_main_exported_20(); } else { } goto ldv_66435; case 23: ; if (ldv_state_variable_14 != 0) { ldv_main_exported_14(); } else { } goto ldv_66435; case 24: ; if (ldv_state_variable_15 != 0) { ldv_main_exported_15(); } else { } goto ldv_66435; case 25: ; if (ldv_state_variable_8 != 0) { invoke_work_8(); } else { } goto ldv_66435; case 26: ; if (ldv_state_variable_4 != 0) { invoke_work_4(); } else { } goto ldv_66435; case 27: ; if (ldv_state_variable_24 != 0) { ldv_main_exported_24(); } else { } goto ldv_66435; case 28: ; if (ldv_state_variable_19 != 0) { ldv_main_exported_19(); } else { } goto ldv_66435; case 29: ; if (ldv_state_variable_10 != 0) { ldv_main_exported_10(); } else { } goto ldv_66435; case 30: ; if (ldv_state_variable_5 != 0) { invoke_work_5(); } else { } goto ldv_66435; default: ldv_stop(); } ldv_66435: ; goto ldv_66529; ldv_final: ldv_check_final_state(); return 0; } } __inline static bool IS_ERR(void const *ptr ) { bool tmp ; { tmp = ldv_is_err(ptr); return (tmp); } } bool ldv_queue_work_on_5(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_6(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_7(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_8(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_9(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_cancel_delayed_work_10(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(& ldv_func_arg1->work); return (ldv_func_res); } } bool ldv_cancel_delayed_work_11(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___4 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(& ldv_func_arg1->work); return (ldv_func_res); } } void ldv_flush_workqueue_12(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } int ldv_mod_timer_13(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_9(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } void ldv_flush_workqueue_14(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } void ldv_flush_workqueue_15(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_cancel_work_sync_16(struct work_struct *ldv_func_arg1 ) { ldv_func_ret_type___6 ldv_func_res ; bool tmp ; { tmp = cancel_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(ldv_func_arg1); return (ldv_func_res); } } void ldv_free_netdev_17(struct net_device *dev ) { { free_netdev(dev); ldv_state_variable_30 = 0; return; } } int ldv_register_netdev_18(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_30 = 1; ldv_net_device_ops_30(); return (ldv_func_res); } } void ldv_free_netdev_19(struct net_device *dev ) { { free_netdev(dev); ldv_state_variable_30 = 0; return; } } void ldv_unregister_netdev_20(struct net_device *dev ) { { unregister_netdev(dev); ldv_state_variable_30 = 0; return; } } bool ldv_cancel_delayed_work_sync_21(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_7(& ldv_func_arg1->work); return (ldv_func_res); } } void ldv_free_netdev_22(struct net_device *dev ) { { free_netdev(dev); ldv_state_variable_30 = 0; return; } } int ldv_del_timer_sync_23(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___9 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_24(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___10 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(& ldv_func_arg1->work); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_25(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___11 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(& ldv_func_arg1->work); return (ldv_func_res); } } void ldv_destroy_workqueue_26(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } int ldv___pci_register_driver_27(struct pci_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) { ldv_func_ret_type___12 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_27 = 1; ldv_pci_driver_27(); return (ldv_func_res); } } void ldv_destroy_workqueue_28(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } void ldv_destroy_workqueue_29(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } void ldv_pci_unregister_driver_30(struct pci_driver *ldv_func_arg1 ) { { pci_unregister_driver(ldv_func_arg1); ldv_state_variable_27 = 0; return; } } void ldv_destroy_workqueue_31(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } void ldv_destroy_workqueue_32(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_65(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_67(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_66(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_69(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_68(struct workqueue_struct *ldv_func_arg1 ) ; int bnx2x_get_ext_phy_fw_version(struct link_params *params , u8 *version___0 , u16 len ) ; int bnx2x_set_led(struct link_params *params , struct link_vars *vars , u8 mode , u32 speed ) ; void bnx2x_ext_phy_hw_reset(struct bnx2x *bp , u8 port ) ; void bnx2x_sfx7101_sp_sw_reset(struct bnx2x *bp , struct bnx2x_phy *phy ) ; int bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy , struct link_params *params , u8 dev_addr , u16 addr , u16 byte_cnt , u8 *o_buf ) ; u32 bnx2x_phy_selection(struct link_params *params ) ; int bnx2x_update_pfc(struct link_params *params , struct link_vars *vars , struct bnx2x_nig_brb_pfc_port_params *pfc_params ) ; int bnx2x_ets_disabled(struct link_params *params , struct link_vars *vars ) ; void bnx2x_ets_bw_limit(struct link_params const *params , u32 const cos0_bw , u32 const cos1_bw ) ; int bnx2x_ets_strict(struct link_params const *params , u8 const strict_cos ) ; int bnx2x_ets_e3b0_config(struct link_params const *params , struct link_vars const *vars , struct bnx2x_ets_params *ets_params ) ; static int bnx2x_check_half_open_conn(struct link_params *params , struct link_vars *vars , u8 notify ) ; static int bnx2x_sfp_module_detection(struct bnx2x_phy *phy , struct link_params *params ) ; static u32 bnx2x_bits_en(struct bnx2x *bp , u32 reg , u32 bits ) { u32 val ; unsigned int tmp ; { tmp = readl((void const volatile *)bp->regview + (unsigned long )reg); val = tmp; val = val | bits; writel(val, (void volatile *)bp->regview + (unsigned long )reg); return (val); } } static u32 bnx2x_bits_dis(struct bnx2x *bp , u32 reg , u32 bits ) { u32 val ; unsigned int tmp ; { tmp = readl((void const volatile *)bp->regview + (unsigned long )reg); val = tmp; val = ~ bits & val; writel(val, (void volatile *)bp->regview + (unsigned long )reg); return (val); } } static int bnx2x_check_lfa(struct link_params *params ) { u32 link_status ; u32 cfg_idx ; u32 lfa_mask ; u32 cfg_size ; u32 cur_speed_cap_mask ; u32 cur_req_fc_auto_adv ; u32 additional_config ; u32 saved_val ; u32 req_val ; u32 eee_status ; struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; unsigned int tmp___4 ; long tmp___5 ; long tmp___6 ; { bp = params->bp; additional_config = readl((void const volatile *)(bp->regview + ((unsigned long )params->lfa_base + 20UL))); if ((additional_config & 65536U) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]No LFA due to DCC flap after clp exit\n", "bnx2x_check_lfa", 265, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(additional_config & 4294901759U, (void volatile *)(bp->regview + ((unsigned long )params->lfa_base + 20UL))); return (8); } else { } link_status = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 16UL) + 1636UL))); if ((link_status & 1U) == 0U) { return (1); } else { } if ((params->feature_config_flags & 16384U) != 0U) { return (0); } else { } if ((unsigned int )params->loopback_mode != 0U) { return (2); } else { } if (params->lfa_base == 0U) { return (4); } else { } if ((unsigned int )params->num_phys == 3U) { cfg_size = 2U; lfa_mask = 4294967295U; } else { cfg_size = 1U; lfa_mask = 65535U; } saved_val = readl((void const volatile *)bp->regview + (unsigned long )params->lfa_base); req_val = (u32 )((int )params->req_duplex[0] | ((int )params->req_duplex[1] << 16)); if (((saved_val ^ req_val) & lfa_mask) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Duplex mismatch %x vs. %x\n", "bnx2x_check_lfa", 307, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", saved_val & lfa_mask, req_val & lfa_mask); } else { } return (3); } else { } saved_val = readl((void const volatile *)(bp->regview + ((unsigned long )params->lfa_base + 4UL))); req_val = (u32 )((int )params->req_flow_ctrl[0] | ((int )params->req_flow_ctrl[1] << 16)); if (((saved_val ^ req_val) & lfa_mask) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Flow control mismatch %x vs. %x\n", "bnx2x_check_lfa", 316, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", saved_val & lfa_mask, req_val & lfa_mask); } else { } return (6); } else { } saved_val = readl((void const volatile *)(bp->regview + ((unsigned long )params->lfa_base + 8UL))); req_val = (u32 )((int )params->req_line_speed[0] | ((int )params->req_line_speed[1] << 16)); if (((saved_val ^ req_val) & lfa_mask) != 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Link speed mismatch %x vs. %x\n", "bnx2x_check_lfa", 325, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", saved_val & lfa_mask, req_val & lfa_mask); } else { } return (5); } else { } cfg_idx = 0U; goto ldv_51602; ldv_51601: cur_speed_cap_mask = readl((void const volatile *)(bp->regview + ((unsigned long )params->lfa_base + ((unsigned long )cfg_idx + 3UL) * 4UL))); if (params->speed_cap_mask[cfg_idx] != cur_speed_cap_mask) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Speed Cap mismatch %x vs. %x\n", "bnx2x_check_lfa", 337, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cur_speed_cap_mask, params->speed_cap_mask[cfg_idx]); } else { } return (7); } else { } cfg_idx = cfg_idx + 1U; ldv_51602: ; if (cfg_idx < cfg_size) { goto ldv_51601; } else { } tmp___4 = readl((void const volatile *)(bp->regview + ((unsigned long )params->lfa_base + 20UL))); cur_req_fc_auto_adv = tmp___4 & 65535U; if ((int )((unsigned short )cur_req_fc_auto_adv) != (int )params->req_fc_auto_adv) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Flow Ctrl AN mismatch %x vs. %x\n", "bnx2x_check_lfa", 349, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cur_req_fc_auto_adv, (int )params->req_fc_auto_adv); } else { } return (6); } else { } eee_status = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem2_base + ((unsigned long )params->port + 76UL) * 4UL))); if ((eee_status & 536870912U) != (params->eee_mode & 1073741824U) || (eee_status & 268435456U) != (params->eee_mode & 2147483648U)) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]EEE mismatch %x vs. %x\n", "bnx2x_check_lfa", 362, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", params->eee_mode, eee_status); } else { } return (9); } else { } return (0); } } static void bnx2x_get_epio(struct bnx2x *bp , u32 epio_pin , u32 *en ) { u32 epio_mask ; u32 gp_oenable ; long tmp ; unsigned int tmp___0 ; { *en = 0U; if (epio_pin > 31U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid EPIO pin %d to get\n", "bnx2x_get_epio", 378, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", epio_pin); } else { } return; } else { } epio_mask = (u32 )(1 << (int )epio_pin); gp_oenable = readl((void const volatile *)bp->regview + 524488U); writel(~ epio_mask & gp_oenable, (void volatile *)bp->regview + 524488U); tmp___0 = readl((void const volatile *)bp->regview + 524480U); *en = (tmp___0 & epio_mask) >> (int )epio_pin; return; } } static void bnx2x_set_epio(struct bnx2x *bp , u32 epio_pin , u32 en ) { u32 epio_mask ; u32 gp_output ; u32 gp_oenable ; long tmp ; long tmp___0 ; { if (epio_pin > 31U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid EPIO pin %d to set\n", "bnx2x_set_epio", 395, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", epio_pin); } else { } return; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting EPIO pin %d to %d\n", "bnx2x_set_epio", 398, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", epio_pin, en); } else { } epio_mask = (u32 )(1 << (int )epio_pin); gp_output = readl((void const volatile *)bp->regview + 524484U); if (en != 0U) { gp_output = gp_output | epio_mask; } else { gp_output = ~ epio_mask & gp_output; } writel(gp_output, (void volatile *)bp->regview + 524484U); gp_oenable = readl((void const volatile *)bp->regview + 524488U); writel(gp_oenable | epio_mask, (void volatile *)bp->regview + 524488U); return; } } static void bnx2x_set_cfg_pin(struct bnx2x *bp , u32 pin_cfg , u32 val ) { u8 gpio_num ; u8 gpio_port ; { if (pin_cfg == 0U) { return; } else { } if (pin_cfg > 8U) { bnx2x_set_epio(bp, pin_cfg - 9U, val); } else { gpio_num = ((unsigned int )((u8 )pin_cfg) - 1U) & 3U; gpio_port = (u8 )((pin_cfg - 1U) >> 2); bnx2x_set_gpio(bp, (int )gpio_num, (u32 )((unsigned char )val), (int )gpio_port); } return; } } static u32 bnx2x_get_cfg_pin(struct bnx2x *bp , u32 pin_cfg , u32 *val ) { u8 gpio_num ; u8 gpio_port ; int tmp ; { if (pin_cfg == 0U) { return (4294967274U); } else { } if (pin_cfg > 8U) { bnx2x_get_epio(bp, pin_cfg - 9U, val); } else { gpio_num = ((unsigned int )((u8 )pin_cfg) - 1U) & 3U; gpio_port = (u8 )((pin_cfg - 1U) >> 2); tmp = bnx2x_get_gpio(bp, (int )gpio_num, (int )gpio_port); *val = (u32 )tmp; } return (0U); } } static void bnx2x_ets_e2e3a0_disabled(struct link_params *params ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]ETS E2E3 disabled configuration\n", "bnx2x_ets_e2e3a0_disabled", 449, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(18056U, (void volatile *)bp->regview + 98532U); writel(7U, (void volatile *)bp->regview + 98536U); writel(0U, (void volatile *)bp->regview + 98540U); writel(256U, (void volatile *)bp->regview + 98548U); writel(0U, (void volatile *)bp->regview + 98544U); writel(0U, (void volatile *)bp->regview + 98552U); writel(0U, (void volatile *)bp->regview + 98556U); writel(0U, (void volatile *)bp->regview + 98572U); writel(0U, (void volatile *)bp->regview + 98576U); writel(0U, (void volatile *)bp->regview + 1425484U); writel(0U, (void volatile *)bp->regview + 1425488U); writel(10000U, (void volatile *)bp->regview + 1425492U); writel(10000U, (void volatile *)bp->regview + 1425496U); writel(10000000U, (void volatile *)bp->regview + 1425500U); writel(10000000U, (void volatile *)bp->regview + 1425504U); writel(0U, (void volatile *)bp->regview + 1425508U); return; } } static u32 bnx2x_ets_get_min_w_val_nig(struct link_vars const *vars ) { u32 min_w_val ; { min_w_val = 0U; if ((unsigned int )((unsigned char )vars->link_up) != 0U) { if ((unsigned int )((unsigned short )vars->line_speed) == 20000U) { min_w_val = 2720U; } else { min_w_val = 1360U; } } else { min_w_val = 2720U; } return (min_w_val); } } static u32 bnx2x_ets_get_credit_upper_bound(u32 const min_w_val ) { u32 credit_upper_bound ; { credit_upper_bound = 9700U > (unsigned int )min_w_val * 150U ? 9700U : (unsigned int )min_w_val * 150U; return (credit_upper_bound); } } static void bnx2x_ets_e3b0_set_credit_upper_bound_nig(struct link_params const *params , u32 const min_w_val ) { struct bnx2x *bp ; u8 port ; u32 credit_upper_bound ; u32 tmp ; { bp = params->bp; port = params->port; tmp = bnx2x_ets_get_credit_upper_bound(min_w_val); credit_upper_bound = tmp; writel(credit_upper_bound, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98904UL : 98572UL))); writel(credit_upper_bound, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98908UL : 98576UL))); writel(credit_upper_bound, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98912UL : 98580UL))); writel(credit_upper_bound, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98916UL : 98584UL))); writel(credit_upper_bound, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98920UL : 98588UL))); writel(credit_upper_bound, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 100084UL : 100000UL))); if ((unsigned int )port == 0U) { writel(credit_upper_bound, (void volatile *)bp->regview + 100004U); writel(credit_upper_bound, (void volatile *)bp->regview + 100008U); writel(credit_upper_bound, (void volatile *)bp->regview + 100012U); } else { } return; } } static void bnx2x_ets_e3b0_nig_disabled(struct link_params const *params , struct link_vars const *vars ) { struct bnx2x *bp ; u8 port ; u32 min_w_val ; u32 tmp ; { bp = params->bp; port = params->port; tmp = bnx2x_ets_get_min_w_val_nig(vars); min_w_val = tmp; if ((unsigned int )port != 0U) { writel(5517840U, (void volatile *)bp->regview + 100064U); writel(0U, (void volatile *)bp->regview + 100068U); } else { writel(1985229328U, (void volatile *)bp->regview + 99968U); writel(8U, (void volatile *)bp->regview + 99972U); } writel(256U, (void volatile *)bp->regview + 98880U); if ((unsigned int )port != 0U) { writel(2164035U, (void volatile *)bp->regview + 100072U); writel(0U, (void volatile *)bp->regview + 100076U); } else { writel(1126238326U, (void volatile *)bp->regview + 99976U); writel(5U, (void volatile *)bp->regview + 99980U); } if ((unsigned int )port != 0U) { writel(63U, (void volatile *)bp->regview + 98868U); } else { writel(511U, (void volatile *)bp->regview + 98536U); } writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98872UL : 98540UL))); writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98884UL : 98552UL))); writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98888UL : 98556UL))); writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98892UL : 98560UL))); writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98896UL : 98564UL))); writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98900UL : 98568UL))); writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 100080UL : 99984UL))); if ((unsigned int )port == 0U) { writel(0U, (void volatile *)bp->regview + 99988U); writel(0U, (void volatile *)bp->regview + 99992U); writel(0U, (void volatile *)bp->regview + 99996U); } else { } bnx2x_ets_e3b0_set_credit_upper_bound_nig(params, min_w_val); return; } } static void bnx2x_ets_e3b0_set_credit_upper_bound_pbf(struct link_params const *params , u32 const min_w_val ) { struct bnx2x *bp ; u32 credit_upper_bound ; u32 tmp ; u8 port ; u32 base_upper_bound ; u8 max_cos ; u8 i ; { bp = params->bp; tmp = bnx2x_ets_get_credit_upper_bound(min_w_val); credit_upper_bound = tmp; port = params->port; base_upper_bound = 0U; max_cos = 0U; i = 0U; if ((unsigned int )port == 0U) { base_upper_bound = 1426124U; max_cos = 6U; } else { base_upper_bound = 1426148U; max_cos = 3U; } i = 0U; goto ldv_51673; ldv_51672: writel(credit_upper_bound, (void volatile *)bp->regview + (unsigned long )((u32 )((int )i << 2) + base_upper_bound)); i = (u8 )((int )i + 1); ldv_51673: ; if ((int )i < (int )max_cos) { goto ldv_51672; } else { } return; } } static void bnx2x_ets_e3b0_pbf_disabled(struct link_params const *params ) { struct bnx2x *bp ; u8 port ; u32 min_w_val_pbf ; u8 i ; u32 base_weight ; u8 max_cos ; { bp = params->bp; port = params->port; min_w_val_pbf = 10000U; i = 0U; base_weight = 0U; max_cos = 0U; if ((unsigned int )port != 0U) { writel(1672U, (void volatile *)bp->regview + 1426036U); } else { writel(181896U, (void volatile *)bp->regview + 1426032U); } if ((unsigned int )port != 0U) { writel(1672U, (void volatile *)bp->regview + 1426060U); } else { writel(181896U, (void volatile *)bp->regview + 1426056U); } writel(256U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 1426084UL : 1426080UL))); writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 1426044UL : 1426040UL))); writel(0U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 1426052UL : 1426048UL))); if ((unsigned int )port == 0U) { base_weight = 1426088U; max_cos = 6U; } else { base_weight = 1426112U; max_cos = 3U; } i = 0U; goto ldv_51685; ldv_51684: writel(0U, (void volatile *)bp->regview + (unsigned long )((u32 )((int )i * 4) + base_weight)); i = (u8 )((int )i + 1); ldv_51685: ; if ((int )i < (int )max_cos) { goto ldv_51684; } else { } bnx2x_ets_e3b0_set_credit_upper_bound_pbf(params, min_w_val_pbf); return; } } static int bnx2x_ets_e3b0_disabled(struct link_params const *params , struct link_vars const *vars ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; if ((((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) || ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 != 4096U : (bp->common.chip_id & 61440U) != 4096U)) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_disabled the chip isn\'t E3B0\n", "bnx2x_ets_e3b0_disabled", 755, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_ets_e3b0_nig_disabled(params, vars); bnx2x_ets_e3b0_pbf_disabled(params); return (0); } } int bnx2x_ets_disabled(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; int bnx2x_status ; long tmp ; { bp = params->bp; bnx2x_status = 0; if (((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) || ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U))) { bnx2x_ets_e2e3a0_disabled(params); } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { bnx2x_status = bnx2x_ets_e3b0_disabled((struct link_params const *)params, (struct link_vars const *)vars); } else { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_disabled - chip not supported\n", "bnx2x_ets_disabled", 782, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } return (bnx2x_status); } } static int bnx2x_ets_e3b0_cli_map(struct link_params const *params , struct bnx2x_ets_params const *ets_params , u8 const cos_sp_bitmap , u8 const cos_bw_bitmap ) { struct bnx2x *bp ; u8 port ; u8 nig_cli_sp_bitmap ; u8 pbf_cli_sp_bitmap ; u8 nig_cli_subject2wfq_bitmap ; u8 pbf_cli_subject2wfq_bitmap ; { bp = params->bp; port = params->port; nig_cli_sp_bitmap = (u8 const )((int )((signed char )((int )cos_sp_bitmap << 3)) | 7); pbf_cli_sp_bitmap = cos_sp_bitmap; nig_cli_subject2wfq_bitmap = (int const )cos_bw_bitmap << 3U; pbf_cli_subject2wfq_bitmap = cos_bw_bitmap; writel((unsigned int )nig_cli_sp_bitmap, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98868UL : 98536UL))); writel((unsigned int )pbf_cli_sp_bitmap, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 1426044UL : 1426040UL))); writel((unsigned int )nig_cli_subject2wfq_bitmap, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98872UL : 98540UL))); writel((unsigned int )pbf_cli_subject2wfq_bitmap, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 1426052UL : 1426048UL))); return (0); } } static int bnx2x_ets_e3b0_set_cos_bw(struct bnx2x *bp , u8 const cos_entry , u32 const min_w_val_nig , u32 const min_w_val_pbf , u16 const total_bw , u8 const bw , u8 const port ) { u32 nig_reg_adress_crd_weight ; u32 pbf_reg_adress_crd_weight ; u32 cos_bw_nig ; u32 cos_bw_pbf ; { nig_reg_adress_crd_weight = 0U; pbf_reg_adress_crd_weight = 0U; cos_bw_nig = (((unsigned int )((unsigned char )bw) != 0U ? (unsigned int )bw : 1U) * (unsigned int )min_w_val_nig) / (unsigned int )total_bw; cos_bw_pbf = (((unsigned int )((unsigned char )bw) != 0U ? (unsigned int )bw : 1U) * (unsigned int )min_w_val_pbf) / (unsigned int )total_bw; switch ((int )cos_entry) { case 0: nig_reg_adress_crd_weight = (unsigned int )((unsigned char )port) != 0U ? 98884U : 98552U; pbf_reg_adress_crd_weight = (unsigned int )((unsigned char )port) != 0U ? 1426112U : 1426088U; goto ldv_51726; case 1: nig_reg_adress_crd_weight = (unsigned int )((unsigned char )port) != 0U ? 98888U : 98556U; pbf_reg_adress_crd_weight = (unsigned int )((unsigned char )port) != 0U ? 1426116U : 1426092U; goto ldv_51726; case 2: nig_reg_adress_crd_weight = (unsigned int )((unsigned char )port) != 0U ? 98892U : 98560U; pbf_reg_adress_crd_weight = (unsigned int )((unsigned char )port) != 0U ? 1426120U : 1426096U; goto ldv_51726; case 3: ; if ((unsigned int )((unsigned char )port) != 0U) { return (-22); } else { } nig_reg_adress_crd_weight = 98564U; pbf_reg_adress_crd_weight = 1426100U; goto ldv_51726; case 4: ; if ((unsigned int )((unsigned char )port) != 0U) { return (-22); } else { } nig_reg_adress_crd_weight = 98568U; pbf_reg_adress_crd_weight = 1426104U; goto ldv_51726; case 5: ; if ((unsigned int )((unsigned char )port) != 0U) { return (-22); } else { } nig_reg_adress_crd_weight = 99984U; pbf_reg_adress_crd_weight = 1426108U; goto ldv_51726; } ldv_51726: writel(cos_bw_nig, (void volatile *)bp->regview + (unsigned long )nig_reg_adress_crd_weight); writel(cos_bw_pbf, (void volatile *)bp->regview + (unsigned long )pbf_reg_adress_crd_weight); return (0); } } static int bnx2x_ets_e3b0_get_total_bw(struct link_params const *params , struct bnx2x_ets_params *ets_params , u16 *total_bw ) { struct bnx2x *bp ; u8 cos_idx ; u8 is_bw_cos_exist ; long tmp ; long tmp___0 ; long tmp___1 ; { bp = params->bp; cos_idx = 0U; is_bw_cos_exist = 0U; *total_bw = 0U; cos_idx = 0U; goto ldv_51742; ldv_51741: ; if ((unsigned int )ets_params->cos[(int )cos_idx].state == 1U) { is_bw_cos_exist = 1U; if ((unsigned int )ets_params->cos[(int )cos_idx].params.bw_params.bw == 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_E3B0_config BWwas set to 0\n", "bnx2x_ets_e3b0_get_total_bw", 916, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } ets_params->cos[(int )cos_idx].params.bw_params.bw = 1U; } else { } *total_bw = (int )*total_bw + (int )((u16 )ets_params->cos[(int )cos_idx].params.bw_params.bw); } else { } cos_idx = (u8 )((int )cos_idx + 1); ldv_51742: ; if ((int )ets_params->num_of_cos > (int )cos_idx) { goto ldv_51741; } else { } if ((unsigned int )is_bw_cos_exist == 1U && (unsigned int )*total_bw != 100U) { if ((unsigned int )*total_bw == 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_E3B0_config total BW shouldn\'t be 0\n", "bnx2x_ets_e3b0_get_total_bw", 932, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_E3B0_config total BW should be 100\n", "bnx2x_ets_e3b0_get_total_bw", 936, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } return (0); } } static void bnx2x_ets_e3b0_sp_pri_to_cos_init(u8 *sp_pri_to_cos ) { u8 pri ; { pri = 0U; pri = 0U; goto ldv_51749; ldv_51748: *(sp_pri_to_cos + (unsigned long )pri) = 255U; pri = (u8 )((int )pri + 1); ldv_51749: ; if ((unsigned int )pri <= 5U) { goto ldv_51748; } else { } return; } } static int bnx2x_ets_e3b0_sp_pri_to_cos_set(struct link_params const *params , u8 *sp_pri_to_cos , u8 const pri , u8 const cos_entry ) { struct bnx2x *bp ; u8 port ; u8 max_num_of_cos ; long tmp ; long tmp___0 ; { bp = params->bp; port = params->port; max_num_of_cos = (unsigned int )port != 0U ? 3U : 6U; if ((int )((unsigned char )pri) >= (int )max_num_of_cos) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_sp_pri_to_cos_set invalid parameter Illegal strict priority\n", "bnx2x_ets_e3b0_sp_pri_to_cos_set", 972, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((unsigned int )*(sp_pri_to_cos + (unsigned long )pri) != 255U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_sp_pri_to_cos_set invalid parameter There can\'t be two COS\'s with the same strict pri\n", "bnx2x_ets_e3b0_sp_pri_to_cos_set", 979, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } *(sp_pri_to_cos + (unsigned long )pri) = cos_entry; return (0); } } static u64 bnx2x_e3b0_sp_get_pri_cli_reg(u8 const cos , u8 const cos_offset , u8 const pri_set , u8 const pri_offset , u8 const entry_size ) { u64 pri_cli_nig ; { pri_cli_nig = 0ULL; pri_cli_nig = (unsigned long long )((int )cos + (int )cos_offset) << (int )entry_size * ((int )pri_set + (int )pri_offset); return (pri_cli_nig); } } static u64 bnx2x_e3b0_sp_get_pri_cli_reg_nig(u8 const cos , u8 const pri_set ) { u8 nig_cos_offset ; u8 nig_pri_offset ; u64 tmp ; { nig_cos_offset = 3U; nig_pri_offset = 3U; tmp = bnx2x_e3b0_sp_get_pri_cli_reg((int )cos, (int )nig_cos_offset, (int )pri_set, (int )nig_pri_offset, 4); return (tmp); } } static u64 bnx2x_e3b0_sp_get_pri_cli_reg_pbf(u8 const cos , u8 const pri_set ) { u8 pbf_cos_offset ; u8 pbf_pri_offset ; u64 tmp ; { pbf_cos_offset = 0U; pbf_pri_offset = 0U; tmp = bnx2x_e3b0_sp_get_pri_cli_reg((int )cos, (int )pbf_cos_offset, (int )pri_set, (int )pbf_pri_offset, 3); return (tmp); } } static int bnx2x_ets_e3b0_sp_set_pri_cli_reg(struct link_params const *params , u8 *sp_pri_to_cos ) { struct bnx2x *bp ; u8 i ; u8 port ; u64 pri_cli_nig ; u32 pri_cli_pbf ; u8 pri_set ; u8 pri_bitmask ; u8 max_num_of_cos ; u8 cos_bit_to_set ; long tmp ; u64 tmp___0 ; u64 tmp___1 ; long tmp___2 ; u64 tmp___3 ; u64 tmp___4 ; long tmp___5 ; u32 pri_cli_nig_lsb ; u32 pri_cli_nig_msb ; { bp = params->bp; i = 0U; port = params->port; pri_cli_nig = 528ULL; pri_cli_pbf = 0U; pri_set = 0U; pri_bitmask = 0U; max_num_of_cos = (unsigned int )port != 0U ? 3U : 6U; cos_bit_to_set = (unsigned int )((u8 )(1 << (int )max_num_of_cos)) + 255U; i = 0U; goto ldv_51796; ldv_51795: ; if ((unsigned int )*(sp_pri_to_cos + (unsigned long )i) != 255U) { if ((unsigned int )*(sp_pri_to_cos + (unsigned long )i) > 5U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_sp_set_pri_cli_reg invalid cos entry\n", "bnx2x_ets_e3b0_sp_set_pri_cli_reg", 1065, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } tmp___0 = bnx2x_e3b0_sp_get_pri_cli_reg_nig((int )*(sp_pri_to_cos + (unsigned long )i), (int )pri_set); pri_cli_nig = tmp___0 | pri_cli_nig; tmp___1 = bnx2x_e3b0_sp_get_pri_cli_reg_pbf((int )*(sp_pri_to_cos + (unsigned long )i), (int )pri_set); pri_cli_pbf = (u32 )tmp___1 | pri_cli_pbf; pri_bitmask = (u8 )(1 << (int )*(sp_pri_to_cos + (unsigned long )i)); if ((unsigned int )((int )pri_bitmask & (int )cos_bit_to_set) == 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_sp_set_pri_cli_reg invalid There can\'t be two COS\'s with the same strict pri\n", "bnx2x_ets_e3b0_sp_set_pri_cli_reg", 1080, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } cos_bit_to_set = (u8 )(~ ((int )((signed char )pri_bitmask)) & (int )((signed char )cos_bit_to_set)); pri_set = (u8 )((int )pri_set + 1); } else { } i = (u8 )((int )i + 1); ldv_51796: ; if ((int )i < (int )max_num_of_cos) { goto ldv_51795; } else { } i = 0U; goto ldv_51799; ldv_51798: pri_bitmask = (u8 )(1 << (int )i); if ((unsigned int )((int )pri_bitmask & (int )cos_bit_to_set) != 0U) { tmp___3 = bnx2x_e3b0_sp_get_pri_cli_reg_nig((int )i, (int )pri_set); pri_cli_nig = tmp___3 | pri_cli_nig; tmp___4 = bnx2x_e3b0_sp_get_pri_cli_reg_pbf((int )i, (int )pri_set); pri_cli_pbf = (u32 )tmp___4 | pri_cli_pbf; cos_bit_to_set = (u8 )(~ ((int )((signed char )pri_bitmask)) & (int )((signed char )cos_bit_to_set)); pri_set = (u8 )((int )pri_set + 1); } else { } i = (u8 )((int )i + 1); ldv_51799: ; if ((int )i < (int )max_num_of_cos) { goto ldv_51798; } else { } if ((int )pri_set != (int )max_num_of_cos) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_sp_set_pri_cli_reg not all entries were set\n", "bnx2x_ets_e3b0_sp_set_pri_cli_reg", 1107, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((unsigned int )port != 0U) { writel((unsigned int )pri_cli_nig, (void volatile *)bp->regview + 100064U); writel(pri_cli_pbf, (void volatile *)bp->regview + 1426036U); } else { pri_cli_nig_lsb = (unsigned int )pri_cli_nig; pri_cli_nig_msb = (unsigned int )(pri_cli_nig >> 32) & 15U; writel(pri_cli_nig_lsb, (void volatile *)bp->regview + 99968U); writel(pri_cli_nig_msb, (void volatile *)bp->regview + 99972U); writel(pri_cli_pbf, (void volatile *)bp->regview + 1426032U); } return (0); } } int bnx2x_ets_e3b0_config(struct link_params const *params , struct link_vars const *vars , struct bnx2x_ets_params *ets_params ) { struct bnx2x *bp ; int bnx2x_status ; u8 port ; u16 total_bw ; u32 min_w_val_nig ; u32 tmp ; u32 min_w_val_pbf ; u8 cos_bw_bitmap ; u8 cos_sp_bitmap ; u8 sp_pri_to_cos[6U] ; unsigned int tmp___0 ; u8 max_num_of_cos ; u8 cos_entry ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; { bp = params->bp; bnx2x_status = 0; port = params->port; total_bw = 0U; tmp = bnx2x_ets_get_min_w_val_nig(vars); min_w_val_nig = tmp; min_w_val_pbf = 10000U; cos_bw_bitmap = 0U; cos_sp_bitmap = 0U; sp_pri_to_cos[0] = 0U; tmp___0 = 1U; while (1) { if (tmp___0 >= 6U) { break; } else { } sp_pri_to_cos[tmp___0] = (unsigned char)0; tmp___0 = tmp___0 + 1U; } max_num_of_cos = (unsigned int )port != 0U ? 3U : 6U; cos_entry = 0U; if ((((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) || ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 != 4096U : (bp->common.chip_id & 61440U) != 4096U)) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_disabled the chip isn\'t E3B0\n", "bnx2x_ets_e3b0_config", 1155, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((int )ets_params->num_of_cos > (int )max_num_of_cos) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_E3B0_config the number of COS isn\'t supported\n", "bnx2x_ets_e3b0_config", 1161, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_ets_e3b0_sp_pri_to_cos_init((u8 *)(& sp_pri_to_cos)); bnx2x_status = bnx2x_ets_e3b0_get_total_bw(params, ets_params, & total_bw); if (bnx2x_status != 0) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_E3B0_config get_total_bw failed\n", "bnx2x_ets_e3b0_config", 1173, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_ets_e3b0_set_credit_upper_bound_nig(params, min_w_val_nig); bnx2x_ets_e3b0_set_credit_upper_bound_pbf(params, min_w_val_pbf); cos_entry = 0U; goto ldv_51821; ldv_51820: ; if ((unsigned int )ets_params->cos[(int )cos_entry].state == 1U) { cos_bw_bitmap = (u8 )((int )((signed char )(1 << (int )cos_entry)) | (int )((signed char )cos_bw_bitmap)); bnx2x_status = bnx2x_ets_e3b0_set_cos_bw(bp, (int )cos_entry, min_w_val_nig, min_w_val_pbf, (int )total_bw, (int )ets_params->cos[(int )cos_entry].params.bw_params.bw, (int )port); } else if ((unsigned int )ets_params->cos[(int )cos_entry].state == 0U) { cos_sp_bitmap = (u8 )((int )((signed char )(1 << (int )cos_entry)) | (int )((signed char )cos_sp_bitmap)); bnx2x_status = bnx2x_ets_e3b0_sp_pri_to_cos_set(params, (u8 *)(& sp_pri_to_cos), (int )ets_params->cos[(int )cos_entry].params.sp_params.pri, (int )cos_entry); } else { tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_config cos state not valid\n", "bnx2x_ets_e3b0_config", 1207, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } if (bnx2x_status != 0) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_config set cos bw failed\n", "bnx2x_ets_e3b0_config", 1212, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (bnx2x_status); } else { } cos_entry = (u8 )((int )cos_entry + 1); ldv_51821: ; if ((int )ets_params->num_of_cos > (int )cos_entry) { goto ldv_51820; } else { } bnx2x_status = bnx2x_ets_e3b0_sp_set_pri_cli_reg(params, (u8 *)(& sp_pri_to_cos)); if (bnx2x_status != 0) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_E3B0_config set_pri_cli_reg failed\n", "bnx2x_ets_e3b0_config", 1223, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (bnx2x_status); } else { } bnx2x_status = bnx2x_ets_e3b0_cli_map(params, (struct bnx2x_ets_params const *)ets_params, (int )cos_sp_bitmap, (int )cos_bw_bitmap); if (bnx2x_status != 0) { tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_ets_E3B0_config SP failed\n", "bnx2x_ets_e3b0_config", 1233, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (bnx2x_status); } else { } return (0); } } static void bnx2x_ets_bw_limit_common(struct link_params const *params ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]ETS enabled BW limit configuration\n", "bnx2x_ets_bw_limit_common", 1242, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(24U, (void volatile *)bp->regview + 98540U); writel(4378U, (void volatile *)bp->regview + 98544U); writel(20480U, (void volatile *)bp->regview + 98572U); writel(20480U, (void volatile *)bp->regview + 98576U); writel(1U, (void volatile *)bp->regview + 1425488U); writel(0U, (void volatile *)bp->regview + 1425508U); writel(7U, (void volatile *)bp->regview + 98536U); writel(20480U, (void volatile *)bp->regview + 1425500U); writel(20480U, (void volatile *)bp->regview + 1425504U); return; } } void bnx2x_ets_bw_limit(struct link_params const *params , u32 const cos0_bw , u32 const cos1_bw ) { struct bnx2x *bp ; u32 total_bw ; u32 cos0_credit_weight ; u32 cos1_credit_weight ; long tmp ; long tmp___0 ; { bp = params->bp; total_bw = (unsigned int )cos0_bw + (unsigned int )cos1_bw; cos0_credit_weight = 0U; cos1_credit_weight = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]ETS enabled BW limit configuration\n", "bnx2x_ets_bw_limit", 1291, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((total_bw == 0U || (unsigned int )cos0_bw == 0U) || (unsigned int )cos1_bw == 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Total BW can\'t be zero\n", "bnx2x_ets_bw_limit", 1296, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } cos0_credit_weight = ((unsigned int )cos0_bw * 20480U) / total_bw; cos1_credit_weight = ((unsigned int )cos1_bw * 20480U) / total_bw; bnx2x_ets_bw_limit_common(params); writel(cos0_credit_weight, (void volatile *)bp->regview + 98552U); writel(cos1_credit_weight, (void volatile *)bp->regview + 98556U); writel(cos0_credit_weight, (void volatile *)bp->regview + 1425492U); writel(cos1_credit_weight, (void volatile *)bp->regview + 1425496U); return; } } int bnx2x_ets_strict(struct link_params const *params , u8 const strict_cos ) { struct bnx2x *bp ; u32 val ; long tmp ; { bp = params->bp; val = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]ETS enabled strict configuration\n", "bnx2x_ets_strict", 1320, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(31U, (void volatile *)bp->regview + 98536U); writel(256U, (void volatile *)bp->regview + 98548U); writel(0U, (void volatile *)bp->regview + 1425488U); writel(256U, (void volatile *)bp->regview + 1425508U); writel((unsigned int )strict_cos, (void volatile *)bp->regview + 1425484U); val = (unsigned int )((unsigned char )strict_cos) == 0U ? 8984U : 8928U; writel(val, (void volatile *)bp->regview + 98532U); return (0); } } static void bnx2x_update_pfc_xmac(struct link_params *params , struct link_vars *vars , u8 is_lb ) { struct bnx2x *bp ; u32 xmac_base ; u32 pause_val ; u32 pfc0_val ; u32 pfc1_val ; { bp = params->bp; xmac_base = (unsigned int )params->port != 0U ? 1456128U : 1454080U; pause_val = 98304U; pfc0_val = 4294934528U; pfc1_val = 2U; if ((params->feature_config_flags & 2U) == 0U) { if (((int )vars->flow_ctrl & 512) != 0) { pause_val = pause_val | 262144U; } else { } if (((int )vars->flow_ctrl & 256) != 0) { pause_val = pause_val | 131072U; } else { } } else { pfc1_val = pfc1_val | 59U; writel(pause_val, (void volatile *)bp->regview + (unsigned long )(xmac_base + 104U)); writel(pfc0_val, (void volatile *)bp->regview + (unsigned long )(xmac_base + 112U)); writel(pfc1_val, (void volatile *)bp->regview + (unsigned long )(xmac_base + 116U)); pfc1_val = pfc1_val & 4294967293U; } writel(pause_val, (void volatile *)bp->regview + (unsigned long )(xmac_base + 104U)); writel(pfc0_val, (void volatile *)bp->regview + (unsigned long )(xmac_base + 112U)); writel(pfc1_val, (void volatile *)bp->regview + (unsigned long )(xmac_base + 116U)); writel((unsigned int )(((((int )params->mac_addr[2] << 24) | ((int )params->mac_addr[3] << 16)) | ((int )params->mac_addr[4] << 8)) | (int )params->mac_addr[5]), (void volatile *)bp->regview + (unsigned long )(xmac_base + 40U)); writel((unsigned int )(((int )params->mac_addr[0] << 8) | (int )params->mac_addr[1]), (void volatile *)bp->regview + (unsigned long )(xmac_base + 44U)); __const_udelay(128850UL); return; } } static void bnx2x_set_mdio_clk(struct bnx2x *bp , u32 chip_id , u32 emac_base ) { u32 new_mode ; u32 cur_mode ; u32 clc_cnt ; long tmp ; { cur_mode = readl((void const volatile *)bp->regview + (unsigned long )(emac_base + 180U)); if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { clc_cnt = 4849664U; } else { clc_cnt = 3211264U; } if (((long )cur_mode & 67043328L) == (long )clc_cnt && (int )cur_mode < 0) { return; } else { } new_mode = cur_mode & 4227923951U; new_mode = new_mode | clc_cnt; new_mode = new_mode | 2147483648U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Changing emac_mode from 0x%x to 0x%x\n", "bnx2x_set_mdio_clk", 1446, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cur_mode, new_mode); } else { } writel(new_mode, (void volatile *)bp->regview + (unsigned long )(emac_base + 180U)); __const_udelay(171800UL); return; } } static void bnx2x_set_mdio_emac_per_phy(struct bnx2x *bp , struct link_params *params ) { u8 phy_index ; { phy_index = 0U; goto ldv_51870; ldv_51869: bnx2x_set_mdio_clk(bp, params->chip_id, params->phy[(int )phy_index].mdio_ctrl); phy_index = (u8 )((int )phy_index + 1); ldv_51870: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_51869; } else { } return; } } static u8 bnx2x_is_4_port_mode(struct bnx2x *bp ) { u32 port4mode_ovwr_val ; unsigned int tmp ; { port4mode_ovwr_val = readl((void const volatile *)bp->regview + 42784U); if ((int )port4mode_ovwr_val & 1) { return ((port4mode_ovwr_val & 2U) != 0U); } else { } tmp = readl((void const volatile *)bp->regview + 42832U); return ((u8 )tmp); } } static void bnx2x_emac_init(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 port ; u32 emac_base ; u32 val ; u16 timeout ; long tmp ; long tmp___0 ; { bp = params->bp; port = params->port; emac_base = (unsigned int )port != 0U ? 33792U : 32768U; writel((unsigned int )(16384 << (int )port), (void volatile *)bp->regview + 42392U); __const_udelay(21475UL); writel((unsigned int )(16384 << (int )port), (void volatile *)bp->regview + 42388U); val = readl((void const volatile *)bp->regview + (unsigned long )emac_base); writel(val | 1U, (void volatile *)bp->regview + (unsigned long )emac_base); timeout = 200U; ldv_51886: val = readl((void const volatile *)bp->regview + (unsigned long )emac_base); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]EMAC reset reg is %u\n", "bnx2x_emac_init", 1499, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", val); } else { } if ((unsigned int )timeout == 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]EMAC timeout!\n", "bnx2x_emac_init", 1501, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } timeout = (u16 )((int )timeout - 1); if ((int )val & 1) { goto ldv_51886; } else { } bnx2x_set_mdio_emac_per_phy(bp, params); val = (u32 )(((int )params->mac_addr[0] << 8) | (int )params->mac_addr[1]); writel(val, (void volatile *)bp->regview + (unsigned long )(emac_base + 16U)); val = (u32 )(((((int )params->mac_addr[2] << 24) | ((int )params->mac_addr[3] << 16)) | ((int )params->mac_addr[4] << 8)) | (int )params->mac_addr[5]); writel(val, (void volatile *)bp->regview + (unsigned long )(emac_base + 20U)); return; } } static void bnx2x_set_xumac_nig(struct link_params *params , u16 tx_pause_en , u8 enable ) { struct bnx2x *bp ; { bp = params->bp; writel((unsigned int )enable, (void volatile *)(bp->regview + ((unsigned int )params->port != 0U ? 99776UL : 99756UL))); writel((unsigned int )enable, (void volatile *)(bp->regview + ((unsigned int )params->port != 0U ? 99780UL : 99760UL))); writel((unsigned int )tx_pause_en, (void volatile *)(bp->regview + ((unsigned int )params->port != 0U ? 99784UL : 99764UL))); return; } } static void bnx2x_set_umac_rxtx(struct link_params *params , u8 en ) { u32 umac_base ; u32 val ; struct bnx2x *bp ; unsigned int tmp ; { umac_base = (unsigned int )params->port != 0U ? 1442816U : 1441792U; bp = params->bp; tmp = readl((void const volatile *)bp->regview + 42384U); if ((tmp & (unsigned int )(1048576 << (int )params->port)) == 0U) { return; } else { } val = readl((void const volatile *)bp->regview + (unsigned long )(umac_base + 8U)); if ((unsigned int )en != 0U) { val = val | 3U; } else { val = val & 4294967292U; } writel(val, (void volatile *)bp->regview + (unsigned long )(umac_base + 8U)); return; } } static void bnx2x_umac_enable(struct link_params *params , struct link_vars *vars , u8 lb ) { u32 val ; u32 umac_base ; struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; { umac_base = (unsigned int )params->port != 0U ? 1442816U : 1441792U; bp = params->bp; writel((unsigned int )(1048576 << (int )params->port), (void volatile *)bp->regview + 42392U); usleep_range(1000UL, 2000UL); writel((unsigned int )(1048576 << (int )params->port), (void volatile *)bp->regview + 42388U); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]enabling UMAC\n", "bnx2x_umac_enable", 1567, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16406) * 4)); val = 16785456U; switch ((int )vars->line_speed) { case 10: val = val; goto ldv_51911; case 100: val = val | 4U; goto ldv_51911; case 1000: val = val | 8U; goto ldv_51911; case 2500: val = val | 12U; goto ldv_51911; default: tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid speed for UMAC %d\n", "bnx2x_umac_enable", 1591, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed); } else { } goto ldv_51911; } ldv_51911: ; if (((int )vars->flow_ctrl & 256) == 0) { val = val | 268435456U; } else { } if (((int )vars->flow_ctrl & 512) == 0) { val = val | 256U; } else { } if ((unsigned int )vars->duplex == 0U) { val = val | 1024U; } else { } writel(val, (void volatile *)bp->regview + (unsigned long )(umac_base + 8U)); __const_udelay(214750UL); if ((vars->eee_status & 15728640U) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]configured UMAC for EEE\n", "bnx2x_umac_enable", 1608, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(8U, (void volatile *)bp->regview + (unsigned long )(umac_base + 100U)); writel(17U, (void volatile *)bp->regview + (unsigned long )(umac_base + 108U)); } else { writel(0U, (void volatile *)bp->regview + (unsigned long )(umac_base + 100U)); } writel((unsigned int )(((((int )params->mac_addr[2] << 24) | ((int )params->mac_addr[3] << 16)) | ((int )params->mac_addr[4] << 8)) | (int )params->mac_addr[5]), (void volatile *)bp->regview + (unsigned long )(umac_base + 12U)); writel((unsigned int )(((int )params->mac_addr[0] << 8) | (int )params->mac_addr[1]), (void volatile *)bp->regview + (unsigned long )(umac_base + 16U)); val = val & 4294967263U; val = val | 3U; writel(val, (void volatile *)bp->regview + (unsigned long )(umac_base + 8U)); __const_udelay(214750UL); val = val & 4294959103U; if ((unsigned int )lb != 0U) { val = val | 32768U; } else { } writel(val, (void volatile *)bp->regview + (unsigned long )(umac_base + 8U)); writel(10000U, (void volatile *)bp->regview + (unsigned long )(umac_base + 20U)); bnx2x_set_xumac_nig(params, ((int )vars->flow_ctrl & 256) != 0, 1); vars->mac_type = 3U; return; } } static void bnx2x_xmac_init(struct link_params *params , u32 max_speed ) { struct bnx2x *bp ; u32 is_port4mode ; u8 tmp ; long tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; { bp = params->bp; tmp = bnx2x_is_4_port_mode(bp); is_port4mode = (u32 )tmp; if (((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U) && is_port4mode != 0U) { tmp___1 = readl((void const volatile *)bp->regview + 42384U); if ((tmp___1 & 4194304U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]XMAC already out of reset in 4-port mode\n", "bnx2x_xmac_init", 1670, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } } else { } writel(4194304U, (void volatile *)bp->regview + 42392U); usleep_range(1000UL, 2000UL); writel(4194304U, (void volatile *)bp->regview + 42388U); if (is_port4mode != 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Init XMAC to 2 ports x 10G per path\n", "bnx2x_xmac_init", 1682, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(1U, (void volatile *)bp->regview + 43364U); writel(3U, (void volatile *)bp->regview + 43360U); } else { writel(0U, (void volatile *)bp->regview + 43364U); if (max_speed == 10000U) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Init XMAC to 10G x 1 port per path\n", "bnx2x_xmac_init", 1694, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(3U, (void volatile *)bp->regview + 43360U); } else { tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Init XMAC to 20G x 2 ports per path\n", "bnx2x_xmac_init", 1699, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(1U, (void volatile *)bp->regview + 43360U); } } writel(8388608U, (void volatile *)bp->regview + 42392U); usleep_range(1000UL, 2000UL); writel(8388608U, (void volatile *)bp->regview + 42388U); return; } } static void bnx2x_set_xmac_rxtx(struct link_params *params , u8 en ) { u8 port ; struct bnx2x *bp ; u32 pfc_ctrl ; u32 xmac_base ; u32 val ; long tmp ; unsigned int tmp___0 ; { port = params->port; bp = params->bp; xmac_base = (unsigned int )port != 0U ? 1456128U : 1454080U; tmp___0 = readl((void const volatile *)bp->regview + 42384U); if ((tmp___0 & 4194304U) != 0U) { pfc_ctrl = readl((void const volatile *)bp->regview + (unsigned long )(xmac_base + 116U)); writel(pfc_ctrl & 4294967293U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 116U)); writel(pfc_ctrl | 2U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 116U)); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Disable XMAC on port %x\n", "bnx2x_set_xmac_rxtx", 1732, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port); } else { } val = readl((void const volatile *)bp->regview + (unsigned long )xmac_base); if ((unsigned int )en != 0U) { val = val | 3U; } else { val = val & 4294967292U; } writel(val, (void volatile *)bp->regview + (unsigned long )xmac_base); } else { } return; } } static int bnx2x_xmac_enable(struct link_params *params , struct link_vars *vars , u8 lb ) { u32 val ; u32 xmac_base ; struct bnx2x *bp ; long tmp ; long tmp___0 ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]enabling XMAC\n", "bnx2x_xmac_enable", 1747, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } xmac_base = (unsigned int )params->port != 0U ? 1456128U : 1454080U; bnx2x_xmac_init(params, (u32 )vars->line_speed); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16406) * 4)); if (((int )params->phy[0].flags & 4096) == 0) { writel(3U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 80U)); writel(0U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 96U)); writel(3U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 96U)); } else { } writel(10000U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 64U)); writel(51200U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 32U)); bnx2x_update_pfc_xmac(params, vars, 0); if ((vars->eee_status & 15728640U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting XMAC for EEE\n", "bnx2x_xmac_enable", 1784, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(20447240U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 228U)); writel(1U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 216U)); } else { writel(0U, (void volatile *)bp->regview + (unsigned long )(xmac_base + 216U)); } val = 3U; if ((unsigned int )vars->line_speed == 20000U && (params->phy[0].supported & 4194304U) != 0U) { val = val | 128U; } else { } if ((unsigned int )lb != 0U) { val = val | 4U; } else { } writel(val, (void volatile *)bp->regview + (unsigned long )xmac_base); bnx2x_set_xumac_nig(params, ((int )vars->flow_ctrl & 256) != 0, 1); vars->mac_type = 4U; return (0); } } static int bnx2x_emac_enable(struct link_params *params , struct link_vars *vars , u8 lb ) { struct bnx2x *bp ; u8 port ; u32 emac_base ; u32 val ; long tmp ; u32 ser_lane ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { bp = params->bp; port = params->port; emac_base = (unsigned int )port != 0U ? 33792U : 32768U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]enabling EMAC\n", "bnx2x_emac_enable", 1820, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel((unsigned int )(1 << (int )port), (void volatile *)bp->regview + 42392U); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16406) * 4)); if ((int )vars->phy_flags & 1) { ser_lane = (params->lane_config & 49152U) >> 14; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]XGXS\n", "bnx2x_emac_enable", 1835, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(ser_lane, (void volatile *)bp->regview + (unsigned long )(((int )port + 16570) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16568) * 4)); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SerDes\n", "bnx2x_emac_enable", 1842, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16568) * 4)); } bnx2x_bits_en(bp, emac_base + 200U, 1U); bnx2x_bits_en(bp, emac_base + 188U, 1U); bnx2x_bits_dis(bp, emac_base + 200U, 4U); bnx2x_bits_dis(bp, emac_base + 188U, 24U); if ((params->feature_config_flags & 2U) == 0U) { if (((int )vars->flow_ctrl & 512) != 0) { bnx2x_bits_en(bp, emac_base + 200U, 4U); } else { } if (((int )vars->flow_ctrl & 256) != 0) { bnx2x_bits_en(bp, emac_base + 188U, 24U); } else { } } else { bnx2x_bits_en(bp, emac_base + 188U, 16U); } val = readl((void const volatile *)bp->regview + (unsigned long )(emac_base + 200U)); val = val | 1280U; writel(0U, (void volatile *)bp->regview + (unsigned long )(emac_base + 800U)); if ((params->feature_config_flags & 2U) != 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PFC is enabled\n", "bnx2x_emac_enable", 1888, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(7U, (void volatile *)bp->regview + (unsigned long )(emac_base + 800U)); writel(16711937U, (void volatile *)bp->regview + (unsigned long )(emac_base + 804U)); val = val | 8U; } else { } writel(val, (void volatile *)bp->regview + (unsigned long )(emac_base + 200U)); val = readl((void const volatile *)bp->regview + (unsigned long )emac_base); if ((unsigned int )lb != 0U) { val = val | 2064U; } else { val = val & 4294965231U; } writel(val, (void volatile *)bp->regview + (unsigned long )emac_base); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16399) * 4)); writel(2147493278U, (void volatile *)bp->regview + (unsigned long )(emac_base + 156U)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16401) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16427) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16452) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16440) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16425) * 4)); val = 0U; if ((params->feature_config_flags & 2U) != 0U || ((int )vars->flow_ctrl & 256) != 0) { val = 1U; } else { } writel(val, (void volatile *)bp->regview + (unsigned long )(((int )port + 16454) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16456) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16442) * 4)); vars->mac_type = 1U; return (0); } } static void bnx2x_update_pfc_bmac1(struct link_params *params , struct link_vars *vars ) { u32 wb_data[2U] ; struct bnx2x *bp ; u32 bmac_addr ; u32 val ; { bp = params->bp; bmac_addr = (unsigned int )params->port != 0U ? 69632U : 68608U; val = 20U; if ((params->feature_config_flags & 2U) == 0U && ((int )vars->flow_ctrl & 512) != 0) { val = val | 32U; } else { } wb_data[0] = val; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 264U, 2U); val = 192U; if ((params->feature_config_flags & 2U) == 0U && ((int )vars->flow_ctrl & 256) != 0) { val = val | 8388608U; } else { } wb_data[0] = val; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 56U, 2U); return; } } static void bnx2x_update_pfc_bmac2(struct link_params *params , struct link_vars *vars , u8 is_lb ) { u32 wb_data[2U] ; struct bnx2x *bp ; u32 bmac_addr ; u32 val ; long tmp ; long tmp___0 ; long tmp___1 ; { bp = params->bp; bmac_addr = (unsigned int )params->port != 0U ? 69632U : 68608U; val = 20U; if ((params->feature_config_flags & 2U) == 0U && ((int )vars->flow_ctrl & 512) != 0) { val = val | 32U; } else { } wb_data[0] = val; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 464U, 2U); __const_udelay(128850UL); val = 192U; if ((params->feature_config_flags & 2U) == 0U && ((int )vars->flow_ctrl & 256) != 0) { val = val | 8388608U; } else { } wb_data[0] = val; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 224U, 2U); if ((params->feature_config_flags & 2U) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]PFC is enabled\n", "bnx2x_update_pfc_bmac2", 2008, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } wb_data[0] = 0U; wb_data[0] = wb_data[0] | 1U; wb_data[0] = wb_data[0] | 2U; wb_data[0] = wb_data[0] | 4U; wb_data[0] = wb_data[0] | 8U; wb_data[0] = wb_data[0] | 32U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 48U, 2U); wb_data[0] = wb_data[0] & 4294967291U; } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PFC is disabled\n", "bnx2x_update_pfc_bmac2", 2022, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } wb_data[0] = 8U; wb_data[1] = 0U; } memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 48U, 2U); val = 32768U; if ((params->feature_config_flags & 2U) != 0U) { val = val | 65536U; } else { } wb_data[0] = val; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 256U, 2U); val = 3U; if ((unsigned int )is_lb != 0U) { val = val | 4U; tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]enable bmac loopback\n", "bnx2x_update_pfc_bmac2", 2048, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((params->feature_config_flags & 2U) != 0U) { val = val | 96U; } else { } wb_data[0] = val; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr, 2U); return; } } static int bnx2x_pfc_nig_rx_priority_mask(struct bnx2x *bp , u8 cos_entry , u32 priority_mask , u8 port ) { u32 nig_reg_rx_priority_mask_add ; { nig_reg_rx_priority_mask_add = 0U; switch ((int )cos_entry) { case 0: nig_reg_rx_priority_mask_add = (unsigned int )port != 0U ? 98732U : 98392U; goto ldv_51979; case 1: nig_reg_rx_priority_mask_add = (unsigned int )port != 0U ? 98736U : 98396U; goto ldv_51979; case 2: nig_reg_rx_priority_mask_add = (unsigned int )port != 0U ? 100088U : 100016U; goto ldv_51979; case 3: ; if ((unsigned int )port != 0U) { return (-22); } else { } nig_reg_rx_priority_mask_add = 100020U; goto ldv_51979; case 4: ; if ((unsigned int )port != 0U) { return (-22); } else { } nig_reg_rx_priority_mask_add = 100024U; goto ldv_51979; case 5: ; if ((unsigned int )port != 0U) { return (-22); } else { } nig_reg_rx_priority_mask_add = 100028U; goto ldv_51979; } ldv_51979: writel(priority_mask, (void volatile *)bp->regview + (unsigned long )nig_reg_rx_priority_mask_add); return (0); } } static void bnx2x_update_mng(struct link_params *params , u32 link_status ) { struct bnx2x *bp ; { bp = params->bp; writel(link_status, (void volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 16UL) + 1636UL))); return; } } static void bnx2x_update_link_attr(struct link_params *params , u32 link_attr ) { struct bnx2x *bp ; unsigned int tmp ; { bp = params->bp; if (bp->common.shmem2_base != 0U) { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp > 340U) { writel(link_attr, (void volatile *)(bp->regview + ((unsigned long )params->shmem2_base + ((unsigned long )params->port + 85UL) * 4UL))); } else { } } else { } return; } } static void bnx2x_update_pfc_nig(struct link_params *params , struct link_vars *vars , struct bnx2x_nig_brb_pfc_port_params *nig_params ) { u32 xcm_mask ; u32 ppp_enable ; u32 pause_enable ; u32 llfc_out_en ; u32 llfc_enable ; u32 xcm_out_en ; u32 hwpfc_enable ; u32 pkt_priority_to_cos ; struct bnx2x *bp ; u8 port ; int set_pfc ; long tmp ; u8 i ; { xcm_mask = 0U; ppp_enable = 0U; pause_enable = 0U; llfc_out_en = 0U; llfc_enable = 0U; xcm_out_en = 0U; hwpfc_enable = 0U; pkt_priority_to_cos = 0U; bp = params->bp; port = params->port; set_pfc = (int )params->feature_config_flags & 2; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]updating pfc nig parameters\n", "bnx2x_update_pfc_nig", 2138, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } xcm_mask = readl((void const volatile *)(bp->regview + ((unsigned int )port != 0U ? 65844UL : 65840UL))); if (set_pfc != 0) { pause_enable = 0U; llfc_out_en = 0U; llfc_enable = 0U; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { ppp_enable = 0U; } else { ppp_enable = 1U; } xcm_mask = xcm_mask & 4294967294U; xcm_out_en = 0U; hwpfc_enable = 1U; } else { if ((unsigned long )nig_params != (unsigned long )((struct bnx2x_nig_brb_pfc_port_params *)0)) { llfc_out_en = nig_params->llfc_out_en; llfc_enable = nig_params->llfc_enable; pause_enable = nig_params->pause_enable; } else { pause_enable = 1U; } xcm_mask = xcm_mask | 1U; xcm_out_en = 1U; } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { writel(pause_enable, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 65736UL : 65732UL))); } else { } writel(llfc_out_en, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 90316UL : 90312UL))); writel(llfc_enable, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 90636UL : 90632UL))); writel(pause_enable, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 90308UL : 90304UL))); writel(ppp_enable, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 90292UL : 90288UL))); writel(xcm_mask, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 65844UL : 65840UL))); writel(7U, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 90228UL : 90224UL))); writel(xcm_out_en, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 65780UL : 65776UL))); writel(hwpfc_enable, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98768UL : 98424UL))); if ((unsigned long )nig_params != (unsigned long )((struct bnx2x_nig_brb_pfc_port_params *)0)) { i = 0U; pkt_priority_to_cos = nig_params->pkt_priority_to_cos; i = 0U; goto ldv_52014; ldv_52013: bnx2x_pfc_nig_rx_priority_mask(bp, (int )i, nig_params->rx_cos_priority_mask[(int )i], (int )port); i = (u8 )((int )i + 1); ldv_52014: ; if ((int )nig_params->num_of_rx_cos_priority_mask > (int )i) { goto ldv_52013; } else { } writel(nig_params->llfc_high_priority_classes, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 90204UL : 90200UL))); writel(nig_params->llfc_low_priority_classes, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 90212UL : 90208UL))); } else { } writel(pkt_priority_to_cos, (void volatile *)(bp->regview + ((unsigned int )port != 0U ? 98728UL : 98388UL))); return; } } int bnx2x_update_pfc(struct link_params *params , struct link_vars *vars , struct bnx2x_nig_brb_pfc_port_params *pfc_params ) { u32 val ; struct bnx2x *bp ; u8 bmac_loopback ; long tmp ; long tmp___0 ; { bp = params->bp; bmac_loopback = (unsigned int )params->loopback_mode == 2U; if ((params->feature_config_flags & 2U) != 0U) { vars->link_status = vars->link_status | 536870912U; } else { vars->link_status = vars->link_status & 3758096383U; } bnx2x_update_mng(params, vars->link_status); bnx2x_update_pfc_nig(params, vars, pfc_params); if ((unsigned int )vars->link_up == 0U) { return (0); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to update PFC in BMAC\n", "bnx2x_update_pfc", 2247, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { if ((unsigned int )vars->mac_type == 4U) { bnx2x_update_pfc_xmac(params, vars, 0); } else { } } else { val = readl((void const volatile *)bp->regview + 42384U); if (((u32 )(1 << (int )params->port) & val) == 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to update PFC in EMAC\n", "bnx2x_update_pfc", 2257, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_emac_enable(params, vars, 0); return (0); } else { } if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { bnx2x_update_pfc_bmac2(params, vars, (int )bmac_loopback); } else { bnx2x_update_pfc_bmac1(params, vars); } val = 0U; if ((params->feature_config_flags & 2U) != 0U || ((int )vars->flow_ctrl & 256) != 0) { val = 1U; } else { } writel(val, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16452) * 4)); } return (0); } } static int bnx2x_bmac1_enable(struct link_params *params , struct link_vars *vars , u8 is_lb ) { struct bnx2x *bp ; u8 port ; u32 bmac_addr ; u32 wb_data[2U] ; u32 val ; long tmp ; long tmp___0 ; { bp = params->bp; port = params->port; bmac_addr = (unsigned int )port != 0U ? 69632U : 68608U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling BigMAC1\n", "bnx2x_bmac1_enable", 2287, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } wb_data[0] = 60U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 8U, 2U); wb_data[0] = (u32 )(((((int )params->mac_addr[2] << 24) | ((int )params->mac_addr[3] << 16)) | ((int )params->mac_addr[4] << 8)) | (int )params->mac_addr[5]); wb_data[1] = (u32 )(((int )params->mac_addr[0] << 8) | (int )params->mac_addr[1]); memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 64U, 2U); val = 3U; if ((unsigned int )is_lb != 0U) { val = val | 4U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]enable bmac loopback\n", "bnx2x_bmac1_enable", 2308, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } wb_data[0] = val; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr, 2U); wb_data[0] = 9630U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 280U, 2U); bnx2x_update_pfc_bmac1(params, vars); wb_data[0] = 9630U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 72U, 2U); wb_data[0] = 9630U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 40U, 2U); wb_data[0] = 16777728U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 560U, 2U); return (0); } } static int bnx2x_bmac2_enable(struct link_params *params , struct link_vars *vars , u8 is_lb ) { struct bnx2x *bp ; u8 port ; u32 bmac_addr ; u32 wb_data[2U] ; long tmp ; { bp = params->bp; port = params->port; bmac_addr = (unsigned int )port != 0U ? 69632U : 68608U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling BigMAC2\n", "bnx2x_bmac2_enable", 2350, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } wb_data[0] = 0U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr, 2U); __const_udelay(128850UL); wb_data[0] = 60U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 8U, 2U); __const_udelay(128850UL); wb_data[0] = (u32 )(((((int )params->mac_addr[2] << 24) | ((int )params->mac_addr[3] << 16)) | ((int )params->mac_addr[4] << 8)) | (int )params->mac_addr[5]); wb_data[1] = (u32 )(((int )params->mac_addr[0] << 8) | (int )params->mac_addr[1]); memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 232U, 2U); __const_udelay(128850UL); wb_data[0] = 16777728U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 784U, 2U); __const_udelay(128850UL); wb_data[0] = 9630U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 480U, 2U); __const_udelay(128850UL); wb_data[0] = 9630U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 240U, 2U); __const_udelay(128850UL); wb_data[0] = 9628U; wb_data[1] = 0U; memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr + 40U, 2U); __const_udelay(128850UL); bnx2x_update_pfc_bmac2(params, vars, (int )is_lb); return (0); } } static int bnx2x_bmac_enable(struct link_params *params , struct link_vars *vars , u8 is_lb , u8 reset_bmac ) { int rc ; u8 port ; struct bnx2x *bp ; u32 val ; { rc = 0; port = params->port; bp = params->bp; if ((unsigned int )reset_bmac != 0U) { writel((unsigned int )(1 << (int )port), (void volatile *)bp->regview + 42392U); usleep_range(1000UL, 2000UL); } else { } writel((unsigned int )(1 << (int )port), (void volatile *)bp->regview + 42388U); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16442) * 4)); if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { rc = bnx2x_bmac2_enable(params, vars, (int )is_lb); } else { rc = bnx2x_bmac1_enable(params, vars, (int )is_lb); } writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16568) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16570) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16406) * 4)); val = 0U; if ((params->feature_config_flags & 2U) != 0U || ((int )vars->flow_ctrl & 256) != 0) { val = 1U; } else { } writel(val, (void volatile *)bp->regview + (unsigned long )(((int )port + 16452) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16456) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16425) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16454) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16427) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16440) * 4)); vars->mac_type = 2U; return (rc); } } static void bnx2x_set_bmac_rx(struct bnx2x *bp , u32 chip_id , u8 port , u8 en ) { u32 bmac_addr ; u32 wb_data[2U] ; u32 nig_bmac_enable ; unsigned int tmp ; unsigned int tmp___0 ; { bmac_addr = (unsigned int )port != 0U ? 69632U : 68608U; tmp = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 16442) * 4)); nig_bmac_enable = tmp; if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { bmac_addr = bmac_addr; } else { bmac_addr = bmac_addr; } tmp___0 = readl((void const volatile *)bp->regview + 42384U); if ((tmp___0 & (unsigned int )(1 << (int )port)) != 0U && nig_bmac_enable != 0U) { bnx2x_read_dmae(bp, bmac_addr, 2U); memcpy((void *)(& wb_data), (void const *)(& (bp->slowpath)->wb_data), 8UL); if ((unsigned int )en != 0U) { wb_data[0] = wb_data[0] | 2U; } else { wb_data[0] = wb_data[0] & 4294967293U; } memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, bmac_addr, 2U); usleep_range(1000UL, 2000UL); } else { } return; } } static int bnx2x_pbf_update(struct link_params *params , u32 flow_ctrl , u32 line_speed ) { struct bnx2x *bp ; u8 port ; u32 init_crd ; u32 crd ; u32 count ; long tmp ; long tmp___0 ; u32 thresh ; long tmp___1 ; long tmp___2 ; { bp = params->bp; port = params->port; count = 1000U; writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 327703) * 4)); init_crd = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 327732) * 4)); crd = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 163904) * 8)); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]init_crd 0x%x crd 0x%x\n", "bnx2x_pbf_update", 2490, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", init_crd, crd); } else { } goto ldv_52077; ldv_52076: usleep_range(5000UL, 10000UL); crd = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 163904) * 8)); count = count - 1U; ldv_52077: ; if (init_crd != crd && count != 0U) { goto ldv_52076; } else { } crd = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 163904) * 8)); if (init_crd != crd) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BUG! init_crd 0x%x != crd 0x%x\n", "bnx2x_pbf_update", 2500, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", init_crd, crd); } else { } return (-22); } else { } if (((((flow_ctrl & 512U) != 0U || line_speed == 10U) || line_speed == 100U) || line_speed == 1000U) || line_speed == 2500U) { writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 327685) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 327737) * 4)); init_crd = 778U; } else { thresh = 601U; writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 327685) * 4)); writel(thresh, (void volatile *)bp->regview + (unsigned long )(((int )port + 327737) * 4)); switch (line_speed) { case 10000U: init_crd = thresh + 531U; goto ldv_52081; default: tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid line_speed 0x%x\n", "bnx2x_pbf_update", 2528, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", line_speed); } else { } return (-22); } ldv_52081: ; } writel(init_crd, (void volatile *)bp->regview + (unsigned long )(((int )port + 327732) * 4)); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PBF updated to speed %d credit %d\n", "bnx2x_pbf_update", 2534, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", line_speed, init_crd); } else { } writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 327681) * 4)); usleep_range(5000UL, 10000UL); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 327681) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 327703) * 4)); return (0); } } static u32 bnx2x_get_emac_base(struct bnx2x *bp , u32 mdc_mdio_access , u8 port ) { u32 emac_base ; unsigned int tmp ; unsigned int tmp___0 ; { emac_base = 0U; switch (mdc_mdio_access) { case 0U: ; goto ldv_52090; case 67108864U: tmp = readl((void const volatile *)bp->regview + 66452U); if (tmp != 0U) { emac_base = 33792U; } else { emac_base = 32768U; } goto ldv_52090; case 134217728U: tmp___0 = readl((void const volatile *)bp->regview + 66452U); if (tmp___0 != 0U) { emac_base = 32768U; } else { emac_base = 33792U; } goto ldv_52090; case 201326592U: emac_base = (unsigned int )port != 0U ? 33792U : 32768U; goto ldv_52090; case 268435456U: emac_base = (unsigned int )port != 0U ? 32768U : 33792U; goto ldv_52090; default: ; goto ldv_52090; } ldv_52090: ; return (emac_base); } } static int bnx2x_cl22_write(struct bnx2x *bp , struct bnx2x_phy *phy , u16 reg , u16 val ) { u32 tmp ; u32 mode ; u8 i ; int rc ; long tmp___0 ; { rc = 0; mode = readl((void const volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 180U)); writel(mode & 2147483647U, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 180U)); tmp = (u32 )(((((int )phy->addr << 21) | ((int )reg << 16)) | (int )val) | 603979776); writel(tmp, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); i = 0U; goto ldv_52108; ldv_52107: __const_udelay(42950UL); tmp = readl((void const volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); if (((long )tmp & 536870912L) == 0L) { __const_udelay(21475UL); goto ldv_52106; } else { } i = (u8 )((int )i + 1); ldv_52108: ; if ((unsigned int )i <= 49U) { goto ldv_52107; } else { } ldv_52106: ; if (((long )tmp & 536870912L) != 0L) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write phy register failed\n", "bnx2x_cl22_write", 2624, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = -14; } else { } writel(mode, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 180U)); return (rc); } } static int bnx2x_cl22_read(struct bnx2x *bp , struct bnx2x_phy *phy , u16 reg , u16 *ret_val ) { u32 val ; u32 mode ; u16 i ; int rc ; long tmp ; { rc = 0; mode = readl((void const volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 180U)); writel(mode & 2147483647U, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 180U)); val = (u32 )((((int )phy->addr << 21) | ((int )reg << 16)) | 671088640); writel(val, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); i = 0U; goto ldv_52122; ldv_52121: __const_udelay(42950UL); val = readl((void const volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); if (((long )val & 536870912L) == 0L) { *ret_val = (unsigned short )val; __const_udelay(21475UL); goto ldv_52120; } else { } i = (u16 )((int )i + 1); ldv_52122: ; if ((unsigned int )i <= 49U) { goto ldv_52121; } else { } ldv_52120: ; if (((long )val & 536870912L) != 0L) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]read phy register failed\n", "bnx2x_cl22_read", 2661, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } *ret_val = 0U; rc = -14; } else { } writel(mode, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 180U)); return (rc); } } static int bnx2x_cl45_read(struct bnx2x *bp , struct bnx2x_phy *phy , u8 devad , u16 reg , u16 *ret_val ) { u32 val ; u16 i ; int rc ; u32 chip_id ; unsigned int tmp ; unsigned int tmp___0 ; long tmp___1 ; long tmp___2 ; u16 temp_val ; { rc = 0; if ((int )((short )phy->flags) < 0) { tmp = readl((void const volatile *)bp->regview + 41992U); tmp___0 = readl((void const volatile *)bp->regview + 41996U); chip_id = (tmp << 16) | ((tmp___0 << 12) & 65535U); bnx2x_set_mdio_clk(bp, chip_id, phy->mdio_ctrl); } else { } if (((int )phy->flags & 1024) != 0) { bnx2x_bits_en(bp, phy->mdio_ctrl + 176U, 2U); } else { } val = (u32 )(((((int )phy->addr << 21) | ((int )devad << 16)) | (int )reg) | 536870912); writel(val, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); i = 0U; goto ldv_52137; ldv_52136: __const_udelay(42950UL); val = readl((void const volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); if (((long )val & 536870912L) == 0L) { __const_udelay(21475UL); goto ldv_52135; } else { } i = (u16 )((int )i + 1); ldv_52137: ; if ((unsigned int )i <= 49U) { goto ldv_52136; } else { } ldv_52135: ; if (((long )val & 536870912L) != 0L) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]read phy register failed\n", "bnx2x_cl45_read", 2705, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } netdev_err((struct net_device const *)bp->dev, "MDC/MDIO access timeout\n"); *ret_val = 0U; rc = -14; } else { val = (u32 )((((int )phy->addr << 21) | ((int )devad << 16)) | 738197504); writel(val, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); i = 0U; goto ldv_52141; ldv_52140: __const_udelay(42950UL); val = readl((void const volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); if (((long )val & 536870912L) == 0L) { *ret_val = (unsigned short )val; goto ldv_52139; } else { } i = (u16 )((int )i + 1); ldv_52141: ; if ((unsigned int )i <= 49U) { goto ldv_52140; } else { } ldv_52139: ; if (((long )val & 536870912L) != 0L) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]read phy register failed\n", "bnx2x_cl45_read", 2727, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } netdev_err((struct net_device const *)bp->dev, "MDC/MDIO access timeout\n"); *ret_val = 0U; rc = -14; } else { } } if (((int )phy->flags & 256) != 0) { phy->flags = (u16 )((unsigned int )phy->flags ^ 512U); if (((int )phy->flags & 512) != 0) { bnx2x_cl45_read(bp, phy, (int )devad, 15, & temp_val); } else { } } else { } if (((int )phy->flags & 1024) != 0) { bnx2x_bits_dis(bp, phy->mdio_ctrl + 176U, 2U); } else { } return (rc); } } static int bnx2x_cl45_write(struct bnx2x *bp , struct bnx2x_phy *phy , u8 devad , u16 reg , u16 val ) { u32 tmp ; u8 i ; int rc ; u32 chip_id ; unsigned int tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; long tmp___3 ; u16 temp_val ; { rc = 0; if ((int )((short )phy->flags) < 0) { tmp___0 = readl((void const volatile *)bp->regview + 41992U); tmp___1 = readl((void const volatile *)bp->regview + 41996U); chip_id = (tmp___0 << 16) | ((tmp___1 << 12) & 65535U); bnx2x_set_mdio_clk(bp, chip_id, phy->mdio_ctrl); } else { } if (((int )phy->flags & 1024) != 0) { bnx2x_bits_en(bp, phy->mdio_ctrl + 176U, 2U); } else { } tmp = (u32 )(((((int )phy->addr << 21) | ((int )devad << 16)) | (int )reg) | 536870912); writel(tmp, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); i = 0U; goto ldv_52156; ldv_52155: __const_udelay(42950UL); tmp = readl((void const volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); if (((long )tmp & 536870912L) == 0L) { __const_udelay(21475UL); goto ldv_52154; } else { } i = (u8 )((int )i + 1); ldv_52156: ; if ((unsigned int )i <= 49U) { goto ldv_52155; } else { } ldv_52154: ; if (((long )tmp & 536870912L) != 0L) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write phy register failed\n", "bnx2x_cl45_write", 2781, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } netdev_err((struct net_device const *)bp->dev, "MDC/MDIO access timeout\n"); rc = -14; } else { tmp = (u32 )(((((int )phy->addr << 21) | ((int )devad << 16)) | (int )val) | 603979776); writel(tmp, (void volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); i = 0U; goto ldv_52160; ldv_52159: __const_udelay(42950UL); tmp = readl((void const volatile *)bp->regview + (unsigned long )(phy->mdio_ctrl + 172U)); if (((long )tmp & 536870912L) == 0L) { __const_udelay(21475UL); goto ldv_52158; } else { } i = (u8 )((int )i + 1); ldv_52160: ; if ((unsigned int )i <= 49U) { goto ldv_52159; } else { } ldv_52158: ; if (((long )tmp & 536870912L) != 0L) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]write phy register failed\n", "bnx2x_cl45_write", 2802, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } netdev_err((struct net_device const *)bp->dev, "MDC/MDIO access timeout\n"); rc = -14; } else { } } if (((int )phy->flags & 256) != 0) { phy->flags = (u16 )((unsigned int )phy->flags ^ 512U); if (((int )phy->flags & 512) != 0) { bnx2x_cl45_read(bp, phy, (int )devad, 15, & temp_val); } else { } } else { } if (((int )phy->flags & 1024) != 0) { bnx2x_bits_dis(bp, phy->mdio_ctrl + 176U, 2U); } else { } return (rc); } } static u8 bnx2x_eee_has_cap(struct link_params *params ) { struct bnx2x *bp ; unsigned int tmp ; { bp = params->bp; tmp = readl((void const volatile *)bp->regview + (unsigned long )params->shmem2_base); if ((unsigned long )tmp <= ((unsigned long )params->port + 76UL) * 4UL) { return (0U); } else { } return (1U); } } static int bnx2x_eee_nvram_to_time(u32 nvram_mode , u32 *idle_timer ) { { switch (nvram_mode) { case 1U: *idle_timer = 2560U; goto ldv_52171; case 2U: *idle_timer = 256U; goto ldv_52171; case 3U: *idle_timer = 24576U; goto ldv_52171; default: *idle_timer = 0U; goto ldv_52171; } ldv_52171: ; return (0); } } static int bnx2x_eee_time_to_nvram(u32 idle_timer , u32 *nvram_mode ) { { switch (idle_timer) { case 2560U: *nvram_mode = 1U; goto ldv_52180; case 256U: *nvram_mode = 2U; goto ldv_52180; case 24576U: *nvram_mode = 3U; goto ldv_52180; default: *nvram_mode = 0U; goto ldv_52180; } ldv_52180: ; return (0); } } static u32 bnx2x_eee_calc_timer(struct link_params *params ) { u32 eee_mode ; u32 eee_idle ; struct bnx2x *bp ; int tmp ; unsigned int tmp___0 ; int tmp___1 ; { bp = params->bp; if ((params->eee_mode & 536870912U) != 0U) { if ((params->eee_mode & 268435456U) != 0U) { eee_idle = params->eee_mode & 1048575U; } else { tmp = bnx2x_eee_nvram_to_time(params->eee_mode & 3U, & eee_idle); if (tmp != 0) { return (0U); } else { } } } else { tmp___0 = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 116UL) + 904UL))); eee_mode = tmp___0 & 255U; tmp___1 = bnx2x_eee_nvram_to_time(eee_mode, & eee_idle); if (tmp___1 != 0) { return (0U); } else { } } return (eee_idle); } } static int bnx2x_eee_set_timers(struct link_params *params , struct link_vars *vars ) { u32 eee_idle ; u32 eee_mode ; struct bnx2x *bp ; long tmp ; int tmp___0 ; { eee_idle = 0U; bp = params->bp; eee_idle = bnx2x_eee_calc_timer(params); if (eee_idle != 0U) { writel(eee_idle, (void volatile *)bp->regview + (unsigned long )(((int )params->port << 2) + 43168)); } else if (((params->eee_mode & 1073741824U) != 0U && (params->eee_mode & 536870912U) != 0U) && (params->eee_mode & 268435456U) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Error: Tx LPI is enabled with timer 0\n", "bnx2x_eee_set_timers", 2921, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } vars->eee_status = vars->eee_status & 2147418112U; if ((params->eee_mode & 268435456U) != 0U) { eee_idle = eee_idle >> 4; vars->eee_status = (vars->eee_status | (eee_idle & 65535U)) | 2147483648U; } else { tmp___0 = bnx2x_eee_time_to_nvram(eee_idle, & eee_mode); if (tmp___0 != 0) { return (-22); } else { } vars->eee_status = vars->eee_status | eee_mode; } return (0); } } static int bnx2x_eee_initial_config(struct link_params *params , struct link_vars *vars , u8 mode ) { int tmp ; { vars->eee_status = vars->eee_status | ((unsigned int )mode << 16); if ((params->eee_mode & 1073741824U) != 0U) { vars->eee_status = vars->eee_status | 536870912U; } else { vars->eee_status = vars->eee_status & 3758096383U; } if ((int )params->eee_mode < 0) { vars->eee_status = vars->eee_status | 268435456U; } else { vars->eee_status = vars->eee_status & 4026531839U; } tmp = bnx2x_eee_set_timers(params, vars); return (tmp); } } static int bnx2x_eee_disable(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; { bp = params->bp; writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port << 2) + 43084)); bnx2x_cl45_write(bp, phy, 7, 60, 0); vars->eee_status = vars->eee_status & 4279238655U; return (0); } } static int bnx2x_eee_advertise(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars , u8 modes ) { struct bnx2x *bp ; u16 val ; long tmp ; long tmp___0 ; { bp = params->bp; val = 0U; writel(64544U, (void volatile *)bp->regview + (unsigned long )(((int )params->port << 2) + 43144)); if (((int )modes & 4) != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertise 10GBase-T EEE\n", "bnx2x_eee_advertise", 2986, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } val = (u16 )((unsigned int )val | 8U); } else { } if (((int )modes & 2) != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertise 1GBase-T EEE\n", "bnx2x_eee_advertise", 2990, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } val = (u16 )((unsigned int )val | 4U); } else { } bnx2x_cl45_write(bp, phy, 7, 60, (int )val); vars->eee_status = vars->eee_status & 4279238655U; vars->eee_status = vars->eee_status | (u32 )((int )modes << 20); return (0); } } static void bnx2x_update_mng_eee(struct link_params *params , u32 eee_status ) { struct bnx2x *bp ; u8 tmp ; { bp = params->bp; tmp = bnx2x_eee_has_cap(params); if ((unsigned int )tmp != 0U) { writel(eee_status, (void volatile *)(bp->regview + ((unsigned long )params->shmem2_base + ((unsigned long )params->port + 76UL) * 4UL))); } else { } return; } } static void bnx2x_eee_an_resolve(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 adv ; u16 lp ; u32 lp_adv ; u8 neg ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { bp = params->bp; adv = 0U; lp = 0U; lp_adv = 0U; neg = 0U; bnx2x_cl45_read(bp, phy, 7, 60, & adv); bnx2x_cl45_read(bp, phy, 7, 61, & lp); if (((int )lp & 2) != 0) { lp_adv = lp_adv | 1U; if (((int )adv & 2) != 0) { if ((unsigned int )vars->line_speed == 100U) { neg = 1U; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]EEE negotiated - 100M\n", "bnx2x_eee_an_resolve", 3029, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { } if (((int )lp & 20) != 0) { lp_adv = lp_adv | 2U; if (((int )adv & 20) != 0) { if ((unsigned int )vars->line_speed == 1000U) { neg = 1U; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]EEE negotiated - 1G\n", "bnx2x_eee_an_resolve", 3037, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { } if (((int )lp & 104) != 0) { lp_adv = lp_adv | 4U; if (((int )adv & 104) != 0) { if ((unsigned int )vars->line_speed == 10000U) { neg = 1U; } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]EEE negotiated - 10G\n", "bnx2x_eee_an_resolve", 3045, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { } vars->eee_status = vars->eee_status & 4043309055U; vars->eee_status = vars->eee_status | (lp_adv << 24); if ((unsigned int )neg != 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]EEE is active\n", "bnx2x_eee_an_resolve", 3053, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->eee_status = vars->eee_status | 1073741824U; } else { } return; } } static void bnx2x_bsc_module_sel(struct link_params *params ) { int idx ; u32 board_cfg ; u32 sfp_ctrl ; u32 i2c_pins[2U] ; u32 i2c_val[2U] ; struct bnx2x *bp ; u8 port ; long tmp ; { bp = params->bp; port = params->port; board_cfg = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem_base + 44UL))); i2c_pins[0] = board_cfg & 63U; i2c_pins[1] = (board_cfg & 4032U) >> 6; sfp_ctrl = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 400UL) + 116UL))); i2c_val[0] = (sfp_ctrl & 16777216U) != 0U; i2c_val[1] = (sfp_ctrl & 33554432U) != 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting BSC switch\n", "bnx2x_bsc_module_sel", 3083, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } idx = 0; goto ldv_52246; ldv_52245: bnx2x_set_cfg_pin(bp, i2c_pins[idx], i2c_val[idx]); idx = idx + 1; ldv_52246: ; if (idx <= 1) { goto ldv_52245; } else { } return; } } static int bnx2x_bsc_read(struct link_params *params , struct bnx2x *bp , u8 sl_devid , u16 sl_addr , u8 lc_addr , u8 xfer_cnt , u32 *data_array ) { u32 val ; u32 i ; int rc ; long tmp ; long tmp___0 ; u32 tmp___1 ; long tmp___2 ; u32 tmp___3 ; { rc = 0; if ((unsigned int )xfer_cnt > 16U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]invalid xfer_cnt %d. Max is 16 bytes\n", "bnx2x_bsc_read", 3101, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )xfer_cnt); } else { } return (-22); } else { } bnx2x_bsc_module_sel(params); xfer_cnt = 16U - (unsigned int )lc_addr; val = readl((void const volatile *)bp->regview + 547072U); val = val | 2147483648U; writel(val, (void volatile *)bp->regview + 547072U); val = (u32 )(((int )sl_devid << 16) | (int )sl_addr); writel(val, (void volatile *)bp->regview + 547076U); val = (u32 )(((int )lc_addr << 8) | -1610612736); writel(val, (void volatile *)bp->regview + 547072U); i = 0U; val = readl((void const volatile *)bp->regview + 547072U); goto ldv_52263; ldv_52262: __const_udelay(42950UL); val = readl((void const volatile *)bp->regview + 547072U); tmp___1 = i; i = i + 1U; if (tmp___1 > 1000U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]wr 0 byte timed out after %d try\n", "bnx2x_bsc_read", 3132, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i); } else { } rc = -14; goto ldv_52261; } else { } ldv_52263: ; if (((val >> 16) & 3U) != 1U) { goto ldv_52262; } else { } ldv_52261: ; if (rc == -14) { return (rc); } else { } val = (u32 )((((int )lc_addr << 8) | -1879048192) | (int )xfer_cnt); writel(val, (void volatile *)bp->regview + 547072U); i = 0U; val = readl((void const volatile *)bp->regview + 547072U); goto ldv_52266; ldv_52265: __const_udelay(42950UL); val = readl((void const volatile *)bp->regview + 547072U); tmp___3 = i; i = i + 1U; if (tmp___3 > 1000U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]rd op timed out after %d try\n", "bnx2x_bsc_read", 3155, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i); } else { } rc = -14; goto ldv_52264; } else { } ldv_52266: ; if (((val >> 16) & 3U) != 1U) { goto ldv_52265; } else { } ldv_52264: ; if (rc == -14) { return (rc); } else { } i = (u32 )((int )lc_addr >> 2); goto ldv_52268; ldv_52267: *(data_array + (unsigned long )i) = readl((void const volatile *)bp->regview + (unsigned long )((i + 136776U) * 4U)); i = i + 1U; ldv_52268: ; if (i <= 3U) { goto ldv_52267; } else { } return (rc); } } static void bnx2x_cl45_read_or_write(struct bnx2x *bp , struct bnx2x_phy *phy , u8 devad , u16 reg , u16 or_val ) { u16 val ; { bnx2x_cl45_read(bp, phy, (int )devad, (int )reg, & val); bnx2x_cl45_write(bp, phy, (int )devad, (int )reg, (int )val | (int )or_val); return; } } static void bnx2x_cl45_read_and_write(struct bnx2x *bp , struct bnx2x_phy *phy , u8 devad , u16 reg , u16 and_val ) { u16 val ; { bnx2x_cl45_read(bp, phy, (int )devad, (int )reg, & val); bnx2x_cl45_write(bp, phy, (int )devad, (int )reg, (int )val & (int )and_val); return; } } int bnx2x_phy_read(struct link_params *params , u8 phy_addr , u8 devad , u16 reg , u16 *ret_val ) { u8 phy_index ; int tmp ; { phy_index = 0U; goto ldv_52295; ldv_52294: ; if ((int )params->phy[(int )phy_index].addr == (int )phy_addr) { tmp = bnx2x_cl45_read(params->bp, (struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index, (int )devad, (int )reg, ret_val); return (tmp); } else { } phy_index = (u8 )((int )phy_index + 1); ldv_52295: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_52294; } else { } return (-22); } } int bnx2x_phy_write(struct link_params *params , u8 phy_addr , u8 devad , u16 reg , u16 val ) { u8 phy_index ; int tmp ; { phy_index = 0U; goto ldv_52306; ldv_52305: ; if ((int )params->phy[(int )phy_index].addr == (int )phy_addr) { tmp = bnx2x_cl45_write(params->bp, (struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index, (int )devad, (int )reg, (int )val); return (tmp); } else { } phy_index = (u8 )((int )phy_index + 1); ldv_52306: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_52305; } else { } return (-22); } } static u8 bnx2x_get_warpcore_lane(struct bnx2x_phy *phy , struct link_params *params ) { u8 lane ; struct bnx2x *bp ; u32 path_swap ; u32 path_swap_ovr ; u8 path ; u8 port ; u32 port_swap ; u32 port_swap_ovr ; u8 tmp ; { lane = 0U; bp = params->bp; path = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; port = params->port; tmp = bnx2x_is_4_port_mode(bp); if ((unsigned int )tmp != 0U) { path_swap_ovr = readl((void const volatile *)bp->regview + 42808U); if ((int )path_swap_ovr & 1) { path_swap = path_swap_ovr & 2U; } else { path_swap = readl((void const volatile *)bp->regview + 42844U); } if (path_swap != 0U) { path = (u8 )((unsigned int )path ^ 1U); } else { } port_swap_ovr = readl((void const volatile *)bp->regview + 42804U); if ((int )port_swap_ovr & 1) { port_swap = port_swap_ovr & 2U; } else { port_swap = readl((void const volatile *)bp->regview + 42836U); } if (port_swap != 0U) { port = (u8 )((unsigned int )port ^ 1U); } else { } lane = ((int )port << 1U) + (int )path; } else { path_swap_ovr = readl((void const volatile *)bp->regview + 42796U); if ((int )path_swap_ovr & 1) { path_swap = path_swap_ovr & 2U; } else { path_swap = readl((void const volatile *)bp->regview + 42840U); } if (path_swap != 0U) { path = (u8 )((unsigned int )path ^ 1U); } else { } lane = (int )path << 1U; } return (lane); } } static void bnx2x_set_aer_mmd(struct link_params *params , struct bnx2x_phy *phy ) { u32 ser_lane ; u16 offset ; u16 aer_val ; struct bnx2x *bp ; u8 tmp ; { bp = params->bp; ser_lane = (params->lane_config & 49152U) >> 14; offset = phy->type == 0U ? (int )((u16 )phy->addr) + (int )((u16 )ser_lane) : 0U; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { tmp = bnx2x_get_warpcore_lane(phy, params); aer_val = (u16 )tmp; if (((int )phy->flags & 16) != 0) { aer_val = (u16 )((unsigned int )((int )aer_val >> 1) | 512U); } else { } } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { aer_val = (unsigned int )offset + 14335U; } else { aer_val = (unsigned int )offset + 14336U; } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, (int )aer_val); return; } } static void bnx2x_set_serdes_access(struct bnx2x *bp , u8 port ) { u32 emac_base ; { emac_base = (unsigned int )port != 0U ? 33792U : 32768U; writel(1U, (void volatile *)bp->regview + (unsigned long )((int )port * 16 + 66412)); writel(610238464U, (void volatile *)bp->regview + (unsigned long )(emac_base + 172U)); __const_udelay(2147500UL); writel(610074639U, (void volatile *)bp->regview + (unsigned long )(emac_base + 172U)); __const_udelay(2147500UL); writel(0U, (void volatile *)bp->regview + (unsigned long )((int )port * 16 + 66412)); return; } } static void bnx2x_serdes_deassert(struct bnx2x *bp , u8 port ) { u32 val ; long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_serdes_deassert\n", "bnx2x_serdes_deassert", 3334, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } val = (u32 )(15 << (int )port * 16); writel(val, (void volatile *)bp->regview + 42408U); __const_udelay(2147500UL); writel(val, (void volatile *)bp->regview + 42404U); bnx2x_set_serdes_access(bp, (int )port); writel(3U, (void volatile *)bp->regview + (unsigned long )(((int )port + 4151) * 16)); return; } } static void bnx2x_xgxs_specific_func(struct bnx2x_phy *phy , struct link_params *params , u32 action ) { struct bnx2x *bp ; { bp = params->bp; switch (action) { case 3U: writel(0U, (void volatile *)bp->regview + (unsigned long )((int )params->port * 24 + 66360)); writel((unsigned int )phy->def_md_devad, (void volatile *)bp->regview + (unsigned long )((int )params->port * 24 + 66364)); goto ldv_52346; } ldv_52346: ; return; } } static void bnx2x_xgxs_deassert(struct link_params *params ) { struct bnx2x *bp ; u8 port ; u32 val ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_xgxs_deassert\n", "bnx2x_xgxs_deassert", 3369, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } port = params->port; val = (u32 )(496 << (int )port * 16); writel(val, (void volatile *)bp->regview + 42408U); __const_udelay(2147500UL); writel(val, (void volatile *)bp->regview + 42404U); bnx2x_xgxs_specific_func((struct bnx2x_phy *)(& params->phy), params, 3U); return; } } static void bnx2x_calc_ieee_aneg_adv(struct bnx2x_phy *phy , struct link_params *params , u16 *ieee_fc ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; *ieee_fc = 32U; switch ((int )phy->req_flow_ctrl) { case 0: ; switch ((int )params->req_fc_auto_adv) { case 768: ; case 512: *ieee_fc = (u16 )((unsigned int )*ieee_fc | 384U); goto ldv_52363; case 256: *ieee_fc = (u16 )((unsigned int )*ieee_fc | 256U); goto ldv_52363; default: ; goto ldv_52363; } ldv_52363: ; goto ldv_52366; case 256: *ieee_fc = (u16 )((unsigned int )*ieee_fc | 256U); goto ldv_52366; case 512: ; case 768: *ieee_fc = (u16 )((unsigned int )*ieee_fc | 384U); goto ldv_52366; case 1024: ; default: *ieee_fc = *ieee_fc; goto ldv_52366; } ldv_52366: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]ieee_fc = 0x%x\n", "bnx2x_calc_ieee_aneg_adv", 3420, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )*ieee_fc); } else { } return; } } static void set_phy_vars(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 actual_phy_idx ; u8 phy_index ; u8 link_cfg_idx ; u8 phy_config_swapped ; long tmp ; { bp = params->bp; phy_config_swapped = (unsigned int )((u8 )params->multi_phy_config) & 8U; phy_index = 0U; goto ldv_52384; ldv_52383: link_cfg_idx = (unsigned int )phy_index != 0U ? (unsigned int )phy_index + 255U : 0U; actual_phy_idx = phy_index; if ((unsigned int )phy_config_swapped != 0U) { if ((unsigned int )phy_index == 1U) { actual_phy_idx = 2U; } else if ((unsigned int )phy_index == 2U) { actual_phy_idx = 1U; } else { } } else { } params->phy[(int )actual_phy_idx].req_flow_ctrl = params->req_flow_ctrl[(int )link_cfg_idx]; params->phy[(int )actual_phy_idx].req_line_speed = params->req_line_speed[(int )link_cfg_idx]; params->phy[(int )actual_phy_idx].speed_cap_mask = params->speed_cap_mask[(int )link_cfg_idx]; params->phy[(int )actual_phy_idx].req_duplex = params->req_duplex[(int )link_cfg_idx]; if ((unsigned int )params->req_line_speed[(int )link_cfg_idx] == 0U) { vars->link_status = vars->link_status | 32U; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]req_flow_ctrl %x, req_line_speed %x, speed_cap_mask %x\n", "set_phy_vars", 3460, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->phy[(int )actual_phy_idx].req_flow_ctrl, (int )params->phy[(int )actual_phy_idx].req_line_speed, params->phy[(int )actual_phy_idx].speed_cap_mask); } else { } phy_index = (u8 )((int )phy_index + 1); ldv_52384: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_52383; } else { } return; } } static void bnx2x_ext_phy_set_pause(struct link_params *params , struct bnx2x_phy *phy , struct link_vars *vars ) { u16 val ; struct bnx2x *bp ; long tmp ; { bp = params->bp; bnx2x_cl45_read(bp, phy, 7, 16, & val); val = (unsigned int )val & 62463U; bnx2x_calc_ieee_aneg_adv(phy, params, & vars->ieee_fc); if (((int )vars->ieee_fc & 256) != 0) { val = (u16 )((unsigned int )val | 2048U); } else { } if (((int )vars->ieee_fc & 384) == 384) { val = (u16 )((unsigned int )val | 1024U); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Ext phy AN advertize 0x%x\n", "bnx2x_ext_phy_set_pause", 3487, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val); } else { } bnx2x_cl45_write(bp, phy, 7, 16, (int )val); return; } } static void bnx2x_pause_resolve(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars , u32 pause_result ) { struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { bp = params->bp; switch (pause_result) { case 11U: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Flow Control: TX only\n", "bnx2x_pause_resolve", 3500, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->flow_ctrl = 256U; goto ldv_52403; case 14U: tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Flow Control: RX only\n", "bnx2x_pause_resolve", 3505, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->flow_ctrl = 512U; goto ldv_52403; case 5U: ; case 7U: ; case 13U: ; case 15U: ; if ((unsigned int )params->req_fc_auto_adv == 768U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Flow Control: RX & TX\n", "bnx2x_pause_resolve", 3518, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->flow_ctrl = 768U; } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Flow Control: RX only\n", "bnx2x_pause_resolve", 3521, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->flow_ctrl = 512U; } goto ldv_52403; default: tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Flow Control: None\n", "bnx2x_pause_resolve", 3527, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->flow_ctrl = 1024U; goto ldv_52403; } ldv_52403: ; if ((int )pause_result & 1) { vars->link_status = vars->link_status | 262144U; } else { } if ((pause_result & 2U) != 0U) { vars->link_status = vars->link_status | 524288U; } else { } return; } } static void bnx2x_ext_phy_update_adv_fc(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u16 ld_pause ; u16 lp_pause ; u16 pause_result ; struct bnx2x *bp ; u8 lane ; u8 tmp ; u16 gp_status ; u16 gp_mask ; long tmp___0 ; { bp = params->bp; if (phy->type == 3584U) { bnx2x_cl22_read(bp, phy, 4, & ld_pause); bnx2x_cl22_read(bp, phy, 5, & lp_pause); } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && (unsigned int )params->num_phys == 1U) { tmp = bnx2x_get_warpcore_lane(phy, params); lane = tmp; bnx2x_cl45_read(bp, phy, 7, 33236, & gp_status); gp_mask = (u16 )(4112 << (int )lane); if (((int )gp_status & (int )gp_mask) == (int )gp_mask) { bnx2x_cl45_read(bp, phy, 7, 16, & ld_pause); bnx2x_cl45_read(bp, phy, 7, 19, & lp_pause); } else { bnx2x_cl45_read(bp, phy, 7, 65508, & ld_pause); bnx2x_cl45_read(bp, phy, 7, 65509, & lp_pause); ld_pause = ((unsigned int )ld_pause & 384U) << 3U; lp_pause = ((unsigned int )lp_pause & 384U) << 3U; } } else { bnx2x_cl45_read(bp, phy, 7, 16, & ld_pause); bnx2x_cl45_read(bp, phy, 7, 19, & lp_pause); } pause_result = (u16 )(((int )ld_pause & 3072) >> 8); pause_result = (u16 )((int )((short )(((int )lp_pause & 3072) >> 10)) | (int )((short )pause_result)); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Ext PHY pause result 0x%x\n", "bnx2x_ext_phy_update_adv_fc", 3588, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pause_result); } else { } bnx2x_pause_resolve(phy, params, vars, (u32 )pause_result); return; } } static u8 bnx2x_ext_phy_resolve_fc(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u8 ret ; { ret = 0U; vars->flow_ctrl = 1024U; if ((unsigned int )phy->req_flow_ctrl != 0U) { if ((unsigned int )phy->req_line_speed == 0U) { bnx2x_ext_phy_update_adv_fc(phy, params, vars); } else { } vars->flow_ctrl = phy->req_flow_ctrl; } else if ((unsigned int )phy->req_line_speed != 0U) { vars->flow_ctrl = params->req_fc_auto_adv; } else if ((vars->link_status & 64U) != 0U) { ret = 1U; bnx2x_ext_phy_update_adv_fc(phy, params, vars); } else { } return (ret); } } static void bnx2x_warpcore_enable_AN_KR2(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 i ; struct bnx2x_reg_set reg_set[15U] ; long tmp ; { bp = params->bp; reg_set[0].devad = 3U; reg_set[0].reg = 33846U; reg_set[0].val = 41303U; reg_set[1].devad = 3U; reg_set[1].reg = 33848U; reg_set[1].val = 52194U; reg_set[2].devad = 3U; reg_set[2].reg = 33847U; reg_set[2].val = 30007U; reg_set[3].devad = 3U; reg_set[3].reg = 33849U; reg_set[3].val = 41303U; reg_set[4].devad = 3U; reg_set[4].reg = 33851U; reg_set[4].val = 52194U; reg_set[5].devad = 3U; reg_set[5].reg = 33850U; reg_set[5].val = 30007U; reg_set[6].devad = 3U; reg_set[6].reg = 33648U; reg_set[6].val = 10U; reg_set[7].devad = 3U; reg_set[7].reg = 33650U; reg_set[7].val = 25600U; reg_set[8].devad = 3U; reg_set[8].reg = 33652U; reg_set[8].val = 1568U; reg_set[9].devad = 3U; reg_set[9].reg = 33659U; reg_set[9].val = 343U; reg_set[10].devad = 3U; reg_set[10].reg = 33875U; reg_set[10].val = 25700U; reg_set[11].devad = 3U; reg_set[11].reg = 33876U; reg_set[11].val = 12624U; reg_set[12].devad = 3U; reg_set[12].reg = 33877U; reg_set[12].val = 12624U; reg_set[13].devad = 3U; reg_set[13].reg = 33878U; reg_set[13].val = 343U; reg_set[14].devad = 3U; reg_set[14].reg = 33879U; reg_set[14].val = 1568U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling 20G-KR2\n", "bnx2x_warpcore_enable_AN_KR2", 3657, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read_or_write(bp, phy, 3, 33640, 192); i = 0U; goto ldv_52441; ldv_52440: bnx2x_cl45_write(bp, phy, (int )reg_set[(int )i].devad, (int )reg_set[(int )i].reg, (int )reg_set[(int )i].val); i = (u16 )((int )i + 1); ldv_52441: ; if ((unsigned int )i <= 14U) { goto ldv_52440; } else { } params->link_attr_sync = params->link_attr_sync | 1U; bnx2x_update_link_attr(params, params->link_attr_sync); return; } } static void bnx2x_disable_kr2(struct link_params *params , struct link_vars *vars , struct bnx2x_phy *phy ) { struct bnx2x *bp ; int i ; struct bnx2x_reg_set reg_set[15U] ; long tmp ; { bp = params->bp; reg_set[0].devad = 3U; reg_set[0].reg = 33846U; reg_set[0].val = 30352U; reg_set[1].devad = 3U; reg_set[1].reg = 33848U; reg_set[1].val = 58951U; reg_set[2].devad = 3U; reg_set[2].reg = 33847U; reg_set[2].val = 50416U; reg_set[3].devad = 3U; reg_set[3].reg = 33849U; reg_set[3].val = 30352U; reg_set[4].devad = 3U; reg_set[4].reg = 33851U; reg_set[4].val = 58951U; reg_set[5].devad = 3U; reg_set[5].reg = 33850U; reg_set[5].val = 50416U; reg_set[6].devad = 3U; reg_set[6].reg = 33648U; reg_set[6].val = 12U; reg_set[7].devad = 3U; reg_set[7].reg = 33650U; reg_set[7].val = 24576U; reg_set[8].devad = 3U; reg_set[8].reg = 33652U; reg_set[8].val = 0U; reg_set[9].devad = 3U; reg_set[9].reg = 33659U; reg_set[9].val = 2U; reg_set[10].devad = 3U; reg_set[10].reg = 33875U; reg_set[10].val = 0U; reg_set[11].devad = 3U; reg_set[11].reg = 33876U; reg_set[11].val = 2807U; reg_set[12].devad = 3U; reg_set[12].reg = 33877U; reg_set[12].val = 2807U; reg_set[13].devad = 3U; reg_set[13].reg = 33878U; reg_set[13].val = 2U; reg_set[14].devad = 3U; reg_set[14].reg = 33879U; reg_set[14].val = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Disabling 20G-KR2\n", "bnx2x_disable_kr2", 3695, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } i = 0; goto ldv_52455; ldv_52454: bnx2x_cl45_write(bp, phy, (int )reg_set[i].devad, (int )reg_set[i].reg, (int )reg_set[i].val); i = i + 1; ldv_52455: ; if ((unsigned int )i <= 14U) { goto ldv_52454; } else { } params->link_attr_sync = params->link_attr_sync & 4294967294U; bnx2x_update_link_attr(params, params->link_attr_sync); vars->check_kr2_recovery_cnt = 5U; return; } } static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Configure WC for LPI pass through\n", "bnx2x_warpcore_set_lpi_passthrough", 3711, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 3, 33680, 124); bnx2x_cl45_read_or_write(bp, phy, 3, 33598, 49152); return; } } static void bnx2x_warpcore_restart_AN_KR(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 lane ; u8 tmp ; { bp = params->bp; tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, (int )lane); bnx2x_cl45_write(bp, phy, 7, 0, 4608); bnx2x_set_aer_mmd(params, phy); return; } } static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u16 lane ; u16 i ; u16 cl72_ctrl ; u16 an_adv ; u16 val ; u32 wc_lane_config ; struct bnx2x *bp ; struct bnx2x_reg_set reg_set[7U] ; long tmp ; u16 addr ; long tmp___0 ; long tmp___1 ; u8 tmp___2 ; long tmp___3 ; unsigned int tmp___4 ; { an_adv = 0U; bp = params->bp; reg_set[0].devad = 3U; reg_set[0].reg = 33537U; reg_set[0].val = 7U; reg_set[1].devad = 1U; reg_set[1].reg = 7U; reg_set[1].val = 0U; reg_set[2].devad = 3U; reg_set[2].reg = 33728U; reg_set[2].val = 29717U; reg_set[3].devad = 3U; reg_set[3].reg = 33545U; reg_set[3].val = 24976U; reg_set[4].devad = 7U; reg_set[4].reg = 0U; reg_set[4].val = 0U; reg_set[5].devad = 1U; reg_set[5].reg = 150U; reg_set[5].val = 2U; reg_set[6].devad = 3U; reg_set[6].reg = 33506U; reg_set[6].val = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enable Auto Negotiation for KR\n", "bnx2x_warpcore_enable_AN_KR", 3749, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } i = 0U; goto ldv_52486; ldv_52485: bnx2x_cl45_write(bp, phy, (int )reg_set[(int )i].devad, (int )reg_set[(int )i].reg, (int )reg_set[(int )i].val); i = (u16 )((int )i + 1); ldv_52486: ; if ((unsigned int )i <= 6U) { goto ldv_52485; } else { } bnx2x_cl45_read(bp, phy, 3, 33507, & cl72_ctrl); cl72_ctrl = (unsigned int )cl72_ctrl & 2303U; cl72_ctrl = (u16 )((unsigned int )cl72_ctrl | 14336U); bnx2x_cl45_write(bp, phy, 3, 33507, (int )cl72_ctrl); if (((unsigned int )vars->line_speed == 0U && (phy->speed_cap_mask & 1048576U) != 0U) || (unsigned int )vars->line_speed == 1000U) { addr = 33537U; an_adv = (u16 )((unsigned int )an_adv | 32U); bnx2x_cl45_read_or_write(bp, phy, 3, (int )addr, 1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertize 1G\n", "bnx2x_warpcore_enable_AN_KR", 3771, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if (((unsigned int )vars->line_speed == 0U && (phy->speed_cap_mask & 4194304U) != 0U) || (unsigned int )vars->line_speed == 10000U) { an_adv = (u16 )((unsigned int )an_adv | 128U); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, 0); bnx2x_cl45_write(bp, phy, 7, 33073, 1); bnx2x_set_aer_mmd(params, phy); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertize 10G\n", "bnx2x_warpcore_enable_AN_KR", 3785, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } tmp___2 = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp___2; bnx2x_cl45_write(bp, phy, 3, (int )((unsigned int )lane * 16U + 32871U), 9872); if (((int )phy->flags & 16) != 0) { bnx2x_cl45_write(bp, phy, 3, (int )((unsigned int )((u16 )((int )lane + 1)) * 16U + 32871U), 9872); } else { } bnx2x_cl45_write(bp, phy, 3, 33510, 1008); bnx2x_cl45_write(bp, phy, 3, 33512, 1008); bnx2x_cl45_write(bp, phy, 7, 17, (int )an_adv); bnx2x_cl45_write(bp, phy, 7, 18, 49152); tmp___4 = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem_base + ((unsigned long )params->port + 1UL) * 400UL))); if ((tmp___4 & 1048576U) != 0U) { bnx2x_cl45_read_or_write(bp, phy, 3, 33616, 1); tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enable CL37 BAM on KR\n", "bnx2x_warpcore_enable_AN_KR", 3823, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } bnx2x_ext_phy_set_pause(params, phy, vars); vars->rx_tx_asic_rst = 4U; bnx2x_cl45_read_or_write(bp, phy, 3, 33609, 256); bnx2x_cl45_write(bp, phy, 3, 33577, 31); if (((unsigned int )phy->req_line_speed == 0U && (phy->speed_cap_mask & 8388608U) != 0U) || (unsigned int )phy->req_line_speed == 20000U) { bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, (int )lane); bnx2x_cl45_read_or_write(bp, phy, 3, (int )((unsigned int )lane * 16U + 32970U), 2048); bnx2x_cl45_write(bp, phy, 3, 33090, 7); bnx2x_set_aer_mmd(params, phy); bnx2x_warpcore_enable_AN_KR2(phy, params, vars); } else { bnx2x_cl45_write(bp, phy, 3, 33536, 16); wc_lane_config = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem_base + 48UL))); bnx2x_cl45_read(bp, phy, 3, (int )((unsigned int )((int )lane << 4U) + 32954U), & val); val = (u16 )((unsigned int )val | 2048U); if (((u32 )(1048576 << (int )lane) & wc_lane_config) != 0U) { val = (u16 )((unsigned int )val | 12U); } else { val = (unsigned int )val & 65523U; } bnx2x_cl45_write(bp, phy, 3, (int )((unsigned int )((int )lane << 4U) + 32954U), (int )val); bnx2x_disable_kr2(params, vars, phy); } bnx2x_warpcore_restart_AN_KR(phy, params); return; } } static void bnx2x_warpcore_set_10G_KR(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 val16 ; u16 i ; u16 lane ; struct bnx2x_reg_set reg_set[7U] ; u8 tmp ; { bp = params->bp; reg_set[0].devad = 3U; reg_set[0].reg = 33537U; reg_set[0].val = 7U; reg_set[1].devad = 3U; reg_set[1].reg = 33507U; reg_set[1].val = 16128U; reg_set[2].devad = 7U; reg_set[2].reg = 17U; reg_set[2].val = 0U; reg_set[3].devad = 7U; reg_set[3].reg = 0U; reg_set[3].val = 0U; reg_set[4].devad = 3U; reg_set[4].reg = 33577U; reg_set[4].val = 1U; reg_set[5].devad = 3U; reg_set[5].reg = 33609U; reg_set[5].val = 10U; reg_set[6].devad = 1U; reg_set[6].reg = 150U; reg_set[6].val = 2U; i = 0U; goto ldv_52502; ldv_52501: bnx2x_cl45_write(bp, phy, (int )reg_set[(int )i].devad, (int )reg_set[(int )i].reg, (int )reg_set[(int )i].val); i = (u16 )((int )i + 1); ldv_52502: ; if ((unsigned int )i <= 6U) { goto ldv_52501; } else { } tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, 0); bnx2x_cl45_read(bp, phy, 3, 32789, & val16); val16 = (u16 )(~ ((int )((short )(17 << (int )lane))) & (int )((short )val16)); bnx2x_cl45_write(bp, phy, 3, 32789, (int )val16); bnx2x_cl45_read(bp, phy, 3, 32790, & val16); val16 = (u16 )((int )((short )(771 << ((int )lane << 1))) | (int )((short )val16)); bnx2x_cl45_write(bp, phy, 3, 32790, (int )val16); bnx2x_set_aer_mmd(params, phy); bnx2x_cl45_write(bp, phy, 1, 0, 8256); bnx2x_cl45_write(bp, phy, 1, 7, 11); bnx2x_cl45_write(bp, phy, 3, 33545, 48); bnx2x_cl45_write(bp, phy, 3, 33712, 9); bnx2x_cl45_read_or_write(bp, phy, 3, 33728, 249); bnx2x_cl45_write(bp, phy, 3, 0, 16384); bnx2x_cl45_write(bp, phy, 3, 0, 0); return; } } static void bnx2x_warpcore_set_10G_XFI(struct bnx2x_phy *phy , struct link_params *params , u8 is_xfi ) { struct bnx2x *bp ; u16 misc1_val ; u16 tap_val ; u16 tx_driver_val ; u16 lane ; u16 val ; u32 cfg_tap_val ; u32 tx_drv_brdct ; u32 tx_equal ; u32 ifir_val ; u32 ipost2_val ; u32 ipre_driver_val ; u8 tmp ; { bp = params->bp; bnx2x_cl45_read_or_write(bp, phy, 3, 33310, 32768); bnx2x_cl45_read_or_write(bp, phy, 3, 33538, 1); bnx2x_cl45_write(bp, phy, 7, 0, 0); bnx2x_cl45_read_and_write(bp, phy, 3, 33792, 65530); bnx2x_cl45_read_or_write(bp, phy, 3, 33794, 128); bnx2x_cl45_read_and_write(bp, phy, 3, 33596, 65407); bnx2x_cl45_read_and_write(bp, phy, 3, 33536, 65518); bnx2x_cl45_read(bp, phy, 3, 33537, & val); bnx2x_cl45_write(bp, phy, 3, 33537, (int )(((unsigned int )val & 65528U) | 6U)); bnx2x_cl45_read(bp, phy, 3, 33544, & misc1_val); misc1_val = (unsigned int )misc1_val & 65504U; if ((unsigned int )is_xfi != 0U) { misc1_val = (u16 )((unsigned int )misc1_val | 5U); tap_val = 9072U; tx_driver_val = 560U; } else { cfg_tap_val = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 400UL) + 128UL))); tx_equal = cfg_tap_val & 65535U; misc1_val = (u16 )((unsigned int )misc1_val | 9U); if (tx_equal != 0U) { tap_val = (unsigned short )tx_equal; } else { tap_val = 16050U; } ifir_val = 0U; ipost2_val = 3U; ipre_driver_val = 6U; tx_drv_brdct = 2U; if ((cfg_tap_val & 4293918720U) != 0U) { ifir_val = (cfg_tap_val & 15728640U) >> 20; ipre_driver_val = (cfg_tap_val & 251658240U) >> 24; ipost2_val = cfg_tap_val >> 28; } else { } if ((cfg_tap_val & 983040U) != 0U) { tx_drv_brdct = (cfg_tap_val & 983040U) >> 16; } else { } tx_driver_val = ((((int )((u16 )ipost2_val) << 12U) | ((int )((u16 )tx_drv_brdct) << 8U)) | ((int )((u16 )ipre_driver_val) << 4U)) | ((int )((u16 )ifir_val) << 1U); } bnx2x_cl45_write(bp, phy, 3, 33544, (int )misc1_val); tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; bnx2x_cl45_write(bp, phy, 3, 33506, (int )((unsigned int )tap_val | 32768U)); bnx2x_cl45_write(bp, phy, 3, (int )((unsigned int )lane * 16U + 32871U), (int )tx_driver_val); bnx2x_cl45_read_or_write(bp, phy, 3, 33536, 13); bnx2x_cl45_read_or_write(bp, phy, 3, 33596, 32896); bnx2x_warpcore_set_lpi_passthrough(phy, params); bnx2x_cl45_write(bp, phy, 3, 0, 256); bnx2x_cl45_read_and_write(bp, phy, 3, 33538, 65534); bnx2x_cl45_read_and_write(bp, phy, 3, 33310, 32767); return; } } static void bnx2x_warpcore_set_20G_force_KR2(struct bnx2x_phy *phy , struct link_params *params ) { u16 val ; struct bnx2x *bp ; { bp = params->bp; bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, 0); bnx2x_cl45_read_and_write(bp, phy, 3, 32768, 57343); bnx2x_set_aer_mmd(params, phy); bnx2x_cl45_read_and_write(bp, phy, 1, 150, 65533); bnx2x_cl45_write(bp, phy, 7, 0, 0); bnx2x_cl45_read(bp, phy, 3, 33648, & val); val = (unsigned int )val & 65503U; val = (u16 )((unsigned int )val | 64U); bnx2x_cl45_write(bp, phy, 3, 33648, (int )val); bnx2x_cl45_read_or_write(bp, phy, 3, 33544, 31); bnx2x_cl45_read_or_write(bp, phy, 3, 33596, 128); bnx2x_cl45_read(bp, phy, 3, 33507, & val); val = (unsigned int )val & 16383U; val = (u16 )((unsigned int )val | 32768U); bnx2x_cl45_write(bp, phy, 3, 33507, (int )val); bnx2x_cl45_write(bp, phy, 3, 33506, 33626); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, 0); bnx2x_cl45_read_or_write(bp, phy, 3, 32768, 8192); bnx2x_set_aer_mmd(params, phy); return; } } static void bnx2x_warpcore_set_20G_DXGXS(struct bnx2x *bp , struct bnx2x_phy *phy , u16 lane ) { { bnx2x_cl45_write(bp, phy, 3, 32953, 144); bnx2x_cl45_write(bp, phy, 3, 32985, 144); bnx2x_cl45_write(bp, phy, 3, 33730, 57456); bnx2x_cl45_write(bp, phy, 3, 33731, 49360); bnx2x_cl45_write(bp, phy, 3, 33732, 41136); bnx2x_cl45_write(bp, phy, 3, 33733, 32912); bnx2x_cl45_write(bp, phy, 3, 33734, 61680); bnx2x_cl45_write(bp, phy, 3, 33735, 61680); bnx2x_cl45_write(bp, phy, 3, 33736, 61680); bnx2x_cl45_write(bp, phy, 3, 33737, 61680); bnx2x_cl45_write(bp, phy, 3, 33544, 24584); bnx2x_cl45_write(bp, phy, 3, 33596, 32904); bnx2x_cl45_write(bp, phy, 3, 33506, 51920); bnx2x_cl45_write(bp, phy, 3, (int )((unsigned int )lane * 16U + 32871U), 8736); return; } } static void bnx2x_warpcore_set_sgmii_speed(struct bnx2x_phy *phy , struct link_params *params , u8 fiber_mode , u8 always_autoneg ) { struct bnx2x *bp ; u16 val16 ; u16 digctrl_kx1 ; u16 digctrl_kx2 ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { bp = params->bp; bnx2x_cl45_read_and_write(bp, phy, 3, 33728, 40959); bnx2x_warpcore_set_lpi_passthrough(phy, params); if ((unsigned int )always_autoneg != 0U || (unsigned int )phy->req_line_speed == 0U) { bnx2x_cl45_read_or_write(bp, phy, 3, 65504, 4096); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]set SGMII AUTONEG\n", "bnx2x_warpcore_set_sgmii_speed", 4215, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { bnx2x_cl45_read(bp, phy, 3, 65504, & val16); val16 = (unsigned int )val16 & 52927U; switch ((int )phy->req_line_speed) { case 10: ; goto ldv_52544; case 100: val16 = (u16 )((unsigned int )val16 | 8192U); goto ldv_52544; case 1000: val16 = (u16 )((unsigned int )val16 | 64U); goto ldv_52544; default: tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Speed not supported: 0x%x\n", "bnx2x_warpcore_set_sgmii_speed", 4231, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy->req_line_speed); } else { } return; } ldv_52544: ; if ((unsigned int )phy->req_duplex == 1U) { val16 = (u16 )((unsigned int )val16 | 256U); } else { } bnx2x_cl45_write(bp, phy, 3, 65504, (int )val16); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]set SGMII force speed %d\n", "bnx2x_warpcore_set_sgmii_speed", 4242, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy->req_line_speed); } else { } bnx2x_cl45_read(bp, phy, 3, 65504, & val16); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)] (readback) %x\n", "bnx2x_warpcore_set_sgmii_speed", 4245, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val16); } else { } } bnx2x_cl45_read(bp, phy, 3, 33536, & digctrl_kx1); if ((unsigned int )fiber_mode != 0U) { digctrl_kx1 = 1U; } else { digctrl_kx1 = (unsigned int )digctrl_kx1 & 65354U; } bnx2x_cl45_write(bp, phy, 3, 33536, (int )digctrl_kx1); bnx2x_cl45_read(bp, phy, 3, 33537, & digctrl_kx2); bnx2x_cl45_write(bp, phy, 3, 33537, (int )digctrl_kx2 & 65531); bnx2x_cl45_write(bp, phy, 3, 33537, (int )((unsigned int )digctrl_kx2 | 4U)); bnx2x_cl45_write(bp, phy, 3, 33536, (int )((unsigned int )digctrl_kx1 | 16U)); return; } } static void bnx2x_warpcore_reset_lane(struct bnx2x *bp , struct bnx2x_phy *phy , u8 reset ) { u16 val ; { bnx2x_cl45_read(bp, phy, 3, 33605, & val); if ((unsigned int )reset != 0U) { val = (u16 )((unsigned int )val | 49152U); } else { val = (unsigned int )val & 16383U; } bnx2x_cl45_write(bp, phy, 3, 33605, (int )val); bnx2x_cl45_read(bp, phy, 3, 33605, & val); return; } } static void bnx2x_warpcore_clear_regs(struct bnx2x_phy *phy , struct link_params *params , u16 lane ) { struct bnx2x *bp ; u16 i ; struct bnx2x_reg_set wc_regs[11U] ; u8 tmp ; { bp = params->bp; wc_regs[0].devad = 7U; wc_regs[0].reg = 0U; wc_regs[0].val = 0U; wc_regs[1].devad = 3U; wc_regs[1].reg = 33792U; wc_regs[1].val = 330U; wc_regs[2].devad = 3U; wc_regs[2].reg = 33794U; wc_regs[2].val = 2048U; wc_regs[3].devad = 3U; wc_regs[3].reg = 33596U; wc_regs[3].val = 32776U; wc_regs[4].devad = 3U; wc_regs[4].reg = 33536U; wc_regs[4].val = 405U; wc_regs[5].devad = 3U; wc_regs[5].reg = 33537U; wc_regs[5].val = 7U; wc_regs[6].devad = 3U; wc_regs[6].reg = 33538U; wc_regs[6].val = 2U; wc_regs[7].devad = 3U; wc_regs[7].reg = 33544U; wc_regs[7].val = 24576U; wc_regs[8].devad = 3U; wc_regs[8].reg = 33506U; wc_regs[8].val = 0U; wc_regs[9].devad = 3U; wc_regs[9].reg = 0U; wc_regs[9].val = 8256U; wc_regs[10].devad = 3U; wc_regs[10].reg = 65504U; wc_regs[10].val = 320U; bnx2x_cl45_read_or_write(bp, phy, 3, 33728, 24576); i = 0U; goto ldv_52565; ldv_52564: bnx2x_cl45_write(bp, phy, (int )wc_regs[(int )i].devad, (int )wc_regs[(int )i].reg, (int )wc_regs[(int )i].val); i = (u16 )((int )i + 1); ldv_52565: ; if ((unsigned int )i <= 10U) { goto ldv_52564; } else { } tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; bnx2x_cl45_write(bp, phy, 3, (int )((unsigned int )lane * 16U + 32871U), 2448); return; } } static int bnx2x_get_mod_abs_int_cfg(struct bnx2x *bp , u32 chip_id , u32 shmem_base , u8 port , u8 *gpio_num , u8 *gpio_port ) { u32 cfg_pin ; unsigned int tmp ; long tmp___0 ; { *gpio_num = 0U; *gpio_port = 0U; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { tmp = readl((void const volatile *)(bp->regview + (((unsigned long )shmem_base + (unsigned long )port * 400UL) + 112UL))); cfg_pin = (tmp & 16711680U) >> 16; if (cfg_pin == 0U || cfg_pin > 8U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]No cfg pin %x for module detect indication\n", "bnx2x_get_mod_abs_int_cfg", 4357, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cfg_pin); } else { } return (-22); } else { } *gpio_num = ((unsigned int )((u8 )cfg_pin) - 1U) & 3U; *gpio_port = (u8 )((cfg_pin - 1U) >> 2); } else { *gpio_num = 3U; *gpio_port = port; } return (0); } } static int bnx2x_is_sfp_module_plugged(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u8 gpio_num ; u8 gpio_port ; u32 gpio_val ; int tmp ; int tmp___0 ; { bp = params->bp; tmp = bnx2x_get_mod_abs_int_cfg(bp, params->chip_id, params->shmem_base, (int )params->port, & gpio_num, & gpio_port); if (tmp != 0) { return (0); } else { } tmp___0 = bnx2x_get_gpio(bp, (int )gpio_num, (int )gpio_port); gpio_val = (u32 )tmp___0; if (gpio_val == 0U) { return (1); } else { return (0); } } } static int bnx2x_warpcore_get_sigdet(struct bnx2x_phy *phy , struct link_params *params ) { u16 gp2_status_reg0 ; u16 lane ; struct bnx2x *bp ; u8 tmp ; { bp = params->bp; tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; bnx2x_cl45_read(bp, phy, 3, 33232, & gp2_status_reg0); return (((int )gp2_status_reg0 >> ((int )lane + 8)) & 1); } } static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u32 serdes_net_if ; u16 gp_status1 ; u16 lnkup ; u16 lnkup_kr ; u16 lane ; u8 tmp ; unsigned int tmp___0 ; long tmp___1 ; { bp = params->bp; gp_status1 = 0U; lnkup = 0U; lnkup_kr = 0U; vars->turn_to_run_wc_rt = (unsigned int )vars->turn_to_run_wc_rt == 0U; if ((unsigned int )vars->turn_to_run_wc_rt == 0U) { return; } else { } if ((unsigned int )vars->rx_tx_asic_rst != 0U) { tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; tmp___0 = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem_base + ((unsigned long )params->port + 1UL) * 400UL))); serdes_net_if = tmp___0 & 251658240U; switch (serdes_net_if) { case 50331648U: bnx2x_cl45_read(bp, phy, 3, 33233, & gp_status1); lnkup = (unsigned int )((u16 )((int )gp_status1 >> ((int )lane + 8))) & 1U; lnkup_kr = (unsigned int )((u16 )((int )gp_status1 >> ((int )lane + 12))) & 1U; if ((unsigned int )lnkup_kr != 0U || (unsigned int )lnkup != 0U) { vars->rx_tx_asic_rst = 0U; } else { bnx2x_warpcore_reset_lane(bp, phy, 1); bnx2x_warpcore_reset_lane(bp, phy, 0); bnx2x_cl45_write(bp, phy, 7, 0, 4608); vars->rx_tx_asic_rst = (u8 )((int )vars->rx_tx_asic_rst - 1); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]0x%x retry left\n", "bnx2x_warpcore_config_runtime", 4445, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->rx_tx_asic_rst); } else { } } goto ldv_52605; default: ; goto ldv_52605; } ldv_52605: ; } else { } return; } } static void bnx2x_warpcore_config_sfi(struct bnx2x_phy *phy , struct link_params *params ) { u16 lane ; u8 tmp ; struct bnx2x *bp ; long tmp___0 ; long tmp___1 ; { tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; bp = params->bp; bnx2x_warpcore_clear_regs(phy, params, (int )lane); if ((unsigned int )params->req_line_speed[0] == 10000U && phy->media_type != 5U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 10G SFI\n", "bnx2x_warpcore_config_sfi", 4465, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_warpcore_set_10G_XFI(phy, params, 0); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 1G Fiber\n", "bnx2x_warpcore_config_sfi", 4468, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_warpcore_set_sgmii_speed(phy, params, 1, 0); } return; } } static void bnx2x_sfp_e3_set_transmitter(struct link_params *params , struct bnx2x_phy *phy , u8 tx_en ) { struct bnx2x *bp ; u32 cfg_pin ; u8 port ; unsigned int tmp ; long tmp___0 ; { bp = params->bp; port = params->port; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 400UL) + 112UL))); cfg_pin = tmp & 255U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting WC TX to %d\n", "bnx2x_sfp_e3_set_transmitter", 4486, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tx_en); } else { } bnx2x_set_cfg_pin(bp, cfg_pin, (unsigned int )tx_en ^ 1U); if ((phy->speed_cap_mask & 8388608U) != 0U) { bnx2x_set_cfg_pin(bp, cfg_pin + 3U, (unsigned int )tx_en ^ 1U); } else { } return; } } static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u32 serdes_net_if ; u8 fiber_mode ; u16 lane ; u8 tmp ; unsigned int tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; int tmp___7 ; long tmp___8 ; long tmp___9 ; long tmp___10 ; long tmp___11 ; long tmp___12 ; { bp = params->bp; tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; tmp___0 = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem_base + ((unsigned long )params->port + 1UL) * 400UL))); serdes_net_if = tmp___0 & 251658240U; tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Begin Warpcore init, link_speed %d, serdes_net_if = 0x%x\n", "bnx2x_warpcore_config_init", 4508, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed, serdes_net_if); } else { } bnx2x_set_aer_mmd(params, phy); bnx2x_warpcore_reset_lane(bp, phy, 1); vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 1U); if (serdes_net_if == 0U || ((unsigned int )phy->req_line_speed != 0U && ((unsigned int )phy->req_line_speed == 100U || (unsigned int )phy->req_line_speed == 10U))) { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 2U); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting SGMII mode\n", "bnx2x_warpcore_config_init", 4517, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_warpcore_clear_regs(phy, params, (int )lane); bnx2x_warpcore_set_sgmii_speed(phy, params, 0, 1); } else { switch (serdes_net_if) { case 50331648U: ; if ((unsigned int )params->loopback_mode != 5U) { bnx2x_warpcore_enable_AN_KR(phy, params, vars); } else { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting KR 10G-Force\n", "bnx2x_warpcore_config_init", 4527, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_warpcore_set_10G_KR(phy, params, vars); } goto ldv_52634; case 16777216U: bnx2x_warpcore_clear_regs(phy, params, (int )lane); if ((unsigned int )vars->line_speed == 10000U) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 10G XFI\n", "bnx2x_warpcore_config_init", 4535, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_warpcore_set_10G_XFI(phy, params, 1); } else { if ((unsigned int )params->num_phys == 1U) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]1G Fiber\n", "bnx2x_warpcore_config_init", 4539, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } fiber_mode = 1U; } else { tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]10/100/1G SGMII\n", "bnx2x_warpcore_config_init", 4542, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } fiber_mode = 0U; } bnx2x_warpcore_set_sgmii_speed(phy, params, (int )fiber_mode, 0); } goto ldv_52634; case 33554432U: ; if ((unsigned int )params->loopback_mode == 0U || (unsigned int )params->loopback_mode == 5U) { tmp___7 = bnx2x_is_sfp_module_plugged(phy, params); if (tmp___7 != 0) { bnx2x_sfp_module_detection(phy, params); } else { bnx2x_sfp_e3_set_transmitter(params, phy, 1); } } else { } bnx2x_warpcore_config_sfi(phy, params); goto ldv_52634; case 67108864U: ; if ((unsigned int )vars->line_speed != 20000U) { tmp___8 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Speed not supported yet\n", "bnx2x_warpcore_config_init", 4572, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } tmp___9 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 20G DXGXS\n", "bnx2x_warpcore_config_init", 4575, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_warpcore_set_20G_DXGXS(bp, phy, (int )lane); bnx2x_sfp_module_detection(phy, params); goto ldv_52634; case 83886080U: ; if ((unsigned int )params->loopback_mode == 0U) { bnx2x_warpcore_enable_AN_KR(phy, params, vars); } else { tmp___10 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___10 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting KR 20G-Force\n", "bnx2x_warpcore_config_init", 4585, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_warpcore_set_20G_force_KR2(phy, params); } goto ldv_52634; default: tmp___11 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unsupported Serdes Net Interface 0x%x\n", "bnx2x_warpcore_config_init", 4592, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", serdes_net_if); } else { } return; } ldv_52634: ; } bnx2x_warpcore_reset_lane(bp, phy, 0); tmp___12 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___12 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Exit config init\n", "bnx2x_warpcore_config_init", 4599, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static void bnx2x_warpcore_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 val16 ; u16 lane ; u8 tmp ; { bp = params->bp; bnx2x_sfp_e3_set_transmitter(params, phy, 0); bnx2x_set_mdio_emac_per_phy(bp, params); bnx2x_set_aer_mmd(params, phy); bnx2x_warpcore_reset_lane(bp, phy, 1); bnx2x_cl45_read_and_write(bp, phy, 3, 65504, 49151); bnx2x_cl45_read_and_write(bp, phy, 3, 0, 65534); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, 0); bnx2x_cl45_read_and_write(bp, phy, 3, 32768, 65519); bnx2x_cl45_read_and_write(bp, phy, 3, 32791, 65280); tmp = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp; bnx2x_cl45_read(bp, phy, 3, 32789, & val16); val16 = (u16 )((int )((short )(17 << (int )lane)) | (int )((short )val16)); if (((int )phy->flags & 16) != 0) { val16 = (u16 )((int )((short )(34 << (int )lane)) | (int )((short )val16)); } else { } bnx2x_cl45_write(bp, phy, 3, 32789, (int )val16); bnx2x_cl45_read(bp, phy, 3, 32790, & val16); val16 = (u16 )(~ ((int )((short )(771 << ((int )lane << 1)))) & (int )((short )val16)); val16 = (u16 )((int )((short )(257 << ((int )lane << 1))) | (int )((short )val16)); if (((int )phy->flags & 16) != 0) { val16 = (u16 )(~ ((int )((short )(3084 << ((int )lane << 1)))) & (int )((short )val16)); val16 = (u16 )((int )((short )(1028 << ((int )lane << 1))) | (int )((short )val16)); } else { } bnx2x_cl45_write(bp, phy, 3, 32790, (int )val16); bnx2x_set_aer_mmd(params, phy); return; } } static void bnx2x_set_warpcore_loopback(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 val16 ; u32 lane ; long tmp ; u8 tmp___0 ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting Warpcore loopback type %x, speed %d\n", "bnx2x_set_warpcore_loopback", 4664, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->loopback_mode, (int )phy->req_line_speed); } else { } if ((unsigned int )phy->req_line_speed <= 9999U || (phy->supported & 4194304U) != 0U) { bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, 0); bnx2x_cl45_read_or_write(bp, phy, 3, 32768, 16); tmp___0 = bnx2x_get_warpcore_lane(phy, params); lane = (u32 )tmp___0; bnx2x_cl45_read(bp, phy, 3, 32791, & val16); val16 = (u16 )((int )((short )(1 << (int )lane)) | (int )((short )val16)); if (((int )phy->flags & 16) != 0) { val16 = (u16 )((int )((short )(2 << (int )lane)) | (int )((short )val16)); } else { } bnx2x_cl45_write(bp, phy, 3, 32791, (int )val16); bnx2x_set_aer_mmd(params, phy); } else { bnx2x_cl45_read_or_write(bp, phy, 3, 65504, 16384); bnx2x_cl45_read_or_write(bp, phy, 3, 0, 1); } return; } } static void bnx2x_sync_link(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 link_10g_plus ; long tmp ; long tmp___0 ; { bp = params->bp; if ((vars->link_status & 1073741824U) != 0U) { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 4U); } else { } vars->link_up = (unsigned int )((u8 )vars->link_status) & 1U; if ((unsigned int )vars->link_up != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy link up\n", "bnx2x_sync_link", 4711, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->phy_link_up = 1U; vars->duplex = 1U; switch (vars->link_status & 30U) { case 2U: vars->duplex = 0U; case 4U: vars->line_speed = 10U; goto ldv_52664; case 6U: vars->duplex = 0U; case 8U: ; case 10U: vars->line_speed = 100U; goto ldv_52664; case 12U: vars->duplex = 0U; case 14U: vars->line_speed = 1000U; goto ldv_52664; case 16U: vars->duplex = 0U; case 18U: vars->line_speed = 2500U; goto ldv_52664; case 20U: vars->line_speed = 10000U; goto ldv_52664; case 22U: vars->line_speed = 20000U; goto ldv_52664; default: ; goto ldv_52664; } ldv_52664: vars->flow_ctrl = 0U; if ((vars->link_status & 65536U) != 0U) { vars->flow_ctrl = (u16 )((unsigned int )vars->flow_ctrl | 256U); } else { } if ((vars->link_status & 131072U) != 0U) { vars->flow_ctrl = (u16 )((unsigned int )vars->flow_ctrl | 512U); } else { } if ((unsigned int )vars->flow_ctrl == 0U) { vars->flow_ctrl = 1024U; } else { } if ((unsigned int )vars->line_speed != 0U && ((unsigned int )vars->line_speed == 10U || (unsigned int )vars->line_speed == 100U)) { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 2U); } else { vars->phy_flags = (unsigned int )vars->phy_flags & 253U; } if (((unsigned int )vars->line_speed != 0U && (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U)) && (unsigned int )vars->line_speed == 1000U) { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 2U); } else { } link_10g_plus = (unsigned int )vars->line_speed > 9999U; if ((unsigned int )link_10g_plus != 0U) { if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { vars->mac_type = 4U; } else { vars->mac_type = 2U; } } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { vars->mac_type = 3U; } else { vars->mac_type = 1U; } } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy link down\n", "bnx2x_sync_link", 4791, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->phy_link_up = 0U; vars->line_speed = 0U; vars->duplex = 1U; vars->flow_ctrl = 1024U; vars->mac_type = 0U; if ((vars->link_status & 1073741824U) != 0U) { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 8U); } else { } if ((int )vars->link_status < 0) { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 32U); } else { } } return; } } void bnx2x_link_status_update(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 port ; u32 sync_offset ; u32 media_types ; u8 tmp ; long tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; long tmp___3 ; { bp = params->bp; port = params->port; set_phy_vars(params, vars); vars->link_status = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 16UL) + 1636UL))); if ((unsigned int )params->loopback_mode != 0U && (unsigned int )params->loopback_mode != 5U) { vars->link_status = vars->link_status | 1U; } else { } tmp = bnx2x_eee_has_cap(params); if ((unsigned int )tmp != 0U) { vars->eee_status = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem2_base + ((unsigned long )params->port + 76UL) * 4UL))); } else { } vars->phy_flags = 1U; bnx2x_sync_link(params, vars); sync_offset = (params->shmem_base + (u32 )port * 400U) + 156U; media_types = readl((void const volatile *)bp->regview + (unsigned long )sync_offset); params->phy[0].media_type = media_types & 255U; params->phy[1].media_type = (media_types & 65280U) >> 8; params->phy[2].media_type = (media_types & 16711680U) >> 16; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]media_types = 0x%x\n", "bnx2x_link_status_update", 4848, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", media_types); } else { } sync_offset = (params->shmem_base + (u32 )port * 400U) + 152U; vars->aeu_int_mask = readl((void const volatile *)bp->regview + (unsigned long )sync_offset); if ((vars->link_status & 536870912U) != 0U) { params->feature_config_flags = params->feature_config_flags | 2U; } else { params->feature_config_flags = params->feature_config_flags & 4294967293U; } if (bp->common.shmem2_base != 0U) { tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___1 > 340U) { params->link_attr_sync = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )params->port + 85UL) * 4UL))); } else { } } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]link_status 0x%x phy_link_up %x int_mask 0x%x\n", "bnx2x_link_status_update", 4870, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vars->link_status, (int )vars->phy_link_up, vars->aeu_int_mask); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]line_speed %x duplex %x flow_ctrl 0x%x\n", "bnx2x_link_status_update", 4872, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed, (int )vars->duplex, (int )vars->flow_ctrl); } else { } return; } } static void bnx2x_set_master_ln(struct link_params *params , struct bnx2x_phy *phy ) { struct bnx2x *bp ; u16 new_master_ln ; u16 ser_lane ; { bp = params->bp; ser_lane = (u16 )((params->lane_config & 49152U) >> 14); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33029, & new_master_ln); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33029, (int )new_master_ln | (int )ser_lane); return; } } static int bnx2x_reset_unicore(struct link_params *params , struct bnx2x_phy *phy , u8 set_serdes ) { struct bnx2x *bp ; u16 mii_control ; u16 i ; long tmp ; { bp = params->bp; bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 65504, & mii_control); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65504, (int )((unsigned int )mii_control | 32768U)); if ((unsigned int )set_serdes != 0U) { bnx2x_set_serdes_access(bp, (int )params->port); } else { } i = 0U; goto ldv_52700; ldv_52699: __const_udelay(21475UL); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 65504, & mii_control); if ((int )((short )mii_control) >= 0) { __const_udelay(21475UL); return (0); } else { } i = (u16 )((int )i + 1); ldv_52700: ; if ((unsigned int )i <= 999U) { goto ldv_52699; } else { } netdev_err((struct net_device const *)bp->dev, "Warning: PHY was not initialized, Port %d\n", (int )params->port); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]BUG! XGXS is still in reset!\n", "bnx2x_reset_unicore", 4935, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } } static void bnx2x_set_swap_lanes(struct link_params *params , struct bnx2x_phy *phy ) { struct bnx2x *bp ; u16 rx_lane_swap ; u16 tx_lane_swap ; { bp = params->bp; rx_lane_swap = (u16 )((params->lane_config & 65280U) >> 8); tx_lane_swap = (unsigned int )((u16 )params->lane_config) & 255U; if ((unsigned int )rx_lane_swap != 27U) { bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33024, (int )((unsigned int )rx_lane_swap | 49152U)); } else { bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33024, 0); } if ((unsigned int )tx_lane_swap != 27U) { bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33025, (int )((unsigned int )tx_lane_swap | 32768U)); } else { bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33025, 0); } return; } } static void bnx2x_set_parallel_detection(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 control2 ; long tmp ; long tmp___0 ; { bp = params->bp; bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33537, & control2); if ((phy->speed_cap_mask & 1048576U) != 0U) { control2 = (u16 )((unsigned int )control2 | 1U); } else { control2 = (unsigned int )control2 & 65534U; } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy->speed_cap_mask = 0x%x, control2 = 0x%x\n", "bnx2x_set_parallel_detection", 4996, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", phy->speed_cap_mask, (int )control2); } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33537, (int )control2); if (phy->type == 0U && (phy->speed_cap_mask & 4194304U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]XGXS\n", "bnx2x_set_parallel_detection", 5005, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33075, 5858); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33073, & control2); control2 = (u16 )((unsigned int )control2 | 1U); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33073, (int )control2); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33028, 17); } else { } return; } } static void bnx2x_set_autoneg(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars , u8 enable_cl73 ) { struct bnx2x *bp ; u16 reg_val ; { bp = params->bp; bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 65504, & reg_val); if ((unsigned int )vars->line_speed == 0U) { reg_val = (u16 )((unsigned int )reg_val | 4096U); } else { reg_val = (unsigned int )reg_val & 60927U; } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65504, (int )reg_val); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33536, & reg_val); reg_val = (unsigned int )reg_val & 65523U; reg_val = (u16 )((unsigned int )reg_val | 1U); if ((unsigned int )vars->line_speed == 0U) { reg_val = (u16 )((unsigned int )reg_val | 16U); } else { reg_val = (unsigned int )reg_val & 65519U; } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33536, (int )reg_val); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33616, & reg_val); if ((unsigned int )vars->line_speed == 0U) { reg_val = (u16 )((unsigned int )reg_val | 3U); } else { reg_val = (unsigned int )reg_val & 65532U; } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33616, (int )reg_val); if ((unsigned int )enable_cl73 != 0U) { bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33648, 14); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33650, 57344); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 17, & reg_val); if ((phy->speed_cap_mask & 4194304U) != 0U) { reg_val = (u16 )((unsigned int )reg_val | 64U); } else { } if ((phy->speed_cap_mask & 1048576U) != 0U) { reg_val = (u16 )((unsigned int )reg_val | 32U); } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 17, (int )reg_val); reg_val = 4096U; } else { reg_val = 0U; } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 0, (int )reg_val); return; } } static void bnx2x_program_serdes(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 reg_val ; long tmp ; { bp = params->bp; bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 65504, & reg_val); reg_val = (unsigned int )reg_val & 52927U; if ((unsigned int )phy->req_duplex == 1U) { reg_val = (u16 )((unsigned int )reg_val | 256U); } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65504, (int )reg_val); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33544, & reg_val); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]MDIO_REG_BANK_SERDES_DIGITAL = 0x%x\n", "bnx2x_program_serdes", 5166, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )reg_val); } else { } reg_val = (unsigned int )reg_val & 65504U; if (((unsigned int )vars->line_speed != 1000U && (unsigned int )vars->line_speed != 100U) && (unsigned int )vars->line_speed != 10U) { reg_val = (u16 )((unsigned int )reg_val | 24592U); if ((unsigned int )vars->line_speed == 10000U) { reg_val = (u16 )((unsigned int )reg_val | 4U); } else { } } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33544, (int )reg_val); return; } } static void bnx2x_set_brcm_cl37_advertisement(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 val ; { bp = params->bp; val = 0U; if ((phy->speed_cap_mask & 2097152U) != 0U) { val = (u16 )((unsigned int )val | 1U); } else { } if ((phy->speed_cap_mask & 4194304U) != 0U) { val = (u16 )((unsigned int )val | 16U); } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33577, (int )val); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33579, 1024); return; } } static void bnx2x_set_ieee_aneg_advertisement(struct bnx2x_phy *phy , struct link_params *params , u16 ieee_fc ) { struct bnx2x *bp ; u16 val ; { bp = params->bp; bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65508, (int )ieee_fc); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 16, & val); val = (unsigned int )val & 62463U; val = (u16 )(((int )((short )((int )ieee_fc << 3)) & 3072) | (int )((short )val)); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 16, (int )val); return; } } static void bnx2x_restart_autoneg(struct bnx2x_phy *phy , struct link_params *params , u8 enable_cl73 ) { struct bnx2x *bp ; u16 mii_control ; long tmp ; long tmp___0 ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_restart_autoneg\n", "bnx2x_restart_autoneg", 5236, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((unsigned int )enable_cl73 != 0U) { bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 0, & mii_control); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 0, (int )((unsigned int )mii_control | 4608U)); } else { bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 65504, & mii_control); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_restart_autoneg mii_control before = 0x%x\n", "bnx2x_restart_autoneg", 5259, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )mii_control); } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65504, (int )((unsigned int )mii_control | 4608U)); } return; } } static void bnx2x_initialize_sgmii_process(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 control1 ; u16 mii_control ; long tmp ; { bp = params->bp; bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33536, & control1); control1 = (u16 )((unsigned int )control1 | 8U); control1 = (unsigned int )control1 & 65486U; bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 33536, (int )control1); if ((unsigned int )vars->line_speed != 0U) { bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 65504, & mii_control); mii_control = (unsigned int )mii_control & 52927U; switch ((int )vars->line_speed) { case 100: mii_control = (u16 )((unsigned int )mii_control | 8192U); goto ldv_52763; case 1000: mii_control = (u16 )((unsigned int )mii_control | 64U); goto ldv_52763; case 10: ; goto ldv_52763; default: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid line_speed 0x%x\n", "bnx2x_initialize_sgmii_process", 5320, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed); } else { } goto ldv_52763; } ldv_52763: ; if ((unsigned int )phy->req_duplex == 1U) { mii_control = (u16 )((unsigned int )mii_control | 256U); } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65504, (int )mii_control); } else { bnx2x_restart_autoneg(phy, params, 0); } return; } } static int bnx2x_direct_parallel_detect_used(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 pd_10g ; u16 status2_1000x ; long tmp ; long tmp___0 ; { bp = params->bp; if ((unsigned int )phy->req_line_speed != 0U) { return (0); } else { } bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33541, & status2_1000x); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33541, & status2_1000x); if (((int )status2_1000x & 2) != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]1G parallel detect link on port %d\n", "bnx2x_direct_parallel_detect_used", 5358, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } return (1); } else { } bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33072, & pd_10g); if ((int )((short )pd_10g) < 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]10G parallel detect link on port %d\n", "bnx2x_direct_parallel_detect_used", 5369, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } return (1); } else { } return (0); } } static void bnx2x_update_adv_fc(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars , u32 gp_status ) { u16 ld_pause ; u16 lp_pause ; u16 pause_result ; struct bnx2x *bp ; long tmp ; long tmp___0 ; { bp = params->bp; if ((gp_status & 17U) == 17U) { bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 16, & ld_pause); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 19, & lp_pause); pause_result = (u16 )(((int )ld_pause & 3072) >> 8); pause_result = (u16 )((int )((short )(((int )lp_pause & 3072) >> 10)) | (int )((short )pause_result)); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]pause_result CL73 0x%x\n", "bnx2x_update_adv_fc", 5402, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pause_result); } else { } } else { bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 65508, & ld_pause); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 65509, & lp_pause); pause_result = (u16 )(((int )ld_pause & 384) >> 5); pause_result = (u16 )((int )((short )(((int )lp_pause & 384) >> 7)) | (int )((short )pause_result)); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pause_result CL37 0x%x\n", "bnx2x_update_adv_fc", 5416, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pause_result); } else { } } bnx2x_pause_resolve(phy, params, vars, (u32 )pause_result); return; } } static void bnx2x_flow_ctrl_resolve(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars , u32 gp_status ) { struct bnx2x *bp ; int tmp ; long tmp___0 ; { bp = params->bp; vars->flow_ctrl = 1024U; if ((unsigned int )phy->req_flow_ctrl != 0U) { if ((unsigned int )phy->req_line_speed == 0U) { bnx2x_update_adv_fc(phy, params, vars, gp_status); } else { } vars->flow_ctrl = phy->req_flow_ctrl; } else if ((unsigned int )phy->req_line_speed != 0U) { vars->flow_ctrl = params->req_fc_auto_adv; } else if ((gp_status & 3U) != 0U && ((int )vars->phy_flags & 2) == 0) { tmp = bnx2x_direct_parallel_detect_used(phy, params); if (tmp != 0) { vars->flow_ctrl = params->req_fc_auto_adv; return; } else { } bnx2x_update_adv_fc(phy, params, vars, gp_status); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]flow_ctrl 0x%x\n", "bnx2x_flow_ctrl_resolve", 5447, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->flow_ctrl); } else { } return; } } static void bnx2x_check_fallback_to_cl37(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 rx_status ; u16 ustat_val ; u16 cl37_fsm_received ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_check_fallback_to_cl37\n", "bnx2x_check_fallback_to_cl37", 5455, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 32944, & rx_status); if ((int )((short )rx_status) >= 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Signal is not detected. Restoring CL73.rx_status(0x80b0) = 0x%x\n", "bnx2x_check_fallback_to_cl37", 5464, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )rx_status); } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 0, 4096); return; } else { } bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33649, & ustat_val); if (((int )ustat_val & 1280) != 1280) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]CL73 state-machine is not stable. ustat_val(0x8371) = 0x%x\n", "bnx2x_check_fallback_to_cl37", 5482, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ustat_val); } else { } return; } else { } bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33584, & cl37_fsm_received); if (((int )cl37_fsm_received & 1552) != 1552) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]No CL37 FSM were received. misc_rx_status(0x8330) = 0x%x\n", "bnx2x_check_fallback_to_cl37", 5499, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cl37_fsm_received); } else { } return; } else { } bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 0, 0); bnx2x_restart_autoneg(phy, params, 0); tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Disabling CL73, and restarting CL37 autoneg\n", "bnx2x_check_fallback_to_cl37", 5515, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static void bnx2x_xgxs_an_resolve(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars , u32 gp_status ) { int tmp ; { if ((gp_status & 3U) != 0U) { vars->link_status = vars->link_status | 64U; } else { } tmp = bnx2x_direct_parallel_detect_used(phy, params); if (tmp != 0) { vars->link_status = vars->link_status | 128U; } else { } return; } } static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars , u16 is_link_up , u16 speed_mask , u16 is_duplex ) { struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { bp = params->bp; if ((unsigned int )phy->req_line_speed == 0U) { vars->link_status = vars->link_status | 32U; } else { } if ((unsigned int )is_link_up != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy link up\n", "bnx2x_get_link_speed_duplex", 5542, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->phy_link_up = 1U; vars->link_status = vars->link_status | 1U; switch ((int )speed_mask) { case 0: vars->line_speed = 10U; if ((unsigned int )is_duplex == 1U) { vars->link_status = vars->link_status | 4U; } else { vars->link_status = vars->link_status | 2U; } goto ldv_52821; case 256: vars->line_speed = 100U; if ((unsigned int )is_duplex == 1U) { vars->link_status = vars->link_status | 10U; } else { vars->link_status = vars->link_status | 6U; } goto ldv_52821; case 512: ; case 3328: vars->line_speed = 1000U; if ((unsigned int )is_duplex == 1U) { vars->link_status = vars->link_status | 14U; } else { vars->link_status = vars->link_status | 12U; } goto ldv_52821; case 768: vars->line_speed = 2500U; if ((unsigned int )is_duplex == 1U) { vars->link_status = vars->link_status | 18U; } else { vars->link_status = vars->link_status | 16U; } goto ldv_52821; case 1024: ; case 1280: tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]link speed unsupported gp_status 0x%x\n", "bnx2x_get_link_speed_duplex", 5585, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )speed_mask); } else { } return (-22); case 3584: ; case 1536: ; case 1792: ; case 3840: ; case 7936: ; case 6912: vars->line_speed = 10000U; vars->link_status = vars->link_status | 20U; goto ldv_52821; case 7680: ; case 14592: vars->line_speed = 20000U; vars->link_status = vars->link_status | 22U; goto ldv_52821; default: tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]link speed unsupported gp_status 0x%x\n", "bnx2x_get_link_speed_duplex", 5605, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )speed_mask); } else { } return (-22); } ldv_52821: ; } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy link down\n", "bnx2x_get_link_speed_duplex", 5609, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->phy_link_up = 0U; vars->duplex = 1U; vars->flow_ctrl = 1024U; vars->mac_type = 0U; } tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)] phy_link_up %x line_speed %d\n", "bnx2x_get_link_speed_duplex", 5618, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->phy_link_up, (int )vars->line_speed); } else { } return (0); } } static int bnx2x_link_settings_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 gp_status ; u16 duplex ; u16 link_up ; u16 speed_mask ; int rc ; long tmp ; u16 val ; long tmp___0 ; { bp = params->bp; duplex = 0U; link_up = 0U; rc = 0; bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33067, & gp_status); if (((int )gp_status & 8) != 0) { duplex = 1U; } else { } if (((int )gp_status & 4) != 0) { link_up = 1U; } else { } speed_mask = (unsigned int )gp_status & 16128U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]gp_status 0x%x, is_link_up %d, speed_mask 0x%x\n", "bnx2x_link_settings_status", 5642, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )gp_status, (int )link_up, (int )speed_mask); } else { } rc = bnx2x_get_link_speed_duplex(phy, params, vars, (int )link_up, (int )speed_mask, (int )duplex); if (rc == -22) { return (rc); } else { } if (((int )gp_status & 4) != 0) { if ((unsigned int )params->num_phys == 1U) { vars->duplex = duplex; bnx2x_flow_ctrl_resolve(phy, params, vars, (u32 )gp_status); if ((unsigned int )phy->req_line_speed == 0U) { bnx2x_xgxs_an_resolve(phy, params, vars, (u32 )gp_status); } else { } } else { } } else if ((unsigned int )phy->req_line_speed == 0U && (unsigned int )params->num_phys == 1U) { bnx2x_check_fallback_to_cl37(phy, params); } else { } if ((unsigned int )params->num_phys == 1U && (vars->link_status & 64U) != 0U) { bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 20, & val); if (((int )val & 32) != 0) { vars->link_status = vars->link_status | 512U; } else { } if (((int )val & 192) != 0) { vars->link_status = vars->link_status | 8388608U; } else { } bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33580, & val); if ((int )val & 1) { vars->link_status = vars->link_status | 2097152U; } else { } if (((int )val & 24) != 0) { vars->link_status = vars->link_status | 8388608U; } else { } } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]duplex %x flow_ctrl 0x%x link_status 0x%x\n", "bnx2x_link_settings_status", 5692, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->duplex, (int )vars->flow_ctrl, vars->link_status); } else { } return (rc); } } static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 lane ; u16 gp_status1 ; u16 gp_speed ; u16 link_up ; u16 duplex ; int rc ; u16 temp_link_up ; long tmp ; long tmp___0 ; u16 an_link ; u16 pd ; u16 gp_status4 ; u16 val ; long tmp___1 ; long tmp___2 ; { bp = params->bp; duplex = 1U; rc = 0; lane = bnx2x_get_warpcore_lane(phy, params); if ((unsigned int )params->loopback_mode != 0U && ((int )phy->flags & 16) != 0) { bnx2x_cl45_read(bp, phy, 3, 33613, & link_up); bnx2x_cl45_read(bp, phy, 3, 33613, & link_up); link_up = (unsigned int )link_up & 1U; } else if ((unsigned int )phy->req_line_speed > 10000U && (phy->supported & 2097152U) != 0U) { bnx2x_cl45_read(bp, phy, 3, 1, & temp_link_up); bnx2x_cl45_read(bp, phy, 3, 1, & link_up); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]PCS RX link status = 0x%x-->0x%x\n", "bnx2x_warpcore_read_status", 5721, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )temp_link_up, (int )link_up); } else { } link_up = (unsigned int )link_up & 4U; if ((unsigned int )link_up != 0U) { bnx2x_ext_phy_resolve_fc(phy, params, vars); } else { } } else { bnx2x_cl45_read(bp, phy, 3, 33233, & gp_status1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]0x81d1 = 0x%x\n", "bnx2x_warpcore_read_status", 5729, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )gp_status1); } else { } link_up = (u16 )((int )((short )((((int )gp_status1 >> 8) | ((int )gp_status1 >> 12)) | (int )gp_status1)) & (int )((short )(1 << (int )lane))); if ((phy->supported & 4194304U) != 0U) { bnx2x_cl45_read(bp, phy, 7, 1, & an_link); bnx2x_cl45_read(bp, phy, 7, 1, & an_link); link_up = (u16 )(((int )((short )an_link) & 4) | (int )((short )link_up)); } else { } if ((unsigned int )link_up != 0U && (unsigned int )params->num_phys == 1U) { if ((unsigned int )phy->req_line_speed == 0U) { bnx2x_cl45_read(bp, phy, 3, 33236, & gp_status4); if (((int )gp_status4 & (4096 << (int )lane)) != 0) { vars->link_status = vars->link_status | 64U; } else { } bnx2x_cl45_read(bp, phy, 3, 33072, & pd); if ((int )((short )pd) < 0) { vars->link_status = vars->link_status | 128U; } else { } } else { } bnx2x_ext_phy_resolve_fc(phy, params, vars); vars->duplex = duplex; } else { } } if ((vars->link_status & 64U) != 0U && (unsigned int )params->num_phys == 1U) { bnx2x_cl45_read(bp, phy, 7, 20, & val); if (((int )val & 32) != 0) { vars->link_status = vars->link_status | 512U; } else { } if (((int )val & 192) != 0) { vars->link_status = vars->link_status | 8388608U; } else { } bnx2x_cl45_read(bp, phy, 3, 33580, & val); if ((int )val & 1) { vars->link_status = vars->link_status | 2097152U; } else { } if (((int )val & 24) != 0) { vars->link_status = vars->link_status | 8388608U; } else { } } else { } if ((unsigned int )lane <= 1U) { bnx2x_cl45_read(bp, phy, 3, 33234, & gp_speed); } else { bnx2x_cl45_read(bp, phy, 3, 33235, & gp_speed); } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]lane %d gp_speed 0x%x\n", "bnx2x_warpcore_read_status", 5802, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )lane, (int )gp_speed); } else { } if (((int )lane & 1) == 0) { gp_speed = (int )gp_speed << 8U; } else { } gp_speed = (unsigned int )gp_speed & 16128U; link_up = (unsigned int )link_up != 0U; rc = bnx2x_get_link_speed_duplex(phy, params, vars, (int )link_up, (int )gp_speed, (int )duplex); if (((unsigned int )link_up == 0U && phy->media_type == 240U) && ((int )phy->flags & 16) == 0) { vars->rx_tx_asic_rst = 4U; } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]duplex %x flow_ctrl 0x%x link_status 0x%x\n", "bnx2x_warpcore_read_status", 5818, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->duplex, (int )vars->flow_ctrl, vars->link_status); } else { } return (rc); } } static void bnx2x_set_gmii_tx_driver(struct link_params *params ) { struct bnx2x *bp ; struct bnx2x_phy *phy ; u16 lp_up2 ; u16 tx_driver ; u16 bank ; { bp = params->bp; phy = (struct bnx2x_phy *)(& params->phy); bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, 33581, & lp_up2); lp_up2 = (int )((u16 )(((int )lp_up2 & 1920) >> 7)) << 12U; if ((unsigned int )lp_up2 == 0U) { return; } else { } bank = 32864U; goto ldv_52877; ldv_52876: bnx2x_cl45_read(bp, phy, (int )phy->def_md_devad, (int )((unsigned int )bank + 7U), & tx_driver); if ((int )lp_up2 != ((int )tx_driver & 61440)) { tx_driver = (unsigned int )tx_driver & 4095U; tx_driver = (u16 )((int )tx_driver | (int )lp_up2); bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, (int )((unsigned int )bank + 7U), (int )tx_driver); } else { } bank = (unsigned int )bank + 16U; ldv_52877: ; if ((unsigned int )bank <= 32912U) { goto ldv_52876; } else { } return; } } static int bnx2x_emac_program(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 port ; u16 mode ; long tmp ; long tmp___0 ; { bp = params->bp; port = params->port; mode = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]setting link speed & duplex\n", "bnx2x_emac_program", 5867, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_bits_dis(bp, (u32 )(((int )port + 32) * 1024), 46U); switch ((int )vars->line_speed) { case 10: mode = (u16 )((unsigned int )mode | 12U); goto ldv_52888; case 100: mode = (u16 )((unsigned int )mode | 4U); goto ldv_52888; case 1000: mode = (u16 )((unsigned int )mode | 8U); goto ldv_52888; case 2500: mode = (u16 )((unsigned int )mode | 40U); goto ldv_52888; default: tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid line_speed 0x%x\n", "bnx2x_emac_program", 5893, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed); } else { } return (-22); } ldv_52888: ; if ((unsigned int )vars->duplex == 0U) { mode = (u16 )((unsigned int )mode | 2U); } else { } bnx2x_bits_en(bp, (u32 )(((int )port + 32) * 1024), (u32 )mode); bnx2x_set_led(params, vars, 2, (u32 )vars->line_speed); return (0); } } static void bnx2x_set_preemphasis(struct bnx2x_phy *phy , struct link_params *params ) { u16 bank ; u16 i ; struct bnx2x *bp ; { i = 0U; bp = params->bp; bank = 32944U; i = 0U; goto ldv_52901; ldv_52900: bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, (int )((unsigned int )bank + 12U), (int )phy->rx_preemphasis[(int )i]); bank = (unsigned int )bank + 16U; i = (u16 )((int )i + 1); ldv_52901: ; if ((unsigned int )bank <= 32992U) { goto ldv_52900; } else { } bank = 32864U; i = 0U; goto ldv_52904; ldv_52903: bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, (int )((unsigned int )bank + 7U), (int )phy->tx_preemphasis[(int )i]); bank = (unsigned int )bank + 16U; i = (u16 )((int )i + 1); ldv_52904: ; if ((unsigned int )bank <= 32912U) { goto ldv_52903; } else { } return; } } static void bnx2x_xgxs_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 enable_cl73 ; long tmp ; long tmp___0 ; long tmp___1 ; { bp = params->bp; enable_cl73 = (u8 )((unsigned int )params->num_phys == 1U || (unsigned int )params->loopback_mode == 3U); if (((int )vars->phy_flags & 2) == 0) { if ((unsigned int )params->num_phys == 1U && (int )params->feature_config_flags & 1) { bnx2x_set_preemphasis(phy, params); } else { } if ((unsigned int )vars->line_speed != 0U || ((unsigned int )params->num_phys == 1U && (unsigned int )params->loopback_mode == 5U)) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]not SGMII, no AN\n", "bnx2x_xgxs_config_init", 5948, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_set_autoneg(phy, params, vars, 0); bnx2x_program_serdes(phy, params, vars); } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]not SGMII, AN\n", "bnx2x_xgxs_config_init", 5957, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_set_brcm_cl37_advertisement(phy, params); bnx2x_set_ieee_aneg_advertisement(phy, params, (int )vars->ieee_fc); bnx2x_set_autoneg(phy, params, vars, (int )enable_cl73); bnx2x_restart_autoneg(phy, params, (int )enable_cl73); } } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SGMII\n", "bnx2x_xgxs_config_init", 5974, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_initialize_sgmii_process(phy, params, vars); } return; } } static int bnx2x_prepare_xgxs(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { int rc ; { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 1U); if ((((unsigned int )phy->req_line_speed != 0U && ((unsigned int )phy->req_line_speed == 100U || (unsigned int )phy->req_line_speed == 10U)) || (((unsigned int )phy->req_line_speed == 0U && phy->speed_cap_mask > 65535U) && phy->speed_cap_mask <= 1048575U)) || phy->type == 33554432U) { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 2U); } else { vars->phy_flags = (unsigned int )vars->phy_flags & 253U; } bnx2x_calc_ieee_aneg_adv(phy, params, & vars->ieee_fc); bnx2x_set_aer_mmd(params, phy); if (phy->type == 0U) { bnx2x_set_master_ln(params, phy); } else { } rc = bnx2x_reset_unicore(params, phy, 0); if (rc != 0) { return (rc); } else { } bnx2x_set_aer_mmd(params, phy); if (phy->type == 0U) { bnx2x_set_master_ln(params, phy); bnx2x_set_swap_lanes(params, phy); } else { } return (rc); } } static u16 bnx2x_wait_reset_complete(struct bnx2x *bp , struct bnx2x_phy *phy , struct link_params *params ) { u16 cnt ; u16 ctrl ; long tmp ; { cnt = 0U; goto ldv_52929; ldv_52928: ; if (phy->type == 3584U) { bnx2x_cl22_read(bp, phy, 0, & ctrl); } else { bnx2x_cl45_read(bp, phy, 1, 0, & ctrl); } if ((int )((short )ctrl) >= 0) { goto ldv_52927; } else { } usleep_range(1000UL, 2000UL); cnt = (u16 )((int )cnt + 1); ldv_52929: ; if ((unsigned int )cnt <= 999U) { goto ldv_52928; } else { } ldv_52927: ; if ((unsigned int )cnt == 1000U) { netdev_err((struct net_device const *)bp->dev, "Warning: PHY was not initialized, Port %d\n", (int )params->port); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]control reg 0x%x (after %d ms)\n", "bnx2x_wait_reset_complete", 6042, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ctrl, (int )cnt); } else { } return (cnt); } } static void bnx2x_link_int_enable(struct link_params *params ) { u8 port ; u32 mask ; struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; unsigned int tmp___3 ; long tmp___4 ; unsigned int tmp___5 ; unsigned int tmp___6 ; unsigned int tmp___7 ; long tmp___8 ; unsigned int tmp___9 ; unsigned int tmp___10 ; long tmp___11 ; { port = params->port; bp = params->bp; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { mask = 3932160U; if ((unsigned int )params->num_phys != 1U) { mask = mask | 1U; } else { } } else if (params->switch_cfg == 16777216U) { mask = 3964928U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]enabled XGXS interrupt\n", "bnx2x_link_int_enable", 6060, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((unsigned int )params->num_phys != 1U && params->phy[0].type != 64768U) { mask = mask | 1U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]enabled external phy int\n", "bnx2x_link_int_enable", 6065, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { mask = 512U; tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]enabled SerDes interrupt\n", "bnx2x_link_int_enable", 6070, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((unsigned int )params->num_phys != 1U && params->phy[0].type != 4278190080U) { mask = mask | 1U; tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]enabled external phy int\n", "bnx2x_link_int_enable", 6075, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } bnx2x_bits_en(bp, (u32 )(((int )port + 16588) * 4), mask); tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { tmp___3 = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 16586) * 4)); printk("\rbnx2x: [%s:%d(%s)]port %x, is_xgxs %x, int_status 0x%x\n", "bnx2x_link_int_enable", 6084, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port, params->switch_cfg == 16777216U, tmp___3); } else { } tmp___8 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___8 != 0L) { tmp___5 = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 60 + 66936)); tmp___6 = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 24 + 66708)); tmp___7 = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 16588) * 4)); printk("\rbnx2x: [%s:%d(%s)] int_mask 0x%x, MI_INT %x, SERDES_LINK %x\n", "bnx2x_link_int_enable", 6088, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tmp___7, tmp___6, tmp___5); } else { } tmp___11 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___11 != 0L) { tmp___9 = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 104 + 67204)); tmp___10 = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 104 + 67200)); printk("\rbnx2x: [%s:%d(%s)] 10G %x, XGXS_LINK %x\n", "bnx2x_link_int_enable", 6091, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tmp___10, tmp___9); } else { } return; } } static void bnx2x_rearm_latch_signal(struct bnx2x *bp , u8 port , u8 exp_mi_int ) { u32 latch_status ; long tmp ; { latch_status = 0U; latch_status = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 12288) * 8)); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]latch_status = 0x%x\n", "bnx2x_rearm_latch_signal", 6106, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", latch_status); } else { } if ((unsigned int )exp_mi_int != 0U) { bnx2x_bits_en(bp, (u32 )(((int )port + 16586) * 4), 1U); } else { bnx2x_bits_dis(bp, (u32 )(((int )port + 16586) * 4), 1U); } if ((int )latch_status & 1) { writel(latch_status & 65535U, (void volatile *)bp->regview + (unsigned long )(((int )port + 12288) * 8)); } else { } return; } } static void bnx2x_link_int_ack(struct link_params *params , struct link_vars *vars , u8 is_10g_plus ) { struct bnx2x *bp ; u8 port ; u32 mask ; u32 ser_lane ; long tmp ; { bp = params->bp; port = params->port; bnx2x_bits_dis(bp, (u32 )(((int )port + 16586) * 4), 3965440U); if ((unsigned int )vars->phy_link_up != 0U) { if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { mask = 3932160U; } else if ((unsigned int )is_10g_plus != 0U) { mask = 32768U; } else if (params->switch_cfg == 16777216U) { ser_lane = (params->lane_config & 49152U) >> 14; mask = (u32 )((1 << (int )ser_lane) << 18); } else { mask = 512U; } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Ack link up interrupt with mask 0x%x\n", "bnx2x_link_int_ack", 6161, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", mask); } else { } bnx2x_bits_en(bp, (u32 )(((int )port + 16586) * 4), mask); } else { } return; } } static int bnx2x_format_ver(u32 num , u8 *str , u16 *len ) { u8 *str_ptr ; u32 mask ; u8 shift ; u8 digit ; u8 remove_leading_zeros ; { str_ptr = str; mask = 4026531840U; shift = 32U; remove_leading_zeros = 1U; if ((unsigned int )*len <= 9U) { *str_ptr = 0U; *len = (u16 )((int )*len - 1); return (-22); } else { } goto ldv_52965; ldv_52966: shift = (unsigned int )shift + 252U; digit = (u8 )((num & mask) >> (int )shift); if ((unsigned int )digit == 0U && (unsigned int )remove_leading_zeros != 0U) { mask = mask >> 4; goto ldv_52965; } else if ((unsigned int )digit <= 9U) { *str_ptr = (unsigned int )digit + 48U; } else { *str_ptr = (unsigned int )digit + 87U; } remove_leading_zeros = 0U; str_ptr = str_ptr + 1; *len = (u16 )((int )*len - 1); mask = mask >> 4; if ((unsigned int )shift == 16U) { *str_ptr = 46U; str_ptr = str_ptr + 1; *len = (u16 )((int )*len - 1); remove_leading_zeros = 1U; } else { } ldv_52965: ; if ((unsigned int )shift != 0U) { goto ldv_52966; } else { } return (0); } } static int bnx2x_null_format_ver(u32 spirom_ver , u8 *str , u16 *len ) { { *str = 0U; *len = (u16 )((int )*len - 1); return (0); } } int bnx2x_get_ext_phy_fw_version(struct link_params *params , u8 *version___0 , u16 len ) { struct bnx2x *bp ; u32 spirom_ver ; int status ; u8 *ver_p ; u16 remain_len ; u8 tmp ; u8 tmp___0 ; { spirom_ver = 0U; status = 0; ver_p = version___0; remain_len = len; if ((unsigned long )version___0 == (unsigned long )((u8 *)0U) || (unsigned long )params == (unsigned long )((struct link_params *)0)) { return (-22); } else { } bp = params->bp; *version___0 = 0U; spirom_ver = readl((void const volatile *)bp->regview + (unsigned long )params->phy[1].ver_addr); if ((unsigned long )params->phy[1].format_fw_ver != (unsigned long )((u8 (*)(u32 , u8 * , u16 * ))0)) { tmp = (*(params->phy[1].format_fw_ver))(spirom_ver, ver_p, & remain_len); status = (int )tmp | status; ver_p = ver_p + (unsigned long )((int )len - (int )remain_len); } else { } if ((unsigned int )params->num_phys == 3U && params->phy[2].ver_addr != 0U) { spirom_ver = readl((void const volatile *)bp->regview + (unsigned long )params->phy[2].ver_addr); if ((unsigned long )params->phy[2].format_fw_ver != (unsigned long )((u8 (*)(u32 , u8 * , u16 * ))0)) { *ver_p = 47U; ver_p = ver_p + 1; remain_len = (u16 )((int )remain_len - 1); tmp___0 = (*(params->phy[2].format_fw_ver))(spirom_ver, ver_p, & remain_len); status = (int )tmp___0 | status; ver_p = version___0 + (unsigned long )((int )len - (int )remain_len); } else { } } else { } *ver_p = 0U; return (status); } } static void bnx2x_set_xgxs_loopback(struct bnx2x_phy *phy , struct link_params *params ) { u8 port ; struct bnx2x *bp ; u32 md_devad ; long tmp ; u16 mii_ctrl ; long tmp___0 ; { port = params->port; bp = params->bp; if ((unsigned int )phy->req_line_speed != 1000U) { md_devad = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]XGXS 10G loopback enable\n", "bnx2x_set_xgxs_loopback", 6263, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { md_devad = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 24 + 66364)); writel(5U, (void volatile *)bp->regview + (unsigned long )((int )port * 24 + 66364)); } else { } bnx2x_cl45_write(bp, phy, 5, 65502, 10240); bnx2x_cl45_write(bp, phy, 5, 0, 24641); msleep(200U); bnx2x_set_aer_mmd(params, phy); if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { writel(md_devad, (void volatile *)bp->regview + (unsigned long )((int )port * 24 + 66364)); } else { } } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]XGXS 1G loopback enable\n", "bnx2x_set_xgxs_loopback", 6296, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read(bp, phy, 5, 65504, & mii_ctrl); bnx2x_cl45_write(bp, phy, 5, 65504, (int )((unsigned int )mii_ctrl | 16384U)); } return; } } int bnx2x_set_led(struct link_params *params , struct link_vars *vars , u8 mode , u32 speed ) { u8 port ; u16 hw_led_mode ; int rc ; u8 phy_idx ; u32 tmp ; u32 emac_base ; struct bnx2x *bp ; long tmp___0 ; long tmp___1 ; u32 nig_led_mode ; long tmp___2 ; { port = params->port; hw_led_mode = params->hw_led_mode; rc = 0; emac_base = (unsigned int )port != 0U ? 33792U : 32768U; bp = params->bp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_set_led: port %x, mode %d\n", "bnx2x_set_led", 6319, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port, (int )mode); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]speed 0x%x, hw_led_mode 0x%x\n", "bnx2x_set_led", 6321, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", speed, (int )hw_led_mode); } else { } phy_idx = 1U; goto ldv_53007; ldv_53006: ; if ((unsigned long )params->phy[(int )phy_idx].set_link_led != (unsigned long )((void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0)) { (*(params->phy[(int )phy_idx].set_link_led))((struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_idx, params, (int )mode); } else { } phy_idx = (u8 )((int )phy_idx + 1); ldv_53007: ; if ((unsigned int )phy_idx <= 2U) { goto ldv_53006; } else { } switch ((int )mode) { case 3: ; case 0: writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16584) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16572) * 4)); tmp = readl((void const volatile *)bp->regview + (unsigned long )(emac_base + 12U)); if (params->phy[1].type == 3584U) { tmp = tmp & 4294967281U; } else { tmp = tmp | 1U; } writel(tmp, (void volatile *)bp->regview + (unsigned long )(emac_base + 12U)); goto ldv_53011; case 2: ; if ((unsigned int )vars->link_up == 0U) { goto ldv_53011; } else { } case 1: ; if (((params->phy[1].type == 2304U || params->phy[1].type == 3840U) && ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U)) && (unsigned int )params->num_phys == 2U) { if ((unsigned int )mode == 1U || speed == 10000U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16572) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16584) * 4)); tmp = readl((void const volatile *)bp->regview + (unsigned long )(emac_base + 12U)); writel(tmp | 1U, (void volatile *)bp->regview + (unsigned long )(emac_base + 12U)); if ((unsigned int )mode == 1U) { return (rc); } else { } } else { } } else if ((unsigned int )params->num_phys == 1U) { if ((((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) || ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && (unsigned int )mode == 1U)) { writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16584) * 4)); } else { } if (((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U)) || (unsigned int )mode == 1U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16572) * 4)); } else { writel((unsigned int )hw_led_mode, (void volatile *)bp->regview + (unsigned long )(((int )port + 16572) * 4)); } } else if (params->phy[1].type == 3584U && (unsigned int )mode == 1U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16572) * 4)); tmp = readl((void const volatile *)bp->regview + (unsigned long )(emac_base + 12U)); writel(tmp | 3U, (void volatile *)bp->regview + (unsigned long )(emac_base + 12U)); goto ldv_53011; } else { nig_led_mode = (int )params->hw_led_mode << 16 != 983040 ? (u32 )hw_led_mode : 1U; writel(nig_led_mode, (void volatile *)bp->regview + (unsigned long )(((int )port + 16572) * 4)); } writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16574) * 4)); if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { writel(354U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16580) * 4)); } else { writel(480U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16580) * 4)); } writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16582) * 4)); tmp = readl((void const volatile *)bp->regview + (unsigned long )(emac_base + 12U)); writel(tmp & 4294967294U, (void volatile *)bp->regview + (unsigned long )(emac_base + 12U)); if (bp->common.chip_id >> 16 == 5710U && (((speed == 2500U || speed == 1000U) || speed == 100U) || speed == 10U)) { writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16574) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16576) * 4)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16578) * 4)); } else { } goto ldv_53011; default: rc = -22; tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_set_led: Invalid led mode %d\n", "bnx2x_set_led", 6447, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )mode); } else { } goto ldv_53011; } ldv_53011: ; return (rc); } } int bnx2x_test_link(struct link_params *params , struct link_vars *vars , u8 is_serdes ) { struct bnx2x *bp ; u16 gp_status ; u16 phy_index ; u8 ext_phy_link_up ; u8 serdes_phy_type ; struct link_vars temp_vars ; struct bnx2x_phy *int_phy ; u16 link_up ; u8 lane ; u8 tmp ; u8 tmp___0 ; { bp = params->bp; gp_status = 0U; phy_index = 0U; ext_phy_link_up = 0U; int_phy = (struct bnx2x_phy *)(& params->phy); if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { if ((unsigned int )params->req_line_speed[0] > 10000U) { bnx2x_cl45_read(bp, int_phy, 3, 1, & link_up); bnx2x_cl45_read(bp, int_phy, 3, 1, & link_up); link_up = (unsigned int )link_up & 4U; } else { tmp = bnx2x_get_warpcore_lane(int_phy, params); lane = tmp; bnx2x_cl45_read(bp, int_phy, 3, 33233, & gp_status); gp_status = (unsigned int )((u16 )(((int )gp_status >> 8) | ((int )gp_status >> 12))) & 15U; link_up = (u16 )((int )((short )(1 << (int )lane)) & (int )((short )gp_status)); } if ((unsigned int )link_up == 0U) { return (-3); } else { } } else { bnx2x_cl45_read(bp, int_phy, (int )int_phy->def_md_devad, 33067, & gp_status); if (((int )gp_status & 4) == 0) { return (-3); } else { } } if ((unsigned int )params->loopback_mode == 3U) { return (0); } else { } switch ((int )params->num_phys) { case 1: ; return (0); case 2: ext_phy_link_up = (*(params->phy[1].read_status))((struct bnx2x_phy *)(& params->phy) + 1UL, params, & temp_vars); goto ldv_53032; case 3: phy_index = 1U; goto ldv_53036; ldv_53035: serdes_phy_type = (u8 )(((params->phy[(int )phy_index].media_type == 1U || params->phy[(int )phy_index].media_type == 5U) || params->phy[(int )phy_index].media_type == 2U) || params->phy[(int )phy_index].media_type == 3U); if ((int )is_serdes != (int )serdes_phy_type) { goto ldv_53034; } else { } if ((unsigned long )params->phy[(int )phy_index].read_status != (unsigned long )((u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))0)) { tmp___0 = (*(params->phy[(int )phy_index].read_status))((struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index, params, & temp_vars); ext_phy_link_up = (u8 )((int )tmp___0 | (int )ext_phy_link_up); } else { } ldv_53034: phy_index = (u16 )((int )phy_index + 1); ldv_53036: ; if ((int )((unsigned short )params->num_phys) > (int )phy_index) { goto ldv_53035; } else { } goto ldv_53032; } ldv_53032: ; if ((unsigned int )ext_phy_link_up != 0U) { return (0); } else { } return (-3); } } static int bnx2x_link_initialize(struct link_params *params , struct link_vars *vars ) { u8 phy_index ; u8 non_ext_phy ; struct bnx2x *bp ; struct bnx2x_phy *phy ; long tmp ; u32 tmp___0 ; { bp = params->bp; vars->line_speed = params->phy[0].req_line_speed; if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { bnx2x_prepare_xgxs((struct bnx2x_phy *)(& params->phy), params, vars); } else { } non_ext_phy = (u8 )((unsigned int )params->num_phys == 1U || (unsigned int )params->loopback_mode == 3U); if (((unsigned int )non_ext_phy != 0U || ((int )params->phy[1].flags & 8) != 0) || (unsigned int )params->loopback_mode == 4U) { phy = (struct bnx2x_phy *)(& params->phy); if ((unsigned int )vars->line_speed == 0U && ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U))) { bnx2x_set_parallel_detection(phy, params); } else { } if ((unsigned long )params->phy[0].config_init != (unsigned long )((u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))0)) { (*(params->phy[0].config_init))(phy, params, vars); } else { } } else { } vars->line_speed = params->phy[0].req_line_speed; if ((unsigned int )non_ext_phy != 0U) { if ((params->phy[0].supported & 1024U) != 0U) { vars->link_status = vars->link_status | 1048576U; } else { } } else { phy_index = 1U; goto ldv_53049; ldv_53048: ; if ((params->phy[(int )phy_index].supported & 1024U) != 0U) { vars->link_status = vars->link_status | 1048576U; } else { } if ((unsigned int )phy_index == 2U) { tmp___0 = bnx2x_phy_selection(params); if (tmp___0 == 1U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Not initializing second phy\n", "bnx2x_link_initialize", 6598, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } goto ldv_53047; } else { } } else { } (*(params->phy[(int )phy_index].config_init))((struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index, params, vars); ldv_53047: phy_index = (u8 )((int )phy_index + 1); ldv_53049: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_53048; } else { } } bnx2x_bits_dis(bp, (u32 )(((int )params->port + 16586) * 4), 3965441U); return (0); } } static void bnx2x_int_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { { writel((unsigned int )(511 << (int )params->port * 16), (void volatile *)(params->bp)->regview + 42408U); return; } } static void bnx2x_common_ext_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u8 gpio_port ; long tmp ; { bp = params->bp; if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { gpio_port = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; } else { gpio_port = params->port; } bnx2x_set_gpio(bp, 1, 0U, (int )gpio_port); bnx2x_set_gpio(bp, 2, 0U, (int )gpio_port); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]reset external PHY\n", "bnx2x_common_ext_link_reset", 6640, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static int bnx2x_update_link_down(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 port ; long tmp ; { bp = params->bp; port = params->port; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Port %x: Link is down\n", "bnx2x_update_link_down", 6649, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port); } else { } bnx2x_set_led(params, vars, 0, 0U); vars->phy_flags = (unsigned int )vars->phy_flags & 251U; vars->mac_type = 0U; vars->link_status = vars->link_status & 3220242208U; vars->line_speed = 0U; bnx2x_update_mng(params, vars->link_status); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16408) * 4)); if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16399) * 4)); } else { } usleep_range(10000UL, 20000UL); if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U)) { bnx2x_set_bmac_rx(bp, params->chip_id, (int )params->port, 0); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port << 2) + 43084)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port << 2) + 43136)); vars->eee_status = vars->eee_status & 2969567231U; bnx2x_update_mng_eee(params, vars->eee_status); bnx2x_set_xmac_rxtx(params, 0); bnx2x_set_umac_rxtx(params, 0); } else { } return (0); } } static int bnx2x_update_link_up(struct link_params *params , struct link_vars *vars , u8 link_10g ) { struct bnx2x *bp ; u8 phy_idx ; u8 port ; int rc ; long tmp ; int tmp___0 ; long tmp___1 ; long tmp___2 ; int tmp___3 ; int tmp___4 ; { bp = params->bp; port = params->port; rc = 0; vars->link_status = vars->link_status | 1073741825U; vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 4U); if (((int )vars->flow_ctrl & 256) != 0) { vars->link_status = vars->link_status | 65536U; } else { } if (((int )vars->flow_ctrl & 512) != 0) { vars->link_status = vars->link_status | 131072U; } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { if ((unsigned int )link_10g != 0U) { tmp___0 = bnx2x_xmac_enable(params, vars, 0); if (tmp___0 == -3) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Found errors on XMAC\n", "bnx2x_update_link_up", 6713, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->link_up = 0U; vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 8U); vars->link_status = vars->link_status & 4294967294U; } else { } } else { bnx2x_umac_enable(params, vars, 0); } bnx2x_set_led(params, vars, 2, (u32 )vars->line_speed); if ((vars->eee_status & 1073741824U) != 0U && (vars->eee_status & 536870912U) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling LPI assertion\n", "bnx2x_update_link_up", 6725, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )params->port << 2) + 43084)); writel(1U, (void volatile *)bp->regview + 43096U); writel(64544U, (void volatile *)bp->regview + (unsigned long )(((int )params->port << 2) + 43136)); } else { } } else { } if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U)) { if ((unsigned int )link_10g != 0U) { tmp___3 = bnx2x_bmac_enable(params, vars, 0, 1); if (tmp___3 == -3) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Found errors on BMAC\n", "bnx2x_update_link_up", 6738, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vars->link_up = 0U; vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 8U); vars->link_status = vars->link_status & 4294967294U; } else { } bnx2x_set_led(params, vars, 2, 10000U); } else { rc = bnx2x_emac_program(params, vars); bnx2x_emac_enable(params, vars, 0); if (((vars->link_status & 64U) != 0U && ((int )vars->phy_flags & 2) == 0) && (unsigned int )params->num_phys == 1U) { bnx2x_set_gmii_tx_driver(params); } else { } } } else { } if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { tmp___4 = bnx2x_pbf_update(params, (u32 )vars->flow_ctrl, (u32 )vars->line_speed); rc = tmp___4 | rc; } else { } writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16408) * 4)); bnx2x_update_mng(params, vars->link_status); bnx2x_update_mng_eee(params, vars->eee_status); phy_idx = 0U; goto ldv_53081; ldv_53080: ; if (((int )params->phy[(int )phy_idx].flags & 4096) != 0) { bnx2x_check_half_open_conn(params, vars, 0); goto ldv_53079; } else { } phy_idx = (u8 )((int )phy_idx + 1); ldv_53081: ; if ((unsigned int )phy_idx <= 2U) { goto ldv_53080; } else { } ldv_53079: msleep(20U); return (rc); } } static void bnx2x_chng_link_count(struct link_params *params , bool clear ) { struct bnx2x *bp ; u32 addr ; u32 val ; unsigned int tmp ; unsigned int tmp___0 ; { bp = params->bp; if (bp->common.shmem2_base == 0U) { return; } else { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp <= 356U) { return; } else { } } addr = params->shmem2_base + (u32 )((unsigned long )params->port + 89UL) * 4U; if ((int )clear) { val = 0U; } else { tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )addr); val = tmp___0 + 1U; } writel(val, (void volatile *)bp->regview + (unsigned long )addr); return; } } int bnx2x_link_update(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; struct link_vars phy_vars[3U] ; u8 port ; u8 link_10g_plus ; u8 phy_index ; u32 prev_link_status ; u8 ext_phy_link_up ; u8 cur_link_up ; int rc ; u8 is_mi_int ; u16 ext_phy_line_speed ; u16 prev_line_speed ; u8 active_external_phy ; unsigned int tmp ; long tmp___0 ; unsigned int tmp___1 ; unsigned int tmp___2 ; unsigned int tmp___3 ; long tmp___4 ; unsigned int tmp___5 ; unsigned int tmp___6 ; long tmp___7 ; struct bnx2x_phy *phy ; long tmp___8 ; long tmp___9 ; u32 tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; long tmp___14 ; long tmp___15 ; long tmp___16 ; { bp = params->bp; port = params->port; prev_link_status = vars->link_status; ext_phy_link_up = 0U; rc = 0; is_mi_int = 0U; ext_phy_line_speed = 0U; prev_line_speed = vars->line_speed; active_external_phy = 0U; vars->phy_flags = (unsigned int )vars->phy_flags & 247U; vars->link_status = vars->link_status & 3220242208U; phy_index = 0U; goto ldv_53107; ldv_53106: phy_vars[(int )phy_index].flow_ctrl = 0U; phy_vars[(int )phy_index].link_status = 0U; phy_vars[(int )phy_index].line_speed = 0U; phy_vars[(int )phy_index].duplex = 1U; phy_vars[(int )phy_index].phy_link_up = 0U; phy_vars[(int )phy_index].link_up = 0U; phy_vars[(int )phy_index].fault_detected = 0U; phy_vars[(int )phy_index].eee_status = vars->eee_status; phy_index = (u8 )((int )phy_index + 1); ldv_53107: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_53106; } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_set_aer_mmd(params, (struct bnx2x_phy *)(& params->phy)); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { tmp = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 16586) * 4)); printk("\rbnx2x: [%s:%d(%s)]port %x, XGXS?%x, int_status 0x%x\n", "bnx2x_link_update", 6843, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port, (int )vars->phy_flags & 1, tmp); } else { } tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 24 + 66708)); is_mi_int = tmp___1 != 0U; tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { tmp___2 = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 60 + 66936)); tmp___3 = readl((void const volatile *)bp->regview + (unsigned long )(((int )port + 16588) * 4)); printk("\rbnx2x: [%s:%d(%s)]int_mask 0x%x MI_INT %x, SERDES_LINK %x\n", "bnx2x_link_update", 6850, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tmp___3, (int )is_mi_int, tmp___2); } else { } tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { tmp___5 = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 104 + 67204)); tmp___6 = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 104 + 67200)); printk("\rbnx2x: [%s:%d(%s)] 10G %x, XGXS_LINK %x\n", "bnx2x_link_update", 6854, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tmp___6, tmp___5); } else { } if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16399) * 4)); } else { } phy_index = 1U; goto ldv_53118; ldv_53117: phy = (struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index; if ((unsigned long )phy->read_status == (unsigned long )((u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))0)) { goto ldv_53111; } else { } cur_link_up = (*(phy->read_status))(phy, params, (struct link_vars *)(& phy_vars) + (unsigned long )phy_index); if ((unsigned int )cur_link_up != 0U) { tmp___8 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy in index %d link is up\n", "bnx2x_link_update", 6877, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy_index); } else { } } else { tmp___9 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy in index %d link is down\n", "bnx2x_link_update", 6880, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy_index); } else { } goto ldv_53111; } if ((unsigned int )ext_phy_link_up == 0U) { ext_phy_link_up = 1U; active_external_phy = phy_index; } else { tmp___10 = bnx2x_phy_selection(params); switch (tmp___10) { case 0U: ; case 3U: active_external_phy = 1U; goto ldv_53114; case 4U: active_external_phy = 2U; goto ldv_53114; default: tmp___11 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid link indicationmpc=0x%x. DISABLING LINK !!!\n", "bnx2x_link_update", 6914, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", params->multi_phy_config); } else { } ext_phy_link_up = 0U; goto ldv_53114; } ldv_53114: ; } ldv_53111: phy_index = (u8 )((int )phy_index + 1); ldv_53118: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_53117; } else { } prev_line_speed = vars->line_speed; if ((unsigned long )params->phy[0].read_status != (unsigned long )((u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))0)) { (*(params->phy[0].read_status))((struct bnx2x_phy *)(& params->phy), params, vars); } else { } if ((unsigned int )active_external_phy != 0U) { vars->flow_ctrl = phy_vars[(int )active_external_phy].flow_ctrl; vars->link_status = vars->link_status | phy_vars[(int )active_external_phy].link_status; if ((unsigned int )active_external_phy == 1U) { if ((unsigned long )params->phy[2].phy_specific_func != (unsigned long )((void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0)) { tmp___12 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___12 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Disabling TX on EXT_PHY2\n", "bnx2x_link_update", 6951, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } (*(params->phy[2].phy_specific_func))((struct bnx2x_phy *)(& params->phy) + 2UL, params, 1U); } else { } } else { } ext_phy_line_speed = phy_vars[(int )active_external_phy].line_speed; vars->duplex = phy_vars[(int )active_external_phy].duplex; if ((params->phy[(int )active_external_phy].supported & 1024U) != 0U) { vars->link_status = vars->link_status | 1048576U; } else { vars->link_status = vars->link_status & 4293918719U; } vars->eee_status = phy_vars[(int )active_external_phy].eee_status; tmp___13 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___13 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Active external phy selected: %x\n", "bnx2x_link_update", 6969, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )active_external_phy); } else { } } else { } phy_index = 1U; goto ldv_53122; ldv_53121: ; if (((int )params->phy[(int )phy_index].flags & 64) != 0) { bnx2x_rearm_latch_signal(bp, (int )port, (int )phy_index == (int )active_external_phy); goto ldv_53120; } else { } phy_index = (u8 )((int )phy_index + 1); ldv_53122: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_53121; } else { } ldv_53120: tmp___14 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___14 != 0L) { printk("\rbnx2x: [%s:%d(%s)]vars->flow_ctrl = 0x%x, vars->link_status = 0x%x, ext_phy_line_speed = %d\n", "bnx2x_link_update", 6984, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->flow_ctrl, vars->link_status, (int )ext_phy_line_speed); } else { } if ((unsigned int )vars->phy_link_up != 0U) { if (((unsigned int )params->num_phys != 1U && (unsigned int )ext_phy_link_up != 0U) && (int )vars->line_speed != (int )ext_phy_line_speed) { tmp___15 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___15 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Internal link speed %d is different than the external link speed %d\n", "bnx2x_link_update", 6996, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed, (int )ext_phy_line_speed); } else { } vars->phy_link_up = 0U; } else if ((int )vars->line_speed != (int )prev_line_speed) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); usleep_range(1000UL, 2000UL); } else { } } else { } link_10g_plus = (unsigned int )vars->line_speed > 9999U; bnx2x_link_int_ack(params, vars, (int )link_10g_plus); if ((unsigned int )params->num_phys != 1U) { tmp___16 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___16 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ext_phy_link_up = %d, int_link_up = %d, init_preceding = %d\n", "bnx2x_link_update", 7022, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ext_phy_link_up, (int )vars->phy_link_up, (int )params->phy[1].flags & 8); } else { } if ((((int )params->phy[1].flags & 8) == 0 && (unsigned int )ext_phy_link_up != 0U) && (unsigned int )vars->phy_link_up == 0U) { vars->line_speed = ext_phy_line_speed; if ((unsigned int )vars->line_speed <= 999U) { vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 2U); } else { vars->phy_flags = (unsigned int )vars->phy_flags & 253U; } if ((unsigned long )params->phy[0].config_init != (unsigned long )((u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))0)) { (*(params->phy[0].config_init))((struct bnx2x_phy *)(& params->phy), params, vars); } else { } } else { } } else { } vars->link_up = (u8 )(((unsigned int )vars->phy_link_up != 0U && ((unsigned int )ext_phy_link_up != 0U || (unsigned int )params->num_phys == 1U)) && (unsigned int )phy_vars[(int )active_external_phy].fault_detected == 0U); if ((params->feature_config_flags & 2U) != 0U) { vars->link_status = vars->link_status | 536870912U; } else { vars->link_status = vars->link_status & 3758096383U; } if ((unsigned int )vars->link_up != 0U) { rc = bnx2x_update_link_up(params, vars, (int )link_10g_plus); } else { rc = bnx2x_update_link_down(params, vars); } if ((int )(vars->link_status ^ prev_link_status) & 1) { bnx2x_chng_link_count(params, 0); } else { } if ((params->feature_config_flags & 256U) != 0U) { bnx2x_fw_command(bp, 16777216U, 0U); } else { } return (rc); } } void bnx2x_ext_phy_hw_reset(struct bnx2x *bp , u8 port ) { { bnx2x_set_gpio(bp, 1, 0U, (int )port); usleep_range(1000UL, 2000UL); bnx2x_set_gpio(bp, 1, 1U, (int )port); return; } } static void bnx2x_save_spirom_version(struct bnx2x *bp , u8 port , u32 spirom_ver , u32 ver_addr ) { long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]FW version 0x%x:0x%x for port %d\n", "bnx2x_save_spirom_version", 7083, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )((unsigned short )(spirom_ver >> 16)), (int )((unsigned short )spirom_ver), (int )port); } else { } if (ver_addr != 0U) { writel(spirom_ver, (void volatile *)bp->regview + (unsigned long )ver_addr); } else { } return; } } static void bnx2x_save_bcm_spirom_ver(struct bnx2x *bp , struct bnx2x_phy *phy , u8 port ) { u16 fw_ver1 ; u16 fw_ver2 ; { bnx2x_cl45_read(bp, phy, 1, 51737, & fw_ver1); bnx2x_cl45_read(bp, phy, 1, 51738, & fw_ver2); bnx2x_save_spirom_version(bp, (int )port, (unsigned int )(((int )fw_ver1 << 16) | (int )fw_ver2), phy->ver_addr); return; } } static void bnx2x_ext_phy_10G_an_resolve(struct bnx2x *bp , struct bnx2x_phy *phy , struct link_vars *vars ) { u16 val ; { bnx2x_cl45_read(bp, phy, 7, 1, & val); bnx2x_cl45_read(bp, phy, 7, 1, & val); if (((int )val & 32) != 0) { vars->link_status = vars->link_status | 64U; } else { } if (((int )val & 1) == 0) { vars->link_status = vars->link_status | 128U; } else { } return; } } static void bnx2x_8073_resolve_fc(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 pause_result ; u16 ld_pause ; u16 lp_pause ; long tmp ; u8 tmp___0 ; { bp = params->bp; if ((unsigned int )phy->req_line_speed == 10U || (unsigned int )phy->req_line_speed == 100U) { vars->flow_ctrl = phy->req_flow_ctrl; return; } else { } tmp___0 = bnx2x_ext_phy_resolve_fc(phy, params, vars); if ((unsigned int )tmp___0 != 0U && (unsigned int )vars->flow_ctrl == 1024U) { bnx2x_cl45_read(bp, phy, 7, 65508, & ld_pause); bnx2x_cl45_read(bp, phy, 7, 65509, & lp_pause); pause_result = (u16 )(((int )ld_pause & 384) >> 5); pause_result = (u16 )((int )((short )(((int )lp_pause & 384) >> 7)) | (int )((short )pause_result)); bnx2x_pause_resolve(phy, params, vars, (u32 )pause_result); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Ext PHY CL37 pause result 0x%x\n", "bnx2x_8073_resolve_fc", 7153, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pause_result); } else { } } else { } return; } } static int bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp , struct bnx2x_phy *phy , u8 port ) { u32 count ; u16 fw_ver1 ; u16 fw_msgout ; int rc ; long tmp ; long tmp___0 ; { count = 0U; rc = 0; bnx2x_cl45_write(bp, phy, 1, 51728, 1); bnx2x_cl45_write(bp, phy, 1, 51728, 140); bnx2x_cl45_write(bp, phy, 1, 51845, 1); bnx2x_cl45_write(bp, phy, 1, 51728, 394); bnx2x_cl45_write(bp, phy, 1, 51728, 392); msleep(100U); ldv_53168: count = count + 1U; if (count > 300U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_8073_8727_external_rom_boot port %x:Download failed. fw version = 0x%x\n", "bnx2x_8073_8727_external_rom_boot", 7203, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port, (int )fw_ver1); } else { } rc = -22; goto ldv_53167; } else { } bnx2x_cl45_read(bp, phy, 1, 51737, & fw_ver1); bnx2x_cl45_read(bp, phy, 1, 51731, & fw_msgout); usleep_range(1000UL, 2000UL); if (((unsigned int )fw_ver1 == 0U || (unsigned int )fw_ver1 == 17185U) || (((int )fw_msgout & 255) != 3 && phy->type == 768U)) { goto ldv_53168; } else { } ldv_53167: bnx2x_cl45_write(bp, phy, 1, 51845, 0); bnx2x_save_bcm_spirom_ver(bp, phy, (int )port); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_8073_8727_external_rom_boot port %x:Download complete. fw version = 0x%x\n", "bnx2x_8073_8727_external_rom_boot", 7229, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port, (int )fw_ver1); } else { } return (rc); } } static int bnx2x_8073_is_snr_needed(struct bnx2x *bp , struct bnx2x_phy *phy ) { u16 val ; { bnx2x_cl45_read(bp, phy, 1, 51201, & val); if ((unsigned int )val != 1U) { return (0); } else { } bnx2x_cl45_read(bp, phy, 1, 51738, & val); if ((unsigned int )val != 258U) { return (0); } else { } return (1); } } static int bnx2x_8073_xaui_wa(struct bnx2x *bp , struct bnx2x_phy *phy ) { u16 val ; u16 cnt ; u16 cnt1 ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { bnx2x_cl45_read(bp, phy, 1, 51201, & val); if ((unsigned int )val != 0U) { return (0); } else { } cnt = 0U; goto ldv_53187; ldv_53186: bnx2x_cl45_read(bp, phy, 1, 51232, & val); if (((int )val & 16384) == 0 || ((int )val & 8192) == 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]XAUI work-around not required\n", "bnx2x_8073_xaui_wa", 7291, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } else if ((int )((short )val) >= 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]bit 15 went off\n", "bnx2x_8073_xaui_wa", 7294, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } cnt1 = 0U; goto ldv_53183; ldv_53182: bnx2x_cl45_read(bp, phy, 1, 51265, & val); if ((int )((short )val) < 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]XAUI workaround has completed\n", "bnx2x_8073_xaui_wa", 7306, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } else { } usleep_range(3000UL, 6000UL); cnt1 = (u16 )((int )cnt1 + 1); ldv_53183: ; if ((unsigned int )cnt1 <= 999U) { goto ldv_53182; } else { } goto ldv_53185; } else { } usleep_range(3000UL, 6000UL); cnt = (u16 )((int )cnt + 1); ldv_53187: ; if ((unsigned int )cnt <= 999U) { goto ldv_53186; } else { } ldv_53185: tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Warning: XAUI work-around timeout !!!\n", "bnx2x_8073_xaui_wa", 7315, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } } static void bnx2x_807x_force_10G(struct bnx2x *bp , struct bnx2x_phy *phy ) { { bnx2x_cl45_write(bp, phy, 1, 0, 8256); bnx2x_cl45_write(bp, phy, 1, 7, 11); bnx2x_cl45_write(bp, phy, 1, 150, 0); bnx2x_cl45_write(bp, phy, 7, 0, 0); return; } } static void bnx2x_8073_set_pause_cl37(struct link_params *params , struct bnx2x_phy *phy , struct link_vars *vars ) { u16 cl37_val ; struct bnx2x *bp ; long tmp ; { bp = params->bp; bnx2x_cl45_read(bp, phy, 7, 65508, & cl37_val); cl37_val = (unsigned int )cl37_val & 65151U; bnx2x_calc_ieee_aneg_adv(phy, params, & vars->ieee_fc); if (((int )vars->ieee_fc & 128) != 0) { cl37_val = (u16 )((unsigned int )cl37_val | 128U); } else { } if (((int )vars->ieee_fc & 256) != 0) { cl37_val = (u16 )((unsigned int )cl37_val | 256U); } else { } if (((int )vars->ieee_fc & 384) == 384) { cl37_val = (u16 )((unsigned int )cl37_val | 384U); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Ext phy AN advertize cl37 0x%x\n", "bnx2x_8073_set_pause_cl37", 7360, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cl37_val); } else { } bnx2x_cl45_write(bp, phy, 7, 65508, (int )cl37_val); msleep(500U); return; } } static void bnx2x_8073_specific_func(struct bnx2x_phy *phy , struct link_params *params , u32 action ) { struct bnx2x *bp ; { bp = params->bp; switch (action) { case 3U: bnx2x_cl45_write(bp, phy, 1, 36864, 4); bnx2x_cl45_write(bp, phy, 1, 36866, 4); goto ldv_53207; } ldv_53207: ; return; } } static int bnx2x_8073_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 val ; u16 tmp1 ; u8 gpio_port ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; unsigned int tmp___3 ; long tmp___4 ; long tmp___5 ; u16 phy_ver ; long tmp___6 ; long tmp___7 ; int tmp___8 ; long tmp___9 ; { bp = params->bp; val = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Init 8073\n", "bnx2x_8073_config_init", 7390, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { gpio_port = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; } else { gpio_port = params->port; } bnx2x_set_gpio(bp, 2, 1U, (int )gpio_port); bnx2x_set_gpio(bp, 1, 1U, (int )gpio_port); bnx2x_8073_specific_func(phy, params, 3U); bnx2x_8073_set_pause_cl37(params, phy, vars); bnx2x_cl45_read(bp, phy, 1, 51731, & tmp1); bnx2x_cl45_read(bp, phy, 1, 36867, & tmp1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Before rom RX_ALARM(port1): 0x%x\n", "bnx2x_8073_config_init", 7412, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tmp1); } else { } if ((params->lane_config & 65536U) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Swapping polarity for the 8073\n", "bnx2x_8073_config_init", 7417, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read(bp, phy, 1, 52488, & val); bnx2x_cl45_write(bp, phy, 1, 52488, (int )((unsigned int )val | 1536U)); } else { } tmp___3 = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem_base + ((unsigned long )params->port + 1UL) * 400UL))); if ((tmp___3 & 1048576U) != 0U) { bnx2x_cl45_read(bp, phy, 7, 33616, & val); bnx2x_cl45_write(bp, phy, 7, 33616, (int )((unsigned int )val | 1U)); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enable CL37 BAM on KR\n", "bnx2x_8073_config_init", 7441, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((unsigned int )params->loopback_mode == 5U) { bnx2x_807x_force_10G(bp, phy); tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Forced speed 10G on 807X\n", "bnx2x_8073_config_init", 7445, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } else { bnx2x_cl45_write(bp, phy, 1, 150, 2); } if ((unsigned int )phy->req_line_speed != 0U) { if ((unsigned int )phy->req_line_speed == 10000U) { val = 128U; } else if ((unsigned int )phy->req_line_speed == 2500U) { val = 32U; } else { val = 32U; } } else { val = 0U; if ((phy->speed_cap_mask & 4194304U) != 0U) { val = (u16 )((unsigned int )val | 128U); } else { } if ((phy->speed_cap_mask & 3145728U) != 0U) { val = (u16 )((unsigned int )val | 32U); } else { } tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]807x autoneg val = 0x%x\n", "bnx2x_8073_config_init", 7472, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val); } else { } } bnx2x_cl45_write(bp, phy, 7, 17, (int )val); bnx2x_cl45_read(bp, phy, 7, 33577, & tmp1); if (((phy->speed_cap_mask & 2097152U) != 0U && (unsigned int )phy->req_line_speed == 0U) || (unsigned int )phy->req_line_speed == 2500U) { bnx2x_cl45_read(bp, phy, 1, 51201, & phy_ver); tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Add 2.5G\n", "bnx2x_8073_config_init", 7486, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((unsigned int )phy_ver != 0U) { tmp1 = (u16 )((unsigned int )tmp1 | 1U); } else { tmp1 = (unsigned int )tmp1 & 65534U; } } else { tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Disable 2.5G\n", "bnx2x_8073_config_init", 7492, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp1 = (unsigned int )tmp1 & 65534U; } bnx2x_cl45_write(bp, phy, 7, 33577, (int )tmp1); bnx2x_cl45_read(bp, phy, 7, 65508, & tmp1); bnx2x_cl45_write(bp, phy, 7, 65508, (int )((u16 )(((unsigned int )phy->req_duplex == 1U ? 32 : 64) | (int )((short )tmp1)))); bnx2x_cl45_write(bp, phy, 7, 65504, 4096); tmp___8 = bnx2x_8073_is_snr_needed(bp, phy); if (tmp___8 != 0) { bnx2x_cl45_write(bp, phy, 1, 51739, 64268); } else { } bnx2x_cl45_read(bp, phy, 7, 18, & tmp1); tmp1 = (u16 )((unsigned int )tmp1 | 32768U); bnx2x_cl45_write(bp, phy, 7, 18, (int )tmp1); bnx2x_ext_phy_set_pause(params, phy, vars); msleep(500U); bnx2x_cl45_write(bp, phy, 7, 0, 4608); tmp___9 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]807x Autoneg Restart: Advertise 1G=%x, 10G=%x\n", "bnx2x_8073_config_init", 7527, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ((int )val & 32) > 0, ((int )val & 128) > 0); } else { } return (0); } } static u8 bnx2x_8073_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 link_up ; u16 val1 ; u16 val2 ; u16 link_status ; u16 an1000_status ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; long tmp___5 ; int tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; long tmp___10 ; long tmp___11 ; { bp = params->bp; link_up = 0U; link_status = 0U; an1000_status = 0U; bnx2x_cl45_read(bp, phy, 1, 36869, & val1); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]8703 LASI status 0x%x\n", "bnx2x_8073_read_status", 7544, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val1); } else { } bnx2x_cl45_read(bp, phy, 3, 32, & val2); bnx2x_cl45_read(bp, phy, 3, 32, & val1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]807x PCS status 0x%x->0x%x\n", "bnx2x_8073_read_status", 7551, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val2, (int )val1); } else { } bnx2x_cl45_read(bp, phy, 1, 51731, & val1); bnx2x_cl45_read(bp, phy, 1, 36867, & val2); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]KR 0x9003 0x%x\n", "bnx2x_8073_read_status", 7560, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val2); } else { } bnx2x_cl45_read(bp, phy, 3, 32, & val2); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]KR PCS status 0x%x\n", "bnx2x_8073_read_status", 7565, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val2); } else { } bnx2x_cl45_read(bp, phy, 1, 1, & val2); bnx2x_cl45_read(bp, phy, 1, 1, & val1); link_up = ((int )val1 & 4) != 0; tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PMA_REG_STATUS=0x%x\n", "bnx2x_8073_read_status", 7572, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val1); } else { } if ((unsigned int )link_up != 0U && (unsigned int )phy->req_line_speed != 10000U) { tmp___4 = bnx2x_8073_xaui_wa(bp, phy); if (tmp___4 != 0) { return (0U); } else { } } else { } bnx2x_cl45_read(bp, phy, 7, 33540, & an1000_status); bnx2x_cl45_read(bp, phy, 7, 33540, & an1000_status); bnx2x_cl45_read(bp, phy, 1, 1, & val2); bnx2x_cl45_read(bp, phy, 1, 1, & val1); tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]KR PMA status 0x%x->0x%x,an_link_status=0x%x\n", "bnx2x_8073_read_status", 7590, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val2, (int )val1, (int )an1000_status); } else { } link_up = (u8 )(((int )val1 & 4) != 0 || ((int )an1000_status & 2) != 0); if ((unsigned int )link_up != 0U) { tmp___6 = bnx2x_8073_is_snr_needed(bp, phy); if (tmp___6 != 0) { bnx2x_cl45_write(bp, phy, 1, 51741, 9916); bnx2x_cl45_write(bp, phy, 1, 51782, 819); } else { } } else { } bnx2x_cl45_read(bp, phy, 1, 51232, & link_status); if (((int )link_status & 4) != 0 && (int )((short )link_status) >= 0) { link_up = 1U; vars->line_speed = 10000U; tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x: External link up in 10G\n", "bnx2x_8073_read_status", 7616, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } } else if (((int )link_status & 2) != 0 && ((int )link_status & 16384) == 0) { link_up = 1U; vars->line_speed = 2500U; tmp___8 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x: External link up in 2.5G\n", "bnx2x_8073_read_status", 7621, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } } else if ((int )link_status & 1 && ((int )link_status & 8192) == 0) { link_up = 1U; vars->line_speed = 1000U; tmp___9 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x: External link up in 1G\n", "bnx2x_8073_read_status", 7626, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } } else { link_up = 0U; tmp___10 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___10 != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x: External link is down\n", "bnx2x_8073_read_status", 7630, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } } if ((unsigned int )link_up != 0U) { if ((params->lane_config & 65536U) != 0U) { bnx2x_cl45_read(bp, phy, 4, 33018, & val1); if ((unsigned int )vars->line_speed == 1000U) { tmp___11 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Swapping 1G polarity forthe 8073\n", "bnx2x_8073_read_status", 7646, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } val1 = (u16 )((unsigned int )val1 | 8U); } else { val1 = (unsigned int )val1 & 65527U; } bnx2x_cl45_write(bp, phy, 4, 33018, (int )val1); } else { } bnx2x_ext_phy_10G_an_resolve(bp, phy, vars); bnx2x_8073_resolve_fc(phy, params, vars); vars->duplex = 1U; } else { } if ((vars->link_status & 64U) != 0U) { bnx2x_cl45_read(bp, phy, 7, 20, & val1); if (((int )val1 & 32) != 0) { vars->link_status = vars->link_status | 512U; } else { } if (((int )val1 & 128) != 0) { vars->link_status = vars->link_status | 8388608U; } else { } } else { } return (link_up); } } static void bnx2x_8073_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u8 gpio_port ; long tmp ; { bp = params->bp; if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { gpio_port = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; } else { gpio_port = params->port; } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 8073 port %d into low power mode\n", "bnx2x_8073_link_reset", 7686, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )gpio_port); } else { } bnx2x_set_gpio(bp, 2, 0U, (int )gpio_port); return; } } static int bnx2x_8705_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]init 8705\n", "bnx2x_8705_config_init", 7700, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_set_gpio(bp, 2, 1U, (int )params->port); bnx2x_ext_phy_hw_reset(bp, (int )params->port); bnx2x_cl45_write(bp, phy, 1, 0, 41024); bnx2x_wait_reset_complete(bp, phy, params); bnx2x_cl45_write(bp, phy, 1, 51722, 33416); bnx2x_cl45_write(bp, phy, 1, 51200, 32703); bnx2x_cl45_write(bp, phy, 1, 51721, 256); bnx2x_cl45_write(bp, phy, 2, 36866, 1); bnx2x_save_spirom_version(bp, (int )params->port, params->shmem_base, 0U); return (0); } } static u8 bnx2x_8705_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u8 link_up ; u16 val1 ; u16 rx_sd ; struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { link_up = 0U; bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]read status 8705\n", "bnx2x_8705_read_status", 7729, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read(bp, phy, 2, 36869, & val1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]8705 LASI status 0x%x\n", "bnx2x_8705_read_status", 7732, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val1); } else { } bnx2x_cl45_read(bp, phy, 2, 36869, & val1); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]8705 LASI status 0x%x\n", "bnx2x_8705_read_status", 7736, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val1); } else { } bnx2x_cl45_read(bp, phy, 1, 10, & rx_sd); bnx2x_cl45_read(bp, phy, 1, 51209, & val1); bnx2x_cl45_read(bp, phy, 1, 51209, & val1); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]8705 1.c809 val=0x%x\n", "bnx2x_8705_read_status", 7746, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val1); } else { } link_up = (u8 )(((int )rx_sd & 1 && ((int )val1 & 512) != 0) && ((int )val1 & 256) == 0); if ((unsigned int )link_up != 0U) { vars->line_speed = 10000U; bnx2x_ext_phy_resolve_fc(phy, params, vars); } else { } return (link_up); } } static void bnx2x_set_disable_pmd_transmit(struct link_params *params , struct bnx2x_phy *phy , u8 pmd_dis ) { struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; { bp = params->bp; if ((unsigned int )pmd_dis != 0U) { if ((params->feature_config_flags & 1024U) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Disabling PMD transmitter\n", "bnx2x_set_disable_pmd_transmit", 7769, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]NOT disabling PMD transmitter\n", "bnx2x_set_disable_pmd_transmit", 7771, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling PMD transmitter\n", "bnx2x_set_disable_pmd_transmit", 7775, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } bnx2x_cl45_write(bp, phy, 1, 9, (int )pmd_dis); return; } } static u8 bnx2x_get_gpio_port(struct link_params *params ) { u8 gpio_port ; u32 swap_val ; u32 swap_override ; struct bnx2x *bp ; { bp = params->bp; if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { gpio_port = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; } else { gpio_port = params->port; } swap_val = readl((void const volatile *)bp->regview + 66452U); swap_override = readl((void const volatile *)bp->regview + 66456U); return ((u8 )((int )((signed char )(swap_val != 0U && swap_override != 0U)) ^ (int )((signed char )gpio_port))); } } static void bnx2x_sfp_e1e2_set_transmitter(struct link_params *params , struct bnx2x_phy *phy , u8 tx_en ) { u16 val ; u8 port ; struct bnx2x *bp ; u32 tx_en_mode ; unsigned int tmp ; long tmp___0 ; u16 gpio_pin ; u8 gpio_port ; u8 gpio_mode ; long tmp___1 ; { port = params->port; bp = params->bp; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 400UL) + 108UL))); tx_en_mode = tmp & 255U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting transmitter tx_en=%x for port %x mode = %x\n", "bnx2x_sfp_e1e2_set_transmitter", 7810, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tx_en, (int )port, tx_en_mode); } else { } switch (tx_en_mode) { case 0U: bnx2x_cl45_read(bp, phy, 1, 51200, & val); if ((unsigned int )tx_en != 0U) { val = (unsigned int )val & 32767U; } else { val = (u16 )((unsigned int )val | 32768U); } bnx2x_cl45_write(bp, phy, 1, 51200, (int )val); goto ldv_53280; case 1U: ; case 2U: ; case 3U: ; case 4U: ; if ((unsigned int )tx_en != 0U) { gpio_mode = 1U; } else { gpio_mode = 0U; } gpio_pin = (unsigned int )((u16 )tx_en_mode) - 1U; gpio_port = bnx2x_get_gpio_port(params); bnx2x_set_gpio(bp, (int )gpio_pin, (u32 )gpio_mode, (int )gpio_port); goto ldv_53280; default: tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid TX_LASER_MDIO 0x%x\n", "bnx2x_sfp_e1e2_set_transmitter", 7847, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tx_en_mode); } else { } goto ldv_53280; } ldv_53280: ; return; } } static void bnx2x_sfp_set_transmitter(struct link_params *params , struct bnx2x_phy *phy , u8 tx_en ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting SFP+ transmitter to %d\n", "bnx2x_sfp_set_transmitter", 7857, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tx_en); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_sfp_e3_set_transmitter(params, phy, (int )tx_en); } else { bnx2x_sfp_e1e2_set_transmitter(params, phy, (int )tx_en); } return; } } static int bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy , struct link_params *params , u8 dev_addr , u16 addr , u8 byte_cnt , u8 *o_buf , u8 is_init ) { struct bnx2x *bp ; u16 val ; u16 i ; long tmp ; long tmp___0 ; { bp = params->bp; val = 0U; if ((unsigned int )byte_cnt > 16U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Reading from eeprom is limited to 0xf\n", "bnx2x_8726_read_sfp_module_eeprom", 7874, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_cl45_write(bp, phy, 1, 32770, (int )((u16 )((int )((short )byte_cnt) | (int )((short )((int )dev_addr << 8))))); bnx2x_cl45_write(bp, phy, 1, 32771, (int )addr); bnx2x_cl45_write(bp, phy, 1, 32768, 11279); i = 0U; goto ldv_53311; ldv_53310: bnx2x_cl45_read(bp, phy, 1, 32768, & val); if (((int )val & 12) == 4) { goto ldv_53309; } else { } __const_udelay(21475UL); i = (u16 )((int )i + 1); ldv_53311: ; if ((unsigned int )i <= 99U) { goto ldv_53310; } else { } ldv_53309: ; if (((int )val & 12) != 4) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Got bad status 0x%x when reading from SFP+ EEPROM\n", "bnx2x_8726_read_sfp_module_eeprom", 7907, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val & 12); } else { } return (-22); } else { } i = 0U; goto ldv_53313; ldv_53312: bnx2x_cl45_read(bp, phy, 1, (int )((unsigned int )i + 51232U), & val); *(o_buf + (unsigned long )i) = (unsigned char )val; i = (u16 )((int )i + 1); ldv_53313: ; if ((int )((unsigned short )byte_cnt) > (int )i) { goto ldv_53312; } else { } i = 0U; goto ldv_53316; ldv_53315: bnx2x_cl45_read(bp, phy, 1, 32768, & val); if (((int )val & 12) == 0) { return (0); } else { } usleep_range(1000UL, 2000UL); i = (u16 )((int )i + 1); ldv_53316: ; if ((unsigned int )i <= 99U) { goto ldv_53315; } else { } return (-22); } } static void bnx2x_warpcore_power_module(struct link_params *params , u8 power ) { u32 pin_cfg ; struct bnx2x *bp ; unsigned int tmp ; long tmp___0 ; { bp = params->bp; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 400UL) + 112UL))); pin_cfg = tmp >> 24; if (pin_cfg == 0U) { return; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting SFP+ module power to %d using pin cfg %d\n", "bnx2x_warpcore_power_module", 7946, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )power, pin_cfg); } else { } bnx2x_set_cfg_pin(bp, pin_cfg, (unsigned int )power ^ 1U); return; } } static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy , struct link_params *params , u8 dev_addr , u16 addr , u8 byte_cnt , u8 *o_buf , u8 is_init ) { int rc ; u8 i ; u8 j ; u8 cnt ; u32 data_array[4U] ; u16 addr32 ; struct bnx2x *bp ; long tmp ; { rc = 0; j = 0U; cnt = 0U; bp = params->bp; if ((unsigned int )byte_cnt > 16U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Reading from eeprom is limited to 16 bytes\n", "bnx2x_warpcore_read_sfp_module_eeprom", 7966, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } addr32 = (unsigned int )addr & 65532U; ldv_53342: ; if ((unsigned int )is_init == 0U && (unsigned int )cnt == 2U) { bnx2x_warpcore_power_module(params, 0); usleep_range(1000UL, 2000UL); bnx2x_warpcore_power_module(params, 1); } else { } rc = bnx2x_bsc_read(params, bp, (int )dev_addr, (int )addr32, 0, (int )byte_cnt, (u32 *)(& data_array)); if (rc != 0) { cnt = (u8 )((int )cnt + 1); if ((unsigned int )cnt <= 2U) { goto ldv_53342; } else { goto ldv_53343; } } else { } ldv_53343: ; if (rc == 0) { i = (int )((u8 )addr) - (int )((u8 )addr32); goto ldv_53345; ldv_53344: *(o_buf + (unsigned long )j) = *((u8 *)(& data_array) + (unsigned long )i); j = (u8 )((int )j + 1); i = (u8 )((int )i + 1); ldv_53345: ; if ((int )i < (int )byte_cnt + ((int )addr - (int )addr32)) { goto ldv_53344; } else { } } else { } return (rc); } } static int bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy , struct link_params *params , u8 dev_addr , u16 addr , u8 byte_cnt , u8 *o_buf , u8 is_init ) { struct bnx2x *bp ; u16 val ; u16 i ; long tmp ; long tmp___0 ; { bp = params->bp; if ((unsigned int )byte_cnt > 16U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Reading from eeprom is limited to 0xf\n", "bnx2x_8727_read_sfp_module_eeprom", 8003, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_cl45_write(bp, phy, 1, 32773, (int )((u16 )((int )((short )((int )dev_addr << 8)) | 1))); bnx2x_cl45_read(bp, phy, 1, 32768, & val); bnx2x_cl45_write(bp, phy, 1, 32770, (unsigned int )byte_cnt > 1U ? (int )byte_cnt : 2); bnx2x_cl45_write(bp, phy, 1, 32771, (int )addr); bnx2x_cl45_write(bp, phy, 1, 32772, 32775); bnx2x_cl45_write(bp, phy, 1, 32768, 32770); usleep_range(1000UL, 2000UL); i = 0U; goto ldv_53362; ldv_53361: bnx2x_cl45_read(bp, phy, 1, 32768, & val); if (((int )val & 12) == 4) { goto ldv_53360; } else { } __const_udelay(21475UL); i = (u16 )((int )i + 1); ldv_53362: ; if ((unsigned int )i <= 99U) { goto ldv_53361; } else { } ldv_53360: ; if (((int )val & 12) != 4) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Got bad status 0x%x when reading from SFP+ EEPROM\n", "bnx2x_8727_read_sfp_module_eeprom", 8064, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val & 12); } else { } return (-14); } else { } i = 0U; goto ldv_53364; ldv_53363: bnx2x_cl45_read(bp, phy, 1, (int )((unsigned int )i + 32775U), & val); *(o_buf + (unsigned long )i) = (unsigned char )val; i = (u16 )((int )i + 1); ldv_53364: ; if ((int )((unsigned short )byte_cnt) > (int )i) { goto ldv_53363; } else { } i = 0U; goto ldv_53367; ldv_53366: bnx2x_cl45_read(bp, phy, 1, 32768, & val); if (((int )val & 12) == 0) { return (0); } else { } usleep_range(1000UL, 2000UL); i = (u16 )((int )i + 1); ldv_53367: ; if ((unsigned int )i <= 99U) { goto ldv_53366; } else { } return (-22); } } int bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy , struct link_params *params , u8 dev_addr , u16 addr , u16 byte_cnt , u8 *o_buf ) { int rc ; struct bnx2x *bp ; u8 xfer_size ; u8 *user_data ; int (*read_func)(struct bnx2x_phy * , struct link_params * , u8 , u16 , u8 , u8 * , u8 ) ; long tmp ; { rc = 0; bp = params->bp; user_data = o_buf; if ((unsigned int )dev_addr != 160U && (unsigned int )dev_addr != 162U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]invalid dev_addr 0x%x\n", "bnx2x_read_sfp_module_eeprom", 8099, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )dev_addr); } else { } return (-22); } else { } switch (phy->type) { case 1536U: read_func = & bnx2x_8726_read_sfp_module_eeprom; goto ldv_53384; case 2304U: ; case 3840U: read_func = & bnx2x_8727_read_sfp_module_eeprom; goto ldv_53384; case 0U: read_func = & bnx2x_warpcore_read_sfp_module_eeprom; goto ldv_53384; default: ; return (-95); } ldv_53384: ; goto ldv_53390; ldv_53389: xfer_size = (unsigned int )byte_cnt <= 16U ? (u8 )byte_cnt : 16U; rc = (*read_func)(phy, params, (int )dev_addr, (int )addr, (int )xfer_size, user_data, 0); byte_cnt = (int )byte_cnt - (int )((u16 )xfer_size); user_data = user_data + (unsigned long )xfer_size; addr = (int )((u16 )xfer_size) + (int )addr; ldv_53390: ; if (rc == 0 && (unsigned int )byte_cnt != 0U) { goto ldv_53389; } else { } return (rc); } } static int bnx2x_get_edc_mode(struct bnx2x_phy *phy , struct link_params *params , u16 *edc_mode ) { struct bnx2x *bp ; u32 sync_offset ; u32 phy_idx ; u32 media_types ; u8 val[9U] ; u8 check_limiting_mode ; long tmp ; int tmp___0 ; u8 copper_module_type ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; u8 gport ; int idx ; int cfg_idx ; long tmp___5 ; long tmp___6 ; u8 options[2U] ; long tmp___7 ; int tmp___8 ; long tmp___9 ; { bp = params->bp; sync_offset = 0U; check_limiting_mode = 0U; *edc_mode = 68U; phy->media_type = 0U; tmp___0 = bnx2x_read_sfp_module_eeprom(phy, params, 160, 0, 9, (u8 *)(& val)); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to read from SFP+ module EEPROM\n", "bnx2x_get_edc_mode", 8146, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } params->link_attr_sync = params->link_attr_sync & 4294902015U; params->link_attr_sync = params->link_attr_sync | (u32 )((int )val[3] << 8); bnx2x_update_link_attr(params, params->link_attr_sync); switch ((int )val[2]) { case 33: phy->media_type = 3U; copper_module_type = val[8]; if (((int )copper_module_type & 8) != 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Active Copper cable detected\n", "bnx2x_get_edc_mode", 8165, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (phy->type == 0U) { *edc_mode = 102U; } else { check_limiting_mode = 1U; } } else { *edc_mode = 85U; if (((int )copper_module_type & 4) != 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Passive Copper cable detected\n", "bnx2x_get_edc_mode", 8179, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unknown copper-cable-type\n", "bnx2x_get_edc_mode", 8182, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } } goto ldv_53406; case 0: ; case 7: ; case 34: check_limiting_mode = 1U; if (((int )val[3] & 112) == 0 && (unsigned int )val[6] != 0U) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]1G SFP module detected\n", "bnx2x_get_edc_mode", 8196, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } phy->media_type = 5U; if ((unsigned int )phy->req_line_speed != 1000U) { gport = params->port; phy->req_line_speed = 1000U; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { gport = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U) + (unsigned int )((int )params->port << 1U); } else { } netdev_err((struct net_device const *)bp->dev, "Warning: Link speed was forced to 1000Mbps. Current SFP module in port %d is not compliant with 10G Ethernet\n", (int )gport); } else { } if (((int )val[6] & 8) != 0) { bnx2x_sfp_set_transmitter(params, phy, 0); msleep(40U); bnx2x_sfp_set_transmitter(params, phy, 1); } else { } } else { cfg_idx = 0; tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]10G Optic module detected\n", "bnx2x_get_edc_mode", 8217, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } idx = 0; goto ldv_53415; ldv_53414: ; if (params->phy[idx].type == phy->type) { cfg_idx = idx != 0 ? idx + -1 : 0; goto ldv_53413; } else { } idx = idx + 1; ldv_53415: ; if (idx <= 2) { goto ldv_53414; } else { } ldv_53413: phy->media_type = 1U; phy->req_line_speed = params->req_line_speed[cfg_idx]; } goto ldv_53406; default: tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unable to determine module type 0x%x !!!\n", "bnx2x_get_edc_mode", 8230, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val[2]); } else { } return (-22); } ldv_53406: sync_offset = (params->shmem_base + (u32 )params->port * 400U) + 156U; media_types = readl((void const volatile *)bp->regview + (unsigned long )sync_offset); phy_idx = 0U; goto ldv_53419; ldv_53418: ; if ((unsigned long )((struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_idx) == (unsigned long )phy) { media_types = (u32 )(~ (255 << (int )(phy_idx * 8U))) & media_types; media_types = ((phy->media_type & 255U) << (int )(phy_idx * 8U)) | media_types; goto ldv_53417; } else { } phy_idx = phy_idx + 1U; ldv_53419: ; if (phy_idx <= 2U) { goto ldv_53418; } else { } ldv_53417: writel(media_types, (void volatile *)bp->regview + (unsigned long )sync_offset); if ((unsigned int )check_limiting_mode != 0U) { tmp___8 = bnx2x_read_sfp_module_eeprom(phy, params, 160, 64, 2, (u8 *)(& options)); if (tmp___8 != 0) { tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to read Option field from module EEPROM\n", "bnx2x_get_edc_mode", 8258, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((int )options[0] & 1) { *edc_mode = 34U; } else { *edc_mode = 68U; } } else { } tmp___9 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]EDC mode is set to 0x%x\n", "bnx2x_get_edc_mode", 8266, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )*edc_mode); } else { } return (0); } } static int bnx2x_verify_sfp_module(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u32 val ; u32 cmd ; u32 fw_resp ; u32 fw_cmd_param ; char vendor_name[17U] ; char vendor_pn[17U] ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; int tmp___3 ; int tmp___4 ; { bp = params->bp; phy->flags = (unsigned int )phy->flags & 65407U; val = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 116UL) + 856UL))); if ((val & 3758096384U) == 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]NOT enforcing module verification\n", "bnx2x_verify_sfp_module", 8286, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } else { } if ((params->feature_config_flags & 8U) != 0U) { cmd = 2701131776U; } else if ((params->feature_config_flags & 4U) != 0U) { if ((unsigned int )params->num_phys == 3U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]FW does not support OPT MDL verification\n", "bnx2x_verify_sfp_module", 8299, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } cmd = 2684354560U; } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]FW does not support OPT MDL verification\n", "bnx2x_verify_sfp_module", 8306, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } fw_cmd_param = ((u32 )phy->addr | phy->type) | (phy->mdio_ctrl << 16); fw_resp = bnx2x_fw_command(bp, cmd, fw_cmd_param); if (fw_resp == 2685403136U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Approved module\n", "bnx2x_verify_sfp_module", 8313, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } else { } tmp___3 = bnx2x_read_sfp_module_eeprom(phy, params, 160, 20, 16, (u8 *)(& vendor_name)); if (tmp___3 != 0) { vendor_name[0] = 0; } else { vendor_name[16] = 0; } tmp___4 = bnx2x_read_sfp_module_eeprom(phy, params, 160, 40, 16, (u8 *)(& vendor_pn)); if (tmp___4 != 0) { vendor_pn[0] = 0; } else { vendor_pn[16] = 0; } netdev_err((struct net_device const *)bp->dev, "Warning: Unqualified SFP+ module detected, Port %d from %s part number %s\n", (int )params->port, (char *)(& vendor_name), (char *)(& vendor_pn)); if ((val & 3758096384U) != 1073741824U) { phy->flags = (u16 )((unsigned int )phy->flags | 128U); } else { } return (-22); } } static int bnx2x_wait_for_sfp_module_initialized(struct bnx2x_phy *phy , struct link_params *params ) { u8 val ; int rc ; struct bnx2x *bp ; u16 timeout ; long tmp ; { bp = params->bp; timeout = 0U; goto ldv_53443; ldv_53442: ; if (phy->type == 0U) { rc = bnx2x_warpcore_read_sfp_module_eeprom(phy, params, 160, 1, 1, & val, 1); } else { rc = bnx2x_read_sfp_module_eeprom(phy, params, 160, 1, 1, & val); } if (rc == 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]SFP+ module initialization took %d ms\n", "bnx2x_wait_for_sfp_module_initialized", 8370, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )timeout * 5); } else { } return (0); } else { } usleep_range(5000UL, 10000UL); timeout = (u16 )((int )timeout + 1); ldv_53443: ; if ((unsigned int )timeout <= 59U) { goto ldv_53442; } else { } rc = bnx2x_read_sfp_module_eeprom(phy, params, 160, 1, 1, & val); return (rc); } } static void bnx2x_8727_power_module(struct bnx2x *bp , struct bnx2x_phy *phy , u8 is_power_up ) { u16 val ; { if (((int )phy->flags & 2) != 0) { return; } else { } if ((unsigned int )is_power_up != 0U) { val = 16U; } else { val = 2U; } bnx2x_cl45_write(bp, phy, 1, 51214, (int )val); return; } } static int bnx2x_8726_set_limiting_mode(struct bnx2x *bp , struct bnx2x_phy *phy , u16 edc_mode ) { u16 cur_limiting_mode ; long tmp ; long tmp___0 ; long tmp___1 ; { bnx2x_cl45_read(bp, phy, 1, 51738, & cur_limiting_mode); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Current Limiting mode is 0x%x\n", "bnx2x_8726_set_limiting_mode", 8423, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cur_limiting_mode); } else { } if ((unsigned int )edc_mode == 68U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting LIMITING MODE\n", "bnx2x_8726_set_limiting_mode", 8426, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 1, 51738, 68); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting LRM MODE\n", "bnx2x_8726_set_limiting_mode", 8433, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((unsigned int )cur_limiting_mode != 68U) { return (0); } else { } bnx2x_cl45_write(bp, phy, 1, 51775, 0); bnx2x_cl45_write(bp, phy, 1, 51738, 296); bnx2x_cl45_write(bp, phy, 1, 51747, 16392); bnx2x_cl45_write(bp, phy, 1, 51775, 43690); } return (0); } } static int bnx2x_8727_set_limiting_mode(struct bnx2x *bp , struct bnx2x_phy *phy , u16 edc_mode ) { u16 phy_identifier ; u16 rom_ver2_val ; { bnx2x_cl45_read(bp, phy, 1, 51200, & phy_identifier); bnx2x_cl45_write(bp, phy, 1, 51200, (int )phy_identifier & 65023); bnx2x_cl45_read(bp, phy, 1, 51738, & rom_ver2_val); bnx2x_cl45_write(bp, phy, 1, 51738, (int )((u16 )(((int )((short )rom_ver2_val) & -256) | ((int )((short )edc_mode) & 255)))); bnx2x_cl45_write(bp, phy, 1, 51200, (int )((unsigned int )phy_identifier | 512U)); return (0); } } static void bnx2x_8727_specific_func(struct bnx2x_phy *phy , struct link_params *params , u32 action ) { struct bnx2x *bp ; u16 val ; long tmp ; { bp = params->bp; switch (action) { case 1U: bnx2x_sfp_set_transmitter(params, phy, 0); goto ldv_53473; case 2U: ; if (((int )phy->flags & 128) == 0) { bnx2x_sfp_set_transmitter(params, phy, 1); } else { } goto ldv_53473; case 3U: bnx2x_cl45_write(bp, phy, 1, 36864, 36); bnx2x_cl45_write(bp, phy, 1, 36865, 0); bnx2x_cl45_write(bp, phy, 1, 36866, 6); bnx2x_cl45_read(bp, phy, 1, 51208, & val); val = (u16 )((unsigned int )val | 4096U); if (((int )phy->flags & 2) != 0) { val = (u16 )((unsigned int )val | 96U); } else { } if (((int )phy->flags & 2) == 0) { val = (unsigned int )val & 65423U; } else { } bnx2x_cl45_write(bp, phy, 1, 51208, (int )val); goto ldv_53473; default: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Function 0x%x not supported by 8727\n", "bnx2x_8727_specific_func", 8536, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", action); } else { } return; } ldv_53473: ; return; } } static void bnx2x_set_e1e2_module_fault_led(struct link_params *params , u8 gpio_mode ) { struct bnx2x *bp ; u32 fault_led_gpio ; unsigned int tmp ; u8 gpio_port ; u8 tmp___0 ; u16 gpio_pin ; long tmp___1 ; long tmp___2 ; { bp = params->bp; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 400UL) + 108UL))); fault_led_gpio = tmp & 65280U; switch (fault_led_gpio) { case 1024U: ; return; case 0U: ; case 256U: ; case 512U: ; case 768U: tmp___0 = bnx2x_get_gpio_port(params); gpio_port = tmp___0; gpio_pin = (u16 )fault_led_gpio; tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set fault module-detected led pin %x port %x mode %x\n", "bnx2x_set_e1e2_module_fault_led", 8563, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )gpio_pin, (int )gpio_port, (int )gpio_mode); } else { } bnx2x_set_gpio(bp, (int )gpio_pin, (u32 )gpio_mode, (int )gpio_port); goto ldv_53492; default: tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Error: Invalid fault led mode 0x%x\n", "bnx2x_set_e1e2_module_fault_led", 8569, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", fault_led_gpio); } else { } } ldv_53492: ; return; } } static void bnx2x_set_e3_module_fault_led(struct link_params *params , u8 gpio_mode ) { u32 pin_cfg ; u8 port ; struct bnx2x *bp ; unsigned int tmp ; long tmp___0 ; { port = params->port; bp = params->bp; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 400UL) + 112UL))); pin_cfg = (tmp & 65280U) >> 8; tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting Fault LED to %d using pin cfg %d\n", "bnx2x_set_e3_module_fault_led", 8585, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )gpio_mode, pin_cfg); } else { } bnx2x_set_cfg_pin(bp, pin_cfg, (u32 )gpio_mode); return; } } static void bnx2x_set_sfp_module_fault_led(struct link_params *params , u8 gpio_mode ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting SFP+ module fault LED to %d\n", "bnx2x_set_sfp_module_fault_led", 8593, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )gpio_mode); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_set_e3_module_fault_led(params, (int )gpio_mode); } else { bnx2x_set_e1e2_module_fault_led(params, (int )gpio_mode); } return; } } static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; { bp = params->bp; bnx2x_warpcore_power_module(params, 0); writel(3086U, (void volatile *)bp->regview + 44080U); writel(1U, (void volatile *)bp->regview + 43636U); writel(0U, (void volatile *)bp->regview + 43640U); writel(0U, (void volatile *)bp->regview + 43644U); return; } } static void bnx2x_power_sfp_module(struct link_params *params , struct bnx2x_phy *phy , u8 power ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting SFP+ power to %x\n", "bnx2x_power_sfp_module", 8622, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )power); } else { } switch (phy->type) { case 2304U: ; case 3840U: bnx2x_8727_power_module(params->bp, phy, (int )power); goto ldv_53522; case 0U: bnx2x_warpcore_power_module(params, (int )power); goto ldv_53522; default: ; goto ldv_53522; } ldv_53522: ; return; } } static void bnx2x_warpcore_set_limiting_mode(struct link_params *params , struct bnx2x_phy *phy , u16 edc_mode ) { u16 val ; u16 mode ; struct bnx2x *bp ; u8 lane ; u8 tmp ; { val = 0U; mode = 0U; bp = params->bp; tmp = bnx2x_get_warpcore_lane(phy, params); lane = tmp; bnx2x_cl45_read(bp, phy, 3, 33266, & val); val = (u16 )(~ ((int )((short )(15 << ((int )lane << 2)))) & (int )((short )val)); switch ((int )edc_mode) { case 34: ; case 68: mode = 0U; goto ldv_53536; case 85: ; case 102: mode = 2U; goto ldv_53536; default: ; goto ldv_53536; } ldv_53536: val = (u16 )((int )((short )((int )mode << ((int )lane << 2))) | (int )((short )val)); bnx2x_cl45_write(bp, phy, 3, 33266, (int )val); bnx2x_cl45_read(bp, phy, 3, 33266, & val); bnx2x_warpcore_reset_lane(bp, phy, 1); bnx2x_warpcore_reset_lane(bp, phy, 0); return; } } static void bnx2x_set_limiting_mode(struct link_params *params , struct bnx2x_phy *phy , u16 edc_mode ) { { switch (phy->type) { case 1536U: bnx2x_8726_set_limiting_mode(params->bp, phy, (int )edc_mode); goto ldv_53546; case 2304U: ; case 3840U: bnx2x_8727_set_limiting_mode(params->bp, phy, (int )edc_mode); goto ldv_53546; case 0U: bnx2x_warpcore_set_limiting_mode(params, phy, (int )edc_mode); goto ldv_53546; } ldv_53546: ; return; } } static int bnx2x_sfp_module_detection(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 edc_mode ; int rc ; u32 val ; unsigned int tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; int tmp___5 ; { bp = params->bp; rc = 0; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 116UL) + 856UL))); val = tmp; bnx2x_sfp_set_transmitter(params, phy, 1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SFP+ module plugged in/out detected on port %d\n", "bnx2x_sfp_module_detection", 8707, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } bnx2x_power_sfp_module(params, phy, 1); tmp___5 = bnx2x_get_edc_mode(phy, params, & edc_mode); if (tmp___5 != 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to get valid module type\n", "bnx2x_sfp_module_detection", 8711, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { tmp___4 = bnx2x_verify_sfp_module(phy, params); if (tmp___4 != 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Module verification failed!!\n", "bnx2x_sfp_module_detection", 8715, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = -22; bnx2x_set_sfp_module_fault_led(params, 1); if ((val & 3758096384U) == 1610612736U) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Shutdown SFP+ module!!\n", "bnx2x_sfp_module_detection", 8724, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_power_sfp_module(params, phy, 0); return (rc); } else { } } else { bnx2x_set_sfp_module_fault_led(params, 0); } } bnx2x_set_limiting_mode(params, phy, (int )edc_mode); if (rc != 0 && (val & 3758096384U) == 536870912U) { bnx2x_sfp_set_transmitter(params, phy, 0); } else { } return (rc); } } void bnx2x_handle_module_detect_int(struct link_params *params ) { struct bnx2x *bp ; struct bnx2x_phy *phy ; u32 gpio_val ; u8 gpio_num ; u8 gpio_port ; long tmp ; int tmp___0 ; int tmp___1 ; u16 rx_tx_in_reset ; long tmp___2 ; int tmp___3 ; { bp = params->bp; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { phy = (struct bnx2x_phy *)(& params->phy); bnx2x_sfp_set_transmitter(params, phy, 1); } else { phy = (struct bnx2x_phy *)(& params->phy) + 1UL; } tmp___0 = bnx2x_get_mod_abs_int_cfg(bp, params->chip_id, params->shmem_base, (int )params->port, & gpio_num, & gpio_port); if (tmp___0 == -22) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to get MOD_ABS interrupt config\n", "bnx2x_handle_module_detect_int", 8765, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } bnx2x_set_sfp_module_fault_led(params, 1); tmp___1 = bnx2x_get_gpio(bp, (int )gpio_num, (int )gpio_port); gpio_val = (u32 )tmp___1; if (gpio_val == 0U) { bnx2x_set_mdio_emac_per_phy(bp, params); bnx2x_set_aer_mmd(params, phy); bnx2x_power_sfp_module(params, phy, 1); bnx2x_set_gpio_int(bp, (int )gpio_num, 0U, (int )gpio_port); tmp___3 = bnx2x_wait_for_sfp_module_initialized(phy, params); if (tmp___3 == 0) { bnx2x_sfp_module_detection(phy, params); if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_cl45_read(bp, phy, 3, 33605, & rx_tx_in_reset); if ((unsigned int )rx_tx_in_reset == 0U && ((int )params->link_flags & 2) != 0) { bnx2x_warpcore_reset_lane(bp, phy, 1); bnx2x_warpcore_config_sfi(phy, params); bnx2x_warpcore_reset_lane(bp, phy, 0); } else { } } else { } } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SFP+ module is not initialized\n", "bnx2x_handle_module_detect_int", 8805, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } } else { bnx2x_set_gpio_int(bp, (int )gpio_num, 1U, (int )gpio_port); phy->media_type = 255U; } return; } } static void bnx2x_sfp_mask_fault(struct bnx2x *bp , struct bnx2x_phy *phy , u16 alarm_status_offset , u16 alarm_ctrl_offset ) { u16 alarm_status ; u16 val ; { bnx2x_cl45_read(bp, phy, 1, (int )alarm_status_offset, & alarm_status); bnx2x_cl45_read(bp, phy, 1, (int )alarm_status_offset, & alarm_status); bnx2x_cl45_read(bp, phy, 1, (int )alarm_ctrl_offset, & val); if ((int )alarm_status & 1) { val = (unsigned int )val & 65534U; } else { val = (u16 )((unsigned int )val | 1U); } bnx2x_cl45_write(bp, phy, 1, (int )alarm_ctrl_offset, (int )val); return; } } static u8 bnx2x_8706_8726_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u8 link_up ; u16 val1 ; u16 val2 ; u16 rx_sd ; u16 pcs_status ; struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; { link_up = 0U; bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]XGXS 8706/8726\n", "bnx2x_8706_8726_read_status", 8851, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read(bp, phy, 1, 36867, & val2); bnx2x_sfp_mask_fault(bp, phy, 36868, 36865); bnx2x_cl45_read(bp, phy, 1, 36869, & val1); bnx2x_cl45_read(bp, phy, 1, 36869, & val2); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]8706/8726 LASI status 0x%x--> 0x%x\n", "bnx2x_8706_8726_read_status", 8864, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val1, (int )val2); } else { } bnx2x_cl45_read(bp, phy, 1, 10, & rx_sd); bnx2x_cl45_read(bp, phy, 3, 32, & pcs_status); bnx2x_cl45_read(bp, phy, 7, 33540, & val2); bnx2x_cl45_read(bp, phy, 7, 33540, & val2); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]8706/8726 rx_sd 0x%x pcs_status 0x%x 1Gbps link_status 0x%x\n", "bnx2x_8706_8726_read_status", 8876, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )rx_sd, (int )pcs_status, (int )val2); } else { } link_up = (u8 )(((int )rx_sd & (int )pcs_status) & 1 || ((int )val2 & 2) != 0); if ((unsigned int )link_up != 0U) { if (((int )val2 & 2) != 0) { vars->line_speed = 1000U; } else { vars->line_speed = 10000U; } bnx2x_ext_phy_resolve_fc(phy, params, vars); vars->duplex = 1U; } else { } if ((unsigned int )vars->line_speed == 10000U) { bnx2x_cl45_read(bp, phy, 1, 36868, & val1); bnx2x_cl45_read(bp, phy, 1, 36868, & val1); if ((int )val1 & 1) { vars->fault_detected = 1U; } else { } } else { } return (link_up); } } static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u32 tx_en_mode ; u16 cnt ; u16 val ; u16 tmp1 ; struct bnx2x *bp ; long tmp ; u8 i ; u16 reg ; long tmp___0 ; long tmp___1 ; long tmp___2 ; unsigned int tmp___3 ; long tmp___4 ; { bp = params->bp; bnx2x_set_gpio(bp, 2, 1U, (int )params->port); bnx2x_ext_phy_hw_reset(bp, (int )params->port); bnx2x_cl45_write(bp, phy, 1, 0, 41024); bnx2x_wait_reset_complete(bp, phy, params); cnt = 0U; goto ldv_53601; ldv_53600: bnx2x_cl45_read(bp, phy, 1, 51737, & val); if ((unsigned int )val != 0U) { goto ldv_53599; } else { } usleep_range(10000UL, 20000UL); cnt = (u16 )((int )cnt + 1); ldv_53601: ; if ((unsigned int )cnt <= 99U) { goto ldv_53600; } else { } ldv_53599: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]XGXS 8706 is initialized after %d ms\n", "bnx2x_8706_config_init", 8929, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cnt); } else { } if ((int )params->feature_config_flags & 1) { i = 0U; goto ldv_53606; ldv_53605: reg = (unsigned int )((u16 )i) * 16U + 32956U; bnx2x_cl45_read(bp, phy, 4, (int )reg, & val); val = (unsigned int )val & 65528U; val = (u16 )(((int )((short )phy->rx_preemphasis[(int )i]) & 7) | (int )((short )val)); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting RX Equalizer to BCM8706 reg 0x%x <-- val 0x%x\n", "bnx2x_8706_config_init", 8944, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )reg, (int )val); } else { } bnx2x_cl45_write(bp, phy, 4, (int )reg, (int )val); i = (u8 )((int )i + 1); ldv_53606: ; if ((unsigned int )i <= 3U) { goto ldv_53605; } else { } } else { } if ((unsigned int )phy->req_line_speed == 10000U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]XGXS 8706 force 10Gbps\n", "bnx2x_8706_config_init", 8950, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 1, 51208, 1024); bnx2x_cl45_write(bp, phy, 1, 36865, 0); bnx2x_cl45_write(bp, phy, 1, 36866, 3); } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]XGXS 8706 AutoNeg\n", "bnx2x_8706_config_init", 8965, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 7, 33648, 1036); bnx2x_cl45_write(bp, phy, 7, 65509, 32); bnx2x_cl45_write(bp, phy, 7, 65504, 4096); bnx2x_cl45_write(bp, phy, 7, 17, 32); bnx2x_cl45_write(bp, phy, 7, 0, 4608); bnx2x_cl45_write(bp, phy, 1, 36864, 1024); bnx2x_cl45_write(bp, phy, 1, 36866, 4); } bnx2x_save_bcm_spirom_ver(bp, phy, (int )params->port); tmp___3 = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 400UL) + 108UL))); tx_en_mode = tmp___3 & 255U; if (tx_en_mode == 1U) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling TXONOFF_PWRDN_DIS\n", "bnx2x_8706_config_init", 9001, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read(bp, phy, 1, 51208, & tmp1); tmp1 = (u16 )((unsigned int )tmp1 | 1U); bnx2x_cl45_write(bp, phy, 1, 51208, (int )tmp1); } else { } return (0U); } } static int bnx2x_8706_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u8 tmp ; { tmp = bnx2x_8706_8726_read_status(phy, params, vars); return ((int )tmp); } } static void bnx2x_8726_config_loopback(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]PMA/PMD ext_phy_loopback: 8726\n", "bnx2x_8726_config_loopback", 9026, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 1, 0, 1); return; } } static void bnx2x_8726_external_rom_boot(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; { bp = params->bp; msleep(100U); bnx2x_cl45_write(bp, phy, 1, 51728, 395); bnx2x_cl45_write(bp, phy, 1, 51728, 394); bnx2x_cl45_write(bp, phy, 1, 51845, 1); bnx2x_cl45_write(bp, phy, 1, 51728, 392); msleep(150U); bnx2x_cl45_write(bp, phy, 1, 51845, 0); msleep(200U); bnx2x_save_bcm_spirom_ver(bp, phy, (int )params->port); return; } } static u8 bnx2x_8726_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 val1 ; u8 link_up ; u8 tmp ; long tmp___0 ; { bp = params->bp; tmp = bnx2x_8706_8726_read_status(phy, params, vars); link_up = tmp; if ((unsigned int )link_up != 0U) { bnx2x_cl45_read(bp, phy, 1, 51200, & val1); if ((int )((short )val1) < 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Tx is disabled\n", "bnx2x_8726_read_status", 9080, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } link_up = 0U; vars->line_speed = 0U; } else { } } else { } return (link_up); } } static int bnx2x_8726_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Initializing BCM8726\n", "bnx2x_8726_config_init", 9094, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 1, 0, 32768); bnx2x_wait_reset_complete(bp, phy, params); bnx2x_8726_external_rom_boot(phy, params); bnx2x_sfp_module_detection(phy, params); if ((unsigned int )phy->req_line_speed == 1000U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 1G force\n", "bnx2x_8726_config_init", 9109, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 1, 0, 64); bnx2x_cl45_write(bp, phy, 1, 7, 13); bnx2x_cl45_write(bp, phy, 1, 36866, 5); bnx2x_cl45_write(bp, phy, 1, 36864, 1024); } else if (((unsigned int )phy->req_line_speed == 0U && (phy->speed_cap_mask & 1048576U) != 0U) && (phy->speed_cap_mask & 4194304U) == 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 1G clause37\n", "bnx2x_8726_config_init", 9125, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_ext_phy_set_pause(params, phy, vars); bnx2x_cl45_write(bp, phy, 7, 17, 32); bnx2x_cl45_write(bp, phy, 7, 33648, 1036); bnx2x_cl45_write(bp, phy, 7, 65508, 32); bnx2x_cl45_write(bp, phy, 7, 65504, 4096); bnx2x_cl45_write(bp, phy, 7, 0, 4608); bnx2x_cl45_write(bp, phy, 1, 36866, 4); bnx2x_cl45_write(bp, phy, 1, 36864, 1024); } else { bnx2x_cl45_write(bp, phy, 1, 36866, 1); } if ((int )params->feature_config_flags & 1) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting TX_CTRL1 0x%x, TX_CTRL2 0x%x\n", "bnx2x_8726_config_init", 9158, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy->tx_preemphasis[0], (int )phy->tx_preemphasis[1]); } else { } bnx2x_cl45_write(bp, phy, 1, 51713, (int )phy->tx_preemphasis[0]); bnx2x_cl45_write(bp, phy, 1, 51717, (int )phy->tx_preemphasis[1]); } else { } return (0); } } static void bnx2x_8726_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]bnx2x_8726_link_reset port %d\n", "bnx2x_8726_link_reset", 9178, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } bnx2x_cl45_write(bp, phy, 1, 51728, 1); return; } } static void bnx2x_8727_set_link_led(struct bnx2x_phy *phy , struct link_params *params , u8 mode ) { struct bnx2x *bp ; u16 led_mode_bitmask ; u16 gpio_pins_bitmask ; u16 val ; { bp = params->bp; led_mode_bitmask = 0U; gpio_pins_bitmask = 0U; if (((int )phy->flags & 2) == 0) { return; } else { } switch ((int )mode) { case 3: ; case 0: led_mode_bitmask = 0U; gpio_pins_bitmask = 3U; goto ldv_53657; case 1: led_mode_bitmask = 0U; gpio_pins_bitmask = 2U; goto ldv_53657; case 2: led_mode_bitmask = 96U; gpio_pins_bitmask = 17U; goto ldv_53657; } ldv_53657: bnx2x_cl45_read(bp, phy, 1, 51208, & val); val = (unsigned int )val & 65423U; val = (u16 )((int )val | (int )led_mode_bitmask); bnx2x_cl45_write(bp, phy, 1, 51208, (int )val); bnx2x_cl45_read(bp, phy, 1, 51214, & val); val = (unsigned int )val & 65504U; val = (u16 )((int )val | (int )gpio_pins_bitmask); bnx2x_cl45_write(bp, phy, 1, 51214, (int )val); return; } } static void bnx2x_8727_hw_reset(struct bnx2x_phy *phy , struct link_params *params ) { u32 swap_val ; u32 swap_override ; u8 port ; struct bnx2x *bp ; { bp = params->bp; swap_val = readl((void const volatile *)bp->regview + 66452U); swap_override = readl((void const volatile *)bp->regview + 66456U); port = (u8 )((int )((signed char )(swap_val != 0U && swap_override != 0U)) ^ 1); bnx2x_set_gpio(bp, 1, 0U, (int )port); return; } } static void bnx2x_8727_config_speed(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 tmp1 ; u16 val ; long tmp ; long tmp___0 ; long tmp___1 ; { bp = params->bp; if ((unsigned int )phy->req_line_speed == 1000U || phy->media_type == 5U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 1G force\n", "bnx2x_8727_config_speed", 9258, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 1, 0, 64); bnx2x_cl45_write(bp, phy, 1, 7, 13); bnx2x_cl45_read(bp, phy, 1, 7, & tmp1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]1.7 = 0x%x\n", "bnx2x_8727_config_speed", 9265, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tmp1); } else { } if ((unsigned int )params->num_phys == 3U) { bnx2x_cl45_read(bp, phy, 1, 51266, & val); val = (u16 )((unsigned int )val | 3072U); bnx2x_cl45_write(bp, phy, 1, 51266, (int )val); } else { } } else if (((unsigned int )phy->req_line_speed == 0U && (phy->speed_cap_mask & 1048576U) != 0U) && (phy->speed_cap_mask & 4194304U) == 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 1G clause37\n", "bnx2x_8727_config_speed", 9285, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 7, 33545, 0); bnx2x_cl45_write(bp, phy, 7, 65504, 4864); } else { bnx2x_cl45_write(bp, phy, 7, 33545, 32); bnx2x_cl45_write(bp, phy, 7, 65504, 256); bnx2x_cl45_write(bp, phy, 1, 0, 8256); bnx2x_cl45_write(bp, phy, 1, 7, 8); } return; } } static int bnx2x_8727_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u32 tx_en_mode ; u16 tmp1 ; u16 mod_abs ; u16 tmp2 ; struct bnx2x *bp ; long tmp ; long tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; { bp = params->bp; bnx2x_wait_reset_complete(bp, phy, params); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Initializing BCM8727\n", "bnx2x_8727_config_init", 9318, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_8727_specific_func(phy, params, 3U); bnx2x_cl45_read(bp, phy, 1, 51200, & mod_abs); mod_abs = (unsigned int )mod_abs & 65279U; if (((int )phy->flags & 2) == 0) { mod_abs = (unsigned int )mod_abs & 65023U; } else { } bnx2x_cl45_write(bp, phy, 1, 51200, (int )mod_abs); bnx2x_set_disable_pmd_transmit(params, phy, 0); bnx2x_8727_power_module(bp, phy, 1); bnx2x_cl45_read(bp, phy, 1, 51731, & tmp1); bnx2x_cl45_read(bp, phy, 1, 36867, & tmp1); bnx2x_8727_config_speed(phy, params); if ((int )params->feature_config_flags & 1) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting TX_CTRL1 0x%x, TX_CTRL2 0x%x\n", "bnx2x_8727_config_init", 9355, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy->tx_preemphasis[0], (int )phy->tx_preemphasis[1]); } else { } bnx2x_cl45_write(bp, phy, 1, 51714, (int )phy->tx_preemphasis[0]); bnx2x_cl45_write(bp, phy, 1, 51717, (int )phy->tx_preemphasis[1]); } else { } tmp___1 = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 400UL) + 108UL))); tx_en_mode = tmp___1 & 255U; if (tx_en_mode == 1U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling TXONOFF_PWRDN_DIS\n", "bnx2x_8727_config_init", 9375, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read(bp, phy, 1, 51428, & tmp2); tmp2 = (u16 )((unsigned int )tmp2 | 4096U); tmp2 = (unsigned int )tmp2 & 65519U; bnx2x_cl45_write(bp, phy, 1, 51428, (int )tmp2); bnx2x_cl45_read(bp, phy, 1, 51200, & tmp2); bnx2x_cl45_write(bp, phy, 1, 51200, (int )tmp2 & 32767); } else { } return (0); } } static void bnx2x_8727_handle_mod_abs(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 mod_abs ; u16 rx_alarm_status ; u32 val ; unsigned int tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; int tmp___3 ; long tmp___4 ; { bp = params->bp; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 116UL) + 856UL))); val = tmp; bnx2x_cl45_read(bp, phy, 1, 51200, & mod_abs); if (((int )mod_abs & 256) != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]MOD_ABS indication show module is absent\n", "bnx2x_8727_handle_mod_abs", 9409, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } phy->media_type = 255U; mod_abs = (unsigned int )mod_abs & 65279U; if (((int )phy->flags & 2) == 0) { mod_abs = (unsigned int )mod_abs & 65023U; } else { } bnx2x_cl45_write(bp, phy, 1, 51200, (int )mod_abs); bnx2x_cl45_read(bp, phy, 1, 36867, & rx_alarm_status); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]MOD_ABS indication show module is present\n", "bnx2x_8727_handle_mod_abs", 9435, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } mod_abs = (u16 )((unsigned int )mod_abs | 256U); if (((int )phy->flags & 2) == 0) { mod_abs = (u16 )((unsigned int )mod_abs | 512U); } else { } bnx2x_cl45_write(bp, phy, 1, 51200, (int )mod_abs); bnx2x_cl45_read(bp, phy, 1, 36867, & rx_alarm_status); if ((val & 3758096384U) == 536870912U) { bnx2x_sfp_set_transmitter(params, phy, 0); } else { } tmp___3 = bnx2x_wait_for_sfp_module_initialized(phy, params); if (tmp___3 == 0) { bnx2x_sfp_module_detection(phy, params); } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SFP+ module is not initialized\n", "bnx2x_8727_handle_mod_abs", 9467, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } bnx2x_8727_config_speed(phy, params); } tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]8727 RX_ALARM_STATUS 0x%x\n", "bnx2x_8727_handle_mod_abs", 9474, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )rx_alarm_status); } else { } return; } } static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 link_up ; u8 oc_port ; u16 link_status ; u16 rx_alarm_status ; u16 lasi_ctrl ; u16 val1 ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; { bp = params->bp; link_up = 0U; oc_port = params->port; link_status = 0U; bnx2x_cl45_read(bp, phy, 1, 36866, & lasi_ctrl); if ((unsigned int )lasi_ctrl == 0U) { return (0U); } else { } bnx2x_cl45_read(bp, phy, 1, 36867, & rx_alarm_status); vars->line_speed = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]8727 RX_ALARM_STATUS 0x%x\n", "bnx2x_8727_read_status", 9500, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )rx_alarm_status); } else { } bnx2x_sfp_mask_fault(bp, phy, 36868, 36865); bnx2x_cl45_read(bp, phy, 1, 36869, & val1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]8727 LASI status 0x%x\n", "bnx2x_8727_read_status", 9508, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val1); } else { } bnx2x_cl45_read(bp, phy, 1, 51731, & val1); if (((int )phy->flags & 2) == 0 && ((int )rx_alarm_status & 32) == 0) { bnx2x_cl45_read(bp, phy, 1, 51214, & val1); if (((int )val1 & 256) == 0) { if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { oc_port = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U) + (unsigned int )((int )params->port << 1U); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]8727 Power fault has been detected on port %d\n", "bnx2x_8727_read_status", 9528, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )oc_port); } else { } netdev_err((struct net_device const *)bp->dev, "Error: Power fault on Port %d has been detected and the power to that SFP+ module has been removed to prevent failure of the card. Please remove the SFP+ module and restart the system to clear this error.\n", (int )oc_port); bnx2x_cl45_write(bp, phy, 1, 36864, 32); bnx2x_cl45_read(bp, phy, 1, 51200, & val1); val1 = (u16 )((unsigned int )val1 | 256U); bnx2x_cl45_write(bp, phy, 1, 51200, (int )val1); bnx2x_cl45_read(bp, phy, 1, 36867, & rx_alarm_status); bnx2x_8727_power_module(params->bp, phy, 0); return (0U); } else { } } else { } if (((int )rx_alarm_status & 32) != 0) { bnx2x_8727_handle_mod_abs(phy, params); bnx2x_cl45_write(bp, phy, 1, 36864, 36); } else { } if (((int )phy->flags & 128) == 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling 8727 TX laser\n", "bnx2x_8727_read_status", 9569, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_sfp_set_transmitter(params, phy, 1); } else { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Tx is disabled\n", "bnx2x_8727_read_status", 9572, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0U); } bnx2x_cl45_read(bp, phy, 1, 51232, & link_status); if (((int )link_status & 4) != 0 && (int )((short )link_status) >= 0) { link_up = 1U; vars->line_speed = 10000U; tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x: External link up in 10G\n", "bnx2x_8727_read_status", 9587, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } } else if ((int )link_status & 1 && ((int )link_status & 8192) == 0) { link_up = 1U; vars->line_speed = 1000U; tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x: External link up in 1G\n", "bnx2x_8727_read_status", 9592, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } } else { link_up = 0U; tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x: External link is down\n", "bnx2x_8727_read_status", 9596, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->port); } else { } } if ((unsigned int )vars->line_speed == 10000U) { bnx2x_cl45_read(bp, phy, 1, 36868, & val1); bnx2x_cl45_read(bp, phy, 1, 36868, & val1); if ((int )val1 & 1) { vars->fault_detected = 1U; } else { } } else { } if ((unsigned int )link_up != 0U) { bnx2x_ext_phy_resolve_fc(phy, params, vars); vars->duplex = 1U; tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]duplex = 0x%x\n", "bnx2x_8727_read_status", 9615, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->duplex); } else { } } else { } if ((unsigned int )params->num_phys == 3U && (unsigned int )phy->req_line_speed == 1000U) { bnx2x_cl45_read(bp, phy, 1, 51266, & val1); if ((unsigned int )link_up != 0U) { val1 = (unsigned int )val1 & 62463U; } else { val1 = (u16 )((unsigned int )val1 | 3072U); } bnx2x_cl45_write(bp, phy, 1, 51266, (int )val1); } else { } return (link_up); } } static void bnx2x_8727_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; { bp = params->bp; bnx2x_set_disable_pmd_transmit(params, phy, 1); bnx2x_sfp_set_transmitter(params, phy, 0); bnx2x_cl45_write(bp, phy, 1, 36866, 0); return; } } static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy , struct bnx2x *bp , u8 port ) { u16 val ; u16 fw_ver2 ; u16 cnt ; u16 i ; struct bnx2x_reg_set reg_set[5U] ; u16 fw_ver1 ; long tmp ; long tmp___0 ; { reg_set[0].devad = 1U; reg_set[0].reg = 43033U; reg_set[0].val = 20U; reg_set[1].devad = 1U; reg_set[1].reg = 43034U; reg_set[1].val = 49664U; reg_set[2].devad = 1U; reg_set[2].reg = 43035U; reg_set[2].val = 0U; reg_set[3].devad = 1U; reg_set[3].reg = 43036U; reg_set[3].val = 768U; reg_set[4].devad = 1U; reg_set[4].reg = 43031U; reg_set[4].val = 9U; if (phy->type == 3328U || phy->type == 4352U) { bnx2x_cl45_read(bp, phy, 30, 16399, & fw_ver1); bnx2x_save_spirom_version(bp, (int )port, (u32 )fw_ver1 & 4095U, phy->ver_addr); } else { i = 0U; goto ldv_53728; ldv_53727: bnx2x_cl45_write(bp, phy, (int )reg_set[(int )i].devad, (int )reg_set[(int )i].reg, (int )reg_set[(int )i].val); i = (u16 )((int )i + 1); ldv_53728: ; if ((unsigned int )i <= 4U) { goto ldv_53727; } else { } cnt = 0U; goto ldv_53732; ldv_53731: bnx2x_cl45_read(bp, phy, 1, 43032, & val); if ((int )val & 1) { goto ldv_53730; } else { } __const_udelay(21475UL); cnt = (u16 )((int )cnt + 1); ldv_53732: ; if ((unsigned int )cnt <= 99U) { goto ldv_53731; } else { } ldv_53730: ; if ((unsigned int )cnt == 100U) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unable to read 848xx phy fw version(1)\n", "bnx2x_save_848xx_spirom_version", 9689, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_save_spirom_version(bp, (int )port, 0U, phy->ver_addr); return; } else { } bnx2x_cl45_write(bp, phy, 1, 43033, 0); bnx2x_cl45_write(bp, phy, 1, 43034, 49664); bnx2x_cl45_write(bp, phy, 1, 43031, 10); cnt = 0U; goto ldv_53736; ldv_53735: bnx2x_cl45_read(bp, phy, 1, 43032, & val); if ((int )val & 1) { goto ldv_53734; } else { } __const_udelay(21475UL); cnt = (u16 )((int )cnt + 1); ldv_53736: ; if ((unsigned int )cnt <= 99U) { goto ldv_53735; } else { } ldv_53734: ; if ((unsigned int )cnt == 100U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unable to read 848xx phy fw version(2)\n", "bnx2x_save_848xx_spirom_version", 9708, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_save_spirom_version(bp, (int )port, 0U, phy->ver_addr); return; } else { } bnx2x_cl45_read(bp, phy, 1, 43035, & fw_ver1); bnx2x_cl45_read(bp, phy, 1, 43036, & fw_ver2); bnx2x_save_spirom_version(bp, (int )port, (u32 )(((int )fw_ver2 << 16) | (int )fw_ver1), phy->ver_addr); } return; } } static void bnx2x_848xx_set_led(struct bnx2x *bp , struct bnx2x_phy *phy ) { u16 val ; u16 offset ; u16 i ; struct bnx2x_reg_set reg_set[6U] ; { reg_set[0].devad = 1U; reg_set[0].reg = 43052U; reg_set[0].val = 128U; reg_set[1].devad = 1U; reg_set[1].reg = 43055U; reg_set[1].val = 24U; reg_set[2].devad = 1U; reg_set[2].reg = 43058U; reg_set[2].val = 6U; reg_set[3].devad = 1U; reg_set[3].reg = 43060U; reg_set[3].val = 0U; reg_set[4].devad = 1U; reg_set[4].reg = 43051U; reg_set[4].val = 47U; reg_set[5].devad = 7U; reg_set[5].reg = 65531U; reg_set[5].val = 65533U; bnx2x_cl45_read(bp, phy, 1, 43067, & val); val = (unsigned int )val & 65024U; val = (u16 )((unsigned int )val | 146U); bnx2x_cl45_write(bp, phy, 1, 43067, (int )val); i = 0U; goto ldv_53748; ldv_53747: bnx2x_cl45_write(bp, phy, (int )reg_set[(int )i].devad, (int )reg_set[(int )i].reg, (int )reg_set[(int )i].val); i = (u16 )((int )i + 1); ldv_53748: ; if ((unsigned int )i <= 5U) { goto ldv_53747; } else { } if (phy->type == 3328U || phy->type == 4352U) { offset = 43244U; } else { offset = 43235U; } bnx2x_cl45_read_or_write(bp, phy, 1, (int )offset, 128); return; } } static void bnx2x_848xx_specific_func(struct bnx2x_phy *phy , struct link_params *params , u32 action ) { struct bnx2x *bp ; { bp = params->bp; switch (action) { case 3U: ; if (phy->type != 3328U && phy->type != 4352U) { bnx2x_save_848xx_spirom_version(phy, bp, (int )params->port); } else { } bnx2x_bits_en(bp, (u32 )(((int )params->port + 22660) * 4), 1U); bnx2x_848xx_set_led(bp, phy); goto ldv_53757; } ldv_53757: ; return; } } static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 autoneg_val ; u16 an_1000_val ; u16 an_10_100_val ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { bp = params->bp; bnx2x_848xx_specific_func(phy, params, 3U); bnx2x_cl45_write(bp, phy, 1, 0, 0); bnx2x_cl45_read(bp, phy, 7, 65513, & an_1000_val); bnx2x_ext_phy_set_pause(params, phy, vars); bnx2x_cl45_read(bp, phy, 7, 65508, & an_10_100_val); bnx2x_cl45_read(bp, phy, 7, 65504, & autoneg_val); autoneg_val = (unsigned int )autoneg_val & 52415U; an_10_100_val = (unsigned int )an_10_100_val & 65055U; if (((unsigned int )phy->req_line_speed == 0U && (phy->speed_cap_mask & 1048576U) != 0U) || (unsigned int )phy->req_line_speed == 1000U) { an_1000_val = (u16 )((unsigned int )an_1000_val | 256U); autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); if ((unsigned int )phy->req_duplex == 1U) { an_1000_val = (u16 )((unsigned int )an_1000_val | 512U); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 1G\n", "bnx2x_848xx_cmn_config_init", 9824, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { an_1000_val = (unsigned int )an_1000_val & 64767U; } bnx2x_cl45_write(bp, phy, 7, 65513, (int )an_1000_val); if ((unsigned int )phy->req_line_speed == 0U) { if ((phy->speed_cap_mask & 524288U) != 0U) { autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); an_10_100_val = (u16 )((unsigned int )an_10_100_val | 256U); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 100M-FD\n", "bnx2x_848xx_cmn_config_init", 9840, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((phy->speed_cap_mask & 262144U) != 0U) { autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); an_10_100_val = (u16 )((unsigned int )an_10_100_val | 128U); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 100M-HD\n", "bnx2x_848xx_cmn_config_init", 9849, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((phy->speed_cap_mask & 65536U) != 0U && (phy->supported & 2U) != 0U) { an_10_100_val = (u16 )((unsigned int )an_10_100_val | 64U); autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 10M-FD\n", "bnx2x_848xx_cmn_config_init", 9857, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((phy->speed_cap_mask & 131072U) != 0U && (int )phy->supported & 1) { an_10_100_val = (u16 )((unsigned int )an_10_100_val | 32U); autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 10M-HD\n", "bnx2x_848xx_cmn_config_init", 9865, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { } if ((unsigned int )phy->req_line_speed == 100U && (phy->supported & 12U) != 0U) { autoneg_val = (u16 )((unsigned int )autoneg_val | 8192U); bnx2x_cl45_write(bp, phy, 7, 65528, 33287); an_10_100_val = (u16 )((unsigned int )an_10_100_val | 384U); tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 100M force\n", "bnx2x_848xx_cmn_config_init", 9881, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((unsigned int )phy->req_line_speed == 10U && (phy->supported & 3U) != 0U) { bnx2x_cl45_write(bp, phy, 7, 65528, 33287); tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 10M force\n", "bnx2x_848xx_cmn_config_init", 9891, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } bnx2x_cl45_write(bp, phy, 7, 65508, (int )an_10_100_val); if ((unsigned int )phy->req_duplex == 1U) { autoneg_val = (u16 )((unsigned int )autoneg_val | 256U); } else { } if ((phy->type != 3328U && phy->type != 4352U) || ((int )autoneg_val & 4096) == 0) { bnx2x_cl45_write(bp, phy, 7, 65504, (int )autoneg_val); } else { } if (((unsigned int )phy->req_line_speed == 0U && (phy->speed_cap_mask & 4194304U) != 0U) || (unsigned int )phy->req_line_speed == 10000U) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 10G\n", "bnx2x_848xx_cmn_config_init", 9915, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_read_or_write(bp, phy, 7, 32, 4096); bnx2x_cl45_write(bp, phy, 7, 0, 12800); } else { bnx2x_cl45_write(bp, phy, 7, 32, 1); } return (0); } } static int bnx2x_8481_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; int tmp ; { bp = params->bp; bnx2x_set_gpio(bp, 2, 1U, (int )params->port); bnx2x_ext_phy_hw_reset(bp, (int )params->port); bnx2x_wait_reset_complete(bp, phy, params); bnx2x_cl45_write(bp, phy, 1, 0, 32768); tmp = bnx2x_848xx_cmn_config_init(phy, params, vars); return (tmp); } } static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy , struct link_params *params , u16 fw_cmd , u16 *cmd_args , int argc ) { int idx ; u16 val ; struct bnx2x *bp ; long tmp ; long tmp___0 ; { bp = params->bp; bnx2x_cl45_write(bp, phy, 30, 16439, 42405); idx = 0; goto ldv_53786; ldv_53785: bnx2x_cl45_read(bp, phy, 30, 16439, & val); if ((unsigned int )val == 16U) { goto ldv_53784; } else { } usleep_range(1000UL, 2000UL); idx = idx + 1; ldv_53786: ; if (idx <= 299) { goto ldv_53785; } else { } ldv_53784: ; if (idx > 299) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]FW cmd: FW not ready.\n", "bnx2x_84833_cmd_hdlr", 9973, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } idx = 0; goto ldv_53789; ldv_53788: bnx2x_cl45_write(bp, phy, 30, (int )((unsigned int )((u16 )idx) + 16440U), (int )*(cmd_args + (unsigned long )idx)); idx = idx + 1; ldv_53789: ; if (idx < argc) { goto ldv_53788; } else { } bnx2x_cl45_write(bp, phy, 30, 16389, (int )fw_cmd); idx = 0; goto ldv_53793; ldv_53792: bnx2x_cl45_read(bp, phy, 30, 16439, & val); if ((unsigned int )val == 4U || (unsigned int )val == 8U) { goto ldv_53791; } else { } usleep_range(1000UL, 2000UL); idx = idx + 1; ldv_53793: ; if (idx <= 299) { goto ldv_53792; } else { } ldv_53791: ; if (idx > 299 || (unsigned int )val == 8U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]FW cmd failed.\n", "bnx2x_84833_cmd_hdlr", 9995, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } idx = 0; goto ldv_53795; ldv_53794: bnx2x_cl45_read(bp, phy, 30, (int )((unsigned int )((u16 )idx) + 16440U), cmd_args + (unsigned long )idx); idx = idx + 1; ldv_53795: ; if (idx < argc) { goto ldv_53794; } else { } bnx2x_cl45_write(bp, phy, 30, 16439, 128); return (0); } } static int bnx2x_84833_pair_swap_cfg(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u32 pair_swap ; u16 data[5U] ; int status ; struct bnx2x *bp ; unsigned int tmp ; long tmp___0 ; { bp = params->bp; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 400UL) + 396UL))); pair_swap = tmp & 255U; if (pair_swap == 0U) { return (0); } else { } data[1] = (unsigned short )pair_swap; status = bnx2x_84833_cmd_hdlr(phy, params, 32769, (u16 *)(& data), 5); if (status == 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Pairswap OK, val=0x%x\n", "bnx2x_84833_pair_swap_cfg", 10034, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )data[1]); } else { } } else { } return (status); } } static u8 bnx2x_84833_get_reset_gpios(struct bnx2x *bp , u32 *shmem_base_path , u32 chip_id ) { u32 reset_pin[2U] ; u32 idx ; u8 reset_gpios ; { if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { idx = 0U; goto ldv_53816; ldv_53815: reset_pin[idx] = readl((void const volatile *)(bp->regview + ((unsigned long )*(shmem_base_path + (unsigned long )idx) + 116UL))); reset_pin[idx] = (reset_pin[idx] & 65280U) >> 8; reset_pin[idx] = reset_pin[idx] - 1U; reset_pin[idx] = (u32 )(1 << (int )reset_pin[idx]); idx = idx + 1U; ldv_53816: ; if (idx <= 1U) { goto ldv_53815; } else { } reset_gpios = (int )((unsigned char )reset_pin[0]) | (int )((unsigned char )reset_pin[1]); } else { idx = 0U; goto ldv_53819; ldv_53818: reset_pin[idx] = readl((void const volatile *)(bp->regview + ((unsigned long )*(shmem_base_path + (unsigned long )idx) + 400UL))); reset_pin[idx] = reset_pin[idx] & 983040U; reset_pin[idx] = reset_pin[idx] - 65536U; reset_pin[idx] = reset_pin[idx] >> 16; reset_pin[idx] = (u32 )(1 << (int )reset_pin[idx]); idx = idx + 1U; ldv_53819: ; if (idx <= 1U) { goto ldv_53818; } else { } reset_gpios = (int )((unsigned char )reset_pin[0]) | (int )((unsigned char )reset_pin[1]); } return (reset_gpios); } } static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u8 reset_gpios ; u32 other_shmem_base_addr ; unsigned int tmp ; u32 shmem_base_path[2U] ; long tmp___0 ; { bp = params->bp; tmp = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem2_base + 52UL))); other_shmem_base_addr = tmp; bnx2x_cl45_write(bp, phy, 7, 65504, 64); bnx2x_cl45_write(bp, phy, 7, 65520, 8); shmem_base_path[0] = params->shmem_base; shmem_base_path[1] = other_shmem_base_addr; reset_gpios = bnx2x_84833_get_reset_gpios(bp, (u32 *)(& shmem_base_path), params->chip_id); bnx2x_set_mult_gpio(bp, (int )reset_gpios, 0U); __const_udelay(42950UL); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]84833 hw reset on pin values 0x%x\n", "bnx2x_84833_hw_reset_phy", 10105, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )reset_gpios); } else { } return (0); } } static int bnx2x_8483x_disable_eee(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { int rc ; struct bnx2x *bp ; u16 cmd_args ; long tmp ; long tmp___0 ; int tmp___1 ; { bp = params->bp; cmd_args = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Don\'t Advertise 10GBase-T EEE\n", "bnx2x_8483x_disable_eee", 10118, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = bnx2x_84833_cmd_hdlr(phy, params, 32777, & cmd_args, 1); if (rc != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]EEE disable failed.\n", "bnx2x_8483x_disable_eee", 10124, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (rc); } else { } tmp___1 = bnx2x_eee_disable(phy, params, vars); return (tmp___1); } } static int bnx2x_8483x_enable_eee(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { int rc ; struct bnx2x *bp ; u16 cmd_args ; long tmp ; int tmp___0 ; { bp = params->bp; cmd_args = 1U; rc = bnx2x_84833_cmd_hdlr(phy, params, 32777, & cmd_args, 1); if (rc != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]EEE enable failed.\n", "bnx2x_8483x_enable_eee", 10142, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (rc); } else { } tmp___0 = bnx2x_eee_advertise(phy, params, vars, 4); return (tmp___0); } } static int bnx2x_848x3_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 port ; u8 initialize ; u16 val ; u32 actual_phy_selection ; u16 cmd_args[5U] ; int rc ; u16 temp ; long tmp ; long tmp___0 ; u32 cms_enable ; unsigned int tmp___1 ; long tmp___2 ; u32 tmp___3 ; long tmp___4 ; u8 tmp___5 ; { bp = params->bp; initialize = 1U; rc = 0; usleep_range(1000UL, 2000UL); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { port = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; } else { port = params->port; } if (phy->type == 2816U) { bnx2x_set_gpio(bp, 3, 1U, (int )port); } else { bnx2x_cl45_write(bp, phy, 1, 0, 32768); } bnx2x_wait_reset_complete(bp, phy, params); msleep(50U); if (phy->type != 3328U && phy->type != 4352U) { temp = vars->line_speed; vars->line_speed = 10000U; bnx2x_set_autoneg((struct bnx2x_phy *)(& params->phy), params, vars, 0); bnx2x_program_serdes((struct bnx2x_phy *)(& params->phy), params, vars); vars->line_speed = temp; } else { } bnx2x_cl45_read(bp, phy, 30, 16410, & val); val = (unsigned int )val & 60935U; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { val = (unsigned int )val & 65415U; } else { val = (u16 )((unsigned int )val | 40U); } actual_phy_selection = bnx2x_phy_selection(params); switch (actual_phy_selection) { case 0U: ; goto ldv_53862; case 3U: val = val; goto ldv_53862; case 4U: val = (u16 )((unsigned int )val | 256U); goto ldv_53862; case 1U: ; goto ldv_53862; case 2U: val = (u16 )((unsigned int )val | 128U); initialize = 0U; goto ldv_53862; } ldv_53862: ; if ((unsigned int )params->phy[2].req_line_speed == 1000U) { val = (u16 )((unsigned int )val | 4096U); } else { } bnx2x_cl45_write(bp, phy, 30, 16410, (int )val); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Multi_phy config = 0x%x, Media control = 0x%x\n", "bnx2x_848x3_config_init", 10238, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", params->multi_phy_config, (int )val); } else { } if (phy->type == 3328U || phy->type == 4352U) { bnx2x_84833_pair_swap_cfg(phy, params, vars); cmd_args[0] = 0U; cmd_args[1] = 0U; cmd_args[2] = 1194U; cmd_args[3] = 1193U; rc = bnx2x_84833_cmd_hdlr(phy, params, 32777, (u16 *)(& cmd_args), 5); if (rc != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Cfg AutogrEEEn failed.\n", "bnx2x_848x3_config_init", 10253, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { } if ((unsigned int )initialize != 0U) { rc = bnx2x_848xx_cmn_config_init(phy, params, vars); } else { bnx2x_save_848xx_spirom_version(phy, bp, (int )params->port); } if (phy->type == 2816U) { tmp___1 = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem_base + ((unsigned long )params->port + 1UL) * 400UL))); cms_enable = tmp___1 & 2097152U; bnx2x_cl45_read(bp, phy, 30, 16389, & val); if (cms_enable != 0U) { val = (u16 )((unsigned int )val | 128U); } else { val = (unsigned int )val & 65407U; } bnx2x_cl45_write(bp, phy, 30, 16389, (int )val); } else { } bnx2x_cl45_read(bp, phy, 30, 16399, & val); if ((unsigned int )val > 4272U && (unsigned int )val != 8065U) { tmp___5 = bnx2x_eee_has_cap(params); if ((unsigned int )tmp___5 != 0U) { rc = bnx2x_eee_initial_config(params, vars, 4); if (rc != 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to configure EEE timers\n", "bnx2x_848x3_config_init", 10285, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_8483x_disable_eee(phy, params, vars); return (rc); } else { } if ((unsigned int )phy->req_duplex == 1U && (int )params->eee_mode < 0) { tmp___3 = bnx2x_eee_calc_timer(params); if (tmp___3 != 0U || (params->eee_mode & 1073741824U) == 0U) { rc = bnx2x_8483x_enable_eee(phy, params, vars); } else { rc = bnx2x_8483x_disable_eee(phy, params, vars); } } else { rc = bnx2x_8483x_disable_eee(phy, params, vars); } if (rc != 0) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to set EEE advertisement\n", "bnx2x_848x3_config_init", 10298, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (rc); } else { } } else { vars->eee_status = vars->eee_status & 4293984255U; } } else { vars->eee_status = vars->eee_status & 4293984255U; } if (phy->type == 3328U || phy->type == 4352U) { bnx2x_cl45_read_and_write(bp, phy, 30, 16410, 32767); } else { } return (rc); } } static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 val ; u16 val1 ; u16 val2 ; u8 link_up ; long tmp ; u16 legacy_status ; u16 legacy_speed ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { bp = params->bp; link_up = 0U; bnx2x_cl45_read(bp, phy, 7, 65530, & val1); bnx2x_cl45_read(bp, phy, 1, 43025, & val2); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]BCM848xx: PMD_SIGNAL 1.a811 = 0x%x\n", "bnx2x_848xx_read_status", 10332, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val2); } else { } if (((int )val2 & 2048) != 0) { vars->line_speed = 10000U; vars->duplex = 1U; link_up = 1U; bnx2x_ext_phy_10G_an_resolve(bp, phy, vars); } else { bnx2x_cl45_write(bp, phy, 7, 65527, 3906); bnx2x_cl45_read(bp, phy, 7, 65525, & legacy_status); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Legacy speed status = 0x%x\n", "bnx2x_848xx_read_status", 10355, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )legacy_status); } else { } link_up = ((int )legacy_status & 2048) != 0; legacy_speed = (unsigned int )legacy_status & 1536U; if ((unsigned int )legacy_speed == 0U) { vars->line_speed = 10U; } else if ((unsigned int )legacy_speed == 512U) { vars->line_speed = 100U; } else if ((unsigned int )legacy_speed == 1024U) { vars->line_speed = 1000U; } else { vars->line_speed = 0U; link_up = 0U; } if ((unsigned int )link_up != 0U) { if (((int )legacy_status & 256) != 0) { vars->duplex = 1U; } else { vars->duplex = 0U; } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Link is up in %dMbps, is_duplex_full= %d\n", "bnx2x_848xx_read_status", 10378, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed, (unsigned int )vars->duplex == 1U); } else { } bnx2x_cl45_read(bp, phy, 7, 65505, & val); if (((int )val & 32) != 0) { vars->link_status = vars->link_status | 64U; } else { } bnx2x_cl45_read(bp, phy, 7, 65510, & val); if (((int )val & 1) == 0) { vars->link_status = vars->link_status | 128U; } else { } } else { } } if ((unsigned int )link_up != 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BCM848x3: link speed is %d\n", "bnx2x_848xx_read_status", 10398, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed); } else { } bnx2x_ext_phy_resolve_fc(phy, params, vars); bnx2x_cl45_read(bp, phy, 7, 65509, & val); if (((int )val & 32) != 0) { vars->link_status = vars->link_status | 32768U; } else { } if (((int )val & 64) != 0) { vars->link_status = vars->link_status | 16384U; } else { } if (((int )val & 128) != 0) { vars->link_status = vars->link_status | 8192U; } else { } if (((int )val & 256) != 0) { vars->link_status = vars->link_status | 4096U; } else { } if (((int )val & 512) != 0) { vars->link_status = vars->link_status | 2048U; } else { } bnx2x_cl45_read(bp, phy, 7, 65514, & val); if (((int )val & 1024) != 0) { vars->link_status = vars->link_status | 1024U; } else { } if (((int )val & 2048) != 0) { vars->link_status = vars->link_status | 512U; } else { } bnx2x_cl45_read(bp, phy, 7, 33, & val); if (((int )val & 2048) != 0) { vars->link_status = vars->link_status | 8388608U; } else { } if (phy->type == 3328U || phy->type == 4352U) { bnx2x_eee_an_resolve(phy, params, vars); } else { } } else { } return (link_up); } } static int bnx2x_848xx_format_ver(u32 raw_ver , u8 *str , u16 *len ) { int status ; u32 spirom_ver ; { status = 0; spirom_ver = (((raw_ver & 3968U) >> 7) << 16) | (raw_ver & 127U); status = bnx2x_format_ver(spirom_ver, str, len); return (status); } } static void bnx2x_8481_hw_reset(struct bnx2x_phy *phy , struct link_params *params ) { { bnx2x_set_gpio(params->bp, 1, 0U, 0); bnx2x_set_gpio(params->bp, 1, 0U, 1); return; } } static void bnx2x_8481_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { { bnx2x_cl45_write(params->bp, phy, 7, 0, 0); bnx2x_cl45_write(params->bp, phy, 1, 0, 1); return; } } static void bnx2x_848x3_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u8 port ; u16 val16 ; { bp = params->bp; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { port = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; } else { port = params->port; } if (phy->type == 2816U) { bnx2x_set_gpio(bp, 3, 0U, (int )port); } else { bnx2x_cl45_read(bp, phy, 30, 16410, & val16); val16 = (u16 )((unsigned int )val16 | 32768U); bnx2x_cl45_write(bp, phy, 30, 16410, (int )val16); } return; } } static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy , struct link_params *params , u8 mode ) { struct bnx2x *bp ; u16 val ; u8 port ; long tmp ; long tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; unsigned int tmp___3 ; long tmp___4 ; long tmp___5 ; { bp = params->bp; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { port = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; } else { port = params->port; } switch ((int )mode) { case 0: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Port 0x%x: LED MODE OFF\n", "bnx2x_848xx_set_link_led", 10515, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port); } else { } if ((int )params->hw_led_mode << 16 == 917504) { bnx2x_cl45_write(bp, phy, 1, 43052, 0); bnx2x_cl45_write(bp, phy, 1, 43055, 0); bnx2x_cl45_write(bp, phy, 1, 43058, 0); bnx2x_cl45_write(bp, phy, 1, 43064, 0); } else { bnx2x_cl45_write(bp, phy, 1, 43052, 0); } goto ldv_53914; case 3: tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Port 0x%x: LED MODE FRONT PANEL OFF\n", "bnx2x_848xx_set_link_led", 10551, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port); } else { } if ((int )params->hw_led_mode << 16 == 917504) { bnx2x_cl45_write(bp, phy, 1, 43052, 0); bnx2x_cl45_write(bp, phy, 1, 43055, 0); bnx2x_cl45_write(bp, phy, 1, 43058, 0); bnx2x_cl45_write(bp, phy, 1, 43064, 32); } else { bnx2x_cl45_write(bp, phy, 1, 43052, 0); if (phy->type == 4352U) { tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )(((int )params->port + 16588) * 4)); if ((int )tmp___1 & 1) { params->link_flags = (u16 )((unsigned int )params->link_flags | 1U); bnx2x_bits_dis(bp, (u32 )(((int )params->port + 16588) * 4), 1U); } else { } bnx2x_cl45_write(bp, phy, 1, 43061, 0); } else { } } goto ldv_53914; case 1: tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Port 0x%x: LED MODE ON\n", "bnx2x_848xx_set_link_led", 10608, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port); } else { } if ((int )params->hw_led_mode << 16 == 917504) { bnx2x_cl45_read(bp, phy, 1, 43067, & val); val = (unsigned int )val & 32768U; val = (u16 )((unsigned int )val | 9362U); bnx2x_cl45_write(bp, phy, 1, 43067, (int )val); bnx2x_cl45_write(bp, phy, 1, 43052, 0); bnx2x_cl45_write(bp, phy, 1, 43055, 32); bnx2x_cl45_write(bp, phy, 1, 43058, 32); bnx2x_cl45_write(bp, phy, 1, 43064, 0); } else { bnx2x_cl45_write(bp, phy, 1, 43052, 32); if (phy->type == 4352U) { tmp___3 = readl((void const volatile *)bp->regview + (unsigned long )(((int )params->port + 16588) * 4)); if ((int )tmp___3 & 1) { params->link_flags = (u16 )((unsigned int )params->link_flags | 1U); bnx2x_bits_dis(bp, (u32 )(((int )params->port + 16588) * 4), 1U); } else { } bnx2x_cl45_write(bp, phy, 1, 43061, 32); } else { } } goto ldv_53914; case 2: tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Port 0x%x: LED MODE OPER\n", "bnx2x_848xx_set_link_led", 10677, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port); } else { } if ((int )params->hw_led_mode << 16 == 917504) { bnx2x_cl45_read(bp, phy, 1, 43067, & val); if (((int )val & 2048) >> 11 == 0) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting LINK_SIGNAL\n", "bnx2x_848xx_set_link_led", 10691, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 1, 43067, 42130); } else { } bnx2x_cl45_write(bp, phy, 1, 43052, 16); bnx2x_cl45_write(bp, phy, 1, 43055, 128); bnx2x_cl45_write(bp, phy, 1, 43058, 152); bnx2x_cl45_write(bp, phy, 1, 43064, 64); } else { val = (int )params->hw_led_mode << 16 == 983040 ? 152U : 128U; bnx2x_cl45_write(bp, phy, 1, 43052, (int )val); bnx2x_cl45_read(bp, phy, 1, 43067, & val); val = (unsigned int )val & 65087U; val = (u16 )((unsigned int )val | 64U); bnx2x_cl45_write(bp, phy, 1, 43067, (int )val); if (phy->type == 4352U) { bnx2x_cl45_write(bp, phy, 1, 43061, 64); if ((int )params->link_flags & 1) { bnx2x_link_int_enable(params); params->link_flags = (unsigned int )params->link_flags & 65534U; } else { } } else { } } goto ldv_53914; } ldv_53914: ; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_cl45_read(bp, phy, 3, 33233, & val); } else { } return; } } static void bnx2x_54618se_specific_func(struct bnx2x_phy *phy , struct link_params *params , u32 action ) { struct bnx2x *bp ; u16 temp ; { bp = params->bp; switch (action) { case 3U: bnx2x_cl22_write(bp, phy, 28, 14336); bnx2x_cl22_read(bp, phy, 28, & temp); temp = (unsigned int )temp & 65295U; temp = (u16 )((unsigned int )temp | 96U); bnx2x_cl22_write(bp, phy, 28, (int )((unsigned int )temp | 32768U)); bnx2x_cl22_write(bp, phy, 27, 65533); goto ldv_53926; } ldv_53926: ; return; } } static int bnx2x_54618se_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 port ; u16 autoneg_val ; u16 an_1000_val ; u16 an_10_100_val ; u16 fc_val ; u16 temp ; u32 cfg_pin ; long tmp ; unsigned int tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; int rc ; long tmp___8 ; long tmp___9 ; u32 tmp___10 ; long tmp___11 ; long tmp___12 ; u8 tmp___13 ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]54618SE cfg init\n", "bnx2x_54618se_config_init", 10814, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } usleep_range(1000UL, 2000UL); port = params->port; tmp___0 = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 400UL) + 116UL))); cfg_pin = (tmp___0 & 65280U) >> 8; bnx2x_set_cfg_pin(bp, cfg_pin, 1U); msleep(50U); bnx2x_cl22_write(bp, phy, 0, 32768); bnx2x_wait_reset_complete(bp, phy, params); msleep(50U); bnx2x_54618se_specific_func(phy, params, 3U); bnx2x_cl22_write(bp, phy, 28, 30720); bnx2x_cl22_read(bp, phy, 28, & temp); temp = (u16 )((unsigned int )temp | 256U); bnx2x_cl22_write(bp, phy, 28, (int )((unsigned int )temp | 32768U)); bnx2x_calc_ieee_aneg_adv(phy, params, & vars->ieee_fc); fc_val = 0U; if (((int )vars->ieee_fc & 256) != 0) { fc_val = (u16 )((unsigned int )fc_val | 2048U); } else { } if (((int )vars->ieee_fc & 384) == 384) { fc_val = (u16 )((unsigned int )fc_val | 1024U); } else { } bnx2x_cl22_read(bp, phy, 9, & an_1000_val); bnx2x_cl22_read(bp, phy, 4, & an_10_100_val); bnx2x_cl22_read(bp, phy, 0, & autoneg_val); autoneg_val = (unsigned int )autoneg_val & 52415U; an_10_100_val = (unsigned int )an_10_100_val & 61983U; if (((unsigned int )phy->req_line_speed == 0U && (phy->speed_cap_mask & 1048576U) != 0U) || (unsigned int )phy->req_line_speed == 1000U) { an_1000_val = (u16 )((unsigned int )an_1000_val | 256U); autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); if ((unsigned int )phy->req_duplex == 1U) { an_1000_val = (u16 )((unsigned int )an_1000_val | 512U); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 1G\n", "bnx2x_54618se_config_init", 10894, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { an_1000_val = (unsigned int )an_1000_val & 64767U; } bnx2x_cl22_write(bp, phy, 9, (int )an_1000_val); bnx2x_cl22_read(bp, phy, 9, & an_1000_val); if ((unsigned int )phy->req_line_speed == 0U) { if ((phy->speed_cap_mask & 131072U) != 0U) { an_10_100_val = (u16 )((unsigned int )an_10_100_val | 32U); autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 10M-HD\n", "bnx2x_54618se_config_init", 10911, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((phy->speed_cap_mask & 65536U) != 0U) { an_10_100_val = (u16 )((unsigned int )an_10_100_val | 64U); autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 10M-FD\n", "bnx2x_54618se_config_init", 10917, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((phy->speed_cap_mask & 262144U) != 0U) { an_10_100_val = (u16 )((unsigned int )an_10_100_val | 128U); autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); tmp___4 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 100M-HD\n", "bnx2x_54618se_config_init", 10923, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((phy->speed_cap_mask & 524288U) != 0U) { an_10_100_val = (u16 )((unsigned int )an_10_100_val | 256U); autoneg_val = (u16 )((unsigned int )autoneg_val | 4608U); tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertising 100M-FD\n", "bnx2x_54618se_config_init", 10929, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { } if ((unsigned int )phy->req_line_speed == 100U) { autoneg_val = (u16 )((unsigned int )autoneg_val | 8192U); bnx2x_cl22_write(bp, phy, 24, 33287); tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 100M force\n", "bnx2x_54618se_config_init", 10940, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((unsigned int )phy->req_line_speed == 10U) { bnx2x_cl22_write(bp, phy, 24, 33287); tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting 10M force\n", "bnx2x_54618se_config_init", 10947, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if (((int )phy->flags & 8192) != 0) { tmp___13 = bnx2x_eee_has_cap(params); if ((unsigned int )tmp___13 != 0U) { bnx2x_cl22_write(bp, phy, 23, 3392); bnx2x_cl22_read(bp, phy, 21, & temp); temp = (unsigned int )temp & 65534U; bnx2x_cl22_write(bp, phy, 21, (int )temp); rc = bnx2x_eee_initial_config(params, vars, 2); if (rc != 0) { tmp___8 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to configure EEE timers\n", "bnx2x_54618se_config_init", 10962, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_eee_disable(phy, params, vars); } else if ((int )params->eee_mode < 0 && (unsigned int )phy->req_duplex == 1U) { tmp___10 = bnx2x_eee_calc_timer(params); if (tmp___10 != 0U || (params->eee_mode & 1073741824U) == 0U) { bnx2x_eee_advertise(phy, params, vars, 2); } else { goto _L; } } else { _L: /* CIL Label */ tmp___9 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Don\'t Advertise 1GBase-T EEE\n", "bnx2x_54618se_config_init", 10976, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_eee_disable(phy, params, vars); } } else { goto _L___0; } } else { _L___0: /* CIL Label */ vars->eee_status = vars->eee_status & 4294770688U; if (((int )phy->flags & 8192) != 0) { if ((params->feature_config_flags & 512U) != 0U) { temp = 6U; tmp___11 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Enabling Auto-GrEEEn\n", "bnx2x_54618se_config_init", 10988, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { temp = 0U; tmp___12 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___12 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Don\'t Adv. EEE\n", "bnx2x_54618se_config_init", 10991, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } bnx2x_cl45_write(bp, phy, 7, 60, (int )temp); } else { } } bnx2x_cl22_write(bp, phy, 4, (int )an_10_100_val | (int )fc_val); if ((unsigned int )phy->req_duplex == 1U) { autoneg_val = (u16 )((unsigned int )autoneg_val | 256U); } else { } bnx2x_cl22_write(bp, phy, 0, (int )autoneg_val); return (0); } } static void bnx2x_5461x_set_link_led(struct bnx2x_phy *phy , struct link_params *params , u8 mode ) { struct bnx2x *bp ; u16 temp ; long tmp ; { bp = params->bp; bnx2x_cl22_write(bp, phy, 28, 13312); bnx2x_cl22_read(bp, phy, 28, & temp); temp = (unsigned int )temp & 65280U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]54618x set link led (mode=%x)\n", "bnx2x_5461x_set_link_led", 11026, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )mode); } else { } switch ((int )mode) { case 3: ; case 0: temp = (u16 )((unsigned int )temp | 238U); goto ldv_53952; case 2: temp = (u16 )((unsigned int )temp | 1U); goto ldv_53952; case 1: temp = (u16 )((unsigned int )temp | 255U); goto ldv_53952; default: ; goto ldv_53952; } ldv_53952: bnx2x_cl22_write(bp, phy, 28, (int )((unsigned int )temp | 32768U)); return; } } static void bnx2x_54618se_link_reset(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u32 cfg_pin ; u8 port ; unsigned int tmp ; { bp = params->bp; bnx2x_cl22_write(bp, phy, 0, 2048); port = params->port; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 400UL) + 116UL))); cfg_pin = (tmp & 65280U) >> 8; bnx2x_set_cfg_pin(bp, cfg_pin, 0U); return; } } static u8 bnx2x_54618se_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u16 val ; u8 link_up ; u16 legacy_status ; u16 legacy_speed ; long tmp ; long tmp___0 ; long tmp___1 ; u8 tmp___2 ; { bp = params->bp; link_up = 0U; bnx2x_cl22_read(bp, phy, 25, & legacy_status); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]54618SE read_status: 0x%x\n", "bnx2x_54618se_read_status", 11086, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )legacy_status); } else { } bnx2x_cl22_read(bp, phy, 26, & val); link_up = ((int )legacy_status & 4) != 0; if ((unsigned int )link_up != 0U) { legacy_speed = (unsigned int )legacy_status & 1792U; if ((unsigned int )legacy_speed == 1792U) { vars->line_speed = 1000U; vars->duplex = 1U; } else if ((unsigned int )legacy_speed == 1536U) { vars->line_speed = 1000U; vars->duplex = 0U; } else if ((unsigned int )legacy_speed == 1280U) { vars->line_speed = 100U; vars->duplex = 1U; } else if ((unsigned int )legacy_speed == 768U) { vars->line_speed = 100U; vars->duplex = 0U; } else if ((unsigned int )legacy_speed == 512U) { vars->line_speed = 10U; vars->duplex = 1U; } else if ((unsigned int )legacy_speed == 256U) { vars->line_speed = 10U; vars->duplex = 0U; } else { vars->line_speed = 0U; } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Link is up in %dMbps, is_duplex_full= %d\n", "bnx2x_54618se_read_status", 11123, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed, (unsigned int )vars->duplex == 1U); } else { } bnx2x_cl22_read(bp, phy, 1, & val); if (((int )val & 32) != 0) { vars->link_status = vars->link_status | 64U; } else { } bnx2x_cl22_read(bp, phy, 6, & val); if (((int )val & 1) == 0) { vars->link_status = vars->link_status | 128U; } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BCM54618SE: link speed is %d\n", "bnx2x_54618se_read_status", 11140, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->line_speed); } else { } bnx2x_ext_phy_resolve_fc(phy, params, vars); if ((vars->link_status & 64U) != 0U) { bnx2x_cl22_read(bp, phy, 5, & val); if (((int )val & 32) != 0) { vars->link_status = vars->link_status | 32768U; } else { } if (((int )val & 64) != 0) { vars->link_status = vars->link_status | 16384U; } else { } if (((int )val & 128) != 0) { vars->link_status = vars->link_status | 8192U; } else { } if (((int )val & 256) != 0) { vars->link_status = vars->link_status | 4096U; } else { } if (((int )val & 512) != 0) { vars->link_status = vars->link_status | 2048U; } else { } bnx2x_cl22_read(bp, phy, 10, & val); if (((int )val & 1024) != 0) { vars->link_status = vars->link_status | 1024U; } else { } if (((int )val & 2048) != 0) { vars->link_status = vars->link_status | 512U; } else { } if (((int )phy->flags & 8192) != 0) { tmp___2 = bnx2x_eee_has_cap(params); if ((unsigned int )tmp___2 != 0U) { bnx2x_eee_an_resolve(phy, params, vars); } else { } } else { } } else { } } else { } return (link_up); } } static void bnx2x_54618se_config_loopback(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; u16 val ; u32 umac_base ; long tmp ; { bp = params->bp; umac_base = (unsigned int )params->port != 0U ? 1442816U : 1441792U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]2PMA/PMD ext_phy_loopback: 54618se\n", "bnx2x_54618se_config_loopback", 11187, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl22_write(bp, phy, 9, 6144); bnx2x_cl22_read(bp, phy, 0, & val); val = (unsigned int )val & 53183U; val = (u16 )((unsigned int )val | 320U); bnx2x_cl22_write(bp, phy, 0, (int )val); bnx2x_cl22_write(bp, phy, 24, 7); bnx2x_cl22_read(bp, phy, 24, & val); bnx2x_cl22_write(bp, phy, 24, (int )((unsigned int )val | 33792U)); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16406) * 4)); writel(10000U, (void volatile *)bp->regview + (unsigned long )(umac_base + 20U)); return; } } static void bnx2x_7101_config_loopback(struct bnx2x_phy *phy , struct link_params *params ) { struct bnx2x *bp ; { bp = params->bp; bnx2x_cl45_write(bp, phy, 4, 49162, 256); return; } } static int bnx2x_7101_config_init(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { u16 fw_ver1 ; u16 fw_ver2 ; u16 val ; struct bnx2x *bp ; long tmp ; long tmp___0 ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting the SFX7101 LASI indication\n", "bnx2x_7101_config_init", 11238, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_set_gpio(bp, 2, 1U, (int )params->port); bnx2x_ext_phy_hw_reset(bp, (int )params->port); bnx2x_wait_reset_complete(bp, phy, params); bnx2x_cl45_write(bp, phy, 1, 36866, 1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting the SFX7101 LED to blink on traffic\n", "bnx2x_7101_config_init", 11249, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_cl45_write(bp, phy, 1, 49159, 8); bnx2x_ext_phy_set_pause(params, phy, vars); bnx2x_cl45_read(bp, phy, 7, 0, & val); val = (u16 )((unsigned int )val | 512U); bnx2x_cl45_write(bp, phy, 7, 0, (int )val); bnx2x_cl45_read(bp, phy, 1, 49190, & fw_ver1); bnx2x_cl45_read(bp, phy, 1, 49191, & fw_ver2); bnx2x_save_spirom_version(bp, (int )params->port, (unsigned int )(((int )fw_ver1 << 16) | (int )fw_ver2), phy->ver_addr); return (0); } } static u8 bnx2x_7101_read_status(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u8 link_up ; u16 val1 ; u16 val2 ; long tmp ; long tmp___0 ; long tmp___1 ; { bp = params->bp; bnx2x_cl45_read(bp, phy, 1, 36869, & val2); bnx2x_cl45_read(bp, phy, 1, 36869, & val1); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]10G-base-T LASI status 0x%x->0x%x\n", "bnx2x_7101_read_status", 11284, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val2, (int )val1); } else { } bnx2x_cl45_read(bp, phy, 1, 1, & val2); bnx2x_cl45_read(bp, phy, 1, 1, & val1); tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]10G-base-T PMA status 0x%x->0x%x\n", "bnx2x_7101_read_status", 11290, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val2, (int )val1); } else { } link_up = ((int )val1 & 4) != 0; if ((unsigned int )link_up != 0U) { bnx2x_cl45_read(bp, phy, 7, 33, & val2); vars->line_speed = 10000U; vars->duplex = 1U; tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SFX7101 AN status 0x%x->Master=%x\n", "bnx2x_7101_read_status", 11300, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )val2, (int )val2 & 16384); } else { } bnx2x_ext_phy_10G_an_resolve(bp, phy, vars); bnx2x_ext_phy_resolve_fc(phy, params, vars); if (((int )val2 & 2048) != 0) { vars->link_status = vars->link_status | 8388608U; } else { } } else { } return (link_up); } } static int bnx2x_7101_format_ver(u32 spirom_ver , u8 *str , u16 *len ) { { if ((unsigned int )*len <= 4U) { return (-22); } else { } *str = (u8 )spirom_ver; *(str + 1UL) = (u8 )((spirom_ver & 65280U) >> 8); *(str + 2UL) = (u8 )((spirom_ver & 16711680U) >> 16); *(str + 3UL) = (u8 )(spirom_ver >> 24); *(str + 4UL) = 0U; *len = (unsigned int )*len + 65531U; return (0); } } void bnx2x_sfx7101_sp_sw_reset(struct bnx2x *bp , struct bnx2x_phy *phy ) { u16 val ; u16 cnt ; { bnx2x_cl45_read(bp, phy, 1, 49152, & val); cnt = 0U; goto ldv_54020; ldv_54019: msleep(50U); bnx2x_cl45_write(bp, phy, 1, 49152, (int )((unsigned int )val | 32768U)); bnx2x_cl45_read(bp, phy, 1, 49152, & val); if ((int )((short )val) >= 0) { goto ldv_54018; } else { } cnt = (u16 )((int )cnt + 1); ldv_54020: ; if ((unsigned int )cnt <= 9U) { goto ldv_54019; } else { } ldv_54018: ; return; } } static void bnx2x_7101_hw_reset(struct bnx2x_phy *phy , struct link_params *params ) { { bnx2x_set_gpio(params->bp, 2, 0U, (int )params->port); bnx2x_set_gpio(params->bp, 1, 0U, (int )params->port); return; } } static void bnx2x_7101_set_link_led(struct bnx2x_phy *phy , struct link_params *params , u8 mode ) { u16 val ; struct bnx2x *bp ; { val = 0U; bp = params->bp; switch ((int )mode) { case 3: ; case 0: val = 2U; goto ldv_54034; case 1: val = 1U; goto ldv_54034; case 2: val = 0U; goto ldv_54034; } ldv_54034: bnx2x_cl45_write(bp, phy, 1, 49161, (int )val); return; } } static struct bnx2x_phy const phy_null = {65280U, 0U, 0U, 8U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 0U, 255U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))0, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))0, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))0, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0}; static struct bnx2x_phy const phy_serdes = {0U, 255U, 0U, 0U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 57583U, 4U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_xgxs_config_init), (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_link_settings_status), & bnx2x_int_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))0, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0}; static struct bnx2x_phy const phy_xgxs = {0U, 255U, 0U, 0U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 62575U, 241U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_xgxs_config_init), (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_link_settings_status), & bnx2x_int_link_reset, & bnx2x_set_xgxs_loopback, (u8 (*)(u32 , u8 * , u16 * ))0, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0, & bnx2x_xgxs_specific_func}; static struct bnx2x_phy const phy_warpcore = {0U, 255U, 0U, 4096U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 6976623U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_warpcore_config_init), (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_warpcore_read_status), & bnx2x_warpcore_link_reset, & bnx2x_set_warpcore_loopback, (u8 (*)(u32 , u8 * , u16 * ))0, & bnx2x_warpcore_hw_reset, (void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0}; static struct bnx2x_phy const phy_7101 = {2048U, 255U, 0U, 4U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 28864U, 4U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_7101_config_init), & bnx2x_7101_read_status, & bnx2x_common_ext_link_reset, & bnx2x_7101_config_loopback, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_7101_format_ver), & bnx2x_7101_hw_reset, & bnx2x_7101_set_link_led, (void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0}; static struct bnx2x_phy const phy_8073 = {768U, 255U, 0U, 0U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 62560U, 240U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_8073_config_init), & bnx2x_8073_read_status, & bnx2x_8073_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_format_ver), (void (*)(struct bnx2x_phy * , struct link_params * ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0, & bnx2x_8073_specific_func}; static struct bnx2x_phy const phy_8705 = {1024U, 255U, 0U, 8U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 29696U, 2U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_8705_config_init), & bnx2x_8705_read_status, & bnx2x_common_ext_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_null_format_ver), (void (*)(struct bnx2x_phy * , struct link_params * ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0}; static struct bnx2x_phy const phy_8706 = {1280U, 255U, 0U, 8U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 29728U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, & bnx2x_8706_config_init, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_8706_read_status), & bnx2x_common_ext_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_format_ver), (void (*)(struct bnx2x_phy * , struct link_params * ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0}; static struct bnx2x_phy const phy_8726 = {1536U, 255U, 0U, 4104U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 29792U, 255U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_8726_config_init), & bnx2x_8726_read_status, & bnx2x_8726_link_reset, & bnx2x_8726_config_loopback, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_format_ver), (void (*)(struct bnx2x_phy * , struct link_params * ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u8 ))0, (void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0}; static struct bnx2x_phy const phy_8727 = {2304U, 255U, 0U, 4100U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 29728U, 255U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_8727_config_init), & bnx2x_8727_read_status, & bnx2x_8727_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_format_ver), & bnx2x_8727_hw_reset, & bnx2x_8727_set_link_led, & bnx2x_8727_specific_func}; static struct bnx2x_phy const phy_8481 = {1792U, 255U, 0U, 68U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 28911U, 4U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_8481_config_init), & bnx2x_848xx_read_status, & bnx2x_8481_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_848xx_format_ver), & bnx2x_8481_hw_reset, & bnx2x_848xx_set_link_led, (void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0}; static struct bnx2x_phy const phy_84823 = {2816U, 255U, 0U, 4164U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 28911U, 4U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_848x3_config_init), & bnx2x_848xx_read_status, & bnx2x_848x3_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_848xx_format_ver), (void (*)(struct bnx2x_phy * , struct link_params * ))0, & bnx2x_848xx_set_link_led, & bnx2x_848xx_specific_func}; static struct bnx2x_phy const phy_84833 = {3328U, 255U, 0U, 4164U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 28908U, 4U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_848x3_config_init), & bnx2x_848xx_read_status, & bnx2x_848x3_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_848xx_format_ver), (void (*)(struct bnx2x_phy * , struct link_params * ))(& bnx2x_84833_hw_reset_phy), & bnx2x_848xx_set_link_led, & bnx2x_848xx_specific_func}; static struct bnx2x_phy const phy_84834 = {4352U, 255U, 0U, 68U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 28908U, 4U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_848x3_config_init), & bnx2x_848xx_read_status, & bnx2x_848x3_link_reset, (void (*)(struct bnx2x_phy * , struct link_params * ))0, (u8 (*)(u32 , u8 * , u16 * ))(& bnx2x_848xx_format_ver), (void (*)(struct bnx2x_phy * , struct link_params * ))(& bnx2x_84833_hw_reset_phy), & bnx2x_848xx_set_link_led, & bnx2x_848xx_specific_func}; static struct bnx2x_phy const phy_54618se = {3584U, 255U, 0U, 8U, {65535U, 65535U, 65535U, 65535U}, {65535U, 65535U, 65535U, 65535U}, 0U, 24815U, 4U, 0U, 0U, 0U, 0U, 0U, 0U, (u8 (*)(struct bnx2x_phy * , struct link_params * , struct link_vars * ))(& bnx2x_54618se_config_init), & bnx2x_54618se_read_status, & bnx2x_54618se_link_reset, & bnx2x_54618se_config_loopback, (u8 (*)(u32 , u8 * , u16 * ))0, (void (*)(struct bnx2x_phy * , struct link_params * ))0, & bnx2x_5461x_set_link_led, & bnx2x_54618se_specific_func}; static void bnx2x_populate_preemphasis(struct bnx2x *bp , u32 shmem_base , struct bnx2x_phy *phy , u8 port , u8 phy_index ) { u32 rx ; u32 tx ; u32 i ; { rx = 0U; tx = 0U; i = 0U; goto ldv_54063; ldv_54062: ; if ((unsigned int )phy_index == 0U || (unsigned int )phy_index == 1U) { rx = readl((void const volatile *)(bp->regview + ((unsigned long )shmem_base + (((unsigned long )port * 200UL + (unsigned long )(i << 1)) + 80UL) * 2UL))); tx = readl((void const volatile *)(bp->regview + ((unsigned long )shmem_base + (((unsigned long )port * 200UL + (unsigned long )(i << 1)) + 84UL) * 2UL))); } else { rx = readl((void const volatile *)(bp->regview + ((unsigned long )shmem_base + (((unsigned long )port * 200UL + (unsigned long )(i << 1)) + 208UL) * 2UL))); tx = readl((void const volatile *)(bp->regview + ((unsigned long )shmem_base + (((unsigned long )port * 200UL + (unsigned long )(i << 1)) + 208UL) * 2UL))); } phy->rx_preemphasis[i << 1] = (u16 )(rx >> 16); phy->rx_preemphasis[(i << 1) + 1U] = (u16 )rx; phy->tx_preemphasis[i << 1] = (u16 )(tx >> 16); phy->tx_preemphasis[(i << 1) + 1U] = (u16 )tx; i = i + 1U; ldv_54063: ; if (i <= 1U) { goto ldv_54062; } else { } return; } } static u32 bnx2x_get_ext_phy_config(struct bnx2x *bp , u32 shmem_base , u8 phy_index , u8 port ) { u32 ext_phy_config ; long tmp ; { ext_phy_config = 0U; switch ((int )phy_index) { case 1: ext_phy_config = readl((void const volatile *)(bp->regview + (((unsigned long )shmem_base + (unsigned long )port * 400UL) + 436UL))); goto ldv_54073; case 2: ext_phy_config = readl((void const volatile *)(bp->regview + (((unsigned long )shmem_base + (unsigned long )port * 400UL) + 412UL))); goto ldv_54073; default: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid phy_index %d\n", "bnx2x_get_ext_phy_config", 11937, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy_index); } else { } return (4294967274U); } ldv_54073: ; return (ext_phy_config); } } static int bnx2x_populate_int_phy(struct bnx2x *bp , u32 shmem_base , u8 port , struct bnx2x_phy *phy ) { u32 phy_addr ; u32 chip_id ; u32 switch_cfg ; unsigned int tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; u32 serdes_net_if ; unsigned int tmp___3 ; unsigned int tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; { tmp = readl((void const volatile *)(bp->regview + (((unsigned long )shmem_base + (unsigned long )port * 116UL) + 888UL))); switch_cfg = tmp & 50331648U; tmp___0 = readl((void const volatile *)bp->regview + 41992U); tmp___1 = readl((void const volatile *)bp->regview + 41996U); chip_id = (tmp___0 << 16) | ((tmp___1 << 12) & 65535U); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]:chip_id = 0x%x\n", "bnx2x_populate_int_phy", 11955, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", chip_id); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { phy_addr = readl((void const volatile *)bp->regview + 43468U); *phy = phy_warpcore; tmp___3 = readl((void const volatile *)bp->regview + 42784U); if (tmp___3 == 3U) { phy->flags = (u16 )((unsigned int )phy->flags | 32U); } else { phy->flags = (unsigned int )phy->flags & 65503U; } tmp___4 = readl((void const volatile *)(bp->regview + ((unsigned long )shmem_base + ((unsigned long )port + 1UL) * 400UL))); serdes_net_if = tmp___4 & 251658240U; switch (serdes_net_if) { case 0U: phy->supported = phy->supported & 25711U; phy->media_type = 4U; goto ldv_54089; case 16777216U: phy->supported = phy->supported & 29728U; phy->media_type = 2U; goto ldv_54089; case 33554432U: phy->supported = phy->supported & 29728U; phy->media_type = 1U; goto ldv_54089; case 50331648U: phy->media_type = 240U; phy->supported = phy->supported & 681024U; goto ldv_54089; case 67108864U: phy->media_type = 240U; phy->flags = (u16 )((unsigned int )phy->flags | 16U); phy->supported = phy->supported & 2122752U; goto ldv_54089; case 83886080U: phy->media_type = 240U; phy->flags = (u16 )((unsigned int )phy->flags | 16U); phy->supported = phy->supported & 4875328U; phy->flags = (unsigned int )phy->flags & 61439U; goto ldv_54089; default: tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unknown WC interface type 0x%x\n", "bnx2x_populate_int_phy", 12033, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", serdes_net_if); } else { } goto ldv_54089; } ldv_54089: ; if ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U) { phy->flags = (u16 )((unsigned int )phy->flags | 256U); } else { phy->flags = (u16 )((unsigned int )phy->flags | 1024U); } } else { switch (switch_cfg) { case 0U: phy_addr = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 16 + 66420)); *phy = phy_serdes; goto ldv_54097; case 16777216U: phy_addr = readl((void const volatile *)bp->regview + (unsigned long )((int )port * 24 + 66368)); *phy = phy_xgxs; goto ldv_54097; default: tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid switch_cfg\n", "bnx2x_populate_int_phy", 12060, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } ldv_54097: ; } phy->addr = (unsigned char )phy_addr; phy->mdio_ctrl = bnx2x_get_emac_base(bp, 201326592U, (int )port); if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { phy->def_md_devad = 5U; } else { phy->def_md_devad = 3U; } tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Internal phy port=%d, addr=0x%x, mdio_ctl=0x%x\n", "bnx2x_populate_int_phy", 12074, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port, (int )phy->addr, phy->mdio_ctrl); } else { } bnx2x_populate_preemphasis(bp, shmem_base, phy, (int )port, 0); return (0); } } static int bnx2x_populate_ext_phy(struct bnx2x *bp , u8 phy_index , u32 shmem_base , u32 shmem2_base , u8 port , struct bnx2x_phy *phy ) { u32 ext_phy_config ; u32 phy_type ; u32 config2 ; u32 mdc_mdio_access ; u32 size ; unsigned int tmp ; u32 raw_ver ; unsigned int tmp___0 ; long tmp___1 ; long tmp___2 ; { mdc_mdio_access = 201326592U; ext_phy_config = bnx2x_get_ext_phy_config(bp, shmem_base, (int )phy_index, (int )port); phy_type = ext_phy_config & 65280U; switch (phy_type) { case 768U: mdc_mdio_access = 268435456U; *phy = phy_8073; goto ldv_54113; case 1024U: *phy = phy_8705; goto ldv_54113; case 1280U: *phy = phy_8706; goto ldv_54113; case 1536U: mdc_mdio_access = 134217728U; *phy = phy_8726; goto ldv_54113; case 2560U: mdc_mdio_access = 134217728U; *phy = phy_8727; phy->flags = (u16 )((unsigned int )phy->flags | 2U); goto ldv_54113; case 3840U: ; case 2304U: mdc_mdio_access = 134217728U; *phy = phy_8727; goto ldv_54113; case 1792U: *phy = phy_8481; goto ldv_54113; case 2816U: *phy = phy_84823; goto ldv_54113; case 3328U: *phy = phy_84833; goto ldv_54113; case 4352U: *phy = phy_84834; goto ldv_54113; case 4096U: ; case 3584U: *phy = phy_54618se; if (phy_type == 3584U) { phy->flags = (u16 )((unsigned int )phy->flags | 8192U); } else { } goto ldv_54113; case 2048U: *phy = phy_7101; goto ldv_54113; case 64768U: *phy = phy_null; return (-22); default: *phy = phy_null; if (phy_type != 0U && phy_type != 65280U) { return (-22); } else { } return (0); } ldv_54113: phy->addr = (u8 )ext_phy_config; bnx2x_populate_preemphasis(bp, shmem_base, phy, (int )port, (int )phy_index); config2 = readl((void const volatile *)(bp->regview + ((unsigned long )shmem_base + 32UL))); if ((unsigned int )phy_index == 1U) { phy->ver_addr = (u32 )((unsigned long )port + 103UL) * 16U + shmem_base; if ((config2 & 469762048U) != 0U) { mdc_mdio_access = config2 & 469762048U; } else { } } else { tmp = readl((void const volatile *)bp->regview + (unsigned long )shmem2_base); size = tmp; if (size > 8U) { phy->ver_addr = (u32 )((unsigned long )port + 2UL) * 4U + shmem2_base; } else { } if ((config2 & 3758096384U) != 0U) { mdc_mdio_access = (config2 & 3758096384U) >> 3; } else { } } phy->mdio_ctrl = bnx2x_get_emac_base(bp, mdc_mdio_access, (int )port); if ((phy->type == 3328U || phy->type == 4352U) && phy->ver_addr != 0U) { tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )phy->ver_addr); raw_ver = tmp___0; if ((raw_ver & 127U) <= 39U && (raw_ver & 3968U) >> 7 <= 1U) { phy->supported = phy->supported & 4294967283U; } else { } } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy_type 0x%x port %d found in index %d\n", "bnx2x_populate_ext_phy", 12201, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", phy_type, (int )port, (int )phy_index); } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)] addr=0x%x, mdio_ctl=0x%x\n", "bnx2x_populate_ext_phy", 12203, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy->addr, phy->mdio_ctrl); } else { } return (0); } } static int bnx2x_populate_phy(struct bnx2x *bp , u8 phy_index , u32 shmem_base , u32 shmem2_base , u8 port , struct bnx2x_phy *phy ) { int status ; int tmp ; { status = 0; phy->type = 65280U; if ((unsigned int )phy_index == 0U) { tmp = bnx2x_populate_int_phy(bp, shmem_base, (int )port, phy); return (tmp); } else { } status = bnx2x_populate_ext_phy(bp, (int )phy_index, shmem_base, shmem2_base, (int )port, phy); return (status); } } static void bnx2x_phy_def_cfg(struct link_params *params , struct bnx2x_phy *phy , u8 phy_index ) { struct bnx2x *bp ; u32 link_config ; long tmp ; { bp = params->bp; if ((unsigned int )phy_index == 2U) { link_config = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 116UL) + 896UL))); phy->speed_cap_mask = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 400UL) + 404UL))); } else { link_config = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 116UL) + 888UL))); phy->speed_cap_mask = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )params->port * 400UL) + 440UL))); } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Default config phy idx %x cfg 0x%x speed_cap_mask 0x%x\n", "bnx2x_phy_def_cfg", 12245, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy_index, link_config, phy->speed_cap_mask); } else { } phy->req_duplex = 1U; switch (link_config & 983040U) { case 131072U: phy->req_duplex = 0U; case 65536U: phy->req_line_speed = 10U; goto ldv_54151; case 196608U: phy->req_duplex = 0U; case 262144U: phy->req_line_speed = 100U; goto ldv_54151; case 327680U: phy->req_line_speed = 1000U; goto ldv_54151; case 393216U: phy->req_line_speed = 2500U; goto ldv_54151; case 458752U: phy->req_line_speed = 10000U; goto ldv_54151; default: phy->req_line_speed = 0U; goto ldv_54151; } ldv_54151: ; switch (link_config & 1792U) { case 0U: phy->req_flow_ctrl = 0U; goto ldv_54159; case 256U: phy->req_flow_ctrl = 256U; goto ldv_54159; case 512U: phy->req_flow_ctrl = 512U; goto ldv_54159; case 768U: phy->req_flow_ctrl = 768U; goto ldv_54159; default: phy->req_flow_ctrl = 1024U; goto ldv_54159; } ldv_54159: ; return; } } u32 bnx2x_phy_selection(struct link_params *params ) { u32 phy_config_swapped ; u32 prio_cfg ; u32 return_cfg ; { return_cfg = 0U; phy_config_swapped = params->multi_phy_config & 8U; prio_cfg = params->multi_phy_config & 7U; if (phy_config_swapped != 0U) { switch (prio_cfg) { case 3U: return_cfg = 4U; goto ldv_54171; case 4U: return_cfg = 3U; goto ldv_54171; case 2U: return_cfg = 1U; goto ldv_54171; case 1U: return_cfg = 2U; goto ldv_54171; } ldv_54171: ; } else { return_cfg = prio_cfg; } return (return_cfg); } } int bnx2x_phy_probe(struct link_params *params ) { u8 phy_index ; u8 actual_phy_idx ; u32 phy_config_swapped ; u32 sync_offset ; u32 media_types ; struct bnx2x *bp ; struct bnx2x_phy *phy ; long tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; { bp = params->bp; params->num_phys = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Begin phy probe\n", "bnx2x_phy_probe", 12331, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } phy_config_swapped = params->multi_phy_config & 8U; phy_index = 0U; goto ldv_54191; ldv_54190: actual_phy_idx = phy_index; if (phy_config_swapped != 0U) { if ((unsigned int )phy_index == 1U) { actual_phy_idx = 2U; } else if ((unsigned int )phy_index == 2U) { actual_phy_idx = 1U; } else { } } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy_config_swapped %x, phy_index %x, actual_phy_idx %x\n", "bnx2x_phy_probe", 12346, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", phy_config_swapped, (int )phy_index, (int )actual_phy_idx); } else { } phy = (struct bnx2x_phy *)(& params->phy) + (unsigned long )actual_phy_idx; tmp___2 = bnx2x_populate_phy(bp, (int )phy_index, params->shmem_base, params->shmem2_base, (int )params->port, phy); if (tmp___2 != 0) { params->num_phys = 0U; tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]phy probe failed in phy index %d\n", "bnx2x_phy_probe", 12353, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )phy_index); } else { } phy_index = 0U; goto ldv_54187; ldv_54186: *phy = phy_null; phy_index = (u8 )((int )phy_index + 1); ldv_54187: ; if ((unsigned int )phy_index <= 2U) { goto ldv_54186; } else { } return (-22); } else { } if (phy->type == 65280U) { goto ldv_54189; } else { } if ((params->feature_config_flags & 2048U) != 0U) { phy->flags = (unsigned int )phy->flags & 61439U; } else { } if ((params->feature_config_flags & 8192U) == 0U) { phy->flags = (u16 )((unsigned int )phy->flags | 32768U); } else { } sync_offset = (params->shmem_base + (u32 )params->port * 400U) + 156U; media_types = readl((void const volatile *)bp->regview + (unsigned long )sync_offset); if (((u32 )(255 << (int )actual_phy_idx * 8) & media_types) == 0U) { media_types = ((phy->media_type & 255U) << (int )actual_phy_idx * 8) | media_types; } else { } writel(media_types, (void volatile *)bp->regview + (unsigned long )sync_offset); bnx2x_phy_def_cfg(params, phy, (int )phy_index); params->num_phys = (u8 )((int )params->num_phys + 1); phy_index = (u8 )((int )phy_index + 1); ldv_54191: ; if ((unsigned int )phy_index <= 2U) { goto ldv_54190; } else { } ldv_54189: tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]End phy probe. #phys found %x\n", "bnx2x_phy_probe", 12394, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->num_phys); } else { } return (0); } } static void bnx2x_init_bmac_loopback(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; { bp = params->bp; vars->link_up = 1U; vars->line_speed = 10000U; vars->duplex = 1U; vars->flow_ctrl = 1024U; vars->mac_type = 2U; vars->phy_flags = 1U; bnx2x_xgxs_deassert(params); bnx2x_bmac_enable(params, vars, 1, 1); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); return; } } static void bnx2x_init_emac_loopback(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; { bp = params->bp; vars->link_up = 1U; vars->line_speed = 1000U; vars->duplex = 1U; vars->flow_ctrl = 1024U; vars->mac_type = 1U; vars->phy_flags = 1U; bnx2x_xgxs_deassert(params); bnx2x_emac_enable(params, vars, 1); bnx2x_emac_program(params, vars); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); return; } } static void bnx2x_init_xmac_loopback(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; { bp = params->bp; vars->link_up = 1U; if ((unsigned int )params->req_line_speed[0] == 0U) { vars->line_speed = 10000U; } else { vars->line_speed = params->req_line_speed[0]; } vars->duplex = 1U; vars->flow_ctrl = 1024U; vars->mac_type = 4U; vars->phy_flags = 1U; bnx2x_set_aer_mmd(params, (struct bnx2x_phy *)(& params->phy)); bnx2x_warpcore_reset_lane(bp, (struct bnx2x_phy *)(& params->phy), 0); (*(params->phy[0].config_loopback))((struct bnx2x_phy *)(& params->phy), params); bnx2x_xmac_enable(params, vars, 1); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); return; } } static void bnx2x_init_umac_loopback(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; { bp = params->bp; vars->link_up = 1U; vars->line_speed = 1000U; vars->duplex = 1U; vars->flow_ctrl = 1024U; vars->mac_type = 3U; vars->phy_flags = 1U; bnx2x_umac_enable(params, vars, 1); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); return; } } static void bnx2x_init_xgxs_loopback(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; struct bnx2x_phy *int_phy ; u8 phy_index ; { bp = params->bp; int_phy = (struct bnx2x_phy *)(& params->phy); vars->link_up = 1U; vars->flow_ctrl = 1024U; vars->duplex = 1U; if ((unsigned int )params->req_line_speed[0] == 1000U) { vars->line_speed = 1000U; } else if ((unsigned int )params->req_line_speed[0] == 20000U || ((int )int_phy->flags & 16) != 0) { vars->line_speed = 20000U; } else { vars->line_speed = 10000U; } if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { bnx2x_xgxs_deassert(params); } else { } bnx2x_link_initialize(params, vars); if ((unsigned int )params->req_line_speed[0] == 1000U) { if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_umac_enable(params, vars, 0); } else { bnx2x_emac_program(params, vars); bnx2x_emac_enable(params, vars, 0); } } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_xmac_enable(params, vars, 0); } else { bnx2x_bmac_enable(params, vars, 0, 1); } if ((unsigned int )params->loopback_mode == 3U) { (*(int_phy->config_loopback))(int_phy, params); } else { phy_index = 1U; goto ldv_54220; ldv_54219: ; if ((unsigned long )params->phy[(int )phy_index].config_loopback != (unsigned long )((void (*)(struct bnx2x_phy * , struct link_params * ))0)) { (*(params->phy[(int )phy_index].config_loopback))((struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index, params); } else { } phy_index = (u8 )((int )phy_index + 1); ldv_54220: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_54219; } else { } } writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); bnx2x_set_led(params, vars, 2, (u32 )vars->line_speed); return; } } void bnx2x_set_rx_filter(struct link_params *params , u8 en ) { struct bnx2x *bp ; u8 val ; { bp = params->bp; val = (unsigned int )en * 31U; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { val = (u8 )((int )((signed char )((unsigned int )en * 32U)) | (int )((signed char )val)); } else { } writel((unsigned int )val, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16529) * 4)); if (bp->common.chip_id >> 16 != 5710U) { writel((unsigned int )en * 3U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 22546) * 4)); } else { } writel((unsigned int )en, (void volatile *)(bp->regview + ((unsigned int )params->port != 0U ? 66268UL : 66140UL))); return; } } static int bnx2x_avoid_link_flap(struct link_params *params , struct link_vars *vars ) { u32 phy_idx ; u32 dont_clear_stat ; u32 lfa_sts ; struct bnx2x *bp ; struct bnx2x_phy *phy ; long tmp ; { bp = params->bp; bnx2x_set_mdio_emac_per_phy(bp, params); bnx2x_link_status_update(params, vars); phy_idx = 0U; goto ldv_54239; ldv_54238: phy = (struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_idx; if ((unsigned long )phy->phy_specific_func != (unsigned long )((void (*)(struct bnx2x_phy * , struct link_params * , u32 ))0)) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Calling PHY specific func\n", "bnx2x_avoid_link_flap", 12567, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } (*(phy->phy_specific_func))(phy, params, 3U); } else { } if ((phy->media_type == 1U || phy->media_type == 5U) || phy->media_type == 3U) { bnx2x_verify_sfp_module(phy, params); } else { } phy_idx = phy_idx + 1U; ldv_54239: ; if ((u32 )params->num_phys > phy_idx) { goto ldv_54238; } else { } lfa_sts = readl((void const volatile *)(bp->regview + ((unsigned long )params->lfa_base + 24UL))); dont_clear_stat = lfa_sts & 16777216U; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { if (dont_clear_stat == 0U) { writel((unsigned int )(16777216 << (int )params->port), (void volatile *)bp->regview + 42392U); writel((unsigned int )(16777216 << (int )params->port), (void volatile *)bp->regview + 42388U); } else { } if ((unsigned int )vars->line_speed <= 9999U) { bnx2x_umac_enable(params, vars, 0); } else { bnx2x_xmac_enable(params, vars, 0); } } else if ((unsigned int )vars->line_speed <= 9999U) { bnx2x_emac_enable(params, vars, 0); } else { bnx2x_bmac_enable(params, vars, 0, dont_clear_stat == 0U); } lfa_sts = (lfa_sts & 4294902015U) | (((((lfa_sts & 65280U) >> 8) + 1U) << 8) & 65535U); lfa_sts = lfa_sts & 4294967040U; writel(lfa_sts, (void volatile *)(bp->regview + ((unsigned long )params->lfa_base + 24UL))); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); bnx2x_link_int_enable(params); return (0); } } static void bnx2x_cannot_avoid_link_flap(struct link_params *params , struct link_vars *vars , int lfa_status ) { u32 lfa_sts ; u32 cfg_idx ; u32 tmp_val ; struct bnx2x *bp ; { bp = params->bp; bnx2x_link_reset(params, vars, 1); if (params->lfa_base == 0U) { return; } else { } writel((unsigned int )params->req_duplex[0] | (unsigned int )((int )params->req_duplex[1] << 16), (void volatile *)bp->regview + (unsigned long )params->lfa_base); writel((unsigned int )params->req_flow_ctrl[0] | (unsigned int )((int )params->req_flow_ctrl[1] << 16), (void volatile *)(bp->regview + ((unsigned long )params->lfa_base + 4UL))); writel((unsigned int )params->req_line_speed[0] | (unsigned int )((int )params->req_line_speed[1] << 16), (void volatile *)(bp->regview + ((unsigned long )params->lfa_base + 8UL))); cfg_idx = 0U; goto ldv_54251; ldv_54250: writel(params->speed_cap_mask[cfg_idx], (void volatile *)(bp->regview + ((unsigned long )params->lfa_base + ((unsigned long )cfg_idx + 3UL) * 4UL))); cfg_idx = cfg_idx + 1U; ldv_54251: ; if (cfg_idx <= 1U) { goto ldv_54250; } else { } tmp_val = readl((void const volatile *)(bp->regview + ((unsigned long )params->lfa_base + 20UL))); tmp_val = tmp_val & 4294901760U; tmp_val = (u32 )params->req_fc_auto_adv | tmp_val; writel(tmp_val, (void volatile *)(bp->regview + ((unsigned long )params->lfa_base + 20UL))); lfa_sts = readl((void const volatile *)(bp->regview + ((unsigned long )params->lfa_base + 24UL))); lfa_sts = lfa_sts & 4278190079U; lfa_sts = lfa_sts & 4294967040U; lfa_sts = ((u32 )lfa_status & 255U) | lfa_sts; lfa_sts = (lfa_sts & 4278255615U) | (((((lfa_sts & 16711680U) >> 16) + 1U) & 255U) << 16); writel(lfa_sts, (void volatile *)(bp->regview + ((unsigned long )params->lfa_base + 24UL))); return; } } int bnx2x_phy_init(struct link_params *params , struct link_vars *vars ) { int lfa_status ; struct bnx2x *bp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Phy Initialization started\n", "bnx2x_phy_init", 12687, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)](1) req_speed %d, req_flowctrl %d\n", "bnx2x_phy_init", 12689, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->req_line_speed[0], (int )params->req_flow_ctrl[0]); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)](2) req_speed %d, req_flowctrl %d\n", "bnx2x_phy_init", 12691, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->req_line_speed[1], (int )params->req_flow_ctrl[1]); } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]req_adv_flow_ctrl 0x%x\n", "bnx2x_phy_init", 12692, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->req_fc_auto_adv); } else { } vars->link_status = 0U; vars->phy_link_up = 0U; vars->link_up = 0U; vars->line_speed = 0U; vars->duplex = 1U; vars->flow_ctrl = 1024U; vars->mac_type = 0U; vars->phy_flags = 0U; vars->check_kr2_recovery_cnt = 0U; params->link_flags = 2U; bnx2x_set_rx_filter(params, 1); bnx2x_chng_link_count(params, 1); lfa_status = bnx2x_check_lfa(params); if (lfa_status == 0) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Link Flap Avoidance in progress\n", "bnx2x_phy_init", 12710, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___4 = bnx2x_avoid_link_flap(params, vars); return (tmp___4); } else { } tmp___5 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Cannot avoid link flap lfa_sta=0x%x\n", "bnx2x_phy_init", 12715, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", lfa_status); } else { } bnx2x_cannot_avoid_link_flap(params, vars, lfa_status); bnx2x_bits_dis(bp, (u32 )(((int )params->port + 16588) * 4), 3965441U); bnx2x_emac_init(params, vars); if ((params->feature_config_flags & 2U) != 0U) { vars->link_status = vars->link_status | 536870912U; } else { } if ((unsigned int )params->num_phys == 0U) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]No phy found for initialization !!\n", "bnx2x_phy_init", 12731, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } set_phy_vars(params, vars); tmp___7 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Num of phys on board: %d\n", "bnx2x_phy_init", 12736, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )params->num_phys); } else { } switch ((int )params->loopback_mode) { case 2: bnx2x_init_bmac_loopback(params, vars); goto ldv_54261; case 1: bnx2x_init_emac_loopback(params, vars); goto ldv_54261; case 7: bnx2x_init_xmac_loopback(params, vars); goto ldv_54261; case 6: bnx2x_init_umac_loopback(params, vars); goto ldv_54261; case 3: ; case 4: bnx2x_init_xgxs_loopback(params, vars); goto ldv_54261; default: ; if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { if (params->switch_cfg == 16777216U) { bnx2x_xgxs_deassert(params); } else { bnx2x_serdes_deassert(bp, (int )params->port); } } else { } bnx2x_link_initialize(params, vars); msleep(30U); bnx2x_link_int_enable(params); goto ldv_54261; } ldv_54261: bnx2x_update_mng(params, vars->link_status); bnx2x_update_mng_eee(params, vars->eee_status); return (0); } } int bnx2x_link_reset(struct link_params *params , struct link_vars *vars , u8 reset_ext_phy ) { struct bnx2x *bp ; u8 phy_index ; u8 port ; u8 clear_latch_ind ; long tmp ; u32 xmac_base ; unsigned int tmp___0 ; { bp = params->bp; port = params->port; clear_latch_ind = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Resetting the link of port %d\n", "bnx2x_link_reset", 12777, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port); } else { } vars->link_status = 0U; bnx2x_chng_link_count(params, 1); bnx2x_update_mng(params, vars->link_status); vars->eee_status = vars->eee_status & 2969567231U; bnx2x_update_mng_eee(params, vars->eee_status); bnx2x_bits_dis(bp, (u32 )(((int )port + 16588) * 4), 3965441U); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16408) * 4)); if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16440) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16456) * 4)); } else { } if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { bnx2x_set_bmac_rx(bp, params->chip_id, (int )port, 0); } else { bnx2x_set_xmac_rxtx(params, 0); bnx2x_set_umac_rxtx(params, 0); } if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16399) * 4)); } else { } usleep_range(10000UL, 20000UL); bnx2x_set_mdio_emac_per_phy(bp, params); bnx2x_set_led(params, vars, 0, 0U); if ((unsigned int )reset_ext_phy != 0U) { phy_index = 1U; goto ldv_54279; ldv_54278: ; if ((unsigned long )params->phy[(int )phy_index].link_reset != (unsigned long )((void (*)(struct bnx2x_phy * , struct link_params * ))0)) { bnx2x_set_aer_mmd(params, (struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index); (*(params->phy[(int )phy_index].link_reset))((struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index, params); } else { } if (((int )params->phy[(int )phy_index].flags & 64) != 0) { clear_latch_ind = 1U; } else { } phy_index = (u8 )((int )phy_index + 1); ldv_54279: ; if ((int )params->num_phys > (int )phy_index) { goto ldv_54278; } else { } } else { } if ((unsigned int )clear_latch_ind != 0U) { bnx2x_rearm_latch_signal(bp, (int )port, 0); bnx2x_bits_dis(bp, (u32 )(((int )port + 22660) * 4), 1U); } else { } if ((unsigned long )params->phy[0].link_reset != (unsigned long )((void (*)(struct bnx2x_phy * , struct link_params * ))0)) { (*(params->phy[0].link_reset))((struct bnx2x_phy *)(& params->phy), params); } else { } if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { writel((unsigned int )(1 << (int )port), (void volatile *)bp->regview + 42392U); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16427) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )port + 16425) * 4)); } else { xmac_base = (unsigned int )params->port != 0U ? 1456128U : 1454080U; bnx2x_set_xumac_nig(params, 0, 0); tmp___0 = readl((void const volatile *)bp->regview + 42384U); if ((tmp___0 & 4194304U) != 0U) { writel(64U, (void volatile *)bp->regview + (unsigned long )xmac_base); } else { } } vars->link_up = 0U; vars->phy_flags = 0U; return (0); } } int bnx2x_lfa_reset(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; int tmp ; { bp = params->bp; vars->link_up = 0U; vars->phy_flags = 0U; params->link_flags = (unsigned int )params->link_flags & 65533U; if (params->lfa_base == 0U) { tmp = bnx2x_link_reset(params, vars, 1); return (tmp); } else { } writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { bnx2x_set_bmac_rx(bp, params->chip_id, (int )params->port, 0); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_set_xmac_rxtx(params, 0); bnx2x_set_umac_rxtx(params, 0); } else { } usleep_range(10000UL, 20000UL); bnx2x_set_rx_filter(params, 0); if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { bnx2x_set_bmac_rx(bp, params->chip_id, (int )params->port, 1); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { bnx2x_set_xmac_rxtx(params, 1); bnx2x_set_umac_rxtx(params, 1); } else { } writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); return (0); } } static int bnx2x_8073_common_init_phy(struct bnx2x *bp , u32 *shmem_base_path , u32 *shmem2_base_path , u8 phy_index , u32 chip_id ) { struct bnx2x_phy phy[2U] ; struct bnx2x_phy *phy_blk[2U] ; u16 val ; s8 port ; s8 port_of_path ; u32 swap_val ; u32 swap_override ; u32 shmem_base ; u32 shmem2_base ; long tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; { port = 0; port_of_path = 0; swap_val = readl((void const volatile *)bp->regview + 66452U); swap_override = readl((void const volatile *)bp->regview + 66456U); port = (int )((s8 )(swap_val != 0U && swap_override != 0U)) ^ (int )port; bnx2x_ext_phy_hw_reset(bp, (int )((u8 )port)); port = 1; goto ldv_54305; ldv_54304: ; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { shmem_base = *shmem_base_path; shmem2_base = *shmem2_base_path; port_of_path = port; } else { shmem_base = *(shmem_base_path + (unsigned long )port); shmem2_base = *(shmem2_base_path + (unsigned long )port); port_of_path = 0; } tmp___0 = bnx2x_populate_phy(bp, (int )phy_index, shmem_base, shmem2_base, (int )((u8 )port_of_path), (struct bnx2x_phy *)(& phy) + (unsigned long )port); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]populate_phy failed\n", "bnx2x_8073_common_init_phy", 12951, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_bits_dis(bp, (u32 )(((int )port_of_path + 16588) * 4), 3965441U); bnx2x_set_gpio(bp, 2, 1U, (int )((u8 )port)); bnx2x_cl45_write(bp, (struct bnx2x_phy *)(& phy) + (unsigned long )port, 1, 0, 32768); port = (s8 )((int )port - 1); ldv_54305: ; if ((int )port >= 0) { goto ldv_54304; } else { } msleep(150U); if ((int )phy[0].addr & 1) { phy_blk[0] = (struct bnx2x_phy *)(& phy) + 1UL; phy_blk[1] = (struct bnx2x_phy *)(& phy); } else { phy_blk[0] = (struct bnx2x_phy *)(& phy); phy_blk[1] = (struct bnx2x_phy *)(& phy) + 1UL; } port = 1; goto ldv_54308; ldv_54307: ; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { port_of_path = port; } else { port_of_path = 0; } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Loading spirom for phy address 0x%x\n", "bnx2x_8073_common_init_phy", 12995, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )(phy_blk[(int )port])->addr); } else { } tmp___2 = bnx2x_8073_8727_external_rom_boot(bp, phy_blk[(int )port], (int )((u8 )port_of_path)); if (tmp___2 != 0) { return (-22); } else { } bnx2x_cl45_read(bp, phy_blk[(int )port], 1, 51714, & val); bnx2x_cl45_write(bp, phy_blk[(int )port], 1, 51714, (int )((unsigned int )val | 1024U)); port = (s8 )((int )port - 1); ldv_54308: ; if ((int )port >= 0) { goto ldv_54307; } else { } msleep(600U); port = 1; goto ldv_54311; ldv_54310: bnx2x_cl45_read(bp, phy_blk[(int )port], 1, 51714, & val); bnx2x_cl45_write(bp, phy_blk[(int )port], 1, 51714, (int )val & 64511); usleep_range(15000UL, 30000UL); bnx2x_cl45_read(bp, phy_blk[(int )port], 1, 51739, & val); bnx2x_cl45_write(bp, phy_blk[(int )port], 1, 51739, (int )((unsigned int )val | 4096U)); bnx2x_set_gpio(bp, 2, 0U, (int )((u8 )port)); port = (s8 )((int )port - 1); ldv_54311: ; if ((int )port >= 0) { goto ldv_54310; } else { } return (0); } } static int bnx2x_8726_common_init_phy(struct bnx2x *bp , u32 *shmem_base_path , u32 *shmem2_base_path , u8 phy_index , u32 chip_id ) { u32 val ; s8 port ; struct bnx2x_phy phy ; u32 shmem_base ; u32 shmem2_base ; long tmp ; int tmp___0 ; { val = readl((void const volatile *)bp->regview + 41660U); val = val | 136U; writel(val, (void volatile *)bp->regview + 41660U); bnx2x_ext_phy_hw_reset(bp, 0); usleep_range(5000UL, 10000UL); port = 0; goto ldv_54327; ldv_54326: ; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { shmem_base = *shmem_base_path; shmem2_base = *shmem2_base_path; } else { shmem_base = *(shmem_base_path + (unsigned long )port); shmem2_base = *(shmem2_base_path + (unsigned long )port); } tmp___0 = bnx2x_populate_phy(bp, (int )phy_index, shmem_base, shmem2_base, (int )((u8 )port), & phy); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]populate phy failed\n", "bnx2x_8726_common_init_phy", 13076, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_cl45_write(bp, & phy, 1, 51728, 1); bnx2x_set_gpio(bp, 0, 1U, (int )((u8 )port)); port = (s8 )((int )port + 1); ldv_54327: ; if ((int )port <= 1) { goto ldv_54326; } else { } return (0); } } static void bnx2x_get_ext_phy_reset_gpio(struct bnx2x *bp , u32 shmem_base , u8 *io_gpio , u8 *io_port ) { u32 phy_gpio_reset ; unsigned int tmp ; { tmp = readl((void const volatile *)(bp->regview + ((unsigned long )shmem_base + 400UL))); phy_gpio_reset = tmp; switch (phy_gpio_reset) { case 65536U: *io_gpio = 0U; *io_port = 0U; goto ldv_54337; case 131072U: *io_gpio = 1U; *io_port = 0U; goto ldv_54337; case 196608U: *io_gpio = 2U; *io_port = 0U; goto ldv_54337; case 262144U: *io_gpio = 3U; *io_port = 0U; goto ldv_54337; case 327680U: *io_gpio = 0U; *io_port = 1U; goto ldv_54337; case 393216U: *io_gpio = 1U; *io_port = 1U; goto ldv_54337; case 458752U: *io_gpio = 2U; *io_port = 1U; goto ldv_54337; case 524288U: *io_gpio = 3U; *io_port = 1U; goto ldv_54337; default: ; goto ldv_54337; } ldv_54337: ; return; } } static int bnx2x_8727_common_init_phy(struct bnx2x *bp , u32 *shmem_base_path , u32 *shmem2_base_path , u8 phy_index , u32 chip_id ) { s8 port ; s8 reset_gpio ; u32 swap_val ; u32 swap_override ; struct bnx2x_phy phy[2U] ; struct bnx2x_phy *phy_blk[2U] ; s8 port_of_path ; u32 shmem_base ; u32 shmem2_base ; long tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; { swap_val = readl((void const volatile *)bp->regview + 66452U); swap_override = readl((void const volatile *)bp->regview + 66456U); reset_gpio = 1; port = 1; bnx2x_get_ext_phy_reset_gpio(bp, *shmem_base_path, (u8 *)(& reset_gpio), (u8 *)(& port)); port = (int )((s8 )(swap_val != 0U && swap_override != 0U)) ^ (int )port; bnx2x_set_gpio(bp, (int )reset_gpio, 0U, (int )((u8 )port)); usleep_range(1000UL, 2000UL); bnx2x_set_gpio(bp, (int )reset_gpio, 1U, (int )((u8 )port)); usleep_range(5000UL, 10000UL); port = 1; goto ldv_54364; ldv_54363: ; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { shmem_base = *shmem_base_path; shmem2_base = *shmem2_base_path; port_of_path = port; } else { shmem_base = *(shmem_base_path + (unsigned long )port); shmem2_base = *(shmem2_base_path + (unsigned long )port); port_of_path = 0; } tmp___0 = bnx2x_populate_phy(bp, (int )phy_index, shmem_base, shmem2_base, (int )((u8 )port_of_path), (struct bnx2x_phy *)(& phy) + (unsigned long )port); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]populate phy failed\n", "bnx2x_8727_common_init_phy", 13192, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_bits_dis(bp, (u32 )(((int )port_of_path + 16588) * 4), 3965441U); bnx2x_cl45_write(bp, (struct bnx2x_phy *)(& phy) + (unsigned long )port, 1, 0, 32768); port = (s8 )((int )port - 1); ldv_54364: ; if ((int )port >= 0) { goto ldv_54363; } else { } msleep(150U); if ((int )phy[0].addr & 1) { phy_blk[0] = (struct bnx2x_phy *)(& phy) + 1UL; phy_blk[1] = (struct bnx2x_phy *)(& phy); } else { phy_blk[0] = (struct bnx2x_phy *)(& phy); phy_blk[1] = (struct bnx2x_phy *)(& phy) + 1UL; } port = 1; goto ldv_54367; ldv_54366: ; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { port_of_path = port; } else { port_of_path = 0; } tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Loading spirom for phy address 0x%x\n", "bnx2x_8727_common_init_phy", 13225, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )(phy_blk[(int )port])->addr); } else { } tmp___2 = bnx2x_8073_8727_external_rom_boot(bp, phy_blk[(int )port], (int )((u8 )port_of_path)); if (tmp___2 != 0) { return (-22); } else { } bnx2x_cl45_write(bp, phy_blk[(int )port], 1, 9, 1); port = (s8 )((int )port - 1); ldv_54367: ; if ((int )port >= 0) { goto ldv_54366; } else { } return (0); } } static int bnx2x_84833_common_init_phy(struct bnx2x *bp , u32 *shmem_base_path , u32 *shmem2_base_path , u8 phy_index , u32 chip_id ) { u8 reset_gpios ; long tmp ; { reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path, chip_id); bnx2x_set_mult_gpio(bp, (int )reset_gpios, 0U); __const_udelay(42950UL); bnx2x_set_mult_gpio(bp, (int )reset_gpios, 1U); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]84833 reset pulse on pin values 0x%x\n", "bnx2x_84833_common_init_phy", 13250, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )reset_gpios); } else { } return (0); } } static int bnx2x_ext_phy_common_init(struct bnx2x *bp , u32 *shmem_base_path , u32 *shmem2_base_path , u8 phy_index , u32 ext_phy_type , u32 chip_id ) { int rc ; long tmp ; { rc = 0; switch (ext_phy_type) { case 768U: rc = bnx2x_8073_common_init_phy(bp, shmem_base_path, shmem2_base_path, (int )phy_index, chip_id); goto ldv_54388; case 3840U: ; case 2304U: ; case 2560U: rc = bnx2x_8727_common_init_phy(bp, shmem_base_path, shmem2_base_path, (int )phy_index, chip_id); goto ldv_54388; case 1536U: rc = bnx2x_8726_common_init_phy(bp, shmem_base_path, shmem2_base_path, (int )phy_index, chip_id); goto ldv_54388; case 3328U: ; case 4352U: rc = bnx2x_84833_common_init_phy(bp, shmem_base_path, shmem2_base_path, (int )phy_index, chip_id); goto ldv_54388; case 64768U: rc = -22; goto ldv_54388; default: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]ext_phy 0x%x common init not required\n", "bnx2x_ext_phy_common_init", 13297, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ext_phy_type); } else { } goto ldv_54388; } ldv_54388: ; if (rc != 0) { netdev_err((struct net_device const *)bp->dev, "Warning: PHY was not initialized, Port %d\n", 0); } else { } return (rc); } } int bnx2x_common_init_phy(struct bnx2x *bp , u32 *shmem_base_path , u32 *shmem2_base_path , u32 chip_id ) { int rc ; u32 phy_ver ; u32 val ; u8 phy_index ; u32 ext_phy_type ; u32 ext_phy_config ; long tmp ; long tmp___0 ; int tmp___1 ; { rc = 0; phy_index = 0U; bnx2x_set_mdio_clk(bp, chip_id, 32768U); bnx2x_set_mdio_clk(bp, chip_id, 33792U); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Begin common phy init\n", "bnx2x_common_init_phy", 13318, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { val = readl((void const volatile *)bp->regview + 43424U); writel(val | 1U, (void volatile *)bp->regview + 43424U); } else { } phy_ver = readl((void const volatile *)(bp->regview + ((unsigned long )*shmem_base_path + 1648UL))); if (phy_ver != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Not doing common init; phy ver is 0x%x\n", "bnx2x_common_init_phy", 13330, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", phy_ver); } else { } return (0); } else { } phy_index = 1U; goto ldv_54412; ldv_54411: ext_phy_config = bnx2x_get_ext_phy_config(bp, *shmem_base_path, (int )phy_index, 0); ext_phy_type = ext_phy_config & 65280U; tmp___1 = bnx2x_ext_phy_common_init(bp, shmem_base_path, shmem2_base_path, (int )phy_index, ext_phy_type, chip_id); rc = tmp___1 | rc; phy_index = (u8 )((int )phy_index + 1); ldv_54412: ; if ((unsigned int )phy_index <= 2U) { goto ldv_54411; } else { } return (rc); } } static void bnx2x_check_over_curr(struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u32 cfg_pin ; u8 port ; u32 pin_val ; unsigned int tmp ; u32 tmp___0 ; { bp = params->bp; port = params->port; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 400UL) + 120UL))); cfg_pin = tmp & 255U; tmp___0 = bnx2x_get_cfg_pin(bp, cfg_pin, & pin_val); if (tmp___0 != 0U) { return; } else { } if (pin_val == 0U) { if (((int )vars->phy_flags & 16) == 0) { netdev_err((struct net_device const *)bp->dev, "Error: Power fault on Port %d has been detected and the power to that SFP+ module has been removed to prevent failure of the card. Please remove the SFP+ module and restart the system to clear this error.\n", (int )params->port); vars->phy_flags = (u8 )((unsigned int )vars->phy_flags | 16U); bnx2x_warpcore_power_module(params, 0); } else { } } else { vars->phy_flags = (unsigned int )vars->phy_flags & 239U; } return; } } static u8 bnx2x_analyze_link_error(struct link_params *params , struct link_vars *vars , u32 status , u32 phy_flag , u32 link_flag , u8 notify ) { struct bnx2x *bp ; u8 led_mode ; u32 old_status ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { bp = params->bp; old_status = ((u32 )vars->phy_flags & phy_flag) != 0U; if (status == old_status) { return (0U); } else { } switch (phy_flag) { case 8U: tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Analyze Remote Fault\n", "bnx2x_analyze_link_error", 13400, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } goto ldv_54435; case 32U: tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Analyze TX Fault\n", "bnx2x_analyze_link_error", 13403, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } goto ldv_54435; default: tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Analyze UNKNOWN\n", "bnx2x_analyze_link_error", 13406, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } ldv_54435: tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Link changed:[%x %x]->%x\n", "bnx2x_analyze_link_error", 13409, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vars->link_up, old_status, status); } else { } if (((int )vars->phy_flags & 4) == 0) { return (1U); } else { } if (status != 0U) { vars->link_status = vars->link_status & 4294967294U; vars->link_status = vars->link_status | link_flag; vars->link_up = 0U; vars->phy_flags = (int )vars->phy_flags | (int )((u8 )phy_flag); writel(1U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); led_mode = 0U; } else { vars->link_status = vars->link_status | 1U; vars->link_status = vars->link_status & ~ link_flag; vars->link_up = 1U; vars->phy_flags = (int )vars->phy_flags & ~ ((int )((u8 )phy_flag)); led_mode = 2U; writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )params->port + 16408) * 4)); } bnx2x_sync_link(params, vars); bnx2x_set_led(params, vars, (int )led_mode, 10000U); bnx2x_update_mng(params, vars->link_status); vars->periodic_flags = (u16 )((unsigned int )vars->periodic_flags | 1U); if ((unsigned int )notify != 0U) { bnx2x_notify_link_changed(bp); } else { } return (1U); } } static int bnx2x_check_half_open_conn(struct link_params *params , struct link_vars *vars , u8 notify ) { struct bnx2x *bp ; u32 lss_status ; u32 mac_base ; unsigned int tmp ; unsigned int tmp___0 ; u32 lss_status_reg ; u32 wb_data[2U] ; unsigned int tmp___1 ; unsigned int tmp___2 ; { bp = params->bp; lss_status = 0U; if (((int )vars->phy_flags & 4) == 0) { return (0); } else { tmp = readl((void const volatile *)bp->regview + (unsigned long )(((int )params->port + 16406) * 4)); if (tmp != 0U) { return (0); } else { } } if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { tmp___2 = readl((void const volatile *)bp->regview + 42384U); if ((tmp___2 & 4194304U) != 0U) { mac_base = (unsigned int )params->port != 0U ? 1456128U : 1454080U; writel(0U, (void volatile *)bp->regview + (unsigned long )(mac_base + 96U)); writel(3U, (void volatile *)bp->regview + (unsigned long )(mac_base + 96U)); tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )(mac_base + 88U)); if (tmp___0 != 0U) { lss_status = 1U; } else { } bnx2x_analyze_link_error(params, vars, lss_status, 8U, 0U, (int )notify); } else { goto _L; } } else { _L: /* CIL Label */ tmp___1 = readl((void const volatile *)bp->regview + 42384U); if ((tmp___1 & (unsigned int )(1 << (int )params->port)) != 0U) { mac_base = (unsigned int )params->port != 0U ? 69632U : 68608U; if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { lss_status_reg = 496U; } else { lss_status_reg = 536U; } bnx2x_read_dmae(bp, mac_base + lss_status_reg, 2U); memcpy((void *)(& wb_data), (void const *)(& (bp->slowpath)->wb_data), 8UL); lss_status = wb_data[0] != 0U; bnx2x_analyze_link_error(params, vars, lss_status, 8U, 0U, (int )notify); } else { } } return (0); } } static void bnx2x_sfp_tx_fault_detection(struct bnx2x_phy *phy , struct link_params *params , struct link_vars *vars ) { struct bnx2x *bp ; u32 cfg_pin ; u32 value ; u8 led_change ; u8 port ; unsigned int tmp ; long tmp___0 ; u32 tmp___1 ; u8 led_mode ; long tmp___2 ; { bp = params->bp; value = 0U; port = params->port; tmp = readl((void const volatile *)(bp->regview + (((unsigned long )params->shmem_base + (unsigned long )port * 400UL) + 116UL))); cfg_pin = tmp & 255U; tmp___1 = bnx2x_get_cfg_pin(bp, cfg_pin, & value); if (tmp___1 != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to read pin 0x%02x\n", "bnx2x_sfp_tx_fault_detection", 13534, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cfg_pin); } else { } return; } else { } led_change = bnx2x_analyze_link_error(params, vars, value, 32U, 2147483648U, 1); if ((unsigned int )led_change != 0U) { if (((int )vars->phy_flags & 32) != 0) { led_mode = 1U; vars->link_status = vars->link_status | 2147483648U; } else { led_mode = 0U; vars->link_status = vars->link_status & 2147483647U; } if (((int )phy->flags & 128) == 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Change TX_Fault LED: ->%x\n", "bnx2x_sfp_tx_fault_detection", 13557, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )led_mode); } else { } bnx2x_set_e3_module_fault_led(params, (int )led_mode); } else { } } else { } return; } } static void bnx2x_kr2_recovery(struct link_params *params , struct link_vars *vars , struct bnx2x_phy *phy ) { struct bnx2x *bp ; long tmp ; { bp = params->bp; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]KR2 recovery\n", "bnx2x_kr2_recovery", 13567, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_warpcore_enable_AN_KR2(phy, params, vars); bnx2x_warpcore_restart_AN_KR(phy, params); return; } } static void bnx2x_check_kr2_wa(struct link_params *params , struct link_vars *vars , struct bnx2x_phy *phy ) { struct bnx2x *bp ; u16 base_page ; u16 next_page ; u16 not_kr2_device ; u16 lane ; int sigdet ; long tmp ; u8 tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { bp = params->bp; if ((unsigned int )vars->check_kr2_recovery_cnt != 0U) { vars->check_kr2_recovery_cnt = (u8 )((int )vars->check_kr2_recovery_cnt - 1); return; } else { } sigdet = bnx2x_warpcore_get_sigdet(phy, params); if (sigdet == 0) { if ((params->link_attr_sync & 1U) == 0U) { bnx2x_kr2_recovery(params, vars, phy); tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]No sigdet\n", "bnx2x_check_kr2_wa", 13594, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } return; } else { } tmp___0 = bnx2x_get_warpcore_lane(phy, params); lane = (u16 )tmp___0; bnx2x_cl45_write(bp, phy, (int )phy->def_md_devad, 65502, (int )lane); bnx2x_cl45_read(bp, phy, 7, 19, & base_page); bnx2x_cl45_read(bp, phy, 7, 20, & next_page); bnx2x_set_aer_mmd(params, phy); if ((unsigned int )base_page == 0U) { if ((params->link_attr_sync & 1U) == 0U) { bnx2x_kr2_recovery(params, vars, phy); tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]No BP\n", "bnx2x_check_kr2_wa", 13612, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } return; } else { } not_kr2_device = (u16 )((int )((short )base_page) >= 0 || ((int )((short )base_page) < 0 && ((int )next_page & 224) == 32)); if ((params->link_attr_sync & 1U) == 0U) { if ((unsigned int )not_kr2_device == 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BP=0x%x, NP=0x%x\n", "bnx2x_check_kr2_wa", 13629, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )base_page, (int )next_page); } else { } bnx2x_kr2_recovery(params, vars, phy); } else { } return; } else { } if ((unsigned int )not_kr2_device != 0U) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BP=0x%x, NP=0x%x\n", "bnx2x_check_kr2_wa", 13637, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )base_page, (int )next_page); } else { } bnx2x_disable_kr2(params, vars, phy); bnx2x_warpcore_restart_AN_KR(phy, params); return; } else { } return; } } void bnx2x_period_func(struct link_params *params , struct link_vars *vars ) { u16 phy_idx ; struct bnx2x *bp ; long tmp ; int tmp___0 ; struct bnx2x_phy *phy ; int tmp___1 ; unsigned int tmp___2 ; { bp = params->bp; phy_idx = 0U; goto ldv_54488; ldv_54487: ; if (((int )params->phy[(int )phy_idx].flags & 4096) != 0) { bnx2x_set_aer_mmd(params, (struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_idx); tmp___0 = bnx2x_check_half_open_conn(params, vars, 1); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Fault detection failed\n", "bnx2x_period_func", 13654, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } goto ldv_54486; } else { } phy_idx = (u16 )((int )phy_idx + 1); ldv_54488: ; if ((unsigned int )phy_idx <= 2U) { goto ldv_54487; } else { } ldv_54486: ; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { phy = (struct bnx2x_phy *)(& params->phy); bnx2x_set_aer_mmd(params, phy); if ((phy->supported & 4194304U) != 0U && (phy->speed_cap_mask & 8388608U) != 0U) { bnx2x_check_kr2_wa(params, vars, phy); } else { } bnx2x_check_over_curr(params, vars); if ((unsigned int )vars->rx_tx_asic_rst != 0U) { bnx2x_warpcore_config_runtime(phy, params, vars); } else { } tmp___2 = readl((void const volatile *)(bp->regview + ((unsigned long )params->shmem_base + ((unsigned long )params->port + 1UL) * 400UL))); if ((tmp___2 & 251658240U) == 33554432U) { tmp___1 = bnx2x_is_sfp_module_plugged(phy, params); if (tmp___1 != 0) { bnx2x_sfp_tx_fault_detection(phy, params, vars); } else if ((int )vars->link_status < 0) { vars->link_status = vars->link_status & 2147483647U; vars->phy_flags = (unsigned int )vars->phy_flags & 223U; bnx2x_update_mng(params, vars->link_status); } else { } } else { } } else { } return; } } u8 bnx2x_fan_failure_det_req(struct bnx2x *bp , u32 shmem_base , u32 shmem2_base , u8 port ) { u8 phy_index ; u8 fan_failure_det_req ; struct bnx2x_phy phy ; long tmp ; int tmp___0 ; { fan_failure_det_req = 0U; phy_index = 1U; goto ldv_54501; ldv_54500: tmp___0 = bnx2x_populate_phy(bp, (int )phy_index, shmem_base, shmem2_base, (int )port, & phy); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]populate phy failed\n", "bnx2x_fan_failure_det_req", 13700, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0U); } else { } fan_failure_det_req = (u8 )(((int )((signed char )phy.flags) & 4) | (int )((signed char )fan_failure_det_req)); phy_index = (u8 )((int )phy_index + 1); ldv_54501: ; if ((unsigned int )phy_index <= 2U) { goto ldv_54500; } else { } return (fan_failure_det_req); } } void bnx2x_hw_reset_phy(struct link_params *params ) { u8 phy_index ; struct bnx2x *bp ; { bp = params->bp; bnx2x_update_mng(params, 0U); bnx2x_bits_dis(bp, (u32 )(((int )params->port + 16588) * 4), 3965441U); phy_index = 0U; goto ldv_54509; ldv_54508: ; if ((unsigned long )params->phy[(int )phy_index].hw_reset != (unsigned long )((void (*)(struct bnx2x_phy * , struct link_params * ))0)) { (*(params->phy[(int )phy_index].hw_reset))((struct bnx2x_phy *)(& params->phy) + (unsigned long )phy_index, params); params->phy[(int )phy_index] = phy_null; } else { } phy_index = (u8 )((int )phy_index + 1); ldv_54509: ; if ((unsigned int )phy_index <= 2U) { goto ldv_54508; } else { } return; } } void bnx2x_init_mod_abs_int(struct bnx2x *bp , struct link_vars *vars , u32 chip_id , u32 shmem_base , u32 shmem2_base , u8 port ) { u8 gpio_num ; u8 gpio_port ; u8 phy_index ; u32 val ; u32 offset ; u32 aeu_mask ; u32 swap_val ; u32 swap_override ; u32 sync_offset ; int tmp ; struct bnx2x_phy phy ; long tmp___0 ; int tmp___1 ; long tmp___2 ; { gpio_num = 255U; gpio_port = 255U; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { tmp = bnx2x_get_mod_abs_int_cfg(bp, chip_id, shmem_base, (int )port, & gpio_num, & gpio_port); if (tmp != 0) { return; } else { } } else { phy_index = 1U; goto ldv_54532; ldv_54531: tmp___1 = bnx2x_populate_phy(bp, (int )phy_index, shmem_base, shmem2_base, (int )port, & phy); if (tmp___1 != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]populate phy failed\n", "bnx2x_init_mod_abs_int", 13752, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } if (phy.type == 1536U) { gpio_num = 3U; gpio_port = port; goto ldv_54530; } else { } phy_index = (u8 )((int )phy_index + 1); ldv_54532: ; if ((unsigned int )phy_index <= 2U) { goto ldv_54531; } else { } ldv_54530: ; } if ((unsigned int )gpio_num == 255U) { return; } else { } bnx2x_set_gpio(bp, (int )gpio_num, 2U, (int )gpio_port); swap_val = readl((void const volatile *)bp->regview + 66452U); swap_override = readl((void const volatile *)bp->regview + 66456U); gpio_port = (u8 )((int )((signed char )(swap_val != 0U && swap_override != 0U)) ^ (int )((signed char )gpio_port)); vars->aeu_int_mask = (u32 )(4 << ((int )gpio_num + ((int )gpio_port << 2))); sync_offset = ((u32 )port * 400U + shmem_base) + 152U; writel(vars->aeu_int_mask, (void volatile *)bp->regview + (unsigned long )sync_offset); tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting MOD_ABS (GPIO%d_P%d) AEU to 0x%x\n", "bnx2x_init_mod_abs_int", 13782, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )gpio_num, (int )gpio_port, vars->aeu_int_mask); } else { } if ((unsigned int )port == 0U) { offset = 41068U; } else { offset = 41228U; } aeu_mask = readl((void const volatile *)bp->regview + (unsigned long )offset); aeu_mask = vars->aeu_int_mask | aeu_mask; writel(aeu_mask, (void volatile *)bp->regview + (unsigned long )offset); val = readl((void const volatile *)bp->regview + 41660U); val = (u32 )(1 << ((int )gpio_num + ((int )gpio_port << 2))) | val; writel(val, (void volatile *)bp->regview + 41660U); return; } } extern int ldv_probe_16(void) ; extern int ldv_release_14(void) ; extern int ldv_probe_19(void) ; extern int ldv_release_20(void) ; extern int ldv_probe_21(void) ; extern int ldv_probe_26(void) ; extern int ldv_probe_25(void) ; extern int ldv_release_16(void) ; extern int ldv_probe_22(void) ; extern int ldv_probe_24(void) ; extern int ldv_release_18(void) ; extern int ldv_probe_23(void) ; extern int ldv_release_13(void) ; extern int ldv_release_19(void) ; extern int ldv_release_26(void) ; extern int ldv_probe_17(void) ; extern int ldv_probe_20(void) ; extern int ldv_release_22(void) ; extern int ldv_probe_15(void) ; extern int ldv_release_17(void) ; extern int ldv_release_21(void) ; extern int ldv_release_23(void) ; extern int ldv_probe_13(void) ; extern int ldv_probe_14(void) ; extern int ldv_release_25(void) ; extern int ldv_release_24(void) ; extern int ldv_release_15(void) ; extern int ldv_probe_18(void) ; void ldv_initialize_bnx2x_phy_20(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_8706_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_8706_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_8706_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_19(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_8726_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_8726_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_8726_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_16(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_84823_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_84823_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_84823_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_17(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_8481_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_8481_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_8481_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_22(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_8073_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_8073_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_8073_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_25(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_xgxs_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_xgxs_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_xgxs_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_14(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_84834_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_84834_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_84834_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_21(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_8705_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_8705_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_8705_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_18(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_8727_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_8727_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_8727_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_26(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_serdes_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_serdes_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_serdes_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_13(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_54618se_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_54618se_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_54618se_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_15(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_84833_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_84833_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_84833_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_23(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_7101_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_7101_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_7101_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_initialize_bnx2x_phy_24(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = ldv_init_zalloc(32UL); phy_warpcore_group1 = (struct link_vars *)tmp; tmp___0 = ldv_init_zalloc(456UL); phy_warpcore_group0 = (struct link_params *)tmp___0; tmp___1 = ldv_init_zalloc(120UL); phy_warpcore_group2 = (struct bnx2x_phy *)tmp___1; return; } } void ldv_main_exported_25(void) { u32 ldvarg72 ; int tmp ; { ldv_memset((void *)(& ldvarg72), 0, 4UL); tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_25 == 1) { bnx2x_xgxs_specific_func(phy_xgxs_group2, phy_xgxs_group0, ldvarg72); ldv_state_variable_25 = 1; } else { } if (ldv_state_variable_25 == 2) { bnx2x_xgxs_specific_func(phy_xgxs_group2, phy_xgxs_group0, ldvarg72); ldv_state_variable_25 = 2; } else { } goto ldv_54636; case 1: ; if (ldv_state_variable_25 == 1) { bnx2x_set_xgxs_loopback(phy_xgxs_group2, phy_xgxs_group0); ldv_state_variable_25 = 1; } else { } if (ldv_state_variable_25 == 2) { bnx2x_set_xgxs_loopback(phy_xgxs_group2, phy_xgxs_group0); ldv_state_variable_25 = 2; } else { } goto ldv_54636; case 2: ; if (ldv_state_variable_25 == 1) { bnx2x_int_link_reset(phy_xgxs_group2, phy_xgxs_group0); ldv_state_variable_25 = 1; } else { } if (ldv_state_variable_25 == 2) { bnx2x_int_link_reset(phy_xgxs_group2, phy_xgxs_group0); ldv_state_variable_25 = 2; } else { } goto ldv_54636; case 3: ; if (ldv_state_variable_25 == 1) { bnx2x_xgxs_config_init(phy_xgxs_group2, phy_xgxs_group0, phy_xgxs_group1); ldv_state_variable_25 = 1; } else { } if (ldv_state_variable_25 == 2) { bnx2x_xgxs_config_init(phy_xgxs_group2, phy_xgxs_group0, phy_xgxs_group1); ldv_state_variable_25 = 2; } else { } goto ldv_54636; case 4: ; if (ldv_state_variable_25 == 2) { bnx2x_link_settings_status(phy_xgxs_group2, phy_xgxs_group0, phy_xgxs_group1); ldv_state_variable_25 = 2; } else { } goto ldv_54636; case 5: ; if (ldv_state_variable_25 == 2) { ldv_release_25(); ldv_state_variable_25 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54636; case 6: ; if (ldv_state_variable_25 == 1) { ldv_probe_25(); ldv_state_variable_25 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54636; default: ldv_stop(); } ldv_54636: ; return; } } void ldv_main_exported_21(void) { u32 ldvarg16 ; u16 *ldvarg17 ; void *tmp ; u8 *ldvarg18 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(2UL); ldvarg17 = (u16 *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg18 = (u8 *)tmp___0; ldv_memset((void *)(& ldvarg16), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_21 == 1) { bnx2x_null_format_ver(ldvarg16, ldvarg18, ldvarg17); ldv_state_variable_21 = 1; } else { } if (ldv_state_variable_21 == 2) { bnx2x_null_format_ver(ldvarg16, ldvarg18, ldvarg17); ldv_state_variable_21 = 2; } else { } goto ldv_54651; case 1: ; if (ldv_state_variable_21 == 1) { bnx2x_common_ext_link_reset(phy_8705_group2, phy_8705_group0); ldv_state_variable_21 = 1; } else { } if (ldv_state_variable_21 == 2) { bnx2x_common_ext_link_reset(phy_8705_group2, phy_8705_group0); ldv_state_variable_21 = 2; } else { } goto ldv_54651; case 2: ; if (ldv_state_variable_21 == 1) { bnx2x_8705_config_init(phy_8705_group2, phy_8705_group0, phy_8705_group1); ldv_state_variable_21 = 1; } else { } if (ldv_state_variable_21 == 2) { bnx2x_8705_config_init(phy_8705_group2, phy_8705_group0, phy_8705_group1); ldv_state_variable_21 = 2; } else { } goto ldv_54651; case 3: ; if (ldv_state_variable_21 == 2) { bnx2x_8705_read_status(phy_8705_group2, phy_8705_group0, phy_8705_group1); ldv_state_variable_21 = 2; } else { } goto ldv_54651; case 4: ; if (ldv_state_variable_21 == 2) { ldv_release_21(); ldv_state_variable_21 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54651; case 5: ; if (ldv_state_variable_21 == 1) { ldv_probe_21(); ldv_state_variable_21 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54651; default: ldv_stop(); } ldv_54651: ; return; } } void ldv_main_exported_26(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_26 == 1) { bnx2x_int_link_reset(phy_serdes_group2, phy_serdes_group0); ldv_state_variable_26 = 1; } else { } if (ldv_state_variable_26 == 2) { bnx2x_int_link_reset(phy_serdes_group2, phy_serdes_group0); ldv_state_variable_26 = 2; } else { } goto ldv_54662; case 1: ; if (ldv_state_variable_26 == 1) { bnx2x_xgxs_config_init(phy_serdes_group2, phy_serdes_group0, phy_serdes_group1); ldv_state_variable_26 = 1; } else { } if (ldv_state_variable_26 == 2) { bnx2x_xgxs_config_init(phy_serdes_group2, phy_serdes_group0, phy_serdes_group1); ldv_state_variable_26 = 2; } else { } goto ldv_54662; case 2: ; if (ldv_state_variable_26 == 2) { bnx2x_link_settings_status(phy_serdes_group2, phy_serdes_group0, phy_serdes_group1); ldv_state_variable_26 = 2; } else { } goto ldv_54662; case 3: ; if (ldv_state_variable_26 == 2) { ldv_release_26(); ldv_state_variable_26 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54662; case 4: ; if (ldv_state_variable_26 == 1) { ldv_probe_26(); ldv_state_variable_26 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54662; default: ldv_stop(); } ldv_54662: ; return; } } void ldv_main_exported_17(void) { u8 ldvarg19 ; u8 *ldvarg22 ; void *tmp ; u32 ldvarg20 ; u16 *ldvarg21 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg22 = (u8 *)tmp; tmp___0 = ldv_init_zalloc(2UL); ldvarg21 = (u16 *)tmp___0; ldv_memset((void *)(& ldvarg19), 0, 1UL); ldv_memset((void *)(& ldvarg20), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_17 == 1) { bnx2x_848xx_format_ver(ldvarg20, ldvarg22, ldvarg21); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 2) { bnx2x_848xx_format_ver(ldvarg20, ldvarg22, ldvarg21); ldv_state_variable_17 = 2; } else { } goto ldv_54676; case 1: ; if (ldv_state_variable_17 == 1) { bnx2x_8481_hw_reset(phy_8481_group2, phy_8481_group0); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 2) { bnx2x_8481_hw_reset(phy_8481_group2, phy_8481_group0); ldv_state_variable_17 = 2; } else { } goto ldv_54676; case 2: ; if (ldv_state_variable_17 == 1) { bnx2x_848xx_set_link_led(phy_8481_group2, phy_8481_group0, (int )ldvarg19); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 2) { bnx2x_848xx_set_link_led(phy_8481_group2, phy_8481_group0, (int )ldvarg19); ldv_state_variable_17 = 2; } else { } goto ldv_54676; case 3: ; if (ldv_state_variable_17 == 1) { bnx2x_8481_link_reset(phy_8481_group2, phy_8481_group0); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 2) { bnx2x_8481_link_reset(phy_8481_group2, phy_8481_group0); ldv_state_variable_17 = 2; } else { } goto ldv_54676; case 4: ; if (ldv_state_variable_17 == 1) { bnx2x_8481_config_init(phy_8481_group2, phy_8481_group0, phy_8481_group1); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 2) { bnx2x_8481_config_init(phy_8481_group2, phy_8481_group0, phy_8481_group1); ldv_state_variable_17 = 2; } else { } goto ldv_54676; case 5: ; if (ldv_state_variable_17 == 2) { bnx2x_848xx_read_status(phy_8481_group2, phy_8481_group0, phy_8481_group1); ldv_state_variable_17 = 2; } else { } goto ldv_54676; case 6: ; if (ldv_state_variable_17 == 2) { ldv_release_17(); ldv_state_variable_17 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54676; case 7: ; if (ldv_state_variable_17 == 1) { ldv_probe_17(); ldv_state_variable_17 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54676; default: ldv_stop(); } ldv_54676: ; return; } } void ldv_main_exported_20(void) { u32 ldvarg99 ; u16 *ldvarg100 ; void *tmp ; u8 *ldvarg101 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(2UL); ldvarg100 = (u16 *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg101 = (u8 *)tmp___0; ldv_memset((void *)(& ldvarg99), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_20 == 1) { bnx2x_format_ver(ldvarg99, ldvarg101, ldvarg100); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 2) { bnx2x_format_ver(ldvarg99, ldvarg101, ldvarg100); ldv_state_variable_20 = 2; } else { } goto ldv_54692; case 1: ; if (ldv_state_variable_20 == 1) { bnx2x_common_ext_link_reset(phy_8706_group2, phy_8706_group0); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 2) { bnx2x_common_ext_link_reset(phy_8706_group2, phy_8706_group0); ldv_state_variable_20 = 2; } else { } goto ldv_54692; case 2: ; if (ldv_state_variable_20 == 1) { bnx2x_8706_config_init(phy_8706_group2, phy_8706_group0, phy_8706_group1); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 2) { bnx2x_8706_config_init(phy_8706_group2, phy_8706_group0, phy_8706_group1); ldv_state_variable_20 = 2; } else { } goto ldv_54692; case 3: ; if (ldv_state_variable_20 == 2) { bnx2x_8706_read_status(phy_8706_group2, phy_8706_group0, phy_8706_group1); ldv_state_variable_20 = 2; } else { } goto ldv_54692; case 4: ; if (ldv_state_variable_20 == 2) { ldv_release_20(); ldv_state_variable_20 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54692; case 5: ; if (ldv_state_variable_20 == 1) { ldv_probe_20(); ldv_state_variable_20 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54692; default: ldv_stop(); } ldv_54692: ; return; } } void ldv_main_exported_15(void) { u32 ldvarg109 ; u8 ldvarg107 ; u32 ldvarg108 ; u16 *ldvarg110 ; void *tmp ; u8 *ldvarg111 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(2UL); ldvarg110 = (u16 *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg111 = (u8 *)tmp___0; ldv_memset((void *)(& ldvarg109), 0, 4UL); ldv_memset((void *)(& ldvarg107), 0, 1UL); ldv_memset((void *)(& ldvarg108), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_15 == 1) { bnx2x_848xx_format_ver(ldvarg109, ldvarg111, ldvarg110); ldv_state_variable_15 = 1; } else { } if (ldv_state_variable_15 == 2) { bnx2x_848xx_format_ver(ldvarg109, ldvarg111, ldvarg110); ldv_state_variable_15 = 2; } else { } goto ldv_54708; case 1: ; if (ldv_state_variable_15 == 1) { bnx2x_84833_hw_reset_phy(phy_84833_group2, phy_84833_group0); ldv_state_variable_15 = 1; } else { } if (ldv_state_variable_15 == 2) { bnx2x_84833_hw_reset_phy(phy_84833_group2, phy_84833_group0); ldv_state_variable_15 = 2; } else { } goto ldv_54708; case 2: ; if (ldv_state_variable_15 == 1) { bnx2x_848xx_specific_func(phy_84833_group2, phy_84833_group0, ldvarg108); ldv_state_variable_15 = 1; } else { } if (ldv_state_variable_15 == 2) { bnx2x_848xx_specific_func(phy_84833_group2, phy_84833_group0, ldvarg108); ldv_state_variable_15 = 2; } else { } goto ldv_54708; case 3: ; if (ldv_state_variable_15 == 1) { bnx2x_848xx_set_link_led(phy_84833_group2, phy_84833_group0, (int )ldvarg107); ldv_state_variable_15 = 1; } else { } if (ldv_state_variable_15 == 2) { bnx2x_848xx_set_link_led(phy_84833_group2, phy_84833_group0, (int )ldvarg107); ldv_state_variable_15 = 2; } else { } goto ldv_54708; case 4: ; if (ldv_state_variable_15 == 1) { bnx2x_848x3_link_reset(phy_84833_group2, phy_84833_group0); ldv_state_variable_15 = 1; } else { } if (ldv_state_variable_15 == 2) { bnx2x_848x3_link_reset(phy_84833_group2, phy_84833_group0); ldv_state_variable_15 = 2; } else { } goto ldv_54708; case 5: ; if (ldv_state_variable_15 == 1) { bnx2x_848x3_config_init(phy_84833_group2, phy_84833_group0, phy_84833_group1); ldv_state_variable_15 = 1; } else { } if (ldv_state_variable_15 == 2) { bnx2x_848x3_config_init(phy_84833_group2, phy_84833_group0, phy_84833_group1); ldv_state_variable_15 = 2; } else { } goto ldv_54708; case 6: ; if (ldv_state_variable_15 == 2) { bnx2x_848xx_read_status(phy_84833_group2, phy_84833_group0, phy_84833_group1); ldv_state_variable_15 = 2; } else { } goto ldv_54708; case 7: ; if (ldv_state_variable_15 == 2) { ldv_release_15(); ldv_state_variable_15 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54708; case 8: ; if (ldv_state_variable_15 == 1) { ldv_probe_15(); ldv_state_variable_15 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54708; default: ldv_stop(); } ldv_54708: ; return; } } void ldv_main_exported_14(void) { u32 ldvarg103 ; u16 *ldvarg105 ; void *tmp ; u8 *ldvarg106 ; void *tmp___0 ; u8 ldvarg102 ; u32 ldvarg104 ; int tmp___1 ; { tmp = ldv_init_zalloc(2UL); ldvarg105 = (u16 *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg106 = (u8 *)tmp___0; ldv_memset((void *)(& ldvarg103), 0, 4UL); ldv_memset((void *)(& ldvarg102), 0, 1UL); ldv_memset((void *)(& ldvarg104), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_14 == 1) { bnx2x_848xx_format_ver(ldvarg104, ldvarg106, ldvarg105); ldv_state_variable_14 = 1; } else { } if (ldv_state_variable_14 == 2) { bnx2x_848xx_format_ver(ldvarg104, ldvarg106, ldvarg105); ldv_state_variable_14 = 2; } else { } goto ldv_54727; case 1: ; if (ldv_state_variable_14 == 1) { bnx2x_84833_hw_reset_phy(phy_84834_group2, phy_84834_group0); ldv_state_variable_14 = 1; } else { } if (ldv_state_variable_14 == 2) { bnx2x_84833_hw_reset_phy(phy_84834_group2, phy_84834_group0); ldv_state_variable_14 = 2; } else { } goto ldv_54727; case 2: ; if (ldv_state_variable_14 == 1) { bnx2x_848xx_specific_func(phy_84834_group2, phy_84834_group0, ldvarg103); ldv_state_variable_14 = 1; } else { } if (ldv_state_variable_14 == 2) { bnx2x_848xx_specific_func(phy_84834_group2, phy_84834_group0, ldvarg103); ldv_state_variable_14 = 2; } else { } goto ldv_54727; case 3: ; if (ldv_state_variable_14 == 1) { bnx2x_848xx_set_link_led(phy_84834_group2, phy_84834_group0, (int )ldvarg102); ldv_state_variable_14 = 1; } else { } if (ldv_state_variable_14 == 2) { bnx2x_848xx_set_link_led(phy_84834_group2, phy_84834_group0, (int )ldvarg102); ldv_state_variable_14 = 2; } else { } goto ldv_54727; case 4: ; if (ldv_state_variable_14 == 1) { bnx2x_848x3_link_reset(phy_84834_group2, phy_84834_group0); ldv_state_variable_14 = 1; } else { } if (ldv_state_variable_14 == 2) { bnx2x_848x3_link_reset(phy_84834_group2, phy_84834_group0); ldv_state_variable_14 = 2; } else { } goto ldv_54727; case 5: ; if (ldv_state_variable_14 == 1) { bnx2x_848x3_config_init(phy_84834_group2, phy_84834_group0, phy_84834_group1); ldv_state_variable_14 = 1; } else { } if (ldv_state_variable_14 == 2) { bnx2x_848x3_config_init(phy_84834_group2, phy_84834_group0, phy_84834_group1); ldv_state_variable_14 = 2; } else { } goto ldv_54727; case 6: ; if (ldv_state_variable_14 == 2) { bnx2x_848xx_read_status(phy_84834_group2, phy_84834_group0, phy_84834_group1); ldv_state_variable_14 = 2; } else { } goto ldv_54727; case 7: ; if (ldv_state_variable_14 == 2) { ldv_release_14(); ldv_state_variable_14 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54727; case 8: ; if (ldv_state_variable_14 == 1) { ldv_probe_14(); ldv_state_variable_14 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54727; default: ldv_stop(); } ldv_54727: ; return; } } void ldv_main_exported_22(void) { u32 ldvarg23 ; u16 *ldvarg25 ; void *tmp ; u8 *ldvarg26 ; void *tmp___0 ; u32 ldvarg24 ; int tmp___1 ; { tmp = ldv_init_zalloc(2UL); ldvarg25 = (u16 *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg26 = (u8 *)tmp___0; ldv_memset((void *)(& ldvarg23), 0, 4UL); ldv_memset((void *)(& ldvarg24), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_22 == 1) { bnx2x_format_ver(ldvarg24, ldvarg26, ldvarg25); ldv_state_variable_22 = 1; } else { } if (ldv_state_variable_22 == 2) { bnx2x_format_ver(ldvarg24, ldvarg26, ldvarg25); ldv_state_variable_22 = 2; } else { } goto ldv_54745; case 1: ; if (ldv_state_variable_22 == 1) { bnx2x_8073_specific_func(phy_8073_group2, phy_8073_group0, ldvarg23); ldv_state_variable_22 = 1; } else { } if (ldv_state_variable_22 == 2) { bnx2x_8073_specific_func(phy_8073_group2, phy_8073_group0, ldvarg23); ldv_state_variable_22 = 2; } else { } goto ldv_54745; case 2: ; if (ldv_state_variable_22 == 1) { bnx2x_8073_link_reset(phy_8073_group2, phy_8073_group0); ldv_state_variable_22 = 1; } else { } if (ldv_state_variable_22 == 2) { bnx2x_8073_link_reset(phy_8073_group2, phy_8073_group0); ldv_state_variable_22 = 2; } else { } goto ldv_54745; case 3: ; if (ldv_state_variable_22 == 1) { bnx2x_8073_config_init(phy_8073_group2, phy_8073_group0, phy_8073_group1); ldv_state_variable_22 = 1; } else { } if (ldv_state_variable_22 == 2) { bnx2x_8073_config_init(phy_8073_group2, phy_8073_group0, phy_8073_group1); ldv_state_variable_22 = 2; } else { } goto ldv_54745; case 4: ; if (ldv_state_variable_22 == 2) { bnx2x_8073_read_status(phy_8073_group2, phy_8073_group0, phy_8073_group1); ldv_state_variable_22 = 2; } else { } goto ldv_54745; case 5: ; if (ldv_state_variable_22 == 2) { ldv_release_22(); ldv_state_variable_22 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54745; case 6: ; if (ldv_state_variable_22 == 1) { ldv_probe_22(); ldv_state_variable_22 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54745; default: ldv_stop(); } ldv_54745: ; return; } } void ldv_main_exported_18(void) { u16 *ldvarg30 ; void *tmp ; u32 ldvarg28 ; u32 ldvarg29 ; u8 *ldvarg31 ; void *tmp___0 ; u8 ldvarg27 ; int tmp___1 ; { tmp = ldv_init_zalloc(2UL); ldvarg30 = (u16 *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg31 = (u8 *)tmp___0; ldv_memset((void *)(& ldvarg28), 0, 4UL); ldv_memset((void *)(& ldvarg29), 0, 4UL); ldv_memset((void *)(& ldvarg27), 0, 1UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_18 == 1) { bnx2x_format_ver(ldvarg29, ldvarg31, ldvarg30); ldv_state_variable_18 = 1; } else { } if (ldv_state_variable_18 == 2) { bnx2x_format_ver(ldvarg29, ldvarg31, ldvarg30); ldv_state_variable_18 = 2; } else { } goto ldv_54762; case 1: ; if (ldv_state_variable_18 == 1) { bnx2x_8727_hw_reset(phy_8727_group2, phy_8727_group0); ldv_state_variable_18 = 1; } else { } if (ldv_state_variable_18 == 2) { bnx2x_8727_hw_reset(phy_8727_group2, phy_8727_group0); ldv_state_variable_18 = 2; } else { } goto ldv_54762; case 2: ; if (ldv_state_variable_18 == 1) { bnx2x_8727_specific_func(phy_8727_group2, phy_8727_group0, ldvarg28); ldv_state_variable_18 = 1; } else { } if (ldv_state_variable_18 == 2) { bnx2x_8727_specific_func(phy_8727_group2, phy_8727_group0, ldvarg28); ldv_state_variable_18 = 2; } else { } goto ldv_54762; case 3: ; if (ldv_state_variable_18 == 1) { bnx2x_8727_set_link_led(phy_8727_group2, phy_8727_group0, (int )ldvarg27); ldv_state_variable_18 = 1; } else { } if (ldv_state_variable_18 == 2) { bnx2x_8727_set_link_led(phy_8727_group2, phy_8727_group0, (int )ldvarg27); ldv_state_variable_18 = 2; } else { } goto ldv_54762; case 4: ; if (ldv_state_variable_18 == 1) { bnx2x_8727_link_reset(phy_8727_group2, phy_8727_group0); ldv_state_variable_18 = 1; } else { } if (ldv_state_variable_18 == 2) { bnx2x_8727_link_reset(phy_8727_group2, phy_8727_group0); ldv_state_variable_18 = 2; } else { } goto ldv_54762; case 5: ; if (ldv_state_variable_18 == 1) { bnx2x_8727_config_init(phy_8727_group2, phy_8727_group0, phy_8727_group1); ldv_state_variable_18 = 1; } else { } if (ldv_state_variable_18 == 2) { bnx2x_8727_config_init(phy_8727_group2, phy_8727_group0, phy_8727_group1); ldv_state_variable_18 = 2; } else { } goto ldv_54762; case 6: ; if (ldv_state_variable_18 == 2) { bnx2x_8727_read_status(phy_8727_group2, phy_8727_group0, phy_8727_group1); ldv_state_variable_18 = 2; } else { } goto ldv_54762; case 7: ; if (ldv_state_variable_18 == 2) { ldv_release_18(); ldv_state_variable_18 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54762; case 8: ; if (ldv_state_variable_18 == 1) { ldv_probe_18(); ldv_state_variable_18 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54762; default: ldv_stop(); } ldv_54762: ; return; } } void ldv_main_exported_24(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_24 == 1) { bnx2x_warpcore_hw_reset(phy_warpcore_group2, phy_warpcore_group0); ldv_state_variable_24 = 1; } else { } if (ldv_state_variable_24 == 2) { bnx2x_warpcore_hw_reset(phy_warpcore_group2, phy_warpcore_group0); ldv_state_variable_24 = 2; } else { } goto ldv_54776; case 1: ; if (ldv_state_variable_24 == 1) { bnx2x_set_warpcore_loopback(phy_warpcore_group2, phy_warpcore_group0); ldv_state_variable_24 = 1; } else { } if (ldv_state_variable_24 == 2) { bnx2x_set_warpcore_loopback(phy_warpcore_group2, phy_warpcore_group0); ldv_state_variable_24 = 2; } else { } goto ldv_54776; case 2: ; if (ldv_state_variable_24 == 1) { bnx2x_warpcore_link_reset(phy_warpcore_group2, phy_warpcore_group0); ldv_state_variable_24 = 1; } else { } if (ldv_state_variable_24 == 2) { bnx2x_warpcore_link_reset(phy_warpcore_group2, phy_warpcore_group0); ldv_state_variable_24 = 2; } else { } goto ldv_54776; case 3: ; if (ldv_state_variable_24 == 1) { bnx2x_warpcore_config_init(phy_warpcore_group2, phy_warpcore_group0, phy_warpcore_group1); ldv_state_variable_24 = 1; } else { } if (ldv_state_variable_24 == 2) { bnx2x_warpcore_config_init(phy_warpcore_group2, phy_warpcore_group0, phy_warpcore_group1); ldv_state_variable_24 = 2; } else { } goto ldv_54776; case 4: ; if (ldv_state_variable_24 == 2) { bnx2x_warpcore_read_status(phy_warpcore_group2, phy_warpcore_group0, phy_warpcore_group1); ldv_state_variable_24 = 2; } else { } goto ldv_54776; case 5: ; if (ldv_state_variable_24 == 2) { ldv_release_24(); ldv_state_variable_24 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54776; case 6: ; if (ldv_state_variable_24 == 1) { ldv_probe_24(); ldv_state_variable_24 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54776; default: ldv_stop(); } ldv_54776: ; return; } } void ldv_main_exported_23(void) { u32 ldvarg59 ; u16 *ldvarg60 ; void *tmp ; u8 *ldvarg61 ; void *tmp___0 ; u8 ldvarg58 ; int tmp___1 ; { tmp = ldv_init_zalloc(2UL); ldvarg60 = (u16 *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg61 = (u8 *)tmp___0; ldv_memset((void *)(& ldvarg59), 0, 4UL); ldv_memset((void *)(& ldvarg58), 0, 1UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_23 == 1) { bnx2x_7101_format_ver(ldvarg59, ldvarg61, ldvarg60); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { bnx2x_7101_format_ver(ldvarg59, ldvarg61, ldvarg60); ldv_state_variable_23 = 2; } else { } goto ldv_54792; case 1: ; if (ldv_state_variable_23 == 1) { bnx2x_7101_hw_reset(phy_7101_group2, phy_7101_group0); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { bnx2x_7101_hw_reset(phy_7101_group2, phy_7101_group0); ldv_state_variable_23 = 2; } else { } goto ldv_54792; case 2: ; if (ldv_state_variable_23 == 1) { bnx2x_7101_set_link_led(phy_7101_group2, phy_7101_group0, (int )ldvarg58); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { bnx2x_7101_set_link_led(phy_7101_group2, phy_7101_group0, (int )ldvarg58); ldv_state_variable_23 = 2; } else { } goto ldv_54792; case 3: ; if (ldv_state_variable_23 == 1) { bnx2x_7101_config_loopback(phy_7101_group2, phy_7101_group0); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { bnx2x_7101_config_loopback(phy_7101_group2, phy_7101_group0); ldv_state_variable_23 = 2; } else { } goto ldv_54792; case 4: ; if (ldv_state_variable_23 == 1) { bnx2x_common_ext_link_reset(phy_7101_group2, phy_7101_group0); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { bnx2x_common_ext_link_reset(phy_7101_group2, phy_7101_group0); ldv_state_variable_23 = 2; } else { } goto ldv_54792; case 5: ; if (ldv_state_variable_23 == 1) { bnx2x_7101_config_init(phy_7101_group2, phy_7101_group0, phy_7101_group1); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { bnx2x_7101_config_init(phy_7101_group2, phy_7101_group0, phy_7101_group1); ldv_state_variable_23 = 2; } else { } goto ldv_54792; case 6: ; if (ldv_state_variable_23 == 2) { bnx2x_7101_read_status(phy_7101_group2, phy_7101_group0, phy_7101_group1); ldv_state_variable_23 = 2; } else { } goto ldv_54792; case 7: ; if (ldv_state_variable_23 == 2) { ldv_release_23(); ldv_state_variable_23 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54792; case 8: ; if (ldv_state_variable_23 == 1) { ldv_probe_23(); ldv_state_variable_23 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54792; default: ldv_stop(); } ldv_54792: ; return; } } void ldv_main_exported_13(void) { u32 ldvarg68 ; u8 ldvarg67 ; int tmp ; { ldv_memset((void *)(& ldvarg68), 0, 4UL); ldv_memset((void *)(& ldvarg67), 0, 1UL); tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_13 == 1) { bnx2x_54618se_specific_func(phy_54618se_group2, phy_54618se_group0, ldvarg68); ldv_state_variable_13 = 1; } else { } if (ldv_state_variable_13 == 2) { bnx2x_54618se_specific_func(phy_54618se_group2, phy_54618se_group0, ldvarg68); ldv_state_variable_13 = 2; } else { } goto ldv_54808; case 1: ; if (ldv_state_variable_13 == 1) { bnx2x_5461x_set_link_led(phy_54618se_group2, phy_54618se_group0, (int )ldvarg67); ldv_state_variable_13 = 1; } else { } if (ldv_state_variable_13 == 2) { bnx2x_5461x_set_link_led(phy_54618se_group2, phy_54618se_group0, (int )ldvarg67); ldv_state_variable_13 = 2; } else { } goto ldv_54808; case 2: ; if (ldv_state_variable_13 == 1) { bnx2x_54618se_config_loopback(phy_54618se_group2, phy_54618se_group0); ldv_state_variable_13 = 1; } else { } if (ldv_state_variable_13 == 2) { bnx2x_54618se_config_loopback(phy_54618se_group2, phy_54618se_group0); ldv_state_variable_13 = 2; } else { } goto ldv_54808; case 3: ; if (ldv_state_variable_13 == 1) { bnx2x_54618se_link_reset(phy_54618se_group2, phy_54618se_group0); ldv_state_variable_13 = 1; } else { } if (ldv_state_variable_13 == 2) { bnx2x_54618se_link_reset(phy_54618se_group2, phy_54618se_group0); ldv_state_variable_13 = 2; } else { } goto ldv_54808; case 4: ; if (ldv_state_variable_13 == 1) { bnx2x_54618se_config_init(phy_54618se_group2, phy_54618se_group0, phy_54618se_group1); ldv_state_variable_13 = 1; } else { } if (ldv_state_variable_13 == 2) { bnx2x_54618se_config_init(phy_54618se_group2, phy_54618se_group0, phy_54618se_group1); ldv_state_variable_13 = 2; } else { } goto ldv_54808; case 5: ; if (ldv_state_variable_13 == 2) { bnx2x_54618se_read_status(phy_54618se_group2, phy_54618se_group0, phy_54618se_group1); ldv_state_variable_13 = 2; } else { } goto ldv_54808; case 6: ; if (ldv_state_variable_13 == 2) { ldv_release_13(); ldv_state_variable_13 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54808; case 7: ; if (ldv_state_variable_13 == 1) { ldv_probe_13(); ldv_state_variable_13 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54808; default: ldv_stop(); } ldv_54808: ; return; } } void ldv_main_exported_16(void) { u8 ldvarg62 ; u32 ldvarg64 ; u8 *ldvarg66 ; void *tmp ; u32 ldvarg63 ; u16 *ldvarg65 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg66 = (u8 *)tmp; tmp___0 = ldv_init_zalloc(2UL); ldvarg65 = (u16 *)tmp___0; ldv_memset((void *)(& ldvarg62), 0, 1UL); ldv_memset((void *)(& ldvarg64), 0, 4UL); ldv_memset((void *)(& ldvarg63), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_16 == 1) { bnx2x_848xx_format_ver(ldvarg64, ldvarg66, ldvarg65); ldv_state_variable_16 = 1; } else { } if (ldv_state_variable_16 == 2) { bnx2x_848xx_format_ver(ldvarg64, ldvarg66, ldvarg65); ldv_state_variable_16 = 2; } else { } goto ldv_54826; case 1: ; if (ldv_state_variable_16 == 1) { bnx2x_848xx_specific_func(phy_84823_group2, phy_84823_group0, ldvarg63); ldv_state_variable_16 = 1; } else { } if (ldv_state_variable_16 == 2) { bnx2x_848xx_specific_func(phy_84823_group2, phy_84823_group0, ldvarg63); ldv_state_variable_16 = 2; } else { } goto ldv_54826; case 2: ; if (ldv_state_variable_16 == 1) { bnx2x_848xx_set_link_led(phy_84823_group2, phy_84823_group0, (int )ldvarg62); ldv_state_variable_16 = 1; } else { } if (ldv_state_variable_16 == 2) { bnx2x_848xx_set_link_led(phy_84823_group2, phy_84823_group0, (int )ldvarg62); ldv_state_variable_16 = 2; } else { } goto ldv_54826; case 3: ; if (ldv_state_variable_16 == 1) { bnx2x_848x3_link_reset(phy_84823_group2, phy_84823_group0); ldv_state_variable_16 = 1; } else { } if (ldv_state_variable_16 == 2) { bnx2x_848x3_link_reset(phy_84823_group2, phy_84823_group0); ldv_state_variable_16 = 2; } else { } goto ldv_54826; case 4: ; if (ldv_state_variable_16 == 1) { bnx2x_848x3_config_init(phy_84823_group2, phy_84823_group0, phy_84823_group1); ldv_state_variable_16 = 1; } else { } if (ldv_state_variable_16 == 2) { bnx2x_848x3_config_init(phy_84823_group2, phy_84823_group0, phy_84823_group1); ldv_state_variable_16 = 2; } else { } goto ldv_54826; case 5: ; if (ldv_state_variable_16 == 2) { bnx2x_848xx_read_status(phy_84823_group2, phy_84823_group0, phy_84823_group1); ldv_state_variable_16 = 2; } else { } goto ldv_54826; case 6: ; if (ldv_state_variable_16 == 2) { ldv_release_16(); ldv_state_variable_16 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54826; case 7: ; if (ldv_state_variable_16 == 1) { ldv_probe_16(); ldv_state_variable_16 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54826; default: ldv_stop(); } ldv_54826: ; return; } } void ldv_main_exported_19(void) { u8 *ldvarg114 ; void *tmp ; u16 *ldvarg113 ; void *tmp___0 ; u32 ldvarg112 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg114 = (u8 *)tmp; tmp___0 = ldv_init_zalloc(2UL); ldvarg113 = (u16 *)tmp___0; ldv_memset((void *)(& ldvarg112), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_19 == 1) { bnx2x_format_ver(ldvarg112, ldvarg114, ldvarg113); ldv_state_variable_19 = 1; } else { } if (ldv_state_variable_19 == 2) { bnx2x_format_ver(ldvarg112, ldvarg114, ldvarg113); ldv_state_variable_19 = 2; } else { } goto ldv_54842; case 1: ; if (ldv_state_variable_19 == 1) { bnx2x_8726_config_loopback(phy_8726_group2, phy_8726_group0); ldv_state_variable_19 = 1; } else { } if (ldv_state_variable_19 == 2) { bnx2x_8726_config_loopback(phy_8726_group2, phy_8726_group0); ldv_state_variable_19 = 2; } else { } goto ldv_54842; case 2: ; if (ldv_state_variable_19 == 1) { bnx2x_8726_link_reset(phy_8726_group2, phy_8726_group0); ldv_state_variable_19 = 1; } else { } if (ldv_state_variable_19 == 2) { bnx2x_8726_link_reset(phy_8726_group2, phy_8726_group0); ldv_state_variable_19 = 2; } else { } goto ldv_54842; case 3: ; if (ldv_state_variable_19 == 1) { bnx2x_8726_config_init(phy_8726_group2, phy_8726_group0, phy_8726_group1); ldv_state_variable_19 = 1; } else { } if (ldv_state_variable_19 == 2) { bnx2x_8726_config_init(phy_8726_group2, phy_8726_group0, phy_8726_group1); ldv_state_variable_19 = 2; } else { } goto ldv_54842; case 4: ; if (ldv_state_variable_19 == 2) { bnx2x_8726_read_status(phy_8726_group2, phy_8726_group0, phy_8726_group1); ldv_state_variable_19 = 2; } else { } goto ldv_54842; case 5: ; if (ldv_state_variable_19 == 2) { ldv_release_19(); ldv_state_variable_19 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54842; case 6: ; if (ldv_state_variable_19 == 1) { ldv_probe_19(); ldv_state_variable_19 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54842; default: ldv_stop(); } ldv_54842: ; return; } } bool ldv_queue_work_on_65(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_66(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_67(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_68(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_69(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static void __write_once_size(void volatile *p , void *res , int size ) { { switch (size) { case 1: *((__u8 volatile *)p) = *((__u8 *)res); goto ldv_891; case 2: *((__u16 volatile *)p) = *((__u16 *)res); goto ldv_891; case 4: *((__u32 volatile *)p) = *((__u32 *)res); goto ldv_891; case 8: *((__u64 volatile *)p) = *((__u64 *)res); goto ldv_891; default: __asm__ volatile ("": : : "memory"); __builtin_memcpy((void *)p, (void const *)res, (unsigned long )size); __asm__ volatile ("": : : "memory"); } ldv_891: ; return; } } __inline static void le16_add_cpu(__le16 *var , u16 val ) { { *var = (int )*var + (int )val; return; } } extern void dump_stack(void) ; extern unsigned long __phys_addr(unsigned long ) ; extern int memcmp(void const * , void const * , size_t ) ; extern size_t strlen(char const * ) ; extern void __cmpxchg_wrong_size(void) ; extern void dump_page(struct page * , char const * ) ; int ldv_mod_timer_90(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_del_timer_sync_91(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_79(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_81(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_80(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_83(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_82(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_work___0(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = ldv_queue_work_on_79(8192, wq, work); return (tmp); } } __inline static bool queue_delayed_work___0(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = ldv_queue_delayed_work_on_80(8192, wq, dwork, delay); return (tmp); } } __inline static bool schedule_work___0(struct work_struct *work ) { bool tmp ; { tmp = queue_work___0(system_wq, work); return (tmp); } } __inline static bool schedule_delayed_work___0(struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = queue_delayed_work___0(system_wq, dwork, delay); return (tmp); } } extern struct page *alloc_pages_current(gfp_t , unsigned int ) ; __inline static struct page *alloc_pages(gfp_t gfp_mask , unsigned int order ) { struct page *tmp ; { tmp = alloc_pages_current(gfp_mask, order); return (tmp); } } extern unsigned long __get_free_pages(gfp_t , unsigned int ) ; extern void __free_page_frag(void * ) ; int ldv_irq_3(int state , int line , void *data ) ; void disable_suitable_irq_2(int line , void *data ) ; void activate_suitable_irq_3(int line , void *data ) ; int reg_check_1(irqreturn_t (*handler)(int , void * ) ) ; void disable_suitable_irq_1(int line , void *data ) ; void activate_suitable_irq_1(int line , void *data ) ; int ldv_irq_2(int state , int line , void *data ) ; void choose_interrupt_2(void) ; void activate_suitable_irq_2(int line , void *data ) ; void choose_interrupt_1(void) ; int reg_check_2(irqreturn_t (*handler)(int , void * ) ) ; void disable_suitable_irq_3(int line , void *data ) ; int reg_check_3(irqreturn_t (*handler)(int , void * ) ) ; int ldv_irq_1(int state , int line , void *data ) ; void choose_interrupt_3(void) ; __inline static void kmemcheck_mark_initialized(void *address , unsigned int n ) { { return; } } __inline static __sum16 csum_fold(__wsum sum ) { { __asm__ (" addl %1,%0\n adcl $0xffff,%0": "=r" (sum): "r" (sum << 16), "0" (sum & 4294901760U)); return ((__sum16 )(~ sum >> 16)); } } __inline static __wsum csum_tcpudp_nofold(__be32 saddr , __be32 daddr , unsigned short len , unsigned short proto , __wsum sum ) { { __asm__ (" addl %1, %0\n adcl %2, %0\n adcl %3, %0\n adcl $0, %0\n": "=r" (sum): "g" (daddr), "g" (saddr), "g" (((int )len + (int )proto) << 8), "0" (sum)); return (sum); } } __inline static __sum16 csum_tcpudp_magic(__be32 saddr , __be32 daddr , unsigned short len , unsigned short proto , __wsum sum ) { __wsum tmp ; __sum16 tmp___0 ; { tmp = csum_tcpudp_nofold(saddr, daddr, (int )len, (int )proto, sum); tmp___0 = csum_fold(tmp); return (tmp___0); } } extern __wsum csum_partial(void const * , int , __wsum ) ; extern __sum16 csum_ipv6_magic(struct in6_addr const * , struct in6_addr const * , __u32 , unsigned short , __wsum ) ; __inline static unsigned int add32_with_carry(unsigned int a , unsigned int b ) { { __asm__ ("addl %2,%0\n\tadcl $0,%0": "=r" (a): "0" (a), "rm" (b)); return (a); } } __inline static __wsum csum_add(__wsum csum , __wsum addend ) { unsigned int tmp ; { tmp = add32_with_carry(csum, addend); return (tmp); } } __inline static __wsum csum_sub(__wsum csum , __wsum addend ) { __wsum tmp ; { tmp = csum_add(csum, ~ addend); return (tmp); } } __inline static int PageTail(struct page const *page ) { int tmp ; { tmp = constant_test_bit(15L, (unsigned long const volatile *)(& page->flags)); return (tmp); } } __inline static struct page *compound_head_by_tail(struct page *tail ) { struct page *head ; int tmp ; long tmp___0 ; { head = tail->__annonCompField46.first_page; __asm__ volatile ("": : : "memory"); tmp = PageTail((struct page const *)tail); tmp___0 = ldv__builtin_expect(tmp != 0, 1L); if (tmp___0 != 0L) { return (head); } else { } return (tail); } } __inline static struct page *compound_head(struct page *page ) { struct page *tmp ; int tmp___0 ; long tmp___1 ; { tmp___0 = PageTail((struct page const *)page); tmp___1 = ldv__builtin_expect(tmp___0 != 0, 0L); if (tmp___1 != 0L) { tmp = compound_head_by_tail(page); return (tmp); } else { } return (page); } } extern bool __get_page_tail(struct page * ) ; __inline static void get_page(struct page *page ) { bool tmp ; long tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; long tmp___4 ; { tmp___1 = PageTail((struct page const *)page); tmp___2 = ldv__builtin_expect(tmp___1 != 0, 0L); if (tmp___2 != 0L) { tmp = __get_page_tail(page); tmp___0 = ldv__builtin_expect((long )tmp, 1L); if (tmp___0 != 0L) { return; } else { } } else { } tmp___3 = atomic_read((atomic_t const *)(& page->__annonCompField42.__annonCompField41.__annonCompField40._count)); tmp___4 = ldv__builtin_expect(tmp___3 <= 0, 0L); if (tmp___4 != 0L) { dump_page(page, "VM_BUG_ON_PAGE(atomic_read(&page->_count) <= 0)"); __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/mm.h"), "i" (543), "i" (12UL)); ldv_24014: ; goto ldv_24014; } else { } atomic_inc(& page->__annonCompField42.__annonCompField41.__annonCompField40._count); return; } } __inline static void *lowmem_page_address(struct page const *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 64L) << 12) + 0xffff880000000000UL)); } } extern void debug_dma_map_page(struct device * , struct page * , size_t , size_t , int , dma_addr_t , bool ) ; extern void debug_dma_mapping_error(struct device * , dma_addr_t ) ; extern void debug_dma_sync_single_for_cpu(struct device * , dma_addr_t , size_t , int ) ; __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_26066: ; goto ldv_26066; } 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_26075: ; goto ldv_26075; } 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 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_26110: ; goto ldv_26110; } 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 void dma_unmap_page___0(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_26118: ; goto ldv_26118; } 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_sync_single_for_cpu(struct device *dev , dma_addr_t addr , size_t size , enum dma_data_direction dir ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int tmp___0 ; long tmp___1 ; { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (108), "i" (12UL)); ldv_26126: ; goto ldv_26126; } else { } if ((unsigned long )ops->sync_single_for_cpu != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction ))0)) { (*(ops->sync_single_for_cpu))(dev, addr, size, dir); } else { } debug_dma_sync_single_for_cpu(dev, addr, size, (int )dir); return; } } __inline static int dma_mapping_error(struct device *dev , dma_addr_t dma_addr ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int tmp___0 ; { tmp = get_dma_ops(dev); ops = tmp; debug_dma_mapping_error(dev, dma_addr); if ((unsigned long )ops->mapping_error != (unsigned long )((int (*)(struct device * , dma_addr_t ))0)) { tmp___0 = (*(ops->mapping_error))(dev, dma_addr); return (tmp___0); } else { } return (dma_addr == 0ULL); } } __inline static unsigned int skb_frag_size(skb_frag_t const *frag ) { { return ((unsigned int )frag->size); } } __inline static void skb_frag_size_set(skb_frag_t *frag , unsigned int size ) { { frag->size = size; return; } } extern void consume_skb(struct sk_buff * ) ; extern struct sk_buff *build_skb(void * , unsigned int ) ; __inline static void skb_set_hash(struct sk_buff *skb , __u32 hash , enum pkt_hash_types type ) { { skb->l4_hash = (unsigned int )type == 3U; skb->sw_hash = 0U; skb->hash = hash; return; } } __inline static struct sk_buff *skb_get(struct sk_buff *skb ) { { atomic_inc(& skb->users); return (skb); } } __inline static bool skb_is_nonlinear(struct sk_buff const *skb ) { { return ((unsigned int )skb->data_len != 0U); } } __inline static void __skb_fill_page_desc(struct sk_buff *skb , int i , struct page *page , int off , int size ) { skb_frag_t *frag ; unsigned char *tmp ; { tmp = skb_end_pointer((struct sk_buff const *)skb); frag = (skb_frag_t *)(& ((struct skb_shared_info *)tmp)->frags) + (unsigned long )i; frag->page.p = page; frag->page_offset = (__u32 )off; skb_frag_size_set(frag, (unsigned int )size); page = compound_head(page); if ((int )page->__annonCompField42.__annonCompField37.pfmemalloc && (unsigned long )page->__annonCompField36.mapping == (unsigned long )((struct address_space *)0)) { skb->pfmemalloc = 1U; } else { } return; } } __inline static void skb_fill_page_desc(struct sk_buff *skb , int i , struct page *page , int off , int size ) { unsigned char *tmp ; { __skb_fill_page_desc(skb, i, page, off, size); tmp = skb_end_pointer((struct sk_buff const *)skb); ((struct skb_shared_info *)tmp)->nr_frags = (unsigned int )((unsigned char )i) + 1U; return; } } extern unsigned char *skb_put(struct sk_buff * , unsigned int ) ; __inline static void skb_reserve(struct sk_buff *skb , int len ) { { skb->data = skb->data + (unsigned long )len; skb->tail = skb->tail + (sk_buff_data_t )len; return; } } __inline static unsigned char *skb_inner_transport_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->inner_transport_header); } } __inline static unsigned char *skb_inner_network_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->inner_network_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 void skb_reset_network_header(struct sk_buff *skb ) { { skb->network_header = (int )((__u16 )((long )skb->data)) - (int )((__u16 )((long )skb->head)); return; } } __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; } } __inline static int skb_transport_offset(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_transport_header(skb); return ((int )((unsigned int )((long )tmp) - (unsigned int )((long )skb->data))); } } extern void *netdev_alloc_frag(unsigned int ) ; __inline static void skb_free_frag(void *addr ) { { __free_page_frag(addr); return; } } extern struct sk_buff *__napi_alloc_skb(struct napi_struct * , unsigned int , gfp_t ) ; __inline static struct sk_buff *napi_alloc_skb(struct napi_struct *napi , unsigned int length ) { struct sk_buff *tmp ; { tmp = __napi_alloc_skb(napi, length, 32U); return (tmp); } } __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); } } extern void skb_clone_tx_timestamp(struct sk_buff * ) ; __inline static void sw_tx_timestamp(struct sk_buff *skb ) { unsigned char *tmp ; unsigned char *tmp___0 ; { tmp = skb_end_pointer((struct sk_buff const *)skb); if (((int )((struct skb_shared_info *)tmp)->tx_flags & 2) != 0) { tmp___0 = skb_end_pointer((struct sk_buff const *)skb); if (((int )((struct skb_shared_info *)tmp___0)->tx_flags & 4) == 0) { skb_tstamp_tx(skb, (struct skb_shared_hwtstamps *)0); } else { } } else { } return; } } __inline static void skb_tx_timestamp(struct sk_buff *skb ) { { skb_clone_tx_timestamp(skb); sw_tx_timestamp(skb); return; } } __inline static u16 skb_get_queue_mapping(struct sk_buff const *skb ) { { return ((u16 )skb->queue_mapping); } } __inline static void skb_record_rx_queue(struct sk_buff *skb , u16 rx_queue ) { { skb->queue_mapping = (unsigned int )rx_queue + 1U; return; } } __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 bool skb_is_gso_v6(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_end_pointer(skb); return (((int )((struct skb_shared_info *)tmp)->gso_type & 16) != 0); } } __inline static void skb_checksum_none_assert(struct sk_buff const *skb ) { { return; } } __inline static void dql_queued(struct dql *dql , unsigned int count ) { long tmp ; { tmp = ldv__builtin_expect(count > 268435455U, 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/dynamic_queue_limits.h"), "i" (74), "i" (12UL)); ldv_28823: ; goto ldv_28823; } else { } dql->last_obj_cnt = count; __asm__ volatile ("": : : "memory"); dql->num_queued = dql->num_queued + count; return; } } __inline static int dql_avail(struct dql const *dql ) { unsigned int __var ; unsigned int __var___0 ; { __var = 0U; __var___0 = 0U; return ((int )((unsigned int )*((unsigned int const volatile *)(& dql->adj_limit)) - (unsigned int )*((unsigned int const volatile *)(& dql->num_queued)))); } } extern void dql_completed(struct dql * , unsigned int ) ; extern void dql_reset(struct dql * ) ; __inline static u32 ethtool_rxfh_indir_default(u32 index , u32 n_rx_rings ) { { return (index % n_rx_rings); } } 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_87(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; __inline static int ldv_request_irq_88(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; __inline static int ldv_request_irq_89(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_84(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; void ldv_free_irq_85(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; void ldv_free_irq_86(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; __inline static void napi_complete(struct napi_struct *n ) { { return; } } extern void napi_hash_add(struct napi_struct * ) ; 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_41778: ; goto ldv_41778; } else { } __asm__ volatile ("": : : "memory"); clear_bit(0L, (unsigned long volatile *)(& n->state)); return; } } __inline static int netdev_set_prio_tc_map(struct net_device *dev , u8 prio , u8 tc ) { { if ((int )dev->num_tc <= (int )tc) { return (-22); } else { } dev->prio_tc_map[(int )prio & 15] = (unsigned int )tc & 15U; return (0); } } __inline static int netdev_set_tc_queue(struct net_device *dev , u8 tc , u16 count , u16 offset ) { { if ((int )dev->num_tc <= (int )tc) { return (-22); } else { } dev->tc_to_txq[(int )tc].count = count; dev->tc_to_txq[(int )tc].offset = offset; return (0); } } __inline static int netdev_set_num_tc(struct net_device *dev , u8 num_tc ) { { if ((unsigned int )num_tc > 16U) { return (-22); } else { } dev->num_tc = num_tc; return (0); } } extern void netif_napi_add(struct net_device * , struct napi_struct * , int (*)(struct napi_struct * , int ) , int ) ; extern void netif_schedule_queue(struct netdev_queue * ) ; __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_tx_start_all_queues(struct net_device *dev ) { unsigned int i ; struct netdev_queue *txq ; struct netdev_queue *tmp ; { i = 0U; goto ldv_42844; ldv_42843: tmp = netdev_get_tx_queue((struct net_device const *)dev, i); txq = tmp; netif_tx_start_queue(txq); i = i + 1U; ldv_42844: ; if (dev->num_tx_queues > i) { goto ldv_42843; } else { } return; } } __inline static void netif_tx_wake_all_queues___0(struct net_device *dev ) { unsigned int i ; struct netdev_queue *txq ; struct netdev_queue *tmp ; { i = 0U; goto ldv_42857; ldv_42856: tmp = netdev_get_tx_queue((struct net_device const *)dev, i); txq = tmp; netif_tx_wake_queue(txq); i = i + 1U; ldv_42857: ; if (dev->num_tx_queues > i) { goto ldv_42856; } else { } 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 void netdev_tx_sent_queue(struct netdev_queue *dev_queue , unsigned int bytes ) { int tmp ; long tmp___0 ; int tmp___1 ; long tmp___2 ; { dql_queued(& dev_queue->dql, bytes); tmp = dql_avail((struct dql const *)(& dev_queue->dql)); tmp___0 = ldv__builtin_expect(tmp >= 0, 1L); if (tmp___0 != 0L) { return; } else { } set_bit(1L, (unsigned long volatile *)(& dev_queue->state)); __asm__ volatile ("mfence": : : "memory"); tmp___1 = dql_avail((struct dql const *)(& dev_queue->dql)); tmp___2 = ldv__builtin_expect(tmp___1 >= 0, 0L); if (tmp___2 != 0L) { clear_bit(1L, (unsigned long volatile *)(& dev_queue->state)); } else { } return; } } __inline static void netdev_tx_completed_queue(struct netdev_queue *dev_queue , unsigned int pkts , unsigned int bytes ) { long tmp ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(bytes == 0U, 0L); if (tmp != 0L) { return; } else { } dql_completed(& dev_queue->dql, bytes); __asm__ volatile ("mfence": : : "memory"); tmp___0 = dql_avail((struct dql const *)(& dev_queue->dql)); if (tmp___0 < 0) { return; } else { } tmp___1 = test_and_clear_bit(1L, (unsigned long volatile *)(& dev_queue->state)); if (tmp___1 != 0) { netif_schedule_queue(dev_queue); } else { } return; } } __inline static void netdev_tx_reset_queue(struct netdev_queue *q ) { { clear_bit(1L, (unsigned long volatile *)(& q->state)); dql_reset(& q->dql); return; } } extern int netif_set_real_num_tx_queues(struct net_device * , unsigned int ) ; extern int netif_set_real_num_rx_queues(struct net_device * , unsigned int ) ; extern int netif_get_num_default_rss_queues(void) ; 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 gro_result_t napi_gro_receive(struct napi_struct * , struct sk_buff * ) ; extern void netif_carrier_on(struct net_device * ) ; __inline static void netif_tx_disable___0(struct net_device *dev ) { unsigned int i ; int cpu ; int pscr_ret__ ; void const *__vpp_verify ; int pfo_ret__ ; int pfo_ret_____0 ; int pfo_ret_____1 ; int pfo_ret_____2 ; struct netdev_queue *txq ; struct netdev_queue *tmp ; { local_bh_disable(); __vpp_verify = (void const *)0; switch (4UL) { case 1UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_43419; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_43419; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_43419; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_43419; default: __bad_percpu_size(); } ldv_43419: pscr_ret__ = pfo_ret__; goto ldv_43425; case 2UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____0): "m" (cpu_number)); goto ldv_43429; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_43429; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_43429; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_43429; default: __bad_percpu_size(); } ldv_43429: pscr_ret__ = pfo_ret_____0; goto ldv_43425; case 4UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____1): "m" (cpu_number)); goto ldv_43438; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_43438; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_43438; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_43438; default: __bad_percpu_size(); } ldv_43438: pscr_ret__ = pfo_ret_____1; goto ldv_43425; case 8UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____2): "m" (cpu_number)); goto ldv_43447; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_43447; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_43447; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_43447; default: __bad_percpu_size(); } ldv_43447: pscr_ret__ = pfo_ret_____2; goto ldv_43425; default: __bad_size_call_parameter(); goto ldv_43425; } ldv_43425: cpu = pscr_ret__; i = 0U; goto ldv_43457; ldv_43456: tmp = netdev_get_tx_queue((struct net_device const *)dev, i); txq = tmp; __netif_tx_lock(txq, cpu); netif_tx_stop_queue(txq); __netif_tx_unlock(txq); i = i + 1U; ldv_43457: ; if (dev->num_tx_queues > i) { goto ldv_43456; } else { } local_bh_enable(); return; } } extern void netdev_rss_key_fill(void * , size_t ) ; extern __be16 eth_type_trans(struct sk_buff * , struct net_device * ) ; __inline static bool is_broadcast_ether_addr(u8 const *addr ) { { return ((unsigned int )(((int )((unsigned short )*((u16 const *)addr)) & (int )((unsigned short )*((u16 const *)addr + 2U))) & (int )((unsigned short )*((u16 const *)addr + 4U))) == 65535U); } } extern int rtnl_is_locked(void) ; __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 __be16 __vlan_get_protocol___0(struct sk_buff *skb , __be16 type , int *depth ) { unsigned int vlan_depth ; int __ret_warn_on ; long tmp ; long tmp___0 ; struct vlan_hdr *vh ; int tmp___1 ; long tmp___2 ; { vlan_depth = (unsigned int )skb->mac_len; if ((unsigned int )type == 129U || (unsigned int )type == 43144U) { if (vlan_depth != 0U) { __ret_warn_on = vlan_depth <= 3U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/if_vlan.h", 492); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return (0U); } else { } vlan_depth = vlan_depth - 4U; } else { vlan_depth = 14U; } ldv_44648: tmp___1 = pskb_may_pull(skb, vlan_depth + 4U); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { return (0U); } else { } vh = (struct vlan_hdr *)skb->data + (unsigned long )vlan_depth; type = vh->h_vlan_encapsulated_proto; vlan_depth = vlan_depth + 4U; if ((unsigned int )type == 129U || (unsigned int )type == 43144U) { goto ldv_44648; } else { } } else { } if ((unsigned long )depth != (unsigned long )((int *)0)) { *depth = (int )vlan_depth; } else { } return (type); } } __inline static __be16 vlan_get_protocol___0(struct sk_buff *skb ) { __be16 tmp ; { tmp = __vlan_get_protocol___0(skb, (int )skb->protocol, (int *)0); return (tmp); } } __inline static struct iphdr *inner_ip_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_inner_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 unsigned int tcp_hdrlen(struct sk_buff const *skb ) { struct tcphdr *tmp ; { tmp = tcp_hdr(skb); return ((unsigned int )((int )tmp->doff * 4)); } } __inline static struct tcphdr *inner_tcp_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_inner_transport_header(skb); return ((struct tcphdr *)tmp); } } __inline static unsigned int inner_tcp_hdrlen(struct sk_buff const *skb ) { struct tcphdr *tmp ; { tmp = inner_tcp_hdr(skb); return ((unsigned int )((int )tmp->doff * 4)); } } __inline static struct ipv6hdr *inner_ipv6_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_inner_network_header(skb); return ((struct ipv6hdr *)tmp); } } __inline static __sum16 tcp_v4_check(int len , __be32 saddr , __be32 daddr , __wsum base ) { __sum16 tmp ; { tmp = csum_tcpudp_magic(saddr, daddr, (int )((unsigned short )len), 6, base); return (tmp); } } extern int tcp_gro_complete(struct sk_buff * ) ; __inline static __sum16 tcp_v6_check(int len , struct in6_addr const *saddr , struct in6_addr const *daddr , __wsum base ) { __sum16 tmp ; { tmp = csum_ipv6_magic(saddr, daddr, (__u32 )len, 6, base); return (tmp); } } __inline static void skb_mark_napi_id(struct sk_buff *skb , struct napi_struct *napi ) { { skb->__annonCompField90.napi_id = napi->napi_id; return; } } extern pci_power_t pci_choose_state(struct pci_dev * , pm_message_t ) ; 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); } } extern int pci_enable_msix_range(struct pci_dev * , struct msix_entry * , int , int ) ; extern int pci_num_vf(struct pci_dev * ) ; __inline static u8 calc_crc8(u32 data , u8 crc ) { u8 D[32U] ; u8 NewCRC[8U] ; u8 C[8U] ; u8 crc_res ; u8 i ; { i = 0U; goto ldv_58379; ldv_58378: D[(int )i] = (unsigned int )((unsigned char )data) & 1U; data = data >> 1; i = (u8 )((int )i + 1); ldv_58379: ; if ((unsigned int )i <= 31U) { goto ldv_58378; } else { } i = 0U; goto ldv_58382; ldv_58381: C[(int )i] = (unsigned int )crc & 1U; crc = (u8 )((int )crc >> 1); i = (u8 )((int )i + 1); ldv_58382: ; if ((unsigned int )i <= 7U) { goto ldv_58381; } else { } NewCRC[0] = (u8 )(((((((((((((((((int )D[31] ^ (int )D[30]) ^ (int )D[28]) ^ (int )D[23]) ^ (int )D[21]) ^ (int )D[19]) ^ (int )D[18]) ^ (int )D[16]) ^ (int )D[14]) ^ (int )D[12]) ^ (int )D[8]) ^ (int )D[7]) ^ (int )D[6]) ^ (int )D[0]) ^ (int )C[4]) ^ (int )C[6]) ^ (int )C[7]); NewCRC[1] = (u8 )(((((((((((((((((((((((int )D[30] ^ (int )D[29]) ^ (int )D[28]) ^ (int )D[24]) ^ (int )D[23]) ^ (int )D[22]) ^ (int )D[21]) ^ (int )D[20]) ^ (int )D[18]) ^ (int )D[17]) ^ (int )D[16]) ^ (int )D[15]) ^ (int )D[14]) ^ (int )D[13]) ^ (int )D[12]) ^ (int )D[9]) ^ (int )D[6]) ^ (int )D[1]) ^ (int )D[0]) ^ (int )C[0]) ^ (int )C[4]) ^ (int )C[5]) ^ (int )C[6]); NewCRC[2] = (u8 )(((((((((((((((((((int )D[29] ^ (int )D[28]) ^ (int )D[25]) ^ (int )D[24]) ^ (int )D[22]) ^ (int )D[17]) ^ (int )D[15]) ^ (int )D[13]) ^ (int )D[12]) ^ (int )D[10]) ^ (int )D[8]) ^ (int )D[6]) ^ (int )D[2]) ^ (int )D[1]) ^ (int )D[0]) ^ (int )C[0]) ^ (int )C[1]) ^ (int )C[4]) ^ (int )C[5]); NewCRC[3] = (u8 )(((((((((((((((((((int )D[30] ^ (int )D[29]) ^ (int )D[26]) ^ (int )D[25]) ^ (int )D[23]) ^ (int )D[18]) ^ (int )D[16]) ^ (int )D[14]) ^ (int )D[13]) ^ (int )D[11]) ^ (int )D[9]) ^ (int )D[7]) ^ (int )D[3]) ^ (int )D[2]) ^ (int )D[1]) ^ (int )C[1]) ^ (int )C[2]) ^ (int )C[5]) ^ (int )C[6]); NewCRC[4] = (u8 )((((((((((((((((((((int )D[31] ^ (int )D[30]) ^ (int )D[27]) ^ (int )D[26]) ^ (int )D[24]) ^ (int )D[19]) ^ (int )D[17]) ^ (int )D[15]) ^ (int )D[14]) ^ (int )D[12]) ^ (int )D[10]) ^ (int )D[8]) ^ (int )D[4]) ^ (int )D[3]) ^ (int )D[2]) ^ (int )C[0]) ^ (int )C[2]) ^ (int )C[3]) ^ (int )C[6]) ^ (int )C[7]); NewCRC[5] = (u8 )((((((((((((((((((int )D[31] ^ (int )D[28]) ^ (int )D[27]) ^ (int )D[25]) ^ (int )D[20]) ^ (int )D[18]) ^ (int )D[16]) ^ (int )D[15]) ^ (int )D[13]) ^ (int )D[11]) ^ (int )D[9]) ^ (int )D[5]) ^ (int )D[4]) ^ (int )D[3]) ^ (int )C[1]) ^ (int )C[3]) ^ (int )C[4]) ^ (int )C[7]); NewCRC[6] = (u8 )((((((((((((((((int )D[29] ^ (int )D[28]) ^ (int )D[26]) ^ (int )D[21]) ^ (int )D[19]) ^ (int )D[17]) ^ (int )D[16]) ^ (int )D[14]) ^ (int )D[12]) ^ (int )D[10]) ^ (int )D[6]) ^ (int )D[5]) ^ (int )D[4]) ^ (int )C[2]) ^ (int )C[4]) ^ (int )C[5]); NewCRC[7] = (u8 )((((((((((((((((int )D[30] ^ (int )D[29]) ^ (int )D[27]) ^ (int )D[22]) ^ (int )D[20]) ^ (int )D[18]) ^ (int )D[17]) ^ (int )D[15]) ^ (int )D[13]) ^ (int )D[11]) ^ (int )D[7]) ^ (int )D[6]) ^ (int )D[5]) ^ (int )C[3]) ^ (int )C[5]) ^ (int )C[6]); crc_res = 0U; i = 0U; goto ldv_58385; ldv_58384: crc_res = (u8 )((int )((signed char )((int )NewCRC[(int )i] << (int )i)) | (int )((signed char )crc_res)); i = (u8 )((int )i + 1); ldv_58385: ; if ((unsigned int )i <= 7U) { goto ldv_58384; } else { } return (crc_res); } } void bnx2x_init_rx_mode_obj(struct bnx2x *bp , struct bnx2x_rx_mode_obj *o ) ; void bnx2x_init_mcast_obj(struct bnx2x *bp , struct bnx2x_mcast_obj *mcast_obj , u8 mcast_cl_id , u32 mcast_cid , u8 func_id , u8 engine_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type ) ; void bnx2x_init_mac_credit_pool(struct bnx2x *bp , struct bnx2x_credit_pool_obj *p , u8 func_id , u8 func_num ) ; void bnx2x_init_vlan_credit_pool(struct bnx2x *bp , struct bnx2x_credit_pool_obj *p , u8 func_id , u8 func_num ) ; void bnx2x_init_rss_config_obj(struct bnx2x *bp , struct bnx2x_rss_config_obj *rss_obj , u8 cl_id , u32 cid , u8 func_id , u8 engine_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type ) ; int bnx2x_config_rss(struct bnx2x *bp , struct bnx2x_config_rss_params *p ) ; __inline static void bnx2x_fp_busy_poll_init(struct bnx2x_fastpath *fp ) { union __anonunion___u_410 __u ; { __u.__val = 0UL; __write_once_size((void volatile *)(& fp->busy_poll_state), (void *)(& __u.__c), 8); return; } } __inline static bool bnx2x_fp_lock_napi(struct bnx2x_fastpath *fp ) { unsigned long prev ; unsigned long old ; union __anonunion___u_412 __u ; unsigned long __ret ; unsigned long __old ; unsigned long __new ; u8 volatile *__ptr ; u16 volatile *__ptr___0 ; u32 volatile *__ptr___1 ; u64 volatile *__ptr___2 ; long tmp ; { __read_once_size((void const volatile *)(& fp->busy_poll_state), (void *)(& __u.__c), 8); old = __u.__val; ldv_60185: ; switch (old) { case 4UL: set_bit(1L, (unsigned long volatile *)(& fp->busy_poll_state)); case 6UL: ; return (0); default: ; goto ldv_60169; } ldv_60169: __old = old; __new = 1UL; switch (8UL) { case 1UL: __ptr = (u8 volatile *)(& fp->busy_poll_state); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgb %2,%1": "=a" (__ret), "+m" (*__ptr): "q" (__new), "0" (__old): "memory"); goto ldv_60175; case 2UL: __ptr___0 = (u16 volatile *)(& fp->busy_poll_state); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgw %2,%1": "=a" (__ret), "+m" (*__ptr___0): "r" (__new), "0" (__old): "memory"); goto ldv_60175; case 4UL: __ptr___1 = (u32 volatile *)(& fp->busy_poll_state); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgl %2,%1": "=a" (__ret), "+m" (*__ptr___1): "r" (__new), "0" (__old): "memory"); goto ldv_60175; case 8UL: __ptr___2 = (u64 volatile *)(& fp->busy_poll_state); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgq %2,%1": "=a" (__ret), "+m" (*__ptr___2): "r" (__new), "0" (__old): "memory"); goto ldv_60175; default: __cmpxchg_wrong_size(); } ldv_60175: prev = __ret; tmp = ldv__builtin_expect(prev != old, 0L); if (tmp != 0L) { old = prev; goto ldv_60184; } else { } return (1); ldv_60184: ; goto ldv_60185; } } __inline static void bnx2x_fp_unlock_napi(struct bnx2x_fastpath *fp ) { { __asm__ volatile ("": : : "memory"); fp->busy_poll_state = 0UL; return; } } __inline static bool bnx2x_fp_lock_poll(struct bnx2x_fastpath *fp ) { unsigned long __ret ; unsigned long __old ; unsigned long __new ; u8 volatile *__ptr ; u16 volatile *__ptr___0 ; u32 volatile *__ptr___1 ; u64 volatile *__ptr___2 ; { __old = 0UL; __new = 4UL; switch (8UL) { case 1UL: __ptr = (u8 volatile *)(& fp->busy_poll_state); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgb %2,%1": "=a" (__ret), "+m" (*__ptr): "q" (__new), "0" (__old): "memory"); goto ldv_60197; case 2UL: __ptr___0 = (u16 volatile *)(& fp->busy_poll_state); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgw %2,%1": "=a" (__ret), "+m" (*__ptr___0): "r" (__new), "0" (__old): "memory"); goto ldv_60197; case 4UL: __ptr___1 = (u32 volatile *)(& fp->busy_poll_state); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgl %2,%1": "=a" (__ret), "+m" (*__ptr___1): "r" (__new), "0" (__old): "memory"); goto ldv_60197; case 8UL: __ptr___2 = (u64 volatile *)(& fp->busy_poll_state); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgq %2,%1": "=a" (__ret), "+m" (*__ptr___2): "r" (__new), "0" (__old): "memory"); goto ldv_60197; default: __cmpxchg_wrong_size(); } ldv_60197: ; return (__ret == 0UL); } } __inline static void bnx2x_fp_unlock_poll(struct bnx2x_fastpath *fp ) { { __asm__ volatile ("": : : "memory"); clear_bit(2L, (unsigned long volatile *)(& fp->busy_poll_state)); return; } } __inline static bool bnx2x_fp_ll_polling(struct bnx2x_fastpath *fp ) { union __anonunion___u_414 __u ; { __read_once_size((void const volatile *)(& fp->busy_poll_state), (void *)(& __u.__c), 8); return ((__u.__val & 4UL) != 0UL); } } __inline static bool bnx2x_fp_ll_disable(struct bnx2x_fastpath *fp ) { bool tmp ; int tmp___0 ; { set_bit(3L, (unsigned long volatile *)(& fp->busy_poll_state)); tmp = bnx2x_fp_ll_polling(fp); if ((int )tmp != 0) { tmp___0 = 0; } else { tmp___0 = 1; } return ((bool )tmp___0); } } int bnx2x_get_cur_phy_idx(struct bnx2x *bp ) ; int bnx2x_iov_nic_init(struct bnx2x *bp ) ; int bnx2x_vfpf_init(struct bnx2x *bp ) ; void bnx2x_vfpf_close_vf(struct bnx2x *bp ) ; int bnx2x_vfpf_config_rss(struct bnx2x *bp , struct bnx2x_config_rss_params *params ) ; __inline static void bnx2x_vf_fill_fw_str(struct bnx2x *bp , char *buf , size_t buf_len ) { { strlcpy(buf, (char const *)(& bp->acquire_resp.pfdev_info.fw_ver), buf_len); return; } } __inline static int bnx2x_vf_headroom(struct bnx2x *bp ) { { return ((int )(bp->vfdb)->sriov.nr_virtfn * 16); } } void bnx2x_iov_channel_down(struct bnx2x *bp ) ; void bnx2x_iov_link_update(struct bnx2x *bp ) ; int bnx2x_rss(struct bnx2x *bp , struct bnx2x_rss_config_obj *rss_obj , bool config_hash , bool enable ) ; u16 bnx2x_get_mf_speed(struct bnx2x *bp ) ; void bnx2x_dcbx_init(struct bnx2x *bp , bool update_shmem ) ; void bnx2x_update_max_mf_config(struct bnx2x *bp , u32 value ) ; __inline static void bnx2x_update_rx_prod(struct bnx2x *bp , struct bnx2x_fastpath *fp , u16 bd_prod , u16 rx_comp_prod , u16 rx_sge_prod ) { struct ustorm_eth_rx_producers rx_prods ; u32 i ; long tmp ; { rx_prods.cqe_prod = 0U; rx_prods.bd_prod = (unsigned short)0; rx_prods.sge_prod = (unsigned short)0; rx_prods.reserved = (unsigned short)0; rx_prods.bd_prod = bd_prod; rx_prods.cqe_prod = rx_comp_prod; rx_prods.sge_prod = rx_sge_prod; __asm__ volatile ("sfence": : : "memory"); i = 0U; goto ldv_61283; ldv_61282: writel(*((u32 *)(& rx_prods) + (unsigned long )i), (void volatile *)bp->regview + (unsigned long )(fp->ustorm_rx_prods_offset + i * 4U)); i = i + 1U; ldv_61283: ; if (i <= 1U) { goto ldv_61282; } else { } __asm__ volatile ("": : : "memory"); tmp = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]queue[%d]: wrote bd_prod %u cqe_prod %u sge_prod %u\n", "bnx2x_update_rx_prod", 527, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index, (int )bd_prod, (int )rx_comp_prod, (int )rx_sge_prod); } else { } return; } } int bnx2x_reload_if_running(struct net_device *dev ) ; int bnx2x_tx_int(struct bnx2x *bp , struct bnx2x_fp_txdata *txdata ) ; void bnx2x_netif_start(struct bnx2x *bp ) ; __inline static u16 bnx2x_tx_avail(struct bnx2x *bp , struct bnx2x_fp_txdata *txdata ) { s16 used ; u16 prod ; u16 cons ; { prod = txdata->tx_bd_prod; cons = txdata->tx_bd_cons; used = (short )((int )prod - (int )cons); return ((int )((u16 )txdata->tx_ring_size) - (int )((u16 )used)); } } __inline static bool bnx2x_has_tx_work___0(struct bnx2x_fastpath *fp ) { u8 cos ; int tmp ; { cos = 0U; goto ldv_61407; ldv_61406: tmp = bnx2x_tx_queue_has_work(fp->txdata_ptr[(int )cos]); if (tmp != 0) { return (1); } else { } cos = (u8 )((int )cos + 1); ldv_61407: ; if ((int )fp->max_cos > (int )cos) { goto ldv_61406; } else { } return (0); } } __inline static void bnx2x_tx_disable___0(struct bnx2x *bp ) { { netif_tx_disable___0(bp->dev); netif_carrier_off(bp->dev); return; } } __inline static void bnx2x_free_rx_sge___0(struct bnx2x *bp , struct bnx2x_fastpath *fp , u16 index ) { struct sw_rx_page *sw_buf ; struct page *page ; struct eth_rx_sge *sge ; { sw_buf = fp->rx_page_ring + (unsigned long )index; page = sw_buf->page; sge = fp->rx_sge_ring + (unsigned long )index; if ((unsigned long )page == (unsigned long )((struct page *)0)) { return; } else { } dma_unmap_page___0(& (bp->pdev)->dev, sw_buf->mapping, 4096UL, 2); put_page(page); sw_buf->page = (struct page *)0; sge->addr_hi = 0U; sge->addr_lo = 0U; return; } } __inline static void bnx2x_del_all_napi_cnic___0(struct bnx2x *bp ) { int i ; { i = (int )bp->num_ethernet_queues; goto ldv_61432; ldv_61431: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { napi_hash_del(& (bp->fp + (unsigned long )i)->napi); netif_napi_del(& (bp->fp + (unsigned long )i)->napi); } i = i + 1; ldv_61432: ; if (bp->num_queues > i) { goto ldv_61431; } else { } return; } } __inline static void bnx2x_del_all_napi___0(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_61439; ldv_61438: napi_hash_del(& (bp->fp + (unsigned long )i)->napi); netif_napi_del(& (bp->fp + (unsigned long )i)->napi); i = i + 1; ldv_61439: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_61438; } else { } return; } } __inline static void bnx2x_clear_sge_mask_next_elems(struct bnx2x_fastpath *fp ) { int i ; int j ; int idx ; { i = 1; goto ldv_61456; ldv_61455: idx = (int )((unsigned int )((unsigned long )i) * 512U - 1U); j = 0; goto ldv_61453; ldv_61452: fp->sge_mask[idx >> 6] = fp->sge_mask[idx >> 6] & ~ (1ULL << (idx & 63)); idx = idx - 1; j = j + 1; ldv_61453: ; if (j <= 1) { goto ldv_61452; } else { } i = i + 1; ldv_61456: ; if (i <= 2) { goto ldv_61455; } else { } return; } } __inline static void bnx2x_init_sge_ring_bit_mask(struct bnx2x_fastpath *fp ) { { memset((void *)(& fp->sge_mask), 255, 128UL); bnx2x_clear_sge_mask_next_elems(fp); return; } } __inline static void bnx2x_reuse_rx_data(struct bnx2x_fastpath *fp , u16 cons , u16 prod ) { struct sw_rx_bd *cons_rx_buf ; struct sw_rx_bd *prod_rx_buf ; struct eth_rx_bd *cons_bd ; struct eth_rx_bd *prod_bd ; { cons_rx_buf = fp->rx_buf_ring + (unsigned long )cons; prod_rx_buf = fp->rx_buf_ring + (unsigned long )prod; cons_bd = fp->rx_desc_ring + (unsigned long )cons; prod_bd = fp->rx_desc_ring + (unsigned long )prod; prod_rx_buf->mapping = cons_rx_buf->mapping; prod_rx_buf->data = cons_rx_buf->data; *prod_bd = *cons_bd; return; } } __inline static int bnx2x_config_rss_eth(struct bnx2x *bp , bool config_hash ) { int tmp ; { tmp = bnx2x_rss(bp, & bp->rss_conf_obj, (int )config_hash, 1); return (tmp); } } __inline static int bnx2x_func_start(struct bnx2x *bp ) { struct bnx2x_func_state_params func_params ; struct bnx2x_func_start_params *start_params ; int tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; start_params = & func_params.params.start; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); func_params.f_obj = & bp->func_obj; func_params.cmd = 1; start_params->mf_mode = (u16 )bp->mf_mode; start_params->sd_vlan_tag = bp->mf_ov; if (((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) || (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U)) { start_params->network_cos_mode = 1U; } else { start_params->network_cos_mode = 2U; } start_params->tunnel_mode = 2U; start_params->gre_tunnel_type = 2U; start_params->inner_gre_rss_en = 1U; if (((unsigned int )bp->mf_mode == 1U && (unsigned int )bp->mf_sub_mode == 1U) && (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U) { start_params->class_fail_ethtype = 35092U; start_params->class_fail = 1U; start_params->no_added_tags = 1U; } else { } tmp = bnx2x_func_state_change(bp, & func_params); return (tmp); } } __inline static void bnx2x_set_fw_mac_addr(__le16 *fw_hi , __le16 *fw_mid , __le16 *fw_lo , u8 *mac ) { { *((u8 *)fw_hi) = *(mac + 1UL); *((u8 *)fw_hi + 1UL) = *mac; *((u8 *)fw_mid) = *(mac + 3UL); *((u8 *)fw_mid + 1UL) = *(mac + 2UL); *((u8 *)fw_lo) = *(mac + 5UL); *((u8 *)fw_lo + 1UL) = *(mac + 4UL); return; } } __inline static void bnx2x_free_rx_sge_range___0(struct bnx2x *bp , struct bnx2x_fastpath *fp , int last ) { int i ; { if ((unsigned int )fp->mode == 0U) { return; } else { } i = 0; goto ldv_61500; ldv_61499: bnx2x_free_rx_sge___0(bp, fp, (int )((u16 )i)); i = i + 1; ldv_61500: ; if (i < last) { goto ldv_61499; } else { } bnx2x_free_rx_mem_pool(bp, & fp->page_pool); return; } } __inline static void bnx2x_set_next_page_rx_bd(struct bnx2x_fastpath *fp ) { int i ; struct eth_rx_bd *rx_bd ; { i = 1; goto ldv_61508; ldv_61507: rx_bd = fp->rx_desc_ring + ((unsigned long )i * 512UL + 0xfffffffffffffffeUL); rx_bd->addr_hi = (unsigned int )((fp->rx_desc_mapping + (dma_addr_t )((i % 8) * 4096)) >> 32); rx_bd->addr_lo = (unsigned int )fp->rx_desc_mapping + (unsigned int )((i % 8) * 4096); i = i + 1; ldv_61508: ; if (i <= 8) { goto ldv_61507; } else { } return; } } __inline static u8 bnx2x_get_path_func_num(struct bnx2x *bp ) { u8 func_num ; u8 i ; u32 func_config ; unsigned int tmp ; int __ret_warn_on ; long tmp___0 ; { func_num = 0U; if (bp->common.chip_id >> 16 == 5710U) { return (1U); } else { } if ((bp->common.chip_id & 61440U) > 20480U) { if ((unsigned int )bp->mf_mode != 0U) { func_num = 4U; } else { func_num = 2U; } } else { i = 0U; goto ldv_61526; ldv_61525: tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.mf_cfg_base + (unsigned long )(((int )bp->pfid & 1) + (int )i * 2) * 24UL) + 36UL))); func_config = tmp; func_num = ((int )func_config & 1 ? 0U : 1U) + (unsigned int )func_num; i = (u8 )((int )i + 1); ldv_61526: ; if ((unsigned int )i <= 3U) { goto ldv_61525; } else { } } __ret_warn_on = (unsigned int )func_num == 0U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/inst/current/envs/linux-4.2-rc1.tar.xz/linux-4.2-rc1/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h", 1077); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (func_num); } } __inline static void bnx2x_init_bp_objs(struct bnx2x *bp ) { u8 tmp ; u8 tmp___0 ; { bnx2x_init_rx_mode_obj(bp, & bp->rx_mode_obj); bnx2x_init_mcast_obj(bp, & bp->mcast_obj, (int )(bp->fp)->cl_id, (bp->fp)->cid, (int )bp->pfid, (int )bp->pfid, (void *)(& (bp->slowpath)->mcast_rdata), bp->slowpath_mapping + 1296ULL, 9, & bp->sp_state, 0); tmp = bnx2x_get_path_func_num(bp); bnx2x_init_mac_credit_pool(bp, & bp->macs_pool, (int )bp->pfid, (int )tmp); tmp___0 = bnx2x_get_path_func_num(bp); bnx2x_init_vlan_credit_pool(bp, & bp->vlans_pool, (int )bp->pf_num >> 1, (int )tmp___0); bnx2x_init_rss_config_obj(bp, & bp->rss_conf_obj, (int )(bp->fp)->cl_id, (bp->fp)->cid, (int )bp->pfid, (int )bp->pfid, (void *)(& (bp->slowpath)->rss_rdata), bp->slowpath_mapping + 2328ULL, 11, & bp->sp_state, 0); return; } } __inline static int bnx2x_clean_tx_queue___0(struct bnx2x *bp , struct bnx2x_fp_txdata *txdata ) { int cnt ; int tmp ; { cnt = 1000; goto ldv_61563; ldv_61562: ; if (cnt == 0) { printk("\vbnx2x: [%s:%d(%s)]timeout waiting for queue[%d]: txdata->tx_pkt_prod(%d) != txdata->tx_pkt_cons(%d)\n", "bnx2x_clean_tx_queue", 1160, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", txdata->txq_index, (int )txdata->tx_pkt_prod, (int )txdata->tx_pkt_cons); goto ldv_61561; } else { } cnt = cnt - 1; usleep_range(1000UL, 2000UL); ldv_61563: tmp = bnx2x_has_tx_work_unload(txdata); if (tmp != 0) { goto ldv_61562; } else { } ldv_61561: ; return (0); } } __inline static bool bnx2x_wait_sp_comp___0(struct bnx2x *bp , unsigned long mask ) { int tout ; int tmp ; { tout = 5000; goto ldv_61582; ldv_61581: __asm__ volatile ("mfence": : : "memory"); netif_addr_lock_bh(bp->dev); if ((bp->sp_state & mask) == 0UL) { netif_addr_unlock_bh(bp->dev); return (1); } else { } netif_addr_unlock_bh(bp->dev); usleep_range(1000UL, 2000UL); ldv_61582: tmp = tout; tout = tout - 1; if (tmp != 0) { goto ldv_61581; } else { } __asm__ volatile ("mfence": : : "memory"); netif_addr_lock_bh(bp->dev); if ((bp->sp_state & mask) != 0UL) { printk("\vbnx2x: [%s:%d(%s)]Filtering completion timed out. sp_state 0x%lx, mask 0x%lx\n", "bnx2x_wait_sp_comp", 1212, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->sp_state, mask); netif_addr_unlock_bh(bp->dev); return (0); } else { } netif_addr_unlock_bh(bp->dev); return (1); } } __inline static bool bnx2x_mtu_allows_gro(int mtu ) { int fpp ; { fpp = 4096 / (mtu + -72); return ((bool )(mtu <= 4096 && (unsigned int )(fpp * 8) <= 17U)); } } __inline static void bnx2x_update_drv_flags(struct bnx2x *bp , u32 flags , u32 set ) { u32 drv_flags ; long tmp ; unsigned int tmp___0 ; { if (bp->common.shmem2_base != 0U) { tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___0 > 188U) { bnx2x_acquire_hw_lock(bp, 10U); drv_flags = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 188UL))); if (set != 0U) { drv_flags = drv_flags | flags; } else { drv_flags = ~ flags & drv_flags; } writel(drv_flags, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 188UL))); tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]drv_flags 0x%08x\n", "bnx2x_update_drv_flags", 1319, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", drv_flags); } else { } bnx2x_release_hw_lock(bp, 10U); } else { } } else { } return; } } void bnx2x_fill_fw_str(struct bnx2x *bp , char *buf , size_t buf_len ) ; static void bnx2x_free_fp_mem_cnic(struct bnx2x *bp ) ; static int bnx2x_alloc_fp_mem_cnic(struct bnx2x *bp ) ; static int bnx2x_alloc_fp_mem(struct bnx2x *bp ) ; static int bnx2x_poll(struct napi_struct *napi , int budget ) ; static void bnx2x_add_all_napi_cnic(struct bnx2x *bp ) { int i ; { i = (int )bp->num_ethernet_queues; goto ldv_61926; ldv_61925: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { netif_napi_add(bp->dev, & (bp->fp + (unsigned long )i)->napi, & bnx2x_poll, 64); napi_hash_add(& (bp->fp + (unsigned long )i)->napi); } i = i + 1; ldv_61926: ; if (bp->num_queues > i) { goto ldv_61925; } else { } return; } } static void bnx2x_add_all_napi(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_61933; ldv_61932: netif_napi_add(bp->dev, & (bp->fp + (unsigned long )i)->napi, & bnx2x_poll, 64); napi_hash_add(& (bp->fp + (unsigned long )i)->napi); i = i + 1; ldv_61933: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_61932; } else { } return; } } static int bnx2x_calc_num_queues(struct bnx2x *bp ) { int nq ; int tmp ; int tmp___0 ; int tmp___1 ; int _min1 ; int _max1 ; int _max2 ; int _min2 ; { tmp___0 = bnx2x_num_queues != 0; if (tmp___0) { } else { tmp = netif_get_num_default_rss_queues(); tmp___0 = tmp; } nq = tmp___0; tmp___1 = is_kdump_kernel(); if (tmp___1 != 0) { nq = 1; } else { } _max1 = nq; _max2 = 1; _min1 = _max1 > _max2 ? _max1 : _max2; _min2 = (int )bp->igu_sb_cnt - (int )bp->cnic_support; nq = _min1 < _min2 ? _min1 : _min2; return (nq); } } __inline static void bnx2x_move_fp(struct bnx2x *bp , int from , int to ) { struct bnx2x_fastpath *from_fp ; struct bnx2x_fastpath *to_fp ; struct bnx2x_sp_objs *from_sp_objs ; struct bnx2x_sp_objs *to_sp_objs ; struct bnx2x_fp_stats *from_fp_stats ; struct bnx2x_fp_stats *to_fp_stats ; int old_max_eth_txqs ; int new_max_eth_txqs ; int old_txdata_index ; int new_txdata_index ; struct bnx2x_agg_info *old_tpa_info ; { from_fp = bp->fp + (unsigned long )from; to_fp = bp->fp + (unsigned long )to; from_sp_objs = bp->sp_objs + (unsigned long )from; to_sp_objs = bp->sp_objs + (unsigned long )to; from_fp_stats = bp->fp_stats + (unsigned long )from; to_fp_stats = bp->fp_stats + (unsigned long )to; old_txdata_index = 0; new_txdata_index = 0; old_tpa_info = to_fp->tpa_info; from_fp->napi = to_fp->napi; memcpy((void *)to_fp, (void const *)from_fp, 664UL); to_fp->index = (u8 )to; to_fp->tpa_info = old_tpa_info; memcpy((void *)to_sp_objs, (void const *)from_sp_objs, 504UL); memcpy((void *)to_fp_stats, (void const *)from_fp_stats, 512UL); old_max_eth_txqs = (int )(bp->num_ethernet_queues * (uint )bp->max_cos); new_max_eth_txqs = (int )(((bp->num_ethernet_queues - (uint )from) + (uint )to) * (uint )bp->max_cos); if ((uint )from == (uint )bp->num_queues - bp->num_cnic_queues) { old_txdata_index = old_max_eth_txqs; new_txdata_index = new_max_eth_txqs; } else { } memcpy((void *)bp->bnx2x_txq + (unsigned long )new_txdata_index, (void const *)bp->bnx2x_txq + (unsigned long )old_txdata_index, 80UL); to_fp->txdata_ptr[0] = bp->bnx2x_txq + (unsigned long )new_txdata_index; return; } } void bnx2x_fill_fw_str(struct bnx2x *bp , char *buf , size_t buf_len ) { u8 phy_fw_ver[20U] ; size_t tmp ; size_t tmp___0 ; { if ((bp->flags & 4194304U) == 0U) { phy_fw_ver[0] = 0U; bnx2x_get_ext_phy_fw_version(& bp->link_params, (u8 *)(& phy_fw_ver), 20); strlcpy(buf, (char const *)(& bp->fw_ver), buf_len); tmp = strlen((char const *)(& bp->fw_ver)); tmp___0 = strlen((char const *)(& bp->fw_ver)); snprintf(buf + tmp___0, 32UL - tmp, "bc %d.%d.%d%s%s", (bp->common.bc_ver & 16711680U) >> 16, (bp->common.bc_ver & 65280U) >> 8, bp->common.bc_ver & 255U, (unsigned int )phy_fw_ver[0] != 0U ? (char *)" phy " : (char *)"", (u8 *)(& phy_fw_ver)); } else { bnx2x_vf_fill_fw_str(bp, buf, buf_len); } return; } } static void bnx2x_shrink_eth_fp(struct bnx2x *bp , int delta ) { int i ; int cos ; int old_eth_num ; struct bnx2x_fastpath *fp ; int new_idx ; { old_eth_num = (int )bp->num_ethernet_queues; cos = 1; goto ldv_61983; ldv_61982: i = 0; goto ldv_61980; ldv_61979: fp = bp->fp + (unsigned long )i; new_idx = (old_eth_num - delta) * cos + i; memcpy((void *)bp->bnx2x_txq + (unsigned long )new_idx, (void const *)fp->txdata_ptr[cos], 80UL); fp->txdata_ptr[cos] = bp->bnx2x_txq + (unsigned long )new_idx; i = i + 1; ldv_61980: ; if (old_eth_num - delta > i) { goto ldv_61979; } else { } cos = cos + 1; ldv_61983: ; if ((int )bp->max_cos > cos) { goto ldv_61982; } else { } return; } } int bnx2x_load_count[2U][3U] = { { 0}}; static u16 bnx2x_free_tx_pkt(struct bnx2x *bp , struct bnx2x_fp_txdata *txdata , u16 idx , unsigned int *pkts_compl , unsigned int *bytes_compl ) { struct sw_tx_bd *tx_buf ; struct eth_tx_start_bd *tx_start_bd ; struct eth_tx_bd *tx_data_bd ; struct sk_buff *skb ; u16 bd_idx ; u16 new_cons ; int nbd ; u16 split_bd_len ; long tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; { tx_buf = txdata->tx_buf_ring + (unsigned long )idx; skb = tx_buf->skb; bd_idx = (unsigned int )tx_buf->first_bd & 4095U; split_bd_len = 0U; __builtin_prefetch((void const *)(& skb->end)); tmp = ldv__builtin_expect((bp->msg_enable & 1024) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]fp[%d]: pkt_idx %d buff @(%p)->skb %p\n", "bnx2x_free_tx_pkt", 211, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", txdata->txq_index, (int )idx, tx_buf, skb); } else { } tx_start_bd = & (txdata->tx_desc_ring + (unsigned long )bd_idx)->start_bd; nbd = (int )tx_start_bd->nbd + -1; new_cons = (int )tx_buf->first_bd + (int )((u16 )nbd); bd_idx = ((unsigned long )bd_idx & 255UL) == 254UL ? ((unsigned int )bd_idx + 2U) & 4095U : ((unsigned int )bd_idx + 1U) & 4095U; nbd = nbd - 1; bd_idx = ((unsigned long )bd_idx & 255UL) == 254UL ? ((unsigned int )bd_idx + 2U) & 4095U : ((unsigned int )bd_idx + 1U) & 4095U; if (((int )tx_buf->flags & 2) != 0) { nbd = nbd - 1; bd_idx = ((unsigned long )bd_idx & 255UL) == 254UL ? ((unsigned int )bd_idx + 2U) & 4095U : ((unsigned int )bd_idx + 1U) & 4095U; } else { } if ((int )tx_buf->flags & 1) { tx_data_bd = & (txdata->tx_desc_ring + (unsigned long )bd_idx)->reg_bd; split_bd_len = tx_data_bd->nbytes; nbd = nbd - 1; bd_idx = ((unsigned long )bd_idx & 255UL) == 254UL ? ((unsigned int )bd_idx + 2U) & 4095U : ((unsigned int )bd_idx + 1U) & 4095U; } else { } dma_unmap_single_attrs(& (bp->pdev)->dev, ((unsigned long long )tx_start_bd->addr_hi << 32) + (unsigned long long )tx_start_bd->addr_lo, (size_t )((int )tx_start_bd->nbytes + (int )split_bd_len), 1, (struct dma_attrs *)0); goto ldv_62003; ldv_62002: tx_data_bd = & (txdata->tx_desc_ring + (unsigned long )bd_idx)->reg_bd; dma_unmap_page___0(& (bp->pdev)->dev, ((unsigned long long )tx_data_bd->addr_hi << 32) + (unsigned long long )tx_data_bd->addr_lo, (size_t )tx_data_bd->nbytes, 1); nbd = nbd - 1; if (nbd != 0) { bd_idx = ((unsigned long )bd_idx & 255UL) == 254UL ? ((unsigned int )bd_idx + 2U) & 4095U : ((unsigned int )bd_idx + 1U) & 4095U; } else { } ldv_62003: ; if (nbd > 0) { goto ldv_62002; } else { } __ret_warn_on = (unsigned long )skb == (unsigned long )((struct sk_buff *)0); tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", 261); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___1 = ldv__builtin_expect((unsigned long )skb != (unsigned long )((struct sk_buff *)0), 1L); if (tmp___1 != 0L) { *pkts_compl = *pkts_compl + 1U; *bytes_compl = *bytes_compl + skb->len; } else { } dev_kfree_skb_any(skb); tx_buf->first_bd = 0U; tx_buf->skb = (struct sk_buff *)0; return (new_cons); } } int bnx2x_tx_int(struct bnx2x *bp , struct bnx2x_fp_txdata *txdata ) { struct netdev_queue *txq ; u16 hw_cons ; u16 sw_cons ; u16 bd_cons ; unsigned int pkts_compl ; unsigned int bytes_compl ; u16 pkt_cons ; long tmp ; int pscr_ret__ ; void const *__vpp_verify ; int pfo_ret__ ; int pfo_ret_____0 ; int pfo_ret_____1 ; int pfo_ret_____2 ; bool tmp___0 ; u16 tmp___1 ; bool tmp___2 ; long tmp___3 ; { bd_cons = txdata->tx_bd_cons; pkts_compl = 0U; bytes_compl = 0U; txq = netdev_get_tx_queue((struct net_device const *)bp->dev, (unsigned int )txdata->txq_index); hw_cons = *(txdata->tx_cons_sb); sw_cons = txdata->tx_pkt_cons; goto ldv_62020; ldv_62019: pkt_cons = (unsigned int )sw_cons & 4095U; tmp = ldv__builtin_expect((bp->msg_enable & 1024) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]queue[%d]: hw_cons %u sw_cons %u pkt_cons %u\n", "bnx2x_tx_int", 296, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", txdata->txq_index, (int )hw_cons, (int )sw_cons, (int )pkt_cons); } else { } bd_cons = bnx2x_free_tx_pkt(bp, txdata, (int )pkt_cons, & pkts_compl, & bytes_compl); sw_cons = (u16 )((int )sw_cons + 1); ldv_62020: ; if ((int )sw_cons != (int )hw_cons) { goto ldv_62019; } else { } netdev_tx_completed_queue(txq, pkts_compl, bytes_compl); txdata->tx_pkt_cons = sw_cons; txdata->tx_bd_cons = bd_cons; __asm__ volatile ("mfence": : : "memory"); tmp___2 = netif_tx_queue_stopped((struct netdev_queue const *)txq); tmp___3 = ldv__builtin_expect((long )tmp___2, 0L); if (tmp___3 != 0L) { __vpp_verify = (void const *)0; switch (4UL) { case 1UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_62027; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_62027; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_62027; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_62027; default: __bad_percpu_size(); } ldv_62027: pscr_ret__ = pfo_ret__; goto ldv_62033; case 2UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____0): "m" (cpu_number)); goto ldv_62037; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_62037; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_62037; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_62037; default: __bad_percpu_size(); } ldv_62037: pscr_ret__ = pfo_ret_____0; goto ldv_62033; case 4UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____1): "m" (cpu_number)); goto ldv_62046; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_62046; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_62046; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_62046; default: __bad_percpu_size(); } ldv_62046: pscr_ret__ = pfo_ret_____1; goto ldv_62033; case 8UL: ; switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret_____2): "m" (cpu_number)); goto ldv_62055; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_62055; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_62055; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_62055; default: __bad_percpu_size(); } ldv_62055: pscr_ret__ = pfo_ret_____2; goto ldv_62033; default: __bad_size_call_parameter(); goto ldv_62033; } ldv_62033: __netif_tx_lock(txq, pscr_ret__); tmp___0 = netif_tx_queue_stopped((struct netdev_queue const *)txq); if ((int )tmp___0 && (unsigned int )bp->state == 12288U) { tmp___1 = bnx2x_tx_avail(bp, txdata); if ((unsigned int )tmp___1 > 21U) { netif_tx_wake_queue(txq); } else { } } else { } __netif_tx_unlock(txq); } else { } return (0); } } __inline static void bnx2x_update_last_max_sge(struct bnx2x_fastpath *fp , u16 idx ) { u16 last_max ; { last_max = fp->last_max_sge; if ((int )((short )((int )idx - (int )last_max)) > 0) { fp->last_max_sge = idx; } else { } return; } } __inline static void bnx2x_update_sge_prod(struct bnx2x_fastpath *fp , u16 sge_len , struct eth_end_agg_rx_cqe *cqe ) { struct bnx2x *bp ; u16 last_max ; u16 last_elem ; u16 first_elem ; u16 delta ; u16 i ; long tmp ; long tmp___0 ; long tmp___1 ; { bp = fp->bp; delta = 0U; if ((unsigned int )sge_len == 0U) { return; } else { } i = 0U; goto ldv_62080; ldv_62079: fp->sge_mask[((unsigned long )cqe->sgl_or_raw_data.sgl[(int )i] & 1023UL) >> 6] = fp->sge_mask[((unsigned long )cqe->sgl_or_raw_data.sgl[(int )i] & 1023UL) >> 6] & ~ (1ULL << ((int )cqe->sgl_or_raw_data.sgl[(int )i] & 63)); i = (u16 )((int )i + 1); ldv_62080: ; if ((int )i < (int )sge_len) { goto ldv_62079; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]fp_cqe->sgl[%d] = %d\n", "bnx2x_update_sge_prod", 370, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )sge_len + -1, (int )cqe->sgl_or_raw_data.sgl[(int )sge_len + -1]); } else { } __builtin_prefetch((void const *)(& fp->sge_mask)); bnx2x_update_last_max_sge(fp, (int )cqe->sgl_or_raw_data.sgl[(int )sge_len + -1]); last_max = (unsigned int )fp->last_max_sge & 1023U; last_elem = (u16 )((int )last_max >> 6); first_elem = (u16 )(((unsigned long )fp->rx_sge_prod & 1023UL) >> 6); if ((int )last_elem + 1 != (int )first_elem) { last_elem = (u16 )((int )last_elem + 1); } else { } i = first_elem; goto ldv_62085; ldv_62084: tmp___0 = ldv__builtin_expect(fp->sge_mask[(int )i] != 0ULL, 1L); if (tmp___0 != 0L) { goto ldv_62083; } else { } fp->sge_mask[(int )i] = 0xffffffffffffffffULL; delta = (unsigned int )delta + 64U; i = ((unsigned int )i + 1U) & 15U; ldv_62085: ; if ((int )i != (int )last_elem) { goto ldv_62084; } else { } ldv_62083: ; if ((unsigned int )delta != 0U) { fp->rx_sge_prod = (int )fp->rx_sge_prod + (int )delta; bnx2x_clear_sge_mask_next_elems(fp); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]fp->last_max_sge = %d fp->rx_sge_prod = %d\n", "bnx2x_update_sge_prod", 402, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->last_max_sge, (int )fp->rx_sge_prod); } else { } return; } } static u32 bnx2x_get_rxhash(struct bnx2x const *bp , struct eth_fast_path_rx_cqe const *cqe , enum pkt_hash_types *rxhash_type ) { enum eth_rss_hash_type htype ; { if (((bp->dev)->features & 8589934592ULL) != 0ULL && ((int )cqe->status_flags & 8) != 0) { htype = (enum eth_rss_hash_type )((int )cqe->status_flags & 7); *rxhash_type = (unsigned int )htype == 2U || (unsigned int )htype == 4U ? 3 : 2; return ((u32 )cqe->rss_hash_result); } else { } *rxhash_type = 0; return (0U); } } static void bnx2x_tpa_start(struct bnx2x_fastpath *fp , u16 queue , u16 cons , u16 prod , struct eth_fast_path_rx_cqe *cqe ) { struct bnx2x *bp ; struct sw_rx_bd *cons_rx_buf ; struct sw_rx_bd *prod_rx_buf ; struct eth_rx_bd *prod_bd ; dma_addr_t mapping ; struct bnx2x_agg_info *tpa_info ; struct sw_rx_bd *first_buf ; int _max1 ; int _max2 ; int tmp ; long tmp___0 ; u16 gro_size ; { bp = fp->bp; cons_rx_buf = fp->rx_buf_ring + (unsigned long )cons; prod_rx_buf = fp->rx_buf_ring + (unsigned long )prod; prod_bd = fp->rx_desc_ring + (unsigned long )prod; tpa_info = fp->tpa_info + (unsigned long )queue; first_buf = & tpa_info->first_buf; if ((unsigned int )tpa_info->tpa_state != 2U) { printk("\vbnx2x: [%s:%d(%s)]start of bin not in stop [%d]\n", "bnx2x_tpa_start", 442, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )queue); } else { } _max1 = 32; _max2 = 64; mapping = dma_map_single_attrs(& (bp->pdev)->dev, (void *)first_buf->data + (unsigned long )(_max1 > _max2 ? _max1 : _max2), (size_t )fp->rx_buf_size, 2, (struct dma_attrs *)0); tmp = dma_mapping_error(& (bp->pdev)->dev, mapping); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); if (tmp___0 != 0L) { bnx2x_reuse_rx_data(fp, (int )cons, (int )prod); tpa_info->tpa_state = 3U; return; } else { } prod_rx_buf->data = first_buf->data; prod_rx_buf->mapping = mapping; prod_bd->addr_hi = (unsigned int )(mapping >> 32); prod_bd->addr_lo = (unsigned int )mapping; *first_buf = *cons_rx_buf; tpa_info->parsing_flags = cqe->pars_flags.flags; tpa_info->vlan_tag = cqe->vlan_tag; tpa_info->tpa_state = 1U; tpa_info->len_on_bd = cqe->len_on_bd; tpa_info->placement_offset = cqe->placement_offset; tpa_info->rxhash = bnx2x_get_rxhash((struct bnx2x const *)bp, (struct eth_fast_path_rx_cqe const *)cqe, & tpa_info->rxhash_type); if ((unsigned int )fp->mode == 2U) { gro_size = cqe->pkt_len_or_gro_seg_len; tpa_info->full_page = (int )((u16 )(4096 / (int )gro_size)) * (int )gro_size; tpa_info->gro_size = gro_size; } else { } return; } } static void bnx2x_set_gro_params(struct sk_buff *skb , u16 parsing_flags , u16 len_on_bd , unsigned int pkt_len , u16 num_of_coalesced_segs ) { u16 hdrs_len ; unsigned char *tmp ; unsigned char *tmp___0 ; unsigned char *tmp___1 ; { hdrs_len = 34U; if (((int )parsing_flags & 24) >> 3 == 2) { hdrs_len = (unsigned int )hdrs_len + 40U; tmp = skb_end_pointer((struct sk_buff const *)skb); ((struct skb_shared_info *)tmp)->gso_type = 16U; } else { hdrs_len = (unsigned int )hdrs_len + 20U; tmp___0 = skb_end_pointer((struct sk_buff const *)skb); ((struct skb_shared_info *)tmp___0)->gso_type = 1U; } if (((int )parsing_flags & 2048) != 0) { hdrs_len = (unsigned int )hdrs_len + 12U; } else { } tmp___1 = skb_end_pointer((struct sk_buff const *)skb); ((struct skb_shared_info *)tmp___1)->gso_size = (int )len_on_bd - (int )hdrs_len; ((struct napi_gro_cb *)(& skb->cb))->count = num_of_coalesced_segs; return; } } static int bnx2x_alloc_rx_sge(struct bnx2x *bp , struct bnx2x_fastpath *fp , u16 index , gfp_t gfp_mask ) { struct sw_rx_page *sw_buf ; struct eth_rx_sge *sge ; struct bnx2x_alloc_pool *pool ; dma_addr_t mapping ; long tmp ; int tmp___0 ; long tmp___1 ; { sw_buf = fp->rx_page_ring + (unsigned long )index; sge = fp->rx_sge_ring + (unsigned long )index; pool = & fp->page_pool; if ((unsigned long )pool->page == (unsigned long )((struct page *)0) || 4096UL - (unsigned long )pool->offset <= 4095UL) { if ((unsigned long )pool->page != (unsigned long )((struct page *)0)) { put_page(pool->page); } else { } pool->page = alloc_pages(gfp_mask, 0U); tmp = ldv__builtin_expect((unsigned long )pool->page == (unsigned long )((struct page *)0), 0L); if (tmp != 0L) { printk("\vbnx2x: [%s:%d(%s)]Can\'t alloc sge\n", "bnx2x_alloc_rx_sge", 562, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } else { } pool->offset = 0U; } else { } mapping = dma_map_page(& (bp->pdev)->dev, pool->page, (size_t )pool->offset, 4096UL, 2); tmp___0 = dma_mapping_error(& (bp->pdev)->dev, mapping); tmp___1 = ldv__builtin_expect(tmp___0 != 0, 0L); if (tmp___1 != 0L) { printk("\vbnx2x: [%s:%d(%s)]Can\'t map sge\n", "bnx2x_alloc_rx_sge", 572, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } else { } get_page(pool->page); sw_buf->page = pool->page; sw_buf->offset = pool->offset; sw_buf->mapping = mapping; sge->addr_hi = (unsigned int )(mapping >> 32); sge->addr_lo = (unsigned int )mapping; pool->offset = pool->offset + 4096U; return (0); } } static int bnx2x_fill_frag_skb(struct bnx2x *bp , struct bnx2x_fastpath *fp , struct bnx2x_agg_info *tpa_info , u16 pages , struct sk_buff *skb , struct eth_end_agg_rx_cqe *cqe , u16 cqe_idx ) { struct sw_rx_page *rx_pg ; struct sw_rx_page old_rx_pg ; u32 i ; u32 frag_len ; u32 frag_size ; int err ; int j ; int frag_id ; u16 len_on_bd ; u16 full_page ; u16 gro_size ; u16 sge_idx ; u32 __min1 ; u32 __min2 ; u32 __min1___0 ; u32 __min2___0 ; long tmp ; int rem ; int offset ; int len ; int tmp___0 ; { frag_id = 0; len_on_bd = tpa_info->len_on_bd; full_page = 0U; gro_size = 0U; frag_size = (u32 )((int )cqe->pkt_len - (int )len_on_bd); if ((unsigned int )fp->mode == 2U) { gro_size = tpa_info->gro_size; full_page = tpa_info->full_page; } else { } if (frag_size != 0U) { bnx2x_set_gro_params(skb, (int )tpa_info->parsing_flags, (int )len_on_bd, (unsigned int )cqe->pkt_len, (int )cqe->num_of_coalesced_segs); } else { } i = 0U; j = 0; goto ldv_62164; ldv_62163: sge_idx = (unsigned int )cqe->sgl_or_raw_data.sgl[j] & 1023U; if ((unsigned int )fp->mode == 2U) { __min1 = frag_size; __min2 = (unsigned int )full_page; frag_len = __min1 < __min2 ? __min1 : __min2; } else { __min1___0 = frag_size; __min2___0 = 4096U; frag_len = __min1___0 < __min2___0 ? __min1___0 : __min2___0; } rx_pg = fp->rx_page_ring + (unsigned long )sge_idx; old_rx_pg = *rx_pg; err = bnx2x_alloc_rx_sge(bp, fp, (int )sge_idx, 32U); tmp = ldv__builtin_expect(err != 0, 0L); if (tmp != 0L) { (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed = (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed + 1U; return (err); } else { } dma_unmap_page___0(& (bp->pdev)->dev, old_rx_pg.mapping, 4096UL, 2); if ((unsigned int )fp->mode == 1U) { skb_fill_page_desc(skb, j, old_rx_pg.page, (int )old_rx_pg.offset, (int )frag_len); } else { offset = 0; rem = (int )frag_len; goto ldv_62161; ldv_62160: len = rem < (int )gro_size ? rem : (int )gro_size; tmp___0 = frag_id; frag_id = frag_id + 1; skb_fill_page_desc(skb, tmp___0, old_rx_pg.page, (int )(old_rx_pg.offset + (unsigned int )offset), len); if (offset != 0) { get_page(old_rx_pg.page); } else { } offset = offset + len; rem = rem - (int )gro_size; ldv_62161: ; if (rem > 0) { goto ldv_62160; } else { } } skb->data_len = skb->data_len + frag_len; skb->truesize = skb->truesize + 4096U; skb->len = skb->len + frag_len; frag_size = frag_size - frag_len; i = i + 1U; j = j + 1; ldv_62164: ; if ((u32 )pages > i) { goto ldv_62163; } else { } return (0); } } static void bnx2x_frag_free(struct bnx2x_fastpath const *fp , void *data ) { { if ((unsigned int )fp->rx_frag_size != 0U) { skb_free_frag(data); } else { kfree((void const *)data); } return; } } static void *bnx2x_frag_alloc(struct bnx2x_fastpath const *fp , gfp_t gfp_mask ) { unsigned long tmp ; long tmp___0 ; void *tmp___1 ; int _max1 ; int _max2 ; void *tmp___2 ; { if ((unsigned int )fp->rx_frag_size != 0U) { tmp___0 = ldv__builtin_expect((gfp_mask & 16U) != 0U, 0L); if (tmp___0 != 0L) { tmp = __get_free_pages(gfp_mask, 0U); return ((void *)tmp); } else { } tmp___1 = netdev_alloc_frag(fp->rx_frag_size); return (tmp___1); } else { } _max1 = 32; _max2 = 64; tmp___2 = kmalloc((size_t )((unsigned int )fp->rx_buf_size + (unsigned int )(_max1 > _max2 ? _max1 : _max2)), gfp_mask); return (tmp___2); } } static void bnx2x_gro_ip_csum(struct bnx2x *bp , struct sk_buff *skb ) { struct iphdr const *iph ; struct iphdr *tmp ; struct tcphdr *th ; int tmp___0 ; __sum16 tmp___1 ; { tmp = ip_hdr((struct sk_buff const *)skb); iph = (struct iphdr const *)tmp; skb_set_transport_header(skb, 20); th = tcp_hdr((struct sk_buff const *)skb); tmp___0 = skb_transport_offset((struct sk_buff const *)skb); tmp___1 = tcp_v4_check((int )(skb->len - (unsigned int )tmp___0), iph->saddr, iph->daddr, 0U); th->check = ~ ((int )tmp___1); return; } } static void bnx2x_gro_ipv6_csum(struct bnx2x *bp , struct sk_buff *skb ) { struct ipv6hdr *iph ; struct ipv6hdr *tmp ; struct tcphdr *th ; int tmp___0 ; __sum16 tmp___1 ; { tmp = ipv6_hdr((struct sk_buff const *)skb); iph = tmp; skb_set_transport_header(skb, 40); th = tcp_hdr((struct sk_buff const *)skb); tmp___0 = skb_transport_offset((struct sk_buff const *)skb); tmp___1 = tcp_v6_check((int )(skb->len - (unsigned int )tmp___0), (struct in6_addr const *)(& iph->saddr), (struct in6_addr const *)(& iph->daddr), 0U); th->check = ~ ((int )tmp___1); return; } } static void bnx2x_gro_csum(struct bnx2x *bp , struct sk_buff *skb , void (*gro_func)(struct bnx2x * , struct sk_buff * ) ) { { skb_set_network_header(skb, 0); (*gro_func)(bp, skb); tcp_gro_complete(skb); return; } } static void bnx2x_gro_receive(struct bnx2x *bp , struct bnx2x_fastpath *fp , struct sk_buff *skb ) { __u16 tmp ; __u16 tmp___0 ; unsigned char *tmp___1 ; { tmp___1 = skb_end_pointer((struct sk_buff const *)skb); if ((unsigned int )((struct skb_shared_info *)tmp___1)->gso_size != 0U) { tmp = __fswab16((int )skb->protocol); switch ((int )tmp) { case 2048: bnx2x_gro_csum(bp, skb, & bnx2x_gro_ip_csum); goto ldv_62202; case 34525: bnx2x_gro_csum(bp, skb, & bnx2x_gro_ipv6_csum); goto ldv_62202; default: tmp___0 = __fswab16((int )skb->protocol); printk("\vbnx2x: [%s:%d(%s)]Error: FW GRO supports only IPv4/IPv6, not 0x%04x\n", "bnx2x_gro_receive", 749, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tmp___0); } ldv_62202: ; } else { } skb_record_rx_queue(skb, (int )fp->rx_queue); napi_gro_receive(& fp->napi, skb); return; } } static void bnx2x_tpa_stop(struct bnx2x *bp , struct bnx2x_fastpath *fp , struct bnx2x_agg_info *tpa_info , u16 pages , struct eth_end_agg_rx_cqe *cqe , u16 cqe_idx ) { struct sw_rx_bd *rx_buf ; u8 pad ; u16 len ; struct sk_buff *skb ; u8 *new_data ; u8 *data ; u8 old_tpa_state ; void *tmp ; long tmp___0 ; int _max1 ; int _max2 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; { rx_buf = & tpa_info->first_buf; pad = tpa_info->placement_offset; len = tpa_info->len_on_bd; skb = (struct sk_buff *)0; data = rx_buf->data; old_tpa_state = tpa_info->tpa_state; tpa_info->tpa_state = 2U; if ((unsigned int )old_tpa_state == 3U) { goto drop; } else { } tmp = bnx2x_frag_alloc((struct bnx2x_fastpath const *)fp, 32U); new_data = (u8 *)tmp; dma_unmap_single_attrs(& (bp->pdev)->dev, rx_buf->mapping, (size_t )fp->rx_buf_size, 2, (struct dma_attrs *)0); tmp___0 = ldv__builtin_expect((unsigned long )new_data != (unsigned long )((u8 *)0U), 1L); if (tmp___0 != 0L) { skb = build_skb((void *)data, fp->rx_frag_size); } else { } tmp___3 = ldv__builtin_expect((unsigned long )skb != (unsigned long )((struct sk_buff *)0), 1L); if (tmp___3 != 0L) { _max1 = 32; _max2 = 64; skb_reserve(skb, (int )pad + (_max1 > _max2 ? _max1 : _max2)); skb_put(skb, (unsigned int )len); skb_set_hash(skb, tpa_info->rxhash, tpa_info->rxhash_type); skb->protocol = eth_type_trans(skb, bp->dev); skb->ip_summed = 1U; tmp___2 = bnx2x_fill_frag_skb(bp, fp, tpa_info, (int )pages, skb, cqe, (int )cqe_idx); if (tmp___2 == 0) { if (((int )tpa_info->parsing_flags & 2) != 0) { __vlan_hwaccel_put_tag(skb, 129, (int )tpa_info->vlan_tag); } else { } bnx2x_gro_receive(bp, fp, skb); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to allocate new pages - dropping packet!\n", "bnx2x_tpa_stop", 812, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } dev_kfree_skb_any(skb); } rx_buf->data = new_data; return; } else { } if ((unsigned long )new_data != (unsigned long )((u8 *)0U)) { bnx2x_frag_free((struct bnx2x_fastpath const *)fp, (void *)new_data); } else { } drop: tmp___4 = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed to allocate or map a new skb - dropping packet!\n", "bnx2x_tpa_stop", 826, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed = (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed + 1U; return; } } static int bnx2x_alloc_rx_data(struct bnx2x *bp , struct bnx2x_fastpath *fp , u16 index , gfp_t gfp_mask ) { u8 *data ; struct sw_rx_bd *rx_buf ; struct eth_rx_bd *rx_bd ; dma_addr_t mapping ; void *tmp ; long tmp___0 ; int _max1 ; int _max2 ; int tmp___1 ; long tmp___2 ; { rx_buf = fp->rx_buf_ring + (unsigned long )index; rx_bd = fp->rx_desc_ring + (unsigned long )index; tmp = bnx2x_frag_alloc((struct bnx2x_fastpath const *)fp, gfp_mask); data = (u8 *)tmp; tmp___0 = ldv__builtin_expect((unsigned long )data == (unsigned long )((u8 *)0U), 0L); if (tmp___0 != 0L) { return (-12); } else { } _max1 = 32; _max2 = 64; mapping = dma_map_single_attrs(& (bp->pdev)->dev, (void *)data + (unsigned long )(_max1 > _max2 ? _max1 : _max2), (size_t )fp->rx_buf_size, 2, (struct dma_attrs *)0); tmp___1 = dma_mapping_error(& (bp->pdev)->dev, mapping); tmp___2 = ldv__builtin_expect(tmp___1 != 0, 0L); if (tmp___2 != 0L) { bnx2x_frag_free((struct bnx2x_fastpath const *)fp, (void *)data); printk("\vbnx2x: [%s:%d(%s)]Can\'t map rx data\n", "bnx2x_alloc_rx_data", 847, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } else { } rx_buf->data = data; rx_buf->mapping = mapping; rx_bd->addr_hi = (unsigned int )(mapping >> 32); rx_bd->addr_lo = (unsigned int )mapping; return (0); } } static void bnx2x_csum_validate(struct sk_buff *skb , union eth_rx_cqe *cqe , struct bnx2x_fastpath *fp , struct bnx2x_eth_q_stats *qstats ) { { if ((int )((signed char )cqe->fast_path_cqe.status_flags) < 0) { return; } else { } if (((int )cqe->fast_path_cqe.type_error_flags & 48) != 0) { qstats->hw_csum_err = qstats->hw_csum_err + 1U; } else { skb->ip_summed = 1U; } return; } } static int bnx2x_rx_int(struct bnx2x_fastpath *fp , int budget ) { struct bnx2x *bp ; u16 bd_cons ; u16 bd_prod ; u16 bd_prod_fw ; u16 comp_ring_cons ; u16 sw_comp_cons ; u16 sw_comp_prod ; int rx_pkt ; union eth_rx_cqe *cqe ; struct eth_fast_path_rx_cqe *cqe_fp ; long tmp ; struct sw_rx_bd *rx_buf ; struct sk_buff *skb ; u8 cqe_fp_flags ; enum eth_rx_cqe_type cqe_fp_type ; u16 len ; u16 pad ; u16 queue ; u8 *data ; u32 rxhash ; enum pkt_hash_types rxhash_type ; long tmp___0 ; long tmp___1 ; struct bnx2x_agg_info *tpa_info ; u16 frag_size ; u16 pages ; u16 queue___0 ; long tmp___2 ; long tmp___3 ; int _max1 ; int _max2 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; int tmp___9 ; long tmp___10 ; long tmp___11 ; bool tmp___12 ; { bp = fp->bp; rx_pkt = 0; if (budget <= 0) { return (rx_pkt); } else { } bd_cons = fp->rx_bd_cons; bd_prod = fp->rx_bd_prod; bd_prod_fw = bd_prod; sw_comp_cons = fp->rx_comp_cons; sw_comp_prod = fp->rx_comp_prod; comp_ring_cons = (unsigned int )sw_comp_cons & 4095U; cqe = fp->rx_comp_ring + (unsigned long )comp_ring_cons; cqe_fp = & cqe->fast_path_cqe; tmp = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]queue[%d]: sw_comp_cons %u\n", "bnx2x_rx_int", 911, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index, (int )sw_comp_cons); } else { } goto ldv_62283; ldv_62282: rx_buf = (struct sw_rx_bd *)0; bd_prod = (unsigned int )bd_prod & 4095U; bd_cons = (unsigned int )bd_cons & 4095U; __asm__ volatile ("lfence": : : "memory"); cqe_fp_flags = cqe_fp->type_error_flags; cqe_fp_type = (enum eth_rx_cqe_type )((int )cqe_fp_flags & 3); tmp___0 = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]CQE type %x err %x status %x queue %x vlan %x len %u\n", "bnx2x_rx_int", 952, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cqe_fp_flags & 3, (int )cqe_fp_flags, (int )cqe_fp->status_flags, cqe_fp->rss_hash_result, (int )cqe_fp->vlan_tag, (int )cqe_fp->pkt_len_or_gro_seg_len); } else { } tmp___1 = ldv__builtin_expect((unsigned int )cqe_fp_type == 1U, 0L); if (tmp___1 != 0L) { bnx2x_sp_event(fp, cqe); goto next_cqe; } else { } rx_buf = fp->rx_buf_ring + (unsigned long )bd_cons; data = rx_buf->data; if ((unsigned int )cqe_fp_type != 0U) { if ((unsigned int )cqe_fp_type == 2U) { queue___0 = (u16 )cqe_fp->queue_index; tmp___2 = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]calling tpa_start on queue %d\n", "bnx2x_rx_int", 979, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )queue___0); } else { } bnx2x_tpa_start(fp, (int )queue___0, (int )bd_cons, (int )bd_prod, cqe_fp); goto next_rx; } else { } queue = (u16 )cqe->end_agg_cqe.queue_index; tpa_info = fp->tpa_info + (unsigned long )queue; tmp___3 = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]calling tpa_stop on queue %d\n", "bnx2x_rx_int", 991, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )queue); } else { } frag_size = (int )cqe->end_agg_cqe.pkt_len - (int )tpa_info->len_on_bd; if ((unsigned int )fp->mode == 2U) { pages = (u16 )((((int )frag_size + (int )tpa_info->full_page) + -1) / (int )tpa_info->full_page); } else { pages = (u16 )(((int )frag_size + 4095) >> 12); } bnx2x_tpa_stop(bp, fp, tpa_info, (int )pages, & cqe->end_agg_cqe, (int )comp_ring_cons); bnx2x_update_sge_prod(fp, (int )pages, & cqe->end_agg_cqe); goto next_cqe; } else { } len = cqe_fp->pkt_len_or_gro_seg_len; pad = (u16 )cqe_fp->placement_offset; dma_sync_single_for_cpu(& (bp->pdev)->dev, rx_buf->mapping, (size_t )((int )pad + 92), 2); _max1 = 32; _max2 = 64; pad = (int )((u16 )(_max1 > _max2 ? _max1 : _max2)) + (int )pad; __builtin_prefetch((void const *)data + (unsigned long )pad); tmp___5 = ldv__builtin_expect(((int )cqe_fp_flags & 8) != 0, 0L); if (tmp___5 != 0L) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 2112) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]OLD_ERROR flags %x rx packet %u\n", "bnx2x_rx_int", 1026, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cqe_fp_flags, (int )sw_comp_cons); } else { } (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_err_discard_pkt = (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_err_discard_pkt + 1U; goto reuse_rx; } else { } if ((bp->dev)->mtu > 1500U && (unsigned int )len <= 92U) { skb = napi_alloc_skb(& fp->napi, (unsigned int )len); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 2112) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]OLD_ERROR packet dropped because of alloc failure\n", "bnx2x_rx_int", 1039, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed = (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed + 1U; goto reuse_rx; } else { } memcpy((void *)skb->data, (void const *)data + (unsigned long )pad, (size_t )len); bnx2x_reuse_rx_data(fp, (int )bd_cons, (int )bd_prod); } else { tmp___9 = bnx2x_alloc_rx_data(bp, fp, (int )bd_prod, 32U); tmp___10 = ldv__builtin_expect(tmp___9 == 0, 1L); if (tmp___10 != 0L) { dma_unmap_single_attrs(& (bp->pdev)->dev, rx_buf->mapping, (size_t )fp->rx_buf_size, 2, (struct dma_attrs *)0); skb = build_skb((void *)data, fp->rx_frag_size); tmp___7 = ldv__builtin_expect((unsigned long )skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___7 != 0L) { bnx2x_frag_free((struct bnx2x_fastpath const *)fp, (void *)data); (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed = (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed + 1U; goto next_rx; } else { } skb_reserve(skb, (int )pad); } else { tmp___8 = ldv__builtin_expect((bp->msg_enable & 2112) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]OLD_ERROR packet dropped because of alloc failure\n", "bnx2x_rx_int", 1062, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed = (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed + 1U; reuse_rx: bnx2x_reuse_rx_data(fp, (int )bd_cons, (int )bd_prod); goto next_rx; } } skb_put(skb, (unsigned int )len); skb->protocol = eth_type_trans(skb, bp->dev); rxhash = bnx2x_get_rxhash((struct bnx2x const *)bp, (struct eth_fast_path_rx_cqe const *)cqe_fp, & rxhash_type); skb_set_hash(skb, rxhash, rxhash_type); skb_checksum_none_assert((struct sk_buff const *)skb); if (((bp->dev)->features & 17179869184ULL) != 0ULL) { bnx2x_csum_validate(skb, cqe, fp, & (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats); } else { } skb_record_rx_queue(skb, (int )fp->rx_queue); tmp___11 = ldv__builtin_expect(((int )cqe->fast_path_cqe.type_error_flags & 64) != 0, 0L); if (tmp___11 != 0L) { bnx2x_set_rx_ts(bp, skb); } else { } if (((int )cqe_fp->pars_flags.flags & 2) != 0) { __vlan_hwaccel_put_tag(skb, 129, (int )cqe_fp->vlan_tag); } else { } skb_mark_napi_id(skb, & fp->napi); tmp___12 = bnx2x_fp_ll_polling(fp); if ((int )tmp___12) { netif_receive_skb(skb); } else { napi_gro_receive(& fp->napi, skb); } next_rx: rx_buf->data = (u8 *)0U; bd_cons = ((unsigned long )bd_cons & 511UL) == 509UL ? (unsigned int )bd_cons + 3U : (unsigned int )bd_cons + 1U; bd_prod = ((unsigned long )bd_prod & 511UL) == 509UL ? (unsigned int )bd_prod + 3U : (unsigned int )bd_prod + 1U; bd_prod_fw = ((unsigned long )bd_prod_fw & 511UL) == 509UL ? (unsigned int )bd_prod_fw + 3U : (unsigned int )bd_prod_fw + 1U; rx_pkt = rx_pkt + 1; next_cqe: sw_comp_prod = ((unsigned long )sw_comp_prod & 63UL) == 62UL ? (unsigned int )sw_comp_prod + 2U : (unsigned int )sw_comp_prod + 1U; sw_comp_cons = ((unsigned long )sw_comp_cons & 63UL) == 62UL ? (unsigned int )sw_comp_cons + 2U : (unsigned int )sw_comp_cons + 1U; cqe_fp->marker = 4294967295U; if (rx_pkt == budget) { goto ldv_62281; } else { } comp_ring_cons = (unsigned int )sw_comp_cons & 4095U; cqe = fp->rx_comp_ring + (unsigned long )comp_ring_cons; cqe_fp = & cqe->fast_path_cqe; ldv_62283: ; if (cqe_fp->marker == 0U) { goto ldv_62282; } else { } ldv_62281: fp->rx_bd_cons = bd_cons; fp->rx_bd_prod = bd_prod_fw; fp->rx_comp_cons = sw_comp_cons; fp->rx_comp_prod = sw_comp_prod; bnx2x_update_rx_prod(bp, fp, (int )bd_prod_fw, (int )sw_comp_prod, (int )fp->rx_sge_prod); fp->rx_pkt = fp->rx_pkt + (unsigned long )rx_pkt; fp->rx_calls = fp->rx_calls + 1UL; return (rx_pkt); } } static irqreturn_t bnx2x_msix_fp_int(int irq , void *fp_cookie ) { struct bnx2x_fastpath *fp ; struct bnx2x *bp ; u8 cos ; long tmp ; { fp = (struct bnx2x_fastpath *)fp_cookie; bp = fp->bp; tmp = ldv__builtin_expect((bp->msg_enable & 512) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]got an MSI-X interrupt on IDX:SB [fp %d fw_sd %d igusb %d]\n", "bnx2x_msix_fp_int", 1146, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index, (int )fp->fw_sb_id, (int )fp->igu_sb_id); } else { } bnx2x_ack_sb(bp, (int )fp->igu_sb_id, 0, 0, 1, 0); cos = 0U; goto ldv_62293; ldv_62292: __builtin_prefetch((void const *)(fp->txdata_ptr[(int )cos])->tx_cons_sb); cos = (u8 )((int )cos + 1); ldv_62293: ; if ((int )fp->max_cos > (int )cos) { goto ldv_62292; } else { } __builtin_prefetch((void const *)fp->sb_running_index); napi_schedule_irqoff(& (bp->fp + (unsigned long )fp->index)->napi); return (1); } } void bnx2x_acquire_phy_lock(struct bnx2x *bp ) { { mutex_lock_nested(& bp->port.phy_mutex, 0U); bnx2x_acquire_hw_lock(bp, 0U); return; } } void bnx2x_release_phy_lock(struct bnx2x *bp ) { { bnx2x_release_hw_lock(bp, 0U); mutex_unlock(& bp->port.phy_mutex); return; } } u16 bnx2x_get_mf_speed(struct bnx2x *bp ) { u16 line_speed ; u16 maxCfg ; u16 tmp ; u16 vn_max_rate ; { line_speed = bp->link_vars.line_speed; if ((unsigned int )bp->mf_mode != 0U) { tmp = bnx2x_extract_max_cfg(bp, bp->mf_config[(int )bp->pfid >> 1]); maxCfg = tmp; if ((unsigned int )bp->mf_mode == 2U) { line_speed = (u16 )(((int )line_speed * (int )maxCfg) / 100); } else { vn_max_rate = (unsigned int )maxCfg * 100U; if ((int )vn_max_rate < (int )line_speed) { line_speed = vn_max_rate; } else { } } } else { } return (line_speed); } } static void bnx2x_fill_report_data(struct bnx2x *bp , struct bnx2x_link_report_data *data ) { { memset((void *)data, 0, 16UL); if ((bp->flags & 4194304U) == 0U) { data->line_speed = bnx2x_get_mf_speed(bp); if ((unsigned int )bp->link_vars.link_up == 0U || (bp->flags & 2048U) != 0U) { __set_bit(1L, (unsigned long volatile *)(& data->link_report_flags)); } else { } if (bp->num_ethernet_queues == 0U) { __set_bit(1L, (unsigned long volatile *)(& data->link_report_flags)); } else { } if ((unsigned int )bp->link_vars.duplex == 1U) { __set_bit(0L, (unsigned long volatile *)(& data->link_report_flags)); } else { } if (((int )bp->link_vars.flow_ctrl & 512) != 0) { __set_bit(2L, (unsigned long volatile *)(& data->link_report_flags)); } else { } if (((int )bp->link_vars.flow_ctrl & 256) != 0) { __set_bit(3L, (unsigned long volatile *)(& data->link_report_flags)); } else { } } else { *data = bp->vf_link_vars; } return; } } void bnx2x_link_report(struct bnx2x *bp ) { { bnx2x_acquire_phy_lock(bp); __bnx2x_link_report(bp); bnx2x_release_phy_lock(bp); return; } } void __bnx2x_link_report(struct bnx2x *bp ) { struct bnx2x_link_report_data cur_data ; int tmp ; int tmp___0 ; int tmp___1 ; char const *duplex ; char const *flow ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { if ((bp->flags & 4194304U) == 0U && bp->common.chip_id >> 16 != 5710U) { bnx2x_read_mf_cfg(bp); } else { } bnx2x_fill_report_data(bp, & cur_data); tmp = memcmp((void const *)(& cur_data), (void const *)(& bp->last_reported_link), 16UL); if (tmp == 0) { return; } else { tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& bp->last_reported_link.link_report_flags)); if (tmp___0 != 0) { tmp___1 = constant_test_bit(1L, (unsigned long const volatile *)(& cur_data.link_report_flags)); if (tmp___1 != 0) { return; } else { } } else { } } bp->link_cnt = bp->link_cnt + 1U; memcpy((void *)(& bp->last_reported_link), (void const *)(& cur_data), 16UL); if ((bp->flags & 4194304U) == 0U) { bnx2x_iov_link_update(bp); } else { } tmp___5 = constant_test_bit(1L, (unsigned long const volatile *)(& cur_data.link_report_flags)); if (tmp___5 != 0) { netif_carrier_off(bp->dev); netdev_err((struct net_device const *)bp->dev, "NIC Link is Down\n"); return; } else { netif_carrier_on(bp->dev); tmp___2 = test_and_clear_bit(0L, (unsigned long volatile *)(& cur_data.link_report_flags)); if (tmp___2 != 0) { duplex = "full"; } else { duplex = "half"; } if (cur_data.link_report_flags != 0UL) { tmp___4 = constant_test_bit(2L, (unsigned long const volatile *)(& cur_data.link_report_flags)); if (tmp___4 != 0) { tmp___3 = constant_test_bit(3L, (unsigned long const volatile *)(& cur_data.link_report_flags)); if (tmp___3 != 0) { flow = "ON - receive & transmit"; } else { flow = "ON - receive"; } } else { flow = "ON - transmit"; } } else { flow = "none"; } netdev_info((struct net_device const *)bp->dev, "NIC Link is Up, %d Mbps %s duplex, Flow control: %s\n", (int )cur_data.line_speed, duplex, flow); } return; } } static void bnx2x_set_next_page_sgl(struct bnx2x_fastpath *fp ) { int i ; struct eth_rx_sge *sge ; { i = 1; goto ldv_62326; ldv_62325: sge = fp->rx_sge_ring + ((unsigned long )i * 512UL + 0xfffffffffffffffeUL); sge->addr_hi = (unsigned int )((fp->rx_sge_mapping + (dma_addr_t )((i % 2) * 4096)) >> 32); sge->addr_lo = (unsigned int )fp->rx_sge_mapping + (unsigned int )((i % 2) * 4096); i = i + 1; ldv_62326: ; if (i <= 2) { goto ldv_62325; } else { } return; } } static void bnx2x_free_tpa_pool(struct bnx2x *bp , struct bnx2x_fastpath *fp , int last ) { int i ; struct bnx2x_agg_info *tpa_info ; struct sw_rx_bd *first_buf ; u8 *data ; long tmp ; { i = 0; goto ldv_62340; ldv_62339: tpa_info = fp->tpa_info + (unsigned long )i; first_buf = & tpa_info->first_buf; data = first_buf->data; if ((unsigned long )data == (unsigned long )((u8 *)0U)) { tmp = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]tpa bin %d empty on free\n", "bnx2x_free_tpa_pool", 1373, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i); } else { } goto ldv_62338; } else { } if ((unsigned int )tpa_info->tpa_state == 1U) { dma_unmap_single_attrs(& (bp->pdev)->dev, first_buf->mapping, (size_t )fp->rx_buf_size, 2, (struct dma_attrs *)0); } else { } bnx2x_frag_free((struct bnx2x_fastpath const *)fp, (void *)data); first_buf->data = (u8 *)0U; ldv_62338: i = i + 1; ldv_62340: ; if (i < last) { goto ldv_62339; } else { } return; } } void bnx2x_init_rx_rings_cnic(struct bnx2x *bp ) { int j ; struct bnx2x_fastpath *fp ; { j = (int )bp->num_ethernet_queues; goto ldv_62349; ldv_62348: ; if ((bp->flags & 32768U) != 0U && (uint )j == (uint )bp->num_queues - bp->num_cnic_queues) { } else { fp = bp->fp + (unsigned long )j; fp->rx_bd_cons = 0U; bnx2x_update_rx_prod(bp, fp, (int )fp->rx_bd_prod, (int )fp->rx_comp_prod, (int )fp->rx_sge_prod); } j = j + 1; ldv_62349: ; if (bp->num_queues > j) { goto ldv_62348; } else { } return; } } void bnx2x_init_rx_rings(struct bnx2x *bp ) { int func ; u16 ring_prod ; int i ; int j ; struct bnx2x_fastpath *fp ; long tmp ; struct bnx2x_agg_info *tpa_info ; struct sw_rx_bd *first_buf ; void *tmp___0 ; int tmp___1 ; struct bnx2x_fastpath *fp___0 ; { func = (int )bp->pfid; j = 0; goto ldv_62369; ldv_62368: fp = bp->fp + (unsigned long )j; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]mtu %d rx_buf_size %d\n", "bnx2x_init_rx_rings", 1415, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->dev)->mtu, fp->rx_buf_size); } else { } if ((unsigned int )fp->mode != 0U) { i = 0; goto ldv_62364; ldv_62363: tpa_info = fp->tpa_info + (unsigned long )i; first_buf = & tpa_info->first_buf; tmp___0 = bnx2x_frag_alloc((struct bnx2x_fastpath const *)fp, 208U); first_buf->data = (u8 *)tmp___0; if ((unsigned long )first_buf->data == (unsigned long )((u8 *)0U)) { printk("\vbnx2x: [%s:%d(%s)]Failed to allocate TPA skb pool for queue[%d] - disabling TPA on this queue!\n", "bnx2x_init_rx_rings", 1429, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", j); bnx2x_free_tpa_pool(bp, fp, i); fp->mode = 0; goto ldv_62362; } else { } first_buf->mapping = 0ULL; tpa_info->tpa_state = 2U; i = i + 1; ldv_62364: ; if ((bp->common.chip_id >> 16 == 5710U ? 32 : 64) > i) { goto ldv_62363; } else { } ldv_62362: bnx2x_set_next_page_sgl(fp); bnx2x_init_sge_ring_bit_mask(fp); i = 0; ring_prod = 0U; goto ldv_62367; ldv_62366: tmp___1 = bnx2x_alloc_rx_sge(bp, fp, (int )ring_prod, 208U); if (tmp___1 < 0) { printk("\vbnx2x: [%s:%d(%s)]was only able to allocate %d rx sges\n", "bnx2x_init_rx_rings", 1451, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i); printk("\vbnx2x: [%s:%d(%s)]disabling TPA for queue[%d]\n", "bnx2x_init_rx_rings", 1453, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", j); bnx2x_free_rx_sge_range___0(bp, fp, (int )ring_prod); bnx2x_free_tpa_pool(bp, fp, bp->common.chip_id >> 16 == 5710U ? 32 : 64); fp->mode = 0; ring_prod = 0U; goto ldv_62365; } else { } ring_prod = ((unsigned long )ring_prod & 511UL) == 509UL ? (unsigned int )ring_prod + 3U : (unsigned int )ring_prod + 1U; i = i + 1; ldv_62367: ; if ((unsigned int )i <= 1019U) { goto ldv_62366; } else { } ldv_62365: fp->rx_sge_prod = ring_prod; } else { } j = j + 1; ldv_62369: ; if ((uint )j < bp->num_ethernet_queues) { goto ldv_62368; } else { } j = 0; goto ldv_62374; ldv_62373: fp___0 = bp->fp + (unsigned long )j; fp___0->rx_bd_cons = 0U; bnx2x_update_rx_prod(bp, fp___0, (int )fp___0->rx_bd_prod, (int )fp___0->rx_comp_prod, (int )fp___0->rx_sge_prod); if (j != 0) { goto ldv_62372; } else { } if (bp->common.chip_id >> 16 == 5710U) { writel((unsigned int )fp___0->rx_comp_mapping, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 186UL)->base + (unsigned int )((int )(bp->iro_arr + 186UL)->m1 * func)) + 4194304U)); writel((unsigned int )(fp___0->rx_comp_mapping >> 32), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 186UL)->base + (unsigned int )((int )(bp->iro_arr + 186UL)->m1 * func)) + 4194308U)); } else { } ldv_62372: j = j + 1; ldv_62374: ; if ((uint )j < bp->num_ethernet_queues) { goto ldv_62373; } else { } return; } } static void bnx2x_free_tx_skbs_queue(struct bnx2x_fastpath *fp ) { u8 cos ; struct bnx2x *bp ; struct bnx2x_fp_txdata *txdata ; unsigned int pkts_compl ; unsigned int bytes_compl ; u16 sw_prod ; u16 sw_cons ; struct netdev_queue *tmp ; { bp = fp->bp; cos = 0U; goto ldv_62390; ldv_62389: txdata = fp->txdata_ptr[(int )cos]; pkts_compl = 0U; bytes_compl = 0U; sw_prod = txdata->tx_pkt_prod; sw_cons = txdata->tx_pkt_cons; goto ldv_62387; ldv_62386: bnx2x_free_tx_pkt(bp, txdata, (int )sw_cons & 4095, & pkts_compl, & bytes_compl); sw_cons = (u16 )((int )sw_cons + 1); ldv_62387: ; if ((int )sw_cons != (int )sw_prod) { goto ldv_62386; } else { } tmp = netdev_get_tx_queue((struct net_device const *)bp->dev, (unsigned int )txdata->txq_index); netdev_tx_reset_queue(tmp); cos = (u8 )((int )cos + 1); ldv_62390: ; if ((int )fp->max_cos > (int )cos) { goto ldv_62389; } else { } return; } } static void bnx2x_free_tx_skbs_cnic(struct bnx2x *bp ) { int i ; { i = (int )bp->num_ethernet_queues; goto ldv_62398; ldv_62397: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_free_tx_skbs_queue(bp->fp + (unsigned long )i); } i = i + 1; ldv_62398: ; if (bp->num_queues > i) { goto ldv_62397; } else { } return; } } static void bnx2x_free_tx_skbs(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_62405; ldv_62404: bnx2x_free_tx_skbs_queue(bp->fp + (unsigned long )i); i = i + 1; ldv_62405: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62404; } else { } return; } } static void bnx2x_free_rx_bds(struct bnx2x_fastpath *fp ) { struct bnx2x *bp ; int i ; struct sw_rx_bd *rx_buf ; u8 *data ; { bp = fp->bp; if ((unsigned long )fp->rx_buf_ring == (unsigned long )((struct sw_rx_bd *)0)) { return; } else { } i = 0; goto ldv_62416; ldv_62415: rx_buf = fp->rx_buf_ring + (unsigned long )i; data = rx_buf->data; if ((unsigned long )data == (unsigned long )((u8 *)0U)) { goto ldv_62414; } else { } dma_unmap_single_attrs(& (bp->pdev)->dev, rx_buf->mapping, (size_t )fp->rx_buf_size, 2, (struct dma_attrs *)0); rx_buf->data = (u8 *)0U; bnx2x_frag_free((struct bnx2x_fastpath const *)fp, (void *)data); ldv_62414: i = i + 1; ldv_62416: ; if ((unsigned int )i <= 4095U) { goto ldv_62415; } else { } return; } } static void bnx2x_free_rx_skbs_cnic(struct bnx2x *bp ) { int j ; { j = (int )bp->num_ethernet_queues; goto ldv_62424; ldv_62423: ; if ((bp->flags & 32768U) != 0U && (uint )j == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_free_rx_bds(bp->fp + (unsigned long )j); } j = j + 1; ldv_62424: ; if (bp->num_queues > j) { goto ldv_62423; } else { } return; } } static void bnx2x_free_rx_skbs(struct bnx2x *bp ) { int j ; struct bnx2x_fastpath *fp ; { j = 0; goto ldv_62432; ldv_62431: fp = bp->fp + (unsigned long )j; bnx2x_free_rx_bds(fp); if ((unsigned int )fp->mode != 0U) { bnx2x_free_tpa_pool(bp, fp, bp->common.chip_id >> 16 == 5710U ? 32 : 64); } else { } j = j + 1; ldv_62432: ; if ((uint )j < bp->num_ethernet_queues) { goto ldv_62431; } else { } return; } } static void bnx2x_free_skbs_cnic(struct bnx2x *bp ) { { bnx2x_free_tx_skbs_cnic(bp); bnx2x_free_rx_skbs_cnic(bp); return; } } void bnx2x_free_skbs(struct bnx2x *bp ) { { bnx2x_free_tx_skbs(bp); bnx2x_free_rx_skbs(bp); return; } } void bnx2x_update_max_mf_config(struct bnx2x *bp , u32 value ) { u32 mf_cfg ; u16 tmp ; { mf_cfg = bp->mf_config[(int )bp->pfid >> 1]; tmp = bnx2x_extract_max_cfg(bp, mf_cfg); if ((u32 )tmp != value) { mf_cfg = mf_cfg & 16777215U; mf_cfg = (value << 24) | mf_cfg; bnx2x_fw_command(bp, 3758096384U, mf_cfg); } else { } return; } } static void bnx2x_free_msix_irqs(struct bnx2x *bp , int nvecs ) { int i ; int offset ; long tmp ; long tmp___0 ; int tmp___1 ; { offset = 0; if (nvecs == offset) { return; } else { } if ((bp->flags & 4194304U) == 0U) { ldv_free_irq_84((bp->msix_table + (unsigned long )offset)->vector, (void *)bp->dev); tmp = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]released sp irq (%d)\n", "bnx2x_free_msix_irqs", 1632, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->msix_table + (unsigned long )offset)->vector); } else { } offset = offset + 1; } else { } if ((unsigned int )bp->cnic_support != 0U) { if (nvecs == offset) { return; } else { } offset = offset + 1; } else { } i = 0; goto ldv_62453; ldv_62452: ; if (nvecs == offset) { return; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]about to release fp #%d->%d irq\n", "bnx2x_free_msix_irqs", 1646, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (bp->msix_table + (unsigned long )offset)->vector); } else { } tmp___1 = offset; offset = offset + 1; ldv_free_irq_85((bp->msix_table + (unsigned long )tmp___1)->vector, (void *)bp->fp + (unsigned long )i); i = i + 1; ldv_62453: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62452; } else { } return; } } void bnx2x_free_irq(struct bnx2x *bp ) { int nvecs ; { if ((bp->flags & 32U) != 0U && (bp->flags & 1048576U) == 0U) { nvecs = (int )(bp->num_ethernet_queues + (uint )bp->cnic_support); if ((bp->flags & 4194304U) == 0U) { nvecs = nvecs + 1; } else { } bnx2x_free_msix_irqs(bp, nvecs); } else { ldv_free_irq_86((unsigned int )(bp->dev)->irq, (void *)bp->dev); } return; } } int bnx2x_enable_msix(struct bnx2x *bp ) { int msix_vec ; int i ; int rc ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; int diff ; long tmp___7 ; long tmp___8 ; { msix_vec = 0; if ((bp->flags & 4194304U) == 0U) { (bp->msix_table + (unsigned long )msix_vec)->entry = (u16 )msix_vec; tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "msix_table[0].entry = %d (slowpath)\n", (int )(bp->msix_table)->entry); } else { } msix_vec = msix_vec + 1; } else { } if ((unsigned int )bp->cnic_support != 0U) { (bp->msix_table + (unsigned long )msix_vec)->entry = (u16 )msix_vec; tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "msix_table[%d].entry = %d (CNIC)\n", msix_vec, (int )(bp->msix_table + (unsigned long )msix_vec)->entry); } else { } msix_vec = msix_vec + 1; } else { } i = 0; goto ldv_62466; ldv_62465: (bp->msix_table + (unsigned long )msix_vec)->entry = (u16 )msix_vec; tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "msix_table[%d].entry = %d (fastpath #%u)\n", msix_vec, msix_vec, i); } else { } msix_vec = msix_vec + 1; i = i + 1; ldv_62466: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62465; } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]about to request enable msix with %d vectors\n", "bnx2x_enable_msix", 1697, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", msix_vec); } else { } rc = pci_enable_msix_range(bp->pdev, bp->msix_table, (int )bp->min_msix_vec_cnt, msix_vec); if (rc == -28) { rc = pci_enable_msix_range(bp->pdev, bp->msix_table, 1, 1); if (rc < 0) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___3 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Single MSI-X is not attainable rc %d\n", rc); } else { } goto no_msix; } else { } tmp___4 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___4 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Using single MSI-X vector\n"); } else { } bp->flags = bp->flags | 1048576U; tmp___5 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___5 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "set number of queues to 1\n"); } else { } bp->num_ethernet_queues = 1U; bp->num_queues = (int )(bp->num_ethernet_queues + bp->num_cnic_queues); } else if (rc < 0) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___6 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "MSI-X is not attainable rc %d\n", rc); } else { } goto no_msix; } else if (rc < msix_vec) { diff = msix_vec - rc; tmp___7 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___7 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "Trying to use less MSI-X vectors: %d\n", rc); } else { } bp->num_ethernet_queues = bp->num_ethernet_queues - (uint )diff; bp->num_queues = (int )(bp->num_ethernet_queues + bp->num_cnic_queues); tmp___8 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___8 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "New queue configuration set: %d\n", bp->num_queues); } else { } } else { } bp->flags = bp->flags | 32U; return (0); no_msix: ; if (rc == -12) { bp->flags = bp->flags | 128U; } else { } return (rc); } } static int bnx2x_req_msix_irqs(struct bnx2x *bp ) { int i ; int rc ; int offset ; int tmp ; struct bnx2x_fastpath *fp ; { offset = 0; if ((bp->flags & 4194304U) == 0U) { tmp = offset; offset = offset + 1; rc = ldv_request_irq_87((bp->msix_table + (unsigned long )tmp)->vector, & bnx2x_msix_sp_int, 0UL, (char const *)(& (bp->dev)->name), (void *)bp->dev); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]request sp irq failed\n", "bnx2x_req_msix_irqs", 1761, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } } else { } if ((unsigned int )bp->cnic_support != 0U) { offset = offset + 1; } else { } i = 0; goto ldv_62480; ldv_62479: fp = bp->fp + (unsigned long )i; snprintf((char *)(& fp->name), 24UL, "%s-fp-%d", (char *)(& (bp->dev)->name), i); rc = ldv_request_irq_88((bp->msix_table + (unsigned long )offset)->vector, & bnx2x_msix_fp_int, 0UL, (char const *)(& fp->name), (void *)fp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]request fp #%d irq (%d) failed rc %d\n", "bnx2x_req_msix_irqs", 1778, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (bp->msix_table + (unsigned long )offset)->vector, rc); bnx2x_free_msix_irqs(bp, offset); return (-16); } else { } offset = offset + 1; i = i + 1; ldv_62480: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62479; } else { } i = (int )bp->num_ethernet_queues; if ((bp->flags & 4194304U) == 0U) { offset = (int )bp->cnic_support + 1; netdev_info((struct net_device const *)bp->dev, "using MSI-X IRQs: sp %d fp[%d] %d ... fp[%d] %d\n", (bp->msix_table)->vector, 0, (bp->msix_table + (unsigned long )offset)->vector, i + -1, (bp->msix_table + ((unsigned long )(offset + i) + 0xffffffffffffffffUL))->vector); } else { offset = (int )bp->cnic_support; netdev_info((struct net_device const *)bp->dev, "using MSI-X IRQs: fp[%d] %d ... fp[%d] %d\n", 0, (bp->msix_table + (unsigned long )offset)->vector, i + -1, (bp->msix_table + ((unsigned long )(offset + i) + 0xffffffffffffffffUL))->vector); } return (0); } } int bnx2x_enable_msi(struct bnx2x *bp ) { int rc ; long tmp ; { rc = pci_enable_msi_exact(bp->pdev, 1); if (rc != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "MSI is not attainable\n"); } else { } return (-1); } else { } bp->flags = bp->flags | 64U; return (0); } } static int bnx2x_req_irq(struct bnx2x *bp ) { unsigned long flags ; unsigned int irq ; int tmp ; { if ((bp->flags & 96U) != 0U) { flags = 0UL; } else { flags = 128UL; } if ((bp->flags & 32U) != 0U) { irq = (bp->msix_table)->vector; } else { irq = (bp->pdev)->irq; } tmp = ldv_request_irq_89(irq, & bnx2x_interrupt, flags, (char const *)(& (bp->dev)->name), (void *)bp->dev); return (tmp); } } static int bnx2x_setup_irqs(struct bnx2x *bp ) { int rc ; { rc = 0; if ((bp->flags & 32U) != 0U && (bp->flags & 1048576U) == 0U) { rc = bnx2x_req_msix_irqs(bp); if (rc != 0) { return (rc); } else { } } else { rc = bnx2x_req_irq(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]IRQ request failed rc %d, aborting\n", "bnx2x_setup_irqs", 1847, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } if ((bp->flags & 64U) != 0U) { (bp->dev)->irq = (int )(bp->pdev)->irq; netdev_info((struct net_device const *)bp->dev, "using MSI IRQ %d\n", (bp->dev)->irq); } else { } if ((bp->flags & 32U) != 0U) { (bp->dev)->irq = (int )(bp->msix_table)->vector; netdev_info((struct net_device const *)bp->dev, "using MSIX IRQ %d\n", (bp->dev)->irq); } else { } } return (0); } } static void bnx2x_napi_enable_cnic(struct bnx2x *bp ) { int i ; { i = (int )bp->num_ethernet_queues; goto ldv_62502; ldv_62501: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_fp_busy_poll_init(bp->fp + (unsigned long )i); napi_enable(& (bp->fp + (unsigned long )i)->napi); } i = i + 1; ldv_62502: ; if (bp->num_queues > i) { goto ldv_62501; } else { } return; } } static void bnx2x_napi_enable(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_62509; ldv_62508: bnx2x_fp_busy_poll_init(bp->fp + (unsigned long )i); napi_enable(& (bp->fp + (unsigned long )i)->napi); i = i + 1; ldv_62509: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62508; } else { } return; } } static void bnx2x_napi_disable_cnic(struct bnx2x *bp ) { int i ; bool tmp ; int tmp___0 ; { i = (int )bp->num_ethernet_queues; goto ldv_62520; ldv_62519: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { napi_disable(& (bp->fp + (unsigned long )i)->napi); goto ldv_62517; ldv_62516: usleep_range(1000UL, 2000UL); ldv_62517: tmp = bnx2x_fp_ll_disable(bp->fp + (unsigned long )i); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto ldv_62516; } else { } } i = i + 1; ldv_62520: ; if (bp->num_queues > i) { goto ldv_62519; } else { } return; } } static void bnx2x_napi_disable(struct bnx2x *bp ) { int i ; bool tmp ; int tmp___0 ; { i = 0; goto ldv_62530; ldv_62529: napi_disable(& (bp->fp + (unsigned long )i)->napi); goto ldv_62527; ldv_62526: usleep_range(1000UL, 2000UL); ldv_62527: tmp = bnx2x_fp_ll_disable(bp->fp + (unsigned long )i); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto ldv_62526; } else { } i = i + 1; ldv_62530: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62529; } else { } return; } } void bnx2x_netif_start(struct bnx2x *bp ) { bool tmp ; { tmp = netif_running((struct net_device const *)bp->dev); if ((int )tmp) { bnx2x_napi_enable(bp); if ((int )bp->cnic_loaded) { bnx2x_napi_enable_cnic(bp); } else { } bnx2x_int_enable(bp); if ((unsigned int )bp->state == 12288U) { netif_tx_wake_all_queues___0(bp->dev); } else { } } else { } return; } } void bnx2x_netif_stop(struct bnx2x *bp , int disable_hw ) { { bnx2x_int_disable_sync(bp, disable_hw); bnx2x_napi_disable(bp); if ((int )bp->cnic_loaded) { bnx2x_napi_disable_cnic(bp); } else { } return; } } u16 bnx2x_select_queue(struct net_device *dev , struct sk_buff *skb , void *accel_priv , u16 (*fallback)(struct net_device * , struct sk_buff * ) ) { struct bnx2x *bp ; void *tmp ; struct ethhdr *hdr ; u16 ether_type ; __u16 tmp___0 ; struct vlan_ethhdr *vhdr ; __u16 tmp___1 ; u16 tmp___2 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((int )bp->cnic_loaded && (bp->flags & 32768U) == 0U) { hdr = (struct ethhdr *)skb->data; tmp___0 = __fswab16((int )hdr->h_proto); ether_type = tmp___0; if ((unsigned int )ether_type == 33024U) { vhdr = (struct vlan_ethhdr *)skb->data; tmp___1 = __fswab16((int )vhdr->h_vlan_encapsulated_proto); ether_type = tmp___1; } else { } if ((unsigned int )ether_type == 35078U || (unsigned int )ether_type == 35092U) { return ((u16 )((bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->txdata_ptr[0])->txq_index); } else { } } else { } tmp___2 = (*fallback)(dev, skb); return ((u16 )((uint )tmp___2 % bp->num_ethernet_queues)); } } void bnx2x_set_num_queues(struct bnx2x *bp ) { int tmp ; long tmp___0 ; { tmp = bnx2x_calc_num_queues(bp); bp->num_ethernet_queues = (uint )tmp; if ((((unsigned int )bp->mf_mode == 1U && ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U || (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U)) || ((unsigned int )bp->mf_mode == 2U && ((bp->mf_ext_config & 14U) == 4U || (bp->mf_ext_config & 14U) == 8U))) || ((unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U)) { bp->num_ethernet_queues = 1U; } else { } bp->num_cnic_queues = (uint )bp->cnic_support; bp->num_queues = (int )(bp->num_ethernet_queues + bp->num_cnic_queues); tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "set number of queues to %d\n", bp->num_queues); } else { } return; } } static int bnx2x_set_real_num_queues(struct bnx2x *bp , int include_cnic ) { int rc ; int tx ; int rx ; long tmp ; { tx = (int )(bp->num_ethernet_queues * (uint )bp->max_cos); rx = (int )bp->num_ethernet_queues; if (include_cnic != 0 && (bp->flags & 32768U) == 0U) { rx = rx + 1; tx = tx + 1; } else { } rc = netif_set_real_num_tx_queues(bp->dev, (unsigned int )tx); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to set real number of Tx queues: %d\n", "bnx2x_set_real_num_queues", 2006, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } rc = netif_set_real_num_rx_queues(bp->dev, (unsigned int )rx); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to set real number of Rx queues: %d\n", "bnx2x_set_real_num_queues", 2011, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting real num queues to (tx, rx) (%d, %d)\n", "bnx2x_set_real_num_queues", 2016, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tx, rx); } else { } return (rc); } } static void bnx2x_set_rx_buf_size(struct bnx2x *bp ) { int i ; struct bnx2x_fastpath *fp ; u32 mtu ; int _max1 ; int _max2 ; int _min1 ; int _min2 ; u64 __max1 ; int _max1___0 ; int _max2___0 ; int _min1___0 ; int _min2___0 ; u64 __max2 ; int _max1___1 ; int _max2___1 ; int _max1___2 ; int _max2___2 ; { i = 0; goto ldv_62595; ldv_62594: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { fp = bp->fp + (unsigned long )i; if ((uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { mtu = 2500U; } else { mtu = (bp->dev)->mtu; } _max1 = 6; _min1 = 8; _min2 = 6; _max2 = _min1 < _min2 ? _min1 : _min2; _max1___0 = 6; _min1___0 = 8; _min2___0 = 6; _max2___0 = _min1___0 < _min2___0 ? _min1___0 : _min2___0; __max1 = (u64 )(1UL << (_max1___0 > _max2___0 ? _max1___0 : _max2___0)); __max2 = 320ULL; fp->rx_buf_size = (((u32 )(1UL << (_max1 > _max2 ? _max1 : _max2)) + mtu) + (u32 )(__max1 > __max2 ? __max1 : __max2)) + 32U; _max1___2 = 32; _max2___2 = 64; if (fp->rx_buf_size + (u32 )(_max1___2 > _max2___2 ? _max1___2 : _max2___2) <= 4096U) { _max1___1 = 32; _max2___1 = 64; fp->rx_frag_size = fp->rx_buf_size + (u32 )(_max1___1 > _max2___1 ? _max1___1 : _max2___1); } else { fp->rx_frag_size = 0U; } } i = i + 1; ldv_62595: ; if (bp->num_queues > i) { goto ldv_62594; } else { } return; } } static int bnx2x_init_rss(struct bnx2x *bp ) { int i ; u8 num_eth_queues ; u32 tmp ; int tmp___0 ; { num_eth_queues = (u8 )bp->num_ethernet_queues; i = 0; goto ldv_62603; ldv_62602: tmp = ethtool_rxfh_indir_default((u32 )i, (u32 )num_eth_queues); bp->rss_conf_obj.ind_table[i] = (int )(bp->fp)->cl_id + (int )((u8 )tmp); i = i + 1; ldv_62603: ; if ((unsigned int )i <= 127U) { goto ldv_62602; } else { } tmp___0 = bnx2x_config_rss_eth(bp, (int )((bool )(bp->port.pmf != 0U || (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U))))); return (tmp___0); } } int bnx2x_rss(struct bnx2x *bp , struct bnx2x_rss_config_obj *rss_obj , bool config_hash , bool enable ) { struct bnx2x_config_rss_params params ; int tmp ; int tmp___0 ; { params.rss_obj = (struct bnx2x_rss_config_obj *)0; params.ramrod_flags = 0UL; params.rss_flags = 0UL; params.rss_result_mask = (unsigned char)0; params.ind_table[0] = (unsigned char)0; params.ind_table[1] = (unsigned char)0; params.ind_table[2] = (unsigned char)0; params.ind_table[3] = (unsigned char)0; params.ind_table[4] = (unsigned char)0; params.ind_table[5] = (unsigned char)0; params.ind_table[6] = (unsigned char)0; params.ind_table[7] = (unsigned char)0; params.ind_table[8] = (unsigned char)0; params.ind_table[9] = (unsigned char)0; params.ind_table[10] = (unsigned char)0; params.ind_table[11] = (unsigned char)0; params.ind_table[12] = (unsigned char)0; params.ind_table[13] = (unsigned char)0; params.ind_table[14] = (unsigned char)0; params.ind_table[15] = (unsigned char)0; params.ind_table[16] = (unsigned char)0; params.ind_table[17] = (unsigned char)0; params.ind_table[18] = (unsigned char)0; params.ind_table[19] = (unsigned char)0; params.ind_table[20] = (unsigned char)0; params.ind_table[21] = (unsigned char)0; params.ind_table[22] = (unsigned char)0; params.ind_table[23] = (unsigned char)0; params.ind_table[24] = (unsigned char)0; params.ind_table[25] = (unsigned char)0; params.ind_table[26] = (unsigned char)0; params.ind_table[27] = (unsigned char)0; params.ind_table[28] = (unsigned char)0; params.ind_table[29] = (unsigned char)0; params.ind_table[30] = (unsigned char)0; params.ind_table[31] = (unsigned char)0; params.ind_table[32] = (unsigned char)0; params.ind_table[33] = (unsigned char)0; params.ind_table[34] = (unsigned char)0; params.ind_table[35] = (unsigned char)0; params.ind_table[36] = (unsigned char)0; params.ind_table[37] = (unsigned char)0; params.ind_table[38] = (unsigned char)0; params.ind_table[39] = (unsigned char)0; params.ind_table[40] = (unsigned char)0; params.ind_table[41] = (unsigned char)0; params.ind_table[42] = (unsigned char)0; params.ind_table[43] = (unsigned char)0; params.ind_table[44] = (unsigned char)0; params.ind_table[45] = (unsigned char)0; params.ind_table[46] = (unsigned char)0; params.ind_table[47] = (unsigned char)0; params.ind_table[48] = (unsigned char)0; params.ind_table[49] = (unsigned char)0; params.ind_table[50] = (unsigned char)0; params.ind_table[51] = (unsigned char)0; params.ind_table[52] = (unsigned char)0; params.ind_table[53] = (unsigned char)0; params.ind_table[54] = (unsigned char)0; params.ind_table[55] = (unsigned char)0; params.ind_table[56] = (unsigned char)0; params.ind_table[57] = (unsigned char)0; params.ind_table[58] = (unsigned char)0; params.ind_table[59] = (unsigned char)0; params.ind_table[60] = (unsigned char)0; params.ind_table[61] = (unsigned char)0; params.ind_table[62] = (unsigned char)0; params.ind_table[63] = (unsigned char)0; params.ind_table[64] = (unsigned char)0; params.ind_table[65] = (unsigned char)0; params.ind_table[66] = (unsigned char)0; params.ind_table[67] = (unsigned char)0; params.ind_table[68] = (unsigned char)0; params.ind_table[69] = (unsigned char)0; params.ind_table[70] = (unsigned char)0; params.ind_table[71] = (unsigned char)0; params.ind_table[72] = (unsigned char)0; params.ind_table[73] = (unsigned char)0; params.ind_table[74] = (unsigned char)0; params.ind_table[75] = (unsigned char)0; params.ind_table[76] = (unsigned char)0; params.ind_table[77] = (unsigned char)0; params.ind_table[78] = (unsigned char)0; params.ind_table[79] = (unsigned char)0; params.ind_table[80] = (unsigned char)0; params.ind_table[81] = (unsigned char)0; params.ind_table[82] = (unsigned char)0; params.ind_table[83] = (unsigned char)0; params.ind_table[84] = (unsigned char)0; params.ind_table[85] = (unsigned char)0; params.ind_table[86] = (unsigned char)0; params.ind_table[87] = (unsigned char)0; params.ind_table[88] = (unsigned char)0; params.ind_table[89] = (unsigned char)0; params.ind_table[90] = (unsigned char)0; params.ind_table[91] = (unsigned char)0; params.ind_table[92] = (unsigned char)0; params.ind_table[93] = (unsigned char)0; params.ind_table[94] = (unsigned char)0; params.ind_table[95] = (unsigned char)0; params.ind_table[96] = (unsigned char)0; params.ind_table[97] = (unsigned char)0; params.ind_table[98] = (unsigned char)0; params.ind_table[99] = (unsigned char)0; params.ind_table[100] = (unsigned char)0; params.ind_table[101] = (unsigned char)0; params.ind_table[102] = (unsigned char)0; params.ind_table[103] = (unsigned char)0; params.ind_table[104] = (unsigned char)0; params.ind_table[105] = (unsigned char)0; params.ind_table[106] = (unsigned char)0; params.ind_table[107] = (unsigned char)0; params.ind_table[108] = (unsigned char)0; params.ind_table[109] = (unsigned char)0; params.ind_table[110] = (unsigned char)0; params.ind_table[111] = (unsigned char)0; params.ind_table[112] = (unsigned char)0; params.ind_table[113] = (unsigned char)0; params.ind_table[114] = (unsigned char)0; params.ind_table[115] = (unsigned char)0; params.ind_table[116] = (unsigned char)0; params.ind_table[117] = (unsigned char)0; params.ind_table[118] = (unsigned char)0; params.ind_table[119] = (unsigned char)0; params.ind_table[120] = (unsigned char)0; params.ind_table[121] = (unsigned char)0; params.ind_table[122] = (unsigned char)0; params.ind_table[123] = (unsigned char)0; params.ind_table[124] = (unsigned char)0; params.ind_table[125] = (unsigned char)0; params.ind_table[126] = (unsigned char)0; params.ind_table[127] = (unsigned char)0; params.rss_key[0] = 0U; params.rss_key[1] = 0U; params.rss_key[2] = 0U; params.rss_key[3] = 0U; params.rss_key[4] = 0U; params.rss_key[5] = 0U; params.rss_key[6] = 0U; params.rss_key[7] = 0U; params.rss_key[8] = 0U; params.rss_key[9] = 0U; params.toe_rss_bitmap = (unsigned short)0; params.rss_obj = rss_obj; __set_bit(2L, (unsigned long volatile *)(& params.ramrod_flags)); if ((int )enable) { __set_bit(1L, (unsigned long volatile *)(& params.rss_flags)); __set_bit(3L, (unsigned long volatile *)(& params.rss_flags)); __set_bit(4L, (unsigned long volatile *)(& params.rss_flags)); __set_bit(6L, (unsigned long volatile *)(& params.rss_flags)); __set_bit(7L, (unsigned long volatile *)(& params.rss_flags)); if ((unsigned int )rss_obj->udp_rss_v4 != 0U) { __set_bit(5L, (unsigned long volatile *)(& params.rss_flags)); } else { } if ((unsigned int )rss_obj->udp_rss_v6 != 0U) { __set_bit(8L, (unsigned long volatile *)(& params.rss_flags)); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { __set_bit(9L, (unsigned long volatile *)(& params.rss_flags)); } else { } } else { __set_bit(0L, (unsigned long volatile *)(& params.rss_flags)); } params.rss_result_mask = 127U; memcpy((void *)(& params.ind_table), (void const *)(& rss_obj->ind_table), 128UL); if ((int )config_hash) { netdev_rss_key_fill((void *)(& params.rss_key), 40UL); __set_bit(2L, (unsigned long volatile *)(& params.rss_flags)); } else { } if ((bp->flags & 4194304U) == 0U) { tmp = bnx2x_config_rss(bp, & params); return (tmp); } else { tmp___0 = bnx2x_vfpf_config_rss(bp, & params); return (tmp___0); } } } static int bnx2x_init_hw(struct bnx2x *bp , u32 load_code ) { struct bnx2x_func_state_params func_params ; int tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); func_params.f_obj = & bp->func_obj; func_params.cmd = 0; func_params.params.hw_init.load_phase = load_code; tmp = bnx2x_func_state_change(bp, & func_params); return (tmp); } } void bnx2x_squeeze_objects(struct bnx2x *bp ) { int rc ; unsigned long ramrod_flags ; unsigned long vlan_mac_flags ; struct bnx2x_mcast_ramrod_params rparam ; struct bnx2x_vlan_mac_obj *mac_obj ; { ramrod_flags = 0UL; vlan_mac_flags = 0UL; rparam.mcast_obj = (struct bnx2x_mcast_obj *)0; rparam.ramrod_flags = 0UL; rparam.mcast_list.next = 0; rparam.mcast_list.prev = 0; rparam.mcast_list_len = 0; mac_obj = & (bp->sp_objs)->mac_obj; __set_bit(2L, (unsigned long volatile *)(& ramrod_flags)); __set_bit(3L, (unsigned long volatile *)(& ramrod_flags)); __set_bit(1L, (unsigned long volatile *)(& vlan_mac_flags)); rc = (*(mac_obj->delete_all))(bp, & (bp->sp_objs)->mac_obj, & vlan_mac_flags, & ramrod_flags); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to clean ETH MACs: %d\n", "bnx2x_squeeze_objects", 2168, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } vlan_mac_flags = 0UL; __set_bit(0L, (unsigned long volatile *)(& vlan_mac_flags)); rc = (*(mac_obj->delete_all))(bp, mac_obj, & vlan_mac_flags, & ramrod_flags); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to clean UC list MACs: %d\n", "bnx2x_squeeze_objects", 2176, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } rparam.mcast_obj = & bp->mcast_obj; __set_bit(3L, (unsigned long volatile *)(& rparam.ramrod_flags)); netif_addr_lock_bh(bp->dev); rc = bnx2x_config_mcast(bp, & rparam, 2); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to add a new DEL command to a multi-cast object: %d\n", "bnx2x_squeeze_objects", 2190, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } rc = bnx2x_config_mcast(bp, & rparam, 1); goto ldv_62627; ldv_62626: ; if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to clean multi-cast object: %d\n", "bnx2x_squeeze_objects", 2197, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); netif_addr_unlock_bh(bp->dev); return; } else { } rc = bnx2x_config_mcast(bp, & rparam, 1); ldv_62627: ; if (rc != 0) { goto ldv_62626; } else { } netif_addr_unlock_bh(bp->dev); return; } } static void bnx2x_free_fw_stats_mem(struct bnx2x *bp ) { { if ((unsigned long )bp->fw_stats != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, (size_t )(bp->fw_stats_data_sz + bp->fw_stats_req_sz), bp->fw_stats, bp->fw_stats_mapping, (struct dma_attrs *)0); bp->fw_stats = (void *)0; bp->fw_stats_mapping = 0ULL; } else { } return; } } static int bnx2x_alloc_fw_stats_mem(struct bnx2x *bp ) { int num_groups ; int vf_headroom ; int is_fcoe_stats ; u8 num_queue_stats ; long tmp ; void *x ; void *tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { vf_headroom = 0; is_fcoe_stats = (bp->flags & 32768U) == 0U; num_queue_stats = (int )((u8 )bp->num_ethernet_queues) + (int )((u8 )is_fcoe_stats); bp->fw_stats_num = (unsigned int )((int )((u8 )is_fcoe_stats) + (int )num_queue_stats) + 2U; if ((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0)) { vf_headroom = bnx2x_vf_headroom(bp); } else { } num_groups = ((int )bp->fw_stats_num + vf_headroom) / 16 + (((unsigned int )((int )bp->fw_stats_num + vf_headroom) & 15U) != 0U); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]stats fw_stats_num %d, vf headroom %d, num_groups %d\n", "bnx2x_alloc_fw_stats_mem", 2275, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->fw_stats_num, vf_headroom, num_groups); } else { } bp->fw_stats_req_sz = (int )((unsigned int )((unsigned long )num_groups) * 256U + 16U); bp->fw_stats_data_sz = (int )((unsigned int )num_queue_stats * 152U + 128U); tmp___0 = dma_zalloc_coherent(& (bp->pdev)->dev, (size_t )(bp->fw_stats_data_sz + bp->fw_stats_req_sz), & bp->fw_stats_mapping, 208U); x = tmp___0; if ((unsigned long )x != (unsigned long )((void *)0)) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_fw_stats_mem", 2294, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->fw_stats_mapping, x); } else { } } else { } bp->fw_stats = x; if ((unsigned long )bp->fw_stats == (unsigned long )((void *)0)) { goto alloc_mem_err; } else { } bp->fw_stats_req = (struct bnx2x_fw_stats_req *)bp->fw_stats; bp->fw_stats_req_mapping = bp->fw_stats_mapping; bp->fw_stats_data = (struct bnx2x_fw_stats_data *)bp->fw_stats + (unsigned long )bp->fw_stats_req_sz; bp->fw_stats_data_mapping = bp->fw_stats_mapping + (dma_addr_t )bp->fw_stats_req_sz; tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]statistics request base address set to %x %x\n", "bnx2x_alloc_fw_stats_mem", 2308, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )(bp->fw_stats_req_mapping >> 32), (unsigned int )bp->fw_stats_req_mapping); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]statistics data base address set to %x %x\n", "bnx2x_alloc_fw_stats_mem", 2311, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )(bp->fw_stats_data_mapping >> 32), (unsigned int )bp->fw_stats_data_mapping); } else { } return (0); alloc_mem_err: bnx2x_free_fw_stats_mem(bp); printk("\vbnx2x: [%s:%d(%s)]Can\'t allocate FW stats memory\n", "bnx2x_alloc_fw_stats_mem", 2316, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } } static int bnx2x_nic_load_request(struct bnx2x *bp , u32 *load_code ) { u32 param ; unsigned int tmp ; long tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; bool tmp___3 ; { tmp = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) * 44UL) + 1668UL))); bp->fw_seq = (u16 )tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "fw_seq 0x%08x\n", (int )bp->fw_seq); } else { } tmp___1 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) * 44UL) + 1684UL))); bp->fw_drv_pulse_wr_seq = (unsigned int )((u16 )tmp___1) & 32767U; tmp___2 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___2 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "drv_pulse 0x%x\n", (int )bp->fw_drv_pulse_wr_seq); } else { } param = 4106U; if ((unsigned int )bp->mf_mode == 1U) { tmp___3 = bnx2x_port_after_undi(bp); if ((int )tmp___3) { param = param | 8192U; } else { } } else { } *load_code = bnx2x_fw_command(bp, 268435456U, param); if (*load_code == 0U) { printk("\vbnx2x: [%s:%d(%s)]MCP response failure, aborting\n", "bnx2x_nic_load_request", 2347, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } if (*load_code == 270532608U) { printk("\vbnx2x: [%s:%d(%s)]MCP refused load request, aborting\n", "bnx2x_nic_load_request", 2355, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } else { } return (0); } } int bnx2x_compare_fw_ver(struct bnx2x *bp , u32 load_code , bool print_err ) { u32 my_fw ; u32 loaded_fw ; unsigned int tmp ; long tmp___0 ; long tmp___1 ; { if (load_code != 269680640U && load_code != 269484032U) { my_fw = 3344903U; tmp = readl((void const volatile *)bp->regview + 2883584U); loaded_fw = tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]loaded fw %x, my fw %x\n", "bnx2x_compare_fw_ver", 2380, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", loaded_fw, my_fw); } else { } if (my_fw != loaded_fw) { if ((int )print_err) { printk("\vbnx2x: [%s:%d(%s)]bnx2x with FW %x was already loaded which mismatches my %x FW. Aborting\n", "bnx2x_compare_fw_ver", 2386, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", loaded_fw, my_fw); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___1 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "bnx2x with FW %x was already loaded which mismatches my %x FW, possibly due to MF UNDI\n", loaded_fw, my_fw); } else { } } return (-16); } else { } } else { } return (0); } } static int bnx2x_nic_load_no_mcp(struct bnx2x *bp , int port ) { int path ; long tmp ; long tmp___0 ; { path = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]NO MCP - load counts[%d] %d, %d, %d\n", "bnx2x_nic_load_no_mcp", 2403, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", path, bnx2x_load_count[path][0], bnx2x_load_count[path][1], bnx2x_load_count[path][2]); } else { } bnx2x_load_count[path][0] = bnx2x_load_count[path][0] + 1; bnx2x_load_count[path][port + 1] = bnx2x_load_count[path][port + 1] + 1; tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]NO MCP - new load counts[%d] %d, %d, %d\n", "bnx2x_nic_load_no_mcp", 2408, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", path, bnx2x_load_count[path][0], bnx2x_load_count[path][1], bnx2x_load_count[path][2]); } else { } if (bnx2x_load_count[path][0] == 1) { return (269484032); } else if (bnx2x_load_count[path][port + 1] == 1) { return (269549568); } else { return (269615104); } } } static void bnx2x_nic_load_pmf(struct bnx2x *bp , u32 load_code ) { long tmp ; { if ((load_code == 269484032U || load_code == 269680640U) || load_code == 269549568U) { bp->port.pmf = 1U; __asm__ volatile ("mfence": : : "memory"); } else { bp->port.pmf = 0U; } tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]pmf %d\n", "bnx2x_nic_load_pmf", 2433, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->port.pmf); } else { } return; } } static void bnx2x_nic_load_afex_dcc(struct bnx2x *bp , int load_code ) { unsigned int tmp ; unsigned int tmp___0 ; { if ((load_code == 269484032 || load_code == 269680640) && bp->common.shmem2_base != 0U) { if (bp->common.shmem2_base != 0U) { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp > 4U) { writel(5U, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 4UL))); } else { } } else { } if (bp->common.shmem2_base != 0U) { tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___0 > 116U) { writel(4097U, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 116UL))); } else { } } else { } } else { } bp->afex_def_vlan_tag = -1; return; } } static void bnx2x_bz_fp(struct bnx2x *bp , int index ) { struct bnx2x_fastpath *fp ; int cos ; struct napi_struct orig_napi ; struct bnx2x_agg_info *orig_tpa_info ; bool tmp ; { fp = bp->fp + (unsigned long )index; orig_napi = fp->napi; orig_tpa_info = fp->tpa_info; if ((unsigned long )fp->tpa_info != (unsigned long )((struct bnx2x_agg_info *)0)) { memset((void *)fp->tpa_info, 0, 2560UL); } else { } memset((void *)fp, 0, 664UL); fp->napi = orig_napi; fp->tpa_info = orig_tpa_info; fp->bp = bp; fp->index = (u8 )index; if ((uint )fp->index < (fp->bp)->num_ethernet_queues) { fp->max_cos = bp->max_cos; } else { fp->max_cos = 1U; } if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { fp->txdata_ptr[0] = bp->bnx2x_txq + (unsigned long )(((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos); } else { } if ((uint )fp->index < (fp->bp)->num_ethernet_queues) { cos = 0; goto ldv_62681; ldv_62680: fp->txdata_ptr[cos] = bp->bnx2x_txq + (unsigned long )(bp->num_ethernet_queues * (uint )cos + (uint )index); cos = cos + 1; ldv_62681: ; if ((int )fp->max_cos > cos) { goto ldv_62680; } else { } } else { } if (((bp->dev)->features & 32768ULL) != 0ULL) { fp->mode = 1; } else if (((bp->dev)->features & 16384ULL) != 0ULL) { tmp = bnx2x_mtu_allows_gro((int )(bp->dev)->mtu); if ((int )tmp) { fp->mode = 2; } else { fp->mode = 0; } } else { fp->mode = 0; } if (bp->disable_tpa != 0 || (uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { fp->mode = 0; } else { } return; } } int bnx2x_load_cnic(struct bnx2x *bp ) { int i ; int rc ; int port ; long tmp ; struct lock_class_key __key ; long tmp___0 ; long tmp___1 ; int tmp___2 ; { port = (int )bp->pfid & 1; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Starting CNIC-related load\n", "bnx2x_load_cnic", 2517, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } __mutex_init(& bp->cnic_mutex, "&bp->cnic_mutex", & __key); if ((bp->flags & 4194304U) == 0U) { rc = bnx2x_alloc_mem_cnic(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to allocate bp memory for cnic\n", "bnx2x_load_cnic", 2524, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->cnic_loaded = 0; goto load_error_cnic0; } else { } } else { } rc = bnx2x_alloc_fp_mem_cnic(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to allocate memory for cnic fps\n", "bnx2x_load_cnic", 2531, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->cnic_loaded = 0; goto load_error_cnic0; } else { } rc = bnx2x_set_real_num_queues(bp, 1); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to set real_num_queues including cnic\n", "bnx2x_load_cnic", 2538, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->cnic_loaded = 0; goto load_error_cnic0; } else { } bnx2x_add_all_napi_cnic(bp); tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]cnic napi added\n", "bnx2x_load_cnic", 2544, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_napi_enable_cnic(bp); rc = bnx2x_init_hw_func_cnic(bp); if (rc != 0) { bp->cnic_loaded = 0; goto load_error_cnic1; } else { } bnx2x_nic_init_cnic(bp); if ((bp->flags & 4194304U) == 0U) { writel(1U, (void volatile *)bp->regview + (unsigned long )((port + 364549) * 4)); i = (int )bp->num_ethernet_queues; goto ldv_62696; ldv_62695: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { rc = bnx2x_setup_queue(bp, bp->fp + (unsigned long )i, 0); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Queue setup failed\n", "bnx2x_load_cnic", 2561, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->state = 61440U; goto load_error_cnic2; } else { } } i = i + 1; ldv_62696: ; if (bp->num_queues > i) { goto ldv_62695; } else { } } else { } bnx2x_set_rx_mode_inner(bp); bnx2x_get_iscsi_info(bp); bnx2x_setup_cnic_irq_info(bp); bnx2x_setup_cnic_info(bp); bp->cnic_loaded = 1; if ((unsigned int )bp->state == 12288U) { bnx2x_cnic_notify(bp, 2); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Ending successfully CNIC-related load\n", "bnx2x_load_cnic", 2578, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); load_error_cnic2: writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 364549) * 4)); load_error_cnic1: bnx2x_napi_disable_cnic(bp); tmp___2 = bnx2x_set_real_num_queues(bp, 0); if (tmp___2 != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to set real_num_queues not including cnic\n", "bnx2x_load_cnic", 2591, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } load_error_cnic0: printk("\vbnx2x: [%s:%d(%s)]CNIC-related load failed\n", "bnx2x_load_cnic", 2593, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_free_fp_mem_cnic(bp); bnx2x_free_mem_cnic(bp); return (rc); } } int bnx2x_nic_load(struct bnx2x *bp , int load_mode ) { int port ; int i ; int rc ; int load_code ; long tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; u32 tmp___4 ; u32 val ; unsigned int tmp___5 ; bool tmp___6 ; int tmp___7 ; long tmp___8 ; { port = (int )bp->pfid & 1; rc = 0; load_code = 0; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Starting NIC load\n", "bnx2x_nic_load", 2606, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]CNIC is %s\n", "bnx2x_nic_load", 2608, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->cnic_enabled ? (char *)"enabled" : (char *)"disabled"); } else { } bp->state = 4096U; memset((void *)(& bp->last_reported_link), 0, 16UL); __set_bit(1L, (unsigned long volatile *)(& bp->last_reported_link.link_report_flags)); if ((bp->flags & 4194304U) == 0U) { bnx2x_ilt_set_info(bp); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]num queues: %d", "bnx2x_nic_load", 2633, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->num_queues); } else { } i = 0; goto ldv_62709; ldv_62708: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_bz_fp(bp, i); } i = i + 1; ldv_62709: ; if (bp->num_queues > i) { goto ldv_62708; } else { } memset((void *)bp->bnx2x_txq, 0, (unsigned long )((uint )(((int )bp->igu_sb_cnt - (int )bp->cnic_support) * 3) + bp->num_cnic_queues) * 80UL); bp->fcoe_init = 0; bnx2x_set_rx_buf_size(bp); if ((bp->flags & 4194304U) == 0U) { rc = bnx2x_alloc_mem(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to allocate bp memory\n", "bnx2x_nic_load", 2648, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } } else { } rc = bnx2x_alloc_fp_mem(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to allocate memory for fps\n", "bnx2x_nic_load", 2658, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->state = 61440U; goto load_error0; } else { } tmp___2 = bnx2x_alloc_fw_stats_mem(bp); if (tmp___2 != 0) { bp->state = 61440U; goto load_error0; } else { } if ((bp->flags & 4194304U) != 0U) { rc = bnx2x_vfpf_init(bp); if (rc != 0) { bp->state = 61440U; goto load_error0; } else { } } else { } rc = bnx2x_set_real_num_queues(bp, 0); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to set real_num_queues\n", "bnx2x_nic_load", 2679, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->state = 61440U; goto load_error0; } else { } bnx2x_setup_tc(bp->dev, (int )bp->max_cos); bnx2x_add_all_napi(bp); tmp___3 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]napi added\n", "bnx2x_nic_load", 2691, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_napi_enable(bp); if ((bp->flags & 4194304U) == 0U) { bnx2x_set_pf_load(bp); if ((bp->flags & 512U) == 0U) { rc = bnx2x_nic_load_request(bp, (u32 *)(& load_code)); if (rc != 0) { bp->state = 61440U; goto load_error1; } else { } rc = bnx2x_compare_fw_ver(bp, (u32 )load_code, 1); if (rc != 0) { bnx2x_fw_command(bp, 285212672U, 0U); bp->state = 61440U; goto load_error2; } else { } } else { load_code = bnx2x_nic_load_no_mcp(bp, port); } bnx2x_nic_load_pmf(bp, (u32 )load_code); bnx2x__init_func_obj(bp); rc = bnx2x_init_hw(bp, (u32 )load_code); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]HW init failed, aborting\n", "bnx2x_nic_load", 2724, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_fw_command(bp, 285212672U, 0U); bp->state = 61440U; goto load_error2; } else { } } else { } bnx2x_pre_irq_nic_init(bp); rc = bnx2x_setup_irqs(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]setup irqs failed\n", "bnx2x_nic_load", 2735, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); if ((bp->flags & 4194304U) == 0U) { bnx2x_fw_command(bp, 285212672U, 0U); } else { } bp->state = 61440U; goto load_error2; } else { } if ((bp->flags & 4194304U) == 0U) { bnx2x_post_irq_nic_init(bp, (u32 )load_code); bnx2x_init_bp_objs(bp); bnx2x_iov_nic_init(bp); bp->afex_def_vlan_tag = -1; bnx2x_nic_load_afex_dcc(bp, load_code); bp->state = 8192U; rc = bnx2x_func_start(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Function start failed!\n", "bnx2x_nic_load", 2755, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_fw_command(bp, 285212672U, 0U); bp->state = 61440U; goto load_error3; } else { } if ((bp->flags & 512U) == 0U) { tmp___4 = bnx2x_fw_command(bp, 285212672U, 0U); load_code = (int )tmp___4; if (load_code == 0) { printk("\vbnx2x: [%s:%d(%s)]MCP response failure, aborting\n", "bnx2x_nic_load", 2766, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -16; bp->state = 61440U; goto load_error3; } else { } } else { } bnx2x_update_coalesce(bp); } else { } rc = bnx2x_setup_leading(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Setup leading failed!\n", "bnx2x_nic_load", 2779, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->state = 61440U; goto load_error3; } else { } i = 1; goto ldv_62716; ldv_62715: ; if ((bp->flags & 4194304U) == 0U) { rc = bnx2x_setup_queue(bp, bp->fp + (unsigned long )i, 0); } else { rc = bnx2x_vfpf_setup_q(bp, bp->fp + (unsigned long )i, 0); } if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Queue %d setup failed\n", "bnx2x_nic_load", 2790, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i); bp->state = 61440U; goto load_error3; } else { } i = i + 1; ldv_62716: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62715; } else { } rc = bnx2x_init_rss(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]PF RSS init failed\n", "bnx2x_nic_load", 2798, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->state = 61440U; goto load_error3; } else { } bp->state = 12288U; if ((bp->flags & 4194304U) == 0U) { rc = bnx2x_set_eth_mac(bp, 1); } else { rc = bnx2x_vfpf_config_mac(bp, (bp->dev)->dev_addr, (int )(bp->fp)->index, 1); } if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Setting Ethernet MAC failed\n", "bnx2x_nic_load", 2812, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->state = 61440U; goto load_error3; } else { } if ((bp->flags & 4194304U) == 0U && bp->pending_max != 0U) { bnx2x_update_max_mf_config(bp, bp->pending_max); bp->pending_max = 0U; } else { } if (bp->port.pmf != 0U) { rc = bnx2x_initial_phy_init(bp, load_mode); if (rc != 0) { bp->state = 61440U; goto load_error3; } else { } } else { } bp->link_params.feature_config_flags = bp->link_params.feature_config_flags & 4294950911U; bnx2x_set_rx_mode_inner(bp); if ((bp->flags & 67108864U) != 0U) { bnx2x_init_ptp(bp); bnx2x_configure_ptp_filters(bp); } else { } switch (load_mode) { case 0: netif_tx_wake_all_queues___0(bp->dev); goto ldv_62719; case 1: netif_tx_start_all_queues(bp->dev); __asm__ volatile ("": : : "memory"); goto ldv_62719; case 2: ; case 3: bp->state = 57344U; goto ldv_62719; default: ; goto ldv_62719; } ldv_62719: ; if (bp->port.pmf != 0U) { bnx2x_update_drv_flags(bp, 128U, 0U); } else { bnx2x__link_status_update(bp); } ldv_mod_timer_90(& bp->timer, (unsigned long )bp->current_interval + (unsigned long )jiffies); if ((int )bp->cnic_enabled) { bnx2x_load_cnic(bp); } else { } if ((bp->flags & 4194304U) == 0U) { bnx2x_schedule_sp_rtnl(bp, 10, 0U); } else { } if ((bp->flags & 4194304U) == 0U) { if (bp->common.shmem2_base != 0U) { tmp___5 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___5 > 224U) { val = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 56UL) * 4UL))); writel(val | 3U, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 56UL) * 4UL))); } else { } } else { } } else { } if ((bp->flags & 4194304U) == 0U) { tmp___6 = bnx2x_wait_sp_comp___0(bp, 0xffffffffffffffffUL); if (tmp___6) { tmp___7 = 0; } else { tmp___7 = 1; } if (tmp___7) { printk("\vbnx2x: [%s:%d(%s)]Timeout waiting for SP elements to complete\n", "bnx2x_nic_load", 2883, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_nic_unload(bp, 1, 0); return (-16); } else { } } else { } if (bp->port.pmf != 0U && (unsigned int )bp->state != 57344U) { bnx2x_dcbx_init(bp, 0); } else { } tmp___8 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Ending successfully NIC load\n", "bnx2x_nic_load", 2892, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); load_error3: ; if ((bp->flags & 4194304U) == 0U) { bnx2x_int_disable_sync(bp, 1); bnx2x_squeeze_objects(bp); } else { } bnx2x_free_skbs(bp); i = 0; goto ldv_62727; ldv_62726: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_free_rx_sge_range___0(bp, bp->fp + (unsigned long )i, 1024); } i = i + 1; ldv_62727: ; if (bp->num_queues > i) { goto ldv_62726; } else { } bnx2x_free_irq(bp); load_error2: ; if ((bp->flags & 4194304U) == 0U && (bp->flags & 512U) == 0U) { bnx2x_fw_command(bp, 537001984U, 0U); bnx2x_fw_command(bp, 553648128U, 0U); } else { } bp->port.pmf = 0U; load_error1: bnx2x_napi_disable(bp); bnx2x_del_all_napi___0(bp); if ((bp->flags & 4194304U) == 0U) { bnx2x_clear_pf_load(bp); } else { } load_error0: bnx2x_free_fw_stats_mem(bp); bnx2x_free_fp_mem(bp); bnx2x_free_mem(bp); return (rc); } } int bnx2x_drain_tx_queues(struct bnx2x *bp ) { u8 rc ; u8 cos ; u8 i ; struct bnx2x_fastpath *fp ; int tmp ; { rc = 0U; i = 0U; goto ldv_62741; ldv_62740: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { fp = bp->fp + (unsigned long )i; cos = 0U; goto ldv_62738; ldv_62737: tmp = bnx2x_clean_tx_queue___0(bp, fp->txdata_ptr[(int )cos]); rc = (u8 )tmp; cos = (u8 )((int )cos + 1); ldv_62738: ; if ((int )fp->max_cos > (int )cos) { goto ldv_62737; } else { } if ((unsigned int )rc != 0U) { return ((int )rc); } else { } } i = (u8 )((int )i + 1); ldv_62741: ; if ((int )i < bp->num_queues) { goto ldv_62740; } else { } return (0); } } int bnx2x_nic_unload(struct bnx2x *bp , int unload_mode , bool keep_link ) { int i ; bool global ; long tmp ; u32 val ; unsigned int tmp___0 ; long tmp___1 ; bool tmp___2 ; bool tmp___3 ; int tmp___4 ; bool tmp___5 ; long tmp___6 ; { global = 0; tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Starting NIC unload\n", "bnx2x_nic_unload", 2957, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } if ((bp->flags & 4194304U) == 0U) { if (bp->common.shmem2_base != 0U) { tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___0 > 224U) { val = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 56UL) * 4UL))); writel(val & 4294967293U, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) + 56UL) * 4UL))); } else { } } else { } } else { } if (((bp->flags & 4194304U) == 0U && (unsigned int )bp->recovery_state != 0U) && ((unsigned int )bp->state == 0U || (unsigned int )bp->state == 61440U)) { bp->recovery_state = 0; bp->is_leader = 0; bnx2x_release_leader_lock(bp); __asm__ volatile ("mfence": : : "memory"); tmp___1 = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Releasing a leadership...\n", "bnx2x_nic_unload", 2982, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } printk("\vbnx2x: [%s:%d(%s)]Can\'t unload in closed or error state\n", "bnx2x_nic_unload", 2983, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } if ((unsigned int )bp->state == 0U || (unsigned int )bp->state == 61440U) { return (0); } else { } bp->state = 16384U; __asm__ volatile ("mfence": : : "memory"); bnx2x_iov_channel_down(bp); if ((int )bp->cnic_loaded) { bnx2x_cnic_notify(bp, 1); } else { } bnx2x_tx_disable___0(bp); netdev_reset_tc(bp->dev); bp->rx_mode = 0U; ldv_del_timer_sync_91(& bp->timer); if ((bp->flags & 4194304U) == 0U) { bp->fw_drv_pulse_wr_seq = (u16 )((unsigned int )bp->fw_drv_pulse_wr_seq | 32768U); bnx2x_drv_pulse(bp); bnx2x_stats_handle(bp, 3); bnx2x_save_statistics(bp); } else { } bnx2x_drain_tx_queues(bp); if ((bp->flags & 4194304U) != 0U) { bnx2x_vfpf_close_vf(bp); } else if (unload_mode != 2) { bnx2x_chip_cleanup(bp, unload_mode, (int )keep_link); } else { bnx2x_send_unload_req(bp, unload_mode); if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { bnx2x_pf_disable(bp); } else { } bnx2x_netif_stop(bp, 1); bnx2x_del_all_napi___0(bp); if ((int )bp->cnic_loaded) { bnx2x_del_all_napi_cnic___0(bp); } else { } bnx2x_free_irq(bp); bnx2x_send_unload_done(bp, 0); } if ((bp->flags & 4194304U) == 0U) { bnx2x_squeeze_objects(bp); } else { } bp->sp_state = 0UL; bp->port.pmf = 0U; bp->sp_rtnl_state = 0UL; __asm__ volatile ("mfence": : : "memory"); bnx2x_free_skbs(bp); if ((int )bp->cnic_loaded) { bnx2x_free_skbs_cnic(bp); } else { } i = 0; goto ldv_62754; ldv_62753: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_free_rx_sge_range___0(bp, bp->fp + (unsigned long )i, 1024); } i = i + 1; ldv_62754: ; if (bp->num_queues > i) { goto ldv_62753; } else { } bnx2x_free_fp_mem(bp); if ((int )bp->cnic_loaded) { bnx2x_free_fp_mem_cnic(bp); } else { } if ((bp->flags & 4194304U) == 0U) { if ((int )bp->cnic_loaded) { bnx2x_free_mem_cnic(bp); } else { } } else { } bnx2x_free_mem(bp); bp->state = 0U; bp->cnic_loaded = 0; if ((bp->flags & 4194304U) == 0U) { bnx2x_update_mng_version(bp); } else { } if ((bp->flags & 4194304U) == 0U) { tmp___2 = bnx2x_chk_parity_attn(bp, & global, 0); if ((int )tmp___2) { bnx2x_set_reset_in_progress(bp); if ((int )global) { bnx2x_set_reset_global(bp); } else { } } else { } } else { } if ((bp->flags & 4194304U) == 0U) { tmp___3 = bnx2x_clear_pf_load(bp); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { tmp___5 = bnx2x_reset_is_done(bp, bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0); if ((int )tmp___5) { bnx2x_disable_close_the_gate(bp); } else { } } else { } } else { } tmp___6 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Ending NIC unload\n", "bnx2x_nic_unload", 3121, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } } int bnx2x_set_power_state(struct bnx2x *bp , pci_power_t state ) { u16 pmcsr ; long tmp ; int tmp___0 ; { if ((unsigned int )(bp->pdev)->pm_cap == 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "No power capability. Breaking.\n"); } else { } return (0); } else { } pci_read_config_word((struct pci_dev const *)bp->pdev, (int )(bp->pdev)->pm_cap + 4, & pmcsr); switch (state) { case 0: pci_write_config_word((struct pci_dev const *)bp->pdev, (int )(bp->pdev)->pm_cap + 4, (int )((u16 )(((int )((short )pmcsr) & 32764) | -32768))); if (((int )pmcsr & 3) != 0) { msleep(20U); } else { } goto ldv_62762; case 3: tmp___0 = atomic_read((atomic_t const *)(& (bp->pdev)->enable_cnt)); if (tmp___0 != 1) { return (0); } else { } if ((bp->common.chip_id & 61440U) > 20480U) { return (0); } else { } pmcsr = (unsigned int )pmcsr & 65532U; pmcsr = (u16 )((unsigned int )pmcsr | 3U); if ((unsigned int )bp->wol != 0U) { pmcsr = (u16 )((unsigned int )pmcsr | 256U); } else { } pci_write_config_word((struct pci_dev const *)bp->pdev, (int )(bp->pdev)->pm_cap + 4, (int )pmcsr); goto ldv_62762; default: dev_err((struct device const *)(& (bp->pdev)->dev), "Can\'t support state = %d\n", state); return (-22); } ldv_62762: ; return (0); } } static int bnx2x_poll(struct napi_struct *napi , int budget ) { int work_done ; u8 cos ; struct bnx2x_fastpath *fp ; struct napi_struct const *__mptr ; struct bnx2x *bp ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; bool tmp___6 ; int tmp___7 ; int tmp___8 ; bool tmp___9 ; int tmp___10 ; { work_done = 0; __mptr = (struct napi_struct const *)napi; fp = (struct bnx2x_fastpath *)__mptr + 0xfffffffffffffff8UL; bp = fp->bp; ldv_62780: tmp = bnx2x_fp_lock_napi(fp); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (budget); } else { } cos = 0U; goto ldv_62776; ldv_62775: tmp___1 = bnx2x_tx_queue_has_work(fp->txdata_ptr[(int )cos]); if (tmp___1 != 0) { bnx2x_tx_int(bp, fp->txdata_ptr[(int )cos]); } else { } cos = (u8 )((int )cos + 1); ldv_62776: ; if ((int )fp->max_cos > (int )cos) { goto ldv_62775; } else { } tmp___3 = bnx2x_has_rx_work(fp); if (tmp___3 != 0) { tmp___2 = bnx2x_rx_int(fp, budget - work_done); work_done = tmp___2 + work_done; if (work_done >= budget) { bnx2x_fp_unlock_napi(fp); goto ldv_62778; } else { } } else { } bnx2x_fp_unlock_napi(fp); tmp___8 = bnx2x_has_rx_work(fp); if (tmp___8 == 0) { tmp___9 = bnx2x_has_tx_work___0(fp); if (tmp___9) { tmp___10 = 0; } else { tmp___10 = 1; } if (tmp___10) { if ((uint )fp->index == (uint )(fp->bp)->num_queues - (fp->bp)->num_cnic_queues) { napi_complete(napi); goto ldv_62778; } else { } bnx2x_update_fpsb_idx(fp); __asm__ volatile ("lfence": : : "memory"); tmp___5 = bnx2x_has_rx_work(fp); if (tmp___5 == 0) { tmp___6 = bnx2x_has_tx_work___0(fp); if (tmp___6) { tmp___7 = 0; } else { tmp___7 = 1; } if (tmp___7) { napi_complete(napi); tmp___4 = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Update index to %d\n", "bnx2x_poll", 3247, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->fp_hc_idx); } else { } bnx2x_ack_sb(bp, (int )fp->igu_sb_id, 0, (int )fp->fp_hc_idx, 0, 1); goto ldv_62778; } else { } } else { } } else { } } else { } goto ldv_62780; ldv_62778: ; return (work_done); } } int bnx2x_low_latency_recv(struct napi_struct *napi ) { struct bnx2x_fastpath *fp ; struct napi_struct const *__mptr ; struct bnx2x *bp ; int found ; bool tmp ; int tmp___0 ; int tmp___1 ; { __mptr = (struct napi_struct const *)napi; fp = (struct bnx2x_fastpath *)__mptr + 0xfffffffffffffff8UL; bp = fp->bp; found = 0; if (((unsigned int )bp->state == 0U || (unsigned int )bp->state == 61440U) || ((bp->dev)->features & 49152ULL) != 0ULL) { return (-1); } else { } tmp = bnx2x_fp_lock_poll(fp); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (-2); } else { } tmp___1 = bnx2x_has_rx_work(fp); if (tmp___1 != 0) { found = bnx2x_rx_int(fp, 4); } else { } bnx2x_fp_unlock_poll(fp); return (found); } } static u16 bnx2x_tx_split(struct bnx2x *bp , struct bnx2x_fp_txdata *txdata , struct sw_tx_bd *tx_buf , struct eth_tx_start_bd **tx_bd , u16 hlen , u16 bd_prod ) { struct eth_tx_start_bd *h_tx_bd ; struct eth_tx_bd *d_tx_bd ; dma_addr_t mapping ; int old_len ; long tmp ; long tmp___0 ; { h_tx_bd = *tx_bd; old_len = (int )h_tx_bd->nbytes; h_tx_bd->nbytes = hlen; tmp = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]TSO split header size is %d (%x:%x)\n", "bnx2x_tx_split", 3304, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )h_tx_bd->nbytes, h_tx_bd->addr_hi, h_tx_bd->addr_lo); } else { } bd_prod = ((unsigned long )bd_prod & 255UL) == 254UL ? ((unsigned int )bd_prod + 2U) & 4095U : ((unsigned int )bd_prod + 1U) & 4095U; d_tx_bd = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->reg_bd; mapping = (((unsigned long long )h_tx_bd->addr_hi << 32) + (unsigned long long )h_tx_bd->addr_lo) + (unsigned long long )hlen; d_tx_bd->addr_hi = (unsigned int )(mapping >> 32); d_tx_bd->addr_lo = (unsigned int )mapping; d_tx_bd->nbytes = (int )((unsigned short )old_len) - (int )hlen; tx_buf->flags = (u8 )((unsigned int )tx_buf->flags | 1U); tmp___0 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]TSO split data size is %d (%x:%x)\n", "bnx2x_tx_split", 3323, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )d_tx_bd->nbytes, d_tx_bd->addr_hi, d_tx_bd->addr_lo); } else { } *tx_bd = (struct eth_tx_start_bd *)d_tx_bd; return (bd_prod); } } static __le16 bnx2x_csum_fix(unsigned char *t_header , u16 csum , s8 fix ) { __sum16 tsum ; __wsum tmp ; __wsum tmp___0 ; __sum16 tmp___1 ; __wsum tmp___2 ; __wsum tmp___3 ; __sum16 tmp___4 ; __u16 tmp___5 ; { tsum = csum; if ((int )fix > 0) { tmp = csum_partial((void const *)(t_header + - ((unsigned long )fix)), (int )fix, 0U); tmp___0 = csum_sub((unsigned int )csum, tmp); tmp___1 = csum_fold(tmp___0); tsum = ~ ((int )tmp___1); } else if ((int )fix < 0) { tmp___2 = csum_partial((void const *)t_header, - ((int )fix), 0U); tmp___3 = csum_add((unsigned int )csum, tmp___2); tmp___4 = csum_fold(tmp___3); tsum = ~ ((int )tmp___4); } else { } tmp___5 = __fswab16((int )tsum); return (tmp___5); } } static u32 bnx2x_xmit_type(struct bnx2x *bp , struct sk_buff *skb ) { u32 rc ; __u8 prot ; __be16 protocol ; struct ipv6hdr *tmp ; struct iphdr *tmp___0 ; struct ipv6hdr *tmp___1 ; struct iphdr *tmp___2 ; struct iphdr *tmp___3 ; bool tmp___4 ; bool tmp___5 ; { prot = 0U; if ((unsigned int )*((unsigned char *)skb + 145UL) != 6U) { return (0U); } else { } protocol = vlan_get_protocol___0(skb); if ((unsigned int )protocol == 56710U) { rc = 2U; tmp = ipv6_hdr((struct sk_buff const *)skb); prot = tmp->nexthdr; } else { rc = 1U; tmp___0 = ip_hdr((struct sk_buff const *)skb); prot = tmp___0->protocol; } if ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && (unsigned int )*((unsigned char *)skb + 146UL) != 0U) { tmp___3 = inner_ip_hdr((struct sk_buff const *)skb); if ((unsigned int )*((unsigned char *)tmp___3 + 0UL) == 96U) { rc = rc | 64U; tmp___1 = inner_ipv6_hdr((struct sk_buff const *)skb); if ((unsigned int )tmp___1->nexthdr == 6U) { rc = rc | 4U; } else { } } else { rc = rc | 32U; tmp___2 = inner_ip_hdr((struct sk_buff const *)skb); if ((unsigned int )tmp___2->protocol == 6U) { rc = rc | 4U; } else { } } } else { } if ((unsigned int )prot == 6U) { rc = rc | 4U; } else { } tmp___5 = skb_is_gso((struct sk_buff const *)skb); if ((int )tmp___5) { tmp___4 = skb_is_gso_v6((struct sk_buff const *)skb); if ((int )tmp___4) { rc = rc | 20U; if ((rc & 96U) != 0U) { rc = rc | 256U; } else { } } else { rc = rc | 12U; if ((rc & 96U) != 0U) { rc = rc | 128U; } else { } } } else { } return (rc); } } static int bnx2x_pkt_req_lin(struct bnx2x *bp , struct sk_buff *skb , u32 xmit_type ) { int to_copy ; int hlen ; int first_bd_sz ; unsigned short lso_mss ; unsigned char *tmp ; int wnd_size ; int num_wnds ; unsigned char *tmp___0 ; int wnd_idx ; int frag_idx ; u32 wnd_sum ; unsigned char *tmp___1 ; unsigned int tmp___2 ; unsigned char *tmp___3 ; unsigned int tmp___4 ; unsigned int tmp___5 ; unsigned char *tmp___6 ; unsigned int tmp___7 ; long tmp___8 ; unsigned char *tmp___9 ; unsigned int tmp___10 ; long tmp___11 ; unsigned char *tmp___12 ; unsigned int tmp___13 ; unsigned char *tmp___14 ; unsigned char *tmp___15 ; long tmp___16 ; long tmp___17 ; { to_copy = 0; hlen = 0; first_bd_sz = 0; tmp___14 = skb_end_pointer((struct sk_buff const *)skb); if ((unsigned int )((struct skb_shared_info *)tmp___14)->nr_frags > 9U) { if ((xmit_type & 408U) != 0U) { tmp = skb_end_pointer((struct sk_buff const *)skb); lso_mss = ((struct skb_shared_info *)tmp)->gso_size; wnd_size = 10; tmp___0 = skb_end_pointer((struct sk_buff const *)skb); num_wnds = (int )((struct skb_shared_info *)tmp___0)->nr_frags - wnd_size; wnd_idx = 0; frag_idx = 0; wnd_sum = 0U; if ((xmit_type & 384U) != 0U) { tmp___1 = skb_inner_transport_header((struct sk_buff const *)skb); tmp___2 = inner_tcp_hdrlen((struct sk_buff const *)skb); hlen = (int )(((unsigned int )((long )tmp___1) - (unsigned int )((long )skb->data)) + tmp___2); } else { tmp___3 = skb_transport_header((struct sk_buff const *)skb); tmp___4 = tcp_hdrlen((struct sk_buff const *)skb); hlen = (int )(((unsigned int )((long )tmp___3) - (unsigned int )((long )skb->data)) + tmp___4); } tmp___5 = skb_headlen((struct sk_buff const *)skb); first_bd_sz = (int )(tmp___5 - (unsigned int )hlen); wnd_sum = (u32 )first_bd_sz; frag_idx = 0; goto ldv_62830; ldv_62829: tmp___6 = skb_end_pointer((struct sk_buff const *)skb); tmp___7 = skb_frag_size((skb_frag_t const *)(& ((struct skb_shared_info *)tmp___6)->frags) + (unsigned long )frag_idx); wnd_sum = tmp___7 + wnd_sum; frag_idx = frag_idx + 1; ldv_62830: ; if (wnd_size + -1 > frag_idx) { goto ldv_62829; } else { } if (first_bd_sz > 0) { tmp___8 = ldv__builtin_expect((u32 )lso_mss > wnd_sum, 0L); if (tmp___8 != 0L) { to_copy = 1; goto exit_lbl; } else { } wnd_sum = wnd_sum - (u32 )first_bd_sz; } else { } wnd_idx = 0; goto ldv_62835; ldv_62834: tmp___9 = skb_end_pointer((struct sk_buff const *)skb); tmp___10 = skb_frag_size((skb_frag_t const *)(& ((struct skb_shared_info *)tmp___9)->frags) + ((unsigned long )(wnd_idx + wnd_size) + 0xffffffffffffffffUL)); wnd_sum = tmp___10 + wnd_sum; tmp___11 = ldv__builtin_expect((u32 )lso_mss > wnd_sum, 0L); if (tmp___11 != 0L) { to_copy = 1; goto ldv_62833; } else { } tmp___12 = skb_end_pointer((struct sk_buff const *)skb); tmp___13 = skb_frag_size((skb_frag_t const *)(& ((struct skb_shared_info *)tmp___12)->frags) + (unsigned long )wnd_idx); wnd_sum = wnd_sum - tmp___13; wnd_idx = wnd_idx + 1; ldv_62835: ; if (wnd_idx <= num_wnds) { goto ldv_62834; } else { } ldv_62833: ; } else { to_copy = 1; } } else { } exit_lbl: tmp___17 = ldv__builtin_expect(to_copy != 0, 0L); if (tmp___17 != 0L) { tmp___16 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___16 != 0L) { tmp___15 = skb_end_pointer((struct sk_buff const *)skb); printk("\rbnx2x: [%s:%d(%s)]Linearization IS REQUIRED for %s packet. num_frags %d hlen %d first_bd_sz %d\n", "bnx2x_pkt_req_lin", 3474, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (xmit_type & 408U) != 0U ? (char *)"LSO" : (char *)"non-LSO", (int )((struct skb_shared_info *)tmp___15)->nr_frags, hlen, first_bd_sz); } else { } } else { } return (to_copy); } } static void bnx2x_set_pbd_gso(struct sk_buff *skb , struct eth_tx_parse_bd_e1x *pbd , u32 xmit_type ) { unsigned char *tmp ; struct tcphdr *tmp___0 ; __u32 tmp___1 ; struct tcphdr *tmp___2 ; __u32 tmp___3 ; struct iphdr *tmp___4 ; __u16 tmp___5 ; struct iphdr *tmp___6 ; struct iphdr *tmp___7 ; __sum16 tmp___8 ; __u16 tmp___9 ; struct ipv6hdr *tmp___10 ; struct ipv6hdr *tmp___11 ; __sum16 tmp___12 ; __u16 tmp___13 ; { tmp = skb_end_pointer((struct sk_buff const *)skb); pbd->lso_mss = ((struct skb_shared_info *)tmp)->gso_size; tmp___0 = tcp_hdr((struct sk_buff const *)skb); tmp___1 = __fswab32(tmp___0->seq); pbd->tcp_send_seq = tmp___1; tmp___2 = tcp_hdr((struct sk_buff const *)skb); tmp___3 = __fswab32(((union tcp_word_hdr *)tmp___2)->words[3]); pbd->tcp_flags = (u8 )(tmp___3 >> 16); if ((xmit_type & 8U) != 0U) { tmp___4 = ip_hdr((struct sk_buff const *)skb); tmp___5 = __fswab16((int )tmp___4->id); pbd->ip_id = tmp___5; tmp___6 = ip_hdr((struct sk_buff const *)skb); tmp___7 = ip_hdr((struct sk_buff const *)skb); tmp___8 = csum_tcpudp_magic(tmp___7->saddr, tmp___6->daddr, 0, 6, 0U); tmp___9 = __fswab16(~ ((int )tmp___8)); pbd->tcp_pseudo_csum = tmp___9; } else { tmp___10 = ipv6_hdr((struct sk_buff const *)skb); tmp___11 = ipv6_hdr((struct sk_buff const *)skb); tmp___12 = csum_ipv6_magic((struct in6_addr const *)(& tmp___11->saddr), (struct in6_addr const *)(& tmp___10->daddr), 0U, 6, 0U); tmp___13 = __fswab16(~ ((int )tmp___12)); pbd->tcp_pseudo_csum = tmp___13; } pbd->global_data = (__le16 )((unsigned int )pbd->global_data | 64U); return; } } static u8 bnx2x_set_pbd_csum_enc(struct bnx2x *bp , struct sk_buff *skb , u32 *parsing_data , u32 xmit_type ) { unsigned char *tmp ; unsigned int tmp___0 ; unsigned char *tmp___1 ; unsigned int tmp___2 ; unsigned char *tmp___3 ; { tmp = skb_inner_transport_header((struct sk_buff const *)skb); *parsing_data = (u32 )((int )*parsing_data | ((int )(((long )tmp - (long )skb->data) >> 1) & 2047)); if ((xmit_type & 4U) != 0U) { tmp___0 = inner_tcp_hdrlen((struct sk_buff const *)skb); *parsing_data = *parsing_data | ((tmp___0 / 4U << 11) & 30720U); tmp___1 = skb_inner_transport_header((struct sk_buff const *)skb); tmp___2 = inner_tcp_hdrlen((struct sk_buff const *)skb); return ((int )((u8 )((long )(tmp___1 + (unsigned long )tmp___2))) - (int )((u8 )((long )skb->data))); } else { } tmp___3 = skb_inner_transport_header((struct sk_buff const *)skb); return ((int )((u8 )((long )(tmp___3 + 8UL))) - (int )((u8 )((long )skb->data))); } } static u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp , struct sk_buff *skb , u32 *parsing_data , u32 xmit_type ) { unsigned char *tmp ; unsigned int tmp___0 ; unsigned char *tmp___1 ; unsigned int tmp___2 ; unsigned char *tmp___3 ; { tmp = skb_transport_header((struct sk_buff const *)skb); *parsing_data = (u32 )((int )*parsing_data | ((int )(((long )tmp - (long )skb->data) >> 1) & 2047)); if ((xmit_type & 4U) != 0U) { tmp___0 = tcp_hdrlen((struct sk_buff const *)skb); *parsing_data = *parsing_data | ((tmp___0 / 4U << 11) & 30720U); tmp___1 = skb_transport_header((struct sk_buff const *)skb); tmp___2 = tcp_hdrlen((struct sk_buff const *)skb); return ((int )((u8 )((long )(tmp___1 + (unsigned long )tmp___2))) - (int )((u8 )((long )skb->data))); } else { } tmp___3 = skb_transport_header((struct sk_buff const *)skb); return ((int )((u8 )((long )(tmp___3 + 8UL))) - (int )((u8 )((long )skb->data))); } } static void bnx2x_set_sbd_csum(struct bnx2x *bp , struct sk_buff *skb , struct eth_tx_start_bd *tx_start_bd , u32 xmit_type ) { { tx_start_bd->bd_flags.as_bitfield = (u8 )((unsigned int )tx_start_bd->bd_flags.as_bitfield | 2U); if ((xmit_type & 66U) != 0U) { tx_start_bd->bd_flags.as_bitfield = (u8 )((unsigned int )tx_start_bd->bd_flags.as_bitfield | 128U); } else { } if ((xmit_type & 4U) == 0U) { tx_start_bd->bd_flags.as_bitfield = (u8 )((unsigned int )tx_start_bd->bd_flags.as_bitfield | 32U); } else { } return; } } static u8 bnx2x_set_pbd_csum(struct bnx2x *bp , struct sk_buff *skb , struct eth_tx_parse_bd_e1x *pbd , u32 xmit_type ) { u8 hlen ; unsigned char *tmp ; unsigned char *tmp___0 ; unsigned char *tmp___1 ; unsigned int tmp___2 ; struct tcphdr *tmp___3 ; __u16 tmp___4 ; s8 fix ; unsigned char *tmp___5 ; long tmp___6 ; unsigned char *tmp___7 ; unsigned char *tmp___8 ; long tmp___9 ; { tmp = skb_network_header((struct sk_buff const *)skb); hlen = (u8 )(((long )tmp - (long )skb->data) >> 1); pbd->global_data = (unsigned short )((int )((short )hlen) | ((unsigned int )skb->protocol == 129U ? 128 : 0)); tmp___0 = skb_transport_header((struct sk_buff const *)skb); tmp___1 = skb_network_header((struct sk_buff const *)skb); pbd->ip_hlen_w = (u8 )(((long )tmp___0 - (long )tmp___1) >> 1); hlen = (int )pbd->ip_hlen_w + (int )hlen; if ((xmit_type & 4U) != 0U) { tmp___2 = tcp_hdrlen((struct sk_buff const *)skb); hlen = (int )((u8 )(tmp___2 / 2U)) + (int )hlen; } else { hlen = (unsigned int )hlen + 4U; } pbd->total_hlen_w = (unsigned short )hlen; hlen = (unsigned int )hlen * 2U; if ((xmit_type & 4U) != 0U) { tmp___3 = tcp_hdr((struct sk_buff const *)skb); tmp___4 = __fswab16((int )tmp___3->check); pbd->tcp_pseudo_csum = tmp___4; } else { fix = (s8 )(16U - (unsigned int )((unsigned char )skb->__annonCompField89.__annonCompField88.csum_offset)); tmp___6 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___6 != 0L) { tmp___5 = skb_transport_header((struct sk_buff const *)skb); printk("\rbnx2x: [%s:%d(%s)]hlen %d fix %d csum before fix %x\n", "bnx2x_set_pbd_csum", 3633, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pbd->total_hlen_w, (int )fix, (int )*((u16 *)tmp___5 + (unsigned long )skb->__annonCompField89.__annonCompField88.csum_offset)); } else { } tmp___7 = skb_transport_header((struct sk_buff const *)skb); tmp___8 = skb_transport_header((struct sk_buff const *)skb); pbd->tcp_pseudo_csum = bnx2x_csum_fix(tmp___8, (int )*((u16 *)tmp___7 + (unsigned long )skb->__annonCompField89.__annonCompField88.csum_offset), (int )fix); tmp___9 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]csum after fix %x\n", "bnx2x_set_pbd_csum", 3641, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pbd->tcp_pseudo_csum); } else { } } return (hlen); } } static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb , struct eth_tx_parse_bd_e2 *pbd_e2 , struct eth_tx_parse_2nd_bd *pbd2 , u16 *global_data , u32 xmit_type ) { u16 hlen_w ; u8 outerip_off ; u8 outerip_len ; unsigned char *tmp ; unsigned char *tmp___0 ; unsigned int tmp___1 ; struct iphdr *iph ; struct iphdr *tmp___2 ; u32 csum ; __sum16 tmp___3 ; __u16 tmp___4 ; struct tcphdr *tmp___5 ; __u32 tmp___6 ; struct tcphdr *tmp___7 ; __u32 tmp___8 ; struct iphdr *tmp___9 ; __u16 tmp___10 ; struct iphdr *tmp___11 ; struct iphdr *tmp___12 ; __sum16 tmp___13 ; __u16 tmp___14 ; struct ipv6hdr *tmp___15 ; struct ipv6hdr *tmp___16 ; __sum16 tmp___17 ; __u16 tmp___18 ; unsigned char *tmp___19 ; int tmp___20 ; struct iphdr *tmp___21 ; { hlen_w = 0U; outerip_len = 0U; tmp = skb_inner_transport_header((struct sk_buff const *)skb); tmp___0 = skb_network_header((struct sk_buff const *)skb); hlen_w = (u16 )(((long )tmp - (long )tmp___0) >> 1); tmp___1 = inner_tcp_hdrlen((struct sk_buff const *)skb); hlen_w = (int )((u16 )(tmp___1 >> 1)) + (int )hlen_w; pbd2->fw_ip_hdr_to_payload_w = (u8 )hlen_w; if ((int )xmit_type & 1) { tmp___2 = ip_hdr((struct sk_buff const *)skb); iph = tmp___2; csum = ((unsigned int )(~ ((int )iph->check)) - (unsigned int )iph->tot_len) - (unsigned int )iph->frag_off; outerip_len = (int )iph->ihl << 1U; tmp___3 = csum_fold(csum); tmp___4 = __fswab16((int )tmp___3); pbd2->fw_ip_csum_wo_len_flags_frag = tmp___4; } else { pbd2->fw_ip_hdr_to_payload_w = (unsigned int )((u8 )hlen_w) - 20U; pbd_e2->data.tunnel_data.flags = (u8 )((unsigned int )pbd_e2->data.tunnel_data.flags | 1U); } tmp___5 = inner_tcp_hdr((struct sk_buff const *)skb); tmp___6 = __fswab32(tmp___5->seq); pbd2->tcp_send_seq = tmp___6; tmp___7 = inner_tcp_hdr((struct sk_buff const *)skb); tmp___8 = __fswab32(((union tcp_word_hdr *)tmp___7)->words[3]); pbd2->tcp_flags = (u8 )(tmp___8 >> 16); if ((xmit_type & 32U) != 0U) { tmp___9 = inner_ip_hdr((struct sk_buff const *)skb); tmp___10 = __fswab16((int )tmp___9->id); pbd2->hw_ip_id = tmp___10; tmp___11 = inner_ip_hdr((struct sk_buff const *)skb); tmp___12 = inner_ip_hdr((struct sk_buff const *)skb); tmp___13 = csum_tcpudp_magic(tmp___12->saddr, tmp___11->daddr, 0, 6, 0U); tmp___14 = __fswab16(~ ((int )tmp___13)); pbd_e2->data.tunnel_data.pseudo_csum = tmp___14; } else { tmp___15 = inner_ipv6_hdr((struct sk_buff const *)skb); tmp___16 = inner_ipv6_hdr((struct sk_buff const *)skb); tmp___17 = csum_ipv6_magic((struct in6_addr const *)(& tmp___16->saddr), (struct in6_addr const *)(& tmp___15->daddr), 0U, 6, 0U); tmp___18 = __fswab16(~ ((int )tmp___17)); pbd_e2->data.tunnel_data.pseudo_csum = tmp___18; } tmp___19 = skb_network_header((struct sk_buff const *)skb); outerip_off = (u8 )(((long )tmp___19 - (long )skb->data) >> 1); *global_data = (u16 )((int )((short )*global_data) | (((int )((short )outerip_off) | (int )((short )((int )outerip_len << 8))) | ((unsigned int )skb->protocol == 129U ? 32 : 0))); tmp___21 = ip_hdr((struct sk_buff const *)skb); if ((unsigned int )tmp___21->protocol == 17U) { *global_data = (unsigned int )*global_data & 65407U; *global_data = (u16 )((unsigned int )*global_data | 128U); tmp___20 = skb_transport_offset((struct sk_buff const *)skb); pbd2->tunnel_udp_hdr_start_w = (u8 )(tmp___20 >> 1); } else { } return; } } __inline static void bnx2x_set_ipv6_ext_e2(struct sk_buff *skb , u32 *parsing_data , u32 xmit_type ) { struct ipv6hdr *ipv6 ; { if ((xmit_type & 272U) == 0U) { return; } else { } if ((xmit_type & 256U) != 0U) { ipv6 = inner_ipv6_hdr((struct sk_buff const *)skb); } else { ipv6 = ipv6_hdr((struct sk_buff const *)skb); } if ((unsigned int )ipv6->nexthdr == 41U) { *parsing_data = *parsing_data | 32768U; } else { } return; } } netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb , struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; struct netdev_queue *txq ; struct bnx2x_fp_txdata *txdata ; struct sw_tx_bd *tx_buf ; struct eth_tx_start_bd *tx_start_bd ; struct eth_tx_start_bd *first_bd ; struct eth_tx_bd *tx_data_bd ; struct eth_tx_bd *total_pkt_bd ; struct eth_tx_parse_bd_e1x *pbd_e1x ; struct eth_tx_parse_bd_e2 *pbd_e2 ; struct eth_tx_parse_2nd_bd *pbd2 ; u32 pbd_e2_parsing_data ; u16 pkt_prod ; u16 bd_prod ; int nbd ; int txq_index ; dma_addr_t mapping ; u32 xmit_type ; u32 tmp___0 ; int i ; u8 hlen ; __le16 pkt_size ; struct ethhdr *eth ; u8 mac_type ; u16 tmp___1 ; long tmp___2 ; struct bnx2x_eth_q_stats *q_stats ; u16 tmp___3 ; unsigned char *tmp___4 ; long tmp___5 ; unsigned char *tmp___6 ; struct iphdr *tmp___7 ; struct ipv6hdr *tmp___8 ; long tmp___9 ; bool tmp___10 ; bool tmp___11 ; long tmp___12 ; long tmp___13 ; int tmp___14 ; int tmp___15 ; unsigned int tmp___16 ; long tmp___17 ; int tmp___18 ; long tmp___19 ; unsigned char *tmp___20 ; unsigned char *tmp___21 ; unsigned char *tmp___22 ; long tmp___23 ; long tmp___24 ; __u16 tmp___25 ; u16 global_data ; unsigned char *tmp___26 ; u16 global_data___0 ; unsigned int tmp___27 ; long tmp___28 ; unsigned char *tmp___29 ; unsigned int tmp___30 ; long tmp___31 ; unsigned int tmp___32 ; long tmp___33 ; unsigned char *tmp___34 ; skb_frag_t *frag ; unsigned char *tmp___35 ; unsigned int tmp___36 ; unsigned int pkts_compl ; unsigned int bytes_compl ; long tmp___37 ; int tmp___38 ; long tmp___39 ; unsigned int tmp___40 ; unsigned int tmp___41 ; long tmp___42 ; unsigned char *tmp___43 ; long tmp___44 ; long tmp___45 ; long tmp___46 ; long tmp___47 ; u16 tmp___48 ; u16 tmp___49 ; long tmp___50 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; total_pkt_bd = (struct eth_tx_bd *)0; pbd_e1x = (struct eth_tx_parse_bd_e1x *)0; pbd_e2 = (struct eth_tx_parse_bd_e2 *)0; pbd2 = (struct eth_tx_parse_2nd_bd *)0; pbd_e2_parsing_data = 0U; tmp___0 = bnx2x_xmit_type(bp, skb); xmit_type = tmp___0; hlen = 0U; pkt_size = 0U; mac_type = 1U; tmp___1 = skb_get_queue_mapping((struct sk_buff const *)skb); txq_index = (int )tmp___1; txq = netdev_get_tx_queue((struct net_device const *)dev, (unsigned int )txq_index); tmp___2 = ldv__builtin_expect((uint )txq_index >= ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + ((int )bp->cnic_loaded ? 1U : 0U), 0L); if (tmp___2 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c"), "i" (3771), "i" (12UL)); ldv_62914: ; goto ldv_62914; } else { } txdata = bp->bnx2x_txq + (unsigned long )txq_index; tmp___3 = bnx2x_tx_avail(bp, txdata); tmp___4 = skb_end_pointer((struct sk_buff const *)skb); tmp___5 = ldv__builtin_expect((unsigned long )tmp___3 < (unsigned long )((int )((struct skb_shared_info *)tmp___4)->nr_frags + 4) + 1UL, 0L); if (tmp___5 != 0L) { if (txdata->tx_ring_size == 0) { q_stats = & (bp->fp_stats + (unsigned long )(txdata->parent_fp)->index)->eth_q_stats; q_stats->driver_filtered_tx_pkt = q_stats->driver_filtered_tx_pkt + 1U; consume_skb(skb); return (0); } else { } (bp->fp_stats + (unsigned long )(txdata->parent_fp)->index)->eth_q_stats.driver_xoff = (bp->fp_stats + (unsigned long )(txdata->parent_fp)->index)->eth_q_stats.driver_xoff + 1U; netif_tx_stop_queue(txq); printk("\vbnx2x: [%s:%d(%s)]BUG! Tx ring full when queue awake!\n", "bnx2x_start_xmit", 3798, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (16); } else { } tmp___9 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___9 != 0L) { tmp___6 = skb_end_pointer((struct sk_buff const *)skb); tmp___7 = ip_hdr((struct sk_buff const *)skb); tmp___8 = ipv6_hdr((struct sk_buff const *)skb); printk("\rbnx2x: [%s:%d(%s)]queue[%d]: SKB: summed %x protocol %x protocol(%x,%x) gso type %x xmit_type %x len %d\n", "bnx2x_start_xmit", 3807, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", txq_index, (int )skb->ip_summed, (int )skb->protocol, (int )tmp___8->nexthdr, (int )tmp___7->protocol, (int )((struct skb_shared_info *)tmp___6)->gso_type, xmit_type, skb->len); } else { } eth = (struct ethhdr *)skb->data; tmp___11 = is_multicast_ether_addr((u8 const *)(& eth->h_dest)); tmp___12 = ldv__builtin_expect((long )tmp___11, 0L); if (tmp___12 != 0L) { tmp___10 = is_broadcast_ether_addr((u8 const *)(& eth->h_dest)); if ((int )tmp___10) { mac_type = 3U; } else { mac_type = 2U; } } else { } tmp___15 = bnx2x_pkt_req_lin(bp, skb, xmit_type); if (tmp___15 != 0) { bp->lin_cnt = bp->lin_cnt + 1U; tmp___14 = skb_linearize(skb); if (tmp___14 != 0) { tmp___13 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___13 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SKB linearization failed - silently dropping this SKB\n", "bnx2x_start_xmit", 3828, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } dev_kfree_skb_any(skb); return (0); } else { } } else { } tmp___16 = skb_headlen((struct sk_buff const *)skb); mapping = dma_map_single_attrs(& (bp->pdev)->dev, (void *)skb->data, (size_t )tmp___16, 1, (struct dma_attrs *)0); tmp___18 = dma_mapping_error(& (bp->pdev)->dev, mapping); tmp___19 = ldv__builtin_expect(tmp___18 != 0, 0L); if (tmp___19 != 0L) { tmp___17 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___17 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SKB mapping failed - silently dropping this SKB\n", "bnx2x_start_xmit", 3839, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } dev_kfree_skb_any(skb); return (0); } else { } pkt_prod = txdata->tx_pkt_prod; bd_prod = (unsigned int )txdata->tx_bd_prod & 4095U; tx_buf = txdata->tx_buf_ring + ((unsigned long )pkt_prod & 4095UL); tx_start_bd = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->start_bd; first_bd = tx_start_bd; tx_start_bd->bd_flags.as_bitfield = 16U; tmp___22 = skb_end_pointer((struct sk_buff const *)skb); tmp___23 = ldv__builtin_expect((long )((struct skb_shared_info *)tmp___22)->tx_flags & 1L, 0L); if (tmp___23 != 0L) { if ((bp->flags & 134217728U) == 0U) { printk("\vbnx2x: [%s:%d(%s)]Tx timestamping was not enabled, this packet will not be timestamped\n", "bnx2x_start_xmit", 3870, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else if ((unsigned long )bp->ptp_tx_skb != (unsigned long )((struct sk_buff *)0)) { printk("\vbnx2x: [%s:%d(%s)]The device supports only a single outstanding packet to timestamp, this packet will not be timestamped\n", "bnx2x_start_xmit", 3872, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { tmp___20 = skb_end_pointer((struct sk_buff const *)skb); tmp___21 = skb_end_pointer((struct sk_buff const *)skb); ((struct skb_shared_info *)tmp___20)->tx_flags = (__u8 )((unsigned int )((struct skb_shared_info *)tmp___21)->tx_flags | 4U); bp->ptp_tx_skb = skb_get(skb); bp->ptp_tx_start = jiffies; schedule_work___0(& bp->ptp_task); } } else { } tx_start_bd->general_data = 1U; tx_buf->first_bd = txdata->tx_bd_prod; tx_buf->skb = skb; tx_buf->flags = 0U; tmp___24 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___24 != 0L) { printk("\rbnx2x: [%s:%d(%s)]sending pkt %u @%p next_idx %u bd %u @%p\n", "bnx2x_start_xmit", 3892, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pkt_prod, tx_buf, (int )txdata->tx_pkt_prod, (int )bd_prod, tx_start_bd); } else { } if (((int )skb->vlan_tci & 4096) != 0) { tx_start_bd->vlan_or_ethertype = (unsigned int )skb->vlan_tci & 61439U; tx_start_bd->bd_flags.as_bitfield = (u8 )((unsigned int )tx_start_bd->bd_flags.as_bitfield | 4U); } else if ((bp->flags & 4194304U) != 0U) { tmp___25 = __fswab16((int )eth->h_proto); tx_start_bd->vlan_or_ethertype = tmp___25; } else { tx_start_bd->vlan_or_ethertype = pkt_prod; } nbd = 2; bd_prod = ((unsigned long )bd_prod & 255UL) == 254UL ? ((unsigned int )bd_prod + 2U) & 4095U : ((unsigned int )bd_prod + 1U) & 4095U; if ((xmit_type & 99U) != 0U) { bnx2x_set_sbd_csum(bp, skb, tx_start_bd, xmit_type); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { pbd_e2 = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->parse_bd_e2; memset((void *)pbd_e2, 0, 16UL); if ((xmit_type & 96U) != 0U) { global_data = 0U; hlen = bnx2x_set_pbd_csum_enc(bp, skb, & pbd_e2_parsing_data, xmit_type); bd_prod = ((unsigned long )bd_prod & 255UL) == 254UL ? ((unsigned int )bd_prod + 2U) & 4095U : ((unsigned int )bd_prod + 1U) & 4095U; pbd2 = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->parse_2nd_bd; memset((void *)pbd2, 0, 16UL); tmp___26 = skb_inner_network_header((struct sk_buff const *)skb); pbd_e2->data.tunnel_data.ip_hdr_start_inner_w = (u8 )(((long )tmp___26 - (long )skb->data) >> 1); if ((xmit_type & 384U) != 0U) { bnx2x_update_pbds_gso_enc(skb, pbd_e2, pbd2, & global_data, xmit_type); } else { } pbd2->global_data = global_data; tx_start_bd->general_data = (unsigned int )tx_start_bd->general_data & 159U; tx_start_bd->general_data = (u8 )((unsigned int )tx_start_bd->general_data | 32U); tx_start_bd->general_data = (unsigned int )tx_start_bd->general_data & 127U; tx_start_bd->general_data = (u8 )((unsigned int )tx_start_bd->general_data | 128U); tx_buf->flags = (u8 )((unsigned int )tx_buf->flags | 2U); nbd = nbd + 1; } else if ((xmit_type & 99U) != 0U) { hlen = bnx2x_set_pbd_csum_e2(bp, skb, & pbd_e2_parsing_data, xmit_type); } else { } bnx2x_set_ipv6_ext_e2(skb, & pbd_e2_parsing_data, xmit_type); if ((bp->flags & 4194304U) != 0U) { bnx2x_set_fw_mac_addr(& pbd_e2->data.mac_addr.src_hi, & pbd_e2->data.mac_addr.src_mid, & pbd_e2->data.mac_addr.src_lo, (u8 *)(& eth->h_source)); bnx2x_set_fw_mac_addr(& pbd_e2->data.mac_addr.dst_hi, & pbd_e2->data.mac_addr.dst_mid, & pbd_e2->data.mac_addr.dst_lo, (u8 *)(& eth->h_dest)); } else if ((bp->flags & 262144U) != 0U) { bnx2x_set_fw_mac_addr(& pbd_e2->data.mac_addr.dst_hi, & pbd_e2->data.mac_addr.dst_mid, & pbd_e2->data.mac_addr.dst_lo, (u8 *)(& eth->h_dest)); } else { } pbd_e2_parsing_data = pbd_e2_parsing_data & 1073741823U; pbd_e2_parsing_data = (u32 )((int )mac_type << 30) | pbd_e2_parsing_data; } else { global_data___0 = 0U; pbd_e1x = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->parse_bd_e1x; memset((void *)pbd_e1x, 0, 16UL); if ((xmit_type & 99U) != 0U) { hlen = bnx2x_set_pbd_csum(bp, skb, pbd_e1x, xmit_type); } else { } global_data___0 = (unsigned int )global_data___0 & 65487U; global_data___0 = (u16 )((int )((short )((int )mac_type << 4)) | (int )((short )global_data___0)); pbd_e1x->global_data = (__le16 )((int )pbd_e1x->global_data | (int )global_data___0); } tx_start_bd->addr_hi = (unsigned int )(mapping >> 32); tx_start_bd->addr_lo = (unsigned int )mapping; tmp___27 = skb_headlen((struct sk_buff const *)skb); tx_start_bd->nbytes = (unsigned short )tmp___27; pkt_size = tx_start_bd->nbytes; tmp___28 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___28 != 0L) { printk("\rbnx2x: [%s:%d(%s)]first bd @%p addr (%x:%x) nbytes %d flags %x vlan %x\n", "bnx2x_start_xmit", 4029, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tx_start_bd, tx_start_bd->addr_hi, tx_start_bd->addr_lo, (int )tx_start_bd->nbytes, (int )tx_start_bd->bd_flags.as_bitfield, (int )tx_start_bd->vlan_or_ethertype); } else { } if ((xmit_type & 408U) != 0U) { tmp___31 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___31 != 0L) { tmp___29 = skb_end_pointer((struct sk_buff const *)skb); tmp___30 = skb_headlen((struct sk_buff const *)skb); printk("\rbnx2x: [%s:%d(%s)]TSO packet len %d hlen %d total len %d tso size %d\n", "bnx2x_start_xmit", 4036, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", skb->len, (int )hlen, tmp___30, (int )((struct skb_shared_info *)tmp___29)->gso_size); } else { } tx_start_bd->bd_flags.as_bitfield = (u8 )((unsigned int )tx_start_bd->bd_flags.as_bitfield | 64U); tmp___32 = skb_headlen((struct sk_buff const *)skb); tmp___33 = ldv__builtin_expect(tmp___32 > (unsigned int )hlen, 0L); if (tmp___33 != 0L) { nbd = nbd + 1; bd_prod = bnx2x_tx_split(bp, txdata, tx_buf, & tx_start_bd, (int )hlen, (int )bd_prod); } else { } if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { tmp___34 = skb_end_pointer((struct sk_buff const *)skb); pbd_e2_parsing_data = ((u32 )((int )((struct skb_shared_info *)tmp___34)->gso_size << 16) & 1073676288U) | pbd_e2_parsing_data; } else { bnx2x_set_pbd_gso(skb, pbd_e1x, xmit_type); } } else { } if (pbd_e2_parsing_data != 0U) { pbd_e2->parsing_data = pbd_e2_parsing_data; } else { } tx_data_bd = (struct eth_tx_bd *)tx_start_bd; i = 0; goto ldv_62923; ldv_62922: tmp___35 = skb_end_pointer((struct sk_buff const *)skb); frag = (skb_frag_t *)(& ((struct skb_shared_info *)tmp___35)->frags) + (unsigned long )i; tmp___36 = skb_frag_size((skb_frag_t const *)frag); mapping = skb_frag_dma_map(& (bp->pdev)->dev, (skb_frag_t const *)frag, 0UL, (size_t )tmp___36, 1); tmp___38 = dma_mapping_error(& (bp->pdev)->dev, mapping); tmp___39 = ldv__builtin_expect(tmp___38 != 0, 0L); if (tmp___39 != 0L) { pkts_compl = 0U; bytes_compl = 0U; tmp___37 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___37 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unable to map page - dropping packet...\n", "bnx2x_start_xmit", 4073, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } first_bd->nbd = (unsigned short )nbd; bnx2x_free_tx_pkt(bp, txdata, (int )txdata->tx_pkt_prod & 4095, & pkts_compl, & bytes_compl); return (0); } else { } bd_prod = ((unsigned long )bd_prod & 255UL) == 254UL ? ((unsigned int )bd_prod + 2U) & 4095U : ((unsigned int )bd_prod + 1U) & 4095U; tx_data_bd = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->reg_bd; if ((unsigned long )total_pkt_bd == (unsigned long )((struct eth_tx_bd *)0)) { total_pkt_bd = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->reg_bd; } else { } tx_data_bd->addr_hi = (unsigned int )(mapping >> 32); tx_data_bd->addr_lo = (unsigned int )mapping; tmp___40 = skb_frag_size((skb_frag_t const *)frag); tx_data_bd->nbytes = (unsigned short )tmp___40; tmp___41 = skb_frag_size((skb_frag_t const *)frag); le16_add_cpu(& pkt_size, (int )((u16 )tmp___41)); nbd = nbd + 1; tmp___42 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___42 != 0L) { printk("\rbnx2x: [%s:%d(%s)]frag %d bd @%p addr (%x:%x) nbytes %d\n", "bnx2x_start_xmit", 4101, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, tx_data_bd, tx_data_bd->addr_hi, tx_data_bd->addr_lo, (int )tx_data_bd->nbytes); } else { } i = i + 1; ldv_62923: tmp___43 = skb_end_pointer((struct sk_buff const *)skb); if ((int )((struct skb_shared_info *)tmp___43)->nr_frags > i) { goto ldv_62922; } else { } tmp___44 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___44 != 0L) { printk("\rbnx2x: [%s:%d(%s)]last bd @%p\n", "bnx2x_start_xmit", 4104, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tx_data_bd); } else { } first_bd->nbd = (unsigned short )nbd; bd_prod = ((unsigned long )bd_prod & 255UL) == 254UL ? ((unsigned int )bd_prod + 2U) & 4095U : ((unsigned int )bd_prod + 1U) & 4095U; if (((unsigned long )bd_prod & 255UL) < (unsigned long )nbd) { nbd = nbd + 1; } else { } if ((unsigned long )total_pkt_bd != (unsigned long )((struct eth_tx_bd *)0)) { total_pkt_bd->total_pkt_bytes = pkt_size; } else { } if ((unsigned long )pbd_e1x != (unsigned long )((struct eth_tx_parse_bd_e1x *)0)) { tmp___45 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___45 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PBD (E1X) @%p ip_data %x ip_hlen %u ip_id %u lso_mss %u tcp_flags %x xsum %x seq %u hlen %u\n", "bnx2x_start_xmit", 4133, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", pbd_e1x, (int )pbd_e1x->global_data, (int )pbd_e1x->ip_hlen_w, (int )pbd_e1x->ip_id, (int )pbd_e1x->lso_mss, (int )pbd_e1x->tcp_flags, (int )pbd_e1x->tcp_pseudo_csum, pbd_e1x->tcp_send_seq, (int )pbd_e1x->total_hlen_w); } else { } } else { } if ((unsigned long )pbd_e2 != (unsigned long )((struct eth_tx_parse_bd_e2 *)0)) { tmp___46 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___46 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PBD (E2) @%p dst %x %x %x src %x %x %x parsing_data %x\n", "bnx2x_start_xmit", 4144, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", pbd_e2, (int )pbd_e2->data.mac_addr.dst_hi, (int )pbd_e2->data.mac_addr.dst_mid, (int )pbd_e2->data.mac_addr.dst_lo, (int )pbd_e2->data.mac_addr.src_hi, (int )pbd_e2->data.mac_addr.src_mid, (int )pbd_e2->data.mac_addr.src_lo, pbd_e2->parsing_data); } else { } } else { } tmp___47 = ldv__builtin_expect((bp->msg_enable & 256) != 0, 0L); if (tmp___47 != 0L) { printk("\rbnx2x: [%s:%d(%s)]doorbell: nbd %d bd %u\n", "bnx2x_start_xmit", 4145, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", nbd, (int )bd_prod); } else { } netdev_tx_sent_queue(txq, skb->len); skb_tx_timestamp(skb); txdata->tx_pkt_prod = (u16 )((int )txdata->tx_pkt_prod + 1); __asm__ volatile ("sfence": : : "memory"); txdata->tx_db.data.prod = (int )txdata->tx_db.data.prod + (int )((u16 )nbd); __asm__ volatile ("": : : "memory"); writel(txdata->tx_db.raw, (void volatile *)bp->doorbells + (unsigned long )((u32 )bp->db_size * txdata->cid)); __asm__ volatile ("": : : "memory"); txdata->tx_bd_prod = (int )txdata->tx_bd_prod + (int )((u16 )nbd); tmp___49 = bnx2x_tx_avail(bp, txdata); tmp___50 = ldv__builtin_expect((unsigned int )tmp___49 <= 21U, 0L); if (tmp___50 != 0L) { netif_tx_stop_queue(txq); __asm__ volatile ("mfence": : : "memory"); (bp->fp_stats + (unsigned long )(txdata->parent_fp)->index)->eth_q_stats.driver_xoff = (bp->fp_stats + (unsigned long )(txdata->parent_fp)->index)->eth_q_stats.driver_xoff + 1U; tmp___48 = bnx2x_tx_avail(bp, txdata); if ((unsigned int )tmp___48 > 21U) { netif_tx_wake_queue(txq); } else { } } else { } txdata->tx_pkt = txdata->tx_pkt + 1UL; return (0); } } int bnx2x_setup_tc(struct net_device *dev , u8 num_tc ) { int cos ; int prio ; int count ; int offset ; struct bnx2x *bp ; void *tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = rtnl_is_locked(); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { printk("\vRTNL: assertion failed at %s (%d)\n", (char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", 4201); dump_stack(); } else { } if ((unsigned int )num_tc == 0U) { netdev_reset_tc(dev); return (0); } else { } if ((int )bp->max_cos < (int )num_tc) { printk("\vbnx2x: [%s:%d(%s)]support for too many traffic classes requested: %d. Max supported is %d\n", "bnx2x_setup_tc", 4212, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )num_tc, (int )bp->max_cos); return (-22); } else { } tmp___2 = netdev_set_num_tc(dev, (int )num_tc); if (tmp___2 != 0) { printk("\vbnx2x: [%s:%d(%s)]failed to declare %d traffic classes\n", "bnx2x_setup_tc", 4218, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )num_tc); return (-22); } else { } prio = 0; goto ldv_62936; ldv_62935: netdev_set_prio_tc_map(dev, (int )((u8 )prio), (int )bp->prio_to_cos[prio]); tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048608) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]mapping priority %d to tc %d\n", "bnx2x_setup_tc", 4227, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prio, (int )bp->prio_to_cos[prio]); } else { } prio = prio + 1; ldv_62936: ; if (prio <= 7) { goto ldv_62935; } else { } cos = 0; goto ldv_62939; ldv_62938: count = (int )bp->num_ethernet_queues; offset = (int )(((uint )bp->num_queues - bp->num_cnic_queues) * (uint )cos); netdev_set_tc_queue(dev, (int )((u8 )cos), (int )((u16 )count), (int )((u16 )offset)); tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048608) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]mapping tc %d to offset %d count %d\n", "bnx2x_setup_tc", 4247, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cos, offset, count); } else { } cos = cos + 1; ldv_62939: ; if ((int )bp->max_cos > cos) { goto ldv_62938; } else { } return (0); } } int bnx2x_change_mac_addr(struct net_device *dev , void *p ) { struct sockaddr *addr ; struct bnx2x *bp ; void *tmp ; int rc ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; bool tmp___3 ; { addr = (struct sockaddr *)p; tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; rc = 0; tmp___0 = is_valid_ether_addr((u8 const *)(& addr->sa_data)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { printk("\vbnx2x: [%s:%d(%s)]Requested MAC address is not valid\n", "bnx2x_change_mac_addr", 4261, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } if ((((unsigned int )bp->mf_mode == 1U && ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U || (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U)) || ((unsigned int )bp->mf_mode == 2U && ((bp->mf_ext_config & 14U) == 4U || (bp->mf_ext_config & 14U) == 8U))) || ((unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U)) { printk("\vbnx2x: [%s:%d(%s)]Can\'t change address on STORAGE ONLY function\n", "bnx2x_change_mac_addr", 4266, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } tmp___2 = netif_running((struct net_device const *)dev); if ((int )tmp___2) { rc = bnx2x_set_eth_mac(bp, 0); if (rc != 0) { return (rc); } else { } } else { } memcpy((void *)dev->dev_addr, (void const *)(& addr->sa_data), (size_t )dev->addr_len); tmp___3 = netif_running((struct net_device const *)dev); if ((int )tmp___3) { rc = bnx2x_set_eth_mac(bp, 1); } else { } return (rc); } } static void bnx2x_free_fp_mem_at(struct bnx2x *bp , int fp_index ) { union host_hc_status_block *sb ; struct bnx2x_fastpath *fp ; u8 cos ; struct bnx2x_fp_txdata *txdata ; long tmp ; { sb = & (bp->fp + (unsigned long )fp_index)->status_blk; fp = bp->fp + (unsigned long )fp_index; if ((uint )fp_index == (uint )bp->num_queues - bp->num_cnic_queues) { memset((void *)sb, 0, 8UL); fp->status_blk_mapping = 0ULL; } else if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { if ((unsigned long )sb->e2_sb != (unsigned long )((struct host_hc_status_block_e2 *)0)) { dma_free_attrs(& (bp->pdev)->dev, 64UL, (void *)sb->e2_sb, (bp->fp + (unsigned long )fp_index)->status_blk_mapping, (struct dma_attrs *)0); sb->e2_sb = (struct host_hc_status_block_e2 *)0; (bp->fp + (unsigned long )fp_index)->status_blk_mapping = 0ULL; } else { } } else if ((unsigned long )sb->e1x_sb != (unsigned long )((struct host_hc_status_block_e1x *)0)) { dma_free_attrs(& (bp->pdev)->dev, 64UL, (void *)sb->e1x_sb, (bp->fp + (unsigned long )fp_index)->status_blk_mapping, (struct dma_attrs *)0); sb->e1x_sb = (struct host_hc_status_block_e1x *)0; (bp->fp + (unsigned long )fp_index)->status_blk_mapping = 0ULL; } else { } if ((bp->flags & 32768U) == 0U || (uint )fp_index != (uint )bp->num_queues - bp->num_cnic_queues) { bnx2x_free_rx_bds(fp); if ((unsigned long )(bp->fp + (unsigned long )fp_index)->rx_buf_ring != (unsigned long )((struct sw_rx_bd *)0)) { kfree((void const *)(bp->fp + (unsigned long )fp_index)->rx_buf_ring); (bp->fp + (unsigned long )fp_index)->rx_buf_ring = (struct sw_rx_bd *)0; } else { } if ((unsigned long )(bp->fp + (unsigned long )fp_index)->rx_desc_ring != (unsigned long )((struct eth_rx_bd *)0)) { dma_free_attrs(& (bp->pdev)->dev, 32768UL, (void *)(bp->fp + (unsigned long )fp_index)->rx_desc_ring, (bp->fp + (unsigned long )fp_index)->rx_desc_mapping, (struct dma_attrs *)0); (bp->fp + (unsigned long )fp_index)->rx_desc_ring = (struct eth_rx_bd *)0; (bp->fp + (unsigned long )fp_index)->rx_desc_mapping = 0ULL; } else { } if ((unsigned long )(bp->fp + (unsigned long )fp_index)->rx_comp_ring != (unsigned long )((union eth_rx_cqe *)0)) { dma_free_attrs(& (bp->pdev)->dev, 262144UL, (void *)(bp->fp + (unsigned long )fp_index)->rx_comp_ring, (bp->fp + (unsigned long )fp_index)->rx_comp_mapping, (struct dma_attrs *)0); (bp->fp + (unsigned long )fp_index)->rx_comp_ring = (union eth_rx_cqe *)0; (bp->fp + (unsigned long )fp_index)->rx_comp_mapping = 0ULL; } else { } if ((unsigned long )(bp->fp + (unsigned long )fp_index)->rx_page_ring != (unsigned long )((struct sw_rx_page *)0)) { kfree((void const *)(bp->fp + (unsigned long )fp_index)->rx_page_ring); (bp->fp + (unsigned long )fp_index)->rx_page_ring = (struct sw_rx_page *)0; } else { } if ((unsigned long )(bp->fp + (unsigned long )fp_index)->rx_sge_ring != (unsigned long )((struct eth_rx_sge *)0)) { dma_free_attrs(& (bp->pdev)->dev, 8192UL, (void *)(bp->fp + (unsigned long )fp_index)->rx_sge_ring, (bp->fp + (unsigned long )fp_index)->rx_sge_mapping, (struct dma_attrs *)0); (bp->fp + (unsigned long )fp_index)->rx_sge_ring = (struct eth_rx_sge *)0; (bp->fp + (unsigned long )fp_index)->rx_sge_mapping = 0ULL; } else { } } else { } if ((bp->flags & 32768U) == 0U || (uint )fp_index != (uint )bp->num_queues - bp->num_cnic_queues) { cos = 0U; goto ldv_62959; ldv_62958: txdata = fp->txdata_ptr[(int )cos]; tmp = ldv__builtin_expect((bp->msg_enable & 16) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]freeing tx memory of fp %d cos %d cid %d\n", "bnx2x_free_fp_mem_at", 4339, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", fp_index, (int )cos, txdata->cid); } else { } if ((unsigned long )txdata->tx_buf_ring != (unsigned long )((struct sw_tx_bd *)0)) { kfree((void const *)txdata->tx_buf_ring); txdata->tx_buf_ring = (struct sw_tx_bd *)0; } else { } if ((unsigned long )txdata->tx_desc_ring != (unsigned long )((union eth_tx_bd_types *)0)) { dma_free_attrs(& (bp->pdev)->dev, 65536UL, (void *)txdata->tx_desc_ring, txdata->tx_desc_mapping, (struct dma_attrs *)0); txdata->tx_desc_ring = (union eth_tx_bd_types *)0; txdata->tx_desc_mapping = 0ULL; } else { } cos = (u8 )((int )cos + 1); ldv_62959: ; if ((int )fp->max_cos > (int )cos) { goto ldv_62958; } else { } } else { } return; } } static void bnx2x_free_fp_mem_cnic(struct bnx2x *bp ) { int i ; { i = (int )bp->num_ethernet_queues; goto ldv_62967; ldv_62966: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_free_fp_mem_at(bp, i); } i = i + 1; ldv_62967: ; if (bp->num_queues > i) { goto ldv_62966; } else { } return; } } void bnx2x_free_fp_mem(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_62974; ldv_62973: bnx2x_free_fp_mem_at(bp, i); i = i + 1; ldv_62974: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_62973; } else { } return; } } static void set_sb_shortcuts(struct bnx2x *bp , int index ) { union host_hc_status_block status_blk ; { status_blk = (bp->fp + (unsigned long )index)->status_blk; if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { (bp->fp + (unsigned long )index)->sb_index_values = (__le16 *)(& (status_blk.e2_sb)->sb.index_values); (bp->fp + (unsigned long )index)->sb_running_index = (__le16 *)(& (status_blk.e2_sb)->sb.running_index); } else { (bp->fp + (unsigned long )index)->sb_index_values = (__le16 *)(& (status_blk.e1x_sb)->sb.index_values); (bp->fp + (unsigned long )index)->sb_running_index = (__le16 *)(& (status_blk.e1x_sb)->sb.running_index); } return; } } static int bnx2x_alloc_rx_bds(struct bnx2x_fastpath *fp , int rx_ring_size ) { struct bnx2x *bp ; u16 ring_prod ; u16 cqe_ring_prod ; int i ; int failure_cnt ; int tmp ; int __ret_warn_on ; long tmp___0 ; u16 __min1 ; u16 __min2 ; unsigned long tmp___1 ; { bp = fp->bp; failure_cnt = 0; fp->rx_comp_cons = 0U; ring_prod = 0U; cqe_ring_prod = ring_prod; i = 0; goto ldv_62994; ldv_62993: tmp = bnx2x_alloc_rx_data(bp, fp, (int )ring_prod, 208U); if (tmp < 0) { failure_cnt = failure_cnt + 1; goto ldv_62990; } else { } ring_prod = ((unsigned long )ring_prod & 511UL) == 509UL ? (unsigned int )ring_prod + 3U : (unsigned int )ring_prod + 1U; cqe_ring_prod = ((unsigned long )cqe_ring_prod & 63UL) == 62UL ? (unsigned int )cqe_ring_prod + 2U : (unsigned int )cqe_ring_prod + 1U; __ret_warn_on = (int )ring_prod <= i - failure_cnt; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", 4401); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); ldv_62990: i = i + 1; ldv_62994: ; if (i < rx_ring_size) { goto ldv_62993; } else { } if (failure_cnt != 0) { printk("\vbnx2x: [%s:%d(%s)]was only able to allocate %d rx skbs on queue[%d]\n", "bnx2x_alloc_rx_bds", 4406, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i - failure_cnt, (int )fp->index); } else { } fp->rx_bd_prod = ring_prod; __min1 = 4096U; __min2 = cqe_ring_prod; fp->rx_comp_prod = (u16 )((int )__min1 < (int )__min2 ? __min1 : __min2); tmp___1 = 0UL; fp->rx_calls = tmp___1; fp->rx_pkt = tmp___1; (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed = (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats.rx_skb_alloc_failed + (u32 )failure_cnt; return (i - failure_cnt); } } static void bnx2x_set_next_page_rx_cq(struct bnx2x_fastpath *fp ) { int i ; struct eth_rx_cqe_next_page *nextpg ; { i = 1; goto ldv_63006; ldv_63005: nextpg = (struct eth_rx_cqe_next_page *)(fp->rx_comp_ring + ((unsigned long )i * 64UL + 0xffffffffffffffffUL)); nextpg->addr_hi = (unsigned int )((fp->rx_comp_mapping + (unsigned long long )(((unsigned long )i & 63UL) * 4096UL)) >> 32); nextpg->addr_lo = (unsigned int )fp->rx_comp_mapping + ((unsigned int )((unsigned long )i) & 63U) * 4096U; i = i + 1; ldv_63006: ; if ((unsigned int )i <= 64U) { goto ldv_63005; } else { } return; } } static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp , int index ) { union host_hc_status_block *sb ; struct bnx2x_fastpath *fp ; int ring_size ; u8 cos ; int rx_ring_size ; u32 __max1 ; u32 __max2 ; u32 cfg ; unsigned int tmp ; int __max1___0 ; u32 __max1___1 ; u32 __max2___0 ; u32 __max1___2 ; u32 __max2___1 ; u32 tmp___0 ; int __max2___2 ; long tmp___1 ; void *x ; void *tmp___2 ; long tmp___3 ; void *x___0 ; void *tmp___4 ; long tmp___5 ; struct bnx2x_fp_txdata *txdata ; long tmp___6 ; void *tmp___7 ; void *x___1 ; void *tmp___8 ; long tmp___9 ; void *tmp___10 ; void *x___2 ; void *tmp___11 ; long tmp___12 ; void *x___3 ; void *tmp___13 ; long tmp___14 ; void *tmp___15 ; void *x___4 ; void *tmp___16 ; long tmp___17 ; u32 __max1___3 ; u32 __max2___3 ; u32 __max1___4 ; u32 __max2___4 ; u32 tmp___18 ; { fp = bp->fp + (unsigned long )index; ring_size = 0; rx_ring_size = 0; if (bp->rx_ring_size == 0 && ((((unsigned int )bp->mf_mode == 1U && ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U || (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U)) || ((unsigned int )bp->mf_mode == 2U && ((bp->mf_ext_config & 14U) == 4U || (bp->mf_ext_config & 14U) == 8U))) || ((unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U))) { __max1 = 11U; __max2 = (int )bp->dropless_fc ? (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 228U : 128U; rx_ring_size = (int )(__max1 > __max2 ? __max1 : __max2); bp->rx_ring_size = rx_ring_size; } else if (bp->rx_ring_size == 0) { rx_ring_size = (int )(4078UL / (unsigned long )bp->num_queues); if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { tmp = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + (((unsigned long )bp->pfid & 1UL) + 1UL) * 400UL))); cfg = tmp; if ((cfg & 251658240U) == 0U) { rx_ring_size = rx_ring_size / 10; } else { } } else { } if (bp->disable_tpa != 0) { __max1___1 = 11U; __max2___0 = (int )bp->dropless_fc ? (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 228U : 128U; tmp___0 = __max1___1 > __max2___0 ? __max1___1 : __max2___0; } else { __max1___2 = bp->common.chip_id >> 16 == 5710U ? 43U : 75U; __max2___1 = (int )bp->dropless_fc ? (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 228U : 128U; tmp___0 = __max1___2 > __max2___1 ? __max1___2 : __max2___1; } __max1___0 = (int )tmp___0; __max2___2 = rx_ring_size; rx_ring_size = __max1___0 > __max2___2 ? __max1___0 : __max2___2; bp->rx_ring_size = rx_ring_size; } else { rx_ring_size = bp->rx_ring_size; } tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]calculated rx_ring_size %d\n", "bnx2x_alloc_fp_mem_at", 4470, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rx_ring_size); } else { } sb = & (bp->fp + (unsigned long )index)->status_blk; if ((uint )index != (uint )bp->num_queues - bp->num_cnic_queues) { if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { tmp___2 = dma_zalloc_coherent(& (bp->pdev)->dev, 64UL, & (bp->fp + (unsigned long )index)->status_blk_mapping, 208U); x = tmp___2; if ((unsigned long )x != (unsigned long )((void *)0)) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_fp_mem_at", 4479, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->fp + (unsigned long )index)->status_blk_mapping, x); } else { } } else { } sb->e2_sb = (struct host_hc_status_block_e2 *)x; if ((unsigned long )sb->e2_sb == (unsigned long )((struct host_hc_status_block_e2 *)0)) { goto alloc_mem_err; } else { } } else { tmp___4 = dma_zalloc_coherent(& (bp->pdev)->dev, 64UL, & (bp->fp + (unsigned long )index)->status_blk_mapping, 208U); x___0 = tmp___4; if ((unsigned long )x___0 != (unsigned long )((void *)0)) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_fp_mem_at", 4484, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->fp + (unsigned long )index)->status_blk_mapping, x___0); } else { } } else { } sb->e1x_sb = (struct host_hc_status_block_e1x *)x___0; if ((unsigned long )sb->e1x_sb == (unsigned long )((struct host_hc_status_block_e1x *)0)) { goto alloc_mem_err; } else { } } } else { } if ((uint )index != (uint )bp->num_queues - bp->num_cnic_queues) { set_sb_shortcuts(bp, index); } else { } if ((bp->flags & 32768U) == 0U || (uint )index != (uint )bp->num_queues - bp->num_cnic_queues) { cos = 0U; goto ldv_63040; ldv_63039: txdata = fp->txdata_ptr[(int )cos]; tmp___6 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]allocating tx memory of fp %d cos %d\n", "bnx2x_alloc_fp_mem_at", 4504, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", index, (int )cos); } else { } tmp___7 = kcalloc(4096UL, 16UL, 208U); txdata->tx_buf_ring = (struct sw_tx_bd *)tmp___7; if ((unsigned long )txdata->tx_buf_ring == (unsigned long )((struct sw_tx_bd *)0)) { goto alloc_mem_err; } else { } tmp___8 = dma_zalloc_coherent(& (bp->pdev)->dev, 65536UL, & txdata->tx_desc_mapping, 208U); x___1 = tmp___8; if ((unsigned long )x___1 != (unsigned long )((void *)0)) { tmp___9 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_fp_mem_at", 4512, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", txdata->tx_desc_mapping, x___1); } else { } } else { } txdata->tx_desc_ring = (union eth_tx_bd_types *)x___1; if ((unsigned long )txdata->tx_desc_ring == (unsigned long )((union eth_tx_bd_types *)0)) { goto alloc_mem_err; } else { } cos = (u8 )((int )cos + 1); ldv_63040: ; if ((int )fp->max_cos > (int )cos) { goto ldv_63039; } else { } } else { } if ((bp->flags & 32768U) == 0U || (uint )index != (uint )bp->num_queues - bp->num_cnic_queues) { tmp___10 = kcalloc(4096UL, 16UL, 208U); (bp->fp + (unsigned long )index)->rx_buf_ring = (struct sw_rx_bd *)tmp___10; if ((unsigned long )(bp->fp + (unsigned long )index)->rx_buf_ring == (unsigned long )((struct sw_rx_bd *)0)) { goto alloc_mem_err; } else { } tmp___11 = dma_zalloc_coherent(& (bp->pdev)->dev, 32768UL, & (bp->fp + (unsigned long )index)->rx_desc_mapping, 208U); x___2 = tmp___11; if ((unsigned long )x___2 != (unsigned long )((void *)0)) { tmp___12 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___12 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_fp_mem_at", 4527, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->fp + (unsigned long )index)->rx_desc_mapping, x___2); } else { } } else { } (bp->fp + (unsigned long )index)->rx_desc_ring = (struct eth_rx_bd *)x___2; if ((unsigned long )(bp->fp + (unsigned long )index)->rx_desc_ring == (unsigned long )((struct eth_rx_bd *)0)) { goto alloc_mem_err; } else { } tmp___13 = dma_alloc_attrs(& (bp->pdev)->dev, 262144UL, & (bp->fp + (unsigned long )index)->rx_comp_mapping, 208U, (struct dma_attrs *)0); x___3 = tmp___13; if ((unsigned long )x___3 != (unsigned long )((void *)0)) { memset(x___3, 255, 262144UL); tmp___14 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___14 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_FALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_fp_mem_at", 4534, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->fp + (unsigned long )index)->rx_comp_mapping, x___3); } else { } } else { } (bp->fp + (unsigned long )index)->rx_comp_ring = (union eth_rx_cqe *)x___3; if ((unsigned long )(bp->fp + (unsigned long )index)->rx_comp_ring == (unsigned long )((union eth_rx_cqe *)0)) { goto alloc_mem_err; } else { } tmp___15 = kcalloc(1024UL, 24UL, 208U); (bp->fp + (unsigned long )index)->rx_page_ring = (struct sw_rx_page *)tmp___15; if ((unsigned long )(bp->fp + (unsigned long )index)->rx_page_ring == (unsigned long )((struct sw_rx_page *)0)) { goto alloc_mem_err; } else { } tmp___16 = dma_zalloc_coherent(& (bp->pdev)->dev, 8192UL, & (bp->fp + (unsigned long )index)->rx_sge_mapping, 208U); x___4 = tmp___16; if ((unsigned long )x___4 != (unsigned long )((void *)0)) { tmp___17 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___17 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_alloc_fp_mem_at", 4546, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->fp + (unsigned long )index)->rx_sge_mapping, x___4); } else { } } else { } (bp->fp + (unsigned long )index)->rx_sge_ring = (struct eth_rx_sge *)x___4; if ((unsigned long )(bp->fp + (unsigned long )index)->rx_sge_ring == (unsigned long )((struct eth_rx_sge *)0)) { goto alloc_mem_err; } else { } bnx2x_set_next_page_rx_bd(fp); bnx2x_set_next_page_rx_cq(fp); ring_size = bnx2x_alloc_rx_bds(fp, rx_ring_size); if (ring_size < rx_ring_size) { goto alloc_mem_err; } else { } } else { } return (0); alloc_mem_err: printk("\vbnx2x: [%s:%d(%s)]Unable to allocate full memory for queue %d (size %d)\n", "bnx2x_alloc_fp_mem_at", 4566, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", index, ring_size); if ((unsigned int )fp->mode == 0U) { __max1___3 = 11U; __max2___3 = (int )bp->dropless_fc ? (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 228U : 128U; tmp___18 = __max1___3 > __max2___3 ? __max1___3 : __max2___3; } else { __max1___4 = bp->common.chip_id >> 16 == 5710U ? 43U : 75U; __max2___4 = (int )bp->dropless_fc ? (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 228U : 128U; tmp___18 = __max1___4 > __max2___4 ? __max1___4 : __max2___4; } if ((u32 )ring_size < tmp___18) { bnx2x_free_fp_mem_at(bp, index); return (-12); } else { } return (0); } } static int bnx2x_alloc_fp_mem_cnic(struct bnx2x *bp ) { int tmp ; { if ((bp->flags & 32768U) == 0U) { tmp = bnx2x_alloc_fp_mem_at(bp, (int )((uint )bp->num_queues - bp->num_cnic_queues)); if (tmp != 0) { return (-12); } else { } } else { } return (0); } } static int bnx2x_alloc_fp_mem(struct bnx2x *bp ) { int i ; int tmp ; int tmp___0 ; int delta ; int __ret_warn_on ; long tmp___1 ; { tmp = bnx2x_alloc_fp_mem_at(bp, 0); if (tmp != 0) { return (-12); } else { } i = 1; goto ldv_63063; ldv_63062: tmp___0 = bnx2x_alloc_fp_mem_at(bp, i); if (tmp___0 != 0) { goto ldv_63061; } else { } i = i + 1; ldv_63063: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_63062; } else { } ldv_63061: ; if ((uint )i != bp->num_ethernet_queues) { delta = (int )(bp->num_ethernet_queues - (uint )i); __ret_warn_on = delta < 0; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", 4614); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); bnx2x_shrink_eth_fp(bp, delta); if ((unsigned int )bp->cnic_support != 0U) { bnx2x_move_fp(bp, (int )((uint )bp->num_queues - bp->num_cnic_queues), (int )(((uint )bp->num_queues - bp->num_cnic_queues) - (uint )delta)); } else { } bp->num_ethernet_queues = bp->num_ethernet_queues - (uint )delta; bp->num_queues = (int )(bp->num_ethernet_queues + bp->num_cnic_queues); printk("\vbnx2x: [%s:%d(%s)]Adjusted num of queues from %d to %d\n", "bnx2x_alloc_fp_mem", 4628, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->num_queues + delta, bp->num_queues); } else { } return (0); } } void bnx2x_free_mem_bp(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_63073; ldv_63072: kfree((void const *)(bp->fp + (unsigned long )i)->tpa_info); i = i + 1; ldv_63073: ; if (bp->fp_array_size > i) { goto ldv_63072; } else { } kfree((void const *)bp->fp); kfree((void const *)bp->sp_objs); kfree((void const *)bp->fp_stats); kfree((void const *)bp->bnx2x_txq); kfree((void const *)bp->msix_table); kfree((void const *)bp->ilt); return; } } int bnx2x_alloc_mem_bp(struct bnx2x *bp ) { struct bnx2x_fastpath *fp ; struct msix_entry *tbl ; struct bnx2x_ilt *ilt ; int msix_table_size ; int fp_array_size ; int txq_array_size ; int i ; long tmp ; long tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; long tmp___5 ; void *tmp___6 ; void *tmp___7 ; void *tmp___8 ; { msix_table_size = 0; msix_table_size = (int )bp->igu_sb_cnt; if ((bp->flags & 4194304U) == 0U) { msix_table_size = msix_table_size + 1; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "msix_table_size %d\n", msix_table_size); } else { } fp_array_size = ((int )bp->igu_sb_cnt - (int )bp->cnic_support) + (int )bp->cnic_support; bp->fp_array_size = fp_array_size; tmp___0 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___0 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "fp_array_size %d\n", bp->fp_array_size); } else { } tmp___1 = kcalloc((size_t )bp->fp_array_size, 664UL, 208U); fp = (struct bnx2x_fastpath *)tmp___1; if ((unsigned long )fp == (unsigned long )((struct bnx2x_fastpath *)0)) { goto alloc_err; } else { } i = 0; goto ldv_63087; ldv_63086: tmp___2 = kcalloc(64UL, 40UL, 208U); (fp + (unsigned long )i)->tpa_info = (struct bnx2x_agg_info *)tmp___2; if ((unsigned long )(fp + (unsigned long )i)->tpa_info == (unsigned long )((struct bnx2x_agg_info *)0)) { goto alloc_err; } else { } i = i + 1; ldv_63087: ; if (bp->fp_array_size > i) { goto ldv_63086; } else { } bp->fp = fp; tmp___3 = kcalloc((size_t )bp->fp_array_size, 504UL, 208U); bp->sp_objs = (struct bnx2x_sp_objs *)tmp___3; if ((unsigned long )bp->sp_objs == (unsigned long )((struct bnx2x_sp_objs *)0)) { goto alloc_err; } else { } tmp___4 = kcalloc((size_t )bp->fp_array_size, 512UL, 208U); bp->fp_stats = (struct bnx2x_fp_stats *)tmp___4; if ((unsigned long )bp->fp_stats == (unsigned long )((struct bnx2x_fp_stats *)0)) { goto alloc_err; } else { } txq_array_size = ((int )bp->igu_sb_cnt - (int )bp->cnic_support) * 3 + (int )bp->cnic_support; tmp___5 = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp___5 != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "txq_array_size %d", txq_array_size); } else { } tmp___6 = kcalloc((size_t )txq_array_size, 80UL, 208U); bp->bnx2x_txq = (struct bnx2x_fp_txdata *)tmp___6; if ((unsigned long )bp->bnx2x_txq == (unsigned long )((struct bnx2x_fp_txdata *)0)) { goto alloc_err; } else { } tmp___7 = kcalloc((size_t )msix_table_size, 8UL, 208U); tbl = (struct msix_entry *)tmp___7; if ((unsigned long )tbl == (unsigned long )((struct msix_entry *)0)) { goto alloc_err; } else { } bp->msix_table = tbl; tmp___8 = kzalloc(64UL, 208U); ilt = (struct bnx2x_ilt *)tmp___8; if ((unsigned long )ilt == (unsigned long )((struct bnx2x_ilt *)0)) { goto alloc_err; } else { } bp->ilt = ilt; return (0); alloc_err: bnx2x_free_mem_bp(bp); return (-12); } } int bnx2x_reload_if_running(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; bool tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = netif_running((struct net_device const *)dev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } tmp___2 = ldv__builtin_expect((long )tmp___1, 0L); if (tmp___2 != 0L) { return (0); } else { } bnx2x_nic_unload(bp, 0, 1); tmp___3 = bnx2x_nic_load(bp, 0); return (tmp___3); } } int bnx2x_get_cur_phy_idx(struct bnx2x *bp ) { u32 sel_phy_idx ; u32 tmp ; { sel_phy_idx = 0U; if ((unsigned int )bp->link_params.num_phys <= 1U) { return (0); } else { } if ((unsigned int )bp->link_vars.link_up != 0U) { sel_phy_idx = 1U; if ((bp->link_vars.link_status & 1048576U) != 0U && (bp->link_params.phy[2].supported & 1024U) != 0U) { sel_phy_idx = 2U; } else { } } else { tmp = bnx2x_phy_selection(& bp->link_params); switch (tmp) { case 0U: ; case 1U: ; case 3U: sel_phy_idx = 1U; goto ldv_63100; case 2U: ; case 4U: sel_phy_idx = 2U; goto ldv_63100; } ldv_63100: ; } return ((int )sel_phy_idx); } } int bnx2x_get_link_cfg_idx(struct bnx2x *bp ) { u32 sel_phy_idx ; int tmp ; { tmp = bnx2x_get_cur_phy_idx(bp); sel_phy_idx = (u32 )tmp; if ((bp->link_params.multi_phy_config & 8U) != 0U) { if (sel_phy_idx == 1U) { sel_phy_idx = 2U; } else if (sel_phy_idx == 2U) { sel_phy_idx = 1U; } else { } } else { } return (sel_phy_idx != 0U ? (int )(sel_phy_idx - 1U) : 0); } } int bnx2x_fcoe_get_wwn(struct net_device *dev , u64 *wwn , int type ) { struct bnx2x *bp ; void *tmp ; struct cnic_eth_dev *cp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; cp = & bp->cnic_eth_dev; switch (type) { case 0: *wwn = ((unsigned long long )cp->fcoe_wwn_node_name_hi << 32) + (unsigned long long )cp->fcoe_wwn_node_name_lo; goto ldv_63115; case 1: *wwn = ((unsigned long long )cp->fcoe_wwn_port_name_hi << 32) + (unsigned long long )cp->fcoe_wwn_port_name_lo; goto ldv_63115; default: printk("\vbnx2x: [%s:%d(%s)]Wrong WWN type requested - %d\n", "bnx2x_fcoe_get_wwn", 4799, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", type); return (-22); } ldv_63115: ; return (0); } } int bnx2x_change_mtu(struct net_device *dev , int new_mtu ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___1 = pci_num_vf(bp->pdev); if (tmp___1 != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]VFs are enabled, can not change MTU\n", "bnx2x_change_mtu", 4813, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-1); } else { } if ((unsigned int )bp->recovery_state != 0U) { printk("\vbnx2x: [%s:%d(%s)]Can\'t perform change MTU during parity recovery\n", "bnx2x_change_mtu", 4818, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-11); } else { } if (new_mtu > 9600 || new_mtu + 14 <= 59) { printk("\vbnx2x: [%s:%d(%s)]Can\'t support requested MTU size\n", "bnx2x_change_mtu", 4824, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } dev->mtu = (unsigned int )new_mtu; tmp___2 = bnx2x_reload_if_running(dev); return (tmp___2); } } netdev_features_t bnx2x_fix_features(struct net_device *dev , netdev_features_t features ) { struct bnx2x *bp ; void *tmp ; netdev_features_t changed ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = pci_num_vf(bp->pdev); if (tmp___0 != 0) { changed = dev->features ^ features; if ((features & 17179869184ULL) == 0ULL && bp->disable_tpa == 0) { features = features & 0xfffffffbffffffffULL; features = (dev->features & 17179869184ULL) | features; } else { } if ((changed & 68719476736ULL) != 0ULL) { features = features & 0xffffffefffffffffULL; features = (dev->features & 68719476736ULL) | features; } else { } } else { } if ((features & 17179869184ULL) == 0ULL) { features = features & 0xffffffffffff7fffULL; features = features & 0xffffffffffffbfffULL; } else { } return (features); } } int bnx2x_set_features(struct net_device *dev , netdev_features_t features ) { struct bnx2x *bp ; void *tmp ; netdev_features_t changes ; bool bnx2x_reload ; int rc ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; changes = dev->features ^ features; bnx2x_reload = 0; tmp___0 = pci_num_vf(bp->pdev); if (tmp___0 == 0) { if ((features & 68719476736ULL) != 0ULL) { if ((unsigned int )bp->link_params.loopback_mode != 2U) { bp->link_params.loopback_mode = 2U; bnx2x_reload = 1; } else { } } else if ((unsigned int )bp->link_params.loopback_mode != 0U) { bp->link_params.loopback_mode = 0U; bnx2x_reload = 1; } else { } } else { } if ((changes & 16384ULL) != 0ULL && (features & 32768ULL) != 0ULL) { changes = changes & 0xffffffffffffbfffULL; } else { } if ((changes & 16384ULL) != 0ULL && bp->disable_tpa != 0) { changes = changes & 0xffffffffffffbfffULL; } else { } if (changes != 0ULL) { bnx2x_reload = 1; } else { } if ((int )bnx2x_reload) { if ((unsigned int )bp->recovery_state == 0U) { dev->features = features; rc = bnx2x_reload_if_running(dev); return (rc != 0 ? rc : 1); } else { } } else { } return (0); } } void bnx2x_tx_timeout(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; bnx2x_schedule_sp_rtnl(bp, 1, 0U); return; } } int bnx2x_suspend(struct pci_dev *pdev , pm_message_t state ) { struct net_device *dev ; void *tmp ; struct bnx2x *bp ; void *tmp___0 ; bool tmp___1 ; int tmp___2 ; pci_power_t tmp___3 ; { tmp = pci_get_drvdata(pdev); dev = (struct net_device *)tmp; if ((unsigned long )dev == (unsigned long )((struct net_device *)0)) { dev_err((struct device const *)(& pdev->dev), "BAD net device from bnx2x_init_one\n"); return (-19); } else { } tmp___0 = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp___0; rtnl_lock(); pci_save_state(pdev); tmp___1 = netif_running((struct net_device const *)dev); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { rtnl_unlock(); return (0); } else { } netif_device_detach(dev); bnx2x_nic_unload(bp, 1, 0); tmp___3 = pci_choose_state(pdev, state); bnx2x_set_power_state(bp, tmp___3); rtnl_unlock(); return (0); } } int bnx2x_resume(struct pci_dev *pdev ) { struct net_device *dev ; void *tmp ; struct bnx2x *bp ; int rc ; void *tmp___0 ; bool tmp___1 ; int tmp___2 ; { tmp = pci_get_drvdata(pdev); dev = (struct net_device *)tmp; if ((unsigned long )dev == (unsigned long )((struct net_device *)0)) { dev_err((struct device const *)(& pdev->dev), "BAD net device from bnx2x_init_one\n"); return (-19); } else { } tmp___0 = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp___0; if ((unsigned int )bp->recovery_state != 0U) { printk("\vbnx2x: [%s:%d(%s)]Handling parity error recovery. Try again later\n", "bnx2x_resume", 4970, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-11); } else { } rtnl_lock(); pci_restore_state(pdev); tmp___1 = netif_running((struct net_device const *)dev); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { rtnl_unlock(); return (0); } else { } bnx2x_set_power_state(bp, 0); netif_device_attach(dev); rc = bnx2x_nic_load(bp, 1); rtnl_unlock(); return (rc); } } void bnx2x_set_ctx_validation(struct bnx2x *bp , struct eth_context *cxt , u32 cid ) { u8 tmp ; u8 tmp___0 ; { if ((unsigned long )cxt == (unsigned long )((struct eth_context *)0)) { printk("\vbnx2x: [%s:%d(%s)]bad context pointer %p\n", "bnx2x_set_ctx_validation", 4997, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cxt); return; } else { } tmp = calc_crc8((((u32 )((((int )bp->pfid & 1) << 23) | (((int )bp->pfid >> 1) << 17)) | cid) << 8) | 64U, 255); cxt->ustorm_ag_context.cdu_usage = (unsigned int )tmp | 128U; tmp___0 = calc_crc8((((u32 )((((int )bp->pfid & 1) << 23) | (((int )bp->pfid >> 1) << 17)) | cid) << 8) | 32U, 255); cxt->xstorm_ag_context.cdu_reserved = (unsigned int )tmp___0 | 128U; return; } } static void storm_memset_hc_timeout(struct bnx2x *bp , u8 port , u8 fw_sb_id , u8 sb_index , u8 ticks ) { u32 addr ; long tmp ; { addr = ((unsigned int )(bp->iro_arr + 139UL)->base + ((unsigned int )((int )sb_index * (int )(bp->iro_arr + 139UL)->m2) + (unsigned int )((int )fw_sb_id * (int )(bp->iro_arr + 139UL)->m1))) + 4259840U; writeb((int )ticks, (void volatile *)bp->regview + (unsigned long )addr); tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x fw_sb_id %d sb_index %d ticks %d\n", "storm_memset_hc_timeout", 5020, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port, (int )fw_sb_id, (int )sb_index, (int )ticks); } else { } return; } } static void storm_memset_hc_disable(struct bnx2x *bp , u8 port , u16 fw_sb_id , u8 sb_index , u8 disable ) { u32 enable_flag ; u32 addr ; u8 flags ; unsigned char tmp ; long tmp___0 ; { enable_flag = (unsigned int )disable != 0U ? 0U : 2U; addr = ((unsigned int )(bp->iro_arr + 140UL)->base + ((unsigned int )((int )sb_index * (int )(bp->iro_arr + 140UL)->m2) + (unsigned int )((int )fw_sb_id * (int )(bp->iro_arr + 140UL)->m1))) + 4259840U; tmp = readb((void const volatile *)bp->regview + (unsigned long )addr); flags = tmp; flags = (unsigned int )flags & 253U; flags = (int )((u8 )enable_flag) | (int )flags; writeb((int )flags, (void volatile *)bp->regview + (unsigned long )addr); tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]port %x fw_sb_id %d sb_index %d disable %d\n", "storm_memset_hc_disable", 5037, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )port, (int )fw_sb_id, (int )sb_index, (int )disable); } else { } return; } } void bnx2x_update_coalesce_sb_index(struct bnx2x *bp , u8 fw_sb_id , u8 sb_index , u8 disable , u16 usec ) { int port ; u8 ticks ; { port = (int )bp->pfid & 1; ticks = (u8 )((unsigned int )usec / 4U); storm_memset_hc_timeout(bp, (int )((u8 )port), (int )fw_sb_id, (int )sb_index, (int )ticks); disable = (u8 )((unsigned int )disable != 0U || (unsigned int )usec == 0U); storm_memset_hc_disable(bp, (int )((u8 )port), (int )fw_sb_id, (int )sb_index, (int )disable); return; } } void bnx2x_schedule_sp_rtnl(struct bnx2x *bp , enum sp_rtnl_flag flag , u32 verbose ) { long tmp ; { __asm__ volatile ("": : : "memory"); set_bit((long )flag, (unsigned long volatile *)(& bp->sp_rtnl_state)); __asm__ volatile ("": : : "memory"); tmp = ldv__builtin_expect(((u32 )bp->msg_enable & (verbose | 1048576U)) != 0U, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Scheduling sp_rtnl task [Flag: %d]\n", "bnx2x_schedule_sp_rtnl", 5059, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )flag); } else { } schedule_delayed_work___0(& bp->sp_rtnl_task, 0UL); return; } } static char const __kstrtab_bnx2x_schedule_sp_rtnl[23U] = { 'b', 'n', 'x', '2', 'x', '_', 's', 'c', 'h', 'e', 'd', 'u', 'l', 'e', '_', 's', 'p', '_', 'r', 't', 'n', 'l', '\000'}; struct kernel_symbol const __ksymtab_bnx2x_schedule_sp_rtnl ; struct kernel_symbol const __ksymtab_bnx2x_schedule_sp_rtnl = {(unsigned long )(& bnx2x_schedule_sp_rtnl), (char const *)(& __kstrtab_bnx2x_schedule_sp_rtnl)}; int ldv_irq_3(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 = bnx2x_interrupt(line, data); LDV_IN_INTERRUPT = 1; return (state); } else { } goto ldv_63213; default: ldv_stop(); } ldv_63213: ; } else { } return (state); } } void disable_suitable_irq_2(int line , void *data ) { { if (ldv_irq_2_0 != 0 && line == ldv_irq_line_2_0) { ldv_irq_2_0 = 0; return; } else { } if (ldv_irq_2_1 != 0 && line == ldv_irq_line_2_1) { ldv_irq_2_1 = 0; return; } else { } if (ldv_irq_2_2 != 0 && line == ldv_irq_line_2_2) { ldv_irq_2_2 = 0; return; } else { } if (ldv_irq_2_3 != 0 && line == ldv_irq_line_2_3) { ldv_irq_2_3 = 0; return; } else { } return; } } void activate_suitable_irq_3(int line , void *data ) { { if (ldv_irq_3_0 == 0) { ldv_irq_line_3_0 = line; ldv_irq_data_3_0 = data; ldv_irq_3_0 = 1; return; } else { } if (ldv_irq_3_1 == 0) { ldv_irq_line_3_1 = line; ldv_irq_data_3_1 = data; ldv_irq_3_1 = 1; return; } else { } if (ldv_irq_3_2 == 0) { ldv_irq_line_3_2 = line; ldv_irq_data_3_2 = data; ldv_irq_3_2 = 1; return; } else { } if (ldv_irq_3_3 == 0) { ldv_irq_line_3_3 = line; ldv_irq_data_3_3 = data; ldv_irq_3_3 = 1; return; } else { } return; } } int reg_check_1(irqreturn_t (*handler)(int , void * ) ) { { if ((unsigned long )handler == (unsigned long )(& bnx2x_msix_sp_int)) { return (1); } else { } return (0); } } void disable_suitable_irq_1(int line , void *data ) { { if (ldv_irq_1_0 != 0 && line == ldv_irq_line_1_0) { ldv_irq_1_0 = 0; return; } else { } if (ldv_irq_1_1 != 0 && line == ldv_irq_line_1_1) { ldv_irq_1_1 = 0; return; } else { } if (ldv_irq_1_2 != 0 && line == ldv_irq_line_1_2) { ldv_irq_1_2 = 0; return; } else { } if (ldv_irq_1_3 != 0 && line == ldv_irq_line_1_3) { ldv_irq_1_3 = 0; return; } else { } return; } } void activate_suitable_irq_1(int line , void *data ) { { if (ldv_irq_1_0 == 0) { ldv_irq_line_1_0 = line; ldv_irq_data_1_0 = data; ldv_irq_1_0 = 1; return; } else { } if (ldv_irq_1_1 == 0) { ldv_irq_line_1_1 = line; ldv_irq_data_1_1 = data; ldv_irq_1_1 = 1; return; } else { } if (ldv_irq_1_2 == 0) { ldv_irq_line_1_2 = line; ldv_irq_data_1_2 = data; ldv_irq_1_2 = 1; return; } else { } if (ldv_irq_1_3 == 0) { ldv_irq_line_1_3 = line; ldv_irq_data_1_3 = data; ldv_irq_1_3 = 1; return; } else { } return; } } int ldv_irq_2(int state , int line , void *data ) { irqreturn_t irq_retval ; int tmp ; int tmp___0 ; { tmp = __VERIFIER_nondet_int(); irq_retval = (irqreturn_t )tmp; if (state != 0) { tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (state == 1) { LDV_IN_INTERRUPT = 2; irq_retval = bnx2x_msix_fp_int(line, data); LDV_IN_INTERRUPT = 1; return (state); } else { } goto ldv_63243; default: ldv_stop(); } ldv_63243: ; } else { } return (state); } } void choose_interrupt_2(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_irq_2_0 = ldv_irq_2(ldv_irq_2_0, ldv_irq_line_2_0, ldv_irq_data_2_0); goto ldv_63249; case 1: ldv_irq_2_0 = ldv_irq_2(ldv_irq_2_1, ldv_irq_line_2_1, ldv_irq_data_2_1); goto ldv_63249; case 2: ldv_irq_2_0 = ldv_irq_2(ldv_irq_2_2, ldv_irq_line_2_2, ldv_irq_data_2_2); goto ldv_63249; case 3: ldv_irq_2_0 = ldv_irq_2(ldv_irq_2_3, ldv_irq_line_2_3, ldv_irq_data_2_3); goto ldv_63249; default: ldv_stop(); } ldv_63249: ; return; } } void activate_suitable_irq_2(int line , void *data ) { { if (ldv_irq_2_0 == 0) { ldv_irq_line_2_0 = line; ldv_irq_data_2_0 = data; ldv_irq_2_0 = 1; return; } else { } if (ldv_irq_2_1 == 0) { ldv_irq_line_2_1 = line; ldv_irq_data_2_1 = data; ldv_irq_2_1 = 1; return; } else { } if (ldv_irq_2_2 == 0) { ldv_irq_line_2_2 = line; ldv_irq_data_2_2 = data; ldv_irq_2_2 = 1; return; } else { } if (ldv_irq_2_3 == 0) { ldv_irq_line_2_3 = line; ldv_irq_data_2_3 = data; ldv_irq_2_3 = 1; return; } else { } return; } } void 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_63262; 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_63262; 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_63262; 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_63262; default: ldv_stop(); } ldv_63262: ; return; } } int reg_check_2(irqreturn_t (*handler)(int , void * ) ) { { if ((unsigned long )handler == (unsigned long )(& bnx2x_msix_fp_int)) { return (1); } else { } return (0); } } void disable_suitable_irq_3(int line , void *data ) { { if (ldv_irq_3_0 != 0 && line == ldv_irq_line_3_0) { ldv_irq_3_0 = 0; return; } else { } if (ldv_irq_3_1 != 0 && line == ldv_irq_line_3_1) { ldv_irq_3_1 = 0; return; } else { } if (ldv_irq_3_2 != 0 && line == ldv_irq_line_3_2) { ldv_irq_3_2 = 0; return; } else { } if (ldv_irq_3_3 != 0 && line == ldv_irq_line_3_3) { ldv_irq_3_3 = 0; return; } else { } return; } } int reg_check_3(irqreturn_t (*handler)(int , void * ) ) { { if ((unsigned long )handler == (unsigned long )(& bnx2x_interrupt)) { return (1); } else { } return (0); } } 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 = bnx2x_msix_sp_int(line, data); LDV_IN_INTERRUPT = 1; return (state); } else { } goto ldv_63288; default: ldv_stop(); } ldv_63288: ; } else { } return (state); } } void choose_interrupt_3(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_irq_3_0 = ldv_irq_3(ldv_irq_3_0, ldv_irq_line_3_0, ldv_irq_data_3_0); goto ldv_63294; case 1: ldv_irq_3_0 = ldv_irq_3(ldv_irq_3_1, ldv_irq_line_3_1, ldv_irq_data_3_1); goto ldv_63294; case 2: ldv_irq_3_0 = ldv_irq_3(ldv_irq_3_2, ldv_irq_line_3_2, ldv_irq_data_3_2); goto ldv_63294; case 3: ldv_irq_3_0 = ldv_irq_3(ldv_irq_3_3, ldv_irq_line_3_3, ldv_irq_data_3_3); goto ldv_63294; default: ldv_stop(); } ldv_63294: ; return; } } bool ldv_queue_work_on_79(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_80(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_81(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_82(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_83(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void ldv_free_irq_84(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { free_irq(ldv_func_arg1, ldv_func_arg2); disable_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg2); return; } } void ldv_free_irq_85(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { free_irq(ldv_func_arg1, ldv_func_arg2); disable_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg2); return; } } void ldv_free_irq_86(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { free_irq(ldv_func_arg1, ldv_func_arg2); disable_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg2); return; } } __inline static int ldv_request_irq_87(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type___13 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = reg_check_2(handler); if (tmp___0 != 0 && ldv_func_res == 0) { activate_suitable_irq_2((int )irq, dev); } else { } return (ldv_func_res); } } __inline static int ldv_request_irq_88(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type___14 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = reg_check_2(handler); if (tmp___0 != 0 && ldv_func_res == 0) { activate_suitable_irq_2((int )irq, dev); } else { } return (ldv_func_res); } } __inline static int ldv_request_irq_89(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = reg_check_2(handler); if (tmp___0 != 0 && ldv_func_res == 0) { activate_suitable_irq_2((int )irq, dev); } else { } return (ldv_func_res); } } int ldv_mod_timer_90(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___15 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_9(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_del_timer_sync_91(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern int sprintf(char * , char const * , ...) ; extern char *strcpy(char * , char const * ) ; bool ldv_queue_work_on_109(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_111(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_110(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_113(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_112(struct workqueue_struct *ldv_func_arg1 ) ; __inline static char const *kobject_name(struct kobject const *kobj ) { { return ((char const *)kobj->name); } } extern bool capable(int ) ; __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 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_31006: ; goto ldv_31006; } 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_sync_single_for_cpu___0(struct device *dev , dma_addr_t addr , size_t size , enum dma_data_direction dir ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int tmp___0 ; long tmp___1 ; { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (108), "i" (12UL)); ldv_31066: ; goto ldv_31066; } else { } if ((unsigned long )ops->sync_single_for_cpu != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction ))0)) { (*(ops->sync_single_for_cpu))(dev, addr, size, dir); } else { } debug_dma_sync_single_for_cpu(dev, addr, size, (int )dir); return; } } extern struct sk_buff *__netdev_alloc_skb(struct net_device * , unsigned int , gfp_t ) ; __inline static struct sk_buff *netdev_alloc_skb(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = __netdev_alloc_skb(dev, length, 32U); return (tmp); } } __inline static void ethtool_cmd_speed_set(struct ethtool_cmd *ep , __u32 speed ) { { ep->speed = (unsigned short )speed; ep->speed_hi = (unsigned short )(speed >> 16); return; } } __inline static __u32 ethtool_cmd_speed(struct ethtool_cmd const *ep ) { { return ((__u32 )(((int )ep->speed_hi << 16) | (int )ep->speed)); } } extern int ethtool_op_get_ts_info(struct net_device * , struct ethtool_ts_info * ) ; __inline static void dql_queued___0(struct dql *dql , unsigned int count ) { long tmp ; { tmp = ldv__builtin_expect(count > 268435455U, 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/dynamic_queue_limits.h"), "i" (74), "i" (12UL)); ldv_34267: ; goto ldv_34267; } else { } dql->last_obj_cnt = count; __asm__ volatile ("": : : "memory"); dql->num_queued = dql->num_queued + count; return; } } __inline static void netdev_tx_sent_queue___0(struct netdev_queue *dev_queue , unsigned int bytes ) { int tmp ; long tmp___0 ; int tmp___1 ; long tmp___2 ; { dql_queued___0(& dev_queue->dql, bytes); tmp = dql_avail((struct dql const *)(& dev_queue->dql)); tmp___0 = ldv__builtin_expect(tmp >= 0, 1L); if (tmp___0 != 0L) { return; } else { } set_bit(1L, (unsigned long volatile *)(& dev_queue->state)); __asm__ volatile ("mfence": : : "memory"); tmp___1 = dql_avail((struct dql const *)(& dev_queue->dql)); tmp___2 = ldv__builtin_expect(tmp___1 >= 0, 0L); if (tmp___2 != 0L) { clear_bit(1L, (unsigned long volatile *)(& dev_queue->state)); } else { } return; } } extern u32 crc32_le(u32 , unsigned char const * , size_t ) ; __inline static char const *pci_name(struct pci_dev const *pdev ) { char const *tmp ; { tmp = dev_name(& pdev->dev); return (tmp); } } extern int ptp_clock_index(struct ptp_clock * ) ; void bnx2x_get_rss_ind_table(struct bnx2x_rss_config_obj *rss_obj , u8 *ind_table ) ; __inline static void bnx2x_update_rx_prod___0(struct bnx2x *bp , struct bnx2x_fastpath *fp , u16 bd_prod , u16 rx_comp_prod , u16 rx_sge_prod ) { struct ustorm_eth_rx_producers rx_prods ; u32 i ; long tmp ; { rx_prods.cqe_prod = 0U; rx_prods.bd_prod = (unsigned short)0; rx_prods.sge_prod = (unsigned short)0; rx_prods.reserved = (unsigned short)0; rx_prods.bd_prod = bd_prod; rx_prods.cqe_prod = rx_comp_prod; rx_prods.sge_prod = rx_sge_prod; __asm__ volatile ("sfence": : : "memory"); i = 0U; goto ldv_51241; ldv_51240: writel(*((u32 *)(& rx_prods) + (unsigned long )i), (void volatile *)bp->regview + (unsigned long )(fp->ustorm_rx_prods_offset + i * 4U)); i = i + 1U; ldv_51241: ; if (i <= 1U) { goto ldv_51240; } else { } __asm__ volatile ("": : : "memory"); tmp = ldv__builtin_expect((bp->msg_enable & 2048) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]queue[%d]: wrote bd_prod %u cqe_prod %u sge_prod %u\n", "bnx2x_update_rx_prod", 527, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp->index, (int )bd_prod, (int )rx_comp_prod, (int )rx_sge_prod); } else { } return; } } static u32 const page_vals_e2[2U] = { 0U, 128U}; static u32 const page_write_regs_e2[1U] = { 328476U}; static struct reg_addr const page_read_regs_e2[1U] = { {360448U, 4608U, 4U, 48U}}; static u32 const page_vals_e3[2U] = { 0U, 128U}; static u32 const page_write_regs_e3[1U] = { 328476U}; static struct reg_addr const page_read_regs_e3[1U] = { {360448U, 4608U, 24U, 48U}}; static struct reg_addr const reg_addrs[1816U] = { {8192U, 1U, 31U, 4095U}, {8196U, 1U, 31U, 8191U}, {8200U, 25U, 31U, 4095U}, {8300U, 1U, 31U, 8191U}, {8304U, 313U, 31U, 4095U}, {10240U, 103U, 31U, 4095U}, {12288U, 287U, 31U, 4095U}, {14336U, 331U, 31U, 4095U}, {34816U, 6U, 31U, 2340U}, {34840U, 1U, 30U, 2340U}, {36864U, 4U, 28U, 2340U}, {36880U, 7U, 28U, 4095U}, {36908U, 1U, 28U, 2340U}, {36912U, 1U, 28U, 4095U}, {36916U, 13U, 28U, 2340U}, {36968U, 16U, 28U, 4095U}, {37032U, 98U, 28U, 2340U}, {37424U, 2U, 28U, 4095U}, {37432U, 3U, 28U, 2340U}, {37444U, 1U, 28U, 4095U}, {37448U, 1U, 28U, 2340U}, {37452U, 1U, 4U, 2340U}, {37456U, 16U, 28U, 2340U}, {37544U, 2U, 28U, 8191U}, {37556U, 1U, 28U, 8191U}, {37888U, 33U, 28U, 2340U}, {38020U, 5U, 24U, 2340U}, {40960U, 27U, 31U, 2340U}, {41068U, 1U, 3U, 2340U}, {41072U, 2U, 31U, 2340U}, {41080U, 1U, 31U, 8191U}, {41084U, 31U, 31U, 2340U}, {41208U, 1U, 31U, 8191U}, {41212U, 3U, 31U, 2340U}, {41224U, 1U, 31U, 8191U}, {41228U, 3U, 31U, 2340U}, {41240U, 1U, 31U, 8191U}, {41244U, 28U, 31U, 2340U}, {41356U, 4U, 3U, 2340U}, {41372U, 3U, 31U, 2340U}, {41384U, 1U, 31U, 8191U}, {41388U, 3U, 31U, 2340U}, {41400U, 1U, 31U, 8191U}, {41404U, 54U, 31U, 2340U}, {41620U, 2U, 3U, 2340U}, {41628U, 2U, 31U, 2340U}, {41636U, 2U, 7U, 2340U}, {41644U, 2U, 31U, 2340U}, {41652U, 1U, 31U, 8191U}, {41656U, 49U, 31U, 2340U}, {41868U, 2U, 31U, 8191U}, {41880U, 1U, 31U, 8191U}, {41884U, 7U, 30U, 2340U}, {41912U, 2U, 24U, 2340U}, {41920U, 1U, 30U, 2340U}, {41924U, 1U, 30U, 4095U}, {41928U, 1U, 30U, 2340U}, {41936U, 1U, 30U, 2340U}, {41944U, 1U, 30U, 2340U}, {41952U, 1U, 30U, 2340U}, {41960U, 1U, 30U, 2340U}, {41968U, 1U, 30U, 2340U}, {41976U, 1U, 30U, 2340U}, {41984U, 1U, 31U, 2340U}, {41988U, 1U, 31U, 4095U}, {41992U, 2U, 31U, 8191U}, {42000U, 7U, 31U, 2340U}, {42028U, 12U, 31U, 4095U}, {42076U, 1U, 31U, 2340U}, {42080U, 1U, 31U, 6436U}, {42084U, 15U, 31U, 2340U}, {42144U, 1U, 7U, 2340U}, {42148U, 2U, 31U, 2340U}, {42156U, 2U, 3U, 2340U}, {42164U, 1U, 7U, 2340U}, {42168U, 2U, 3U, 2340U}, {42176U, 3U, 31U, 2340U}, {42188U, 5U, 3U, 2340U}, {42208U, 3U, 31U, 2340U}, {42236U, 2U, 31U, 2340U}, {42244U, 1U, 3U, 2340U}, {42248U, 3U, 31U, 2340U}, {42264U, 1U, 31U, 2340U}, {42272U, 1U, 31U, 2340U}, {42280U, 1U, 31U, 2340U}, {42288U, 1U, 31U, 2340U}, {42296U, 1U, 31U, 2340U}, {42304U, 1U, 31U, 2340U}, {42312U, 1U, 3U, 2340U}, {42320U, 1U, 3U, 2340U}, {42328U, 1U, 3U, 2340U}, {42336U, 1U, 3U, 2340U}, {42344U, 1U, 3U, 2340U}, {42352U, 1U, 31U, 2340U}, {42368U, 1U, 31U, 8191U}, {42384U, 1U, 31U, 8191U}, {42400U, 1U, 7U, 2340U}, {42432U, 1U, 31U, 2340U}, {42464U, 1U, 30U, 2340U}, {42472U, 1U, 30U, 2340U}, {42480U, 1U, 30U, 2340U}, {42488U, 1U, 6U, 2340U}, {42492U, 1U, 30U, 2340U}, {42496U, 5U, 30U, 4095U}, {42516U, 1U, 30U, 2340U}, {42520U, 1U, 30U, 4095U}, {42524U, 1U, 30U, 2340U}, {42528U, 6U, 28U, 2340U}, {42552U, 20U, 4U, 2340U}, {42632U, 35U, 28U, 2340U}, {42772U, 1U, 28U, 4095U}, {42776U, 2U, 28U, 2340U}, {42784U, 1U, 28U, 4095U}, {42788U, 3U, 28U, 2340U}, {42800U, 1U, 4U, 2340U}, {42804U, 2U, 28U, 2340U}, {42812U, 4U, 4U, 2340U}, {42828U, 1U, 28U, 2340U}, {42832U, 1U, 28U, 4095U}, {42836U, 3U, 28U, 2340U}, {42848U, 5U, 4U, 2340U}, {42868U, 7U, 28U, 2340U}, {42896U, 15U, 4U, 2340U}, {42956U, 4U, 28U, 2340U}, {42976U, 6U, 24U, 2340U}, {43008U, 18U, 4U, 2340U}, {43080U, 33U, 28U, 2340U}, {43212U, 2U, 24U, 2340U}, {43220U, 4U, 28U, 2340U}, {43236U, 1U, 24U, 2340U}, {43240U, 1U, 28U, 2340U}, {43248U, 1U, 28U, 2340U}, {43256U, 30U, 24U, 2340U}, {43380U, 73U, 24U, 2340U}, {44080U, 1U, 24U, 2340U}, {44096U, 1U, 24U, 2340U}, {44112U, 1U, 24U, 2340U}, {44128U, 1U, 16U, 2340U}, {65536U, 9U, 31U, 2340U}, {65572U, 1U, 7U, 2340U}, {65576U, 5U, 31U, 2340U}, {65596U, 6U, 7U, 2340U}, {65620U, 20U, 31U, 2340U}, {65700U, 4U, 7U, 2340U}, {65716U, 11U, 31U, 2340U}, {65760U, 4U, 7U, 2340U}, {65776U, 8U, 31U, 2340U}, {65808U, 6U, 7U, 2340U}, {65832U, 110U, 31U, 2340U}, {66272U, 4U, 7U, 2340U}, {66288U, 18U, 31U, 2340U}, {66360U, 20U, 7U, 2340U}, {66440U, 10U, 31U, 2340U}, {66512U, 2U, 3U, 8191U}, {66524U, 1U, 3U, 8191U}, {66560U, 6U, 7U, 2340U}, {66584U, 1U, 31U, 4095U}, {66588U, 1U, 31U, 2340U}, {66592U, 1U, 31U, 4095U}, {66596U, 1U, 31U, 2340U}, {66600U, 1U, 31U, 4095U}, {66604U, 1U, 31U, 2340U}, {66608U, 10U, 7U, 2340U}, {66648U, 2U, 31U, 2340U}, {66656U, 1U, 31U, 4095U}, {66660U, 4U, 31U, 2340U}, {66676U, 1U, 31U, 4095U}, {66680U, 14U, 31U, 2340U}, {66736U, 12U, 7U, 2340U}, {66784U, 1U, 31U, 4095U}, {66792U, 1U, 31U, 2340U}, {66796U, 1U, 31U, 4095U}, {66804U, 1U, 31U, 2340U}, {66808U, 1U, 31U, 4095U}, {66816U, 2U, 31U, 2340U}, {66824U, 1U, 31U, 4095U}, {66828U, 9U, 31U, 2340U}, {66864U, 1U, 31U, 4095U}, {66868U, 1U, 31U, 2340U}, {66872U, 1U, 31U, 4095U}, {66876U, 3U, 31U, 2340U}, {66888U, 1U, 31U, 4095U}, {66892U, 3U, 31U, 2340U}, {66904U, 1U, 31U, 4095U}, {66908U, 123U, 31U, 2340U}, {67408U, 2U, 7U, 2340U}, {67424U, 2U, 7U, 2340U}, {67440U, 2U, 7U, 2340U}, {67456U, 2U, 7U, 2340U}, {67472U, 2U, 31U, 2340U}, {67488U, 2U, 7U, 2340U}, {67504U, 2U, 7U, 2340U}, {67520U, 2U, 7U, 2340U}, {67536U, 2U, 7U, 2340U}, {67552U, 2U, 31U, 2340U}, {67712U, 2U, 31U, 2340U}, {67840U, 2U, 31U, 2340U}, {90112U, 1U, 6U, 2340U}, {90116U, 25U, 30U, 2340U}, {90224U, 8U, 30U, 2340U}, {90256U, 4U, 14U, 2340U}, {90272U, 6U, 30U, 2340U}, {90304U, 7U, 30U, 2340U}, {90332U, 2U, 6U, 2340U}, {90340U, 6U, 30U, 2340U}, {90364U, 4U, 30U, 8191U}, {90380U, 2U, 6U, 2340U}, {90388U, 6U, 30U, 2340U}, {90432U, 48U, 30U, 8191U}, {90628U, 5U, 30U, 2340U}, {98304U, 1U, 30U, 2340U}, {98312U, 1U, 30U, 2340U}, {98320U, 35U, 28U, 2340U}, {98468U, 2U, 28U, 2340U}, {98496U, 9U, 28U, 2340U}, {98532U, 1U, 12U, 2340U}, {98536U, 2U, 28U, 2340U}, {98544U, 1U, 12U, 2340U}, {98548U, 79U, 28U, 2340U}, {98864U, 1U, 12U, 2340U}, {98868U, 2U, 28U, 2340U}, {98876U, 1U, 12U, 2340U}, {98880U, 13U, 28U, 2340U}, {98932U, 1U, 4U, 2340U}, {98936U, 12U, 28U, 2340U}, {98984U, 1U, 28U, 4095U}, {98988U, 3U, 28U, 2340U}, {99000U, 1U, 28U, 4095U}, {99004U, 19U, 28U, 2340U}, {99080U, 1U, 28U, 4095U}, {99084U, 3U, 28U, 2340U}, {99096U, 1U, 28U, 4095U}, {99100U, 7U, 28U, 2340U}, {99128U, 1U, 28U, 4095U}, {99132U, 3U, 28U, 2340U}, {99144U, 1U, 28U, 4095U}, {99148U, 28U, 28U, 2340U}, {99260U, 2U, 28U, 8191U}, {99272U, 3U, 28U, 8191U}, {99288U, 1U, 28U, 8191U}, {99392U, 48U, 28U, 8191U}, {99584U, 15U, 28U, 2340U}, {99696U, 1U, 24U, 4095U}, {99700U, 1U, 24U, 2340U}, {99704U, 1U, 24U, 4095U}, {99708U, 4U, 24U, 2340U}, {99724U, 1U, 24U, 4095U}, {99728U, 1U, 24U, 2340U}, {99732U, 1U, 24U, 4095U}, {99736U, 32U, 24U, 2340U}, {99864U, 5U, 16U, 2340U}, {99884U, 4U, 16U, 4095U}, {99900U, 16U, 16U, 2340U}, {99968U, 44U, 16U, 2340U}, {100168U, 12U, 16U, 2340U}, {100232U, 1U, 16U, 2340U}, {100252U, 6U, 16U, 2340U}, {100292U, 51U, 16U, 2340U}, {100864U, 48U, 16U, 2340U}, {131072U, 24U, 31U, 2340U}, {131168U, 8U, 31U, 2532U}, {131200U, 94U, 31U, 2340U}, {131576U, 1U, 3U, 2340U}, {131580U, 1U, 31U, 2340U}, {131584U, 1U, 3U, 2340U}, {131588U, 1U, 31U, 2340U}, {131592U, 1U, 3U, 2340U}, {131596U, 4U, 31U, 2340U}, {131612U, 11U, 31U, 4095U}, {131656U, 24U, 31U, 2340U}, {131768U, 2U, 31U, 8191U}, {131780U, 1U, 31U, 8191U}, {131784U, 1U, 28U, 2340U}, {131800U, 4U, 28U, 2340U}, {131824U, 1U, 16U, 2340U}, {132096U, 1U, 31U, 2340U}, {132100U, 1U, 31U, 4095U}, {132108U, 2U, 31U, 4095U}, {132116U, 2U, 31U, 2340U}, {132124U, 2U, 31U, 4095U}, {132132U, 2U, 31U, 2340U}, {132140U, 18U, 30U, 2340U}, {132224U, 1U, 31U, 2340U}, {132352U, 1U, 31U, 2340U}, {132608U, 1U, 31U, 2340U}, {163840U, 1U, 31U, 2532U}, {163844U, 255U, 31U, 384U}, {164864U, 1U, 31U, 448U}, {164868U, 255U, 31U, 384U}, {165888U, 1U, 31U, 448U}, {165892U, 255U, 31U, 384U}, {166912U, 1U, 31U, 448U}, {166916U, 255U, 31U, 384U}, {167936U, 1U, 31U, 448U}, {167940U, 255U, 31U, 384U}, {168960U, 1U, 31U, 448U}, {168964U, 255U, 31U, 384U}, {169984U, 1U, 31U, 448U}, {169988U, 255U, 31U, 384U}, {171008U, 1U, 31U, 448U}, {171012U, 255U, 31U, 384U}, {172032U, 1U, 31U, 448U}, {172036U, 255U, 31U, 384U}, {173056U, 1U, 31U, 448U}, {173060U, 255U, 31U, 384U}, {174080U, 1U, 31U, 448U}, {174084U, 255U, 31U, 384U}, {175104U, 1U, 31U, 448U}, {175108U, 255U, 31U, 384U}, {176128U, 1U, 31U, 448U}, {176132U, 255U, 31U, 384U}, {177152U, 1U, 31U, 448U}, {177156U, 255U, 31U, 384U}, {178176U, 1U, 31U, 448U}, {178180U, 255U, 31U, 384U}, {179200U, 1U, 31U, 448U}, {179204U, 255U, 31U, 384U}, {180224U, 1U, 31U, 448U}, {180228U, 255U, 31U, 384U}, {181248U, 1U, 31U, 448U}, {181252U, 255U, 31U, 384U}, {182272U, 1U, 31U, 448U}, {182276U, 255U, 31U, 384U}, {183296U, 1U, 31U, 448U}, {183300U, 255U, 31U, 384U}, {184320U, 1U, 31U, 448U}, {184324U, 255U, 31U, 384U}, {185344U, 1U, 31U, 448U}, {185348U, 255U, 31U, 384U}, {186368U, 1U, 31U, 448U}, {186372U, 255U, 31U, 384U}, {187392U, 1U, 31U, 448U}, {187396U, 255U, 31U, 384U}, {188416U, 1U, 31U, 448U}, {188420U, 255U, 31U, 384U}, {189440U, 1U, 31U, 448U}, {189444U, 255U, 31U, 384U}, {190464U, 1U, 31U, 448U}, {190468U, 255U, 31U, 384U}, {191488U, 1U, 31U, 448U}, {191492U, 255U, 31U, 384U}, {192512U, 1U, 31U, 448U}, {192516U, 255U, 31U, 384U}, {193536U, 1U, 31U, 448U}, {193540U, 255U, 31U, 384U}, {194560U, 1U, 31U, 448U}, {194564U, 255U, 31U, 384U}, {195584U, 1U, 31U, 448U}, {195588U, 255U, 31U, 384U}, {196608U, 1U, 31U, 2532U}, {196612U, 255U, 31U, 384U}, {197632U, 1U, 31U, 448U}, {197636U, 255U, 31U, 384U}, {198656U, 1U, 31U, 448U}, {198660U, 255U, 31U, 384U}, {199680U, 1U, 31U, 448U}, {199684U, 255U, 31U, 384U}, {200704U, 1U, 31U, 448U}, {200708U, 255U, 31U, 384U}, {201728U, 1U, 31U, 448U}, {201732U, 255U, 31U, 384U}, {202752U, 1U, 31U, 448U}, {202756U, 255U, 31U, 384U}, {203776U, 1U, 31U, 448U}, {203780U, 255U, 31U, 384U}, {204800U, 1U, 31U, 448U}, {204804U, 255U, 31U, 384U}, {205824U, 1U, 31U, 448U}, {205828U, 255U, 31U, 384U}, {206848U, 1U, 31U, 448U}, {206852U, 255U, 31U, 384U}, {207872U, 1U, 31U, 448U}, {207876U, 255U, 31U, 384U}, {208896U, 1U, 31U, 448U}, {208900U, 255U, 31U, 384U}, {209920U, 1U, 31U, 448U}, {209924U, 255U, 31U, 384U}, {210944U, 1U, 31U, 448U}, {210948U, 255U, 31U, 384U}, {211968U, 1U, 31U, 448U}, {211972U, 255U, 31U, 384U}, {212992U, 1U, 31U, 448U}, {212996U, 255U, 31U, 384U}, {214016U, 1U, 31U, 448U}, {214020U, 255U, 31U, 384U}, {215040U, 1U, 31U, 448U}, {215044U, 255U, 31U, 384U}, {216064U, 1U, 31U, 448U}, {216068U, 255U, 31U, 384U}, {217088U, 1U, 31U, 448U}, {217092U, 255U, 31U, 384U}, {218112U, 1U, 31U, 448U}, {218116U, 255U, 31U, 384U}, {219136U, 1U, 31U, 448U}, {219140U, 255U, 31U, 384U}, {220160U, 1U, 31U, 448U}, {220164U, 255U, 31U, 384U}, {221184U, 1U, 31U, 448U}, {221188U, 255U, 31U, 384U}, {222208U, 1U, 31U, 448U}, {222212U, 255U, 31U, 384U}, {223232U, 1U, 31U, 448U}, {223236U, 255U, 31U, 384U}, {224256U, 1U, 31U, 448U}, {224260U, 255U, 31U, 384U}, {225280U, 1U, 31U, 448U}, {225284U, 255U, 31U, 384U}, {226304U, 1U, 31U, 448U}, {226308U, 255U, 31U, 384U}, {227328U, 1U, 31U, 448U}, {227332U, 255U, 31U, 384U}, {228352U, 1U, 31U, 448U}, {228356U, 255U, 31U, 384U}, {229376U, 1U, 31U, 448U}, {229380U, 255U, 31U, 384U}, {230400U, 1U, 31U, 448U}, {230404U, 255U, 31U, 384U}, {231424U, 1U, 31U, 448U}, {231428U, 255U, 31U, 384U}, {232448U, 1U, 31U, 448U}, {232452U, 255U, 31U, 384U}, {233472U, 1U, 31U, 448U}, {233476U, 255U, 31U, 384U}, {234496U, 1U, 31U, 448U}, {234500U, 255U, 31U, 384U}, {235520U, 1U, 31U, 448U}, {235524U, 255U, 31U, 384U}, {236544U, 1U, 31U, 448U}, {236548U, 255U, 31U, 384U}, {237568U, 1U, 31U, 448U}, {237572U, 255U, 31U, 384U}, {238592U, 1U, 31U, 448U}, {238596U, 255U, 31U, 384U}, {239616U, 1U, 31U, 448U}, {239620U, 255U, 31U, 384U}, {240640U, 1U, 31U, 448U}, {240644U, 255U, 31U, 384U}, {241664U, 1U, 31U, 448U}, {241668U, 255U, 31U, 384U}, {242688U, 1U, 31U, 448U}, {242692U, 255U, 31U, 384U}, {243712U, 1U, 31U, 448U}, {243716U, 255U, 31U, 384U}, {244736U, 1U, 31U, 448U}, {244740U, 255U, 31U, 384U}, {245760U, 1U, 31U, 448U}, {245764U, 255U, 31U, 384U}, {246784U, 1U, 31U, 448U}, {246788U, 255U, 31U, 384U}, {247808U, 1U, 31U, 448U}, {247812U, 255U, 31U, 384U}, {248832U, 1U, 31U, 448U}, {248836U, 255U, 31U, 384U}, {249856U, 1U, 31U, 448U}, {249860U, 255U, 31U, 384U}, {250880U, 1U, 31U, 448U}, {250884U, 255U, 31U, 384U}, {251904U, 1U, 31U, 448U}, {251908U, 255U, 31U, 384U}, {252928U, 1U, 31U, 448U}, {252932U, 255U, 31U, 384U}, {253952U, 1U, 31U, 448U}, {253956U, 255U, 31U, 384U}, {254976U, 1U, 31U, 448U}, {254980U, 255U, 31U, 384U}, {256000U, 1U, 31U, 448U}, {256004U, 255U, 31U, 384U}, {257024U, 1U, 31U, 448U}, {257028U, 255U, 31U, 384U}, {258048U, 1U, 31U, 448U}, {258052U, 255U, 31U, 384U}, {259072U, 1U, 31U, 448U}, {259076U, 255U, 31U, 384U}, {260096U, 1U, 31U, 448U}, {260100U, 255U, 31U, 384U}, {261120U, 1U, 31U, 448U}, {261124U, 255U, 31U, 384U}, {262144U, 85U, 31U, 2340U}, {262484U, 13U, 31U, 4095U}, {262552U, 2U, 31U, 8191U}, {262564U, 1U, 31U, 8191U}, {262568U, 8U, 30U, 2340U}, {262600U, 1U, 2U, 2340U}, {262604U, 2U, 30U, 2340U}, {262612U, 2U, 28U, 2340U}, {262656U, 4U, 31U, 2340U}, {262688U, 6U, 28U, 2340U}, {262712U, 8U, 12U, 2340U}, {262744U, 4U, 28U, 2340U}, {262760U, 2U, 24U, 2340U}, {262768U, 17U, 16U, 2340U}, {263168U, 43U, 31U, 2340U}, {263356U, 2U, 31U, 8191U}, {263368U, 1U, 31U, 8191U}, {263372U, 3U, 30U, 2340U}, {263392U, 1U, 28U, 2340U}, {263424U, 2U, 31U, 2340U}, {263440U, 2U, 31U, 2340U}, {263456U, 2U, 31U, 2340U}, {263472U, 2U, 31U, 2340U}, {263488U, 2U, 31U, 2340U}, {263504U, 10U, 28U, 2340U}, {263696U, 2U, 28U, 2340U}, {270336U, 164U, 31U, 2340U}, {271024U, 2U, 31U, 8191U}, {271036U, 1U, 31U, 8191U}, {271040U, 4U, 28U, 2340U}, {271060U, 5U, 30U, 2340U}, {271080U, 1U, 28U, 2340U}, {271360U, 49U, 31U, 2340U}, {271560U, 32U, 31U, 2340U}, {271688U, 1U, 31U, 4095U}, {271692U, 1U, 31U, 2340U}, {271696U, 1U, 31U, 4095U}, {271700U, 1U, 31U, 2340U}, {271704U, 1U, 31U, 4095U}, {271708U, 1U, 31U, 2340U}, {271720U, 2U, 31U, 2340U}, {271936U, 5U, 28U, 2340U}, {272384U, 1U, 31U, 2340U}, {327680U, 1U, 31U, 8191U}, {327684U, 19U, 31U, 2340U}, {327760U, 8U, 31U, 2364U}, {327792U, 60U, 31U, 2340U}, {328032U, 8U, 31U, 4095U}, {328064U, 20U, 31U, 2340U}, {328160U, 2U, 31U, 8191U}, {328172U, 1U, 31U, 8191U}, {328176U, 4U, 30U, 2340U}, {328192U, 1U, 31U, 2340U}, {328196U, 1U, 31U, 4095U}, {328204U, 2U, 31U, 4095U}, {328212U, 2U, 31U, 2340U}, {328220U, 1U, 31U, 4095U}, {328224U, 2U, 31U, 2340U}, {328232U, 6U, 30U, 2340U}, {328256U, 1U, 31U, 2340U}, {328320U, 1U, 31U, 2340U}, {328448U, 1U, 28U, 2340U}, {328460U, 1U, 28U, 2340U}, {328472U, 1U, 28U, 2356U}, {328476U, 1U, 28U, 2340U}, {328480U, 2U, 28U, 2356U}, {328496U, 1U, 16U, 2340U}, {335872U, 1U, 31U, 2340U}, {344064U, 1U, 31U, 2364U}, {344068U, 255U, 31U, 48U}, {345088U, 1U, 31U, 56U}, {345092U, 255U, 31U, 48U}, {346112U, 1U, 31U, 56U}, {346116U, 255U, 31U, 48U}, {347136U, 1U, 31U, 56U}, {347140U, 255U, 31U, 48U}, {348160U, 1U, 31U, 56U}, {348164U, 255U, 31U, 48U}, {349184U, 1U, 31U, 56U}, {349188U, 255U, 31U, 48U}, {350208U, 1U, 31U, 56U}, {350212U, 255U, 31U, 48U}, {351232U, 1U, 31U, 56U}, {351236U, 255U, 31U, 48U}, {352256U, 1U, 31U, 56U}, {352260U, 255U, 31U, 48U}, {353280U, 1U, 31U, 56U}, {353284U, 255U, 31U, 48U}, {354304U, 1U, 31U, 56U}, {354308U, 255U, 31U, 48U}, {355328U, 1U, 31U, 56U}, {355332U, 255U, 31U, 48U}, {356352U, 1U, 31U, 56U}, {356356U, 255U, 31U, 48U}, {360448U, 1U, 31U, 2356U}, {360452U, 8191U, 3U, 48U}, {393216U, 26U, 31U, 2340U}, {393320U, 8U, 3U, 2340U}, {393352U, 2U, 31U, 2340U}, {393360U, 1U, 31U, 4095U}, {393364U, 9U, 31U, 2340U}, {393400U, 9U, 3U, 2340U}, {393436U, 1U, 31U, 2340U}, {393440U, 5U, 3U, 2340U}, {393460U, 1U, 7U, 2340U}, {393464U, 1U, 3U, 2340U}, {393468U, 8U, 31U, 2340U}, {393516U, 2U, 31U, 8191U}, {393528U, 1U, 31U, 8191U}, {393532U, 24U, 2U, 2340U}, {393628U, 2U, 28U, 2340U}, {393644U, 18U, 28U, 2340U}, {393728U, 1U, 31U, 2925U}, {393732U, 2U, 31U, 585U}, {393744U, 13U, 28U, 2340U}, {393796U, 16U, 16U, 2340U}, {397312U, 1U, 31U, 2925U}, {397316U, 511U, 31U, 585U}, {399360U, 512U, 24U, 585U}, {458752U, 8U, 31U, 2925U}, {458784U, 8184U, 31U, 585U}, {491520U, 8192U, 24U, 585U}, {544768U, 3U, 31U, 4096U}, {544796U, 7U, 31U, 4096U}, {544840U, 1U, 31U, 4096U}, {545280U, 32U, 31U, 4096U}, {655360U, 16384U, 3U, 4096U}, {720896U, 16384U, 2U, 4096U}, {790528U, 7U, 31U, 2340U}, {790572U, 2U, 31U, 8191U}, {790584U, 1U, 31U, 8191U}, {790588U, 2U, 28U, 2340U}, {792576U, 2U, 31U, 2340U}, {794624U, 164U, 31U, 2340U}, {795312U, 2U, 31U, 8191U}, {795324U, 1U, 31U, 8191U}, {795328U, 5U, 28U, 2340U}, {795352U, 4U, 28U, 2340U}, {795648U, 49U, 31U, 2340U}, {795848U, 32U, 31U, 2340U}, {795976U, 1U, 31U, 4095U}, {795980U, 1U, 31U, 2340U}, {795984U, 1U, 31U, 4095U}, {795988U, 1U, 31U, 2340U}, {795992U, 1U, 31U, 4095U}, {795996U, 1U, 31U, 2340U}, {796008U, 2U, 31U, 2340U}, {796160U, 1U, 31U, 2340U}, {802816U, 165U, 31U, 2340U}, {803508U, 2U, 31U, 8191U}, {803520U, 1U, 31U, 8191U}, {803544U, 2U, 28U, 2340U}, {803552U, 7U, 30U, 2340U}, {803580U, 1U, 28U, 2340U}, {803840U, 51U, 31U, 2340U}, {804048U, 32U, 31U, 2340U}, {804176U, 1U, 31U, 4095U}, {804180U, 1U, 31U, 2340U}, {804184U, 1U, 31U, 4095U}, {804188U, 1U, 31U, 2340U}, {804192U, 1U, 31U, 4095U}, {804196U, 1U, 31U, 2340U}, {804208U, 2U, 31U, 2340U}, {804216U, 5U, 28U, 2340U}, {804352U, 1U, 31U, 2340U}, {851968U, 19U, 31U, 2340U}, {852044U, 8U, 31U, 6439U}, {852076U, 64U, 31U, 2340U}, {852332U, 8U, 31U, 4095U}, {852364U, 19U, 31U, 2340U}, {852456U, 2U, 31U, 8191U}, {852468U, 1U, 31U, 8191U}, {852476U, 1U, 28U, 2340U}, {852480U, 1U, 31U, 2340U}, {852484U, 1U, 31U, 4095U}, {852492U, 3U, 31U, 4095U}, {852504U, 4U, 31U, 2340U}, {852520U, 18U, 30U, 2340U}, {852608U, 1U, 31U, 2340U}, {852736U, 1U, 31U, 2340U}, {852992U, 1U, 31U, 2340U}, {854040U, 1U, 16U, 2340U}, {868352U, 1U, 31U, 6439U}, {868356U, 255U, 31U, 6U}, {869376U, 1U, 31U, 4103U}, {869380U, 255U, 31U, 6U}, {870400U, 1U, 31U, 4103U}, {870404U, 255U, 31U, 6U}, {871424U, 1U, 31U, 4103U}, {871428U, 255U, 31U, 6U}, {872448U, 1U, 31U, 4103U}, {872452U, 255U, 31U, 6U}, {873472U, 1U, 31U, 4103U}, {873476U, 255U, 31U, 6U}, {874496U, 1U, 31U, 4103U}, {874500U, 255U, 31U, 6U}, {875520U, 1U, 31U, 4103U}, {875524U, 255U, 31U, 6U}, {876544U, 1U, 31U, 4103U}, {876548U, 255U, 31U, 6U}, {877568U, 1U, 31U, 4103U}, {877572U, 255U, 31U, 6U}, {884736U, 1U, 31U, 6439U}, {884740U, 255U, 31U, 6U}, {885760U, 1U, 31U, 4103U}, {885764U, 255U, 31U, 6U}, {886784U, 1U, 31U, 4103U}, {886788U, 255U, 31U, 6U}, {887808U, 1U, 31U, 4103U}, {887812U, 255U, 31U, 6U}, {888832U, 1U, 31U, 4103U}, {888836U, 255U, 31U, 6U}, {889856U, 1U, 31U, 4103U}, {889860U, 255U, 31U, 6U}, {890880U, 1U, 31U, 4103U}, {890884U, 255U, 31U, 6U}, {891904U, 1U, 31U, 4103U}, {891908U, 255U, 31U, 6U}, {892928U, 1U, 31U, 4103U}, {892932U, 255U, 31U, 6U}, {893952U, 1U, 31U, 4103U}, {893956U, 255U, 31U, 6U}, {894976U, 1U, 31U, 4103U}, {894980U, 255U, 31U, 6U}, {896000U, 1U, 31U, 4103U}, {896004U, 255U, 31U, 6U}, {897024U, 1U, 31U, 4103U}, {897028U, 255U, 31U, 6U}, {898048U, 1U, 31U, 4103U}, {898052U, 255U, 31U, 6U}, {899072U, 1U, 31U, 4103U}, {899076U, 255U, 31U, 6U}, {900096U, 1U, 31U, 4103U}, {900100U, 255U, 31U, 6U}, {901120U, 1U, 31U, 4103U}, {901124U, 255U, 31U, 6U}, {902144U, 1U, 31U, 4103U}, {902148U, 255U, 31U, 6U}, {903168U, 1U, 31U, 4103U}, {903172U, 255U, 31U, 6U}, {904192U, 1U, 31U, 4103U}, {904196U, 255U, 31U, 6U}, {905216U, 1U, 31U, 4103U}, {905220U, 255U, 31U, 6U}, {906240U, 1U, 31U, 4103U}, {906244U, 255U, 31U, 6U}, {907264U, 1U, 31U, 4103U}, {907268U, 255U, 31U, 6U}, {908288U, 1U, 31U, 4103U}, {908292U, 255U, 31U, 6U}, {909312U, 1U, 31U, 4103U}, {909316U, 255U, 31U, 6U}, {910336U, 1U, 31U, 4103U}, {910340U, 255U, 31U, 6U}, {911360U, 1U, 31U, 4103U}, {911364U, 255U, 31U, 6U}, {912384U, 1U, 31U, 4103U}, {912388U, 255U, 31U, 6U}, {913408U, 1U, 31U, 4103U}, {913412U, 255U, 31U, 6U}, {914432U, 1U, 31U, 4103U}, {914436U, 255U, 31U, 6U}, {915456U, 1U, 31U, 4103U}, {915460U, 255U, 31U, 6U}, {916480U, 1U, 31U, 4103U}, {916484U, 255U, 31U, 6U}, {917504U, 21U, 31U, 2340U}, {917588U, 8U, 31U, 3876U}, {917620U, 49U, 31U, 2340U}, {917816U, 1U, 3U, 2340U}, {917820U, 6U, 31U, 2340U}, {917844U, 8U, 31U, 4095U}, {917876U, 21U, 31U, 2340U}, {917976U, 2U, 31U, 8191U}, {917988U, 1U, 31U, 8191U}, {918004U, 1U, 4U, 2340U}, {918008U, 1U, 28U, 2340U}, {918016U, 1U, 31U, 2340U}, {918020U, 1U, 31U, 4095U}, {918028U, 2U, 31U, 4095U}, {918036U, 2U, 31U, 2340U}, {918044U, 2U, 31U, 4095U}, {918052U, 2U, 31U, 2340U}, {918060U, 18U, 30U, 2340U}, {918144U, 1U, 31U, 2340U}, {918272U, 1U, 31U, 2340U}, {918528U, 1U, 16U, 2340U}, {921600U, 1U, 31U, 2340U}, {925696U, 1U, 31U, 3876U}, {925700U, 255U, 31U, 3072U}, {926720U, 1U, 31U, 3584U}, {926724U, 255U, 31U, 3072U}, {927744U, 1U, 31U, 3584U}, {927748U, 255U, 31U, 3072U}, {928768U, 1U, 31U, 3584U}, {928772U, 255U, 31U, 3072U}, {929792U, 1U, 31U, 3584U}, {929796U, 255U, 31U, 3072U}, {930816U, 1U, 31U, 3584U}, {930820U, 255U, 31U, 3072U}, {931840U, 1U, 31U, 3584U}, {931844U, 255U, 31U, 3072U}, {932864U, 1U, 31U, 3584U}, {932868U, 255U, 31U, 3072U}, {983040U, 1U, 31U, 3876U}, {983044U, 255U, 31U, 3072U}, {984064U, 1U, 31U, 3584U}, {984068U, 255U, 31U, 3072U}, {985088U, 1U, 31U, 3584U}, {985092U, 255U, 31U, 3072U}, {986112U, 1U, 31U, 3584U}, {986116U, 255U, 31U, 3072U}, {987136U, 1U, 31U, 3584U}, {987140U, 255U, 31U, 3072U}, {988160U, 1U, 31U, 3584U}, {988164U, 255U, 31U, 3072U}, {989184U, 1U, 31U, 3584U}, {989188U, 255U, 31U, 3072U}, {990208U, 1U, 31U, 3584U}, {990212U, 255U, 31U, 3072U}, {991232U, 1U, 31U, 3584U}, {991236U, 255U, 31U, 3072U}, {992256U, 1U, 31U, 3584U}, {992260U, 255U, 31U, 3072U}, {993280U, 1U, 31U, 3584U}, {993284U, 255U, 31U, 3072U}, {994304U, 1U, 31U, 3584U}, {994308U, 255U, 31U, 3072U}, {995328U, 1U, 31U, 3584U}, {995332U, 255U, 31U, 3072U}, {996352U, 1U, 31U, 3584U}, {996356U, 255U, 31U, 3072U}, {997376U, 1U, 31U, 3584U}, {997380U, 255U, 31U, 3072U}, {998400U, 1U, 31U, 3584U}, {998404U, 255U, 31U, 3072U}, {999424U, 1U, 31U, 3584U}, {999428U, 255U, 31U, 3072U}, {1000448U, 1U, 31U, 3584U}, {1000452U, 255U, 31U, 3072U}, {1001472U, 1U, 31U, 3584U}, {1001476U, 255U, 31U, 3072U}, {1002496U, 1U, 31U, 3584U}, {1002500U, 255U, 31U, 3072U}, {1003520U, 1U, 31U, 3584U}, {1003524U, 255U, 31U, 3072U}, {1004544U, 1U, 31U, 3584U}, {1004548U, 255U, 31U, 3072U}, {1005568U, 1U, 31U, 3584U}, {1005572U, 255U, 31U, 3072U}, {1006592U, 1U, 31U, 3584U}, {1006596U, 255U, 31U, 3072U}, {1007616U, 1U, 31U, 3584U}, {1007620U, 255U, 31U, 3072U}, {1008640U, 1U, 31U, 3584U}, {1008644U, 255U, 31U, 3072U}, {1009664U, 1U, 31U, 3584U}, {1009668U, 255U, 31U, 3072U}, {1010688U, 1U, 31U, 3584U}, {1010692U, 255U, 31U, 3072U}, {1011712U, 1U, 31U, 3584U}, {1011716U, 255U, 31U, 3072U}, {1012736U, 1U, 31U, 3584U}, {1012740U, 255U, 31U, 3072U}, {1013760U, 1U, 31U, 3584U}, {1013764U, 255U, 31U, 3072U}, {1014784U, 1U, 31U, 3584U}, {1014788U, 255U, 31U, 3072U}, {1015808U, 1U, 31U, 3584U}, {1015812U, 255U, 31U, 3072U}, {1016832U, 1U, 31U, 3584U}, {1016836U, 255U, 31U, 3072U}, {1017856U, 1U, 31U, 3584U}, {1017860U, 255U, 31U, 3072U}, {1018880U, 1U, 31U, 3584U}, {1018884U, 255U, 31U, 3072U}, {1019904U, 1U, 31U, 3584U}, {1019908U, 255U, 31U, 3072U}, {1020928U, 1U, 31U, 3584U}, {1020932U, 255U, 31U, 3072U}, {1021952U, 1U, 31U, 3584U}, {1021956U, 255U, 31U, 3072U}, {1022976U, 1U, 31U, 3584U}, {1022980U, 255U, 31U, 3072U}, {1024000U, 1U, 31U, 3584U}, {1024004U, 255U, 31U, 3072U}, {1025024U, 1U, 31U, 3584U}, {1025028U, 255U, 31U, 3072U}, {1026048U, 1U, 31U, 3584U}, {1026052U, 255U, 31U, 3072U}, {1027072U, 1U, 31U, 3584U}, {1027076U, 255U, 31U, 3072U}, {1028096U, 1U, 31U, 3584U}, {1028100U, 255U, 31U, 3072U}, {1029120U, 1U, 31U, 3584U}, {1029124U, 255U, 31U, 3072U}, {1030144U, 1U, 31U, 3584U}, {1030148U, 255U, 31U, 3072U}, {1031168U, 1U, 31U, 3584U}, {1031172U, 255U, 31U, 3072U}, {1032192U, 1U, 31U, 3584U}, {1032196U, 255U, 31U, 3072U}, {1033216U, 1U, 31U, 3584U}, {1033220U, 255U, 31U, 3072U}, {1034240U, 1U, 31U, 3584U}, {1034244U, 255U, 31U, 3072U}, {1035264U, 1U, 31U, 3584U}, {1035268U, 255U, 31U, 3072U}, {1036288U, 1U, 31U, 3584U}, {1036292U, 255U, 31U, 3072U}, {1037312U, 1U, 31U, 3584U}, {1037316U, 255U, 31U, 3072U}, {1038336U, 1U, 31U, 3584U}, {1038340U, 255U, 31U, 3072U}, {1039360U, 1U, 31U, 3584U}, {1039364U, 255U, 31U, 3072U}, {1040384U, 1U, 31U, 3584U}, {1040388U, 255U, 31U, 3072U}, {1041408U, 1U, 31U, 3584U}, {1041412U, 255U, 31U, 3072U}, {1042432U, 1U, 31U, 3584U}, {1042436U, 255U, 31U, 3072U}, {1043456U, 1U, 31U, 3584U}, {1043460U, 255U, 31U, 3072U}, {1044480U, 1U, 31U, 3584U}, {1044484U, 255U, 31U, 3072U}, {1045504U, 1U, 31U, 3584U}, {1045508U, 255U, 31U, 3072U}, {1046528U, 1U, 31U, 3584U}, {1046532U, 255U, 31U, 3072U}, {1047552U, 1U, 31U, 3584U}, {1047556U, 255U, 31U, 3072U}, {1052672U, 5U, 31U, 2340U}, {1052692U, 1U, 31U, 4095U}, {1052696U, 6U, 31U, 2340U}, {1052736U, 2U, 31U, 8191U}, {1052748U, 1U, 31U, 8191U}, {1052752U, 1U, 30U, 2340U}, {1052756U, 3U, 28U, 2340U}, {1052928U, 1U, 31U, 2340U}, {1054720U, 8U, 31U, 2340U}, {1056768U, 18U, 31U, 2340U}, {1056856U, 2U, 31U, 8191U}, {1056868U, 1U, 31U, 8191U}, {1056872U, 6U, 28U, 2340U}, {1056896U, 16U, 31U, 4095U}, {1056960U, 1U, 31U, 2340U}, {1056968U, 8U, 2U, 2340U}, {1057000U, 9U, 28U, 2340U}, {1057792U, 1U, 31U, 2340U}, {1060864U, 1U, 31U, 2340U}, {1060868U, 2U, 31U, 4095U}, {1060876U, 23U, 31U, 2340U}, {1061000U, 2U, 31U, 8191U}, {1061012U, 1U, 31U, 8191U}, {1061016U, 1U, 30U, 2340U}, {1061020U, 2U, 30U, 4095U}, {1061028U, 2U, 30U, 2340U}, {1061036U, 2U, 28U, 2340U}, {1061044U, 1U, 4U, 2340U}, {1061048U, 2U, 28U, 4095U}, {1061056U, 3U, 28U, 2340U}, {1061068U, 1U, 28U, 4095U}, {1061072U, 1U, 28U, 2340U}, {1061080U, 2U, 28U, 2340U}, {1061088U, 1U, 28U, 4095U}, {1061092U, 5U, 28U, 2340U}, {1061888U, 136U, 28U, 8191U}, {1062912U, 8U, 31U, 2340U}, {1064960U, 1U, 31U, 2340U}, {1064964U, 1U, 31U, 4095U}, {1064968U, 4U, 31U, 2340U}, {1064984U, 1U, 31U, 4095U}, {1064988U, 1U, 31U, 2340U}, {1064992U, 1U, 31U, 4095U}, {1064996U, 6U, 31U, 2340U}, {1065020U, 1U, 31U, 4095U}, {1065024U, 47U, 31U, 2340U}, {1065228U, 2U, 31U, 8191U}, {1065240U, 1U, 31U, 8191U}, {1065244U, 16U, 28U, 2340U}, {1065472U, 17U, 31U, 2340U}, {1065984U, 1U, 31U, 8191U}, {1065988U, 63U, 31U, 4095U}, {1066240U, 192U, 31U, 3510U}, {1067008U, 1U, 31U, 8191U}, {1067012U, 63U, 31U, 4095U}, {1067264U, 192U, 31U, 3510U}, {1069056U, 4U, 31U, 8191U}, {1069072U, 252U, 31U, 4095U}, {1070080U, 768U, 31U, 3510U}, {1077248U, 7U, 28U, 2340U}, {1077276U, 1U, 24U, 2340U}, {1081344U, 33U, 3U, 2340U}, {1081516U, 5U, 2U, 2340U}, {1081600U, 5U, 3U, 2340U}, {1081632U, 5U, 3U, 2340U}, {1081856U, 74U, 3U, 2340U}, {1082368U, 74U, 3U, 2340U}, {1083392U, 152U, 3U, 2340U}, {1114112U, 111U, 28U, 2340U}, {1114572U, 2U, 28U, 8191U}, {1114584U, 1U, 28U, 8191U}, {1114588U, 1U, 24U, 2340U}, {1114624U, 4U, 28U, 2340U}, {1179648U, 92U, 31U, 2340U}, {1180016U, 2U, 3U, 2340U}, {1180024U, 14U, 31U, 2340U}, {1180080U, 2U, 31U, 4095U}, {1180088U, 93U, 31U, 2340U}, {1180460U, 1U, 31U, 4095U}, {1180464U, 15U, 31U, 2340U}, {1180524U, 3U, 31U, 4095U}, {1180536U, 36U, 31U, 2340U}, {1180680U, 2U, 31U, 4095U}, {1180688U, 1U, 31U, 2340U}, {1180692U, 15U, 31U, 4095U}, {1180752U, 10U, 31U, 2340U}, {1180792U, 2U, 31U, 4095U}, {1180800U, 43U, 31U, 2340U}, {1180972U, 1U, 31U, 4095U}, {1180976U, 5U, 31U, 2340U}, {1180996U, 4U, 3U, 2340U}, {1181012U, 4U, 31U, 2340U}, {1181028U, 2U, 31U, 4095U}, {1181052U, 2U, 31U, 8191U}, {1181064U, 3U, 31U, 8191U}, {1181080U, 1U, 31U, 8191U}, {1181084U, 22U, 30U, 2340U}, {1181172U, 1U, 6U, 2340U}, {1181176U, 4U, 28U, 2340U}, {1181208U, 1U, 28U, 2340U}, {1181212U, 31U, 30U, 2340U}, {1181336U, 3U, 28U, 2340U}, {1181348U, 1U, 4U, 2340U}, {1181352U, 1U, 28U, 2340U}, {1181360U, 38U, 28U, 2340U}, {1181512U, 1U, 28U, 4095U}, {1181516U, 11U, 28U, 2340U}, {1181560U, 2U, 28U, 4095U}, {1181568U, 23U, 28U, 2340U}, {1181660U, 1U, 4U, 2340U}, {1181692U, 1U, 28U, 2340U}, {1181708U, 2U, 31U, 4095U}, {1181716U, 1U, 31U, 2340U}, {1181720U, 1U, 31U, 4095U}, {1181724U, 1U, 31U, 2340U}, {1181728U, 1U, 31U, 4095U}, {1181732U, 1U, 31U, 2340U}, {1181736U, 1U, 31U, 4095U}, {1181740U, 1U, 31U, 2340U}, {1181744U, 1U, 31U, 4095U}, {1181748U, 1U, 31U, 2340U}, {1181752U, 1U, 31U, 4095U}, {1181756U, 1U, 31U, 2340U}, {1181760U, 1U, 31U, 4095U}, {1181764U, 1U, 31U, 2340U}, {1181768U, 1U, 31U, 4095U}, {1181772U, 1U, 31U, 2340U}, {1181776U, 1U, 31U, 4095U}, {1181780U, 1U, 31U, 2340U}, {1181784U, 1U, 31U, 4095U}, {1181788U, 1U, 31U, 2340U}, {1181792U, 1U, 31U, 4095U}, {1181796U, 1U, 31U, 2340U}, {1181800U, 1U, 31U, 4095U}, {1181804U, 1U, 31U, 2340U}, {1181808U, 1U, 31U, 4095U}, {1181812U, 1U, 31U, 2340U}, {1181816U, 1U, 31U, 4095U}, {1181820U, 1U, 31U, 2340U}, {1181824U, 1U, 31U, 4095U}, {1181828U, 1U, 31U, 2340U}, {1181832U, 1U, 31U, 4095U}, {1181836U, 1U, 31U, 2340U}, {1181840U, 1U, 31U, 4095U}, {1181844U, 1U, 31U, 2340U}, {1181848U, 1U, 31U, 4095U}, {1181852U, 1U, 31U, 2340U}, {1181856U, 1U, 31U, 4095U}, {1181860U, 1U, 31U, 2340U}, {1181864U, 1U, 31U, 4095U}, {1181868U, 1U, 31U, 2340U}, {1181872U, 1U, 31U, 4095U}, {1181876U, 1U, 31U, 2340U}, {1181880U, 1U, 31U, 4095U}, {1181884U, 1U, 31U, 2340U}, {1181888U, 1U, 31U, 4095U}, {1181892U, 1U, 31U, 2340U}, {1181896U, 1U, 31U, 4095U}, {1181900U, 1U, 31U, 2340U}, {1181904U, 1U, 31U, 4095U}, {1181908U, 1U, 31U, 2340U}, {1181912U, 1U, 31U, 4095U}, {1181916U, 1U, 31U, 2340U}, {1181920U, 1U, 31U, 4095U}, {1181924U, 1U, 31U, 2340U}, {1181928U, 1U, 31U, 4095U}, {1181932U, 1U, 31U, 2340U}, {1181936U, 1U, 31U, 4095U}, {1181940U, 1U, 31U, 2340U}, {1181944U, 1U, 31U, 4095U}, {1181948U, 1U, 31U, 2340U}, {1181952U, 1U, 31U, 4095U}, {1181956U, 1U, 31U, 2340U}, {1181960U, 1U, 31U, 4095U}, {1181964U, 1U, 31U, 2340U}, {1181968U, 7U, 28U, 2340U}, {1182000U, 9U, 28U, 2340U}, {1182044U, 37U, 24U, 2340U}, {1182208U, 2U, 7U, 2340U}, {1182464U, 1U, 24U, 2340U}, {1187840U, 2U, 31U, 2340U}, {1187848U, 2046U, 1U, 2340U}, {1212416U, 6144U, 30U, 2340U}, {1245184U, 1U, 28U, 8191U}, {1245188U, 11U, 28U, 2340U}, {1245232U, 1U, 28U, 4095U}, {1245236U, 6U, 28U, 2340U}, {1245260U, 3U, 28U, 4095U}, {1245272U, 3U, 28U, 2340U}, {1245284U, 2U, 28U, 4095U}, {1245292U, 8U, 28U, 2340U}, {1245340U, 2U, 28U, 8191U}, {1245352U, 1U, 28U, 8191U}, {1245440U, 12U, 28U, 2340U}, {1245488U, 1U, 28U, 4095U}, {1245492U, 14U, 28U, 2340U}, {1245548U, 1U, 28U, 4095U}, {1245552U, 1U, 28U, 2340U}, {1245568U, 1U, 28U, 2340U}, {1245696U, 1U, 28U, 2340U}, {1245824U, 1U, 28U, 2340U}, {1245952U, 1U, 28U, 4095U}, {1245956U, 4U, 28U, 2340U}, {1246080U, 1U, 28U, 2340U}, {1246208U, 1U, 28U, 2340U}, {1246336U, 1U, 28U, 4095U}, {1246340U, 4U, 28U, 2340U}, {1247232U, 72U, 28U, 2340U}, {1249280U, 136U, 28U, 2340U}, {1253376U, 148U, 28U, 2340U}, {1261568U, 544U, 28U, 2340U}, {1310720U, 1U, 31U, 2340U}, {1310724U, 9U, 15U, 2340U}, {1310760U, 8U, 31U, 2340U}, {1310792U, 5U, 15U, 2340U}, {1310812U, 2U, 15U, 4095U}, {1310820U, 3U, 15U, 2340U}, {1310832U, 1U, 31U, 2340U}, {1310836U, 10U, 15U, 2340U}, {1310876U, 1U, 31U, 2340U}, {1310880U, 5U, 15U, 2340U}, {1310900U, 7U, 31U, 2340U}, {1310928U, 2U, 15U, 4095U}, {1310936U, 2U, 15U, 2340U}, {1310944U, 1U, 15U, 4095U}, {1310948U, 5U, 15U, 2340U}, {1310968U, 2U, 31U, 2340U}, {1310976U, 5U, 3U, 2340U}, {1310996U, 5U, 15U, 2340U}, {1311016U, 7U, 31U, 2340U}, {1311044U, 9U, 15U, 2340U}, {1311080U, 8U, 31U, 2340U}, {1311112U, 3U, 15U, 2340U}, {1311124U, 13U, 31U, 2340U}, {1311192U, 2U, 31U, 8191U}, {1311204U, 1U, 31U, 8191U}, {1311232U, 6U, 15U, 4095U}, {1311456U, 2U, 12U, 2340U}, {1311464U, 2U, 28U, 2340U}, {1311472U, 9U, 12U, 2340U}, {1311508U, 9U, 16U, 2340U}, {1311544U, 7U, 16U, 4095U}, {1311572U, 7U, 16U, 2340U}, {1311600U, 7U, 16U, 4095U}, {1311628U, 14U, 16U, 2340U}, {1311920U, 14U, 16U, 2340U}, {1425408U, 2U, 30U, 2340U}, {1425416U, 5U, 2U, 2340U}, {1425440U, 8U, 28U, 2340U}, {1425472U, 1U, 12U, 2340U}, {1425476U, 2U, 28U, 2340U}, {1425484U, 8U, 12U, 2340U}, {1425516U, 8U, 28U, 2340U}, {1425552U, 13U, 28U, 2340U}, {1425608U, 24U, 28U, 2340U}, {1425704U, 2U, 12U, 2340U}, {1425712U, 1U, 28U, 2340U}, {1425720U, 6U, 28U, 2340U}, {1425744U, 2U, 24U, 2340U}, {1425752U, 2U, 8U, 2340U}, {1425760U, 23U, 16U, 2340U}, {1425852U, 6U, 16U, 4095U}, {1425876U, 23U, 16U, 2340U}, {1425968U, 7U, 16U, 4095U}, {1425996U, 90U, 16U, 2340U}, {1441796U, 6U, 24U, 2340U}, {1441852U, 1U, 16U, 2340U}, {1441856U, 6U, 24U, 2340U}, {1441884U, 6U, 24U, 2340U}, {1441908U, 1U, 16U, 2340U}, {1441912U, 2U, 24U, 2340U}, {1442560U, 8U, 24U, 2340U}, {1442608U, 6U, 24U, 2340U}, {1442820U, 6U, 24U, 2340U}, {1442876U, 1U, 16U, 2340U}, {1442880U, 6U, 24U, 2340U}, {1442908U, 6U, 24U, 2340U}, {1442932U, 1U, 16U, 2340U}, {1442936U, 2U, 24U, 2340U}, {1443584U, 8U, 24U, 2340U}, {1443632U, 6U, 24U, 2340U}, {1445888U, 7U, 31U, 2340U}, {1445932U, 2U, 31U, 8191U}, {1445944U, 1U, 31U, 8191U}, {1445948U, 2U, 28U, 2340U}, {1447936U, 2U, 31U, 2340U}, {1449984U, 54U, 24U, 2340U}, {1450496U, 60U, 24U, 2340U}, {1451008U, 54U, 24U, 2340U}, {1451520U, 60U, 24U, 2340U}, {1452032U, 54U, 24U, 2340U}, {1452544U, 60U, 24U, 2340U}, {1453056U, 54U, 24U, 2340U}, {1453568U, 60U, 24U, 2340U}, {1454080U, 1U, 24U, 2340U}, {1454088U, 1U, 24U, 2340U}, {1454096U, 1U, 24U, 2340U}, {1454104U, 1U, 24U, 2340U}, {1454112U, 5U, 24U, 2340U}, {1454136U, 3U, 24U, 2340U}, {1454152U, 3U, 24U, 2340U}, {1454168U, 1U, 24U, 2340U}, {1454176U, 1U, 24U, 2340U}, {1454184U, 1U, 24U, 2340U}, {1454192U, 3U, 24U, 2340U}, {1454208U, 1U, 24U, 2340U}, {1454216U, 3U, 24U, 2340U}, {1454232U, 1U, 24U, 2340U}, {1454240U, 1U, 24U, 2340U}, {1454248U, 1U, 24U, 2340U}, {1454256U, 2U, 16U, 2340U}, {1454272U, 1U, 24U, 2340U}, {1454280U, 1U, 24U, 2340U}, {1454288U, 1U, 24U, 2340U}, {1454296U, 1U, 24U, 2340U}, {1454304U, 2U, 24U, 2340U}, {1454352U, 1U, 24U, 2340U}, {1454368U, 2U, 24U, 2340U}, {1455136U, 4U, 24U, 2340U}, {1455160U, 2U, 24U, 2340U}, {1455240U, 2U, 24U, 2340U}, {1455392U, 2U, 24U, 2340U}, {1456128U, 1U, 24U, 2340U}, {1456136U, 1U, 24U, 2340U}, {1456144U, 1U, 24U, 2340U}, {1456152U, 1U, 24U, 2340U}, {1456160U, 5U, 24U, 2340U}, {1456184U, 3U, 24U, 2340U}, {1456200U, 3U, 24U, 2340U}, {1456216U, 1U, 24U, 2340U}, {1456224U, 1U, 24U, 2340U}, {1456232U, 1U, 24U, 2340U}, {1456240U, 3U, 24U, 2340U}, {1456256U, 1U, 24U, 2340U}, {1456264U, 3U, 24U, 2340U}, {1456280U, 1U, 24U, 2340U}, {1456288U, 1U, 24U, 2340U}, {1456296U, 1U, 24U, 2340U}, {1456304U, 2U, 16U, 2340U}, {1456320U, 1U, 24U, 2340U}, {1456328U, 1U, 24U, 2340U}, {1456336U, 1U, 24U, 2340U}, {1456344U, 1U, 24U, 2340U}, {1456352U, 2U, 24U, 2340U}, {1456400U, 1U, 24U, 2340U}, {1456416U, 2U, 24U, 2340U}, {1457184U, 4U, 24U, 2340U}, {1457208U, 2U, 24U, 2340U}, {1457288U, 2U, 24U, 2340U}, {1457440U, 2U, 24U, 2340U}, {1458176U, 5U, 31U, 2340U}, {1458196U, 2U, 31U, 4095U}, {1458204U, 53U, 31U, 2340U}, {1458432U, 2U, 31U, 8191U}, {1458444U, 1U, 31U, 8191U}, {1458448U, 2U, 30U, 2340U}, {1458456U, 15U, 28U, 2340U}, {1458688U, 1U, 31U, 2340U}, {1458696U, 1U, 31U, 2340U}, {1458704U, 1U, 31U, 2340U}, {1458712U, 1U, 31U, 2340U}, {1458720U, 1U, 31U, 2340U}, {1458728U, 1U, 31U, 2340U}, {1458736U, 1U, 31U, 2340U}, {1458744U, 1U, 31U, 2340U}, {1458752U, 1U, 31U, 2340U}, {1458760U, 1U, 31U, 2340U}, {1458768U, 1U, 31U, 2340U}, {1458776U, 1U, 31U, 2340U}, {1458784U, 1U, 31U, 2340U}, {1458800U, 2U, 31U, 2340U}, {1458816U, 2U, 31U, 2340U}, {1460224U, 2U, 31U, 2340U}, {1462272U, 2U, 31U, 2340U}, {1466368U, 164U, 31U, 2340U}, {1467056U, 2U, 31U, 8191U}, {1467068U, 1U, 31U, 8191U}, {1467084U, 7U, 28U, 2340U}, {1467392U, 49U, 31U, 2340U}, {1467592U, 32U, 31U, 2340U}, {1467720U, 1U, 31U, 4095U}, {1467724U, 1U, 31U, 2340U}, {1467728U, 1U, 31U, 4095U}, {1467732U, 1U, 31U, 2340U}, {1467736U, 1U, 31U, 4095U}, {1467740U, 1U, 31U, 2340U}, {1467752U, 2U, 31U, 2340U}, {1467760U, 5U, 28U, 2340U}, {1468416U, 1U, 31U, 2340U}, {1474560U, 1U, 31U, 4095U}, {1474564U, 1U, 31U, 2340U}, {1474568U, 1U, 31U, 4095U}, {1474572U, 1U, 31U, 2340U}, {1474576U, 1U, 31U, 4095U}, {1474580U, 1U, 31U, 2340U}, {1474584U, 1U, 31U, 4095U}, {1474588U, 3U, 31U, 2340U}, {1474600U, 2U, 31U, 4095U}, {1474608U, 10U, 31U, 2340U}, {1474648U, 9U, 31U, 4095U}, {1474684U, 106U, 31U, 2340U}, {1475108U, 2U, 3U, 2340U}, {1475116U, 3U, 31U, 2340U}, {1475128U, 1U, 31U, 4095U}, {1475132U, 25U, 31U, 2340U}, {1475232U, 12U, 3U, 2340U}, {1475280U, 7U, 31U, 4095U}, {1475308U, 5U, 31U, 2340U}, {1475328U, 2U, 3U, 4095U}, {1475336U, 65U, 31U, 4095U}, {1475596U, 1U, 31U, 2340U}, {1475600U, 2U, 31U, 4095U}, {1475608U, 2U, 3U, 2340U}, {1475616U, 6U, 31U, 2340U}, {1475656U, 2U, 31U, 8191U}, {1475668U, 1U, 31U, 8191U}, {1476608U, 19U, 31U, 2340U}, {1476864U, 1U, 31U, 2340U}, {1477120U, 128U, 31U, 4095U}, {1482752U, 1536U, 31U, 2340U}, {1490944U, 1536U, 31U, 2340U}, {1499136U, 16U, 2U, 2340U}, {1499200U, 8U, 28U, 2340U}, {1499392U, 1U, 2U, 2340U}, {1499648U, 2U, 2U, 4095U}, {1500160U, 1U, 2U, 2340U}, {1500164U, 2U, 2U, 4095U}, {1500172U, 94U, 2U, 2340U}, {1500548U, 64U, 2U, 4095U}, {1500804U, 2U, 30U, 4095U}, {1500812U, 4U, 2U, 4095U}, {1500828U, 8U, 2U, 2340U}, {1500860U, 4U, 30U, 2340U}, {1500876U, 4U, 2U, 2340U}, {1500896U, 2U, 28U, 2340U}, {1500904U, 5U, 12U, 2340U}, {1500924U, 4U, 28U, 4095U}, {1500940U, 1U, 28U, 2340U}, {1501032U, 17U, 28U, 2340U}, {1501100U, 12U, 16U, 4095U}, {1507328U, 24U, 31U, 2340U}, {1507424U, 4U, 3U, 2340U}, {1507440U, 13U, 31U, 2340U}, {1507492U, 1U, 31U, 4095U}, {1507496U, 1U, 31U, 2340U}, {1507500U, 2U, 31U, 4095U}, {1507508U, 3U, 31U, 2340U}, {1507520U, 1U, 31U, 4095U}, {1507524U, 44U, 31U, 2340U}, {1507716U, 2U, 31U, 8191U}, {1507728U, 1U, 31U, 8191U}, {1507732U, 11U, 28U, 2340U}, {1507780U, 1U, 28U, 2340U}, {1507788U, 7U, 28U, 2340U}, {1507816U, 1U, 24U, 2340U}, {1507820U, 1U, 28U, 2340U}, {1507828U, 1U, 28U, 2340U}, {1507840U, 4U, 31U, 2340U}, {1507860U, 1U, 31U, 2340U}, {1507864U, 77U, 28U, 2340U}, {1508352U, 64U, 28U, 2340U}, {1540096U, 1U, 31U, 2340U}, {1572864U, 61U, 31U, 2340U}, {1573140U, 2U, 31U, 8191U}, {1573152U, 3U, 31U, 8191U}, {1573168U, 1U, 31U, 8191U}, {1573180U, 2U, 30U, 2340U}, {1573376U, 27U, 31U, 2340U}, {1573484U, 1U, 31U, 4095U}, {1573488U, 12U, 31U, 2340U}, {1573536U, 1U, 31U, 4095U}, {1573540U, 17U, 31U, 2340U}, {1573696U, 4U, 31U, 2340U}, {1573760U, 1U, 28U, 2340U}, {1573768U, 1U, 28U, 2340U}, {1573776U, 1U, 28U, 2340U}, {1573784U, 1U, 28U, 2340U}, {1573792U, 5U, 28U, 2340U}, {1573812U, 2U, 24U, 2340U}, {1576960U, 4U, 31U, 2364U}, {1576976U, 1020U, 31U, 56U}, {1581056U, 4U, 24U, 2340U}, {1703936U, 1U, 31U, 2348U}, {1703940U, 5631U, 31U, 8U}, {1726464U, 2560U, 30U, 8U}, {1736704U, 1U, 31U, 2348U}, {1736708U, 8191U, 30U, 8U}, {1769472U, 1U, 31U, 2348U}, {1769476U, 15U, 2U, 8U}, {1769536U, 1U, 30U, 2348U}, {1769540U, 239U, 2U, 8U}, {1770496U, 1U, 31U, 2348U}, {1770500U, 255U, 2U, 8U}, {1771520U, 1U, 31U, 2340U}, {1771584U, 1U, 30U, 2340U}, {1772544U, 1U, 31U, 8191U}, {1773568U, 1U, 31U, 8191U}, {1773632U, 1U, 30U, 8191U}, {1774592U, 1U, 31U, 2340U}, {1774656U, 1U, 30U, 2340U}, {1774720U, 1U, 30U, 2340U}, {1774784U, 1U, 30U, 2340U}, {1775616U, 128U, 31U, 16U}, {1776640U, 128U, 31U, 16U}, {1777664U, 1U, 31U, 3510U}, {1778688U, 1U, 30U, 2348U}, {1778692U, 5631U, 28U, 8U}, {1802240U, 1U, 31U, 4095U}, {1802304U, 1U, 31U, 4095U}, {1802368U, 1U, 31U, 4095U}, {1802432U, 1U, 31U, 4095U}, {1802496U, 1U, 31U, 2340U}, {1802560U, 1U, 31U, 2340U}, {1802624U, 1U, 31U, 2340U}, {1802688U, 1U, 31U, 2340U}, {1802752U, 1U, 31U, 2340U}, {1802816U, 1U, 31U, 2340U}, {1802880U, 1U, 31U, 2340U}, {1802944U, 1U, 31U, 2340U}, {1803008U, 1U, 31U, 2340U}, {1803072U, 1U, 31U, 2340U}, {1803136U, 1U, 31U, 2340U}, {1803200U, 1U, 31U, 2340U}, {1803264U, 1U, 31U, 2340U}, {1803328U, 1U, 31U, 2340U}, {1803392U, 1U, 31U, 2340U}, {1803456U, 1U, 31U, 2340U}, {1803520U, 1U, 31U, 2340U}, {1803584U, 1U, 31U, 2340U}, {1803648U, 1U, 31U, 2340U}, {1803712U, 19U, 28U, 2340U}, {1804288U, 1U, 31U, 2340U}, {1804352U, 1U, 31U, 2340U}, {1804416U, 1U, 31U, 2340U}, {1804480U, 1U, 31U, 2340U}, {1804544U, 1U, 31U, 2340U}, {1804608U, 1U, 31U, 2340U}, {1804672U, 1U, 31U, 2340U}, {1804736U, 1U, 31U, 2340U}, {1804800U, 1U, 31U, 2356U}, {1804864U, 1U, 31U, 2340U}, {1804928U, 1U, 31U, 1170U}, {1804992U, 1U, 31U, 2340U}, {1805056U, 1U, 31U, 2340U}, {1805120U, 1U, 31U, 2340U}, {1805184U, 1U, 31U, 2340U}, {1805248U, 1U, 31U, 2340U}, {1805312U, 1U, 31U, 2340U}, {1805376U, 1U, 31U, 2340U}, {1805440U, 1U, 31U, 2340U}, {1805504U, 1U, 31U, 2340U}, {1805508U, 1U, 28U, 2340U}, {1805568U, 1U, 31U, 2340U}, {1805632U, 1U, 31U, 2340U}, {1805696U, 1U, 31U, 2340U}, {1805760U, 1U, 31U, 2340U}, {1805824U, 1U, 31U, 2340U}, {1805888U, 1U, 31U, 2340U}, {1805952U, 1U, 31U, 2340U}, {1805956U, 1U, 28U, 2340U}, {1806016U, 1U, 30U, 2340U}, {1806080U, 1U, 30U, 2340U}, {1806144U, 1U, 30U, 2340U}, {1806208U, 1U, 30U, 2340U}, {1806272U, 1U, 30U, 2340U}, {1806292U, 5U, 28U, 2340U}, {1806312U, 2U, 24U, 2340U}, {1806336U, 1U, 28U, 2340U}, {1806400U, 3U, 28U, 2340U}, {1806428U, 1U, 24U, 2340U}, {1806436U, 1U, 16U, 2340U}, {1806464U, 10U, 16U, 2340U}, {1835008U, 2U, 31U, 2340U}, {2097152U, 65U, 31U, 2340U}, {2097444U, 2U, 31U, 8191U}, {2097456U, 3U, 31U, 8191U}, {2097472U, 1U, 31U, 8191U}, {2097484U, 2U, 30U, 2340U}, {2097664U, 27U, 31U, 2340U}, {2097772U, 1U, 31U, 4095U}, {2097776U, 12U, 31U, 2340U}, {2097824U, 1U, 31U, 4095U}, {2097828U, 17U, 31U, 2340U}, {2097984U, 4U, 31U, 2340U}, {2098048U, 1U, 28U, 2340U}, {2098056U, 1U, 28U, 2340U}, {2098064U, 1U, 28U, 2340U}, {2098072U, 1U, 28U, 2340U}, {2098080U, 1U, 28U, 2340U}, {2098088U, 2U, 28U, 2340U}, {2105344U, 4U, 31U, 6439U}, {2105360U, 2044U, 31U, 4103U}, {2113536U, 4U, 24U, 2340U}, {2228224U, 1U, 31U, 2341U}, {2228228U, 5631U, 31U, 1U}, {2250752U, 2560U, 30U, 1U}, {2260992U, 1U, 31U, 2341U}, {2260996U, 8191U, 30U, 1U}, {2293760U, 1U, 31U, 2341U}, {2293764U, 15U, 2U, 1U}, {2293824U, 1U, 30U, 2341U}, {2293828U, 239U, 2U, 1U}, {2294784U, 1U, 31U, 2341U}, {2294788U, 255U, 2U, 1U}, {2295808U, 1U, 31U, 2340U}, {2295872U, 1U, 30U, 2340U}, {2296832U, 1U, 31U, 2340U}, {2297856U, 1U, 31U, 2340U}, {2297920U, 1U, 30U, 2340U}, {2298880U, 1U, 31U, 2340U}, {2298944U, 1U, 30U, 2340U}, {2299008U, 1U, 30U, 2340U}, {2299072U, 1U, 30U, 2340U}, {2299904U, 128U, 31U, 2U}, {2300928U, 128U, 31U, 2U}, {2301952U, 1U, 31U, 3510U}, {2302976U, 1U, 30U, 2341U}, {2302980U, 5631U, 28U, 1U}, {2326528U, 1U, 31U, 4095U}, {2326592U, 1U, 31U, 4095U}, {2326656U, 1U, 31U, 4095U}, {2326720U, 1U, 31U, 4095U}, {2326784U, 1U, 31U, 2340U}, {2326848U, 1U, 31U, 2340U}, {2326912U, 1U, 31U, 2340U}, {2326976U, 1U, 31U, 2340U}, {2327040U, 1U, 31U, 2340U}, {2327104U, 1U, 31U, 2340U}, {2327168U, 1U, 31U, 2340U}, {2327232U, 1U, 31U, 2340U}, {2327296U, 1U, 31U, 2340U}, {2327360U, 1U, 31U, 2340U}, {2327424U, 1U, 31U, 2340U}, {2327488U, 1U, 31U, 2340U}, {2327552U, 1U, 31U, 2340U}, {2327616U, 1U, 31U, 2340U}, {2327680U, 1U, 31U, 2340U}, {2327744U, 1U, 31U, 2340U}, {2327808U, 1U, 31U, 2340U}, {2327872U, 1U, 31U, 2340U}, {2327936U, 1U, 31U, 2340U}, {2328000U, 19U, 28U, 2340U}, {2328576U, 1U, 31U, 2340U}, {2328640U, 1U, 31U, 2340U}, {2328704U, 1U, 31U, 2340U}, {2328768U, 1U, 31U, 2340U}, {2328832U, 1U, 31U, 2340U}, {2328896U, 1U, 31U, 2340U}, {2328960U, 1U, 31U, 2340U}, {2329024U, 1U, 31U, 2340U}, {2329088U, 1U, 31U, 2342U}, {2329152U, 1U, 31U, 2340U}, {2329216U, 1U, 31U, 1170U}, {2329280U, 1U, 31U, 2340U}, {2329344U, 1U, 31U, 2340U}, {2329408U, 1U, 31U, 2340U}, {2329472U, 1U, 31U, 2340U}, {2329536U, 1U, 31U, 2340U}, {2329600U, 1U, 31U, 2340U}, {2329664U, 1U, 31U, 2340U}, {2329728U, 1U, 31U, 2340U}, {2329792U, 1U, 31U, 2340U}, {2329796U, 1U, 28U, 2340U}, {2329856U, 1U, 31U, 2340U}, {2329920U, 1U, 31U, 2340U}, {2329984U, 1U, 31U, 2340U}, {2330048U, 1U, 31U, 2340U}, {2330112U, 1U, 31U, 2340U}, {2330176U, 1U, 31U, 2340U}, {2330240U, 1U, 31U, 2340U}, {2330244U, 1U, 28U, 2340U}, {2330304U, 1U, 30U, 2340U}, {2330368U, 1U, 30U, 2340U}, {2330432U, 1U, 30U, 2340U}, {2330496U, 1U, 30U, 2340U}, {2330560U, 1U, 30U, 2340U}, {2330580U, 5U, 28U, 2340U}, {2330600U, 2U, 24U, 2340U}, {2330624U, 1U, 28U, 2340U}, {2330688U, 3U, 28U, 2340U}, {2330716U, 1U, 24U, 2340U}, {2330724U, 1U, 16U, 2340U}, {2330752U, 10U, 16U, 2340U}, {2359296U, 2U, 31U, 2340U}, {2621440U, 65U, 31U, 2340U}, {2621732U, 2U, 31U, 8191U}, {2621744U, 3U, 31U, 8191U}, {2621760U, 1U, 31U, 8191U}, {2621772U, 2U, 30U, 2340U}, {2621952U, 27U, 31U, 2340U}, {2622060U, 1U, 31U, 4095U}, {2622064U, 12U, 31U, 2340U}, {2622112U, 1U, 31U, 4095U}, {2622116U, 17U, 31U, 2340U}, {2622272U, 4U, 31U, 2340U}, {2622336U, 1U, 28U, 2340U}, {2622344U, 1U, 28U, 2340U}, {2622352U, 1U, 28U, 2340U}, {2622360U, 1U, 28U, 2340U}, {2622368U, 1U, 28U, 2340U}, {2622376U, 2U, 28U, 2340U}, {2629632U, 4U, 31U, 2532U}, {2629648U, 2044U, 31U, 448U}, {2637824U, 4U, 24U, 2340U}, {2752512U, 1U, 31U, 2404U}, {2752516U, 5631U, 31U, 64U}, {2775040U, 2560U, 30U, 64U}, {2785280U, 1U, 31U, 2404U}, {2785284U, 8191U, 30U, 64U}, {2818048U, 1U, 31U, 2404U}, {2818052U, 15U, 2U, 64U}, {2818112U, 1U, 30U, 2404U}, {2818116U, 239U, 2U, 64U}, {2819072U, 1U, 31U, 2404U}, {2819076U, 255U, 2U, 64U}, {2820096U, 1U, 31U, 2340U}, {2820160U, 1U, 30U, 2340U}, {2821120U, 1U, 31U, 2340U}, {2822144U, 1U, 31U, 2340U}, {2822208U, 1U, 30U, 2340U}, {2823168U, 1U, 31U, 2340U}, {2823232U, 1U, 30U, 2340U}, {2823296U, 1U, 30U, 2340U}, {2823360U, 1U, 30U, 2340U}, {2824192U, 128U, 31U, 128U}, {2825216U, 128U, 31U, 128U}, {2826240U, 1U, 31U, 3510U}, {2827264U, 1U, 30U, 2404U}, {2827268U, 5631U, 28U, 64U}, {2850816U, 1U, 31U, 4095U}, {2850880U, 1U, 31U, 4095U}, {2850944U, 1U, 31U, 4095U}, {2851008U, 1U, 31U, 2340U}, {2851072U, 1U, 31U, 2340U}, {2851136U, 1U, 31U, 2340U}, {2851200U, 1U, 31U, 2340U}, {2851264U, 1U, 31U, 2340U}, {2851328U, 1U, 31U, 2340U}, {2851392U, 1U, 31U, 2340U}, {2851456U, 1U, 31U, 2340U}, {2851520U, 1U, 31U, 2340U}, {2851584U, 1U, 31U, 2340U}, {2851648U, 1U, 31U, 2340U}, {2851712U, 1U, 31U, 2340U}, {2851776U, 1U, 31U, 2340U}, {2851840U, 1U, 31U, 2340U}, {2851904U, 1U, 31U, 2340U}, {2851968U, 1U, 31U, 2340U}, {2852032U, 1U, 31U, 2340U}, {2852096U, 1U, 31U, 2340U}, {2852160U, 1U, 31U, 2340U}, {2852224U, 1U, 31U, 2340U}, {2852288U, 19U, 28U, 2340U}, {2852864U, 1U, 31U, 2340U}, {2852928U, 1U, 31U, 2340U}, {2852992U, 1U, 31U, 2340U}, {2853056U, 1U, 31U, 2340U}, {2853120U, 1U, 31U, 2340U}, {2853184U, 1U, 31U, 2340U}, {2853248U, 1U, 31U, 2340U}, {2853312U, 1U, 31U, 2340U}, {2853376U, 1U, 31U, 2468U}, {2853440U, 1U, 31U, 2340U}, {2853504U, 1U, 31U, 1170U}, {2853568U, 1U, 31U, 2340U}, {2853632U, 1U, 31U, 2340U}, {2853696U, 1U, 31U, 2340U}, {2853760U, 1U, 31U, 2340U}, {2853824U, 1U, 31U, 2340U}, {2853888U, 1U, 31U, 2340U}, {2853952U, 1U, 31U, 2340U}, {2854016U, 1U, 31U, 2340U}, {2854080U, 1U, 31U, 2340U}, {2854084U, 1U, 28U, 2340U}, {2854144U, 1U, 31U, 2340U}, {2854208U, 1U, 31U, 2340U}, {2854272U, 1U, 31U, 2340U}, {2854336U, 1U, 31U, 2340U}, {2854400U, 1U, 31U, 2340U}, {2854464U, 1U, 31U, 2340U}, {2854528U, 1U, 31U, 2340U}, {2854532U, 1U, 28U, 2340U}, {2854592U, 1U, 30U, 2340U}, {2854656U, 1U, 30U, 2340U}, {2854720U, 1U, 30U, 2340U}, {2854784U, 1U, 30U, 2340U}, {2854848U, 1U, 30U, 2340U}, {2854868U, 5U, 28U, 2340U}, {2854888U, 2U, 24U, 2340U}, {2854912U, 1U, 28U, 2340U}, {2854976U, 3U, 28U, 2340U}, {2855004U, 1U, 24U, 2340U}, {2855012U, 1U, 16U, 2340U}, {2855040U, 10U, 16U, 2340U}, {2883584U, 2U, 31U, 8191U}, {3145728U, 65U, 31U, 2340U}, {3146020U, 2U, 31U, 8191U}, {3146032U, 3U, 31U, 8191U}, {3146048U, 1U, 31U, 8191U}, {3146060U, 2U, 30U, 2340U}, {3146240U, 27U, 31U, 2340U}, {3146348U, 1U, 31U, 4095U}, {3146352U, 12U, 31U, 2340U}, {3146400U, 1U, 31U, 4095U}, {3146404U, 17U, 31U, 2340U}, {3146560U, 4U, 31U, 2340U}, {3146624U, 1U, 28U, 2340U}, {3146632U, 1U, 28U, 2340U}, {3146640U, 1U, 28U, 2340U}, {3146648U, 1U, 28U, 2340U}, {3146656U, 1U, 28U, 2340U}, {3146664U, 2U, 28U, 2340U}, {3153920U, 4U, 31U, 3876U}, {3153936U, 2044U, 31U, 3584U}, {3162112U, 4U, 24U, 2340U}, {3276800U, 1U, 31U, 2852U}, {3276804U, 5631U, 31U, 512U}, {3299328U, 2560U, 30U, 512U}, {3309568U, 1U, 31U, 2852U}, {3309572U, 8191U, 30U, 512U}, {3342336U, 1U, 31U, 2852U}, {3342340U, 15U, 2U, 512U}, {3342400U, 1U, 30U, 2852U}, {3342404U, 239U, 2U, 512U}, {3343360U, 1U, 31U, 2852U}, {3343364U, 255U, 2U, 512U}, {3344384U, 1U, 31U, 2340U}, {3344448U, 1U, 30U, 2340U}, {3345408U, 1U, 31U, 2340U}, {3346432U, 1U, 31U, 2340U}, {3346496U, 1U, 30U, 2340U}, {3347456U, 1U, 31U, 2340U}, {3347520U, 1U, 30U, 2340U}, {3347584U, 1U, 30U, 2340U}, {3347648U, 1U, 30U, 2340U}, {3348480U, 128U, 31U, 1024U}, {3349504U, 128U, 31U, 1024U}, {3350528U, 1U, 31U, 3510U}, {3351552U, 1U, 30U, 2852U}, {3351556U, 5631U, 28U, 512U}, {3375104U, 1U, 31U, 4095U}, {3375168U, 1U, 31U, 4095U}, {3375232U, 1U, 31U, 4095U}, {3375296U, 1U, 31U, 4095U}, {3375360U, 1U, 31U, 2340U}, {3375424U, 1U, 31U, 2340U}, {3375488U, 1U, 31U, 2340U}, {3375552U, 1U, 31U, 2340U}, {3375616U, 1U, 31U, 2340U}, {3375680U, 1U, 31U, 2340U}, {3375744U, 1U, 31U, 2340U}, {3375808U, 1U, 31U, 2340U}, {3375872U, 1U, 31U, 2340U}, {3375936U, 1U, 31U, 2340U}, {3376000U, 1U, 31U, 2340U}, {3376064U, 1U, 31U, 2340U}, {3376128U, 1U, 31U, 2340U}, {3376192U, 1U, 31U, 2340U}, {3376256U, 1U, 31U, 2340U}, {3376320U, 1U, 31U, 2340U}, {3376384U, 1U, 31U, 2340U}, {3376448U, 1U, 31U, 2340U}, {3376512U, 1U, 31U, 2340U}, {3376576U, 19U, 28U, 2340U}, {3377152U, 1U, 31U, 2340U}, {3377216U, 1U, 31U, 2340U}, {3377280U, 1U, 31U, 2340U}, {3377344U, 1U, 31U, 2340U}, {3377408U, 1U, 31U, 2340U}, {3377472U, 1U, 31U, 2340U}, {3377536U, 1U, 31U, 2340U}, {3377600U, 1U, 31U, 2340U}, {3377664U, 1U, 31U, 3364U}, {3377728U, 1U, 31U, 2340U}, {3377792U, 1U, 31U, 1170U}, {3377856U, 1U, 31U, 2340U}, {3377920U, 1U, 31U, 2340U}, {3377984U, 1U, 31U, 2340U}, {3378048U, 1U, 31U, 2340U}, {3378112U, 1U, 31U, 2340U}, {3378176U, 1U, 31U, 2340U}, {3378240U, 1U, 31U, 2340U}, {3378304U, 1U, 31U, 2340U}, {3378368U, 1U, 31U, 2340U}, {3378372U, 1U, 28U, 2340U}, {3378432U, 1U, 31U, 2340U}, {3378496U, 1U, 31U, 2340U}, {3378560U, 1U, 31U, 2340U}, {3378624U, 1U, 31U, 2340U}, {3378688U, 1U, 31U, 2340U}, {3378752U, 1U, 31U, 2340U}, {3378816U, 1U, 31U, 2340U}, {3378820U, 1U, 28U, 2340U}, {3378880U, 1U, 30U, 2340U}, {3378944U, 1U, 30U, 2340U}, {3379008U, 1U, 30U, 2340U}, {3379072U, 1U, 30U, 2340U}, {3379136U, 1U, 30U, 2340U}, {3379156U, 5U, 28U, 2340U}, {3379176U, 2U, 24U, 2340U}, {3379200U, 1U, 28U, 2340U}, {3379264U, 3U, 28U, 2340U}, {3379292U, 1U, 24U, 2340U}, {3379300U, 1U, 16U, 2340U}, {3379328U, 10U, 16U, 2340U}, {3407872U, 2U, 31U, 2340U}, {3801088U, 40960U, 28U, 4096U}}; static struct reg_addr const idle_reg_addrs[270U] = { {8452U, 1U, 31U, 4095U}, {8464U, 2U, 31U, 4095U}, {8476U, 8U, 31U, 4095U}, {10260U, 1U, 31U, 4095U}, {10268U, 2U, 31U, 4095U}, {10324U, 1U, 31U, 4095U}, {10332U, 1U, 31U, 4095U}, {12352U, 1U, 31U, 4095U}, {36880U, 7U, 28U, 4095U}, {36912U, 1U, 28U, 4095U}, {36968U, 16U, 28U, 4095U}, {37424U, 2U, 28U, 4095U}, {37444U, 1U, 28U, 4095U}, {37528U, 1U, 28U, 4095U}, {37544U, 1U, 28U, 8191U}, {41868U, 1U, 31U, 8191U}, {41924U, 1U, 30U, 4095U}, {41988U, 1U, 31U, 4095U}, {41992U, 2U, 31U, 8191U}, {42028U, 12U, 31U, 4095U}, {42368U, 1U, 31U, 8191U}, {42384U, 1U, 31U, 8191U}, {42496U, 5U, 30U, 4095U}, {42520U, 1U, 30U, 4095U}, {42772U, 1U, 28U, 4095U}, {42784U, 1U, 28U, 4095U}, {42832U, 1U, 28U, 4095U}, {49308U, 1U, 3U, 4095U}, {66480U, 1U, 31U, 4095U}, {66496U, 1U, 31U, 4095U}, {66512U, 1U, 3U, 8191U}, {66584U, 1U, 31U, 4095U}, {66592U, 1U, 31U, 4095U}, {66600U, 1U, 31U, 4095U}, {66656U, 1U, 31U, 4095U}, {66676U, 1U, 31U, 4095U}, {66784U, 1U, 31U, 4095U}, {66796U, 1U, 31U, 4095U}, {66808U, 1U, 31U, 4095U}, {66824U, 1U, 31U, 4095U}, {66864U, 1U, 31U, 4095U}, {66872U, 1U, 31U, 4095U}, {66888U, 1U, 31U, 4095U}, {66904U, 1U, 31U, 4095U}, {98984U, 1U, 28U, 4095U}, {99000U, 1U, 28U, 4095U}, {99080U, 1U, 28U, 4095U}, {99096U, 1U, 28U, 4095U}, {99128U, 1U, 28U, 4095U}, {99144U, 1U, 28U, 4095U}, {99260U, 1U, 28U, 8191U}, {99276U, 1U, 28U, 8191U}, {99696U, 1U, 24U, 4095U}, {99704U, 1U, 24U, 4095U}, {99724U, 1U, 24U, 4095U}, {99732U, 1U, 24U, 4095U}, {99884U, 4U, 16U, 4095U}, {131612U, 11U, 31U, 4095U}, {131752U, 1U, 31U, 4095U}, {131768U, 1U, 31U, 8191U}, {132100U, 1U, 31U, 4095U}, {132108U, 2U, 31U, 4095U}, {132124U, 2U, 31U, 4095U}, {262484U, 14U, 31U, 4095U}, {262552U, 1U, 31U, 8191U}, {263340U, 1U, 31U, 4095U}, {263356U, 1U, 31U, 8191U}, {270992U, 1U, 31U, 4095U}, {271008U, 1U, 31U, 4095U}, {271024U, 1U, 31U, 8191U}, {271688U, 1U, 31U, 4095U}, {271696U, 1U, 31U, 4095U}, {271704U, 1U, 31U, 4095U}, {328032U, 8U, 31U, 4095U}, {328144U, 1U, 31U, 4095U}, {328160U, 1U, 31U, 8191U}, {328196U, 1U, 31U, 4095U}, {328204U, 2U, 31U, 4095U}, {328220U, 1U, 31U, 4095U}, {393360U, 1U, 31U, 4095U}, {393500U, 1U, 31U, 4095U}, {393516U, 1U, 31U, 8191U}, {790556U, 1U, 31U, 4095U}, {790572U, 1U, 31U, 8191U}, {795280U, 1U, 31U, 4095U}, {795296U, 1U, 31U, 4095U}, {795312U, 1U, 31U, 8191U}, {795976U, 1U, 31U, 4095U}, {795984U, 1U, 31U, 4095U}, {795992U, 1U, 31U, 4095U}, {803476U, 1U, 31U, 4095U}, {803492U, 1U, 31U, 4095U}, {803508U, 1U, 31U, 8191U}, {804176U, 1U, 31U, 4095U}, {804184U, 1U, 31U, 4095U}, {804192U, 1U, 31U, 4095U}, {852332U, 8U, 31U, 4095U}, {852440U, 1U, 31U, 4095U}, {852456U, 1U, 31U, 8191U}, {852484U, 1U, 31U, 4095U}, {852492U, 3U, 31U, 4095U}, {917844U, 8U, 31U, 4095U}, {917960U, 1U, 31U, 4095U}, {917976U, 1U, 31U, 8191U}, {918020U, 1U, 31U, 4095U}, {918028U, 2U, 31U, 4095U}, {918044U, 2U, 31U, 4095U}, {1052692U, 1U, 31U, 4095U}, {1052720U, 1U, 31U, 4095U}, {1052736U, 1U, 31U, 8191U}, {1056856U, 1U, 31U, 8191U}, {1056896U, 16U, 31U, 4095U}, {1060868U, 2U, 31U, 4095U}, {1060968U, 1U, 31U, 4095U}, {1060984U, 1U, 31U, 4095U}, {1061000U, 1U, 31U, 8191U}, {1061020U, 2U, 30U, 4095U}, {1061048U, 2U, 28U, 4095U}, {1061068U, 1U, 28U, 4095U}, {1061088U, 1U, 28U, 4095U}, {1064964U, 1U, 31U, 4095U}, {1064984U, 1U, 31U, 4095U}, {1064992U, 1U, 31U, 4095U}, {1065020U, 1U, 31U, 4095U}, {1065212U, 1U, 31U, 4095U}, {1065228U, 1U, 31U, 8191U}, {1065984U, 1U, 31U, 8191U}, {1065988U, 63U, 31U, 4095U}, {1067008U, 1U, 31U, 8191U}, {1067012U, 63U, 31U, 4095U}, {1069056U, 4U, 31U, 8191U}, {1069072U, 252U, 31U, 4095U}, {1081492U, 1U, 3U, 4095U}, {1180080U, 2U, 31U, 4095U}, {1180460U, 1U, 31U, 4095U}, {1180524U, 3U, 31U, 4095U}, {1180680U, 2U, 31U, 4095U}, {1180692U, 15U, 31U, 4095U}, {1180792U, 2U, 31U, 4095U}, {1180972U, 1U, 31U, 4095U}, {1181028U, 3U, 31U, 4095U}, {1181052U, 1U, 31U, 8191U}, {1181068U, 1U, 31U, 8191U}, {1181192U, 1U, 30U, 4095U}, {1181512U, 1U, 28U, 4095U}, {1181560U, 2U, 28U, 4095U}, {1181704U, 3U, 31U, 4095U}, {1181720U, 1U, 31U, 4095U}, {1181728U, 1U, 31U, 4095U}, {1181736U, 1U, 31U, 4095U}, {1181744U, 1U, 31U, 4095U}, {1181752U, 1U, 31U, 4095U}, {1181760U, 1U, 31U, 4095U}, {1181768U, 1U, 31U, 4095U}, {1181776U, 1U, 31U, 4095U}, {1181784U, 1U, 31U, 4095U}, {1181792U, 1U, 31U, 4095U}, {1181800U, 1U, 31U, 4095U}, {1181808U, 1U, 31U, 4095U}, {1181816U, 1U, 31U, 4095U}, {1181824U, 1U, 31U, 4095U}, {1181832U, 1U, 31U, 4095U}, {1181840U, 1U, 31U, 4095U}, {1181848U, 1U, 31U, 4095U}, {1181856U, 1U, 31U, 4095U}, {1181864U, 1U, 31U, 4095U}, {1181872U, 1U, 31U, 4095U}, {1181880U, 1U, 31U, 4095U}, {1181888U, 1U, 31U, 4095U}, {1181896U, 1U, 31U, 4095U}, {1181904U, 1U, 31U, 4095U}, {1181912U, 1U, 31U, 4095U}, {1181920U, 1U, 31U, 4095U}, {1181928U, 1U, 31U, 4095U}, {1181936U, 1U, 31U, 4095U}, {1181944U, 1U, 31U, 4095U}, {1181952U, 1U, 31U, 4095U}, {1181960U, 1U, 31U, 4095U}, {1245232U, 1U, 28U, 4095U}, {1245260U, 3U, 28U, 4095U}, {1245284U, 2U, 28U, 4095U}, {1245340U, 1U, 28U, 8191U}, {1245488U, 1U, 28U, 4095U}, {1245548U, 1U, 28U, 4095U}, {1245952U, 1U, 28U, 4095U}, {1246336U, 1U, 28U, 4095U}, {1310812U, 2U, 15U, 4095U}, {1310928U, 2U, 15U, 4095U}, {1310944U, 1U, 15U, 4095U}, {1311176U, 1U, 15U, 4095U}, {1311232U, 6U, 15U, 4095U}, {1311544U, 7U, 16U, 4095U}, {1311600U, 7U, 16U, 4095U}, {1425852U, 6U, 16U, 4095U}, {1425968U, 7U, 16U, 4095U}, {1445916U, 1U, 31U, 4095U}, {1445932U, 1U, 31U, 8191U}, {1458196U, 2U, 31U, 4095U}, {1458416U, 1U, 31U, 4095U}, {1467024U, 1U, 31U, 4095U}, {1467040U, 1U, 31U, 4095U}, {1467056U, 1U, 31U, 8191U}, {1467720U, 1U, 31U, 4095U}, {1467728U, 1U, 31U, 4095U}, {1467736U, 1U, 31U, 4095U}, {1474560U, 1U, 31U, 4095U}, {1474568U, 1U, 31U, 4095U}, {1474576U, 1U, 31U, 4095U}, {1474584U, 1U, 31U, 4095U}, {1474600U, 2U, 31U, 4095U}, {1474648U, 9U, 31U, 4095U}, {1475128U, 1U, 31U, 4095U}, {1475280U, 7U, 31U, 4095U}, {1475328U, 2U, 3U, 4095U}, {1475336U, 65U, 31U, 4095U}, {1475600U, 2U, 31U, 4095U}, {1475640U, 1U, 31U, 4095U}, {1475656U, 1U, 31U, 8191U}, {1477120U, 128U, 31U, 4095U}, {1499648U, 128U, 2U, 4095U}, {1500164U, 2U, 2U, 4095U}, {1500548U, 64U, 2U, 4095U}, {1500804U, 2U, 30U, 4095U}, {1500812U, 4U, 2U, 4095U}, {1500924U, 4U, 28U, 4095U}, {1501100U, 12U, 16U, 4095U}, {1507492U, 1U, 31U, 4095U}, {1507500U, 2U, 31U, 4095U}, {1507520U, 1U, 31U, 4095U}, {1507700U, 1U, 31U, 4095U}, {1507716U, 1U, 31U, 8191U}, {1573108U, 1U, 31U, 4095U}, {1573124U, 1U, 31U, 4095U}, {1573140U, 1U, 31U, 8191U}, {1573156U, 1U, 31U, 8191U}, {1573484U, 1U, 31U, 4095U}, {1573536U, 1U, 31U, 4095U}, {1802240U, 1U, 31U, 4095U}, {1802304U, 1U, 31U, 4095U}, {1802368U, 1U, 31U, 4095U}, {1802432U, 1U, 31U, 4095U}, {2097412U, 1U, 31U, 4095U}, {2097428U, 1U, 31U, 4095U}, {2097444U, 1U, 31U, 8191U}, {2097460U, 1U, 31U, 8191U}, {2097772U, 1U, 31U, 4095U}, {2097824U, 1U, 31U, 4095U}, {2326528U, 1U, 31U, 4095U}, {2326592U, 1U, 31U, 4095U}, {2326656U, 1U, 31U, 4095U}, {2326720U, 1U, 31U, 4095U}, {2621700U, 1U, 31U, 4095U}, {2621716U, 1U, 31U, 4095U}, {2621732U, 1U, 31U, 8191U}, {2621748U, 1U, 31U, 8191U}, {2622060U, 1U, 31U, 4095U}, {2622112U, 1U, 31U, 4095U}, {2850816U, 1U, 31U, 4095U}, {2850880U, 1U, 31U, 4095U}, {2850944U, 1U, 31U, 4095U}, {3145988U, 1U, 31U, 4095U}, {3146004U, 1U, 31U, 4095U}, {3146020U, 1U, 31U, 8191U}, {3146036U, 1U, 31U, 8191U}, {3146348U, 1U, 31U, 4095U}, {3146400U, 1U, 31U, 4095U}, {3375104U, 1U, 31U, 4095U}, {3375168U, 1U, 31U, 4095U}, {3375232U, 1U, 31U, 4095U}, {3375296U, 1U, 31U, 4095U}}; static u32 const read_reg_e1[1U] = { 1773568U}; static struct wreg_addr const wreg_addr_e1 = {1772544U, 192U, 1U, (u32 const *)(& read_reg_e1), 31U, 8191U}; static u32 const read_reg_e1h[2U] = { 1773632U, 1773568U}; static struct wreg_addr const wreg_addr_e1h = {1772544U, 256U, 2U, (u32 const *)(& read_reg_e1h), 31U, 8191U}; static u32 const read_reg_e2[2U] = { 1773632U, 1773568U}; static struct wreg_addr const wreg_addr_e2 = {1772544U, 128U, 2U, (u32 const *)(& read_reg_e2), 31U, 8191U}; static u32 const read_reg_e3[2U] = { 1773632U, 1773568U}; static struct wreg_addr const wreg_addr_e3 = {1772544U, 128U, 2U, (u32 const *)(& read_reg_e3), 31U, 8191U}; static u32 const read_reg_e3b0[2U] = { 1773632U, 1773568U}; static struct wreg_addr const wreg_addr_e3b0 = {1772544U, 128U, 2U, (u32 const *)(& read_reg_e3b0), 31U, 8191U}; static unsigned int const dump_num_registers[5U][13U] = { { 19758U, 17543U, 26951U, 18705U, 17287U, 26695U, 19812U, 31367U, 40775U, 19788U, 25223U, 34631U, 19074U}, { 31750U, 18273U, 32253U, 30697U, 18017U, 31997U, 31804U, 32097U, 46077U, 31780U, 25953U, 39933U, 35895U}, { 36527U, 17928U, 33697U, 35474U, 18700U, 34466U, 36581U, 31752U, 47521U, 36557U, 25608U, 41377U, 43903U}, { 45239U, 17936U, 34387U, 44186U, 18708U, 35156U, 45293U, 31760U, 48211U, 45269U, 25616U, 42067U, 43903U}, { 45302U, 17999U, 34802U, 44249U, 18771U, 35571U, 45356U, 31823U, 48626U, 45332U, 25679U, 42482U, 43903U}}; static struct __anonstruct_bnx2x_blocks_parity_data_362 const bnx2x_blocks_parity_data___0[40U] = { {1061012U, 1061004U, 134217727U, {67108863U, 67108863U, 134217727U, 134217727U}, {'P', 'X', 'P', '\000'}}, {1181064U, 1181056U, 4294967295U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'P', 'X', 'P', '2', '_', '0', '\000'}}, {1181080U, 1181072U, 33554431U, {127U, 127U, 2047U, 33554431U}, {'P', 'X', 'P', '2', '_', '1', '\000'}}, {1081504U, 1081496U, 7U, {7U, 7U, 0U, 0U}, {'H', 'C', '\000'}}, {66524U, 66516U, 4294967295U, {1073741823U, 4294967295U, 0U, 0U}, {'N', 'I', 'G', '\000'}}, {99272U, 99264U, 4294967295U, {0U, 0U, 4294967295U, 4294967295U}, {'N', 'I', 'G', '_', '0', '\000'}}, {99288U, 99280U, 65535U, {0U, 0U, 255U, 65535U}, {'N', 'I', 'G', '_', '1', '\000'}}, {1245352U, 1245344U, 2047U, {0U, 0U, 2047U, 2047U}, {'I', 'G', 'U', '\000'}}, {41880U, 41872U, 1U, {1U, 1U, 1U, 1U}, {'M', 'I', 'S', 'C', '\000'}}, {1475668U, 1475660U, 0U, {511U, 4095U, 4095U, 4095U}, {'Q', 'M', '\000'}}, {1114584U, 1114576U, 31U, {0U, 0U, 31U, 31U}, {'A', 'T', 'C', '\000'}}, {37556U, 37548U, 3U, {0U, 0U, 3U, 3U}, {'P', 'G', 'L', 'U', 'E', '_', 'B', '\000'}}, {1507728U, 1507720U, 0U, {3U, 3U, 3U, 3U}, {'D', 'O', 'R', 'Q', '\000'}}, {790584U, 790576U, 15U, {15U, 15U, 15U, 15U}, {'U', 'P', 'B', '\000'}}, {1445944U, 1445936U, 0U, {15U, 15U, 15U, 15U}, {'X', 'P', 'B', '\000'}}, {263368U, 263360U, 4U, {7U, 7U, 7U, 7U}, {'S', 'R', 'C', '\000'}}, {1052748U, 1052740U, 0U, {31U, 31U, 31U, 31U}, {'C', 'D', 'U', '\000'}}, {1065240U, 1065232U, 0U, {15U, 15U, 15U, 63U}, {'C', 'F', 'C', '\000'}}, {49320U, 49312U, 0U, {1U, 1U, 1U, 1U}, {'D', 'B', 'G', '\000'}}, {1056868U, 1056860U, 0U, {15U, 15U, 15U, 15U}, {'D', 'M', 'A', 'E', '\000'}}, {393528U, 393520U, 0U, {15U, 15U, 15U, 15U}, {'B', 'R', 'B', '1', '\000'}}, {262564U, 262556U, 64U, {255U, 255U, 255U, 255U}, {'P', 'R', 'S', '\000'}}, {1311204U, 1311196U, 0U, {0U, 262143U, 1048575U, 268435455U}, {'P', 'B', 'F', '\000'}}, {1458444U, 1458436U, 0U, {0U, 127U, 127U, 127U}, {'T', 'M', '\000'}}, {271036U, 271028U, 24U, {2047U, 2047U, 2047U, 2047U}, {'T', 'S', 'D', 'M', '\000'}}, {795324U, 795316U, 8U, {2047U, 2047U, 2047U, 2047U}, {'C', 'S', 'D', 'M', '\000'}}, {803520U, 803512U, 56U, {2047U, 2047U, 2047U, 2047U}, {'U', 'S', 'D', 'M', '\000'}}, {1467068U, 1467060U, 8U, {2047U, 2047U, 2047U, 2047U}, {'X', 'S', 'D', 'M', '\000'}}, {328172U, 328164U, 0U, {0U, 134217727U, 134217727U, 134217727U}, {'T', 'C', 'M', '\000'}}, {852468U, 852460U, 0U, {0U, 134217727U, 134217727U, 134217727U}, {'C', 'C', 'M', '\000'}}, {917988U, 917980U, 0U, {0U, 134217727U, 134217727U, 134217727U}, {'U', 'C', 'M', '\000'}}, {131780U, 131772U, 0U, {0U, 1073741823U, 1073741823U, 1073741823U}, {'X', 'C', 'M', '\000'}}, {1573152U, 1573144U, 0U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'T', 'S', 'E', 'M', '_', '0', '\000'}}, {1573168U, 1573160U, 0U, {3U, 31U, 63U, 63U}, {'T', 'S', 'E', 'M', '_', '1', '\000'}}, {3146032U, 3146024U, 0U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'U', 'S', 'E', 'M', '_', '0', '\000'}}, {3146048U, 3146040U, 0U, {3U, 31U, 31U, 31U}, {'U', 'S', 'E', 'M', '_', '1', '\000'}}, {2097456U, 2097448U, 0U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'C', 'S', 'E', 'M', '_', '0', '\000'}}, {2097472U, 2097464U, 0U, {3U, 31U, 31U, 31U}, {'C', 'S', 'E', 'M', '_', '1', '\000'}}, {2621744U, 2621736U, 0U, {4294967295U, 4294967295U, 4294967295U, 4294967295U}, {'X', 'S', 'E', 'M', '_', '0', '\000'}}, {2621760U, 2621752U, 0U, {3U, 31U, 63U, 63U}, {'X', 'S', 'E', 'M', '_', '1', '\000'}}}; static struct __anonstruct_mcp_attn_ctl_regs_364 const mcp_attn_ctl_regs___0[6U] = { {41080U, 4026531840U}, {41208U, 1879048192U}, {41224U, 1879048192U}, {41240U, 4026531840U}, {41368U, 1879048192U}, {41384U, 1879048192U}}; __inline static void bnx2x_set_mcp_parity___0(struct bnx2x *bp , u8 enable ) { int i ; u32 reg_val ; { i = 0; goto ldv_51865; ldv_51864: reg_val = readl((void const volatile *)bp->regview + (unsigned long )mcp_attn_ctl_regs___0[i].addr); if ((unsigned int )enable != 0U) { reg_val = (u32 )mcp_attn_ctl_regs___0[i].bits | reg_val; } else { reg_val = (u32 )(~ mcp_attn_ctl_regs___0[i].bits) & reg_val; } writel(reg_val, (void volatile *)bp->regview + (unsigned long )mcp_attn_ctl_regs___0[i].addr); i = i + 1; ldv_51865: ; if ((unsigned int )i <= 5U) { goto ldv_51864; } else { } return; } } __inline static u32 bnx2x_parity_reg_mask___0(struct bnx2x *bp , int idx ) { { if (bp->common.chip_id >> 16 == 5710U) { return ((u32 )bnx2x_blocks_parity_data___0[idx].reg_mask.e1); } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { return ((u32 )bnx2x_blocks_parity_data___0[idx].reg_mask.e1h); } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return ((u32 )bnx2x_blocks_parity_data___0[idx].reg_mask.e2); } else { return ((u32 )bnx2x_blocks_parity_data___0[idx].reg_mask.e3); } } } __inline static void bnx2x_disable_blocks_parity(struct bnx2x *bp ) { int i ; u32 dis_mask ; u32 tmp ; long tmp___0 ; { i = 0; goto ldv_51880; ldv_51879: tmp = bnx2x_parity_reg_mask___0(bp, i); dis_mask = tmp; if (dis_mask != 0U) { writel(dis_mask, (void volatile *)bp->regview + (unsigned long )bnx2x_blocks_parity_data___0[i].mask_addr); tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting parity mask for %s to\t\t0x%x\n", "bnx2x_disable_blocks_parity", 715, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (char const *)(& bnx2x_blocks_parity_data___0[i].name), dis_mask); } else { } } else { } i = i + 1; ldv_51880: ; if ((unsigned int )i <= 39U) { goto ldv_51879; } else { } bnx2x_set_mcp_parity___0(bp, 0); return; } } __inline static void bnx2x_clear_blocks_parity(struct bnx2x *bp ) { int i ; u32 reg_val ; u32 mcp_aeu_bits ; u32 reg_mask ; u32 tmp ; long tmp___0 ; long tmp___1 ; { mcp_aeu_bits = 4026531840U; writel(1U, (void volatile *)bp->regview + 2852928U); writel(1U, (void volatile *)bp->regview + 1804352U); writel(1U, (void volatile *)bp->regview + 3377216U); writel(1U, (void volatile *)bp->regview + 2328640U); i = 0; goto ldv_51893; ldv_51892: tmp = bnx2x_parity_reg_mask___0(bp, i); reg_mask = tmp; if (reg_mask != 0U) { reg_val = readl((void const volatile *)bp->regview + (unsigned long )bnx2x_blocks_parity_data___0[i].sts_clr_addr); if ((reg_val & reg_mask) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Parity errors in %s: 0x%x\n", "bnx2x_clear_blocks_parity", 749, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (char const *)(& bnx2x_blocks_parity_data___0[i].name), reg_val & reg_mask); } else { } } else { } } else { } i = i + 1; ldv_51893: ; if ((unsigned int )i <= 39U) { goto ldv_51892; } else { } reg_val = readl((void const volatile *)bp->regview + 42072U); if ((reg_val & mcp_aeu_bits) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Parity error in MCP: 0x%x\n", "bnx2x_clear_blocks_parity", 757, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", reg_val & mcp_aeu_bits); } else { } } else { } writel(1920U, (void volatile *)bp->regview + 42076U); return; } } __inline static void bnx2x_enable_blocks_parity___0(struct bnx2x *bp ) { int i ; u32 reg_mask ; u32 tmp ; { i = 0; goto ldv_51903; ldv_51902: tmp = bnx2x_parity_reg_mask___0(bp, i); reg_mask = tmp; if (reg_mask != 0U) { writel((unsigned int )bnx2x_blocks_parity_data___0[i].en_mask & reg_mask, (void volatile *)bp->regview + (unsigned long )bnx2x_blocks_parity_data___0[i].mask_addr); } else { } i = i + 1; ldv_51903: ; if ((unsigned int )i <= 39U) { goto ldv_51902; } else { } bnx2x_set_mcp_parity___0(bp, 1); return; } } static struct __anonstruct_bnx2x_q_stats_arr_369 const bnx2x_q_stats_arr[16U] = { {6L, 8, {'[', '%', 's', ']', ':', ' ', 'r', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {16L, 8, {'[', '%', 's', ']', ':', ' ', 'r', 'x', '_', 'u', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {18L, 8, {'[', '%', 's', ']', ':', ' ', 'r', 'x', '_', 'm', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {20L, 8, {'[', '%', 's', ']', ':', ' ', 'r', 'x', '_', 'b', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {32L, 8, {'[', '%', 's', ']', ':', ' ', 'r', 'x', '_', 'd', 'i', 's', 'c', 'a', 'r', 'd', 's', '\000'}}, {35L, 4, {'[', '%', 's', ']', ':', ' ', 'r', 'x', '_', 'p', 'h', 'y', '_', 'i', 'p', '_', 'e', 'r', 'r', '_', 'd', 'i', 's', 'c', 'a', 'r', 'd', 's', '\000'}}, {36L, 4, {'[', '%', 's', ']', ':', ' ', 'r', 'x', '_', 's', 'k', 'b', '_', 'a', 'l', 'l', 'o', 'c', '_', 'd', 'i', 's', 'c', 'a', 'r', 'd', '\000'}}, {37L, 4, {'[', '%', 's', ']', ':', ' ', 'r', 'x', '_', 'c', 's', 'u', 'm', '_', 'o', 'f', 'f', 'l', 'o', 'a', 'd', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}}, {14L, 8, {'[', '%', 's', ']', ':', ' ', 't', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {22L, 8, {'[', '%', 's', ']', ':', ' ', 't', 'x', '_', 'u', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {24L, 8, {'[', '%', 's', ']', ':', ' ', 't', 'x', '_', 'm', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {26L, 8, {'[', '%', 's', ']', ':', ' ', 't', 'x', '_', 'b', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {44L, 8, {'[', '%', 's', ']', ':', ' ', 't', 'p', 'a', '_', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'i', 'o', 'n', 's', '\000'}}, {46L, 8, {'[', '%', 's', ']', ':', ' ', 't', 'p', 'a', '_', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '\000'}}, {48L, 8, {'[', '%', 's', ']', ':', ' ', 't', 'p', 'a', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {50L, 4, {'[', '%', 's', ']', ':', ' ', 'd', 'r', 'i', 'v', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', 'e', 'd', '_', 't', 'x', '_', 'p', 'k', 't', '\000'}}}; static struct __anonstruct_bnx2x_stats_arr_370 const bnx2x_stats_arr[52U] = { {0L, 8, 3U, {'r', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {18L, 8, 3U, {'r', 'x', '_', 'e', 'r', 'r', 'o', 'r', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {4L, 8, 3U, {'r', 'x', '_', 'u', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {6L, 8, 3U, {'r', 'x', '_', 'm', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {8L, 8, 3U, {'r', 'x', '_', 'b', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {28L, 8, 1U, {'r', 'x', '_', 'c', 'r', 'c', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}}, {30L, 8, 1U, {'r', 'x', '_', 'a', 'l', 'i', 'g', 'n', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}}, {36L, 8, 1U, {'r', 'x', '_', 'u', 'n', 'd', 'e', 'r', 's', 'i', 'z', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {20L, 8, 1U, {'r', 'x', '_', 'o', 'v', 'e', 'r', 's', 'i', 'z', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {40L, 8, 1U, {'r', 'x', '_', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', '\000'}}, {42L, 8, 1U, {'r', 'x', '_', 'j', 'a', 'b', 'b', 'e', 'r', 's', '\000'}}, {22L, 8, 3U, {'r', 'x', '_', 'd', 'i', 's', 'c', 'a', 'r', 'd', 's', '\000'}}, {112L, 4, 1U, {'r', 'x', '_', 'f', 'i', 'l', 't', 'e', 'r', 'e', 'd', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {113L, 4, 1U, {'r', 'x', '_', 'm', 'f', '_', 't', 'a', 'g', '_', 'd', 'i', 's', 'c', 'a', 'r', 'd', '\000'}}, {127L, 8, 1U, {'p', 'f', 'c', '_', 'f', 'r', 'a', 'm', 'e', 's', '_', 'r', 'e', 'c', 'e', 'i', 'v', 'e', 'd', '\000'}}, {129L, 8, 1U, {'p', 'f', 'c', '_', 'f', 'r', 'a', 'm', 'e', 's', '_', 's', 'e', 'n', 't', '\000'}}, {108L, 8, 1U, {'r', 'x', '_', 'b', 'r', 'b', '_', 'd', 'i', 's', 'c', 'a', 'r', 'd', '\000'}}, {110L, 8, 1U, {'r', 'x', '_', 'b', 'r', 'b', '_', 't', 'r', 'u', 'n', 'c', 'a', 't', 'e', '\000'}}, {100L, 8, 1U, {'r', 'x', '_', 'p', 'a', 'u', 's', 'e', '_', 'f', 'r', 'a', 'm', 'e', 's', '\000'}}, {44L, 8, 1U, {'r', 'x', '_', 'm', 'a', 'c', '_', 'c', 't', 'r', 'l', '_', 'f', 'r', 'a', 'm', 'e', 's', '\000'}}, {120L, 4, 1U, {'r', 'x', '_', 'c', 'o', 'n', 's', 't', 'a', 'n', 't', '_', 'p', 'a', 'u', 's', 'e', '_', 'e', 'v', 'e', 'n', 't', 's', '\000'}}, {117L, 4, 3U, {'r', 'x', '_', 'p', 'h', 'y', '_', 'i', 'p', '_', 'e', 'r', 'r', '_', 'd', 'i', 's', 'c', 'a', 'r', 'd', 's', '\000'}}, {118L, 4, 3U, {'r', 'x', '_', 's', 'k', 'b', '_', 'a', 'l', 'l', 'o', 'c', '_', 'd', 'i', 's', 'c', 'a', 'r', 'd', '\000'}}, {119L, 4, 3U, {'r', 'x', '_', 'c', 's', 'u', 'm', '_', 'o', 'f', 'f', 'l', 'o', 'a', 'd', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}}, {2L, 8, 3U, {'t', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {26L, 8, 1U, {'t', 'x', '_', 'e', 'r', 'r', 'o', 'r', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {10L, 8, 3U, {'t', 'x', '_', 'u', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {12L, 8, 3U, {'t', 'x', '_', 'm', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {14L, 8, 3U, {'t', 'x', '_', 'b', 'c', 'a', 's', 't', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {96L, 8, 1U, {'t', 'x', '_', 'm', 'a', 'c', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}}, {32L, 8, 1U, {'t', 'x', '_', 'c', 'a', 'r', 'r', 'i', 'e', 'r', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}}, {64L, 8, 1U, {'t', 'x', '_', 's', 'i', 'n', 'g', 'l', 'e', '_', 'c', 'o', 'l', 'l', 'i', 's', 'i', 'o', 'n', 's', '\000'}}, {66L, 8, 1U, {'t', 'x', '_', 'm', 'u', 'l', 't', 'i', '_', 'c', 'o', 'l', 'l', 'i', 's', 'i', 'o', 'n', 's', '\000'}}, {68L, 8, 1U, {'t', 'x', '_', 'd', 'e', 'f', 'e', 'r', 'r', 'e', 'd', '\000'}}, {70L, 8, 1U, {'t', 'x', '_', 'e', 'x', 'c', 'e', 's', 's', '_', 'c', 'o', 'l', 'l', 'i', 's', 'i', 'o', 'n', 's', '\000'}}, {72L, 8, 1U, {'t', 'x', '_', 'l', 'a', 't', 'e', '_', 'c', 'o', 'l', 'l', 'i', 's', 'i', 'o', 'n', 's', '\000'}}, {62L, 8, 1U, {'t', 'x', '_', 't', 'o', 't', 'a', 'l', '_', 'c', 'o', 'l', 'l', 'i', 's', 'i', 'o', 'n', 's', '\000'}}, {74L, 8, 1U, {'t', 'x', '_', '6', '4', '_', 'b', 'y', 't', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {76L, 8, 1U, {'t', 'x', '_', '6', '5', '_', 't', 'o', '_', '1', '2', '7', '_', 'b', 'y', 't', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {78L, 8, 1U, {'t', 'x', '_', '1', '2', '8', '_', 't', 'o', '_', '2', '5', '5', '_', 'b', 'y', 't', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {80L, 8, 1U, {'t', 'x', '_', '2', '5', '6', '_', 't', 'o', '_', '5', '1', '1', '_', 'b', 'y', 't', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {82L, 8, 1U, {'t', 'x', '_', '5', '1', '2', '_', 't', 'o', '_', '1', '0', '2', '3', '_', 'b', 'y', 't', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {104L, 8, 1U, {'t', 'x', '_', '1', '0', '2', '4', '_', 't', 'o', '_', '1', '5', '2', '2', '_', 'b', 'y', 't', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {106L, 8, 1U, {'t', 'x', '_', '1', '5', '2', '3', '_', 't', 'o', '_', '9', '0', '2', '2', '_', 'b', 'y', 't', 'e', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}}, {102L, 8, 1U, {'t', 'x', '_', 'p', 'a', 'u', 's', 'e', '_', 'f', 'r', 'a', 'm', 'e', 's', '\000'}}, {121L, 8, 2U, {'t', 'p', 'a', '_', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'i', 'o', 'n', 's', '\000'}}, {123L, 8, 2U, {'t', 'p', 'a', '_', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '\000'}}, {125L, 8, 2U, {'t', 'p', 'a', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {131L, 4, 2U, {'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}}, {132L, 4, 2U, {'u', 'n', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}}, {133L, 4, 2U, {'d', 'r', 'i', 'v', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', 'e', 'd', '_', 't', 'x', '_', 'p', 'k', 't', '\000'}}, {134L, 4, 1U, {'T', 'x', ' ', 'L', 'P', 'I', ' ', 'e', 'n', 't', 'r', 'y', ' ', 'c', 'o', 'u', 'n', 't', '\000'}}}; static int bnx2x_get_port_type(struct bnx2x *bp ) { int port_type ; u32 phy_idx ; int tmp ; { tmp = bnx2x_get_cur_phy_idx(bp); phy_idx = (u32 )tmp; switch (bp->link_params.phy[phy_idx].media_type) { case 1U: ; case 5U: ; case 2U: ; case 240U: ; case 241U: port_type = 3; goto ldv_51926; case 3U: port_type = 5; goto ldv_51926; case 4U: port_type = 0; goto ldv_51926; case 255U: port_type = 239; goto ldv_51926; case 0U: ; default: port_type = 255; goto ldv_51926; } ldv_51926: ; return (port_type); } } static int bnx2x_get_vf_settings(struct net_device *dev , struct ethtool_cmd *cmd ) { struct bnx2x *bp ; void *tmp ; int tmp___0 ; __u32 tmp___1 ; long tmp___2 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((unsigned int )bp->state == 12288U) { tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& bp->vf_link_vars.link_report_flags)); if (tmp___0 != 0) { cmd->duplex = 1U; } else { cmd->duplex = 0U; } ethtool_cmd_speed_set(cmd, (__u32 )bp->vf_link_vars.line_speed); } else { cmd->duplex = 255U; ethtool_cmd_speed_set(cmd, 4294967295U); } cmd->port = 255U; cmd->phy_address = 0U; cmd->transceiver = 0U; cmd->autoneg = 0U; cmd->maxtxpkt = 0U; cmd->maxrxpkt = 0U; tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { tmp___1 = ethtool_cmd_speed((struct ethtool_cmd const *)cmd); printk("\rbnx2x: [%s:%d(%s)]ethtool_cmd: cmd %d\n supported 0x%x advertising 0x%x speed %u\n duplex %d port %d phy_address %d transceiver %d\n autoneg %d maxtxpkt %d maxrxpkt %d\n", "bnx2x_get_vf_settings", 251, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cmd->cmd, cmd->supported, cmd->advertising, tmp___1, (int )cmd->duplex, (int )cmd->port, (int )cmd->phy_address, (int )cmd->transceiver, (int )cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt); } else { } return (0); } } static int bnx2x_get_settings(struct net_device *dev , struct ethtool_cmd *cmd ) { struct bnx2x *bp ; void *tmp ; int cfg_idx ; int tmp___0 ; u32 media_type ; int tmp___1 ; u16 tmp___2 ; int tmp___3 ; u32 status ; __u32 tmp___4 ; long tmp___5 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = bnx2x_get_link_cfg_idx(bp); cfg_idx = tmp___0; cmd->supported = bp->port.supported[cfg_idx] | (bp->port.supported[cfg_idx ^ 1] & 1152U); cmd->advertising = bp->port.advertising[cfg_idx]; tmp___1 = bnx2x_get_cur_phy_idx(bp); media_type = bp->link_params.phy[tmp___1].media_type; if (media_type == 5U) { cmd->supported = cmd->supported & 4294963199U; cmd->advertising = cmd->advertising & 4294963199U; } else { } if (((unsigned int )bp->state == 12288U && (unsigned int )bp->link_vars.link_up != 0U) && (bp->flags & 2048U) == 0U) { cmd->duplex = (__u8 )bp->link_vars.duplex; if ((unsigned int )bp->mf_mode != 0U && (bp->flags & 512U) == 0U) { tmp___2 = bnx2x_get_mf_speed(bp); ethtool_cmd_speed_set(cmd, (__u32 )tmp___2); } else { ethtool_cmd_speed_set(cmd, (__u32 )bp->link_vars.line_speed); } } else { cmd->duplex = 255U; ethtool_cmd_speed_set(cmd, 4294967295U); } tmp___3 = bnx2x_get_port_type(bp); cmd->port = (__u8 )tmp___3; cmd->phy_address = (__u8 )bp->mdio.prtad; cmd->transceiver = 0U; if ((unsigned int )bp->link_params.req_line_speed[cfg_idx] == 0U) { cmd->autoneg = 1U; } else { cmd->autoneg = 0U; } if ((bp->link_vars.link_status & 64U) != 0U) { status = bp->link_vars.link_status; cmd->lp_advertising = cmd->lp_advertising | 64U; if ((status & 262144U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 8192U; } else { } if ((status & 524288U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 16384U; } else { } if ((status & 32768U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 1U; } else { } if ((status & 16384U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 2U; } else { } if ((status & 8192U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 4U; } else { } if ((status & 4096U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 8U; } else { } if ((status & 1024U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 16U; } else { } if ((status & 512U) != 0U) { if (media_type == 240U) { cmd->lp_advertising = cmd->lp_advertising | 131072U; } else { cmd->lp_advertising = cmd->lp_advertising | 32U; } } else { } if ((status & 2097152U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 32768U; } else { } if ((status & 8388608U) != 0U) { if (media_type == 240U) { cmd->lp_advertising = cmd->lp_advertising | 524288U; } else { cmd->lp_advertising = cmd->lp_advertising | 4096U; } } else { } if ((status & 268435456U) != 0U) { cmd->lp_advertising = cmd->lp_advertising | 4194304U; } else { } } else { } cmd->maxtxpkt = 0U; cmd->maxrxpkt = 0U; tmp___5 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___5 != 0L) { tmp___4 = ethtool_cmd_speed((struct ethtool_cmd const *)cmd); printk("\rbnx2x: [%s:%d(%s)]ethtool_cmd: cmd %d\n supported 0x%x advertising 0x%x speed %u\n duplex %d port %d phy_address %d transceiver %d\n autoneg %d maxtxpkt %d maxrxpkt %d\n", "bnx2x_get_settings", 350, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cmd->cmd, cmd->supported, cmd->advertising, tmp___4, (int )cmd->duplex, (int )cmd->port, (int )cmd->phy_address, (int )cmd->transceiver, (int )cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt); } else { } return (0); } } static int bnx2x_set_settings(struct net_device *dev , struct ethtool_cmd *cmd ) { struct bnx2x *bp ; void *tmp ; u32 advertising ; u32 cfg_idx ; u32 old_multi_phy_config ; u32 new_multi_phy_config ; u32 speed ; u32 phy_idx ; __u32 tmp___0 ; long tmp___1 ; u32 part ; u32 line_speed ; long tmp___2 ; long tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; int tmp___8 ; int tmp___9 ; long tmp___10 ; u32 an_supported_speed ; long tmp___11 ; long tmp___12 ; long tmp___13 ; long tmp___14 ; long tmp___15 ; long tmp___16 ; long tmp___17 ; long tmp___18 ; long tmp___19 ; long tmp___20 ; long tmp___21 ; int tmp___22 ; long tmp___23 ; long tmp___24 ; long tmp___25 ; bool tmp___26 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((unsigned int )bp->mf_mode == 1U) { return (0); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { tmp___0 = ethtool_cmd_speed((struct ethtool_cmd const *)cmd); printk("\rbnx2x: [%s:%d(%s)]ethtool_cmd: cmd %d\n supported 0x%x advertising 0x%x speed %u\n duplex %d port %d phy_address %d transceiver %d\n autoneg %d maxtxpkt %d maxrxpkt %d\n", "bnx2x_set_settings", 371, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cmd->cmd, cmd->supported, cmd->advertising, tmp___0, (int )cmd->duplex, (int )cmd->port, (int )cmd->phy_address, (int )cmd->transceiver, (int )cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt); } else { } speed = ethtool_cmd_speed((struct ethtool_cmd const *)cmd); if ((unsigned int )cmd->duplex == 255U) { cmd->duplex = 1U; } else { } if ((unsigned int )bp->mf_mode == 2U) { line_speed = (u32 )bp->link_vars.line_speed; if (line_speed == 0U) { line_speed = 10000U; } else { } if (bp->common.bc_ver <= 393729U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]To set speed BC %X or higher is required, please upgrade BC\n", "bnx2x_set_settings", 390, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", 393730); } else { } return (-22); } else { } part = (speed * 100U) / line_speed; if (line_speed < speed || part == 0U) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Speed setting should be in a range from 1%% to 100%% of actual line speed\n", "bnx2x_set_settings", 398, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((unsigned int )bp->state != 12288U) { bp->pending_max = part; } else { bnx2x_update_max_mf_config(bp, part); } return (0); } else { } tmp___4 = bnx2x_get_link_cfg_idx(bp); cfg_idx = (u32 )tmp___4; old_multi_phy_config = bp->link_params.multi_phy_config; tmp___8 = bnx2x_get_port_type(bp); if ((int )cmd->port != tmp___8) { switch ((int )cmd->port) { case 0: ; if ((bp->port.supported[0] & 128U) == 0U && (bp->port.supported[1] & 128U) == 0U) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unsupported port type\n", "bnx2x_set_settings", 419, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bp->link_params.multi_phy_config = bp->link_params.multi_phy_config & 4294967288U; if ((bp->link_params.multi_phy_config & 8U) != 0U) { bp->link_params.multi_phy_config = bp->link_params.multi_phy_config | 2U; } else { bp->link_params.multi_phy_config = bp->link_params.multi_phy_config | 1U; } goto ldv_51962; case 3: ; case 5: ; case 239: ; if ((bp->port.supported[0] & 1024U) == 0U && (bp->port.supported[1] & 1024U) == 0U) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unsupported port type\n", "bnx2x_set_settings", 438, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bp->link_params.multi_phy_config = bp->link_params.multi_phy_config & 4294967288U; if ((bp->link_params.multi_phy_config & 8U) != 0U) { bp->link_params.multi_phy_config = bp->link_params.multi_phy_config | 1U; } else { bp->link_params.multi_phy_config = bp->link_params.multi_phy_config | 2U; } goto ldv_51962; default: tmp___7 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unsupported port type\n", "bnx2x_set_settings", 452, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } ldv_51962: ; } else { } new_multi_phy_config = bp->link_params.multi_phy_config; tmp___9 = bnx2x_get_link_cfg_idx(bp); cfg_idx = (u32 )tmp___9; bp->link_params.multi_phy_config = old_multi_phy_config; tmp___10 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___10 != 0L) { printk("\rbnx2x: [%s:%d(%s)]cfg_idx = %x\n", "bnx2x_set_settings", 462, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cfg_idx); } else { } if ((unsigned int )cmd->autoneg == 1U) { an_supported_speed = bp->port.supported[cfg_idx]; if (bp->link_params.phy[1].type == 3328U) { an_supported_speed = an_supported_speed | 12U; } else { } if ((bp->port.supported[cfg_idx] & 64U) == 0U) { tmp___11 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Autoneg not supported\n", "bnx2x_set_settings", 471, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((cmd->advertising & ~ an_supported_speed) != 0U) { tmp___12 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___12 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Advertisement parameters are not supported\n", "bnx2x_set_settings", 478, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bp->link_params.req_line_speed[cfg_idx] = 0U; bp->link_params.req_duplex[cfg_idx] = (u16 )cmd->duplex; bp->port.advertising[cfg_idx] = cmd->advertising | 64U; if (cmd->advertising != 0U) { bp->link_params.speed_cap_mask[cfg_idx] = 0U; if ((int )cmd->advertising & 1) { bp->link_params.speed_cap_mask[cfg_idx] = bp->link_params.speed_cap_mask[cfg_idx] | 131072U; } else { } if ((cmd->advertising & 2U) != 0U) { bp->link_params.speed_cap_mask[cfg_idx] = bp->link_params.speed_cap_mask[cfg_idx] | 65536U; } else { } if ((cmd->advertising & 8U) != 0U) { bp->link_params.speed_cap_mask[cfg_idx] = bp->link_params.speed_cap_mask[cfg_idx] | 524288U; } else { } if ((cmd->advertising & 4U) != 0U) { bp->link_params.speed_cap_mask[cfg_idx] = bp->link_params.speed_cap_mask[cfg_idx] | 262144U; } else { } if ((cmd->advertising & 16U) != 0U) { bp->link_params.speed_cap_mask[cfg_idx] = bp->link_params.speed_cap_mask[cfg_idx] | 1048576U; } else { } if ((cmd->advertising & 131104U) != 0U) { bp->link_params.speed_cap_mask[cfg_idx] = bp->link_params.speed_cap_mask[cfg_idx] | 1048576U; } else { } if ((cmd->advertising & 790528U) != 0U) { bp->link_params.speed_cap_mask[cfg_idx] = bp->link_params.speed_cap_mask[cfg_idx] | 4194304U; } else { } if ((cmd->advertising & 4194304U) != 0U) { bp->link_params.speed_cap_mask[cfg_idx] = bp->link_params.speed_cap_mask[cfg_idx] | 8388608U; } else { } } else { } } else { switch (speed) { case 10U: ; if ((unsigned int )cmd->duplex == 1U) { if ((bp->port.supported[cfg_idx] & 2U) == 0U) { tmp___13 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___13 != 0L) { printk("\rbnx2x: [%s:%d(%s)]10M full not supported\n", "bnx2x_set_settings", 532, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } advertising = 130U; } else { if ((bp->port.supported[cfg_idx] & 1U) == 0U) { tmp___14 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___14 != 0L) { printk("\rbnx2x: [%s:%d(%s)]10M half not supported\n", "bnx2x_set_settings", 542, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } advertising = 129U; } goto ldv_51969; case 100U: ; if ((unsigned int )cmd->duplex == 1U) { if ((bp->port.supported[cfg_idx] & 8U) == 0U) { tmp___15 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___15 != 0L) { printk("\rbnx2x: [%s:%d(%s)]100M full not supported\n", "bnx2x_set_settings", 556, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } advertising = 136U; } else { if ((bp->port.supported[cfg_idx] & 4U) == 0U) { tmp___16 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___16 != 0L) { printk("\rbnx2x: [%s:%d(%s)]100M half not supported\n", "bnx2x_set_settings", 566, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } advertising = 132U; } goto ldv_51969; case 1000U: ; if ((unsigned int )cmd->duplex != 1U) { tmp___17 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___17 != 0L) { printk("\rbnx2x: [%s:%d(%s)]1G half not supported\n", "bnx2x_set_settings", 578, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((bp->port.supported[cfg_idx] & 32U) != 0U) { advertising = 160U; } else if ((bp->port.supported[cfg_idx] & 131072U) != 0U) { advertising = 131072U; } else { tmp___18 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___18 != 0L) { printk("\rbnx2x: [%s:%d(%s)]1G full not supported\n", "bnx2x_set_settings", 592, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } goto ldv_51969; case 2500U: ; if ((unsigned int )cmd->duplex != 1U) { tmp___19 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___19 != 0L) { printk("\rbnx2x: [%s:%d(%s)]2.5G half not supported\n", "bnx2x_set_settings", 601, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((bp->port.supported[cfg_idx] & 32768U) == 0U) { tmp___20 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___20 != 0L) { printk("\rbnx2x: [%s:%d(%s)]2.5G full not supported\n", "bnx2x_set_settings", 608, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } advertising = 32896U; goto ldv_51969; case 10000U: ; if ((unsigned int )cmd->duplex != 1U) { tmp___21 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___21 != 0L) { printk("\rbnx2x: [%s:%d(%s)]10G half not supported\n", "bnx2x_set_settings", 619, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } tmp___22 = bnx2x_get_cur_phy_idx(bp); phy_idx = (u32 )tmp___22; if ((bp->port.supported[cfg_idx] & 4096U) != 0U && bp->link_params.phy[phy_idx].media_type != 5U) { advertising = 5120U; } else if ((bp->port.supported[cfg_idx] & 524288U) != 0U) { advertising = 525312U; } else { tmp___23 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___23 != 0L) { printk("\rbnx2x: [%s:%d(%s)]10G full not supported\n", "bnx2x_set_settings", 635, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } goto ldv_51969; default: tmp___24 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___24 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unsupported speed %u\n", "bnx2x_set_settings", 642, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", speed); } else { } return (-22); } ldv_51969: bp->link_params.req_line_speed[cfg_idx] = (u16 )speed; bp->link_params.req_duplex[cfg_idx] = (u16 )cmd->duplex; bp->port.advertising[cfg_idx] = advertising; } tmp___25 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___25 != 0L) { printk("\rbnx2x: [%s:%d(%s)]req_line_speed %d\n req_duplex %d advertising 0x%x\n", "bnx2x_set_settings", 655, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->link_params.req_line_speed[cfg_idx], (int )bp->link_params.req_duplex[cfg_idx], bp->port.advertising[cfg_idx]); } else { } bp->link_params.multi_phy_config = new_multi_phy_config; tmp___26 = netif_running((struct net_device const *)dev); if ((int )tmp___26) { bnx2x_stats_handle(bp, 3); bnx2x_force_link_reset(bp); bnx2x_link_set(bp); } else { } return (0); } } static int __bnx2x_get_preset_regs_len(struct bnx2x *bp , u32 preset ) { { if (bp->common.chip_id >> 16 == 5710U) { return ((int )dump_num_registers[0][preset - 1U]); } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { return ((int )dump_num_registers[1][preset - 1U]); } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return ((int )dump_num_registers[2][preset - 1U]); } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U)) { return ((int )dump_num_registers[3][preset - 1U]); } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { return ((int )dump_num_registers[4][preset - 1U]); } else { return (0); } } } static int __bnx2x_get_regs_len(struct bnx2x *bp ) { u32 preset_idx ; int regdump_len ; int tmp ; { regdump_len = 0; preset_idx = 1U; goto ldv_51985; ldv_51984: tmp = __bnx2x_get_preset_regs_len(bp, preset_idx); regdump_len = tmp + regdump_len; preset_idx = preset_idx + 1U; ldv_51985: ; if (preset_idx <= 13U) { goto ldv_51984; } else { } return (regdump_len); } } static int bnx2x_get_regs_len(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; int regdump_len ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; regdump_len = 0; if ((bp->flags & 4194304U) != 0U) { return (0); } else { } regdump_len = __bnx2x_get_regs_len(bp); regdump_len = regdump_len * 4; regdump_len = (int )((unsigned int )regdump_len + 16U); return (regdump_len); } } static u32 const *__bnx2x_get_page_addr_ar(struct bnx2x *bp ) { { if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return ((u32 const *)(& page_vals_e2)); } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { return ((u32 const *)(& page_vals_e3)); } else { return ((u32 const *)0U); } } } static u32 __bnx2x_get_page_reg_num(struct bnx2x *bp ) { { if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return (2U); } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { return (2U); } else { return (0U); } } } static u32 const *__bnx2x_get_page_write_ar(struct bnx2x *bp ) { { if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return ((u32 const *)(& page_write_regs_e2)); } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { return ((u32 const *)(& page_write_regs_e3)); } else { return ((u32 const *)0U); } } } static u32 __bnx2x_get_page_write_num(struct bnx2x *bp ) { { if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return (1U); } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { return (1U); } else { return (0U); } } } static struct reg_addr const *__bnx2x_get_page_read_ar(struct bnx2x *bp ) { { if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return ((struct reg_addr const *)(& page_read_regs_e2)); } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { return ((struct reg_addr const *)(& page_read_regs_e3)); } else { return ((struct reg_addr const *)0); } } } static u32 __bnx2x_get_page_read_num(struct bnx2x *bp ) { { if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return (1U); } else if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { return (1U); } else { return (0U); } } } static bool bnx2x_is_reg_in_chip(struct bnx2x *bp , struct reg_addr const *reg_info ) { { if (bp->common.chip_id >> 16 == 5710U) { return (((int )reg_info->chips & 1) != 0); } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { return (((unsigned int )reg_info->chips & 2U) != 0U); } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return (((unsigned int )reg_info->chips & 4U) != 0U); } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U)) { return (((unsigned int )reg_info->chips & 8U) != 0U); } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { return (((unsigned int )reg_info->chips & 16U) != 0U); } else { return (0); } } } static bool bnx2x_is_wreg_in_chip(struct bnx2x *bp , struct wreg_addr const *wreg_info ) { { if (bp->common.chip_id >> 16 == 5710U) { return (((int )wreg_info->chips & 1) != 0); } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { return (((unsigned int )wreg_info->chips & 2U) != 0U); } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { return (((unsigned int )wreg_info->chips & 4U) != 0U); } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U)) { return (((unsigned int )wreg_info->chips & 8U) != 0U); } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { return (((unsigned int )wreg_info->chips & 16U) != 0U); } else { return (0); } } } static void bnx2x_read_pages_regs(struct bnx2x *bp , u32 *p , u32 preset ) { u32 i ; u32 j ; u32 k ; u32 n ; u32 const *page_addr ; u32 const *tmp ; int num_pages ; u32 tmp___0 ; u32 const *write_addr ; u32 const *tmp___1 ; int write_num ; u32 tmp___2 ; struct reg_addr const *read_addr ; struct reg_addr const *tmp___3 ; int read_num ; u32 tmp___4 ; u32 addr ; u32 size ; u32 *tmp___5 ; { tmp = __bnx2x_get_page_addr_ar(bp); page_addr = tmp; tmp___0 = __bnx2x_get_page_reg_num(bp); num_pages = (int )tmp___0; tmp___1 = __bnx2x_get_page_write_ar(bp); write_addr = tmp___1; tmp___2 = __bnx2x_get_page_write_num(bp); write_num = (int )tmp___2; tmp___3 = __bnx2x_get_page_read_ar(bp); read_addr = tmp___3; tmp___4 = __bnx2x_get_page_read_num(bp); read_num = (int )tmp___4; i = 0U; goto ldv_52045; ldv_52044: j = 0U; goto ldv_52042; ldv_52041: writel(*(page_addr + (unsigned long )i), (void volatile *)bp->regview + (unsigned long )*(write_addr + (unsigned long )j)); k = 0U; goto ldv_52039; ldv_52038: ; if (((unsigned int )(read_addr + (unsigned long )k)->presets & (unsigned int )(1 << (int )(preset - 1U))) == (unsigned int )(1 << (int )(preset - 1U))) { size = (read_addr + (unsigned long )k)->size; n = 0U; goto ldv_52036; ldv_52035: addr = (unsigned int )(read_addr + (unsigned long )k)->addr + n * 4U; tmp___5 = p; p = p + 1; *tmp___5 = readl((void const volatile *)bp->regview + (unsigned long )addr); n = n + 1U; ldv_52036: ; if (n < size) { goto ldv_52035; } else { } } else { } k = k + 1U; ldv_52039: ; if ((u32 )read_num > k) { goto ldv_52038; } else { } j = j + 1U; ldv_52042: ; if ((u32 )write_num > j) { goto ldv_52041; } else { } i = i + 1U; ldv_52045: ; if ((u32 )num_pages > i) { goto ldv_52044; } else { } return; } } static int __bnx2x_get_preset_regs(struct bnx2x *bp , u32 *p , u32 preset ) { u32 i ; u32 j ; u32 addr ; struct wreg_addr const *wreg_addr_p ; u32 *tmp ; bool tmp___0 ; u32 *tmp___1 ; bool tmp___2 ; u32 *tmp___3 ; u32 *tmp___4 ; bool tmp___5 ; { wreg_addr_p = (struct wreg_addr const *)0; if (bp->common.chip_id >> 16 == 5710U) { wreg_addr_p = & wreg_addr_e1; } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { wreg_addr_p = & wreg_addr_e1h; } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { wreg_addr_p = & wreg_addr_e2; } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U)) { wreg_addr_p = & wreg_addr_e3; } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { wreg_addr_p = & wreg_addr_e3b0; } else { } i = 0U; goto ldv_52062; ldv_52061: tmp___0 = bnx2x_is_reg_in_chip(bp, (struct reg_addr const *)(& idle_reg_addrs) + (unsigned long )i); if ((int )tmp___0 && ((unsigned int )idle_reg_addrs[i].presets & (unsigned int )(1 << (int )(preset - 1U))) == (unsigned int )(1 << (int )(preset - 1U))) { j = 0U; goto ldv_52059; ldv_52058: tmp = p; p = p + 1; *tmp = readl((void const volatile *)bp->regview + (unsigned long )((unsigned int )idle_reg_addrs[i].addr + j * 4U)); j = j + 1U; ldv_52059: ; if ((u32 )idle_reg_addrs[i].size > j) { goto ldv_52058; } else { } } else { } i = i + 1U; ldv_52062: ; if (i <= 269U) { goto ldv_52061; } else { } i = 0U; goto ldv_52070; ldv_52069: tmp___2 = bnx2x_is_reg_in_chip(bp, (struct reg_addr const *)(& reg_addrs) + (unsigned long )i); if ((int )tmp___2 && ((unsigned int )reg_addrs[i].presets & (unsigned int )(1 << (int )(preset - 1U))) == (unsigned int )(1 << (int )(preset - 1U))) { j = 0U; goto ldv_52067; ldv_52066: tmp___1 = p; p = p + 1; *tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )((unsigned int )reg_addrs[i].addr + j * 4U)); j = j + 1U; ldv_52067: ; if ((u32 )reg_addrs[i].size > j) { goto ldv_52066; } else { } } else { } i = i + 1U; ldv_52070: ; if (i <= 1815U) { goto ldv_52069; } else { } tmp___5 = bnx2x_is_wreg_in_chip(bp, wreg_addr_p); if ((int )tmp___5 && ((unsigned int )wreg_addr_p->presets & (unsigned int )(1 << (int )(preset - 1U))) == (unsigned int )(1 << (int )(preset - 1U))) { i = 0U; goto ldv_52076; ldv_52075: tmp___3 = p; p = p + 1; *tmp___3 = readl((void const volatile *)bp->regview + (unsigned long )((unsigned int )wreg_addr_p->addr + i * 4U)); j = 0U; goto ldv_52073; ldv_52072: addr = *(wreg_addr_p->read_regs); tmp___4 = p; p = p + 1; *tmp___4 = readl((void const volatile *)bp->regview + (unsigned long )(j * 4U + addr)); j = j + 1U; ldv_52073: ; if ((u32 )wreg_addr_p->read_regs_count > j) { goto ldv_52072; } else { } i = i + 1U; ldv_52076: ; if ((u32 )wreg_addr_p->size > i) { goto ldv_52075; } else { } } else { } if (((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) || (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U)) { bnx2x_read_pages_regs(bp, p, preset); } else { } return (0); } } static void __bnx2x_get_regs(struct bnx2x *bp , u32 *p ) { u32 preset_idx ; int tmp ; { preset_idx = 1U; goto ldv_52085; ldv_52084: ; if (((preset_idx == 2U || preset_idx == 5U) || preset_idx == 8U) || preset_idx == 11U) { goto ldv_52083; } else { } __bnx2x_get_preset_regs(bp, p, preset_idx); tmp = __bnx2x_get_preset_regs_len(bp, preset_idx); p = p + (unsigned long )tmp; ldv_52083: preset_idx = preset_idx + 1U; ldv_52085: ; if (preset_idx <= 13U) { goto ldv_52084; } else { } return; } } static void bnx2x_get_regs(struct net_device *dev , struct ethtool_regs *regs , void *_p ) { u32 *p ; struct bnx2x *bp ; void *tmp ; struct dump_header dump_hdr ; bool tmp___0 ; int tmp___1 ; { p = (u32 *)_p; tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; dump_hdr.header_size = 0U; dump_hdr.version = 0U; dump_hdr.preset = 0U; dump_hdr.dump_meta_data = 0U; regs->version = 2U; memset((void *)p, 0, (size_t )regs->len); tmp___0 = netif_running((struct net_device const *)bp->dev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return; } else { } bnx2x_disable_blocks_parity(bp); dump_hdr.header_size = 3U; dump_hdr.preset = 8191U; dump_hdr.version = 1628508433U; if (bp->common.chip_id >> 16 == 5710U) { dump_hdr.dump_meta_data = 1U; } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { dump_hdr.dump_meta_data = 2U; } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { dump_hdr.dump_meta_data = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 1028U : 516U; } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U)) { dump_hdr.dump_meta_data = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 1032U : 520U; } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { dump_hdr.dump_meta_data = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 1040U : 528U; } else { } memcpy((void *)p, (void const *)(& dump_hdr), 16UL); p = p + (unsigned long )(dump_hdr.header_size + 1U); __bnx2x_get_regs(bp, p); bnx2x_clear_blocks_parity(bp); bnx2x_enable_blocks_parity___0(bp); return; } } static int bnx2x_get_preset_regs_len(struct net_device *dev , u32 preset ) { struct bnx2x *bp ; void *tmp ; int regdump_len ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; regdump_len = 0; regdump_len = __bnx2x_get_preset_regs_len(bp, preset); regdump_len = regdump_len * 4; regdump_len = (int )((unsigned int )regdump_len + 16U); return (regdump_len); } } static int bnx2x_set_dump(struct net_device *dev , struct ethtool_dump *val ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if (val->flag == 0U || val->flag > 13U) { return (-22); } else { } bp->dump_preset_idx = val->flag; return (0); } } static int bnx2x_get_dump_flag(struct net_device *dev , struct ethtool_dump *dump ) { struct bnx2x *bp ; void *tmp ; int tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; dump->version = 1628508433U; dump->flag = bp->dump_preset_idx; tmp___0 = bnx2x_get_preset_regs_len(dev, bp->dump_preset_idx); dump->len = (__u32 )tmp___0; tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Get dump preset %d length=%d\n", "bnx2x_get_dump_flag", 1026, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->dump_preset_idx, dump->len); } else { } return (0); } } static int bnx2x_get_dump_data(struct net_device *dev , struct ethtool_dump *dump , void *buffer ) { u32 *p ; struct bnx2x *bp ; void *tmp ; struct dump_header dump_hdr ; long tmp___0 ; { p = (u32 *)buffer; tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; dump_hdr.header_size = 0U; dump_hdr.version = 0U; dump_hdr.preset = 0U; dump_hdr.dump_meta_data = 0U; bnx2x_disable_blocks_parity(bp); dump_hdr.header_size = 3U; dump_hdr.preset = bp->dump_preset_idx; dump_hdr.version = 1628508433U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Get dump data of preset %d\n", "bnx2x_get_dump_data", 1049, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dump_hdr.preset); } else { } if (bp->common.chip_id >> 16 == 5710U) { dump_hdr.dump_meta_data = 1U; } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { dump_hdr.dump_meta_data = 2U; } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { dump_hdr.dump_meta_data = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 1028U : 516U; } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U)) { dump_hdr.dump_meta_data = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 1032U : 520U; } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { dump_hdr.dump_meta_data = (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (int )bp->pf_num & 1 : 0) ? 1040U : 528U; } else { } memcpy((void *)p, (void const *)(& dump_hdr), 16UL); p = p + (unsigned long )(dump_hdr.header_size + 1U); __bnx2x_get_preset_regs(bp, p, dump_hdr.preset); bnx2x_clear_blocks_parity(bp); bnx2x_enable_blocks_parity___0(bp); return (0); } } static void bnx2x_get_drvinfo(struct net_device *dev , struct ethtool_drvinfo *info ) { struct bnx2x *bp ; void *tmp ; char const *tmp___0 ; int tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; strlcpy((char *)(& info->driver), "bnx2x", 32UL); strlcpy((char *)(& info->version), "1.710.51-0", 32UL); bnx2x_fill_fw_str(bp, (char *)(& info->fw_version), 32UL); tmp___0 = pci_name((struct pci_dev const *)bp->pdev); strlcpy((char *)(& info->bus_info), tmp___0, 32UL); info->n_stats = 52U; info->testinfo_len = (unsigned int )bp->mf_mode == 0U ? ((bp->flags & 4194304U) != 0U ? 0U : 7U) : 3U; info->eedump_len = (__u32 )bp->common.flash_size; tmp___1 = bnx2x_get_regs_len(dev); info->regdump_len = (__u32 )tmp___1; return; } } static void bnx2x_get_wol(struct net_device *dev , struct ethtool_wolinfo *wol ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((bp->flags & 8U) != 0U) { wol->supported = 0U; wol->wolopts = 0U; } else { wol->supported = 32U; if ((unsigned int )bp->wol != 0U) { wol->wolopts = 32U; } else { wol->wolopts = 0U; } } memset((void *)(& wol->sopass), 0, 6UL); return; } } static int bnx2x_set_wol(struct net_device *dev , struct ethtool_wolinfo *wol ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((wol->wolopts & 4294967263U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]WOL not supported\n", "bnx2x_set_wol", 1119, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((wol->wolopts & 32U) != 0U) { if ((bp->flags & 8U) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]WOL not supported\n", "bnx2x_set_wol", 1125, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bp->wol = 1U; } else { bp->wol = 0U; } return (0); } } static u32 bnx2x_get_msglevel(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; return ((u32 )bp->msg_enable); } } static void bnx2x_set_msglevel(struct net_device *dev , u32 level ) { struct bnx2x *bp ; void *tmp ; bool tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = capable(12); if ((int )tmp___0) { if ((bp->flags & 4194304U) == 0U && (level & 65536U) != 0U) { bnx2x_fw_dump_lvl(bp, "\016"); } else { } bp->msg_enable = (int )level; } else { } return; } } static int bnx2x_nway_reset(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; bool tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if (bp->port.pmf == 0U) { return (0); } else { } tmp___0 = netif_running((struct net_device const *)dev); if ((int )tmp___0) { bnx2x_stats_handle(bp, 3); bnx2x_force_link_reset(bp); bnx2x_link_set(bp); } else { } return (0); } } static u32 bnx2x_get_link(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((bp->flags & 2048U) != 0U || (unsigned int )bp->state != 12288U) { return (0U); } else { } if ((bp->flags & 4194304U) != 0U) { tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& bp->vf_link_vars.link_report_flags)); return (tmp___0 == 0); } else { } return ((u32 )bp->link_vars.link_up); } } static int bnx2x_get_eeprom_len(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; return (bp->common.flash_size); } } static int bnx2x_acquire_nvram_lock(struct bnx2x *bp ) { int port ; int count ; int i ; u32 val ; long tmp ; { port = (int )bp->pfid & 1; bnx2x_acquire_hw_lock(bp, 12U); count = 30000; if ((bp->common.chip_id & 61440U) > 20480U) { count = count * 100; } else { } writel((unsigned int )(2L << port), (void volatile *)bp->regview + 549920U); i = 0; goto ldv_52169; ldv_52168: val = readl((void const volatile *)bp->regview + 549920U); if (((long )val & (512L << port)) != 0L) { goto ldv_52167; } else { } __const_udelay(21475UL); i = i + 1; ldv_52169: ; if (count * 10 > i) { goto ldv_52168; } else { } ldv_52167: ; if (((long )val & (512L << port)) == 0L) { tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot get access to nvram interface\n", "bnx2x_acquire_nvram_lock", 1232, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_release_hw_lock(bp, 12U); return (-16); } else { } return (0); } } static int bnx2x_release_nvram_lock(struct bnx2x *bp ) { int port ; int count ; int i ; u32 val ; long tmp ; { port = (int )bp->pfid & 1; count = 30000; if ((bp->common.chip_id & 61440U) > 20480U) { count = count * 100; } else { } writel((unsigned int )(32L << port), (void volatile *)bp->regview + 549920U); i = 0; goto ldv_52180; ldv_52179: val = readl((void const volatile *)bp->regview + 549920U); if (((long )val & (512L << port)) == 0L) { goto ldv_52178; } else { } __const_udelay(21475UL); i = i + 1; ldv_52180: ; if (count * 10 > i) { goto ldv_52179; } else { } ldv_52178: ; if (((long )val & (512L << port)) != 0L) { tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot free access to nvram interface\n", "bnx2x_release_nvram_lock", 1265, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-16); } else { } bnx2x_release_hw_lock(bp, 12U); return (0); } } static void bnx2x_enable_nvram_access(struct bnx2x *bp ) { u32 val ; { val = readl((void const volatile *)bp->regview + 549924U); writel(val | 3U, (void volatile *)bp->regview + 549924U); return; } } static void bnx2x_disable_nvram_access(struct bnx2x *bp ) { u32 val ; { val = readl((void const volatile *)bp->regview + 549924U); writel(val & 4294967292U, (void volatile *)bp->regview + 549924U); return; } } static int bnx2x_nvram_read_dword(struct bnx2x *bp , u32 offset , __be32 *ret_val , u32 cmd_flags ) { int count ; int i ; int rc ; u32 val ; __u32 tmp ; long tmp___0 ; { cmd_flags = cmd_flags | 16U; writel(8U, (void volatile *)bp->regview + 549888U); writel(offset & 16777215U, (void volatile *)bp->regview + 549900U); writel(cmd_flags, (void volatile *)bp->regview + 549888U); count = 30000; if ((bp->common.chip_id & 61440U) > 20480U) { count = count * 100; } else { } *ret_val = 0U; rc = -16; i = 0; goto ldv_52202; ldv_52201: __const_udelay(21475UL); val = readl((void const volatile *)bp->regview + 549888U); if (((long )val & 8L) != 0L) { val = readl((void const volatile *)bp->regview + 549904U); tmp = __fswab32(val); *ret_val = tmp; rc = 0; goto ldv_52200; } else { } i = i + 1; ldv_52202: ; if (i < count) { goto ldv_52201; } else { } ldv_52200: ; if (rc == -16) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]nvram read timeout expired\n", "bnx2x_nvram_read_dword", 1342, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } return (rc); } } static int bnx2x_nvram_read(struct bnx2x *bp , u32 offset , u8 *ret_buf , int buf_size ) { int rc ; u32 cmd_flags ; __be32 val ; long tmp ; long tmp___0 ; { if (((offset & 3U) != 0U || (buf_size & 3) != 0) || buf_size == 0) { tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid parameter: offset 0x%x buf_size 0x%x\n", "bnx2x_nvram_read", 1356, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", offset, buf_size); } else { } return (-22); } else { } if (offset + (u32 )buf_size > (u32 )bp->common.flash_size) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid parameter: offset (0x%x) + buf_size (0x%x) > flash_size (0x%x)\n", "bnx2x_nvram_read", 1363, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", offset, buf_size, bp->common.flash_size); } else { } return (-22); } else { } rc = bnx2x_acquire_nvram_lock(bp); if (rc != 0) { return (rc); } else { } bnx2x_enable_nvram_access(bp); cmd_flags = 128U; goto ldv_52215; ldv_52214: rc = bnx2x_nvram_read_dword(bp, offset, & val, cmd_flags); memcpy((void *)ret_buf, (void const *)(& val), 4UL); offset = offset + 4U; ret_buf = ret_buf + 4UL; buf_size = (int )((unsigned int )buf_size - 4U); cmd_flags = 0U; ldv_52215: ; if ((unsigned int )buf_size > 4U && rc == 0) { goto ldv_52214; } else { } if (rc == 0) { cmd_flags = cmd_flags | 256U; rc = bnx2x_nvram_read_dword(bp, offset, & val, cmd_flags); memcpy((void *)ret_buf, (void const *)(& val), 4UL); } else { } bnx2x_disable_nvram_access(bp); bnx2x_release_nvram_lock(bp); return (rc); } } static int bnx2x_nvram_read32(struct bnx2x *bp , u32 offset , u32 *buf , int buf_size ) { int rc ; __be32 *be ; u32 *tmp ; __be32 *tmp___0 ; __u32 tmp___1 ; { rc = bnx2x_nvram_read(bp, offset, (u8 *)buf, buf_size); if (rc == 0) { be = buf; goto ldv_52226; ldv_52225: tmp = buf; buf = buf + 1; tmp___0 = be; be = be + 1; tmp___1 = __fswab32(*tmp___0); *tmp = tmp___1; ldv_52226: buf_size = buf_size + -4; if (buf_size >= 0) { goto ldv_52225; } else { } } else { } return (rc); } } static bool bnx2x_is_nvm_accessible(struct bnx2x *bp ) { int rc ; u16 pm ; struct net_device *dev ; void *tmp ; bool tmp___0 ; int tmp___1 ; { rc = 1; pm = 0U; tmp = pci_get_drvdata(bp->pdev); dev = (struct net_device *)tmp; if ((unsigned int )(bp->pdev)->pm_cap != 0U) { rc = pci_read_config_word((struct pci_dev const *)bp->pdev, (int )(bp->pdev)->pm_cap + 4, & pm); } else { } if (rc != 0) { tmp___0 = netif_running((struct net_device const *)dev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else { goto _L; } } else _L: /* CIL Label */ if (rc == 0 && ((int )pm & 3) != 0) { return (0); } else { } return (1); } } static int bnx2x_get_eeprom(struct net_device *dev , struct ethtool_eeprom *eeprom , u8 *eebuf ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; long tmp___3 ; int tmp___4 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___1 = bnx2x_is_nvm_accessible(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot access eeprom when the interface is down\n", "bnx2x_get_eeprom", 1442, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-11); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ethtool_eeprom: cmd %d\n magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", "bnx2x_get_eeprom", 1449, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, eeprom->len, eeprom->len); } else { } tmp___4 = bnx2x_nvram_read(bp, eeprom->offset, eebuf, (int )eeprom->len); return (tmp___4); } } static int bnx2x_get_module_eeprom(struct net_device *dev , struct ethtool_eeprom *ee , u8 *data ) { struct bnx2x *bp ; void *tmp ; int rc ; int phy_idx ; u8 *user_data ; unsigned int start_addr ; unsigned int xfer_size ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; rc = -22; user_data = data; start_addr = ee->offset; xfer_size = 0U; tmp___1 = bnx2x_is_nvm_accessible(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot access eeprom when the interface is down\n", "bnx2x_get_module_eeprom", 1467, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-11); } else { } phy_idx = bnx2x_get_cur_phy_idx(bp); if (start_addr <= 255U) { if (ee->len + start_addr > 256U) { xfer_size = 256U - start_addr; } else { xfer_size = ee->len; } bnx2x_acquire_phy_lock(bp); rc = bnx2x_read_sfp_module_eeprom((struct bnx2x_phy *)(& bp->link_params.phy) + (unsigned long )phy_idx, & bp->link_params, 160, (int )((u16 )start_addr), (int )((u16 )xfer_size), user_data); bnx2x_release_phy_lock(bp); if (rc != 0) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed reading A0 section\n", "bnx2x_get_module_eeprom", 1489, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } user_data = user_data + (unsigned long )xfer_size; start_addr = start_addr + xfer_size; } else { } if (start_addr > 255U && start_addr <= 511U) { xfer_size = ee->len - xfer_size; if (start_addr + xfer_size > 512U) { xfer_size = 512U - start_addr; } else { } start_addr = start_addr - 256U; bnx2x_acquire_phy_lock(bp); rc = bnx2x_read_sfp_module_eeprom((struct bnx2x_phy *)(& bp->link_params.phy) + (unsigned long )phy_idx, & bp->link_params, 162, (int )((u16 )start_addr), (int )((u16 )xfer_size), user_data); bnx2x_release_phy_lock(bp); if (rc != 0) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed reading A2 section\n", "bnx2x_get_module_eeprom", 1514, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } } else { } return (rc); } } static int bnx2x_get_module_info(struct net_device *dev , struct ethtool_modinfo *modinfo ) { struct bnx2x *bp ; void *tmp ; int phy_idx ; int rc ; u8 sff8472_comp ; u8 diag_type ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___1 = bnx2x_is_nvm_accessible(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot access eeprom when the interface is down\n", "bnx2x_get_module_info", 1530, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-11); } else { } phy_idx = bnx2x_get_cur_phy_idx(bp); bnx2x_acquire_phy_lock(bp); rc = bnx2x_read_sfp_module_eeprom((struct bnx2x_phy *)(& bp->link_params.phy) + (unsigned long )phy_idx, & bp->link_params, 160, 94, 1, & sff8472_comp); bnx2x_release_phy_lock(bp); if (rc != 0) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed reading SFF-8472 comp field\n", "bnx2x_get_module_info", 1543, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } bnx2x_acquire_phy_lock(bp); rc = bnx2x_read_sfp_module_eeprom((struct bnx2x_phy *)(& bp->link_params.phy) + (unsigned long )phy_idx, & bp->link_params, 160, 92, 1, & diag_type); bnx2x_release_phy_lock(bp); if (rc != 0) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Failed reading Diag Type field\n", "bnx2x_get_module_info", 1556, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((unsigned int )sff8472_comp == 0U || ((int )diag_type & 4) != 0) { modinfo->type = 1U; modinfo->eeprom_len = 256U; } else { modinfo->type = 2U; modinfo->eeprom_len = 512U; } return (0); } } static int bnx2x_nvram_write_dword(struct bnx2x *bp , u32 offset , u32 val , u32 cmd_flags ) { int count ; int i ; int rc ; long tmp ; { cmd_flags = cmd_flags | 48U; writel(8U, (void volatile *)bp->regview + 549888U); writel(val, (void volatile *)bp->regview + 549896U); writel(offset & 16777215U, (void volatile *)bp->regview + 549900U); writel(cmd_flags, (void volatile *)bp->regview + 549888U); count = 30000; if ((bp->common.chip_id & 61440U) > 20480U) { count = count * 100; } else { } rc = -16; i = 0; goto ldv_52274; ldv_52273: __const_udelay(21475UL); val = readl((void const volatile *)bp->regview + 549888U); if (((long )val & 8L) != 0L) { rc = 0; goto ldv_52272; } else { } i = i + 1; ldv_52274: ; if (i < count) { goto ldv_52273; } else { } ldv_52272: ; if (rc == -16) { tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]nvram write timeout expired\n", "bnx2x_nvram_write_dword", 1610, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } return (rc); } } static int bnx2x_nvram_write1(struct bnx2x *bp , u32 offset , u8 *data_buf , int buf_size ) { int rc ; u32 cmd_flags ; u32 align_offset ; u32 val ; __be32 val_be ; long tmp ; __u32 tmp___0 ; { if (offset + (u32 )buf_size > (u32 )bp->common.flash_size) { tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid parameter: offset (0x%x) + buf_size (0x%x) > flash_size (0x%x)\n", "bnx2x_nvram_write1", 1626, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", offset, buf_size, bp->common.flash_size); } else { } return (-22); } else { } rc = bnx2x_acquire_nvram_lock(bp); if (rc != 0) { return (rc); } else { } bnx2x_enable_nvram_access(bp); cmd_flags = 384U; align_offset = offset & 4294967292U; rc = bnx2x_nvram_read_dword(bp, align_offset, & val_be, cmd_flags); if (rc == 0) { tmp___0 = __fswab32(val_be); val = tmp___0; val = ~ ((u32 )(255 << (int )((offset & 3U) * 8U))) & val; val = (u32 )((int )*data_buf << (int )((offset & 3U) * 8U)) | val; rc = bnx2x_nvram_write_dword(bp, align_offset, val, cmd_flags); } else { } bnx2x_disable_nvram_access(bp); bnx2x_release_nvram_lock(bp); return (rc); } } static int bnx2x_nvram_write(struct bnx2x *bp , u32 offset , u8 *data_buf , int buf_size ) { int rc ; u32 cmd_flags ; u32 val ; u32 written_so_far ; int tmp ; long tmp___0 ; long tmp___1 ; { if (buf_size == 1) { tmp = bnx2x_nvram_write1(bp, offset, data_buf, buf_size); return (tmp); } else { } if (((offset & 3U) != 0U || (buf_size & 3) != 0) || buf_size == 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid parameter: offset 0x%x buf_size 0x%x\n", "bnx2x_nvram_write", 1678, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", offset, buf_size); } else { } return (-22); } else { } if (offset + (u32 )buf_size > (u32 )bp->common.flash_size) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalid parameter: offset (0x%x) + buf_size (0x%x) > flash_size (0x%x)\n", "bnx2x_nvram_write", 1685, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", offset, buf_size, bp->common.flash_size); } else { } return (-22); } else { } rc = bnx2x_acquire_nvram_lock(bp); if (rc != 0) { return (rc); } else { } bnx2x_enable_nvram_access(bp); written_so_far = 0U; cmd_flags = 128U; goto ldv_52300; ldv_52299: ; if ((unsigned long )written_so_far == (unsigned long )buf_size - 4UL) { cmd_flags = cmd_flags | 256U; } else if (((offset + 4U) & 255U) == 0U) { cmd_flags = cmd_flags | 256U; } else if ((offset & 255U) == 0U) { cmd_flags = cmd_flags | 128U; } else { } memcpy((void *)(& val), (void const *)data_buf, 4UL); rc = bnx2x_nvram_write_dword(bp, offset, val, cmd_flags); offset = offset + 4U; data_buf = data_buf + 4UL; written_so_far = written_so_far + 4U; cmd_flags = 0U; ldv_52300: ; if ((u32 )buf_size > written_so_far && rc == 0) { goto ldv_52299; } else { } bnx2x_disable_nvram_access(bp); bnx2x_release_nvram_lock(bp); return (rc); } } static int bnx2x_set_eeprom(struct net_device *dev , struct ethtool_eeprom *eeprom , u8 *eebuf ) { struct bnx2x *bp ; void *tmp ; int port ; int rc ; u32 ext_phy_config ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; port = (int )bp->pfid & 1; rc = 0; tmp___1 = bnx2x_is_nvm_accessible(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot access eeprom when the interface is down\n", "bnx2x_set_eeprom", 1741, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-11); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ethtool_eeprom: cmd %d\n magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", "bnx2x_set_eeprom", 1748, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, eeprom->len, eeprom->len); } else { } if ((eeprom->magic > 1346918655U && eeprom->magic <= 1346918911U) && bp->port.pmf == 0U) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]wrong magic or interface is not pmf\n", "bnx2x_set_eeprom", 1756, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } ext_phy_config = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 400UL) + 436UL))); if (eeprom->magic == 1346918736U) { bnx2x_stats_handle(bp, 3); bnx2x_acquire_phy_lock(bp); tmp___5 = bnx2x_link_reset(& bp->link_params, & bp->link_vars, 0); rc = tmp___5 | rc; if ((ext_phy_config & 65280U) == 2048U) { bnx2x_set_gpio(bp, 0, 1U, (int )((u8 )port)); } else { } bnx2x_release_phy_lock(bp); bnx2x_link_report(bp); } else if (eeprom->magic == 1346918738U) { if ((unsigned int )bp->state == 12288U) { bnx2x_acquire_phy_lock(bp); tmp___6 = bnx2x_link_reset(& bp->link_params, & bp->link_vars, 1); rc = tmp___6 | rc; tmp___7 = bnx2x_phy_init(& bp->link_params, & bp->link_vars); rc = tmp___7 | rc; bnx2x_release_phy_lock(bp); bnx2x_calc_fc_adv(bp); } else { } } else if (eeprom->magic == 1402493251U) { if ((ext_phy_config & 65280U) == 2048U) { bnx2x_set_gpio(bp, 0, 0U, (int )((u8 )port)); bnx2x_acquire_phy_lock(bp); bnx2x_sfx7101_sp_sw_reset(bp, (struct bnx2x_phy *)(& bp->link_params.phy) + 1UL); msleep(500U); bnx2x_ext_phy_hw_reset(bp, (int )((u8 )port)); msleep(500U); bnx2x_release_phy_lock(bp); } else { } } else { rc = bnx2x_nvram_write(bp, eeprom->offset, eebuf, (int )eeprom->len); } return (rc); } } static int bnx2x_get_coalesce(struct net_device *dev , struct ethtool_coalesce *coal ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; memset((void *)coal, 0, 92UL); coal->rx_coalesce_usecs = (__u32 )bp->rx_ticks; coal->tx_coalesce_usecs = (__u32 )bp->tx_ticks; return (0); } } static int bnx2x_set_coalesce(struct net_device *dev , struct ethtool_coalesce *coal ) { struct bnx2x *bp ; void *tmp ; bool tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; bp->rx_ticks = (unsigned short )coal->rx_coalesce_usecs; if ((unsigned int )bp->rx_ticks > 1020U) { bp->rx_ticks = 1020U; } else { } bp->tx_ticks = (unsigned short )coal->tx_coalesce_usecs; if ((unsigned int )bp->tx_ticks > 1020U) { bp->tx_ticks = 1020U; } else { } tmp___0 = netif_running((struct net_device const *)dev); if ((int )tmp___0) { bnx2x_update_coalesce(bp); } else { } return (0); } } static void bnx2x_get_ringparam(struct net_device *dev , struct ethtool_ringparam *ering ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; ering->rx_max_pending = 4078U; if (bp->rx_ring_size != 0) { ering->rx_pending = (__u32 )bp->rx_ring_size; } else { ering->rx_pending = 4078U; } ering->tx_max_pending = (unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U ? 0U : 4078U; ering->tx_pending = (__u32 )bp->tx_ring_size; return; } } static int bnx2x_set_ringparam(struct net_device *dev , struct ethtool_ringparam *ering ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; u32 __max1 ; u32 __max2 ; u32 __max1___0 ; u32 __max2___0 ; u32 tmp___5 ; int tmp___6 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]set ring params command parameters: rx_pending = %d, tx_pending = %d\n", "bnx2x_set_ringparam", 1871, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ering->rx_pending, ering->tx_pending); } else { } tmp___2 = pci_num_vf(bp->pdev); if (tmp___2 != 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]VFs are enabled, can not change ring parameters\n", "bnx2x_set_ringparam", 1875, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-1); } else { } if ((unsigned int )bp->recovery_state != 0U) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Handling parity error recovery. Try again later\n", "bnx2x_set_ringparam", 1881, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-11); } else { } if (ering->rx_pending > 4078U) { goto _L; } else { if (bp->disable_tpa != 0) { __max1 = 11U; __max2 = (int )bp->dropless_fc ? (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 228U : 128U; tmp___5 = __max1 > __max2 ? __max1 : __max2; } else { __max1___0 = bp->common.chip_id >> 16 == 5710U ? 43U : 75U; __max2___0 = (int )bp->dropless_fc ? (((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 1024U : 512U) + (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U ? 6U : 4U)) + (bp->common.chip_id >> 16 == 5710U ? 43U : 75U)) + 228U : 128U; tmp___5 = __max1___0 > __max2___0 ? __max1___0 : __max2___0; } if (ering->rx_pending < tmp___5) { goto _L; } else if ((unsigned long )ering->tx_pending > ((((unsigned int )bp->mf_mode == 1U && ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U || (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U)) || ((unsigned int )bp->mf_mode == 2U && ((bp->mf_ext_config & 14U) == 4U || (bp->mf_ext_config & 14U) == 8U))) || ((unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U) ? 0UL : 4078UL)) { goto _L; } else if (ering->tx_pending <= 21U) { _L: /* CIL Label */ tmp___4 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Command parameters not supported\n", "bnx2x_set_ringparam", 1890, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } } bp->rx_ring_size = (int )ering->rx_pending; bp->tx_ring_size = (int )ering->tx_pending; tmp___6 = bnx2x_reload_if_running(dev); return (tmp___6); } } static void bnx2x_get_pauseparam(struct net_device *dev , struct ethtool_pauseparam *epause ) { struct bnx2x *bp ; void *tmp ; int cfg_idx ; int tmp___0 ; int cfg_reg ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = bnx2x_get_link_cfg_idx(bp); cfg_idx = tmp___0; epause->autoneg = (unsigned int )bp->link_params.req_flow_ctrl[cfg_idx] == 0U; if (epause->autoneg == 0U) { cfg_reg = (int )bp->link_params.req_flow_ctrl[cfg_idx]; } else { cfg_reg = (int )bp->link_params.req_fc_auto_adv; } epause->rx_pause = (cfg_reg & 512) != 0; epause->tx_pause = (cfg_reg & 256) != 0; tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ethtool_pauseparam: cmd %d\n autoneg %d rx_pause %d tx_pause %d\n", "bnx2x_get_pauseparam", 1922, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", epause->cmd, epause->autoneg, epause->rx_pause, epause->tx_pause); } else { } return; } } static int bnx2x_set_pauseparam(struct net_device *dev , struct ethtool_pauseparam *epause ) { struct bnx2x *bp ; void *tmp ; u32 cfg_idx ; int tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; bool tmp___4 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = bnx2x_get_link_cfg_idx(bp); cfg_idx = (u32 )tmp___0; if ((unsigned int )bp->mf_mode != 0U) { return (0); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]ethtool_pauseparam: cmd %d\n autoneg %d rx_pause %d tx_pause %d\n", "bnx2x_set_pauseparam", 1935, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", epause->cmd, epause->autoneg, epause->rx_pause, epause->tx_pause); } else { } bp->link_params.req_flow_ctrl[cfg_idx] = 0U; if (epause->rx_pause != 0U) { bp->link_params.req_flow_ctrl[cfg_idx] = (u16 )((unsigned int )bp->link_params.req_flow_ctrl[cfg_idx] | 512U); } else { } if (epause->tx_pause != 0U) { bp->link_params.req_flow_ctrl[cfg_idx] = (u16 )((unsigned int )bp->link_params.req_flow_ctrl[cfg_idx] | 256U); } else { } if ((unsigned int )bp->link_params.req_flow_ctrl[cfg_idx] == 0U) { bp->link_params.req_flow_ctrl[cfg_idx] = 1024U; } else { } if (epause->autoneg != 0U) { if ((bp->port.supported[cfg_idx] & 64U) == 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]autoneg not supported\n", "bnx2x_set_pauseparam", 1950, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if ((unsigned int )bp->link_params.req_line_speed[cfg_idx] == 0U) { bp->link_params.req_flow_ctrl[cfg_idx] = 0U; } else { } bp->link_params.req_fc_auto_adv = 0U; if (epause->rx_pause != 0U) { bp->link_params.req_fc_auto_adv = (u16 )((unsigned int )bp->link_params.req_fc_auto_adv | 512U); } else { } if (epause->tx_pause != 0U) { bp->link_params.req_fc_auto_adv = (u16 )((unsigned int )bp->link_params.req_fc_auto_adv | 256U); } else { } if ((unsigned int )bp->link_params.req_fc_auto_adv == 0U) { bp->link_params.req_fc_auto_adv = (u16 )((unsigned int )bp->link_params.req_fc_auto_adv | 1024U); } else { } } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]req_flow_ctrl 0x%x\n", "bnx2x_set_pauseparam", 1970, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->link_params.req_flow_ctrl[cfg_idx]); } else { } tmp___4 = netif_running((struct net_device const *)dev); if ((int )tmp___4) { bnx2x_stats_handle(bp, 3); bnx2x_force_link_reset(bp); bnx2x_link_set(bp); } else { } return (0); } } static char const bnx2x_tests_str_arr[7U][32U] = { { 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '_', 't', 'e', 's', 't', ' ', '(', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', ' ', ' ', ' ', ' ', '\000'}, { 'm', 'e', 'm', 'o', 'r', 'y', '_', 't', 'e', 's', 't', ' ', '(', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', ' ', ' ', ' ', ' ', ' ', ' ', '\000'}, { 'i', 'n', 't', '_', 'l', 'o', 'o', 'p', 'b', 'a', 'c', 'k', '_', 't', 'e', 's', 't', ' ', '(', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', '\000'}, { 'e', 'x', 't', '_', 'l', 'o', 'o', 'p', 'b', 'a', 'c', 'k', '_', 't', 'e', 's', 't', ' ', '(', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', '\000'}, { 'n', 'v', 'r', 'a', 'm', '_', 't', 'e', 's', 't', ' ', '(', 'o', 'n', 'l', 'i', 'n', 'e', ')', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '\000'}, { 'i', 'n', 't', 'e', 'r', 'r', 'u', 'p', 't', '_', 't', 'e', 's', 't', ' ', '(', 'o', 'n', 'l', 'i', 'n', 'e', ')', ' ', ' ', ' ', ' ', '\000'}, { 'l', 'i', 'n', 'k', '_', 't', 'e', 's', 't', ' ', '(', 'o', 'n', 'l', 'i', 'n', 'e', ')', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '\000'}}; static char const bnx2x_private_arr[3U][32U] = { { 'i', 'S', 'C', 'S', 'I', ' ', 'o', 'f', 'f', 'l', 'o', 'a', 'd', ' ', 's', 'u', 'p', 'p', 'o', 'r', 't', '\000'}, { 'F', 'C', 'o', 'E', ' ', 'o', 'f', 'f', 'l', 'o', 'a', 'd', ' ', 's', 'u', 'p', 'p', 'o', 'r', 't', '\000'}, { 'S', 't', 'o', 'r', 'a', 'g', 'e', ' ', 'o', 'n', 'l', 'y', ' ', 'i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', '\000'}}; static u32 bnx2x_eee_to_adv(u32 eee_adv ) { u32 modes ; { modes = 0U; if ((int )eee_adv & 1) { modes = modes | 8U; } else { } if ((eee_adv & 2U) != 0U) { modes = modes | 32U; } else { } if ((eee_adv & 4U) != 0U) { modes = modes | 4096U; } else { } return (modes); } } static u32 bnx2x_adv_to_eee(u32 modes , u32 shift ) { u32 eee_adv ; { eee_adv = 0U; if ((modes & 8U) != 0U) { eee_adv = eee_adv | 1U; } else { } if ((modes & 32U) != 0U) { eee_adv = eee_adv | 2U; } else { } if ((modes & 4096U) != 0U) { eee_adv = eee_adv | 4U; } else { } return (eee_adv << (int )shift); } } static int bnx2x_get_eee(struct net_device *dev , struct ethtool_eee *edata ) { struct bnx2x *bp ; void *tmp ; u32 eee_cfg ; long tmp___0 ; unsigned int tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if (bp->common.shmem2_base == 0U) { goto _L; } else { tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if ((unsigned long )tmp___1 <= (((unsigned long )bp->pfid & 1UL) + 76UL) * 4UL) { _L: /* CIL Label */ tmp___0 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BC Version does not support EEE\n", "bnx2x_get_eee", 2037, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-95); } else { } } eee_cfg = bp->link_vars.eee_status; edata->supported = bnx2x_eee_to_adv((eee_cfg & 983040U) >> 16); edata->advertised = bnx2x_eee_to_adv((eee_cfg & 15728640U) >> 20); edata->lp_advertised = bnx2x_eee_to_adv((eee_cfg & 251658240U) >> 24); edata->tx_lpi_timer = (eee_cfg & 65535U) << 4; edata->eee_enabled = (eee_cfg & 268435456U) != 0U; edata->eee_active = (eee_cfg & 1073741824U) != 0U; edata->tx_lpi_enabled = (eee_cfg & 536870912U) != 0U; return (0); } } static int bnx2x_set_eee(struct net_device *dev , struct ethtool_eee *edata ) { struct bnx2x *bp ; void *tmp ; u32 eee_cfg ; u32 advertised ; long tmp___0 ; unsigned int tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; bool tmp___6 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((unsigned int )bp->mf_mode != 0U) { return (0); } else { } if (bp->common.shmem2_base == 0U) { goto _L; } else { tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if ((unsigned long )tmp___1 <= (((unsigned long )bp->pfid & 1UL) + 76UL) * 4UL) { _L: /* CIL Label */ tmp___0 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BC Version does not support EEE\n", "bnx2x_set_eee", 2074, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-95); } else { } } eee_cfg = bp->link_vars.eee_status; if ((eee_cfg & 983040U) == 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Board does not support EEE!\n", "bnx2x_set_eee", 2081, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-95); } else { } advertised = bnx2x_adv_to_eee(edata->advertised, 20U); if ((eee_cfg & 15728640U) != advertised) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Direct manipulation of EEE advertisement is not supported\n", "bnx2x_set_eee", 2089, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if (edata->tx_lpi_timer > 1048575U) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Maximal Tx Lpi timer supported is %x(u)\n", "bnx2x_set_eee", 2096, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", 1048575); } else { } return (-22); } else { } if (edata->tx_lpi_enabled != 0U && edata->tx_lpi_timer <= 255U) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Minimal Tx Lpi timer supported is %d(u)\n", "bnx2x_set_eee", 2103, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", 256); } else { } return (-22); } else { } if (edata->eee_enabled != 0U) { bp->link_params.eee_mode = bp->link_params.eee_mode | 2147483648U; } else { bp->link_params.eee_mode = bp->link_params.eee_mode & 2147483647U; } if (edata->tx_lpi_enabled != 0U) { bp->link_params.eee_mode = bp->link_params.eee_mode | 1073741824U; } else { bp->link_params.eee_mode = bp->link_params.eee_mode & 3221225471U; } bp->link_params.eee_mode = bp->link_params.eee_mode & 4293918720U; bp->link_params.eee_mode = (bp->link_params.eee_mode | (edata->tx_lpi_timer & 1048575U)) | 805306368U; tmp___6 = netif_running((struct net_device const *)dev); if ((int )tmp___6) { bnx2x_stats_handle(bp, 3); bnx2x_force_link_reset(bp); bnx2x_link_set(bp); } else { } return (0); } } static int bnx2x_test_registers(struct bnx2x *bp ) { int idx ; int i ; int rc ; u32 wr_val ; u32 hw ; int port ; struct __anonstruct_reg_tbl_375 reg_tbl[39U] ; long tmp ; bool tmp___0 ; int tmp___1 ; u32 offset ; u32 mask ; u32 save_val ; u32 val ; long tmp___2 ; { rc = -19; wr_val = 0U; port = (int )bp->pfid & 1; reg_tbl[0].hw = 31U; reg_tbl[0].offset0 = 393320U; reg_tbl[0].offset1 = 4U; reg_tbl[0].mask = 1023U; reg_tbl[1].hw = 31U; reg_tbl[1].offset0 = 1507468U; reg_tbl[1].offset1 = 4U; reg_tbl[1].mask = 4294967295U; reg_tbl[2].hw = 3U; reg_tbl[2].offset0 = 1081424U; reg_tbl[2].offset1 = 4U; reg_tbl[2].mask = 1023U; reg_tbl[3].hw = 31U; reg_tbl[3].offset0 = 1310768U; reg_tbl[3].offset1 = 4U; reg_tbl[3].mask = 1U; reg_tbl[4].hw = 15U; reg_tbl[4].offset0 = 1310928U; reg_tbl[4].offset1 = 4U; reg_tbl[4].mask = 2047U; reg_tbl[5].hw = 16U; reg_tbl[5].offset0 = 1425968U; reg_tbl[5].offset1 = 4U; reg_tbl[5].mask = 2047U; reg_tbl[6].hw = 31U; reg_tbl[6].offset0 = 262396U; reg_tbl[6].offset1 = 4U; reg_tbl[6].mask = 16777215U; reg_tbl[7].hw = 31U; reg_tbl[7].offset0 = 1179648U; reg_tbl[7].offset1 = 4U; reg_tbl[7].mask = 1048575U; reg_tbl[8].hw = 31U; reg_tbl[8].offset0 = 1179656U; reg_tbl[8].offset1 = 8U; reg_tbl[8].mask = 262143U; reg_tbl[9].hw = 31U; reg_tbl[9].offset0 = 1179676U; reg_tbl[9].offset1 = 4U; reg_tbl[9].mask = 1048575U; reg_tbl[10].hw = 31U; reg_tbl[10].offset0 = 1179796U; reg_tbl[10].offset1 = 8U; reg_tbl[10].mask = 262143U; reg_tbl[11].hw = 31U; reg_tbl[11].offset0 = 1179872U; reg_tbl[11].offset1 = 4U; reg_tbl[11].mask = 1048575U; reg_tbl[12].hw = 31U; reg_tbl[12].offset0 = 1474592U; reg_tbl[12].offset1 = 4U; reg_tbl[12].mask = 1048575U; reg_tbl[13].hw = 31U; reg_tbl[13].offset0 = 1458248U; reg_tbl[13].offset1 = 4U; reg_tbl[13].mask = 262143U; reg_tbl[14].hw = 31U; reg_tbl[14].offset0 = 263176U; reg_tbl[14].offset1 = 40U; reg_tbl[14].mask = 4294967295U; reg_tbl[15].hw = 31U; reg_tbl[15].offset0 = 263204U; reg_tbl[15].offset1 = 40U; reg_tbl[15].mask = 4294967295U; reg_tbl[16].hw = 31U; reg_tbl[16].offset0 = 131524U; reg_tbl[16].offset1 = 4U; reg_tbl[16].mask = 1U; reg_tbl[17].hw = 31U; reg_tbl[17].offset0 = 131540U; reg_tbl[17].offset1 = 4U; reg_tbl[17].mask = 3U; reg_tbl[18].hw = 31U; reg_tbl[18].offset0 = 131352U; reg_tbl[18].offset1 = 4U; reg_tbl[18].mask = 255U; reg_tbl[19].hw = 31U; reg_tbl[19].offset0 = 65652U; reg_tbl[19].offset1 = 4U; reg_tbl[19].mask = 1U; reg_tbl[20].hw = 7U; reg_tbl[20].offset0 = 65700U; reg_tbl[20].offset1 = 4U; reg_tbl[20].mask = 1U; reg_tbl[21].hw = 7U; reg_tbl[21].offset0 = 65708U; reg_tbl[21].offset1 = 4U; reg_tbl[21].mask = 1U; reg_tbl[22].hw = 31U; reg_tbl[22].offset0 = 65776U; reg_tbl[22].offset1 = 4U; reg_tbl[22].mask = 1U; reg_tbl[23].hw = 31U; reg_tbl[23].offset0 = 65784U; reg_tbl[23].offset1 = 4U; reg_tbl[23].mask = 1U; reg_tbl[24].hw = 31U; reg_tbl[24].offset0 = 65840U; reg_tbl[24].offset1 = 4U; reg_tbl[24].mask = 7U; reg_tbl[25].hw = 31U; reg_tbl[25].offset0 = 65876U; reg_tbl[25].offset1 = 68U; reg_tbl[25].mask = 255U; reg_tbl[26].hw = 31U; reg_tbl[26].offset0 = 65884U; reg_tbl[26].offset1 = 68U; reg_tbl[26].mask = 4294967295U; reg_tbl[27].hw = 31U; reg_tbl[27].offset0 = 65984U; reg_tbl[27].offset1 = 160U; reg_tbl[27].mask = 4294967295U; reg_tbl[28].hw = 31U; reg_tbl[28].offset0 = 66012U; reg_tbl[28].offset1 = 160U; reg_tbl[28].mask = 4294967295U; reg_tbl[29].hw = 31U; reg_tbl[29].offset0 = 66056U; reg_tbl[29].offset1 = 160U; reg_tbl[29].mask = 1U; reg_tbl[30].hw = 31U; reg_tbl[30].offset0 = 66068U; reg_tbl[30].offset1 = 160U; reg_tbl[30].mask = 65535U; reg_tbl[31].hw = 31U; reg_tbl[31].offset0 = 66080U; reg_tbl[31].offset1 = 160U; reg_tbl[31].mask = 65535U; reg_tbl[32].hw = 31U; reg_tbl[32].offset0 = 66092U; reg_tbl[32].offset1 = 160U; reg_tbl[32].mask = 4095U; reg_tbl[33].hw = 7U; reg_tbl[33].offset0 = 66272U; reg_tbl[33].offset1 = 4U; reg_tbl[33].mask = 1U; reg_tbl[34].hw = 31U; reg_tbl[34].offset0 = 66296U; reg_tbl[34].offset1 = 4U; reg_tbl[34].mask = 1U; reg_tbl[35].hw = 31U; reg_tbl[35].offset0 = 66344U; reg_tbl[35].offset1 = 4U; reg_tbl[35].mask = 134217727U; reg_tbl[36].hw = 7U; reg_tbl[36].offset0 = 66376U; reg_tbl[36].offset1 = 24U; reg_tbl[36].mask = 1U; reg_tbl[37].hw = 7U; reg_tbl[37].offset0 = 66420U; reg_tbl[37].offset1 = 16U; reg_tbl[37].mask = 31U; reg_tbl[38].hw = 31U; reg_tbl[38].offset0 = 4294967295U; reg_tbl[38].offset1 = 0U; reg_tbl[38].mask = 0U; tmp___0 = bnx2x_is_nvm_accessible(bp); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot access eeprom when the interface is down\n", "bnx2x_test_registers", 2245, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (rc); } else { } if (bp->common.chip_id >> 16 == 5710U) { hw = 1U; } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { hw = 2U; } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { hw = 4U; } else if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { hw = 16U; } else { hw = 8U; } idx = 0; goto ldv_52421; ldv_52420: ; switch (idx) { case 0: wr_val = 0U; goto ldv_52409; case 1: wr_val = 4294967295U; goto ldv_52409; } ldv_52409: i = 0; goto ldv_52418; ldv_52417: ; if ((reg_tbl[i].hw & hw) == 0U) { goto ldv_52415; } else { } offset = reg_tbl[i].offset0 + reg_tbl[i].offset1 * (unsigned int )port; mask = reg_tbl[i].mask; save_val = readl((void const volatile *)bp->regview + (unsigned long )offset); writel(wr_val & mask, (void volatile *)bp->regview + (unsigned long )offset); val = readl((void const volatile *)bp->regview + (unsigned long )offset); writel(save_val, (void volatile *)bp->regview + (unsigned long )offset); if (((val ^ wr_val) & mask) != 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]offset 0x%x: val 0x%x != 0x%x mask 0x%x\n", "bnx2x_test_registers", 2295, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", offset, val, wr_val, mask); } else { } goto test_reg_exit; } else { } ldv_52415: i = i + 1; ldv_52418: ; if (reg_tbl[i].offset0 != 4294967295U) { goto ldv_52417; } else { } idx = idx + 1; ldv_52421: ; if (idx <= 1) { goto ldv_52420; } else { } rc = 0; test_reg_exit: ; return (rc); } } static int bnx2x_test_memory(struct bnx2x *bp ) { int i ; int j ; int rc ; u32 val ; u32 index ; struct __anonstruct_mem_tbl_377 mem_tbl[8U] ; struct __anonstruct_prty_tbl_379 prty_tbl[7U] ; unsigned int tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; unsigned int tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; unsigned int tmp___5 ; long tmp___6 ; bool tmp___7 ; int tmp___8 ; long tmp___9 ; long tmp___10 ; { rc = -19; mem_tbl[0].offset = 852736U; mem_tbl[0].size = 24; mem_tbl[1].offset = 1065984U; mem_tbl[1].size = 256; mem_tbl[2].offset = 1068032U; mem_tbl[2].size = 256; mem_tbl[3].offset = 1057792U; mem_tbl[3].size = 224; mem_tbl[4].offset = 328320U; mem_tbl[4].size = 29; mem_tbl[5].offset = 918144U; mem_tbl[5].size = 27; mem_tbl[6].offset = 132224U; mem_tbl[6].size = 32; mem_tbl[7].offset = 4294967295U; mem_tbl[7].size = 0; prty_tbl[0].name = (char *)"CCM_PRTY_STS"; prty_tbl[0].offset = 852456U; prty_tbl[0].hw_mask[0] = 262080U; prty_tbl[0].hw_mask[1] = 0U; prty_tbl[0].hw_mask[2] = 0U; prty_tbl[0].hw_mask[3] = 0U; tmp = 4U; while (1) { if (tmp >= 5U) { break; } else { } prty_tbl[0].hw_mask[tmp] = 0U; tmp = tmp + 1U; } prty_tbl[1].name = (char *)"CFC_PRTY_STS"; prty_tbl[1].offset = 1065228U; prty_tbl[1].hw_mask[0] = 2U; prty_tbl[1].hw_mask[1] = 2U; prty_tbl[1].hw_mask[2] = 0U; prty_tbl[1].hw_mask[3] = 0U; tmp___0 = 4U; while (1) { if (tmp___0 >= 5U) { break; } else { } prty_tbl[1].hw_mask[tmp___0] = 0U; tmp___0 = tmp___0 + 1U; } prty_tbl[2].name = (char *)"DMAE_PRTY_STS"; prty_tbl[2].offset = 1056856U; prty_tbl[2].hw_mask[0] = 0U; prty_tbl[2].hw_mask[1] = 0U; prty_tbl[2].hw_mask[2] = 0U; prty_tbl[2].hw_mask[3] = 0U; tmp___1 = 4U; while (1) { if (tmp___1 >= 5U) { break; } else { } prty_tbl[2].hw_mask[tmp___1] = 0U; tmp___1 = tmp___1 + 1U; } prty_tbl[3].name = (char *)"TCM_PRTY_STS"; prty_tbl[3].offset = 328160U; prty_tbl[3].hw_mask[0] = 262080U; prty_tbl[3].hw_mask[1] = 0U; prty_tbl[3].hw_mask[2] = 0U; prty_tbl[3].hw_mask[3] = 0U; tmp___2 = 4U; while (1) { if (tmp___2 >= 5U) { break; } else { } prty_tbl[3].hw_mask[tmp___2] = 0U; tmp___2 = tmp___2 + 1U; } prty_tbl[4].name = (char *)"UCM_PRTY_STS"; prty_tbl[4].offset = 917976U; prty_tbl[4].hw_mask[0] = 262080U; prty_tbl[4].hw_mask[1] = 0U; prty_tbl[4].hw_mask[2] = 0U; prty_tbl[4].hw_mask[3] = 0U; tmp___3 = 4U; while (1) { if (tmp___3 >= 5U) { break; } else { } prty_tbl[4].hw_mask[tmp___3] = 0U; tmp___3 = tmp___3 + 1U; } prty_tbl[5].name = (char *)"XCM_PRTY_STS"; prty_tbl[5].offset = 131768U; prty_tbl[5].hw_mask[0] = 262081U; prty_tbl[5].hw_mask[1] = 0U; prty_tbl[5].hw_mask[2] = 0U; prty_tbl[5].hw_mask[3] = 0U; tmp___4 = 4U; while (1) { if (tmp___4 >= 5U) { break; } else { } prty_tbl[5].hw_mask[tmp___4] = 0U; tmp___4 = tmp___4 + 1U; } prty_tbl[6].name = (char *)0; prty_tbl[6].offset = 4294967295U; prty_tbl[6].hw_mask[0] = 0U; prty_tbl[6].hw_mask[1] = 0U; prty_tbl[6].hw_mask[2] = 0U; prty_tbl[6].hw_mask[3] = 0U; tmp___5 = 4U; while (1) { if (tmp___5 >= 5U) { break; } else { } prty_tbl[6].hw_mask[tmp___5] = 0U; tmp___5 = tmp___5 + 1U; } tmp___7 = bnx2x_is_nvm_accessible(bp); if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot access eeprom when the interface is down\n", "bnx2x_test_memory", 2349, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (rc); } else { } if (bp->common.chip_id >> 16 == 5710U) { index = 0U; } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { index = 1U; } else if ((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) { index = 2U; } else { index = 3U; } i = 0; goto ldv_52443; ldv_52442: val = readl((void const volatile *)bp->regview + (unsigned long )prty_tbl[i].offset); if ((~ prty_tbl[i].hw_mask[index] & val) != 0U) { tmp___9 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]%s is 0x%x\n", "bnx2x_test_memory", 2367, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prty_tbl[i].name, val); } else { } goto test_mem_exit; } else { } i = i + 1; ldv_52443: ; if (prty_tbl[i].offset != 4294967295U) { goto ldv_52442; } else { } i = 0; goto ldv_52449; ldv_52448: j = 0; goto ldv_52446; ldv_52445: readl((void const volatile *)bp->regview + (unsigned long )(mem_tbl[i].offset + (unsigned int )(j * 4))); j = j + 1; ldv_52446: ; if (mem_tbl[i].size > j) { goto ldv_52445; } else { } i = i + 1; ldv_52449: ; if (mem_tbl[i].offset != 4294967295U) { goto ldv_52448; } else { } i = 0; goto ldv_52452; ldv_52451: val = readl((void const volatile *)bp->regview + (unsigned long )prty_tbl[i].offset); if ((~ prty_tbl[i].hw_mask[index] & val) != 0U) { tmp___10 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___10 != 0L) { printk("\rbnx2x: [%s:%d(%s)]%s is 0x%x\n", "bnx2x_test_memory", 2382, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prty_tbl[i].name, val); } else { } goto test_mem_exit; } else { } i = i + 1; ldv_52452: ; if (prty_tbl[i].offset != 4294967295U) { goto ldv_52451; } else { } rc = 0; test_mem_exit: ; return (rc); } } static void bnx2x_wait_for_link(struct bnx2x *bp , u8 link_up , u8 is_serdes ) { int cnt ; u8 tmp ; int tmp___0 ; long tmp___1 ; u8 tmp___2 ; int tmp___3 ; long tmp___4 ; { cnt = 1400; if ((unsigned int )link_up != 0U) { goto ldv_52461; ldv_52460: msleep(20U); ldv_52461: tmp = bnx2x_link_test(bp, (int )is_serdes); if ((unsigned int )tmp != 0U) { tmp___0 = cnt; cnt = cnt - 1; if (tmp___0 != 0) { goto ldv_52460; } else { goto ldv_52462; } } else { } ldv_52462: ; if (cnt <= 0) { tmp___2 = bnx2x_link_test(bp, (int )is_serdes); if ((unsigned int )tmp___2 != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Timeout waiting for link up\n", "bnx2x_wait_for_link", 2402, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { } cnt = 1400; goto ldv_52465; ldv_52464: msleep(20U); ldv_52465: ; if ((unsigned int )bp->link_vars.link_up == 0U) { tmp___3 = cnt; cnt = cnt - 1; if (tmp___3 != 0) { goto ldv_52464; } else { goto ldv_52466; } } else { } ldv_52466: ; if (cnt <= 0 && (unsigned int )bp->link_vars.link_up == 0U) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Timeout waiting for link init\n", "bnx2x_wait_for_link", 2410, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } } else { } return; } } static int bnx2x_run_loopback(struct bnx2x *bp , int loopback_mode ) { unsigned int pkt_size ; unsigned int num_pkts ; unsigned int i ; struct sk_buff *skb ; unsigned char *packet ; struct bnx2x_fastpath *fp_rx ; struct bnx2x_fastpath *fp_tx ; struct bnx2x_fp_txdata *txdata ; u16 tx_start_idx ; u16 tx_idx ; u16 rx_start_idx ; u16 rx_idx ; u16 pkt_prod ; u16 bd_prod ; struct sw_tx_bd *tx_buf ; struct eth_tx_start_bd *tx_start_bd ; dma_addr_t mapping ; union eth_rx_cqe *cqe ; u8 cqe_fp_flags ; u8 cqe_fp_type ; struct sw_rx_bd *rx_buf ; u16 len ; int rc ; u8 *data ; struct netdev_queue *txq ; struct netdev_queue *tmp ; long tmp___0 ; int cfg_idx ; int tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; unsigned int tmp___5 ; long tmp___6 ; int tmp___7 ; long tmp___8 ; u16 tmp___9 ; unsigned int tmp___10 ; u16 global_data ; struct eth_tx_parse_bd_e1x *pbd_e1x ; u32 parsing_data ; struct eth_tx_parse_bd_e2 *pbd_e2 ; int _max1 ; int _max2 ; { fp_rx = bp->fp; fp_tx = bp->fp; txdata = fp_tx->txdata_ptr[0]; rc = -19; tmp = netdev_get_tx_queue((struct net_device const *)bp->dev, (unsigned int )txdata->txq_index); txq = tmp; switch (loopback_mode) { case 0: ; if ((unsigned int )bp->link_params.loopback_mode != 3U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]PHY loopback not supported\n", "bnx2x_run_loopback", 2441, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } goto ldv_52498; case 1: ; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { tmp___1 = bnx2x_get_link_cfg_idx(bp); cfg_idx = tmp___1; if ((bp->port.supported[cfg_idx] & 6295552U) != 0U) { bp->link_params.loopback_mode = 7U; } else { bp->link_params.loopback_mode = 6U; } } else { bp->link_params.loopback_mode = 2U; } bnx2x_phy_init(& bp->link_params, & bp->link_vars); goto ldv_52498; case 2: ; if ((unsigned int )bp->link_params.loopback_mode != 5U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Can\'t configure external loopback\n", "bnx2x_run_loopback", 2463, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } goto ldv_52498; default: tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Command parameters not supported\n", "bnx2x_run_loopback", 2468, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } ldv_52498: pkt_size = (1500U < (bp->dev)->mtu ? 1500U : (bp->dev)->mtu) + 14U; skb = netdev_alloc_skb(bp->dev, fp_rx->rx_buf_size); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Can\'t allocate skb\n", "bnx2x_run_loopback", 2477, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = -12; goto test_loopback_exit; } else { } packet = skb_put(skb, pkt_size); memcpy((void *)packet, (void const *)(bp->dev)->dev_addr, 6UL); eth_zero_addr(packet + 6U); memset((void *)packet + 12U, 119, 2UL); i = 14U; goto ldv_52505; ldv_52504: *(packet + (unsigned long )i) = (unsigned char )i; i = i + 1U; ldv_52505: ; if (i < pkt_size) { goto ldv_52504; } else { } tmp___5 = skb_headlen((struct sk_buff const *)skb); mapping = dma_map_single_attrs___0(& (bp->pdev)->dev, (void *)skb->data, (size_t )tmp___5, 1, (struct dma_attrs *)0); tmp___7 = dma_mapping_error(& (bp->pdev)->dev, mapping); tmp___8 = ldv__builtin_expect(tmp___7 != 0, 0L); if (tmp___8 != 0L) { rc = -12; consume_skb(skb); tmp___6 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unable to map SKB\n", "bnx2x_run_loopback", 2492, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } goto test_loopback_exit; } else { } num_pkts = 0U; tx_start_idx = *(txdata->tx_cons_sb); rx_start_idx = *(fp_rx->rx_cons_sb); netdev_tx_sent_queue___0(txq, skb->len); tmp___9 = txdata->tx_pkt_prod; txdata->tx_pkt_prod = (u16 )((int )txdata->tx_pkt_prod + 1); pkt_prod = tmp___9; tx_buf = txdata->tx_buf_ring + ((unsigned long )pkt_prod & 4095UL); tx_buf->first_bd = txdata->tx_bd_prod; tx_buf->skb = skb; tx_buf->flags = 0U; bd_prod = (unsigned int )txdata->tx_bd_prod & 4095U; tx_start_bd = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->start_bd; tx_start_bd->addr_hi = (unsigned int )(mapping >> 32); tx_start_bd->addr_lo = (unsigned int )mapping; tx_start_bd->nbd = 2U; tmp___10 = skb_headlen((struct sk_buff const *)skb); tx_start_bd->nbytes = (unsigned short )tmp___10; tx_start_bd->vlan_or_ethertype = pkt_prod; tx_start_bd->bd_flags.as_bitfield = 16U; tx_start_bd->general_data = (unsigned int )tx_start_bd->general_data & 248U; tx_start_bd->general_data = (u8 )((unsigned int )tx_start_bd->general_data | 1U); tx_start_bd->general_data = (unsigned int )tx_start_bd->general_data & 159U; tx_start_bd->general_data = tx_start_bd->general_data; bd_prod = ((unsigned long )bd_prod & 255UL) == 254UL ? ((unsigned int )bd_prod + 2U) & 4095U : ((unsigned int )bd_prod + 1U) & 4095U; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { global_data = 0U; pbd_e1x = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->parse_bd_e1x; memset((void *)pbd_e1x, 0, 16UL); global_data = (unsigned int )global_data & 65487U; global_data = (u16 )((unsigned int )global_data | 16U); pbd_e1x->global_data = global_data; } else { parsing_data = 0U; pbd_e2 = & (txdata->tx_desc_ring + (unsigned long )bd_prod)->parse_bd_e2; memset((void *)pbd_e2, 0, 16UL); parsing_data = parsing_data & 1073741823U; parsing_data = parsing_data | 1073741824U; pbd_e2->parsing_data = parsing_data; } __asm__ volatile ("sfence": : : "memory"); txdata->tx_db.data.prod = (unsigned int )txdata->tx_db.data.prod + 2U; __asm__ volatile ("": : : "memory"); writel(txdata->tx_db.raw, (void volatile *)bp->doorbells + (unsigned long )((u32 )bp->db_size * txdata->cid)); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); num_pkts = num_pkts + 1U; txdata->tx_bd_prod = (unsigned int )txdata->tx_bd_prod + 2U; __const_udelay(429500UL); tx_idx = *(txdata->tx_cons_sb); if ((unsigned int )tx_idx != (unsigned int )tx_start_idx + num_pkts) { goto test_loopback_exit; } else { } if ((unsigned int )bp->common.int_block == 1U) { local_bh_disable(); bnx2x_tx_int(bp, txdata); local_bh_enable(); } else { } rx_idx = *(fp_rx->rx_cons_sb); if ((unsigned int )rx_idx != (unsigned int )rx_start_idx + num_pkts) { goto test_loopback_exit; } else { } cqe = fp_rx->rx_comp_ring + ((unsigned long )fp_rx->rx_comp_cons & 4095UL); cqe_fp_flags = cqe->fast_path_cqe.type_error_flags; cqe_fp_type = (unsigned int )cqe_fp_flags & 3U; if ((unsigned int )cqe_fp_type != 0U || ((int )cqe_fp_flags & 8) != 0) { goto test_loopback_rx_exit; } else { } len = cqe->fast_path_cqe.pkt_len_or_gro_seg_len; if ((unsigned int )len != pkt_size) { goto test_loopback_rx_exit; } else { } rx_buf = fp_rx->rx_buf_ring + ((unsigned long )fp_rx->rx_bd_cons & 4095UL); dma_sync_single_for_cpu___0(& (bp->pdev)->dev, rx_buf->mapping, (size_t )fp_rx->rx_buf_size, 2); _max1 = 32; _max2 = 64; data = rx_buf->data + ((unsigned long )(_max1 > _max2 ? _max1 : _max2) + (unsigned long )cqe->fast_path_cqe.placement_offset); i = 14U; goto ldv_52516; ldv_52515: ; if ((int )*(data + (unsigned long )i) != (int )((unsigned char )i)) { goto test_loopback_rx_exit; } else { } i = i + 1U; ldv_52516: ; if (i < pkt_size) { goto ldv_52515; } else { } rc = 0; test_loopback_rx_exit: fp_rx->rx_bd_cons = ((unsigned long )fp_rx->rx_bd_cons & 511UL) == 509UL ? (unsigned int )fp_rx->rx_bd_cons + 3U : (unsigned int )fp_rx->rx_bd_cons + 1U; fp_rx->rx_bd_prod = ((unsigned long )fp_rx->rx_bd_prod & 511UL) == 509UL ? (unsigned int )fp_rx->rx_bd_prod + 3U : (unsigned int )fp_rx->rx_bd_prod + 1U; fp_rx->rx_comp_cons = ((unsigned long )fp_rx->rx_comp_cons & 63UL) == 62UL ? (unsigned int )fp_rx->rx_comp_cons + 2U : (unsigned int )fp_rx->rx_comp_cons + 1U; fp_rx->rx_comp_prod = ((unsigned long )fp_rx->rx_comp_prod & 63UL) == 62UL ? (unsigned int )fp_rx->rx_comp_prod + 2U : (unsigned int )fp_rx->rx_comp_prod + 1U; bnx2x_update_rx_prod___0(bp, fp_rx, (int )fp_rx->rx_bd_prod, (int )fp_rx->rx_comp_prod, (int )fp_rx->rx_sge_prod); test_loopback_exit: bp->link_params.loopback_mode = 0U; return (rc); } } static int bnx2x_test_loopback(struct bnx2x *bp ) { int rc ; int res ; bool tmp ; int tmp___0 ; long tmp___1 ; long tmp___2 ; { rc = 0; if ((bp->flags & 512U) != 0U) { return (rc); } else { } tmp = netif_running((struct net_device const *)bp->dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (3); } else { } bnx2x_netif_stop(bp, 1); bnx2x_acquire_phy_lock(bp); res = bnx2x_run_loopback(bp, 0); if (res != 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)] PHY loopback failed (res %d)\n", "bnx2x_test_loopback", 2633, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", res); } else { } rc = rc | 1; } else { } res = bnx2x_run_loopback(bp, 1); if (res != 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)] MAC loopback failed (res %d)\n", "bnx2x_test_loopback", 2639, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", res); } else { } rc = rc | 2; } else { } bnx2x_release_phy_lock(bp); bnx2x_netif_start(bp); return (rc); } } static int bnx2x_test_ext_loopback(struct bnx2x *bp ) { int rc ; u8 is_serdes ; bool tmp ; int tmp___0 ; long tmp___1 ; long tmp___2 ; { is_serdes = (bp->link_vars.link_status & 1048576U) != 0U; if ((bp->flags & 512U) != 0U) { return (-19); } else { } tmp = netif_running((struct net_device const *)bp->dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (3); } else { } bnx2x_nic_unload(bp, 0, 0); rc = bnx2x_nic_load(bp, 3); if (rc != 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Can\'t perform self-test, nic_load (for external lb) failed\n", "bnx2x_test_ext_loopback", 2665, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-19); } else { } bnx2x_wait_for_link(bp, 1, (int )is_serdes); bnx2x_netif_stop(bp, 1); rc = bnx2x_run_loopback(bp, 2); if (rc != 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]EXT loopback failed (res %d)\n", "bnx2x_test_ext_loopback", 2674, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } } else { } bnx2x_netif_start(bp); return (rc); } } static int bnx2x_nvram_crc(struct bnx2x *bp , int offset , int size , u8 *buff ) { u32 crc ; int rc ; int done ; long tmp ; int count ; int __min1 ; int __min2 ; { crc = 4294967295U; rc = 0; done = 0; tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]NVRAM CRC from 0x%08x to 0x%08x\n", "bnx2x_nvram_crc", 2712, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", offset, offset + size); } else { } goto ldv_52549; ldv_52548: __min1 = size - done; __min2 = 256; count = __min1 < __min2 ? __min1 : __min2; rc = bnx2x_nvram_read(bp, (u32 )(offset + done), buff, count); if (rc != 0) { return (rc); } else { } crc = crc32_le(crc, (unsigned char const *)buff, (size_t )count); done = done + count; ldv_52549: ; if (done < size) { goto ldv_52548; } else { } if (crc != 3736805603U) { rc = -22; } else { } return (rc); } } static int bnx2x_test_nvram_dir(struct bnx2x *bp , struct code_entry *entry , u8 *buff ) { size_t size ; u32 type ; int rc ; long tmp ; { size = (size_t )entry->code_attribute & 8388604UL; type = entry->code_attribute & 4034920451U; if (size == 0UL || type == 3489660931U) { return (0); } else { } rc = bnx2x_nvram_crc(bp, (int )entry->nvm_start_addr, (int )size, buff); if (rc != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]image %x has failed crc test (rc %d)\n", "bnx2x_test_nvram_dir", 2747, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", type, rc); } else { } } else { } return (rc); } } static int bnx2x_test_dir_entry(struct bnx2x *bp , u32 addr , u8 *buff ) { int rc ; struct code_entry entry ; int tmp ; { rc = bnx2x_nvram_read32(bp, addr, (u32 *)(& entry), 12); if (rc != 0) { return (rc); } else { } tmp = bnx2x_test_nvram_dir(bp, & entry, buff); return (tmp); } } static int bnx2x_test_nvram_ext_dirs(struct bnx2x *bp , u8 *buff ) { u32 rc ; u32 cnt ; u32 dir_offset ; struct code_entry entry ; int i ; int tmp ; int tmp___0 ; int tmp___1 ; { dir_offset = 20U; tmp = bnx2x_nvram_read32(bp, dir_offset + 180U, (u32 *)(& entry), 12); rc = (u32 )tmp; if (rc != 0U) { return ((int )rc); } else { } if ((entry.code_attribute & 4034920451U) != 3758096384U || (entry.code_attribute & 8388604U) == 0U) { return (0); } else { } tmp___0 = bnx2x_nvram_read32(bp, entry.nvm_start_addr, & cnt, 4); rc = (u32 )tmp___0; if (rc != 0U) { return ((int )rc); } else { } dir_offset = entry.nvm_start_addr + 8U; i = 0; goto ldv_52577; ldv_52576: tmp___1 = bnx2x_test_dir_entry(bp, (u32 )((unsigned long )i) * 12U + dir_offset, buff); rc = (u32 )tmp___1; if (rc != 0U) { return ((int )rc); } else { } i = i + 1; ldv_52577: ; if ((u32 )i < cnt && i <= 63) { goto ldv_52576; } else { } return (0); } } static int bnx2x_test_nvram_dirs(struct bnx2x *bp , u8 *buff ) { u32 rc ; u32 dir_offset ; int i ; long tmp ; int tmp___0 ; int tmp___1 ; { dir_offset = 20U; tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]NVRAM DIRS CRC test-set\n", "bnx2x_test_nvram_dirs", 2803, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } i = 0; goto ldv_52588; ldv_52587: tmp___0 = bnx2x_test_dir_entry(bp, (u32 )((unsigned long )i) * 12U + dir_offset, buff); rc = (u32 )tmp___0; if (rc != 0U) { return ((int )rc); } else { } i = i + 1; ldv_52588: ; if (i <= 14) { goto ldv_52587; } else { } tmp___1 = bnx2x_test_nvram_ext_dirs(bp, buff); return (tmp___1); } } static int bnx2x_test_nvram_tbl(struct bnx2x *bp , struct crc_pair const *nvram_tbl , u8 *buf ) { int i ; int rc ; int tmp ; long tmp___0 ; { i = 0; goto ldv_52602; ldv_52601: tmp = bnx2x_nvram_crc(bp, (nvram_tbl + (unsigned long )i)->offset, (nvram_tbl + (unsigned long )i)->size, buf); rc = tmp; if (rc != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]nvram_tbl[%d] has failed crc test (rc %d)\n", "bnx2x_test_nvram_tbl", 2832, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, rc); } else { } return (rc); } else { } i = i + 1; ldv_52602: ; if ((int )(nvram_tbl + (unsigned long )i)->size != 0) { goto ldv_52601; } else { } return (0); } } static int bnx2x_test_nvram(struct bnx2x *bp ) { struct crc_pair nvram_tbl[7U] ; struct crc_pair nvram_tbl2[3U] ; u8 *buf ; int rc ; u32 magic ; void *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; u32 hide ; unsigned int tmp___4 ; long tmp___5 ; { nvram_tbl[0].offset = 0; nvram_tbl[0].size = 20; nvram_tbl[1].offset = 20; nvram_tbl[1].size = 236; nvram_tbl[2].offset = 256; nvram_tbl[2].size = 848; nvram_tbl[3].offset = 1104; nvram_tbl[3].size = 240; nvram_tbl[4].offset = 1600; nvram_tbl[4].size = 100; nvram_tbl[5].offset = 1800; nvram_tbl[5].size = 112; nvram_tbl[6].offset = 0; nvram_tbl[6].size = 0; nvram_tbl2[0].offset = 2024; nvram_tbl2[0].size = 848; nvram_tbl2[1].offset = 2872; nvram_tbl2[1].size = 240; nvram_tbl2[2].offset = 0; nvram_tbl2[2].size = 0; if ((bp->flags & 512U) != 0U) { return (0); } else { } tmp = kmalloc(256UL, 208U); buf = (u8 *)tmp; if ((unsigned long )buf == (unsigned long )((u8 *)0U)) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]kmalloc failed\n", "bnx2x_test_nvram", 2866, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = -12; goto test_nvram_exit; } else { } rc = bnx2x_nvram_read32(bp, 0U, & magic, 4); if (rc != 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]magic value read (rc %d)\n", "bnx2x_test_nvram", 2874, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } goto test_nvram_exit; } else { } if (magic != 1721324970U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]wrong magic value (0x%08x)\n", "bnx2x_test_nvram", 2880, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", magic); } else { } rc = -19; goto test_nvram_exit; } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Port 0 CRC test-set\n", "bnx2x_test_nvram", 2885, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = bnx2x_test_nvram_tbl(bp, (struct crc_pair const *)(& nvram_tbl), buf); if (rc != 0) { goto test_nvram_exit; } else { } if ((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) { tmp___4 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem_base + 32UL))); hide = tmp___4 & 8192U; if (hide == 0U) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Port 1 CRC test-set\n", "bnx2x_test_nvram", 2896, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = bnx2x_test_nvram_tbl(bp, (struct crc_pair const *)(& nvram_tbl2), buf); if (rc != 0) { goto test_nvram_exit; } else { } } else { } } else { } rc = bnx2x_test_nvram_dirs(bp, buf); test_nvram_exit: kfree((void const *)buf); return (rc); } } static int bnx2x_test_intr(struct bnx2x *bp ) { struct bnx2x_queue_state_params params ; long tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; { params.q_obj = (struct bnx2x_queue_sp_obj *)0; params.cmd = 0; params.ramrod_flags = 0UL; params.params.setup.gen_params.stat_id = (unsigned char)0; params.params.setup.gen_params.spcl_id = (unsigned char)0; params.params.setup.gen_params.mtu = (unsigned short)0; params.params.setup.gen_params.cos = (unsigned char)0; params.params.setup.gen_params.fp_hsi = (unsigned char)0; params.params.setup.txq_params.dscr_map = 0ULL; params.params.setup.txq_params.fw_sb_id = (unsigned char)0; params.params.setup.txq_params.sb_cq_index = (unsigned char)0; params.params.setup.txq_params.cos = (unsigned char)0; params.params.setup.txq_params.traffic_type = (unsigned short)0; params.params.setup.txq_params.tss_leading_cl_id = (unsigned char)0; params.params.setup.txq_params.default_vlan = (unsigned short)0; params.params.setup.rxq_params.dscr_map = 0ULL; params.params.setup.rxq_params.sge_map = 0ULL; params.params.setup.rxq_params.rcq_map = 0ULL; params.params.setup.rxq_params.rcq_np_map = 0ULL; params.params.setup.rxq_params.drop_flags = (unsigned short)0; params.params.setup.rxq_params.buf_sz = (unsigned short)0; params.params.setup.rxq_params.fw_sb_id = (unsigned char)0; params.params.setup.rxq_params.cl_qzone_id = (unsigned char)0; params.params.setup.rxq_params.tpa_agg_sz = (unsigned short)0; params.params.setup.rxq_params.sge_buf_sz = (unsigned short)0; params.params.setup.rxq_params.max_sges_pkt = (unsigned char)0; params.params.setup.rxq_params.max_tpa_queues = (unsigned char)0; params.params.setup.rxq_params.rss_engine_id = (unsigned char)0; params.params.setup.rxq_params.mcast_engine_id = (unsigned char)0; params.params.setup.rxq_params.cache_line_log = (unsigned char)0; params.params.setup.rxq_params.sb_cq_index = (unsigned char)0; params.params.setup.rxq_params.silent_removal_value = (unsigned short)0; params.params.setup.rxq_params.silent_removal_mask = (unsigned short)0; params.params.setup.pause_params.bd_th_lo = (unsigned short)0; params.params.setup.pause_params.bd_th_hi = (unsigned short)0; params.params.setup.pause_params.rcq_th_lo = (unsigned short)0; params.params.setup.pause_params.rcq_th_hi = (unsigned short)0; params.params.setup.pause_params.sge_th_lo = (unsigned short)0; params.params.setup.pause_params.sge_th_hi = (unsigned short)0; params.params.setup.pause_params.pri_map = (unsigned short)0; params.params.setup.flags = 0UL; tmp___0 = netif_running((struct net_device const *)bp->dev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { tmp = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot access eeprom when the interface is down\n", "bnx2x_test_intr", 2917, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-19); } else { } params.q_obj = & (bp->sp_objs)->q_obj; params.cmd = 10; __set_bit(2L, (unsigned long volatile *)(& params.ramrod_flags)); tmp___2 = bnx2x_queue_state_change(bp, & params); return (tmp___2); } } static void bnx2x_self_test(struct net_device *dev , struct ethtool_test *etest , u64 *buf ) { struct bnx2x *bp ; void *tmp ; u8 is_serdes ; u8 link_up ; int rc ; int cnt ; long tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; long tmp___4 ; bool tmp___5 ; int tmp___6 ; int port ; u32 val ; long tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; long tmp___12 ; int tmp___13 ; u8 tmp___14 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; cnt = 0; tmp___1 = pci_num_vf(bp->pdev); if (tmp___1 != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]VFs are enabled, can not perform self test\n", "bnx2x_self_test", 2938, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } if ((unsigned int )bp->recovery_state != 0U) { netdev_err((struct net_device const *)bp->dev, "Handling parity error recovery. Try again later\n"); etest->flags = etest->flags | 2U; return; } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Self-test command parameters: offline = %d, external_lb = %d\n", "bnx2x_self_test", 2952, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", etest->flags & 1U, (etest->flags & 4U) >> 2); } else { } memset((void *)buf, 0, (unsigned int )bp->mf_mode == 0U ? ((bp->flags & 4194304U) != 0U ? 0UL : 56UL) : 24UL); tmp___3 = bnx2x_test_nvram(bp); if (tmp___3 != 0) { if ((unsigned int )bp->mf_mode == 0U) { *(buf + 4UL) = 1ULL; } else { *buf = 1ULL; } etest->flags = etest->flags | 2U; } else { } tmp___5 = netif_running((struct net_device const *)dev); if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } if (tmp___6) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Interface is down\n", "bnx2x_self_test", 2965, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } is_serdes = (bp->link_vars.link_status & 1048576U) != 0U; link_up = bp->link_vars.link_up; if ((int )etest->flags & 1 && (unsigned int )bp->mf_mode == 0U) { port = (int )bp->pfid & 1; val = readl((void const volatile *)bp->regview + (unsigned long )((port + 16437) * 4)); writel(0U, (void volatile *)bp->regview + (unsigned long )((port + 16437) * 4)); bnx2x_nic_unload(bp, 0, 0); rc = bnx2x_nic_load(bp, 2); if (rc != 0) { etest->flags = etest->flags | 2U; tmp___7 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Can\'t perform self-test, nic_load (for offline) failed\n", "bnx2x_self_test", 2986, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } bnx2x_wait_for_link(bp, 1, (int )is_serdes); tmp___8 = bnx2x_test_registers(bp); if (tmp___8 != 0) { *buf = 1ULL; etest->flags = etest->flags | 2U; } else { } tmp___9 = bnx2x_test_memory(bp); if (tmp___9 != 0) { *(buf + 1UL) = 1ULL; etest->flags = etest->flags | 2U; } else { } tmp___10 = bnx2x_test_loopback(bp); *(buf + 2UL) = (u64 )tmp___10; if (*(buf + 2UL) != 0ULL) { etest->flags = etest->flags | 2U; } else { } if ((etest->flags & 4U) != 0U) { tmp___11 = bnx2x_test_ext_loopback(bp); *(buf + 3UL) = (u64 )tmp___11; if (*(buf + 3UL) != 0ULL) { etest->flags = etest->flags | 2U; } else { } etest->flags = etest->flags | 8U; } else { } bnx2x_nic_unload(bp, 0, 0); writel(val, (void volatile *)bp->regview + (unsigned long )((port + 16437) * 4)); rc = bnx2x_nic_load(bp, 0); if (rc != 0) { etest->flags = etest->flags | 2U; tmp___12 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___12 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Can\'t perform self-test, nic_load (for online) failed\n", "bnx2x_self_test", 3021, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } bnx2x_wait_for_link(bp, (int )link_up, (int )is_serdes); } else { } tmp___13 = bnx2x_test_intr(bp); if (tmp___13 != 0) { if ((unsigned int )bp->mf_mode == 0U) { *(buf + 5UL) = 1ULL; } else { *(buf + 1UL) = 1ULL; } etest->flags = etest->flags | 2U; } else { } if ((unsigned int )link_up != 0U) { cnt = 100; goto ldv_52634; ldv_52633: msleep(20U); ldv_52634: tmp___14 = bnx2x_link_test(bp, (int )is_serdes); if ((unsigned int )tmp___14 != 0U) { cnt = cnt - 1; if (cnt != 0) { goto ldv_52633; } else { goto ldv_52635; } } else { } ldv_52635: ; } else { } if (cnt == 0) { if ((unsigned int )bp->mf_mode == 0U) { *(buf + 6UL) = 1ULL; } else { *(buf + 2UL) = 1ULL; } etest->flags = etest->flags | 2U; } else { } return; } } static int bnx2x_num_stat_queues(struct bnx2x *bp ) { { return ((int )bp->num_ethernet_queues); } } static int bnx2x_get_sset_count(struct net_device *dev , int stringset ) { struct bnx2x *bp ; void *tmp ; int i ; int num_strings ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; num_strings = 0; switch (stringset) { case 1: ; if (bp->num_queues > 1) { tmp___0 = bnx2x_num_stat_queues(bp); num_strings = (int )((unsigned int )tmp___0 * 16U); } else { num_strings = 0; } if (((unsigned int )bp->mf_mode != 0U && (bp->msg_enable & 131072) == 0) || (bp->flags & 4194304U) != 0U) { i = 0; goto ldv_52652; ldv_52651: ; if (((unsigned int )bnx2x_stats_arr[i].flags & 2U) != 0U) { num_strings = num_strings + 1; } else { } i = i + 1; ldv_52652: ; if ((unsigned int )i <= 51U) { goto ldv_52651; } else { } } else { num_strings = (int )((unsigned int )num_strings + 52U); } return (num_strings); case 0: ; return ((unsigned int )bp->mf_mode == 0U ? ((bp->flags & 4194304U) != 0U ? 0 : 7) : 3); case 2: ; return (3); default: ; return (-22); } } } static u32 bnx2x_get_private_flags(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; u32 flags ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; flags = 0U; flags = (unsigned int )((bp->flags & 16384U) == 0U) | flags; flags = ((bp->flags & 32768U) == 0U ? 2U : 0U) | flags; flags = (u32 )(((((unsigned int )bp->mf_mode == 1U && ((bp->mf_config[(int )bp->pfid >> 1] & 6U) == 6U || (bp->mf_config[(int )bp->pfid >> 1] & 6U) == 0U)) || ((unsigned int )bp->mf_mode == 2U && ((bp->mf_ext_config & 14U) == 4U || (bp->mf_ext_config & 14U) == 8U))) || ((unsigned int )bp->mf_mode == 3U && (bp->mf_ext_config & 14U) == 8U)) << 2) | flags; return (flags); } } static void bnx2x_get_strings(struct net_device *dev , u32 stringset , u8 *buf ) { struct bnx2x *bp ; void *tmp ; int i ; int j ; int k ; int start ; char queue_name[5U] ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; switch (stringset) { case 1U: k = 0; if (bp->num_queues > 1) { i = 0; goto ldv_52684; ldv_52683: memset((void *)(& queue_name), 0, 5UL); sprintf((char *)(& queue_name), "%d", i); j = 0; goto ldv_52679; ldv_52678: snprintf((char *)buf + (unsigned long )((k + j) * 32), 32UL, (char const *)(& bnx2x_q_stats_arr[j].string), (char *)(& queue_name)); j = j + 1; ldv_52679: ; if ((unsigned int )j <= 15U) { goto ldv_52678; } else { } k = (int )((unsigned int )k + 16U); i = i + 1; ldv_52684: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_52683; } else { } } else { } i = 0; j = 0; goto ldv_52690; ldv_52689: ; if ((((unsigned int )bp->mf_mode != 0U && (bp->msg_enable & 131072) == 0) || (bp->flags & 4194304U) != 0U) && ((unsigned int )bnx2x_stats_arr[i].flags & 3U) == 1U) { goto ldv_52688; } else { } strcpy((char *)buf + (unsigned long )((k + j) * 32), (char const *)(& bnx2x_stats_arr[i].string)); j = j + 1; ldv_52688: i = i + 1; ldv_52690: ; if ((unsigned int )i <= 51U) { goto ldv_52689; } else { } goto ldv_52692; case 0U: ; if ((unsigned int )bp->mf_mode == 0U) { start = 0; } else { start = 4; } memcpy((void *)buf, (void const *)(& bnx2x_tests_str_arr) + (unsigned long )start, (unsigned int )bp->mf_mode == 0U ? ((bp->flags & 4194304U) != 0U ? 0UL : 224UL) : 96UL); goto ldv_52692; case 2U: memcpy((void *)buf, (void const *)(& bnx2x_private_arr), 96UL); goto ldv_52692; } ldv_52692: ; return; } } static void bnx2x_get_ethtool_stats(struct net_device *dev , struct ethtool_stats *stats , u64 *buf ) { struct bnx2x *bp ; void *tmp ; u32 *hw_stats ; u32 *offset ; int i ; int j ; int k ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; k = 0; if (bp->num_queues > 1) { i = 0; goto ldv_52715; ldv_52714: hw_stats = (u32 *)(& (bp->fp_stats + (unsigned long )i)->eth_q_stats); j = 0; goto ldv_52710; ldv_52709: ; if ((int )bnx2x_q_stats_arr[j].size == 0) { *(buf + (unsigned long )(k + j)) = 0ULL; goto ldv_52708; } else { } offset = hw_stats + (unsigned long )bnx2x_q_stats_arr[j].offset; if ((int )bnx2x_q_stats_arr[j].size == 4) { *(buf + (unsigned long )(k + j)) = (unsigned long long )*offset; goto ldv_52708; } else { } *(buf + (unsigned long )(k + j)) = ((unsigned long long )*offset << 32) + (unsigned long long )*(offset + 1UL); ldv_52708: j = j + 1; ldv_52710: ; if ((unsigned int )j <= 15U) { goto ldv_52709; } else { } k = (int )((unsigned int )k + 16U); i = i + 1; ldv_52715: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_52714; } else { } } else { } hw_stats = (u32 *)(& bp->eth_stats); i = 0; j = 0; goto ldv_52721; ldv_52720: ; if ((((unsigned int )bp->mf_mode != 0U && (bp->msg_enable & 131072) == 0) || (bp->flags & 4194304U) != 0U) && ((unsigned int )bnx2x_stats_arr[i].flags & 3U) == 1U) { goto ldv_52719; } else { } if ((int )bnx2x_stats_arr[i].size == 0) { *(buf + (unsigned long )(k + j)) = 0ULL; j = j + 1; goto ldv_52719; } else { } offset = hw_stats + (unsigned long )bnx2x_stats_arr[i].offset; if ((int )bnx2x_stats_arr[i].size == 4) { *(buf + (unsigned long )(k + j)) = (unsigned long long )*offset; j = j + 1; goto ldv_52719; } else { } *(buf + (unsigned long )(k + j)) = ((unsigned long long )*offset << 32) + (unsigned long long )*(offset + 1UL); j = j + 1; ldv_52719: i = i + 1; ldv_52721: ; if ((unsigned int )i <= 51U) { goto ldv_52720; } else { } return; } } static int bnx2x_set_phys_id(struct net_device *dev , enum ethtool_phys_id_state state ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___1 = bnx2x_is_nvm_accessible(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67371008) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]cannot access eeprom when the interface is down\n", "bnx2x_set_phys_id", 3219, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-11); } else { } switch ((unsigned int )state) { case 1U: ; return (1); case 2U: bnx2x_acquire_phy_lock(bp); bnx2x_set_led(& bp->link_params, & bp->link_vars, 1, 1000U); bnx2x_release_phy_lock(bp); goto ldv_52731; case 3U: bnx2x_acquire_phy_lock(bp); bnx2x_set_led(& bp->link_params, & bp->link_vars, 3, 0U); bnx2x_release_phy_lock(bp); goto ldv_52731; case 0U: bnx2x_acquire_phy_lock(bp); bnx2x_set_led(& bp->link_params, & bp->link_vars, 2, (u32 )bp->link_vars.line_speed); bnx2x_release_phy_lock(bp); } ldv_52731: ; return (0); } } static int bnx2x_get_rss_flags(struct bnx2x *bp , struct ethtool_rxnfc *info ) { { switch (info->flow_type) { case 1U: ; case 5U: info->data = 240ULL; goto ldv_52740; case 2U: ; if ((unsigned int )bp->rss_conf_obj.udp_rss_v4 != 0U) { info->data = 240ULL; } else { info->data = 48ULL; } goto ldv_52740; case 6U: ; if ((unsigned int )bp->rss_conf_obj.udp_rss_v6 != 0U) { info->data = 240ULL; } else { info->data = 48ULL; } goto ldv_52740; case 16U: ; case 17U: info->data = 48ULL; goto ldv_52740; default: info->data = 0ULL; goto ldv_52740; } ldv_52740: ; return (0); } } static int bnx2x_get_rxnfc(struct net_device *dev , struct ethtool_rxnfc *info , u32 *rules ) { struct bnx2x *bp ; void *tmp ; int tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; switch (info->cmd) { case 45U: info->data = (__u64 )bp->num_ethernet_queues; return (0); case 41U: tmp___0 = bnx2x_get_rss_flags(bp, info); return (tmp___0); default: tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Command parameters not supported\n", "bnx2x_get_rxnfc", 3298, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-95); } } } static int bnx2x_set_rss_flags(struct bnx2x *bp , struct ethtool_rxnfc *info ) { int udp_rss_requested ; long tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; { tmp = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set rss flags command parameters: flow type = %d, data = %llu\n", "bnx2x_set_rss_flags", 3309, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", info->flow_type, info->data); } else { } switch (info->flow_type) { case 1U: ; case 5U: ; if (info->data != 240ULL) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Command parameters not supported\n", "bnx2x_set_rss_flags", 3318, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } return (0); case 2U: ; case 6U: ; if (info->data == 240ULL) { udp_rss_requested = 1; } else if (info->data == 48ULL) { udp_rss_requested = 0; } else { return (-22); } if (info->flow_type == 2U && (int )bp->rss_conf_obj.udp_rss_v4 != udp_rss_requested) { bp->rss_conf_obj.udp_rss_v4 = (u8 )udp_rss_requested; tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]rss re-configured, UDP 4-tupple %s\n", "bnx2x_set_rss_flags", 3338, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", udp_rss_requested != 0 ? (char *)"enabled" : (char *)"disabled"); } else { } tmp___2 = bnx2x_rss(bp, & bp->rss_conf_obj, 0, 1); return (tmp___2); } else if (info->flow_type == 6U && (int )bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested) { bp->rss_conf_obj.udp_rss_v6 = (u8 )udp_rss_requested; tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]rss re-configured, UDP 4-tupple %s\n", "bnx2x_set_rss_flags", 3345, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", udp_rss_requested != 0 ? (char *)"enabled" : (char *)"disabled"); } else { } tmp___4 = bnx2x_rss(bp, & bp->rss_conf_obj, 0, 1); return (tmp___4); } else { } return (0); case 16U: ; case 17U: ; if (info->data != 48ULL) { tmp___5 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Command parameters not supported\n", "bnx2x_set_rss_flags", 3355, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } return (0); case 3U: ; case 4U: ; case 9U: ; case 10U: ; case 7U: ; case 8U: ; case 11U: ; case 12U: ; case 13U: ; case 18U: ; if (info->data != 0ULL) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Command parameters not supported\n", "bnx2x_set_rss_flags", 3373, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } return (0); default: ; return (-22); } } } static int bnx2x_set_rxnfc(struct net_device *dev , struct ethtool_rxnfc *info ) { struct bnx2x *bp ; void *tmp ; int tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; switch (info->cmd) { case 42U: tmp___0 = bnx2x_set_rss_flags(bp, info); return (tmp___0); default: tmp___1 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Command parameters not supported\n", "bnx2x_set_rxnfc", 3391, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-95); } } } static u32 bnx2x_get_rxfh_indir_size(struct net_device *dev ) { { return (128U); } } static int bnx2x_get_rxfh(struct net_device *dev , u32 *indir , u8 *key , u8 *hfunc ) { struct bnx2x *bp ; void *tmp ; u8 ind_table[128U] ; unsigned int tmp___0 ; size_t i ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; ind_table[0] = 0U; tmp___0 = 1U; while (1) { if (tmp___0 >= 128U) { break; } else { } ind_table[tmp___0] = (unsigned char)0; tmp___0 = tmp___0 + 1U; } if ((unsigned long )hfunc != (unsigned long )((u8 *)0U)) { *hfunc = 1U; } else { } if ((unsigned long )indir == (unsigned long )((u32 *)0U)) { return (0); } else { } bnx2x_get_rss_ind_table(& bp->rss_conf_obj, (u8 *)(& ind_table)); i = 0UL; goto ldv_52800; ldv_52799: *(indir + i) = (u32 )((int )ind_table[i] - (int )(bp->fp)->cl_id); i = i + 1UL; ldv_52800: ; if (i <= 127UL) { goto ldv_52799; } else { } return (0); } } static int bnx2x_set_rxfh(struct net_device *dev , u32 const *indir , u8 const *key , u8 const hfunc ) { struct bnx2x *bp ; void *tmp ; size_t i ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((unsigned long )key != (unsigned long )((u8 const *)0U) || ((unsigned int )((unsigned char )hfunc) != 0U && (unsigned int )((unsigned char )hfunc) != 1U)) { return (-95); } else { } if ((unsigned long )indir == (unsigned long )((u32 const *)0U)) { return (0); } else { } i = 0UL; goto ldv_52811; ldv_52810: bp->rss_conf_obj.ind_table[i] = (int )((u8 )*(indir + i)) + (int )(bp->fp)->cl_id; i = i + 1UL; ldv_52811: ; if (i <= 127UL) { goto ldv_52810; } else { } tmp___0 = bnx2x_config_rss_eth(bp, 0); return (tmp___0); } } static void bnx2x_get_channels(struct net_device *dev , struct ethtool_channels *channels ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; channels->max_combined = (__u32 )((int )bp->igu_sb_cnt - (int )bp->cnic_support); channels->combined_count = bp->num_ethernet_queues; return; } } static void bnx2x_change_num_queues(struct bnx2x *bp , int num_rss ) { long tmp ; { bnx2x_disable_msi(bp); bp->num_ethernet_queues = (uint )num_rss; bp->num_queues = (int )(bp->num_ethernet_queues + bp->num_cnic_queues); tmp = ldv__builtin_expect((bp->msg_enable & 2) != 0, 0L); if (tmp != 0L) { _dev_info((struct device const *)(& (bp->pdev)->dev), "set number of queues to %d\n", bp->num_queues); } else { } bnx2x_set_int_mode(bp); return; } } static int bnx2x_set_channels(struct net_device *dev , struct ethtool_channels *channels ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; bool tmp___5 ; int tmp___6 ; long tmp___7 ; int tmp___8 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]set-channels command parameters: rx = %d, tx = %d, other = %d, combined = %d\n", "bnx2x_set_channels", 3509, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", channels->rx_count, channels->tx_count, channels->other_count, channels->combined_count); } else { } tmp___2 = pci_num_vf(bp->pdev); if (tmp___2 != 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]VFs are enabled, can not set channels\n", "bnx2x_set_channels", 3512, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-1); } else { } if ((((channels->rx_count != 0U || channels->tx_count != 0U) || channels->other_count != 0U) || channels->combined_count == 0U) || channels->combined_count > (__u32 )((int )bp->igu_sb_cnt - (int )bp->cnic_support)) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]command parameters not supported\n", "bnx2x_set_channels", 3522, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } if (channels->combined_count == bp->num_ethernet_queues) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 67108864) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]No change in active parameters\n", "bnx2x_set_channels", 3528, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } else { } tmp___5 = netif_running((struct net_device const *)dev); if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } tmp___7 = ldv__builtin_expect((long )tmp___6, 0L); if (tmp___7 != 0L) { bnx2x_change_num_queues(bp, (int )channels->combined_count); return (0); } else { } bnx2x_nic_unload(bp, 0, 1); bnx2x_change_num_queues(bp, (int )channels->combined_count); tmp___8 = bnx2x_nic_load(bp, 0); return (tmp___8); } } static int bnx2x_get_ts_info(struct net_device *dev , struct ethtool_ts_info *info ) { struct bnx2x *bp ; void *tmp ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; if ((bp->flags & 67108864U) != 0U) { info->so_timestamping = 95U; if ((unsigned long )bp->ptp_clock != (unsigned long )((struct ptp_clock *)0)) { info->phc_index = ptp_clock_index(bp->ptp_clock); } else { info->phc_index = -1; } info->rx_filters = 32761U; info->tx_types = 3U; return (0); } else { } tmp___0 = ethtool_op_get_ts_info(dev, info); return (tmp___0); } } static struct ethtool_ops const bnx2x_ethtool_ops = {& bnx2x_get_settings, & bnx2x_set_settings, & bnx2x_get_drvinfo, & bnx2x_get_regs_len, & bnx2x_get_regs, & bnx2x_get_wol, & bnx2x_set_wol, & bnx2x_get_msglevel, & bnx2x_set_msglevel, & bnx2x_nway_reset, & bnx2x_get_link, & bnx2x_get_eeprom_len, & bnx2x_get_eeprom, & bnx2x_set_eeprom, & bnx2x_get_coalesce, & bnx2x_set_coalesce, & bnx2x_get_ringparam, & bnx2x_set_ringparam, & bnx2x_get_pauseparam, & bnx2x_set_pauseparam, & bnx2x_self_test, & bnx2x_get_strings, & bnx2x_set_phys_id, & bnx2x_get_ethtool_stats, 0, 0, & bnx2x_get_private_flags, 0, & bnx2x_get_sset_count, & bnx2x_get_rxnfc, & bnx2x_set_rxnfc, 0, 0, 0, & bnx2x_get_rxfh_indir_size, & bnx2x_get_rxfh, & bnx2x_set_rxfh, & bnx2x_get_channels, & bnx2x_set_channels, & bnx2x_get_dump_flag, & bnx2x_get_dump_data, & bnx2x_set_dump, & bnx2x_get_ts_info, & bnx2x_get_module_info, & bnx2x_get_module_eeprom, & bnx2x_get_eee, & bnx2x_set_eee, 0, 0}; static struct ethtool_ops const bnx2x_vf_ethtool_ops = {& bnx2x_get_vf_settings, 0, & bnx2x_get_drvinfo, 0, 0, 0, 0, & bnx2x_get_msglevel, & bnx2x_set_msglevel, 0, & bnx2x_get_link, 0, 0, 0, & bnx2x_get_coalesce, 0, & bnx2x_get_ringparam, & bnx2x_set_ringparam, 0, 0, 0, & bnx2x_get_strings, 0, & bnx2x_get_ethtool_stats, 0, 0, 0, 0, & bnx2x_get_sset_count, & bnx2x_get_rxnfc, & bnx2x_set_rxnfc, 0, 0, 0, & bnx2x_get_rxfh_indir_size, & bnx2x_get_rxfh, & bnx2x_set_rxfh, & bnx2x_get_channels, & bnx2x_set_channels, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void bnx2x_set_ethtool_ops(struct bnx2x *bp , struct net_device *netdev ) { { netdev->ethtool_ops = (bp->flags & 4194304U) == 0U ? & bnx2x_ethtool_ops : & bnx2x_vf_ethtool_ops; return; } } void ldv_initialize_ethtool_ops_12(void) { void *tmp ; void *tmp___0 ; 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 ; { tmp = ldv_init_zalloc(40UL); bnx2x_ethtool_ops_group0 = (struct ethtool_eee *)tmp; tmp___0 = ldv_init_zalloc(36UL); bnx2x_ethtool_ops_group1 = (struct ethtool_ringparam *)tmp___0; tmp___1 = ldv_init_zalloc(16UL); bnx2x_ethtool_ops_group3 = (struct ethtool_eeprom *)tmp___1; tmp___2 = ldv_init_zalloc(44UL); bnx2x_ethtool_ops_group2 = (struct ethtool_cmd *)tmp___2; tmp___3 = ldv_init_zalloc(16UL); bnx2x_ethtool_ops_group9 = (struct ethtool_dump *)tmp___3; tmp___4 = ldv_init_zalloc(16UL); bnx2x_ethtool_ops_group4 = (struct ethtool_pauseparam *)tmp___4; tmp___5 = ldv_init_zalloc(36UL); bnx2x_ethtool_ops_group5 = (struct ethtool_channels *)tmp___5; tmp___6 = ldv_init_zalloc(92UL); bnx2x_ethtool_ops_group6 = (struct ethtool_coalesce *)tmp___6; tmp___7 = ldv_init_zalloc(3008UL); bnx2x_ethtool_ops_group10 = (struct net_device *)tmp___7; tmp___8 = ldv_init_zalloc(192UL); bnx2x_ethtool_ops_group7 = (struct ethtool_rxnfc *)tmp___8; tmp___9 = ldv_init_zalloc(20UL); bnx2x_ethtool_ops_group8 = (struct ethtool_wolinfo *)tmp___9; return; } } void ldv_initialize_ethtool_ops_11(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; { tmp = ldv_init_zalloc(36UL); bnx2x_vf_ethtool_ops_group1 = (struct ethtool_channels *)tmp; tmp___0 = ldv_init_zalloc(36UL); bnx2x_vf_ethtool_ops_group0 = (struct ethtool_ringparam *)tmp___0; tmp___1 = ldv_init_zalloc(3008UL); bnx2x_vf_ethtool_ops_group2 = (struct net_device *)tmp___1; tmp___2 = ldv_init_zalloc(192UL); bnx2x_vf_ethtool_ops_group3 = (struct ethtool_rxnfc *)tmp___2; return; } } void ldv_main_exported_11(void) { struct ethtool_coalesce *ldvarg2 ; void *tmp ; u32 *ldvarg14 ; void *tmp___0 ; u8 *ldvarg4 ; void *tmp___1 ; u32 *ldvarg15 ; void *tmp___2 ; u32 ldvarg6 ; u32 ldvarg5 ; u64 *ldvarg0 ; void *tmp___3 ; u8 *ldvarg9 ; void *tmp___4 ; u8 *ldvarg10 ; void *tmp___5 ; u8 *ldvarg13 ; void *tmp___6 ; struct ethtool_stats *ldvarg1 ; void *tmp___7 ; int ldvarg8 ; u8 ldvarg12 ; struct ethtool_drvinfo *ldvarg3 ; void *tmp___8 ; struct ethtool_cmd *ldvarg7 ; void *tmp___9 ; u32 *ldvarg11 ; void *tmp___10 ; int tmp___11 ; { tmp = ldv_init_zalloc(92UL); ldvarg2 = (struct ethtool_coalesce *)tmp; tmp___0 = ldv_init_zalloc(4UL); ldvarg14 = (u32 *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg4 = (u8 *)tmp___1; tmp___2 = ldv_init_zalloc(4UL); ldvarg15 = (u32 *)tmp___2; tmp___3 = ldv_init_zalloc(8UL); ldvarg0 = (u64 *)tmp___3; tmp___4 = ldv_init_zalloc(1UL); ldvarg9 = (u8 *)tmp___4; tmp___5 = ldv_init_zalloc(1UL); ldvarg10 = (u8 *)tmp___5; tmp___6 = ldv_init_zalloc(1UL); ldvarg13 = (u8 *)tmp___6; tmp___7 = ldv_init_zalloc(8UL); ldvarg1 = (struct ethtool_stats *)tmp___7; tmp___8 = ldv_init_zalloc(196UL); ldvarg3 = (struct ethtool_drvinfo *)tmp___8; tmp___9 = ldv_init_zalloc(44UL); ldvarg7 = (struct ethtool_cmd *)tmp___9; tmp___10 = ldv_init_zalloc(4UL); ldvarg11 = (u32 *)tmp___10; ldv_memset((void *)(& ldvarg6), 0, 4UL); ldv_memset((void *)(& ldvarg5), 0, 4UL); ldv_memset((void *)(& ldvarg8), 0, 4UL); ldv_memset((void *)(& ldvarg12), 0, 1UL); tmp___11 = __VERIFIER_nondet_int(); switch (tmp___11) { case 0: ; if (ldv_state_variable_11 == 1) { bnx2x_set_rxnfc(bnx2x_vf_ethtool_ops_group2, bnx2x_vf_ethtool_ops_group3); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 1: ; if (ldv_state_variable_11 == 1) { bnx2x_get_rxnfc(bnx2x_vf_ethtool_ops_group2, bnx2x_vf_ethtool_ops_group3, ldvarg15); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 2: ; if (ldv_state_variable_11 == 1) { bnx2x_get_ringparam(bnx2x_vf_ethtool_ops_group2, bnx2x_vf_ethtool_ops_group0); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 3: ; if (ldv_state_variable_11 == 1) { bnx2x_set_rxfh(bnx2x_vf_ethtool_ops_group2, (u32 const *)ldvarg14, (u8 const *)ldvarg13, (int )ldvarg12); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 4: ; if (ldv_state_variable_11 == 1) { bnx2x_set_channels(bnx2x_vf_ethtool_ops_group2, bnx2x_vf_ethtool_ops_group1); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 5: ; if (ldv_state_variable_11 == 1) { bnx2x_get_rxfh(bnx2x_vf_ethtool_ops_group2, ldvarg11, ldvarg10, ldvarg9); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 6: ; if (ldv_state_variable_11 == 1) { bnx2x_get_sset_count(bnx2x_vf_ethtool_ops_group2, ldvarg8); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 7: ; if (ldv_state_variable_11 == 1) { bnx2x_get_vf_settings(bnx2x_vf_ethtool_ops_group2, ldvarg7); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 8: ; if (ldv_state_variable_11 == 1) { bnx2x_set_msglevel(bnx2x_vf_ethtool_ops_group2, ldvarg6); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 9: ; if (ldv_state_variable_11 == 1) { bnx2x_get_strings(bnx2x_vf_ethtool_ops_group2, ldvarg5, ldvarg4); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 10: ; if (ldv_state_variable_11 == 1) { bnx2x_get_channels(bnx2x_vf_ethtool_ops_group2, bnx2x_vf_ethtool_ops_group1); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 11: ; if (ldv_state_variable_11 == 1) { bnx2x_get_link(bnx2x_vf_ethtool_ops_group2); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 12: ; if (ldv_state_variable_11 == 1) { bnx2x_get_drvinfo(bnx2x_vf_ethtool_ops_group2, ldvarg3); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 13: ; if (ldv_state_variable_11 == 1) { bnx2x_get_coalesce(bnx2x_vf_ethtool_ops_group2, ldvarg2); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 14: ; if (ldv_state_variable_11 == 1) { bnx2x_get_ethtool_stats(bnx2x_vf_ethtool_ops_group2, ldvarg1, ldvarg0); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 15: ; if (ldv_state_variable_11 == 1) { bnx2x_get_rxfh_indir_size(bnx2x_vf_ethtool_ops_group2); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 16: ; if (ldv_state_variable_11 == 1) { bnx2x_get_msglevel(bnx2x_vf_ethtool_ops_group2); ldv_state_variable_11 = 1; } else { } goto ldv_52865; case 17: ; if (ldv_state_variable_11 == 1) { bnx2x_set_ringparam(bnx2x_vf_ethtool_ops_group2, bnx2x_vf_ethtool_ops_group0); ldv_state_variable_11 = 1; } else { } goto ldv_52865; default: ldv_stop(); } ldv_52865: ; return; } } void ldv_main_exported_12(void) { u8 *ldvarg75 ; void *tmp ; struct ethtool_modinfo *ldvarg82 ; void *tmp___0 ; u8 *ldvarg74 ; void *tmp___1 ; void *ldvarg76 ; void *tmp___2 ; u8 *ldvarg89 ; void *tmp___3 ; u32 *ldvarg92 ; void *tmp___4 ; int ldvarg93 ; u8 *ldvarg90 ; void *tmp___5 ; struct ethtool_regs *ldvarg78 ; void *tmp___6 ; u32 ldvarg88 ; u64 *ldvarg85 ; void *tmp___7 ; u8 ldvarg95 ; struct ethtool_drvinfo *ldvarg81 ; void *tmp___8 ; u8 *ldvarg83 ; void *tmp___9 ; u8 *ldvarg96 ; void *tmp___10 ; u32 *ldvarg97 ; void *tmp___11 ; u64 *ldvarg79 ; void *tmp___12 ; u32 *ldvarg98 ; void *tmp___13 ; struct ethtool_test *ldvarg86 ; void *tmp___14 ; struct ethtool_ts_info *ldvarg87 ; void *tmp___15 ; struct ethtool_stats *ldvarg80 ; void *tmp___16 ; u8 *ldvarg91 ; void *tmp___17 ; enum ethtool_phys_id_state ldvarg94 ; u32 ldvarg84 ; void *ldvarg77 ; void *tmp___18 ; int tmp___19 ; { tmp = ldv_init_zalloc(1UL); ldvarg75 = (u8 *)tmp; tmp___0 = ldv_init_zalloc(44UL); ldvarg82 = (struct ethtool_modinfo *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg74 = (u8 *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg76 = tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg89 = (u8 *)tmp___3; tmp___4 = ldv_init_zalloc(4UL); ldvarg92 = (u32 *)tmp___4; tmp___5 = ldv_init_zalloc(1UL); ldvarg90 = (u8 *)tmp___5; tmp___6 = ldv_init_zalloc(12UL); ldvarg78 = (struct ethtool_regs *)tmp___6; tmp___7 = ldv_init_zalloc(8UL); ldvarg85 = (u64 *)tmp___7; tmp___8 = ldv_init_zalloc(196UL); ldvarg81 = (struct ethtool_drvinfo *)tmp___8; tmp___9 = ldv_init_zalloc(1UL); ldvarg83 = (u8 *)tmp___9; tmp___10 = ldv_init_zalloc(1UL); ldvarg96 = (u8 *)tmp___10; tmp___11 = ldv_init_zalloc(4UL); ldvarg97 = (u32 *)tmp___11; tmp___12 = ldv_init_zalloc(8UL); ldvarg79 = (u64 *)tmp___12; tmp___13 = ldv_init_zalloc(4UL); ldvarg98 = (u32 *)tmp___13; tmp___14 = ldv_init_zalloc(16UL); ldvarg86 = (struct ethtool_test *)tmp___14; tmp___15 = ldv_init_zalloc(44UL); ldvarg87 = (struct ethtool_ts_info *)tmp___15; tmp___16 = ldv_init_zalloc(8UL); ldvarg80 = (struct ethtool_stats *)tmp___16; tmp___17 = ldv_init_zalloc(1UL); ldvarg91 = (u8 *)tmp___17; tmp___18 = ldv_init_zalloc(1UL); ldvarg77 = tmp___18; ldv_memset((void *)(& ldvarg93), 0, 4UL); ldv_memset((void *)(& ldvarg88), 0, 4UL); ldv_memset((void *)(& ldvarg95), 0, 1UL); ldv_memset((void *)(& ldvarg94), 0, 4UL); ldv_memset((void *)(& ldvarg84), 0, 4UL); tmp___19 = __VERIFIER_nondet_int(); switch (tmp___19) { case 0: ; if (ldv_state_variable_12 == 1) { bnx2x_set_dump(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group9); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 1: ; if (ldv_state_variable_12 == 1) { bnx2x_set_rxnfc(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group7); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 2: ; if (ldv_state_variable_12 == 1) { bnx2x_get_rxnfc(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group7, ldvarg98); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 3: ; if (ldv_state_variable_12 == 1) { bnx2x_get_ringparam(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group1); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 4: ; if (ldv_state_variable_12 == 1) { bnx2x_set_rxfh(bnx2x_ethtool_ops_group10, (u32 const *)ldvarg97, (u8 const *)ldvarg96, (int )ldvarg95); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 5: ; if (ldv_state_variable_12 == 1) { bnx2x_get_pauseparam(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group4); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 6: ; if (ldv_state_variable_12 == 1) { bnx2x_set_phys_id(bnx2x_ethtool_ops_group10, ldvarg94); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 7: ; if (ldv_state_variable_12 == 1) { bnx2x_get_settings(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group2); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 8: ; if (ldv_state_variable_12 == 1) { bnx2x_set_channels(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group5); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 9: ; if (ldv_state_variable_12 == 1) { bnx2x_get_sset_count(bnx2x_ethtool_ops_group10, ldvarg93); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 10: ; if (ldv_state_variable_12 == 1) { bnx2x_get_rxfh(bnx2x_ethtool_ops_group10, ldvarg92, ldvarg91, ldvarg90); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 11: ; if (ldv_state_variable_12 == 1) { bnx2x_set_coalesce(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group6); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 12: ; if (ldv_state_variable_12 == 1) { bnx2x_get_module_eeprom(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group3, ldvarg89); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 13: ; if (ldv_state_variable_12 == 1) { bnx2x_set_msglevel(bnx2x_ethtool_ops_group10, ldvarg88); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 14: ; if (ldv_state_variable_12 == 1) { bnx2x_get_ts_info(bnx2x_ethtool_ops_group10, ldvarg87); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 15: ; if (ldv_state_variable_12 == 1) { bnx2x_get_eeprom_len(bnx2x_ethtool_ops_group10); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 16: ; if (ldv_state_variable_12 == 1) { bnx2x_self_test(bnx2x_ethtool_ops_group10, ldvarg86, ldvarg85); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 17: ; if (ldv_state_variable_12 == 1) { bnx2x_get_strings(bnx2x_ethtool_ops_group10, ldvarg84, ldvarg83); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 18: ; if (ldv_state_variable_12 == 1) { bnx2x_nway_reset(bnx2x_ethtool_ops_group10); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 19: ; if (ldv_state_variable_12 == 1) { bnx2x_set_eee(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group0); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 20: ; if (ldv_state_variable_12 == 1) { bnx2x_get_eee(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group0); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 21: ; if (ldv_state_variable_12 == 1) { bnx2x_get_module_info(bnx2x_ethtool_ops_group10, ldvarg82); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 22: ; if (ldv_state_variable_12 == 1) { bnx2x_get_channels(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group5); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 23: ; if (ldv_state_variable_12 == 1) { bnx2x_get_link(bnx2x_ethtool_ops_group10); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 24: ; if (ldv_state_variable_12 == 1) { bnx2x_get_private_flags(bnx2x_ethtool_ops_group10); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 25: ; if (ldv_state_variable_12 == 1) { bnx2x_get_drvinfo(bnx2x_ethtool_ops_group10, ldvarg81); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 26: ; if (ldv_state_variable_12 == 1) { bnx2x_set_pauseparam(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group4); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 27: ; if (ldv_state_variable_12 == 1) { bnx2x_get_ethtool_stats(bnx2x_ethtool_ops_group10, ldvarg80, ldvarg79); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 28: ; if (ldv_state_variable_12 == 1) { bnx2x_get_coalesce(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group6); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 29: ; if (ldv_state_variable_12 == 1) { bnx2x_get_regs(bnx2x_ethtool_ops_group10, ldvarg78, ldvarg77); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 30: ; if (ldv_state_variable_12 == 1) { bnx2x_get_rxfh_indir_size(bnx2x_ethtool_ops_group10); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 31: ; if (ldv_state_variable_12 == 1) { bnx2x_set_wol(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group8); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 32: ; if (ldv_state_variable_12 == 1) { bnx2x_set_settings(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group2); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 33: ; if (ldv_state_variable_12 == 1) { bnx2x_get_dump_data(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group9, ldvarg76); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 34: ; if (ldv_state_variable_12 == 1) { bnx2x_get_eeprom(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group3, ldvarg75); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 35: ; if (ldv_state_variable_12 == 1) { bnx2x_get_wol(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group8); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 36: ; if (ldv_state_variable_12 == 1) { bnx2x_get_dump_flag(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group9); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 37: ; if (ldv_state_variable_12 == 1) { bnx2x_set_eeprom(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group3, ldvarg74); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 38: ; if (ldv_state_variable_12 == 1) { bnx2x_get_msglevel(bnx2x_ethtool_ops_group10); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 39: ; if (ldv_state_variable_12 == 1) { bnx2x_get_regs_len(bnx2x_ethtool_ops_group10); ldv_state_variable_12 = 1; } else { } goto ldv_52913; case 40: ; if (ldv_state_variable_12 == 1) { bnx2x_set_ringparam(bnx2x_ethtool_ops_group10, bnx2x_ethtool_ops_group1); ldv_state_variable_12 = 1; } else { } goto ldv_52913; default: ldv_stop(); } ldv_52913: ; return; } } bool ldv_queue_work_on_109(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_110(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_111(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_112(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_113(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void __dynamic_netdev_dbg(struct _ddebug * , struct net_device const * , char const * , ...) ; bool ldv_queue_work_on_123(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_125(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_124(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_127(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_126(struct workqueue_struct *ldv_func_arg1 ) ; int bnx2x_stats_safe_exec(struct bnx2x *bp , void (*func_to_exec)(void * ) , void *cookie ) ; static u32 const dmae_reg_go_c___0[16U] = { 1056896U, 1056900U, 1056928U, 1056932U, 1056936U, 1056940U, 1056944U, 1056948U, 1056952U, 1056956U, 1056904U, 1056908U, 1056912U, 1056916U, 1056920U, 1056924U}; void bnx2x_iov_adjust_stats_req(struct bnx2x *bp ) ; __inline static long bnx2x_hilo(u32 *hiref ) { u32 lo ; u32 hi ; { lo = *(hiref + 1UL); hi = *hiref; return ((long )(((unsigned long long )hi << 32) + (unsigned long long )lo)); } } __inline static u16 bnx2x_get_port_stats_dma_len(struct bnx2x *bp ) { u16 res ; u32 size ; unsigned int tmp ; unsigned int tmp___0 ; int __ret_warn_on ; long tmp___1 ; { res = 0U; if (bp->common.shmem2_base != 0U) { tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___0 > 312U) { tmp = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 312UL))); size = tmp; if (size != 0U) { res = (u16 )size; } else { } if ((unsigned int )res > 648U) { res = 648U; } else { } } else { } } else { } if ((unsigned int )res == 0U) { res = 624U; if ((bp->flags & 131072U) != 0U) { res = (unsigned int )res + 16U; } else { } } else { } res = (u16 )((int )res >> 2); __ret_warn_on = (unsigned int )res > 256U; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c", 74); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (res); } } static void bnx2x_dp_stats(struct bnx2x *bp ) { int i ; long tmp ; long tmp___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]dumping stats:\nfw_stats_req\n hdr\n cmd_num %d\n reserved0 %d\n drv_stats_counter %d\n reserved1 %d\n stats_counters_addrs %x %x\n", "bnx2x_dp_stats", 99, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )(bp->fw_stats_req)->hdr.cmd_num, (int )(bp->fw_stats_req)->hdr.reserved0, (int )(bp->fw_stats_req)->hdr.drv_stats_counter, (bp->fw_stats_req)->hdr.reserved1, (bp->fw_stats_req)->hdr.stats_counters_addrs.hi, (bp->fw_stats_req)->hdr.stats_counters_addrs.lo); } else { } i = 0; goto ldv_51577; ldv_51576: tmp___0 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]query[%d]\n kind %d\n index %d\n funcID %d\n reserved %d\n address %x %x\n", "bnx2x_dp_stats", 114, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (int )(bp->fw_stats_req)->query[i].kind, (int )(bp->fw_stats_req)->query[i].index, (int )(bp->fw_stats_req)->query[i].funcID, (bp->fw_stats_req)->query[i].reserved, (bp->fw_stats_req)->query[i].address.hi, (bp->fw_stats_req)->query[i].address.lo); } else { } i = i + 1; ldv_51577: ; if ((int )(bp->fw_stats_req)->hdr.cmd_num > i) { goto ldv_51576; } else { } return; } } static void bnx2x_storm_stats_post(struct bnx2x *bp ) { int rc ; u16 tmp ; long tmp___0 ; { if ((unsigned int )bp->stats_pending != 0U) { return; } else { } tmp = bp->stats_counter; bp->stats_counter = (u16 )((int )bp->stats_counter + 1); (bp->fw_stats_req)->hdr.drv_stats_counter = tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Sending statistics ramrod %d\n", "bnx2x_storm_stats_post", 135, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )(bp->fw_stats_req)->hdr.drv_stats_counter); } else { } bnx2x_iov_adjust_stats_req(bp); bnx2x_dp_stats(bp); rc = bnx2x_sp_post(bp, 6, 0, (unsigned int )(bp->fw_stats_req_mapping >> 32), (unsigned int )bp->fw_stats_req_mapping, 8); if (rc == 0) { bp->stats_pending = 1U; } else { } return; } } static void bnx2x_hw_stats_post(struct bnx2x *bp ) { struct dmae_command *dmae ; u32 *stats_comp ; int loader_idx ; u32 opcode ; u32 tmp ; { dmae = & bp->stats_dmae; stats_comp = & (bp->slowpath)->stats_comp; *stats_comp = 1624297646U; if ((bp->common.chip_id & 61440U) > 20480U) { return; } else { } if (bp->func_stx != 0U) { memcpy((void *)(& (bp->slowpath)->func_stats), (void const *)(& bp->func_stats), 80UL); } else { } if (bp->executer_idx != 0) { loader_idx = ((int )bp->pfid & 1) * 8 + 4; tmp = bnx2x_dmae_opcode(bp, 0, 2, 1, 1); opcode = tmp; opcode = bnx2x_dmae_opcode_clr_src_reset(opcode); memset((void *)dmae, 0, 56UL); dmae->opcode = opcode; dmae->src_addr_lo = (unsigned int )bp->slowpath_mapping + 2704U; dmae->src_addr_hi = (unsigned int )((bp->slowpath_mapping + 2704ULL) >> 32); dmae->dst_addr_lo = (u32 )(((unsigned long )(loader_idx + 1) * 56UL + 1057792UL) >> 2); dmae->dst_addr_hi = 0U; dmae->len = 14U; if (bp->common.chip_id >> 16 == 5710U) { dmae->len = (u16 )((int )dmae->len - 1); } else { } dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx + 1] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; *stats_comp = 0U; bnx2x_post_dmae(bp, dmae, loader_idx); } else if (bp->func_stx != 0U) { *stats_comp = 0U; bnx2x_issue_dmae_with_comp(bp, dmae, stats_comp); } else { } return; } } static void bnx2x_stats_comp(struct bnx2x *bp ) { u32 *stats_comp ; int cnt ; { stats_comp = & (bp->slowpath)->stats_comp; cnt = 10; __might_sleep("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c", 200, 0); goto ldv_51599; ldv_51598: ; if (cnt == 0) { printk("\vbnx2x: [%s:%d(%s)]timeout waiting for stats finished\n", "bnx2x_stats_comp", 203, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); goto ldv_51597; } else { } cnt = cnt - 1; usleep_range(1000UL, 2000UL); ldv_51599: ; if (*stats_comp != 1624297646U) { goto ldv_51598; } else { } ldv_51597: ; return; } } static void bnx2x_stats_pmf_update(struct bnx2x *bp ) { struct dmae_command *dmae ; u32 opcode ; int loader_idx ; u32 *stats_comp ; int tmp ; int tmp___0 ; u16 tmp___1 ; { loader_idx = ((int )bp->pfid & 1) * 8 + 4; stats_comp = & (bp->slowpath)->stats_comp; if (bp->port.pmf == 0U || bp->port.port_stx == 0U) { printk("\vbnx2x: [%s:%d(%s)]BUG!\n", "bnx2x_stats_pmf_update", 225, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } bp->executer_idx = 0; opcode = bnx2x_dmae_opcode(bp, 1, 1, 0, 0); tmp = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp; dmae->opcode = bnx2x_dmae_opcode_add_comp(opcode, 1); dmae->src_addr_lo = bp->port.port_stx >> 2; dmae->src_addr_hi = 0U; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 3684U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 3684ULL) >> 32); dmae->len = 128U; dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; tmp___0 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___0; dmae->opcode = bnx2x_dmae_opcode_add_comp(opcode, 0); dmae->src_addr_lo = (bp->port.port_stx >> 2) + 128U; dmae->src_addr_hi = 0U; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 4196U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 4196ULL) >> 32); tmp___1 = bnx2x_get_port_stats_dma_len(bp); dmae->len = (unsigned int )tmp___1 + 65408U; dmae->comp_addr_lo = (unsigned int )bp->slowpath_mapping + 3152U; dmae->comp_addr_hi = (unsigned int )((bp->slowpath_mapping + 3152ULL) >> 32); dmae->comp_val = 1624297646U; *stats_comp = 0U; bnx2x_hw_stats_post(bp); bnx2x_stats_comp(bp); return; } } static void bnx2x_port_stats_init(struct bnx2x *bp ) { struct dmae_command *dmae ; int port ; u32 opcode ; int loader_idx ; u32 mac_addr ; u32 *stats_comp ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; u32 tx_src_addr_lo ; u32 rx_src_addr_lo ; u16 rx_len ; u16 tx_len ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; { port = (int )bp->pfid & 1; loader_idx = ((int )bp->pfid & 1) * 8 + 4; stats_comp = & (bp->slowpath)->stats_comp; if ((unsigned int )bp->link_vars.link_up == 0U || bp->port.pmf == 0U) { printk("\vbnx2x: [%s:%d(%s)]BUG!\n", "bnx2x_port_stats_init", 274, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } bp->executer_idx = 0; opcode = bnx2x_dmae_opcode(bp, 0, 2, 1, 1); if (bp->port.port_stx != 0U) { tmp = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp; dmae->opcode = opcode; dmae->src_addr_lo = (unsigned int )bp->slowpath_mapping + 3684U; dmae->src_addr_hi = (unsigned int )((bp->slowpath_mapping + 3684ULL) >> 32); dmae->dst_addr_lo = bp->port.port_stx >> 2; dmae->dst_addr_hi = 0U; dmae->len = bnx2x_get_port_stats_dma_len(bp); dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; } else { } if (bp->func_stx != 0U) { tmp___0 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___0; dmae->opcode = opcode; dmae->src_addr_lo = (unsigned int )bp->slowpath_mapping + 4332U; dmae->src_addr_hi = (unsigned int )((bp->slowpath_mapping + 4332ULL) >> 32); dmae->dst_addr_lo = bp->func_stx >> 2; dmae->dst_addr_hi = 0U; dmae->len = 20U; dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; } else { } opcode = bnx2x_dmae_opcode(bp, 1, 1, 1, 1); if ((unsigned int )bp->link_vars.mac_type == 1U) { mac_addr = port != 0 ? 33792U : 32768U; tmp___1 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___1; dmae->opcode = opcode; dmae->src_addr_lo = (mac_addr + 384U) >> 2; dmae->src_addr_hi = 0U; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 3156U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 3156ULL) >> 32); dmae->len = 23U; dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; tmp___2 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___2; dmae->opcode = opcode; dmae->src_addr_lo = (mac_addr + 500U) >> 2; dmae->src_addr_hi = 0U; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 3248U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 3248ULL) >> 32); dmae->len = 1U; dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; tmp___3 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___3; dmae->opcode = opcode; dmae->src_addr_lo = (mac_addr + 640U) >> 2; dmae->src_addr_hi = 0U; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 3252U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 3252ULL) >> 32); dmae->len = 22U; dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; } else { switch ((int )bp->link_vars.mac_type) { case 2: mac_addr = port != 0 ? 69632U : 68608U; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { tx_src_addr_lo = (mac_addr + 96U) >> 2; tx_len = 42U; rx_src_addr_lo = (mac_addr + 304U) >> 2; rx_len = 58U; } else { tx_src_addr_lo = (mac_addr + 272U) >> 2; tx_len = 48U; rx_src_addr_lo = (mac_addr + 512U) >> 2; rx_len = 64U; } goto ldv_51623; case 3: ; case 4: ; default: mac_addr = port != 0 ? 1452032U : 1449984U; tx_src_addr_lo = mac_addr >> 2; rx_src_addr_lo = (mac_addr + 512U) >> 2; tx_len = 54U; rx_len = 60U; goto ldv_51623; } ldv_51623: tmp___4 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___4; dmae->opcode = opcode; dmae->src_addr_lo = tx_src_addr_lo; dmae->src_addr_hi = 0U; dmae->len = tx_len; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 3156U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 3156ULL) >> 32); dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; tmp___5 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___5; dmae->opcode = opcode; dmae->src_addr_hi = 0U; dmae->src_addr_lo = rx_src_addr_lo; dmae->dst_addr_lo = ((unsigned int )bp->slowpath_mapping + (unsigned int )((int )tx_len << 2)) + 3156U; dmae->dst_addr_hi = (unsigned int )(((bp->slowpath_mapping + (unsigned long long )((int )tx_len << 2)) + 3156ULL) >> 32); dmae->len = rx_len; dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; } if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { tmp___6 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___6; dmae->opcode = opcode; dmae->src_addr_lo = port != 0 ? 16872U : 16852U; dmae->src_addr_hi = 0U; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 3668U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 3668ULL) >> 32); dmae->len = 2U; dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; tmp___7 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___7; dmae->opcode = opcode; dmae->src_addr_lo = port != 0 ? 16876U : 16856U; dmae->src_addr_hi = 0U; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 3676U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 3676ULL) >> 32); dmae->len = 2U; dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; } else { } tmp___8 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___8; dmae->opcode = bnx2x_dmae_opcode(bp, 1, 1, 1, 0); dmae->src_addr_lo = port != 0 ? 16778U : 16764U; dmae->src_addr_hi = 0U; dmae->dst_addr_lo = (unsigned int )bp->slowpath_mapping + 3612U; dmae->dst_addr_hi = (unsigned int )((bp->slowpath_mapping + 3612ULL) >> 32); dmae->len = 14U; dmae->comp_addr_lo = (unsigned int )bp->slowpath_mapping + 3152U; dmae->comp_addr_hi = (unsigned int )((bp->slowpath_mapping + 3152ULL) >> 32); dmae->comp_val = 1624297646U; *stats_comp = 0U; return; } } static void bnx2x_func_stats_init(struct bnx2x *bp ) { struct dmae_command *dmae ; u32 *stats_comp ; { dmae = & bp->stats_dmae; stats_comp = & (bp->slowpath)->stats_comp; if (bp->func_stx == 0U) { printk("\vbnx2x: [%s:%d(%s)]BUG!\n", "bnx2x_func_stats_init", 492, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } bp->executer_idx = 0; memset((void *)dmae, 0, 56UL); dmae->opcode = bnx2x_dmae_opcode(bp, 0, 2, 1, 0); dmae->src_addr_lo = (unsigned int )bp->slowpath_mapping + 4332U; dmae->src_addr_hi = (unsigned int )((bp->slowpath_mapping + 4332ULL) >> 32); dmae->dst_addr_lo = bp->func_stx >> 2; dmae->dst_addr_hi = 0U; dmae->len = 20U; dmae->comp_addr_lo = (unsigned int )bp->slowpath_mapping + 3152U; dmae->comp_addr_hi = (unsigned int )((bp->slowpath_mapping + 3152ULL) >> 32); dmae->comp_val = 1624297646U; *stats_comp = 0U; return; } } static void bnx2x_stats_start(struct bnx2x *bp ) { { if ((bp->flags & 4194304U) == 0U) { if (bp->port.pmf != 0U) { bnx2x_port_stats_init(bp); } else if (bp->func_stx != 0U) { bnx2x_func_stats_init(bp); } else { } bnx2x_hw_stats_post(bp); bnx2x_storm_stats_post(bp); } else { } return; } } static void bnx2x_stats_pmf_start(struct bnx2x *bp ) { { bnx2x_stats_comp(bp); bnx2x_stats_pmf_update(bp); bnx2x_stats_start(bp); return; } } static void bnx2x_stats_restart(struct bnx2x *bp ) { { if ((bp->flags & 4194304U) != 0U) { return; } else { } bnx2x_stats_comp(bp); bnx2x_stats_start(bp); return; } } static void bnx2x_bmac_stats_update(struct bnx2x *bp ) { struct host_port_stats *pstats ; struct bnx2x_eth_stats *estats ; struct __anonstruct_diff_363 diff ; struct bmac1_stats *new ; struct bmac2_stats *new___0 ; { pstats = & (bp->slowpath)->port_stats; estats = & bp->eth_stats; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { new = & (bp->slowpath)->mac_stats.bmac1_stats; if (new->rx_stat_grerb_lo < pstats->mac_stx[0].rx_stat_ifhcinbadoctets_lo) { diff.hi = new->rx_stat_grerb_hi - pstats->mac_stx[0].rx_stat_ifhcinbadoctets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grerb_lo + ~ pstats->mac_stx[0].rx_stat_ifhcinbadoctets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grerb_hi < pstats->mac_stx[0].rx_stat_ifhcinbadoctets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grerb_hi - pstats->mac_stx[0].rx_stat_ifhcinbadoctets_hi; diff.lo = new->rx_stat_grerb_lo - pstats->mac_stx[0].rx_stat_ifhcinbadoctets_lo; } pstats->mac_stx[0].rx_stat_ifhcinbadoctets_hi = new->rx_stat_grerb_hi; pstats->mac_stx[0].rx_stat_ifhcinbadoctets_lo = new->rx_stat_grerb_lo; pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo = pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo + diff.lo; pstats->mac_stx[1].rx_stat_ifhcinbadoctets_hi = pstats->mac_stx[1].rx_stat_ifhcinbadoctets_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo < diff.lo ? 1U : 0U)); if (new->rx_stat_grfcs_lo < pstats->mac_stx[0].rx_stat_dot3statsfcserrors_lo) { diff.hi = new->rx_stat_grfcs_hi - pstats->mac_stx[0].rx_stat_dot3statsfcserrors_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grfcs_lo + ~ pstats->mac_stx[0].rx_stat_dot3statsfcserrors_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grfcs_hi < pstats->mac_stx[0].rx_stat_dot3statsfcserrors_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grfcs_hi - pstats->mac_stx[0].rx_stat_dot3statsfcserrors_hi; diff.lo = new->rx_stat_grfcs_lo - pstats->mac_stx[0].rx_stat_dot3statsfcserrors_lo; } pstats->mac_stx[0].rx_stat_dot3statsfcserrors_hi = new->rx_stat_grfcs_hi; pstats->mac_stx[0].rx_stat_dot3statsfcserrors_lo = new->rx_stat_grfcs_lo; pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo = pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo + diff.lo; pstats->mac_stx[1].rx_stat_dot3statsfcserrors_hi = pstats->mac_stx[1].rx_stat_dot3statsfcserrors_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo < diff.lo ? 1U : 0U)); if (new->rx_stat_grund_lo < pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_lo) { diff.hi = new->rx_stat_grund_hi - pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grund_lo + ~ pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grund_hi < pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grund_hi - pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_hi; diff.lo = new->rx_stat_grund_lo - pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_lo; } pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_hi = new->rx_stat_grund_hi; pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_lo = new->rx_stat_grund_lo; pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo = pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo + diff.lo; pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_hi = pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo < diff.lo ? 1U : 0U)); if (new->rx_stat_grovr_lo < pstats->mac_stx[0].rx_stat_dot3statsframestoolong_lo) { diff.hi = new->rx_stat_grovr_hi - pstats->mac_stx[0].rx_stat_dot3statsframestoolong_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grovr_lo + ~ pstats->mac_stx[0].rx_stat_dot3statsframestoolong_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grovr_hi < pstats->mac_stx[0].rx_stat_dot3statsframestoolong_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grovr_hi - pstats->mac_stx[0].rx_stat_dot3statsframestoolong_hi; diff.lo = new->rx_stat_grovr_lo - pstats->mac_stx[0].rx_stat_dot3statsframestoolong_lo; } pstats->mac_stx[0].rx_stat_dot3statsframestoolong_hi = new->rx_stat_grovr_hi; pstats->mac_stx[0].rx_stat_dot3statsframestoolong_lo = new->rx_stat_grovr_lo; pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo = pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo + diff.lo; pstats->mac_stx[1].rx_stat_dot3statsframestoolong_hi = pstats->mac_stx[1].rx_stat_dot3statsframestoolong_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo < diff.lo ? 1U : 0U)); if (new->rx_stat_grfrg_lo < pstats->mac_stx[0].rx_stat_etherstatsfragments_lo) { diff.hi = new->rx_stat_grfrg_hi - pstats->mac_stx[0].rx_stat_etherstatsfragments_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grfrg_lo + ~ pstats->mac_stx[0].rx_stat_etherstatsfragments_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grfrg_hi < pstats->mac_stx[0].rx_stat_etherstatsfragments_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grfrg_hi - pstats->mac_stx[0].rx_stat_etherstatsfragments_hi; diff.lo = new->rx_stat_grfrg_lo - pstats->mac_stx[0].rx_stat_etherstatsfragments_lo; } pstats->mac_stx[0].rx_stat_etherstatsfragments_hi = new->rx_stat_grfrg_hi; pstats->mac_stx[0].rx_stat_etherstatsfragments_lo = new->rx_stat_grfrg_lo; pstats->mac_stx[1].rx_stat_etherstatsfragments_lo = pstats->mac_stx[1].rx_stat_etherstatsfragments_lo + diff.lo; pstats->mac_stx[1].rx_stat_etherstatsfragments_hi = pstats->mac_stx[1].rx_stat_etherstatsfragments_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_etherstatsfragments_lo < diff.lo ? 1U : 0U)); if (new->rx_stat_grjbr_lo < pstats->mac_stx[0].rx_stat_etherstatsjabbers_lo) { diff.hi = new->rx_stat_grjbr_hi - pstats->mac_stx[0].rx_stat_etherstatsjabbers_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grjbr_lo + ~ pstats->mac_stx[0].rx_stat_etherstatsjabbers_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grjbr_hi < pstats->mac_stx[0].rx_stat_etherstatsjabbers_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grjbr_hi - pstats->mac_stx[0].rx_stat_etherstatsjabbers_hi; diff.lo = new->rx_stat_grjbr_lo - pstats->mac_stx[0].rx_stat_etherstatsjabbers_lo; } pstats->mac_stx[0].rx_stat_etherstatsjabbers_hi = new->rx_stat_grjbr_hi; pstats->mac_stx[0].rx_stat_etherstatsjabbers_lo = new->rx_stat_grjbr_lo; pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo = pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo + diff.lo; pstats->mac_stx[1].rx_stat_etherstatsjabbers_hi = pstats->mac_stx[1].rx_stat_etherstatsjabbers_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo < diff.lo ? 1U : 0U)); if (new->rx_stat_grxcf_lo < pstats->mac_stx[0].rx_stat_maccontrolframesreceived_lo) { diff.hi = new->rx_stat_grxcf_hi - pstats->mac_stx[0].rx_stat_maccontrolframesreceived_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grxcf_lo + ~ pstats->mac_stx[0].rx_stat_maccontrolframesreceived_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grxcf_hi < pstats->mac_stx[0].rx_stat_maccontrolframesreceived_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grxcf_hi - pstats->mac_stx[0].rx_stat_maccontrolframesreceived_hi; diff.lo = new->rx_stat_grxcf_lo - pstats->mac_stx[0].rx_stat_maccontrolframesreceived_lo; } pstats->mac_stx[0].rx_stat_maccontrolframesreceived_hi = new->rx_stat_grxcf_hi; pstats->mac_stx[0].rx_stat_maccontrolframesreceived_lo = new->rx_stat_grxcf_lo; pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo = pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo + diff.lo; pstats->mac_stx[1].rx_stat_maccontrolframesreceived_hi = pstats->mac_stx[1].rx_stat_maccontrolframesreceived_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo < diff.lo ? 1U : 0U)); if (new->rx_stat_grxpf_lo < pstats->mac_stx[0].rx_stat_xoffstateentered_lo) { diff.hi = new->rx_stat_grxpf_hi - pstats->mac_stx[0].rx_stat_xoffstateentered_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grxpf_lo + ~ pstats->mac_stx[0].rx_stat_xoffstateentered_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grxpf_hi < pstats->mac_stx[0].rx_stat_xoffstateentered_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grxpf_hi - pstats->mac_stx[0].rx_stat_xoffstateentered_hi; diff.lo = new->rx_stat_grxpf_lo - pstats->mac_stx[0].rx_stat_xoffstateentered_lo; } pstats->mac_stx[0].rx_stat_xoffstateentered_hi = new->rx_stat_grxpf_hi; pstats->mac_stx[0].rx_stat_xoffstateentered_lo = new->rx_stat_grxpf_lo; pstats->mac_stx[1].rx_stat_xoffstateentered_lo = pstats->mac_stx[1].rx_stat_xoffstateentered_lo + diff.lo; pstats->mac_stx[1].rx_stat_xoffstateentered_hi = pstats->mac_stx[1].rx_stat_xoffstateentered_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_xoffstateentered_lo < diff.lo ? 1U : 0U)); if (new->rx_stat_grxpf_lo < pstats->mac_stx[0].rx_stat_mac_xpf_lo) { diff.hi = new->rx_stat_grxpf_hi - pstats->mac_stx[0].rx_stat_mac_xpf_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->rx_stat_grxpf_lo + ~ pstats->mac_stx[0].rx_stat_mac_xpf_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->rx_stat_grxpf_hi < pstats->mac_stx[0].rx_stat_mac_xpf_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->rx_stat_grxpf_hi - pstats->mac_stx[0].rx_stat_mac_xpf_hi; diff.lo = new->rx_stat_grxpf_lo - pstats->mac_stx[0].rx_stat_mac_xpf_lo; } pstats->mac_stx[0].rx_stat_mac_xpf_hi = new->rx_stat_grxpf_hi; pstats->mac_stx[0].rx_stat_mac_xpf_lo = new->rx_stat_grxpf_lo; pstats->mac_stx[1].rx_stat_mac_xpf_lo = pstats->mac_stx[1].rx_stat_mac_xpf_lo + diff.lo; pstats->mac_stx[1].rx_stat_mac_xpf_hi = pstats->mac_stx[1].rx_stat_mac_xpf_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_mac_xpf_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gtxpf_lo < pstats->mac_stx[0].tx_stat_outxoffsent_lo) { diff.hi = new->tx_stat_gtxpf_hi - pstats->mac_stx[0].tx_stat_outxoffsent_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gtxpf_lo + ~ pstats->mac_stx[0].tx_stat_outxoffsent_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gtxpf_hi < pstats->mac_stx[0].tx_stat_outxoffsent_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gtxpf_hi - pstats->mac_stx[0].tx_stat_outxoffsent_hi; diff.lo = new->tx_stat_gtxpf_lo - pstats->mac_stx[0].tx_stat_outxoffsent_lo; } pstats->mac_stx[0].tx_stat_outxoffsent_hi = new->tx_stat_gtxpf_hi; pstats->mac_stx[0].tx_stat_outxoffsent_lo = new->tx_stat_gtxpf_lo; pstats->mac_stx[1].tx_stat_outxoffsent_lo = pstats->mac_stx[1].tx_stat_outxoffsent_lo + diff.lo; pstats->mac_stx[1].tx_stat_outxoffsent_hi = pstats->mac_stx[1].tx_stat_outxoffsent_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_outxoffsent_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gtxpf_lo < pstats->mac_stx[0].tx_stat_flowcontroldone_lo) { diff.hi = new->tx_stat_gtxpf_hi - pstats->mac_stx[0].tx_stat_flowcontroldone_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gtxpf_lo + ~ pstats->mac_stx[0].tx_stat_flowcontroldone_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gtxpf_hi < pstats->mac_stx[0].tx_stat_flowcontroldone_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gtxpf_hi - pstats->mac_stx[0].tx_stat_flowcontroldone_hi; diff.lo = new->tx_stat_gtxpf_lo - pstats->mac_stx[0].tx_stat_flowcontroldone_lo; } pstats->mac_stx[0].tx_stat_flowcontroldone_hi = new->tx_stat_gtxpf_hi; pstats->mac_stx[0].tx_stat_flowcontroldone_lo = new->tx_stat_gtxpf_lo; pstats->mac_stx[1].tx_stat_flowcontroldone_lo = pstats->mac_stx[1].tx_stat_flowcontroldone_lo + diff.lo; pstats->mac_stx[1].tx_stat_flowcontroldone_hi = pstats->mac_stx[1].tx_stat_flowcontroldone_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_flowcontroldone_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt64_lo < pstats->mac_stx[0].tx_stat_etherstatspkts64octets_lo) { diff.hi = new->tx_stat_gt64_hi - pstats->mac_stx[0].tx_stat_etherstatspkts64octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt64_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts64octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt64_hi < pstats->mac_stx[0].tx_stat_etherstatspkts64octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt64_hi - pstats->mac_stx[0].tx_stat_etherstatspkts64octets_hi; diff.lo = new->tx_stat_gt64_lo - pstats->mac_stx[0].tx_stat_etherstatspkts64octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts64octets_hi = new->tx_stat_gt64_hi; pstats->mac_stx[0].tx_stat_etherstatspkts64octets_lo = new->tx_stat_gt64_lo; pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts64octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts64octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt127_lo < pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_lo) { diff.hi = new->tx_stat_gt127_hi - pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt127_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt127_hi < pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt127_hi - pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_hi; diff.lo = new->tx_stat_gt127_lo - pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_hi = new->tx_stat_gt127_hi; pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_lo = new->tx_stat_gt127_lo; pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt255_lo < pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_lo) { diff.hi = new->tx_stat_gt255_hi - pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt255_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt255_hi < pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt255_hi - pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_hi; diff.lo = new->tx_stat_gt255_lo - pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_hi = new->tx_stat_gt255_hi; pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_lo = new->tx_stat_gt255_lo; pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt511_lo < pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_lo) { diff.hi = new->tx_stat_gt511_hi - pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt511_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt511_hi < pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt511_hi - pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_hi; diff.lo = new->tx_stat_gt511_lo - pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_hi = new->tx_stat_gt511_hi; pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_lo = new->tx_stat_gt511_lo; pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt1023_lo < pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_lo) { diff.hi = new->tx_stat_gt1023_hi - pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt1023_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt1023_hi < pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt1023_hi - pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_hi; diff.lo = new->tx_stat_gt1023_lo - pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_hi = new->tx_stat_gt1023_hi; pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_lo = new->tx_stat_gt1023_lo; pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt1518_lo < pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_lo) { diff.hi = new->tx_stat_gt1518_hi - pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt1518_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt1518_hi < pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt1518_hi - pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_hi; diff.lo = new->tx_stat_gt1518_lo - pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_hi = new->tx_stat_gt1518_hi; pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_lo = new->tx_stat_gt1518_lo; pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt2047_lo < pstats->mac_stx[0].tx_stat_mac_2047_lo) { diff.hi = new->tx_stat_gt2047_hi - pstats->mac_stx[0].tx_stat_mac_2047_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt2047_lo + ~ pstats->mac_stx[0].tx_stat_mac_2047_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt2047_hi < pstats->mac_stx[0].tx_stat_mac_2047_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt2047_hi - pstats->mac_stx[0].tx_stat_mac_2047_hi; diff.lo = new->tx_stat_gt2047_lo - pstats->mac_stx[0].tx_stat_mac_2047_lo; } pstats->mac_stx[0].tx_stat_mac_2047_hi = new->tx_stat_gt2047_hi; pstats->mac_stx[0].tx_stat_mac_2047_lo = new->tx_stat_gt2047_lo; pstats->mac_stx[1].tx_stat_mac_2047_lo = pstats->mac_stx[1].tx_stat_mac_2047_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_2047_hi = pstats->mac_stx[1].tx_stat_mac_2047_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_2047_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt4095_lo < pstats->mac_stx[0].tx_stat_mac_4095_lo) { diff.hi = new->tx_stat_gt4095_hi - pstats->mac_stx[0].tx_stat_mac_4095_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt4095_lo + ~ pstats->mac_stx[0].tx_stat_mac_4095_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt4095_hi < pstats->mac_stx[0].tx_stat_mac_4095_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt4095_hi - pstats->mac_stx[0].tx_stat_mac_4095_hi; diff.lo = new->tx_stat_gt4095_lo - pstats->mac_stx[0].tx_stat_mac_4095_lo; } pstats->mac_stx[0].tx_stat_mac_4095_hi = new->tx_stat_gt4095_hi; pstats->mac_stx[0].tx_stat_mac_4095_lo = new->tx_stat_gt4095_lo; pstats->mac_stx[1].tx_stat_mac_4095_lo = pstats->mac_stx[1].tx_stat_mac_4095_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_4095_hi = pstats->mac_stx[1].tx_stat_mac_4095_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_4095_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt9216_lo < pstats->mac_stx[0].tx_stat_mac_9216_lo) { diff.hi = new->tx_stat_gt9216_hi - pstats->mac_stx[0].tx_stat_mac_9216_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt9216_lo + ~ pstats->mac_stx[0].tx_stat_mac_9216_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt9216_hi < pstats->mac_stx[0].tx_stat_mac_9216_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt9216_hi - pstats->mac_stx[0].tx_stat_mac_9216_hi; diff.lo = new->tx_stat_gt9216_lo - pstats->mac_stx[0].tx_stat_mac_9216_lo; } pstats->mac_stx[0].tx_stat_mac_9216_hi = new->tx_stat_gt9216_hi; pstats->mac_stx[0].tx_stat_mac_9216_lo = new->tx_stat_gt9216_lo; pstats->mac_stx[1].tx_stat_mac_9216_lo = pstats->mac_stx[1].tx_stat_mac_9216_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_9216_hi = pstats->mac_stx[1].tx_stat_mac_9216_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_9216_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gt16383_lo < pstats->mac_stx[0].tx_stat_mac_16383_lo) { diff.hi = new->tx_stat_gt16383_hi - pstats->mac_stx[0].tx_stat_mac_16383_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gt16383_lo + ~ pstats->mac_stx[0].tx_stat_mac_16383_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gt16383_hi < pstats->mac_stx[0].tx_stat_mac_16383_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gt16383_hi - pstats->mac_stx[0].tx_stat_mac_16383_hi; diff.lo = new->tx_stat_gt16383_lo - pstats->mac_stx[0].tx_stat_mac_16383_lo; } pstats->mac_stx[0].tx_stat_mac_16383_hi = new->tx_stat_gt16383_hi; pstats->mac_stx[0].tx_stat_mac_16383_lo = new->tx_stat_gt16383_lo; pstats->mac_stx[1].tx_stat_mac_16383_lo = pstats->mac_stx[1].tx_stat_mac_16383_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_16383_hi = pstats->mac_stx[1].tx_stat_mac_16383_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_16383_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gterr_lo < pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_lo) { diff.hi = new->tx_stat_gterr_hi - pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gterr_lo + ~ pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gterr_hi < pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gterr_hi - pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_hi; diff.lo = new->tx_stat_gterr_lo - pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_lo; } pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_hi = new->tx_stat_gterr_hi; pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_lo = new->tx_stat_gterr_lo; pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo = pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo + diff.lo; pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_hi = pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo < diff.lo ? 1U : 0U)); if (new->tx_stat_gtufl_lo < pstats->mac_stx[0].tx_stat_mac_ufl_lo) { diff.hi = new->tx_stat_gtufl_hi - pstats->mac_stx[0].tx_stat_mac_ufl_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->tx_stat_gtufl_lo + ~ pstats->mac_stx[0].tx_stat_mac_ufl_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->tx_stat_gtufl_hi < pstats->mac_stx[0].tx_stat_mac_ufl_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->tx_stat_gtufl_hi - pstats->mac_stx[0].tx_stat_mac_ufl_hi; diff.lo = new->tx_stat_gtufl_lo - pstats->mac_stx[0].tx_stat_mac_ufl_lo; } pstats->mac_stx[0].tx_stat_mac_ufl_hi = new->tx_stat_gtufl_hi; pstats->mac_stx[0].tx_stat_mac_ufl_lo = new->tx_stat_gtufl_lo; pstats->mac_stx[1].tx_stat_mac_ufl_lo = pstats->mac_stx[1].tx_stat_mac_ufl_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_ufl_hi = pstats->mac_stx[1].tx_stat_mac_ufl_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_ufl_lo < diff.lo ? 1U : 0U)); } else { new___0 = & (bp->slowpath)->mac_stats.bmac2_stats; if (new___0->rx_stat_grerb_lo < pstats->mac_stx[0].rx_stat_ifhcinbadoctets_lo) { diff.hi = new___0->rx_stat_grerb_hi - pstats->mac_stx[0].rx_stat_ifhcinbadoctets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grerb_lo + ~ pstats->mac_stx[0].rx_stat_ifhcinbadoctets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grerb_hi < pstats->mac_stx[0].rx_stat_ifhcinbadoctets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grerb_hi - pstats->mac_stx[0].rx_stat_ifhcinbadoctets_hi; diff.lo = new___0->rx_stat_grerb_lo - pstats->mac_stx[0].rx_stat_ifhcinbadoctets_lo; } pstats->mac_stx[0].rx_stat_ifhcinbadoctets_hi = new___0->rx_stat_grerb_hi; pstats->mac_stx[0].rx_stat_ifhcinbadoctets_lo = new___0->rx_stat_grerb_lo; pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo = pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo + diff.lo; pstats->mac_stx[1].rx_stat_ifhcinbadoctets_hi = pstats->mac_stx[1].rx_stat_ifhcinbadoctets_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo < diff.lo ? 1U : 0U)); if (new___0->rx_stat_grfcs_lo < pstats->mac_stx[0].rx_stat_dot3statsfcserrors_lo) { diff.hi = new___0->rx_stat_grfcs_hi - pstats->mac_stx[0].rx_stat_dot3statsfcserrors_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grfcs_lo + ~ pstats->mac_stx[0].rx_stat_dot3statsfcserrors_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grfcs_hi < pstats->mac_stx[0].rx_stat_dot3statsfcserrors_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grfcs_hi - pstats->mac_stx[0].rx_stat_dot3statsfcserrors_hi; diff.lo = new___0->rx_stat_grfcs_lo - pstats->mac_stx[0].rx_stat_dot3statsfcserrors_lo; } pstats->mac_stx[0].rx_stat_dot3statsfcserrors_hi = new___0->rx_stat_grfcs_hi; pstats->mac_stx[0].rx_stat_dot3statsfcserrors_lo = new___0->rx_stat_grfcs_lo; pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo = pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo + diff.lo; pstats->mac_stx[1].rx_stat_dot3statsfcserrors_hi = pstats->mac_stx[1].rx_stat_dot3statsfcserrors_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo < diff.lo ? 1U : 0U)); if (new___0->rx_stat_grund_lo < pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_lo) { diff.hi = new___0->rx_stat_grund_hi - pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grund_lo + ~ pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grund_hi < pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grund_hi - pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_hi; diff.lo = new___0->rx_stat_grund_lo - pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_lo; } pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_hi = new___0->rx_stat_grund_hi; pstats->mac_stx[0].rx_stat_etherstatsundersizepkts_lo = new___0->rx_stat_grund_lo; pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo = pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo + diff.lo; pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_hi = pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo < diff.lo ? 1U : 0U)); if (new___0->rx_stat_grovr_lo < pstats->mac_stx[0].rx_stat_dot3statsframestoolong_lo) { diff.hi = new___0->rx_stat_grovr_hi - pstats->mac_stx[0].rx_stat_dot3statsframestoolong_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grovr_lo + ~ pstats->mac_stx[0].rx_stat_dot3statsframestoolong_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grovr_hi < pstats->mac_stx[0].rx_stat_dot3statsframestoolong_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grovr_hi - pstats->mac_stx[0].rx_stat_dot3statsframestoolong_hi; diff.lo = new___0->rx_stat_grovr_lo - pstats->mac_stx[0].rx_stat_dot3statsframestoolong_lo; } pstats->mac_stx[0].rx_stat_dot3statsframestoolong_hi = new___0->rx_stat_grovr_hi; pstats->mac_stx[0].rx_stat_dot3statsframestoolong_lo = new___0->rx_stat_grovr_lo; pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo = pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo + diff.lo; pstats->mac_stx[1].rx_stat_dot3statsframestoolong_hi = pstats->mac_stx[1].rx_stat_dot3statsframestoolong_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo < diff.lo ? 1U : 0U)); if (new___0->rx_stat_grfrg_lo < pstats->mac_stx[0].rx_stat_etherstatsfragments_lo) { diff.hi = new___0->rx_stat_grfrg_hi - pstats->mac_stx[0].rx_stat_etherstatsfragments_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grfrg_lo + ~ pstats->mac_stx[0].rx_stat_etherstatsfragments_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grfrg_hi < pstats->mac_stx[0].rx_stat_etherstatsfragments_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grfrg_hi - pstats->mac_stx[0].rx_stat_etherstatsfragments_hi; diff.lo = new___0->rx_stat_grfrg_lo - pstats->mac_stx[0].rx_stat_etherstatsfragments_lo; } pstats->mac_stx[0].rx_stat_etherstatsfragments_hi = new___0->rx_stat_grfrg_hi; pstats->mac_stx[0].rx_stat_etherstatsfragments_lo = new___0->rx_stat_grfrg_lo; pstats->mac_stx[1].rx_stat_etherstatsfragments_lo = pstats->mac_stx[1].rx_stat_etherstatsfragments_lo + diff.lo; pstats->mac_stx[1].rx_stat_etherstatsfragments_hi = pstats->mac_stx[1].rx_stat_etherstatsfragments_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_etherstatsfragments_lo < diff.lo ? 1U : 0U)); if (new___0->rx_stat_grjbr_lo < pstats->mac_stx[0].rx_stat_etherstatsjabbers_lo) { diff.hi = new___0->rx_stat_grjbr_hi - pstats->mac_stx[0].rx_stat_etherstatsjabbers_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grjbr_lo + ~ pstats->mac_stx[0].rx_stat_etherstatsjabbers_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grjbr_hi < pstats->mac_stx[0].rx_stat_etherstatsjabbers_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grjbr_hi - pstats->mac_stx[0].rx_stat_etherstatsjabbers_hi; diff.lo = new___0->rx_stat_grjbr_lo - pstats->mac_stx[0].rx_stat_etherstatsjabbers_lo; } pstats->mac_stx[0].rx_stat_etherstatsjabbers_hi = new___0->rx_stat_grjbr_hi; pstats->mac_stx[0].rx_stat_etherstatsjabbers_lo = new___0->rx_stat_grjbr_lo; pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo = pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo + diff.lo; pstats->mac_stx[1].rx_stat_etherstatsjabbers_hi = pstats->mac_stx[1].rx_stat_etherstatsjabbers_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo < diff.lo ? 1U : 0U)); if (new___0->rx_stat_grxcf_lo < pstats->mac_stx[0].rx_stat_maccontrolframesreceived_lo) { diff.hi = new___0->rx_stat_grxcf_hi - pstats->mac_stx[0].rx_stat_maccontrolframesreceived_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grxcf_lo + ~ pstats->mac_stx[0].rx_stat_maccontrolframesreceived_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grxcf_hi < pstats->mac_stx[0].rx_stat_maccontrolframesreceived_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grxcf_hi - pstats->mac_stx[0].rx_stat_maccontrolframesreceived_hi; diff.lo = new___0->rx_stat_grxcf_lo - pstats->mac_stx[0].rx_stat_maccontrolframesreceived_lo; } pstats->mac_stx[0].rx_stat_maccontrolframesreceived_hi = new___0->rx_stat_grxcf_hi; pstats->mac_stx[0].rx_stat_maccontrolframesreceived_lo = new___0->rx_stat_grxcf_lo; pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo = pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo + diff.lo; pstats->mac_stx[1].rx_stat_maccontrolframesreceived_hi = pstats->mac_stx[1].rx_stat_maccontrolframesreceived_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo < diff.lo ? 1U : 0U)); if (new___0->rx_stat_grxpf_lo < pstats->mac_stx[0].rx_stat_xoffstateentered_lo) { diff.hi = new___0->rx_stat_grxpf_hi - pstats->mac_stx[0].rx_stat_xoffstateentered_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grxpf_lo + ~ pstats->mac_stx[0].rx_stat_xoffstateentered_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grxpf_hi < pstats->mac_stx[0].rx_stat_xoffstateentered_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grxpf_hi - pstats->mac_stx[0].rx_stat_xoffstateentered_hi; diff.lo = new___0->rx_stat_grxpf_lo - pstats->mac_stx[0].rx_stat_xoffstateentered_lo; } pstats->mac_stx[0].rx_stat_xoffstateentered_hi = new___0->rx_stat_grxpf_hi; pstats->mac_stx[0].rx_stat_xoffstateentered_lo = new___0->rx_stat_grxpf_lo; pstats->mac_stx[1].rx_stat_xoffstateentered_lo = pstats->mac_stx[1].rx_stat_xoffstateentered_lo + diff.lo; pstats->mac_stx[1].rx_stat_xoffstateentered_hi = pstats->mac_stx[1].rx_stat_xoffstateentered_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_xoffstateentered_lo < diff.lo ? 1U : 0U)); if (new___0->rx_stat_grxpf_lo < pstats->mac_stx[0].rx_stat_mac_xpf_lo) { diff.hi = new___0->rx_stat_grxpf_hi - pstats->mac_stx[0].rx_stat_mac_xpf_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->rx_stat_grxpf_lo + ~ pstats->mac_stx[0].rx_stat_mac_xpf_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->rx_stat_grxpf_hi < pstats->mac_stx[0].rx_stat_mac_xpf_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->rx_stat_grxpf_hi - pstats->mac_stx[0].rx_stat_mac_xpf_hi; diff.lo = new___0->rx_stat_grxpf_lo - pstats->mac_stx[0].rx_stat_mac_xpf_lo; } pstats->mac_stx[0].rx_stat_mac_xpf_hi = new___0->rx_stat_grxpf_hi; pstats->mac_stx[0].rx_stat_mac_xpf_lo = new___0->rx_stat_grxpf_lo; pstats->mac_stx[1].rx_stat_mac_xpf_lo = pstats->mac_stx[1].rx_stat_mac_xpf_lo + diff.lo; pstats->mac_stx[1].rx_stat_mac_xpf_hi = pstats->mac_stx[1].rx_stat_mac_xpf_hi + (diff.hi + (pstats->mac_stx[1].rx_stat_mac_xpf_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gtxpf_lo < pstats->mac_stx[0].tx_stat_outxoffsent_lo) { diff.hi = new___0->tx_stat_gtxpf_hi - pstats->mac_stx[0].tx_stat_outxoffsent_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gtxpf_lo + ~ pstats->mac_stx[0].tx_stat_outxoffsent_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gtxpf_hi < pstats->mac_stx[0].tx_stat_outxoffsent_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gtxpf_hi - pstats->mac_stx[0].tx_stat_outxoffsent_hi; diff.lo = new___0->tx_stat_gtxpf_lo - pstats->mac_stx[0].tx_stat_outxoffsent_lo; } pstats->mac_stx[0].tx_stat_outxoffsent_hi = new___0->tx_stat_gtxpf_hi; pstats->mac_stx[0].tx_stat_outxoffsent_lo = new___0->tx_stat_gtxpf_lo; pstats->mac_stx[1].tx_stat_outxoffsent_lo = pstats->mac_stx[1].tx_stat_outxoffsent_lo + diff.lo; pstats->mac_stx[1].tx_stat_outxoffsent_hi = pstats->mac_stx[1].tx_stat_outxoffsent_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_outxoffsent_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gtxpf_lo < pstats->mac_stx[0].tx_stat_flowcontroldone_lo) { diff.hi = new___0->tx_stat_gtxpf_hi - pstats->mac_stx[0].tx_stat_flowcontroldone_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gtxpf_lo + ~ pstats->mac_stx[0].tx_stat_flowcontroldone_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gtxpf_hi < pstats->mac_stx[0].tx_stat_flowcontroldone_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gtxpf_hi - pstats->mac_stx[0].tx_stat_flowcontroldone_hi; diff.lo = new___0->tx_stat_gtxpf_lo - pstats->mac_stx[0].tx_stat_flowcontroldone_lo; } pstats->mac_stx[0].tx_stat_flowcontroldone_hi = new___0->tx_stat_gtxpf_hi; pstats->mac_stx[0].tx_stat_flowcontroldone_lo = new___0->tx_stat_gtxpf_lo; pstats->mac_stx[1].tx_stat_flowcontroldone_lo = pstats->mac_stx[1].tx_stat_flowcontroldone_lo + diff.lo; pstats->mac_stx[1].tx_stat_flowcontroldone_hi = pstats->mac_stx[1].tx_stat_flowcontroldone_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_flowcontroldone_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt64_lo < pstats->mac_stx[0].tx_stat_etherstatspkts64octets_lo) { diff.hi = new___0->tx_stat_gt64_hi - pstats->mac_stx[0].tx_stat_etherstatspkts64octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt64_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts64octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt64_hi < pstats->mac_stx[0].tx_stat_etherstatspkts64octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt64_hi - pstats->mac_stx[0].tx_stat_etherstatspkts64octets_hi; diff.lo = new___0->tx_stat_gt64_lo - pstats->mac_stx[0].tx_stat_etherstatspkts64octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts64octets_hi = new___0->tx_stat_gt64_hi; pstats->mac_stx[0].tx_stat_etherstatspkts64octets_lo = new___0->tx_stat_gt64_lo; pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts64octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts64octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt127_lo < pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_lo) { diff.hi = new___0->tx_stat_gt127_hi - pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt127_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt127_hi < pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt127_hi - pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_hi; diff.lo = new___0->tx_stat_gt127_lo - pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_hi = new___0->tx_stat_gt127_hi; pstats->mac_stx[0].tx_stat_etherstatspkts65octetsto127octets_lo = new___0->tx_stat_gt127_lo; pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt255_lo < pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_lo) { diff.hi = new___0->tx_stat_gt255_hi - pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt255_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt255_hi < pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt255_hi - pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_hi; diff.lo = new___0->tx_stat_gt255_lo - pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_hi = new___0->tx_stat_gt255_hi; pstats->mac_stx[0].tx_stat_etherstatspkts128octetsto255octets_lo = new___0->tx_stat_gt255_lo; pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt511_lo < pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_lo) { diff.hi = new___0->tx_stat_gt511_hi - pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt511_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt511_hi < pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt511_hi - pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_hi; diff.lo = new___0->tx_stat_gt511_lo - pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_hi = new___0->tx_stat_gt511_hi; pstats->mac_stx[0].tx_stat_etherstatspkts256octetsto511octets_lo = new___0->tx_stat_gt511_lo; pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt1023_lo < pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_lo) { diff.hi = new___0->tx_stat_gt1023_hi - pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt1023_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt1023_hi < pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt1023_hi - pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_hi; diff.lo = new___0->tx_stat_gt1023_lo - pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_hi = new___0->tx_stat_gt1023_hi; pstats->mac_stx[0].tx_stat_etherstatspkts512octetsto1023octets_lo = new___0->tx_stat_gt1023_lo; pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt1518_lo < pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_lo) { diff.hi = new___0->tx_stat_gt1518_hi - pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt1518_lo + ~ pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt1518_hi < pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt1518_hi - pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_hi; diff.lo = new___0->tx_stat_gt1518_lo - pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_lo; } pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_hi = new___0->tx_stat_gt1518_hi; pstats->mac_stx[0].tx_stat_etherstatspkts1024octetsto1522octets_lo = new___0->tx_stat_gt1518_lo; pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo + diff.lo; pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt2047_lo < pstats->mac_stx[0].tx_stat_mac_2047_lo) { diff.hi = new___0->tx_stat_gt2047_hi - pstats->mac_stx[0].tx_stat_mac_2047_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt2047_lo + ~ pstats->mac_stx[0].tx_stat_mac_2047_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt2047_hi < pstats->mac_stx[0].tx_stat_mac_2047_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt2047_hi - pstats->mac_stx[0].tx_stat_mac_2047_hi; diff.lo = new___0->tx_stat_gt2047_lo - pstats->mac_stx[0].tx_stat_mac_2047_lo; } pstats->mac_stx[0].tx_stat_mac_2047_hi = new___0->tx_stat_gt2047_hi; pstats->mac_stx[0].tx_stat_mac_2047_lo = new___0->tx_stat_gt2047_lo; pstats->mac_stx[1].tx_stat_mac_2047_lo = pstats->mac_stx[1].tx_stat_mac_2047_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_2047_hi = pstats->mac_stx[1].tx_stat_mac_2047_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_2047_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt4095_lo < pstats->mac_stx[0].tx_stat_mac_4095_lo) { diff.hi = new___0->tx_stat_gt4095_hi - pstats->mac_stx[0].tx_stat_mac_4095_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt4095_lo + ~ pstats->mac_stx[0].tx_stat_mac_4095_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt4095_hi < pstats->mac_stx[0].tx_stat_mac_4095_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt4095_hi - pstats->mac_stx[0].tx_stat_mac_4095_hi; diff.lo = new___0->tx_stat_gt4095_lo - pstats->mac_stx[0].tx_stat_mac_4095_lo; } pstats->mac_stx[0].tx_stat_mac_4095_hi = new___0->tx_stat_gt4095_hi; pstats->mac_stx[0].tx_stat_mac_4095_lo = new___0->tx_stat_gt4095_lo; pstats->mac_stx[1].tx_stat_mac_4095_lo = pstats->mac_stx[1].tx_stat_mac_4095_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_4095_hi = pstats->mac_stx[1].tx_stat_mac_4095_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_4095_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt9216_lo < pstats->mac_stx[0].tx_stat_mac_9216_lo) { diff.hi = new___0->tx_stat_gt9216_hi - pstats->mac_stx[0].tx_stat_mac_9216_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt9216_lo + ~ pstats->mac_stx[0].tx_stat_mac_9216_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt9216_hi < pstats->mac_stx[0].tx_stat_mac_9216_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt9216_hi - pstats->mac_stx[0].tx_stat_mac_9216_hi; diff.lo = new___0->tx_stat_gt9216_lo - pstats->mac_stx[0].tx_stat_mac_9216_lo; } pstats->mac_stx[0].tx_stat_mac_9216_hi = new___0->tx_stat_gt9216_hi; pstats->mac_stx[0].tx_stat_mac_9216_lo = new___0->tx_stat_gt9216_lo; pstats->mac_stx[1].tx_stat_mac_9216_lo = pstats->mac_stx[1].tx_stat_mac_9216_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_9216_hi = pstats->mac_stx[1].tx_stat_mac_9216_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_9216_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gt16383_lo < pstats->mac_stx[0].tx_stat_mac_16383_lo) { diff.hi = new___0->tx_stat_gt16383_hi - pstats->mac_stx[0].tx_stat_mac_16383_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gt16383_lo + ~ pstats->mac_stx[0].tx_stat_mac_16383_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gt16383_hi < pstats->mac_stx[0].tx_stat_mac_16383_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gt16383_hi - pstats->mac_stx[0].tx_stat_mac_16383_hi; diff.lo = new___0->tx_stat_gt16383_lo - pstats->mac_stx[0].tx_stat_mac_16383_lo; } pstats->mac_stx[0].tx_stat_mac_16383_hi = new___0->tx_stat_gt16383_hi; pstats->mac_stx[0].tx_stat_mac_16383_lo = new___0->tx_stat_gt16383_lo; pstats->mac_stx[1].tx_stat_mac_16383_lo = pstats->mac_stx[1].tx_stat_mac_16383_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_16383_hi = pstats->mac_stx[1].tx_stat_mac_16383_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_16383_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gterr_lo < pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_lo) { diff.hi = new___0->tx_stat_gterr_hi - pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gterr_lo + ~ pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gterr_hi < pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gterr_hi - pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_hi; diff.lo = new___0->tx_stat_gterr_lo - pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_lo; } pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_hi = new___0->tx_stat_gterr_hi; pstats->mac_stx[0].tx_stat_dot3statsinternalmactransmiterrors_lo = new___0->tx_stat_gterr_lo; pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo = pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo + diff.lo; pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_hi = pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo < diff.lo ? 1U : 0U)); if (new___0->tx_stat_gtufl_lo < pstats->mac_stx[0].tx_stat_mac_ufl_lo) { diff.hi = new___0->tx_stat_gtufl_hi - pstats->mac_stx[0].tx_stat_mac_ufl_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new___0->tx_stat_gtufl_lo + ~ pstats->mac_stx[0].tx_stat_mac_ufl_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new___0->tx_stat_gtufl_hi < pstats->mac_stx[0].tx_stat_mac_ufl_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new___0->tx_stat_gtufl_hi - pstats->mac_stx[0].tx_stat_mac_ufl_hi; diff.lo = new___0->tx_stat_gtufl_lo - pstats->mac_stx[0].tx_stat_mac_ufl_lo; } pstats->mac_stx[0].tx_stat_mac_ufl_hi = new___0->tx_stat_gtufl_hi; pstats->mac_stx[0].tx_stat_mac_ufl_lo = new___0->tx_stat_gtufl_lo; pstats->mac_stx[1].tx_stat_mac_ufl_lo = pstats->mac_stx[1].tx_stat_mac_ufl_lo + diff.lo; pstats->mac_stx[1].tx_stat_mac_ufl_hi = pstats->mac_stx[1].tx_stat_mac_ufl_hi + (diff.hi + (pstats->mac_stx[1].tx_stat_mac_ufl_lo < diff.lo ? 1U : 0U)); pstats->pfc_frames_tx_hi = new___0->tx_stat_gtpp_hi; pstats->pfc_frames_tx_lo = new___0->tx_stat_gtpp_lo; pstats->pfc_frames_rx_hi = new___0->rx_stat_grpp_hi; pstats->pfc_frames_rx_lo = new___0->rx_stat_grpp_lo; } estats->pause_frames_received_hi = pstats->mac_stx[1].rx_stat_mac_xpf_hi; estats->pause_frames_received_lo = pstats->mac_stx[1].rx_stat_mac_xpf_lo; estats->pause_frames_sent_hi = pstats->mac_stx[1].tx_stat_outxoffsent_hi; estats->pause_frames_sent_lo = pstats->mac_stx[1].tx_stat_outxoffsent_lo; estats->pfc_frames_received_hi = pstats->pfc_frames_rx_hi; estats->pfc_frames_received_lo = pstats->pfc_frames_rx_lo; estats->pfc_frames_sent_hi = pstats->pfc_frames_tx_hi; estats->pfc_frames_sent_lo = pstats->pfc_frames_tx_lo; return; } } static void bnx2x_mstat_stats_update(struct bnx2x *bp ) { struct host_port_stats *pstats ; struct bnx2x_eth_stats *estats ; struct mstat_stats *new ; { pstats = & (bp->slowpath)->port_stats; estats = & bp->eth_stats; new = & (bp->slowpath)->mac_stats.mstat_stats; pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo = pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo + new->stats_rx.rx_grerb_lo; pstats->mac_stx[1].rx_stat_ifhcinbadoctets_hi = pstats->mac_stx[1].rx_stat_ifhcinbadoctets_hi + (new->stats_rx.rx_grerb_hi + (pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo < new->stats_rx.rx_grerb_lo ? 1U : 0U)); pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo = pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo + new->stats_rx.rx_grfcs_lo; pstats->mac_stx[1].rx_stat_dot3statsfcserrors_hi = pstats->mac_stx[1].rx_stat_dot3statsfcserrors_hi + (new->stats_rx.rx_grfcs_hi + (pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo < new->stats_rx.rx_grfcs_lo ? 1U : 0U)); pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo = pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo + new->stats_rx.rx_grund_lo; pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_hi = pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_hi + (new->stats_rx.rx_grund_hi + (pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo < new->stats_rx.rx_grund_lo ? 1U : 0U)); pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo = pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo + new->stats_rx.rx_grovr_lo; pstats->mac_stx[1].rx_stat_dot3statsframestoolong_hi = pstats->mac_stx[1].rx_stat_dot3statsframestoolong_hi + (new->stats_rx.rx_grovr_hi + (pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo < new->stats_rx.rx_grovr_lo ? 1U : 0U)); pstats->mac_stx[1].rx_stat_etherstatsfragments_lo = pstats->mac_stx[1].rx_stat_etherstatsfragments_lo + new->stats_rx.rx_grfrg_lo; pstats->mac_stx[1].rx_stat_etherstatsfragments_hi = pstats->mac_stx[1].rx_stat_etherstatsfragments_hi + (new->stats_rx.rx_grfrg_hi + (pstats->mac_stx[1].rx_stat_etherstatsfragments_lo < new->stats_rx.rx_grfrg_lo ? 1U : 0U)); pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo = pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo + new->stats_rx.rx_grxcf_lo; pstats->mac_stx[1].rx_stat_maccontrolframesreceived_hi = pstats->mac_stx[1].rx_stat_maccontrolframesreceived_hi + (new->stats_rx.rx_grxcf_hi + (pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo < new->stats_rx.rx_grxcf_lo ? 1U : 0U)); pstats->mac_stx[1].rx_stat_xoffstateentered_lo = pstats->mac_stx[1].rx_stat_xoffstateentered_lo + new->stats_rx.rx_grxpf_lo; pstats->mac_stx[1].rx_stat_xoffstateentered_hi = pstats->mac_stx[1].rx_stat_xoffstateentered_hi + (new->stats_rx.rx_grxpf_hi + (pstats->mac_stx[1].rx_stat_xoffstateentered_lo < new->stats_rx.rx_grxpf_lo ? 1U : 0U)); pstats->mac_stx[1].rx_stat_mac_xpf_lo = pstats->mac_stx[1].rx_stat_mac_xpf_lo + new->stats_rx.rx_grxpf_lo; pstats->mac_stx[1].rx_stat_mac_xpf_hi = pstats->mac_stx[1].rx_stat_mac_xpf_hi + (new->stats_rx.rx_grxpf_hi + (pstats->mac_stx[1].rx_stat_mac_xpf_lo < new->stats_rx.rx_grxpf_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_outxoffsent_lo = pstats->mac_stx[1].tx_stat_outxoffsent_lo + new->stats_tx.tx_gtxpf_lo; pstats->mac_stx[1].tx_stat_outxoffsent_hi = pstats->mac_stx[1].tx_stat_outxoffsent_hi + (new->stats_tx.tx_gtxpf_hi + (pstats->mac_stx[1].tx_stat_outxoffsent_lo < new->stats_tx.tx_gtxpf_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_flowcontroldone_lo = pstats->mac_stx[1].tx_stat_flowcontroldone_lo + new->stats_tx.tx_gtxpf_lo; pstats->mac_stx[1].tx_stat_flowcontroldone_hi = pstats->mac_stx[1].tx_stat_flowcontroldone_hi + (new->stats_tx.tx_gtxpf_hi + (pstats->mac_stx[1].tx_stat_flowcontroldone_lo < new->stats_tx.tx_gtxpf_lo ? 1U : 0U)); pstats->pfc_frames_tx_lo = pstats->pfc_frames_tx_lo + new->stats_tx.tx_gtxpp_lo; pstats->pfc_frames_tx_hi = pstats->pfc_frames_tx_hi + (new->stats_tx.tx_gtxpp_hi + (pstats->pfc_frames_tx_lo < new->stats_tx.tx_gtxpp_lo ? 1U : 0U)); pstats->pfc_frames_rx_lo = pstats->pfc_frames_rx_lo + new->stats_rx.rx_grxpp_lo; pstats->pfc_frames_rx_hi = pstats->pfc_frames_rx_hi + (new->stats_rx.rx_grxpp_hi + (pstats->pfc_frames_rx_lo < new->stats_rx.rx_grxpp_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo + new->stats_tx.tx_gt64_lo; pstats->mac_stx[1].tx_stat_etherstatspkts64octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts64octets_hi + (new->stats_tx.tx_gt64_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo < new->stats_tx.tx_gt64_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo + new->stats_tx.tx_gt127_lo; pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_hi + (new->stats_tx.tx_gt127_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo < new->stats_tx.tx_gt127_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo + new->stats_tx.tx_gt255_lo; pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_hi + (new->stats_tx.tx_gt255_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo < new->stats_tx.tx_gt255_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo + new->stats_tx.tx_gt511_lo; pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_hi + (new->stats_tx.tx_gt511_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo < new->stats_tx.tx_gt511_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo + new->stats_tx.tx_gt1023_lo; pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_hi + (new->stats_tx.tx_gt1023_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo < new->stats_tx.tx_gt1023_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo + new->stats_tx.tx_gt1518_lo; pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi + (new->stats_tx.tx_gt1518_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo < new->stats_tx.tx_gt1518_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_mac_2047_lo = pstats->mac_stx[1].tx_stat_mac_2047_lo + new->stats_tx.tx_gt2047_lo; pstats->mac_stx[1].tx_stat_mac_2047_hi = pstats->mac_stx[1].tx_stat_mac_2047_hi + (new->stats_tx.tx_gt2047_hi + (pstats->mac_stx[1].tx_stat_mac_2047_lo < new->stats_tx.tx_gt2047_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_mac_4095_lo = pstats->mac_stx[1].tx_stat_mac_4095_lo + new->stats_tx.tx_gt4095_lo; pstats->mac_stx[1].tx_stat_mac_4095_hi = pstats->mac_stx[1].tx_stat_mac_4095_hi + (new->stats_tx.tx_gt4095_hi + (pstats->mac_stx[1].tx_stat_mac_4095_lo < new->stats_tx.tx_gt4095_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_mac_9216_lo = pstats->mac_stx[1].tx_stat_mac_9216_lo + new->stats_tx.tx_gt9216_lo; pstats->mac_stx[1].tx_stat_mac_9216_hi = pstats->mac_stx[1].tx_stat_mac_9216_hi + (new->stats_tx.tx_gt9216_hi + (pstats->mac_stx[1].tx_stat_mac_9216_lo < new->stats_tx.tx_gt9216_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_mac_16383_lo = pstats->mac_stx[1].tx_stat_mac_16383_lo + new->stats_tx.tx_gt16383_lo; pstats->mac_stx[1].tx_stat_mac_16383_hi = pstats->mac_stx[1].tx_stat_mac_16383_hi + (new->stats_tx.tx_gt16383_hi + (pstats->mac_stx[1].tx_stat_mac_16383_lo < new->stats_tx.tx_gt16383_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo = pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo + new->stats_tx.tx_gterr_lo; pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_hi = pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_hi + (new->stats_tx.tx_gterr_hi + (pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo < new->stats_tx.tx_gterr_lo ? 1U : 0U)); pstats->mac_stx[1].tx_stat_mac_ufl_lo = pstats->mac_stx[1].tx_stat_mac_ufl_lo + new->stats_tx.tx_gtufl_lo; pstats->mac_stx[1].tx_stat_mac_ufl_hi = pstats->mac_stx[1].tx_stat_mac_ufl_hi + (new->stats_tx.tx_gtufl_hi + (pstats->mac_stx[1].tx_stat_mac_ufl_lo < new->stats_tx.tx_gtufl_lo ? 1U : 0U)); estats->etherstatspkts1024octetsto1522octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi; estats->etherstatspkts1024octetsto1522octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo; estats->etherstatspktsover1522octets_hi = pstats->mac_stx[1].tx_stat_mac_2047_hi; estats->etherstatspktsover1522octets_lo = pstats->mac_stx[1].tx_stat_mac_2047_lo; estats->etherstatspktsover1522octets_lo = estats->etherstatspktsover1522octets_lo + pstats->mac_stx[1].tx_stat_mac_4095_lo; estats->etherstatspktsover1522octets_hi = estats->etherstatspktsover1522octets_hi + (pstats->mac_stx[1].tx_stat_mac_4095_hi + (estats->etherstatspktsover1522octets_lo < pstats->mac_stx[1].tx_stat_mac_4095_lo ? 1U : 0U)); estats->etherstatspktsover1522octets_lo = estats->etherstatspktsover1522octets_lo + pstats->mac_stx[1].tx_stat_mac_9216_lo; estats->etherstatspktsover1522octets_hi = estats->etherstatspktsover1522octets_hi + (pstats->mac_stx[1].tx_stat_mac_9216_hi + (estats->etherstatspktsover1522octets_lo < pstats->mac_stx[1].tx_stat_mac_9216_lo ? 1U : 0U)); estats->etherstatspktsover1522octets_lo = estats->etherstatspktsover1522octets_lo + pstats->mac_stx[1].tx_stat_mac_16383_lo; estats->etherstatspktsover1522octets_hi = estats->etherstatspktsover1522octets_hi + (pstats->mac_stx[1].tx_stat_mac_16383_hi + (estats->etherstatspktsover1522octets_lo < pstats->mac_stx[1].tx_stat_mac_16383_lo ? 1U : 0U)); estats->pause_frames_received_hi = pstats->mac_stx[1].rx_stat_mac_xpf_hi; estats->pause_frames_received_lo = pstats->mac_stx[1].rx_stat_mac_xpf_lo; estats->pause_frames_sent_hi = pstats->mac_stx[1].tx_stat_outxoffsent_hi; estats->pause_frames_sent_lo = pstats->mac_stx[1].tx_stat_outxoffsent_lo; estats->pfc_frames_received_hi = pstats->pfc_frames_rx_hi; estats->pfc_frames_received_lo = pstats->pfc_frames_rx_lo; estats->pfc_frames_sent_hi = pstats->pfc_frames_tx_hi; estats->pfc_frames_sent_lo = pstats->pfc_frames_tx_lo; return; } } static void bnx2x_emac_stats_update(struct bnx2x *bp ) { struct emac_stats *new ; struct host_port_stats *pstats ; struct bnx2x_eth_stats *estats ; { new = & (bp->slowpath)->mac_stats.emac_stats; pstats = & (bp->slowpath)->port_stats; estats = & bp->eth_stats; pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo = pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo + new->rx_stat_ifhcinbadoctets; pstats->mac_stx[1].rx_stat_ifhcinbadoctets_hi = pstats->mac_stx[1].rx_stat_ifhcinbadoctets_hi + (pstats->mac_stx[1].rx_stat_ifhcinbadoctets_lo < new->rx_stat_ifhcinbadoctets ? 1U : 0U); pstats->mac_stx[1].tx_stat_ifhcoutbadoctets_lo = pstats->mac_stx[1].tx_stat_ifhcoutbadoctets_lo + new->tx_stat_ifhcoutbadoctets; pstats->mac_stx[1].tx_stat_ifhcoutbadoctets_hi = pstats->mac_stx[1].tx_stat_ifhcoutbadoctets_hi + (pstats->mac_stx[1].tx_stat_ifhcoutbadoctets_lo < new->tx_stat_ifhcoutbadoctets ? 1U : 0U); pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo = pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo + new->rx_stat_dot3statsfcserrors; pstats->mac_stx[1].rx_stat_dot3statsfcserrors_hi = pstats->mac_stx[1].rx_stat_dot3statsfcserrors_hi + (pstats->mac_stx[1].rx_stat_dot3statsfcserrors_lo < new->rx_stat_dot3statsfcserrors ? 1U : 0U); pstats->mac_stx[1].rx_stat_dot3statsalignmenterrors_lo = pstats->mac_stx[1].rx_stat_dot3statsalignmenterrors_lo + new->rx_stat_dot3statsalignmenterrors; pstats->mac_stx[1].rx_stat_dot3statsalignmenterrors_hi = pstats->mac_stx[1].rx_stat_dot3statsalignmenterrors_hi + (pstats->mac_stx[1].rx_stat_dot3statsalignmenterrors_lo < new->rx_stat_dot3statsalignmenterrors ? 1U : 0U); pstats->mac_stx[1].rx_stat_dot3statscarriersenseerrors_lo = pstats->mac_stx[1].rx_stat_dot3statscarriersenseerrors_lo + new->rx_stat_dot3statscarriersenseerrors; pstats->mac_stx[1].rx_stat_dot3statscarriersenseerrors_hi = pstats->mac_stx[1].rx_stat_dot3statscarriersenseerrors_hi + (pstats->mac_stx[1].rx_stat_dot3statscarriersenseerrors_lo < new->rx_stat_dot3statscarriersenseerrors ? 1U : 0U); pstats->mac_stx[1].rx_stat_falsecarriererrors_lo = pstats->mac_stx[1].rx_stat_falsecarriererrors_lo + new->rx_stat_falsecarriererrors; pstats->mac_stx[1].rx_stat_falsecarriererrors_hi = pstats->mac_stx[1].rx_stat_falsecarriererrors_hi + (pstats->mac_stx[1].rx_stat_falsecarriererrors_lo < new->rx_stat_falsecarriererrors ? 1U : 0U); pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo = pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo + new->rx_stat_etherstatsundersizepkts; pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_hi = pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_hi + (pstats->mac_stx[1].rx_stat_etherstatsundersizepkts_lo < new->rx_stat_etherstatsundersizepkts ? 1U : 0U); pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo = pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo + new->rx_stat_dot3statsframestoolong; pstats->mac_stx[1].rx_stat_dot3statsframestoolong_hi = pstats->mac_stx[1].rx_stat_dot3statsframestoolong_hi + (pstats->mac_stx[1].rx_stat_dot3statsframestoolong_lo < new->rx_stat_dot3statsframestoolong ? 1U : 0U); pstats->mac_stx[1].rx_stat_etherstatsfragments_lo = pstats->mac_stx[1].rx_stat_etherstatsfragments_lo + new->rx_stat_etherstatsfragments; pstats->mac_stx[1].rx_stat_etherstatsfragments_hi = pstats->mac_stx[1].rx_stat_etherstatsfragments_hi + (pstats->mac_stx[1].rx_stat_etherstatsfragments_lo < new->rx_stat_etherstatsfragments ? 1U : 0U); pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo = pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo + new->rx_stat_etherstatsjabbers; pstats->mac_stx[1].rx_stat_etherstatsjabbers_hi = pstats->mac_stx[1].rx_stat_etherstatsjabbers_hi + (pstats->mac_stx[1].rx_stat_etherstatsjabbers_lo < new->rx_stat_etherstatsjabbers ? 1U : 0U); pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo = pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo + new->rx_stat_maccontrolframesreceived; pstats->mac_stx[1].rx_stat_maccontrolframesreceived_hi = pstats->mac_stx[1].rx_stat_maccontrolframesreceived_hi + (pstats->mac_stx[1].rx_stat_maccontrolframesreceived_lo < new->rx_stat_maccontrolframesreceived ? 1U : 0U); pstats->mac_stx[1].rx_stat_xoffstateentered_lo = pstats->mac_stx[1].rx_stat_xoffstateentered_lo + new->rx_stat_xoffstateentered; pstats->mac_stx[1].rx_stat_xoffstateentered_hi = pstats->mac_stx[1].rx_stat_xoffstateentered_hi + (pstats->mac_stx[1].rx_stat_xoffstateentered_lo < new->rx_stat_xoffstateentered ? 1U : 0U); pstats->mac_stx[1].rx_stat_xonpauseframesreceived_lo = pstats->mac_stx[1].rx_stat_xonpauseframesreceived_lo + new->rx_stat_xonpauseframesreceived; pstats->mac_stx[1].rx_stat_xonpauseframesreceived_hi = pstats->mac_stx[1].rx_stat_xonpauseframesreceived_hi + (pstats->mac_stx[1].rx_stat_xonpauseframesreceived_lo < new->rx_stat_xonpauseframesreceived ? 1U : 0U); pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_lo = pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_lo + new->rx_stat_xoffpauseframesreceived; pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_hi = pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_hi + (pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_lo < new->rx_stat_xoffpauseframesreceived ? 1U : 0U); pstats->mac_stx[1].tx_stat_outxonsent_lo = pstats->mac_stx[1].tx_stat_outxonsent_lo + new->tx_stat_outxonsent; pstats->mac_stx[1].tx_stat_outxonsent_hi = pstats->mac_stx[1].tx_stat_outxonsent_hi + (pstats->mac_stx[1].tx_stat_outxonsent_lo < new->tx_stat_outxonsent ? 1U : 0U); pstats->mac_stx[1].tx_stat_outxoffsent_lo = pstats->mac_stx[1].tx_stat_outxoffsent_lo + new->tx_stat_outxoffsent; pstats->mac_stx[1].tx_stat_outxoffsent_hi = pstats->mac_stx[1].tx_stat_outxoffsent_hi + (pstats->mac_stx[1].tx_stat_outxoffsent_lo < new->tx_stat_outxoffsent ? 1U : 0U); pstats->mac_stx[1].tx_stat_flowcontroldone_lo = pstats->mac_stx[1].tx_stat_flowcontroldone_lo + new->tx_stat_flowcontroldone; pstats->mac_stx[1].tx_stat_flowcontroldone_hi = pstats->mac_stx[1].tx_stat_flowcontroldone_hi + (pstats->mac_stx[1].tx_stat_flowcontroldone_lo < new->tx_stat_flowcontroldone ? 1U : 0U); pstats->mac_stx[1].tx_stat_etherstatscollisions_lo = pstats->mac_stx[1].tx_stat_etherstatscollisions_lo + new->tx_stat_etherstatscollisions; pstats->mac_stx[1].tx_stat_etherstatscollisions_hi = pstats->mac_stx[1].tx_stat_etherstatscollisions_hi + (pstats->mac_stx[1].tx_stat_etherstatscollisions_lo < new->tx_stat_etherstatscollisions ? 1U : 0U); pstats->mac_stx[1].tx_stat_dot3statssinglecollisionframes_lo = pstats->mac_stx[1].tx_stat_dot3statssinglecollisionframes_lo + new->tx_stat_dot3statssinglecollisionframes; pstats->mac_stx[1].tx_stat_dot3statssinglecollisionframes_hi = pstats->mac_stx[1].tx_stat_dot3statssinglecollisionframes_hi + (pstats->mac_stx[1].tx_stat_dot3statssinglecollisionframes_lo < new->tx_stat_dot3statssinglecollisionframes ? 1U : 0U); pstats->mac_stx[1].tx_stat_dot3statsmultiplecollisionframes_lo = pstats->mac_stx[1].tx_stat_dot3statsmultiplecollisionframes_lo + new->tx_stat_dot3statsmultiplecollisionframes; pstats->mac_stx[1].tx_stat_dot3statsmultiplecollisionframes_hi = pstats->mac_stx[1].tx_stat_dot3statsmultiplecollisionframes_hi + (pstats->mac_stx[1].tx_stat_dot3statsmultiplecollisionframes_lo < new->tx_stat_dot3statsmultiplecollisionframes ? 1U : 0U); pstats->mac_stx[1].tx_stat_dot3statsdeferredtransmissions_lo = pstats->mac_stx[1].tx_stat_dot3statsdeferredtransmissions_lo + new->tx_stat_dot3statsdeferredtransmissions; pstats->mac_stx[1].tx_stat_dot3statsdeferredtransmissions_hi = pstats->mac_stx[1].tx_stat_dot3statsdeferredtransmissions_hi + (pstats->mac_stx[1].tx_stat_dot3statsdeferredtransmissions_lo < new->tx_stat_dot3statsdeferredtransmissions ? 1U : 0U); pstats->mac_stx[1].tx_stat_dot3statsexcessivecollisions_lo = pstats->mac_stx[1].tx_stat_dot3statsexcessivecollisions_lo + new->tx_stat_dot3statsexcessivecollisions; pstats->mac_stx[1].tx_stat_dot3statsexcessivecollisions_hi = pstats->mac_stx[1].tx_stat_dot3statsexcessivecollisions_hi + (pstats->mac_stx[1].tx_stat_dot3statsexcessivecollisions_lo < new->tx_stat_dot3statsexcessivecollisions ? 1U : 0U); pstats->mac_stx[1].tx_stat_dot3statslatecollisions_lo = pstats->mac_stx[1].tx_stat_dot3statslatecollisions_lo + new->tx_stat_dot3statslatecollisions; pstats->mac_stx[1].tx_stat_dot3statslatecollisions_hi = pstats->mac_stx[1].tx_stat_dot3statslatecollisions_hi + (pstats->mac_stx[1].tx_stat_dot3statslatecollisions_lo < new->tx_stat_dot3statslatecollisions ? 1U : 0U); pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo + new->tx_stat_etherstatspkts64octets; pstats->mac_stx[1].tx_stat_etherstatspkts64octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts64octets_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts64octets_lo < new->tx_stat_etherstatspkts64octets ? 1U : 0U); pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo + new->tx_stat_etherstatspkts65octetsto127octets; pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts65octetsto127octets_lo < new->tx_stat_etherstatspkts65octetsto127octets ? 1U : 0U); pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo + new->tx_stat_etherstatspkts128octetsto255octets; pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts128octetsto255octets_lo < new->tx_stat_etherstatspkts128octetsto255octets ? 1U : 0U); pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo + new->tx_stat_etherstatspkts256octetsto511octets; pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts256octetsto511octets_lo < new->tx_stat_etherstatspkts256octetsto511octets ? 1U : 0U); pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo + new->tx_stat_etherstatspkts512octetsto1023octets; pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts512octetsto1023octets_lo < new->tx_stat_etherstatspkts512octetsto1023octets ? 1U : 0U); pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo + new->tx_stat_etherstatspkts1024octetsto1522octets; pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi = pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_hi + (pstats->mac_stx[1].tx_stat_etherstatspkts1024octetsto1522octets_lo < new->tx_stat_etherstatspkts1024octetsto1522octets ? 1U : 0U); pstats->mac_stx[1].tx_stat_etherstatspktsover1522octets_lo = pstats->mac_stx[1].tx_stat_etherstatspktsover1522octets_lo + new->tx_stat_etherstatspktsover1522octets; pstats->mac_stx[1].tx_stat_etherstatspktsover1522octets_hi = pstats->mac_stx[1].tx_stat_etherstatspktsover1522octets_hi + (pstats->mac_stx[1].tx_stat_etherstatspktsover1522octets_lo < new->tx_stat_etherstatspktsover1522octets ? 1U : 0U); pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo = pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo + new->tx_stat_dot3statsinternalmactransmiterrors; pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_hi = pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_hi + (pstats->mac_stx[1].tx_stat_dot3statsinternalmactransmiterrors_lo < new->tx_stat_dot3statsinternalmactransmiterrors ? 1U : 0U); estats->pause_frames_received_hi = pstats->mac_stx[1].rx_stat_xonpauseframesreceived_hi; estats->pause_frames_received_lo = pstats->mac_stx[1].rx_stat_xonpauseframesreceived_lo; estats->pause_frames_received_lo = estats->pause_frames_received_lo + pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_lo; estats->pause_frames_received_hi = estats->pause_frames_received_hi + (pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_hi + (estats->pause_frames_received_lo < pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_lo ? 1U : 0U)); estats->pause_frames_sent_hi = pstats->mac_stx[1].tx_stat_outxonsent_hi; estats->pause_frames_sent_lo = pstats->mac_stx[1].tx_stat_outxonsent_lo; estats->pause_frames_sent_lo = estats->pause_frames_sent_lo + pstats->mac_stx[1].tx_stat_outxoffsent_lo; estats->pause_frames_sent_hi = estats->pause_frames_sent_hi + (pstats->mac_stx[1].tx_stat_outxoffsent_hi + (estats->pause_frames_sent_lo < pstats->mac_stx[1].tx_stat_outxoffsent_lo ? 1U : 0U)); return; } } static int bnx2x_hw_stats_update(struct bnx2x *bp ) { struct nig_stats *new ; struct nig_stats *old ; struct host_port_stats *pstats ; struct bnx2x_eth_stats *estats ; struct __anonstruct_diff_365 diff ; long tmp ; u32 lpi_reg ; unsigned int tmp___0 ; u32 nig_timer_max ; unsigned int tmp___1 ; { new = & (bp->slowpath)->nig_stats; old = & bp->port.old_nig_stats; pstats = & (bp->slowpath)->port_stats; estats = & bp->eth_stats; switch ((int )bp->link_vars.mac_type) { case 2: bnx2x_bmac_stats_update(bp); goto ldv_51677; case 1: bnx2x_emac_stats_update(bp); goto ldv_51677; case 3: ; case 4: bnx2x_mstat_stats_update(bp); goto ldv_51677; case 0: tmp = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]stats updated by DMAE but no MAC active\n", "bnx2x_hw_stats_update", 827, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-1); default: printk("\vbnx2x: [%s:%d(%s)]Unknown MAC type\n", "bnx2x_hw_stats_update", 831, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } ldv_51677: pstats->brb_drop_lo = pstats->brb_drop_lo + (new->brb_discard - old->brb_discard); pstats->brb_drop_hi = pstats->brb_drop_hi + (pstats->brb_drop_lo < new->brb_discard - old->brb_discard ? 1U : 0U); estats->brb_truncate_lo = estats->brb_truncate_lo + (new->brb_truncate - old->brb_truncate); estats->brb_truncate_hi = estats->brb_truncate_hi + (estats->brb_truncate_lo < new->brb_truncate - old->brb_truncate ? 1U : 0U); if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { if (new->egress_mac_pkt0_lo < old->egress_mac_pkt0_lo) { diff.hi = new->egress_mac_pkt0_hi - old->egress_mac_pkt0_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->egress_mac_pkt0_lo + ~ old->egress_mac_pkt0_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->egress_mac_pkt0_hi < old->egress_mac_pkt0_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->egress_mac_pkt0_hi - old->egress_mac_pkt0_hi; diff.lo = new->egress_mac_pkt0_lo - old->egress_mac_pkt0_lo; } estats->etherstatspkts1024octetsto1522octets_lo = estats->etherstatspkts1024octetsto1522octets_lo + diff.lo; estats->etherstatspkts1024octetsto1522octets_hi = estats->etherstatspkts1024octetsto1522octets_hi + (diff.hi + (estats->etherstatspkts1024octetsto1522octets_lo < diff.lo ? 1U : 0U)); if (new->egress_mac_pkt1_lo < old->egress_mac_pkt1_lo) { diff.hi = new->egress_mac_pkt1_hi - old->egress_mac_pkt1_hi; if (diff.hi != 0U) { diff.hi = diff.hi - 1U; diff.lo = (new->egress_mac_pkt1_lo + ~ old->egress_mac_pkt1_lo) + 1U; } else { diff.hi = 0U; diff.lo = 0U; } } else if (new->egress_mac_pkt1_hi < old->egress_mac_pkt1_hi) { diff.hi = 0U; diff.lo = 0U; } else { diff.hi = new->egress_mac_pkt1_hi - old->egress_mac_pkt1_hi; diff.lo = new->egress_mac_pkt1_lo - old->egress_mac_pkt1_lo; } estats->etherstatspktsover1522octets_lo = estats->etherstatspktsover1522octets_lo + diff.lo; estats->etherstatspktsover1522octets_hi = estats->etherstatspktsover1522octets_hi + (diff.hi + (estats->etherstatspktsover1522octets_lo < diff.lo ? 1U : 0U)); } else { } memcpy((void *)old, (void const *)new, 72UL); memcpy((void *)(& estats->rx_stat_ifhcinbadoctets_hi), (void const *)(& pstats->mac_stx) + 1U, 304UL); estats->brb_drop_hi = pstats->brb_drop_hi; estats->brb_drop_lo = pstats->brb_drop_lo; pstats->host_port_stats_counter = pstats->host_port_stats_counter + 1U; if (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) { lpi_reg = (int )bp->pfid & 1 ? 43196U : 43192U; tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )lpi_reg); estats->eee_tx_lpi = estats->eee_tx_lpi + tmp___0; } else { } if ((bp->flags & 512U) == 0U) { tmp___1 = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + ((unsigned long )bp->pfid & 1UL) * 16UL) + 1644UL))); nig_timer_max = tmp___1; if (estats->nig_timer_max != nig_timer_max) { estats->nig_timer_max = nig_timer_max; printk("\vbnx2x: [%s:%d(%s)]NIG timer max (%u)\n", "bnx2x_hw_stats_update", 867, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", estats->nig_timer_max); } else { } } else { } return (0); } } static int bnx2x_storm_stats_validate_counters(struct bnx2x *bp ) { struct stats_counter *counters ; u16 cur_stats_counter ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { counters = & (bp->fw_stats_data)->storm_counters; cur_stats_counter = (unsigned int )bp->stats_counter + 65535U; if ((int )counters->xstats_counter != (int )cur_stats_counter) { tmp = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]stats not updated by xstorm xstorm counter (0x%x) != stats_counter (0x%x)\n", "bnx2x_storm_stats_validate_counters", 887, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )counters->xstats_counter, (int )bp->stats_counter); } else { } return (-11); } else { } if ((int )counters->ustats_counter != (int )cur_stats_counter) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]stats not updated by ustorm ustorm counter (0x%x) != stats_counter (0x%x)\n", "bnx2x_storm_stats_validate_counters", 894, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )counters->ustats_counter, (int )bp->stats_counter); } else { } return (-11); } else { } if ((int )counters->cstats_counter != (int )cur_stats_counter) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]stats not updated by cstorm cstorm counter (0x%x) != stats_counter (0x%x)\n", "bnx2x_storm_stats_validate_counters", 901, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )counters->cstats_counter, (int )bp->stats_counter); } else { } return (-11); } else { } if ((int )counters->tstats_counter != (int )cur_stats_counter) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]stats not updated by tstorm tstorm counter (0x%x) != stats_counter (0x%x)\n", "bnx2x_storm_stats_validate_counters", 908, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )counters->tstats_counter, (int )bp->stats_counter); } else { } return (-11); } else { } return (0); } } static int bnx2x_storm_stats_update(struct bnx2x *bp ) { struct tstorm_per_port_stats *tport ; struct tstorm_per_pf_stats *tfunc ; struct host_func_stats *fstats ; struct bnx2x_eth_stats *estats ; struct bnx2x_eth_stats_old *estats_old ; int i ; int tmp ; struct bnx2x_fastpath *fp ; struct tstorm_per_queue_stats *tclient ; struct tstorm_per_queue_stats *old_tclient ; struct ustorm_per_queue_stats *uclient ; struct ustorm_per_queue_stats *old_uclient ; struct xstorm_per_queue_stats *xclient ; struct xstorm_per_queue_stats *old_xclient ; struct bnx2x_eth_q_stats *qstats ; struct bnx2x_eth_q_stats_old *qstats_old ; u32 diff ; long tmp___0 ; long tmp___1 ; struct bnx2x_fw_port_stats_old *fwstats ; { tport = & (bp->fw_stats_data)->port.tstorm_port_statistics; tfunc = & (bp->fw_stats_data)->pf.tstorm_pf_statistics; fstats = & bp->func_stats; estats = & bp->eth_stats; estats_old = & bp->eth_stats_old; if ((bp->flags & 4194304U) == 0U) { tmp = bnx2x_storm_stats_validate_counters(bp); if (tmp != 0) { return (-11); } else { } } else { } estats->error_bytes_received_hi = 0U; estats->error_bytes_received_lo = 0U; i = 0; goto ldv_51713; ldv_51712: fp = bp->fp + (unsigned long )i; tclient = & (bp->fw_stats_data)->queue_stats[i].tstorm_queue_statistics; old_tclient = & (bp->fp_stats + (unsigned long )fp->index)->old_tclient; uclient = & (bp->fw_stats_data)->queue_stats[i].ustorm_queue_statistics; old_uclient = & (bp->fp_stats + (unsigned long )fp->index)->old_uclient; xclient = & (bp->fw_stats_data)->queue_stats[i].xstorm_queue_statistics; old_xclient = & (bp->fp_stats + (unsigned long )fp->index)->old_xclient; qstats = & (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats; qstats_old = & (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats_old; tmp___0 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]queue[%d]: ucast_sent 0x%x, bcast_sent 0x%x mcast_sent 0x%x\n", "bnx2x_storm_stats_update", 958, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, xclient->ucast_pkts_sent, xclient->bcast_pkts_sent, xclient->mcast_pkts_sent); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]---------------\n", "bnx2x_storm_stats_update", 960, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } qstats->total_broadcast_bytes_received_lo = qstats_old->total_broadcast_bytes_received_lo + tclient->rcv_bcast_bytes.lo; qstats->total_broadcast_bytes_received_hi = (qstats_old->total_broadcast_bytes_received_hi + tclient->rcv_bcast_bytes.hi) + (qstats->total_broadcast_bytes_received_lo < qstats_old->total_broadcast_bytes_received_lo ? 1U : 0U); qstats->total_multicast_bytes_received_lo = qstats_old->total_multicast_bytes_received_lo + tclient->rcv_mcast_bytes.lo; qstats->total_multicast_bytes_received_hi = (qstats_old->total_multicast_bytes_received_hi + tclient->rcv_mcast_bytes.hi) + (qstats->total_multicast_bytes_received_lo < qstats_old->total_multicast_bytes_received_lo ? 1U : 0U); qstats->total_unicast_bytes_received_lo = qstats_old->total_unicast_bytes_received_lo + tclient->rcv_ucast_bytes.lo; qstats->total_unicast_bytes_received_hi = (qstats_old->total_unicast_bytes_received_hi + tclient->rcv_ucast_bytes.hi) + (qstats->total_unicast_bytes_received_lo < qstats_old->total_unicast_bytes_received_lo ? 1U : 0U); qstats->total_bytes_received_hi = qstats->total_broadcast_bytes_received_hi; qstats->total_bytes_received_lo = qstats->total_broadcast_bytes_received_lo; qstats->total_bytes_received_lo = qstats->total_bytes_received_lo + qstats->total_multicast_bytes_received_lo; qstats->total_bytes_received_hi = qstats->total_bytes_received_hi + (qstats->total_multicast_bytes_received_hi + (qstats->total_bytes_received_lo < qstats->total_multicast_bytes_received_lo ? 1U : 0U)); qstats->total_bytes_received_lo = qstats->total_bytes_received_lo + qstats->total_unicast_bytes_received_lo; qstats->total_bytes_received_hi = qstats->total_bytes_received_hi + (qstats->total_unicast_bytes_received_hi + (qstats->total_bytes_received_lo < qstats->total_unicast_bytes_received_lo ? 1U : 0U)); qstats->valid_bytes_received_hi = qstats->total_bytes_received_hi; qstats->valid_bytes_received_lo = qstats->total_bytes_received_lo; diff = tclient->rcv_ucast_pkts - old_tclient->rcv_ucast_pkts; old_tclient->rcv_ucast_pkts = tclient->rcv_ucast_pkts; qstats->total_unicast_packets_received_lo = qstats->total_unicast_packets_received_lo + diff; qstats->total_unicast_packets_received_hi = qstats->total_unicast_packets_received_hi + (qstats->total_unicast_packets_received_lo < diff ? 1U : 0U); diff = tclient->rcv_mcast_pkts - old_tclient->rcv_mcast_pkts; old_tclient->rcv_mcast_pkts = tclient->rcv_mcast_pkts; qstats->total_multicast_packets_received_lo = qstats->total_multicast_packets_received_lo + diff; qstats->total_multicast_packets_received_hi = qstats->total_multicast_packets_received_hi + (qstats->total_multicast_packets_received_lo < diff ? 1U : 0U); diff = tclient->rcv_bcast_pkts - old_tclient->rcv_bcast_pkts; old_tclient->rcv_bcast_pkts = tclient->rcv_bcast_pkts; qstats->total_broadcast_packets_received_lo = qstats->total_broadcast_packets_received_lo + diff; qstats->total_broadcast_packets_received_hi = qstats->total_broadcast_packets_received_hi + (qstats->total_broadcast_packets_received_lo < diff ? 1U : 0U); diff = tclient->pkts_too_big_discard - old_tclient->pkts_too_big_discard; old_tclient->pkts_too_big_discard = tclient->pkts_too_big_discard; qstats->etherstatsoverrsizepkts_lo = qstats->etherstatsoverrsizepkts_lo + diff; qstats->etherstatsoverrsizepkts_hi = qstats->etherstatsoverrsizepkts_hi + (qstats->etherstatsoverrsizepkts_lo < diff ? 1U : 0U); estats->etherstatsoverrsizepkts_lo = estats->etherstatsoverrsizepkts_lo + diff; estats->etherstatsoverrsizepkts_hi = estats->etherstatsoverrsizepkts_hi + (estats->etherstatsoverrsizepkts_lo < diff ? 1U : 0U); diff = (u32 )((int )tclient->no_buff_discard - (int )old_tclient->no_buff_discard); old_tclient->no_buff_discard = tclient->no_buff_discard; qstats->no_buff_discard_lo = qstats->no_buff_discard_lo + diff; qstats->no_buff_discard_hi = qstats->no_buff_discard_hi + (qstats->no_buff_discard_lo < diff ? 1U : 0U); estats->no_buff_discard_lo = estats->no_buff_discard_lo + diff; estats->no_buff_discard_hi = estats->no_buff_discard_hi + (estats->no_buff_discard_lo < diff ? 1U : 0U); diff = uclient->ucast_no_buff_pkts - old_uclient->ucast_no_buff_pkts; if (qstats->total_unicast_packets_received_lo < diff) { qstats->total_unicast_packets_received_hi = qstats->total_unicast_packets_received_hi; if (qstats->total_unicast_packets_received_hi != 0U) { qstats->total_unicast_packets_received_hi = qstats->total_unicast_packets_received_hi - 1U; qstats->total_unicast_packets_received_lo = (qstats->total_unicast_packets_received_lo + ~ diff) + 1U; } else { qstats->total_unicast_packets_received_hi = 0U; qstats->total_unicast_packets_received_lo = 0U; } } else { qstats->total_unicast_packets_received_hi = qstats->total_unicast_packets_received_hi; qstats->total_unicast_packets_received_lo = qstats->total_unicast_packets_received_lo - diff; } diff = uclient->mcast_no_buff_pkts - old_uclient->mcast_no_buff_pkts; if (qstats->total_multicast_packets_received_lo < diff) { qstats->total_multicast_packets_received_hi = qstats->total_multicast_packets_received_hi; if (qstats->total_multicast_packets_received_hi != 0U) { qstats->total_multicast_packets_received_hi = qstats->total_multicast_packets_received_hi - 1U; qstats->total_multicast_packets_received_lo = (qstats->total_multicast_packets_received_lo + ~ diff) + 1U; } else { qstats->total_multicast_packets_received_hi = 0U; qstats->total_multicast_packets_received_lo = 0U; } } else { qstats->total_multicast_packets_received_hi = qstats->total_multicast_packets_received_hi; qstats->total_multicast_packets_received_lo = qstats->total_multicast_packets_received_lo - diff; } diff = uclient->bcast_no_buff_pkts - old_uclient->bcast_no_buff_pkts; if (qstats->total_broadcast_packets_received_lo < diff) { qstats->total_broadcast_packets_received_hi = qstats->total_broadcast_packets_received_hi; if (qstats->total_broadcast_packets_received_hi != 0U) { qstats->total_broadcast_packets_received_hi = qstats->total_broadcast_packets_received_hi - 1U; qstats->total_broadcast_packets_received_lo = (qstats->total_broadcast_packets_received_lo + ~ diff) + 1U; } else { qstats->total_broadcast_packets_received_hi = 0U; qstats->total_broadcast_packets_received_lo = 0U; } } else { qstats->total_broadcast_packets_received_hi = qstats->total_broadcast_packets_received_hi; qstats->total_broadcast_packets_received_lo = qstats->total_broadcast_packets_received_lo - diff; } diff = uclient->ucast_no_buff_pkts - old_uclient->ucast_no_buff_pkts; old_uclient->ucast_no_buff_pkts = uclient->ucast_no_buff_pkts; qstats->no_buff_discard_lo = qstats->no_buff_discard_lo + diff; qstats->no_buff_discard_hi = qstats->no_buff_discard_hi + (qstats->no_buff_discard_lo < diff ? 1U : 0U); estats->no_buff_discard_lo = estats->no_buff_discard_lo + diff; estats->no_buff_discard_hi = estats->no_buff_discard_hi + (estats->no_buff_discard_lo < diff ? 1U : 0U); diff = uclient->mcast_no_buff_pkts - old_uclient->mcast_no_buff_pkts; old_uclient->mcast_no_buff_pkts = uclient->mcast_no_buff_pkts; qstats->no_buff_discard_lo = qstats->no_buff_discard_lo + diff; qstats->no_buff_discard_hi = qstats->no_buff_discard_hi + (qstats->no_buff_discard_lo < diff ? 1U : 0U); estats->no_buff_discard_lo = estats->no_buff_discard_lo + diff; estats->no_buff_discard_hi = estats->no_buff_discard_hi + (estats->no_buff_discard_lo < diff ? 1U : 0U); diff = uclient->bcast_no_buff_pkts - old_uclient->bcast_no_buff_pkts; old_uclient->bcast_no_buff_pkts = uclient->bcast_no_buff_pkts; qstats->no_buff_discard_lo = qstats->no_buff_discard_lo + diff; qstats->no_buff_discard_hi = qstats->no_buff_discard_hi + (qstats->no_buff_discard_lo < diff ? 1U : 0U); estats->no_buff_discard_lo = estats->no_buff_discard_lo + diff; estats->no_buff_discard_hi = estats->no_buff_discard_hi + (estats->no_buff_discard_lo < diff ? 1U : 0U); qstats->total_broadcast_bytes_transmitted_lo = qstats_old->total_broadcast_bytes_transmitted_lo + xclient->bcast_bytes_sent.lo; qstats->total_broadcast_bytes_transmitted_hi = (qstats_old->total_broadcast_bytes_transmitted_hi + xclient->bcast_bytes_sent.hi) + (qstats->total_broadcast_bytes_transmitted_lo < qstats_old->total_broadcast_bytes_transmitted_lo ? 1U : 0U); qstats->total_multicast_bytes_transmitted_lo = qstats_old->total_multicast_bytes_transmitted_lo + xclient->mcast_bytes_sent.lo; qstats->total_multicast_bytes_transmitted_hi = (qstats_old->total_multicast_bytes_transmitted_hi + xclient->mcast_bytes_sent.hi) + (qstats->total_multicast_bytes_transmitted_lo < qstats_old->total_multicast_bytes_transmitted_lo ? 1U : 0U); qstats->total_unicast_bytes_transmitted_lo = qstats_old->total_unicast_bytes_transmitted_lo + xclient->ucast_bytes_sent.lo; qstats->total_unicast_bytes_transmitted_hi = (qstats_old->total_unicast_bytes_transmitted_hi + xclient->ucast_bytes_sent.hi) + (qstats->total_unicast_bytes_transmitted_lo < qstats_old->total_unicast_bytes_transmitted_lo ? 1U : 0U); qstats->total_bytes_transmitted_hi = qstats->total_unicast_bytes_transmitted_hi; qstats->total_bytes_transmitted_lo = qstats->total_unicast_bytes_transmitted_lo; qstats->total_bytes_transmitted_lo = qstats->total_bytes_transmitted_lo + qstats->total_broadcast_bytes_transmitted_lo; qstats->total_bytes_transmitted_hi = qstats->total_bytes_transmitted_hi + (qstats->total_broadcast_bytes_transmitted_hi + (qstats->total_bytes_transmitted_lo < qstats->total_broadcast_bytes_transmitted_lo ? 1U : 0U)); qstats->total_bytes_transmitted_lo = qstats->total_bytes_transmitted_lo + qstats->total_multicast_bytes_transmitted_lo; qstats->total_bytes_transmitted_hi = qstats->total_bytes_transmitted_hi + (qstats->total_multicast_bytes_transmitted_hi + (qstats->total_bytes_transmitted_lo < qstats->total_multicast_bytes_transmitted_lo ? 1U : 0U)); diff = xclient->ucast_pkts_sent - old_xclient->ucast_pkts_sent; old_xclient->ucast_pkts_sent = xclient->ucast_pkts_sent; qstats->total_unicast_packets_transmitted_lo = qstats->total_unicast_packets_transmitted_lo + diff; qstats->total_unicast_packets_transmitted_hi = qstats->total_unicast_packets_transmitted_hi + (qstats->total_unicast_packets_transmitted_lo < diff ? 1U : 0U); diff = xclient->mcast_pkts_sent - old_xclient->mcast_pkts_sent; old_xclient->mcast_pkts_sent = xclient->mcast_pkts_sent; qstats->total_multicast_packets_transmitted_lo = qstats->total_multicast_packets_transmitted_lo + diff; qstats->total_multicast_packets_transmitted_hi = qstats->total_multicast_packets_transmitted_hi + (qstats->total_multicast_packets_transmitted_lo < diff ? 1U : 0U); diff = xclient->bcast_pkts_sent - old_xclient->bcast_pkts_sent; old_xclient->bcast_pkts_sent = xclient->bcast_pkts_sent; qstats->total_broadcast_packets_transmitted_lo = qstats->total_broadcast_packets_transmitted_lo + diff; qstats->total_broadcast_packets_transmitted_hi = qstats->total_broadcast_packets_transmitted_hi + (qstats->total_broadcast_packets_transmitted_lo < diff ? 1U : 0U); diff = tclient->checksum_discard - old_tclient->checksum_discard; old_tclient->checksum_discard = tclient->checksum_discard; qstats->total_packets_received_checksum_discarded_lo = qstats->total_packets_received_checksum_discarded_lo + diff; qstats->total_packets_received_checksum_discarded_hi = qstats->total_packets_received_checksum_discarded_hi + (qstats->total_packets_received_checksum_discarded_lo < diff ? 1U : 0U); diff = tclient->ttl0_discard - old_tclient->ttl0_discard; old_tclient->ttl0_discard = tclient->ttl0_discard; qstats->total_packets_received_ttl0_discarded_lo = qstats->total_packets_received_ttl0_discarded_lo + diff; qstats->total_packets_received_ttl0_discarded_hi = qstats->total_packets_received_ttl0_discarded_hi + (qstats->total_packets_received_ttl0_discarded_lo < diff ? 1U : 0U); diff = xclient->error_drop_pkts - old_xclient->error_drop_pkts; old_xclient->error_drop_pkts = xclient->error_drop_pkts; qstats->total_transmitted_dropped_packets_error_lo = qstats->total_transmitted_dropped_packets_error_lo + diff; qstats->total_transmitted_dropped_packets_error_hi = qstats->total_transmitted_dropped_packets_error_hi + (qstats->total_transmitted_dropped_packets_error_lo < diff ? 1U : 0U); diff = uclient->coalesced_events - old_uclient->coalesced_events; old_uclient->coalesced_events = uclient->coalesced_events; qstats->total_tpa_aggregations_lo = qstats->total_tpa_aggregations_lo + diff; qstats->total_tpa_aggregations_hi = qstats->total_tpa_aggregations_hi + (qstats->total_tpa_aggregations_lo < diff ? 1U : 0U); estats->total_tpa_aggregations_lo = estats->total_tpa_aggregations_lo + diff; estats->total_tpa_aggregations_hi = estats->total_tpa_aggregations_hi + (estats->total_tpa_aggregations_lo < diff ? 1U : 0U); diff = uclient->coalesced_pkts - old_uclient->coalesced_pkts; old_uclient->coalesced_pkts = uclient->coalesced_pkts; qstats->total_tpa_aggregated_frames_lo = qstats->total_tpa_aggregated_frames_lo + diff; qstats->total_tpa_aggregated_frames_hi = qstats->total_tpa_aggregated_frames_hi + (qstats->total_tpa_aggregated_frames_lo < diff ? 1U : 0U); estats->total_tpa_aggregated_frames_lo = estats->total_tpa_aggregated_frames_lo + diff; estats->total_tpa_aggregated_frames_hi = estats->total_tpa_aggregated_frames_hi + (estats->total_tpa_aggregated_frames_lo < diff ? 1U : 0U); qstats->total_tpa_bytes_lo = qstats_old->total_tpa_bytes_lo + uclient->coalesced_bytes.lo; qstats->total_tpa_bytes_hi = (qstats_old->total_tpa_bytes_hi + uclient->coalesced_bytes.hi) + (qstats->total_tpa_bytes_lo < qstats_old->total_tpa_bytes_lo ? 1U : 0U); estats->total_tpa_bytes_lo = estats->total_tpa_bytes_lo + qstats->total_tpa_bytes_lo; estats->total_tpa_bytes_hi = estats->total_tpa_bytes_hi + (qstats->total_tpa_bytes_hi + (estats->total_tpa_bytes_lo < qstats->total_tpa_bytes_lo ? 1U : 0U)); if (estats->total_tpa_bytes_lo < qstats_old->total_tpa_bytes_lo_old) { estats->total_tpa_bytes_hi = estats->total_tpa_bytes_hi - qstats_old->total_tpa_bytes_hi_old; if (estats->total_tpa_bytes_hi != 0U) { estats->total_tpa_bytes_hi = estats->total_tpa_bytes_hi - 1U; estats->total_tpa_bytes_lo = (estats->total_tpa_bytes_lo + ~ qstats_old->total_tpa_bytes_lo_old) + 1U; } else { estats->total_tpa_bytes_hi = 0U; estats->total_tpa_bytes_lo = 0U; } } else if (estats->total_tpa_bytes_hi < qstats_old->total_tpa_bytes_hi_old) { estats->total_tpa_bytes_hi = 0U; estats->total_tpa_bytes_lo = 0U; } else { estats->total_tpa_bytes_hi = estats->total_tpa_bytes_hi - qstats_old->total_tpa_bytes_hi_old; estats->total_tpa_bytes_lo = estats->total_tpa_bytes_lo - qstats_old->total_tpa_bytes_lo_old; } qstats_old->total_tpa_bytes_hi_old = qstats->total_tpa_bytes_hi; qstats_old->total_tpa_bytes_lo_old = qstats->total_tpa_bytes_lo; fstats->total_bytes_received_lo = fstats->total_bytes_received_lo + qstats->total_bytes_received_lo; fstats->total_bytes_received_hi = fstats->total_bytes_received_hi + (qstats->total_bytes_received_hi + (fstats->total_bytes_received_lo < qstats->total_bytes_received_lo ? 1U : 0U)); if (fstats->total_bytes_received_lo < qstats_old->total_bytes_received_lo) { fstats->total_bytes_received_hi = fstats->total_bytes_received_hi - qstats_old->total_bytes_received_hi; if (fstats->total_bytes_received_hi != 0U) { fstats->total_bytes_received_hi = fstats->total_bytes_received_hi - 1U; fstats->total_bytes_received_lo = (fstats->total_bytes_received_lo + ~ qstats_old->total_bytes_received_lo) + 1U; } else { fstats->total_bytes_received_hi = 0U; fstats->total_bytes_received_lo = 0U; } } else if (fstats->total_bytes_received_hi < qstats_old->total_bytes_received_hi) { fstats->total_bytes_received_hi = 0U; fstats->total_bytes_received_lo = 0U; } else { fstats->total_bytes_received_hi = fstats->total_bytes_received_hi - qstats_old->total_bytes_received_hi; fstats->total_bytes_received_lo = fstats->total_bytes_received_lo - qstats_old->total_bytes_received_lo; } estats->total_bytes_received_hi = fstats->total_bytes_received_hi; estats->total_bytes_received_lo = fstats->total_bytes_received_lo; qstats_old->total_bytes_received_hi = qstats->total_bytes_received_hi; qstats_old->total_bytes_received_lo = qstats->total_bytes_received_lo; fstats->total_bytes_transmitted_lo = fstats->total_bytes_transmitted_lo + qstats->total_bytes_transmitted_lo; fstats->total_bytes_transmitted_hi = fstats->total_bytes_transmitted_hi + (qstats->total_bytes_transmitted_hi + (fstats->total_bytes_transmitted_lo < qstats->total_bytes_transmitted_lo ? 1U : 0U)); if (fstats->total_bytes_transmitted_lo < qstats_old->total_bytes_transmitted_lo) { fstats->total_bytes_transmitted_hi = fstats->total_bytes_transmitted_hi - qstats_old->total_bytes_transmitted_hi; if (fstats->total_bytes_transmitted_hi != 0U) { fstats->total_bytes_transmitted_hi = fstats->total_bytes_transmitted_hi - 1U; fstats->total_bytes_transmitted_lo = (fstats->total_bytes_transmitted_lo + ~ qstats_old->total_bytes_transmitted_lo) + 1U; } else { fstats->total_bytes_transmitted_hi = 0U; fstats->total_bytes_transmitted_lo = 0U; } } else if (fstats->total_bytes_transmitted_hi < qstats_old->total_bytes_transmitted_hi) { fstats->total_bytes_transmitted_hi = 0U; fstats->total_bytes_transmitted_lo = 0U; } else { fstats->total_bytes_transmitted_hi = fstats->total_bytes_transmitted_hi - qstats_old->total_bytes_transmitted_hi; fstats->total_bytes_transmitted_lo = fstats->total_bytes_transmitted_lo - qstats_old->total_bytes_transmitted_lo; } estats->total_bytes_transmitted_hi = fstats->total_bytes_transmitted_hi; estats->total_bytes_transmitted_lo = fstats->total_bytes_transmitted_lo; qstats_old->total_bytes_transmitted_hi = qstats->total_bytes_transmitted_hi; qstats_old->total_bytes_transmitted_lo = qstats->total_bytes_transmitted_lo; fstats->total_unicast_packets_received_lo = fstats->total_unicast_packets_received_lo + qstats->total_unicast_packets_received_lo; fstats->total_unicast_packets_received_hi = fstats->total_unicast_packets_received_hi + (qstats->total_unicast_packets_received_hi + (fstats->total_unicast_packets_received_lo < qstats->total_unicast_packets_received_lo ? 1U : 0U)); if (fstats->total_unicast_packets_received_lo < qstats_old->total_unicast_packets_received_lo) { fstats->total_unicast_packets_received_hi = fstats->total_unicast_packets_received_hi - qstats_old->total_unicast_packets_received_hi; if (fstats->total_unicast_packets_received_hi != 0U) { fstats->total_unicast_packets_received_hi = fstats->total_unicast_packets_received_hi - 1U; fstats->total_unicast_packets_received_lo = (fstats->total_unicast_packets_received_lo + ~ qstats_old->total_unicast_packets_received_lo) + 1U; } else { fstats->total_unicast_packets_received_hi = 0U; fstats->total_unicast_packets_received_lo = 0U; } } else if (fstats->total_unicast_packets_received_hi < qstats_old->total_unicast_packets_received_hi) { fstats->total_unicast_packets_received_hi = 0U; fstats->total_unicast_packets_received_lo = 0U; } else { fstats->total_unicast_packets_received_hi = fstats->total_unicast_packets_received_hi - qstats_old->total_unicast_packets_received_hi; fstats->total_unicast_packets_received_lo = fstats->total_unicast_packets_received_lo - qstats_old->total_unicast_packets_received_lo; } estats->total_unicast_packets_received_hi = fstats->total_unicast_packets_received_hi; estats->total_unicast_packets_received_lo = fstats->total_unicast_packets_received_lo; qstats_old->total_unicast_packets_received_hi = qstats->total_unicast_packets_received_hi; qstats_old->total_unicast_packets_received_lo = qstats->total_unicast_packets_received_lo; fstats->total_multicast_packets_received_lo = fstats->total_multicast_packets_received_lo + qstats->total_multicast_packets_received_lo; fstats->total_multicast_packets_received_hi = fstats->total_multicast_packets_received_hi + (qstats->total_multicast_packets_received_hi + (fstats->total_multicast_packets_received_lo < qstats->total_multicast_packets_received_lo ? 1U : 0U)); if (fstats->total_multicast_packets_received_lo < qstats_old->total_multicast_packets_received_lo) { fstats->total_multicast_packets_received_hi = fstats->total_multicast_packets_received_hi - qstats_old->total_multicast_packets_received_hi; if (fstats->total_multicast_packets_received_hi != 0U) { fstats->total_multicast_packets_received_hi = fstats->total_multicast_packets_received_hi - 1U; fstats->total_multicast_packets_received_lo = (fstats->total_multicast_packets_received_lo + ~ qstats_old->total_multicast_packets_received_lo) + 1U; } else { fstats->total_multicast_packets_received_hi = 0U; fstats->total_multicast_packets_received_lo = 0U; } } else if (fstats->total_multicast_packets_received_hi < qstats_old->total_multicast_packets_received_hi) { fstats->total_multicast_packets_received_hi = 0U; fstats->total_multicast_packets_received_lo = 0U; } else { fstats->total_multicast_packets_received_hi = fstats->total_multicast_packets_received_hi - qstats_old->total_multicast_packets_received_hi; fstats->total_multicast_packets_received_lo = fstats->total_multicast_packets_received_lo - qstats_old->total_multicast_packets_received_lo; } estats->total_multicast_packets_received_hi = fstats->total_multicast_packets_received_hi; estats->total_multicast_packets_received_lo = fstats->total_multicast_packets_received_lo; qstats_old->total_multicast_packets_received_hi = qstats->total_multicast_packets_received_hi; qstats_old->total_multicast_packets_received_lo = qstats->total_multicast_packets_received_lo; fstats->total_broadcast_packets_received_lo = fstats->total_broadcast_packets_received_lo + qstats->total_broadcast_packets_received_lo; fstats->total_broadcast_packets_received_hi = fstats->total_broadcast_packets_received_hi + (qstats->total_broadcast_packets_received_hi + (fstats->total_broadcast_packets_received_lo < qstats->total_broadcast_packets_received_lo ? 1U : 0U)); if (fstats->total_broadcast_packets_received_lo < qstats_old->total_broadcast_packets_received_lo) { fstats->total_broadcast_packets_received_hi = fstats->total_broadcast_packets_received_hi - qstats_old->total_broadcast_packets_received_hi; if (fstats->total_broadcast_packets_received_hi != 0U) { fstats->total_broadcast_packets_received_hi = fstats->total_broadcast_packets_received_hi - 1U; fstats->total_broadcast_packets_received_lo = (fstats->total_broadcast_packets_received_lo + ~ qstats_old->total_broadcast_packets_received_lo) + 1U; } else { fstats->total_broadcast_packets_received_hi = 0U; fstats->total_broadcast_packets_received_lo = 0U; } } else if (fstats->total_broadcast_packets_received_hi < qstats_old->total_broadcast_packets_received_hi) { fstats->total_broadcast_packets_received_hi = 0U; fstats->total_broadcast_packets_received_lo = 0U; } else { fstats->total_broadcast_packets_received_hi = fstats->total_broadcast_packets_received_hi - qstats_old->total_broadcast_packets_received_hi; fstats->total_broadcast_packets_received_lo = fstats->total_broadcast_packets_received_lo - qstats_old->total_broadcast_packets_received_lo; } estats->total_broadcast_packets_received_hi = fstats->total_broadcast_packets_received_hi; estats->total_broadcast_packets_received_lo = fstats->total_broadcast_packets_received_lo; qstats_old->total_broadcast_packets_received_hi = qstats->total_broadcast_packets_received_hi; qstats_old->total_broadcast_packets_received_lo = qstats->total_broadcast_packets_received_lo; fstats->total_unicast_packets_transmitted_lo = fstats->total_unicast_packets_transmitted_lo + qstats->total_unicast_packets_transmitted_lo; fstats->total_unicast_packets_transmitted_hi = fstats->total_unicast_packets_transmitted_hi + (qstats->total_unicast_packets_transmitted_hi + (fstats->total_unicast_packets_transmitted_lo < qstats->total_unicast_packets_transmitted_lo ? 1U : 0U)); if (fstats->total_unicast_packets_transmitted_lo < qstats_old->total_unicast_packets_transmitted_lo) { fstats->total_unicast_packets_transmitted_hi = fstats->total_unicast_packets_transmitted_hi - qstats_old->total_unicast_packets_transmitted_hi; if (fstats->total_unicast_packets_transmitted_hi != 0U) { fstats->total_unicast_packets_transmitted_hi = fstats->total_unicast_packets_transmitted_hi - 1U; fstats->total_unicast_packets_transmitted_lo = (fstats->total_unicast_packets_transmitted_lo + ~ qstats_old->total_unicast_packets_transmitted_lo) + 1U; } else { fstats->total_unicast_packets_transmitted_hi = 0U; fstats->total_unicast_packets_transmitted_lo = 0U; } } else if (fstats->total_unicast_packets_transmitted_hi < qstats_old->total_unicast_packets_transmitted_hi) { fstats->total_unicast_packets_transmitted_hi = 0U; fstats->total_unicast_packets_transmitted_lo = 0U; } else { fstats->total_unicast_packets_transmitted_hi = fstats->total_unicast_packets_transmitted_hi - qstats_old->total_unicast_packets_transmitted_hi; fstats->total_unicast_packets_transmitted_lo = fstats->total_unicast_packets_transmitted_lo - qstats_old->total_unicast_packets_transmitted_lo; } estats->total_unicast_packets_transmitted_hi = fstats->total_unicast_packets_transmitted_hi; estats->total_unicast_packets_transmitted_lo = fstats->total_unicast_packets_transmitted_lo; qstats_old->total_unicast_packets_transmitted_hi = qstats->total_unicast_packets_transmitted_hi; qstats_old->total_unicast_packets_transmitted_lo = qstats->total_unicast_packets_transmitted_lo; fstats->total_multicast_packets_transmitted_lo = fstats->total_multicast_packets_transmitted_lo + qstats->total_multicast_packets_transmitted_lo; fstats->total_multicast_packets_transmitted_hi = fstats->total_multicast_packets_transmitted_hi + (qstats->total_multicast_packets_transmitted_hi + (fstats->total_multicast_packets_transmitted_lo < qstats->total_multicast_packets_transmitted_lo ? 1U : 0U)); if (fstats->total_multicast_packets_transmitted_lo < qstats_old->total_multicast_packets_transmitted_lo) { fstats->total_multicast_packets_transmitted_hi = fstats->total_multicast_packets_transmitted_hi - qstats_old->total_multicast_packets_transmitted_hi; if (fstats->total_multicast_packets_transmitted_hi != 0U) { fstats->total_multicast_packets_transmitted_hi = fstats->total_multicast_packets_transmitted_hi - 1U; fstats->total_multicast_packets_transmitted_lo = (fstats->total_multicast_packets_transmitted_lo + ~ qstats_old->total_multicast_packets_transmitted_lo) + 1U; } else { fstats->total_multicast_packets_transmitted_hi = 0U; fstats->total_multicast_packets_transmitted_lo = 0U; } } else if (fstats->total_multicast_packets_transmitted_hi < qstats_old->total_multicast_packets_transmitted_hi) { fstats->total_multicast_packets_transmitted_hi = 0U; fstats->total_multicast_packets_transmitted_lo = 0U; } else { fstats->total_multicast_packets_transmitted_hi = fstats->total_multicast_packets_transmitted_hi - qstats_old->total_multicast_packets_transmitted_hi; fstats->total_multicast_packets_transmitted_lo = fstats->total_multicast_packets_transmitted_lo - qstats_old->total_multicast_packets_transmitted_lo; } estats->total_multicast_packets_transmitted_hi = fstats->total_multicast_packets_transmitted_hi; estats->total_multicast_packets_transmitted_lo = fstats->total_multicast_packets_transmitted_lo; qstats_old->total_multicast_packets_transmitted_hi = qstats->total_multicast_packets_transmitted_hi; qstats_old->total_multicast_packets_transmitted_lo = qstats->total_multicast_packets_transmitted_lo; fstats->total_broadcast_packets_transmitted_lo = fstats->total_broadcast_packets_transmitted_lo + qstats->total_broadcast_packets_transmitted_lo; fstats->total_broadcast_packets_transmitted_hi = fstats->total_broadcast_packets_transmitted_hi + (qstats->total_broadcast_packets_transmitted_hi + (fstats->total_broadcast_packets_transmitted_lo < qstats->total_broadcast_packets_transmitted_lo ? 1U : 0U)); if (fstats->total_broadcast_packets_transmitted_lo < qstats_old->total_broadcast_packets_transmitted_lo) { fstats->total_broadcast_packets_transmitted_hi = fstats->total_broadcast_packets_transmitted_hi - qstats_old->total_broadcast_packets_transmitted_hi; if (fstats->total_broadcast_packets_transmitted_hi != 0U) { fstats->total_broadcast_packets_transmitted_hi = fstats->total_broadcast_packets_transmitted_hi - 1U; fstats->total_broadcast_packets_transmitted_lo = (fstats->total_broadcast_packets_transmitted_lo + ~ qstats_old->total_broadcast_packets_transmitted_lo) + 1U; } else { fstats->total_broadcast_packets_transmitted_hi = 0U; fstats->total_broadcast_packets_transmitted_lo = 0U; } } else if (fstats->total_broadcast_packets_transmitted_hi < qstats_old->total_broadcast_packets_transmitted_hi) { fstats->total_broadcast_packets_transmitted_hi = 0U; fstats->total_broadcast_packets_transmitted_lo = 0U; } else { fstats->total_broadcast_packets_transmitted_hi = fstats->total_broadcast_packets_transmitted_hi - qstats_old->total_broadcast_packets_transmitted_hi; fstats->total_broadcast_packets_transmitted_lo = fstats->total_broadcast_packets_transmitted_lo - qstats_old->total_broadcast_packets_transmitted_lo; } estats->total_broadcast_packets_transmitted_hi = fstats->total_broadcast_packets_transmitted_hi; estats->total_broadcast_packets_transmitted_lo = fstats->total_broadcast_packets_transmitted_lo; qstats_old->total_broadcast_packets_transmitted_hi = qstats->total_broadcast_packets_transmitted_hi; qstats_old->total_broadcast_packets_transmitted_lo = qstats->total_broadcast_packets_transmitted_lo; fstats->valid_bytes_received_lo = fstats->valid_bytes_received_lo + qstats->valid_bytes_received_lo; fstats->valid_bytes_received_hi = fstats->valid_bytes_received_hi + (qstats->valid_bytes_received_hi + (fstats->valid_bytes_received_lo < qstats->valid_bytes_received_lo ? 1U : 0U)); if (fstats->valid_bytes_received_lo < qstats_old->valid_bytes_received_lo) { fstats->valid_bytes_received_hi = fstats->valid_bytes_received_hi - qstats_old->valid_bytes_received_hi; if (fstats->valid_bytes_received_hi != 0U) { fstats->valid_bytes_received_hi = fstats->valid_bytes_received_hi - 1U; fstats->valid_bytes_received_lo = (fstats->valid_bytes_received_lo + ~ qstats_old->valid_bytes_received_lo) + 1U; } else { fstats->valid_bytes_received_hi = 0U; fstats->valid_bytes_received_lo = 0U; } } else if (fstats->valid_bytes_received_hi < qstats_old->valid_bytes_received_hi) { fstats->valid_bytes_received_hi = 0U; fstats->valid_bytes_received_lo = 0U; } else { fstats->valid_bytes_received_hi = fstats->valid_bytes_received_hi - qstats_old->valid_bytes_received_hi; fstats->valid_bytes_received_lo = fstats->valid_bytes_received_lo - qstats_old->valid_bytes_received_lo; } estats->valid_bytes_received_hi = fstats->valid_bytes_received_hi; estats->valid_bytes_received_lo = fstats->valid_bytes_received_lo; qstats_old->valid_bytes_received_hi = qstats->valid_bytes_received_hi; qstats_old->valid_bytes_received_lo = qstats->valid_bytes_received_lo; i = i + 1; ldv_51713: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_51712; } else { } estats->total_bytes_received_lo = estats->total_bytes_received_lo + estats->rx_stat_ifhcinbadoctets_lo; estats->total_bytes_received_hi = estats->total_bytes_received_hi + (estats->rx_stat_ifhcinbadoctets_hi + (estats->total_bytes_received_lo < estats->rx_stat_ifhcinbadoctets_lo ? 1U : 0U)); estats->total_bytes_received_lo = estats->total_bytes_received_lo + tfunc->rcv_error_bytes.lo; estats->total_bytes_received_hi = estats->total_bytes_received_hi + (tfunc->rcv_error_bytes.hi + (estats->total_bytes_received_lo < tfunc->rcv_error_bytes.lo ? 1U : 0U)); estats->error_bytes_received_lo = estats->error_bytes_received_lo + tfunc->rcv_error_bytes.lo; estats->error_bytes_received_hi = estats->error_bytes_received_hi + (tfunc->rcv_error_bytes.hi + (estats->error_bytes_received_lo < tfunc->rcv_error_bytes.lo ? 1U : 0U)); if (estats->etherstatsoverrsizepkts_lo < estats_old->rx_stat_dot3statsframestoolong_lo) { estats->etherstatsoverrsizepkts_hi = estats->etherstatsoverrsizepkts_hi - estats_old->rx_stat_dot3statsframestoolong_hi; if (estats->etherstatsoverrsizepkts_hi != 0U) { estats->etherstatsoverrsizepkts_hi = estats->etherstatsoverrsizepkts_hi - 1U; estats->etherstatsoverrsizepkts_lo = (estats->etherstatsoverrsizepkts_lo + ~ estats_old->rx_stat_dot3statsframestoolong_lo) + 1U; } else { estats->etherstatsoverrsizepkts_hi = 0U; estats->etherstatsoverrsizepkts_lo = 0U; } } else if (estats->etherstatsoverrsizepkts_hi < estats_old->rx_stat_dot3statsframestoolong_hi) { estats->etherstatsoverrsizepkts_hi = 0U; estats->etherstatsoverrsizepkts_lo = 0U; } else { estats->etherstatsoverrsizepkts_hi = estats->etherstatsoverrsizepkts_hi - estats_old->rx_stat_dot3statsframestoolong_hi; estats->etherstatsoverrsizepkts_lo = estats->etherstatsoverrsizepkts_lo - estats_old->rx_stat_dot3statsframestoolong_lo; } estats->etherstatsoverrsizepkts_lo = estats->etherstatsoverrsizepkts_lo + estats->rx_stat_dot3statsframestoolong_lo; estats->etherstatsoverrsizepkts_hi = estats->etherstatsoverrsizepkts_hi + (estats->rx_stat_dot3statsframestoolong_hi + (estats->etherstatsoverrsizepkts_lo < estats->rx_stat_dot3statsframestoolong_lo ? 1U : 0U)); estats_old->rx_stat_dot3statsframestoolong_hi = estats->rx_stat_dot3statsframestoolong_hi; estats_old->rx_stat_dot3statsframestoolong_lo = estats->rx_stat_dot3statsframestoolong_lo; estats->error_bytes_received_lo = estats->error_bytes_received_lo + estats->rx_stat_ifhcinbadoctets_lo; estats->error_bytes_received_hi = estats->error_bytes_received_hi + (estats->rx_stat_ifhcinbadoctets_hi + (estats->error_bytes_received_lo < estats->rx_stat_ifhcinbadoctets_lo ? 1U : 0U)); if (bp->port.pmf != 0U) { fwstats = & bp->fw_stats_old; estats->mac_filter_discard = tport->mac_filter_discard + fwstats->mac_filter_discard; estats->mf_tag_discard = tport->mf_tag_discard + fwstats->mf_tag_discard; estats->brb_truncate_discard = tport->brb_truncate_discard + fwstats->brb_truncate_discard; estats->mac_discard = tport->mac_discard + fwstats->mac_discard; } else { } fstats->host_func_stats_end = fstats->host_func_stats_end + 1U; fstats->host_func_stats_start = fstats->host_func_stats_end; bp->stats_pending = 0U; return (0); } } static void bnx2x_net_stats_update(struct bnx2x *bp ) { struct bnx2x_eth_stats *estats ; struct net_device_stats *nstats ; unsigned long tmp ; int i ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; struct tstorm_per_queue_stats *old_tclient ; long tmp___8 ; long tmp___9 ; long tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; long tmp___14 ; long tmp___15 ; long tmp___16 ; long tmp___17 ; long tmp___18 ; long tmp___19 ; long tmp___20 ; { estats = & bp->eth_stats; nstats = & (bp->dev)->stats; tmp___0 = bnx2x_hilo(& estats->total_unicast_packets_received_hi); tmp___1 = bnx2x_hilo(& estats->total_multicast_packets_received_hi); tmp___2 = bnx2x_hilo(& estats->total_broadcast_packets_received_hi); nstats->rx_packets = (unsigned long )((tmp___0 + tmp___1) + tmp___2); tmp___3 = bnx2x_hilo(& estats->total_unicast_packets_transmitted_hi); tmp___4 = bnx2x_hilo(& estats->total_multicast_packets_transmitted_hi); tmp___5 = bnx2x_hilo(& estats->total_broadcast_packets_transmitted_hi); nstats->tx_packets = (unsigned long )((tmp___3 + tmp___4) + tmp___5); tmp___6 = bnx2x_hilo(& estats->total_bytes_received_hi); nstats->rx_bytes = (unsigned long )tmp___6; tmp___7 = bnx2x_hilo(& estats->total_bytes_transmitted_hi); nstats->tx_bytes = (unsigned long )tmp___7; tmp = (unsigned long )estats->mac_discard; i = 0; goto ldv_51726; ldv_51725: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { old_tclient = & (bp->fp_stats + (unsigned long )i)->old_tclient; tmp = (unsigned long )old_tclient->checksum_discard + tmp; } i = i + 1; ldv_51726: ; if (bp->num_queues > i) { goto ldv_51725; } else { } nstats->rx_dropped = (unsigned long )bp->net_stats_old.rx_dropped + tmp; nstats->tx_dropped = 0UL; tmp___8 = bnx2x_hilo(& estats->total_multicast_packets_received_hi); nstats->multicast = (unsigned long )tmp___8; tmp___9 = bnx2x_hilo(& estats->tx_stat_etherstatscollisions_hi); nstats->collisions = (unsigned long )tmp___9; tmp___10 = bnx2x_hilo(& estats->rx_stat_etherstatsundersizepkts_hi); tmp___11 = bnx2x_hilo(& estats->etherstatsoverrsizepkts_hi); nstats->rx_length_errors = (unsigned long )(tmp___10 + tmp___11); tmp___12 = bnx2x_hilo(& estats->brb_drop_hi); tmp___13 = bnx2x_hilo(& estats->brb_truncate_hi); nstats->rx_over_errors = (unsigned long )(tmp___12 + tmp___13); tmp___14 = bnx2x_hilo(& estats->rx_stat_dot3statsfcserrors_hi); nstats->rx_crc_errors = (unsigned long )tmp___14; tmp___15 = bnx2x_hilo(& estats->rx_stat_dot3statsalignmenterrors_hi); nstats->rx_frame_errors = (unsigned long )tmp___15; tmp___16 = bnx2x_hilo(& estats->no_buff_discard_hi); nstats->rx_fifo_errors = (unsigned long )tmp___16; nstats->rx_missed_errors = 0UL; nstats->rx_errors = ((((nstats->rx_length_errors + nstats->rx_over_errors) + nstats->rx_crc_errors) + nstats->rx_frame_errors) + nstats->rx_fifo_errors) + nstats->rx_missed_errors; tmp___17 = bnx2x_hilo(& estats->tx_stat_dot3statslatecollisions_hi); tmp___18 = bnx2x_hilo(& estats->tx_stat_dot3statsexcessivecollisions_hi); nstats->tx_aborted_errors = (unsigned long )(tmp___17 + tmp___18); tmp___19 = bnx2x_hilo(& estats->rx_stat_dot3statscarriersenseerrors_hi); nstats->tx_carrier_errors = (unsigned long )tmp___19; nstats->tx_fifo_errors = 0UL; nstats->tx_heartbeat_errors = 0UL; nstats->tx_window_errors = 0UL; tmp___20 = bnx2x_hilo(& estats->tx_stat_dot3statsinternalmactransmiterrors_hi); nstats->tx_errors = (nstats->tx_aborted_errors + nstats->tx_carrier_errors) + (unsigned long )tmp___20; return; } } static void bnx2x_drv_stats_update(struct bnx2x *bp ) { struct bnx2x_eth_stats *estats ; int i ; struct bnx2x_eth_q_stats *qstats ; struct bnx2x_eth_q_stats_old *qstats_old ; { estats = & bp->eth_stats; i = 0; goto ldv_51737; ldv_51736: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { qstats = & (bp->fp_stats + (unsigned long )i)->eth_q_stats; qstats_old = & (bp->fp_stats + (unsigned long )i)->eth_q_stats_old; estats->driver_xoff = estats->driver_xoff + qstats->driver_xoff; estats->driver_xoff = estats->driver_xoff - qstats_old->driver_xoff_old; qstats_old->driver_xoff_old = qstats->driver_xoff; estats->rx_err_discard_pkt = estats->rx_err_discard_pkt + qstats->rx_err_discard_pkt; estats->rx_err_discard_pkt = estats->rx_err_discard_pkt - qstats_old->rx_err_discard_pkt_old; qstats_old->rx_err_discard_pkt_old = qstats->rx_err_discard_pkt; estats->rx_skb_alloc_failed = estats->rx_skb_alloc_failed + qstats->rx_skb_alloc_failed; estats->rx_skb_alloc_failed = estats->rx_skb_alloc_failed - qstats_old->rx_skb_alloc_failed_old; qstats_old->rx_skb_alloc_failed_old = qstats->rx_skb_alloc_failed; estats->hw_csum_err = estats->hw_csum_err + qstats->hw_csum_err; estats->hw_csum_err = estats->hw_csum_err - qstats_old->hw_csum_err_old; qstats_old->hw_csum_err_old = qstats->hw_csum_err; estats->driver_filtered_tx_pkt = estats->driver_filtered_tx_pkt + qstats->driver_filtered_tx_pkt; estats->driver_filtered_tx_pkt = estats->driver_filtered_tx_pkt - qstats_old->driver_filtered_tx_pkt_old; qstats_old->driver_filtered_tx_pkt_old = qstats->driver_filtered_tx_pkt; } i = i + 1; ldv_51737: ; if (bp->num_queues > i) { goto ldv_51736; } else { } return; } } static bool bnx2x_edebug_stats_stopped(struct bnx2x *bp ) { u32 val ; unsigned int tmp ; { if (bp->common.shmem2_base != 0U) { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp > 108U) { val = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 108UL))); if (val == 3U) { return (1); } else { } } else { } } else { } return (0); } } static void bnx2x_stats_update(struct bnx2x *bp ) { u32 *stats_comp ; bool tmp ; u16 tmp___0 ; int tmp___1 ; struct bnx2x_eth_stats *estats ; struct _ddebug descriptor ; long tmp___2 ; { stats_comp = & (bp->slowpath)->stats_comp; tmp = bnx2x_edebug_stats_stopped(bp); if ((int )tmp) { return; } else { } if ((bp->flags & 4194304U) == 0U) { if (*stats_comp != 1624297646U) { return; } else { } if (bp->port.pmf != 0U) { bnx2x_hw_stats_update(bp); } else { } tmp___1 = bnx2x_storm_stats_update(bp); if (tmp___1 != 0) { tmp___0 = bp->stats_pending; bp->stats_pending = (u16 )((int )bp->stats_pending + 1); if ((unsigned int )tmp___0 == 3U) { printk("\vbnx2x: [%s:%d(%s)]storm stats were not updated for 3 times\n", "bnx2x_stats_update", 1230, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_stats_update", 1231, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); } else { } return; } else { } } else { bnx2x_storm_stats_update(bp); } bnx2x_net_stats_update(bp); bnx2x_drv_stats_update(bp); if ((bp->flags & 4194304U) != 0U) { return; } else { } if ((bp->msg_enable & 8) != 0) { estats = & bp->eth_stats; descriptor.modname = "bnx2x"; descriptor.function = "bnx2x_stats_update"; descriptor.filename = "/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c"; descriptor.format = "brb drops %u brb truncate %u\n"; descriptor.lineno = 1253U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_netdev_dbg(& descriptor, (struct net_device const *)bp->dev, "brb drops %u brb truncate %u\n", estats->brb_drop_lo, estats->brb_truncate_lo); } else { } } else { } bnx2x_hw_stats_post(bp); bnx2x_storm_stats_post(bp); return; } } static void bnx2x_port_stats_stop(struct bnx2x *bp ) { struct dmae_command *dmae ; u32 opcode ; int loader_idx ; u32 *stats_comp ; int tmp ; int tmp___0 ; { loader_idx = ((int )bp->pfid & 1) * 8 + 4; stats_comp = & (bp->slowpath)->stats_comp; bp->executer_idx = 0; opcode = bnx2x_dmae_opcode(bp, 0, 2, 0, 0); if (bp->port.port_stx != 0U) { tmp = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp; if (bp->func_stx != 0U) { dmae->opcode = bnx2x_dmae_opcode_add_comp(opcode, 1); } else { dmae->opcode = bnx2x_dmae_opcode_add_comp(opcode, 0); } dmae->src_addr_lo = (unsigned int )bp->slowpath_mapping + 3684U; dmae->src_addr_hi = (unsigned int )((bp->slowpath_mapping + 3684ULL) >> 32); dmae->dst_addr_lo = bp->port.port_stx >> 2; dmae->dst_addr_hi = 0U; dmae->len = bnx2x_get_port_stats_dma_len(bp); if (bp->func_stx != 0U) { dmae->comp_addr_lo = dmae_reg_go_c___0[loader_idx] >> 2; dmae->comp_addr_hi = 0U; dmae->comp_val = 1U; } else { dmae->comp_addr_lo = (unsigned int )bp->slowpath_mapping + 3152U; dmae->comp_addr_hi = (unsigned int )((bp->slowpath_mapping + 3152ULL) >> 32); dmae->comp_val = 1624297646U; *stats_comp = 0U; } } else { } if (bp->func_stx != 0U) { tmp___0 = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp___0; dmae->opcode = bnx2x_dmae_opcode_add_comp(opcode, 0); dmae->src_addr_lo = (unsigned int )bp->slowpath_mapping + 4332U; dmae->src_addr_hi = (unsigned int )((bp->slowpath_mapping + 4332ULL) >> 32); dmae->dst_addr_lo = bp->func_stx >> 2; dmae->dst_addr_hi = 0U; dmae->len = 20U; dmae->comp_addr_lo = (unsigned int )bp->slowpath_mapping + 3152U; dmae->comp_addr_hi = (unsigned int )((bp->slowpath_mapping + 3152ULL) >> 32); dmae->comp_val = 1624297646U; *stats_comp = 0U; } else { } return; } } static void bnx2x_stats_stop(struct bnx2x *bp ) { bool update ; int tmp ; int tmp___0 ; { update = 0; bnx2x_stats_comp(bp); if (bp->port.pmf != 0U) { tmp = bnx2x_hw_stats_update(bp); update = tmp == 0; } else { } tmp___0 = bnx2x_storm_stats_update(bp); update = ((int )update | (tmp___0 == 0)) != 0; if ((int )update) { bnx2x_net_stats_update(bp); if (bp->port.pmf != 0U) { bnx2x_port_stats_stop(bp); } else { } bnx2x_hw_stats_post(bp); bnx2x_stats_comp(bp); } else { } return; } } static void bnx2x_stats_do_nothing(struct bnx2x *bp ) { { return; } } static struct __anonstruct_bnx2x_stats_stm_366 const bnx2x_stats_stm[2U][4U] = { { {& bnx2x_stats_pmf_update, 0}, {& bnx2x_stats_start, 1}, {& bnx2x_stats_do_nothing, 0}, {& bnx2x_stats_do_nothing, 0}}, { {& bnx2x_stats_pmf_start, 1}, {& bnx2x_stats_restart, 1}, {& bnx2x_stats_update, 1}, {& bnx2x_stats_stop, 0}}}; void bnx2x_stats_handle(struct bnx2x *bp , enum bnx2x_stats_event event ) { enum bnx2x_stats_state state ; long tmp ; long tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; long tmp___4 ; { state = (enum bnx2x_stats_state )bp->stats_state; tmp = ldv__builtin_expect(bp->panic != 0, 0L); if (tmp != 0L) { return; } else { } tmp___3 = down_trylock(& bp->stats_lock); if (tmp___3 != 0) { if ((unsigned int )event == 2U) { return; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Unlikely stats\' lock contention [event %d]\n", "bnx2x_stats_handle", 1380, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )event); } else { } tmp___1 = down_timeout(& bp->stats_lock, 25L); tmp___2 = ldv__builtin_expect(tmp___1 != 0, 0L); if (tmp___2 != 0L) { printk("\vbnx2x: [%s:%d(%s)]Failed to take stats lock [event %d]\n", "bnx2x_stats_handle", 1383, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )event); return; } else { } } else { } (*(bnx2x_stats_stm[(unsigned int )state][(unsigned int )event].action))(bp); bp->stats_state = (int )bnx2x_stats_stm[(unsigned int )state][(unsigned int )event].next_state; up(& bp->stats_lock); if ((unsigned int )event != 2U || (bp->msg_enable & 8) != 0) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]state %d -> event %d -> state %d\n", "bnx2x_stats_handle", 1395, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state, (unsigned int )event, bp->stats_state); } else { } } else { } return; } } static void bnx2x_port_stats_base_init(struct bnx2x *bp ) { struct dmae_command *dmae ; u32 *stats_comp ; int tmp ; { stats_comp = & (bp->slowpath)->stats_comp; if (bp->port.pmf == 0U || bp->port.port_stx == 0U) { printk("\vbnx2x: [%s:%d(%s)]BUG!\n", "bnx2x_port_stats_base_init", 1405, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } bp->executer_idx = 0; tmp = bp->executer_idx; bp->executer_idx = bp->executer_idx + 1; dmae = (struct dmae_command *)(& (bp->slowpath)->dmae) + (unsigned long )tmp; dmae->opcode = bnx2x_dmae_opcode(bp, 0, 2, 1, 0); dmae->src_addr_lo = (unsigned int )bp->slowpath_mapping + 3684U; dmae->src_addr_hi = (unsigned int )((bp->slowpath_mapping + 3684ULL) >> 32); dmae->dst_addr_lo = bp->port.port_stx >> 2; dmae->dst_addr_hi = 0U; dmae->len = bnx2x_get_port_stats_dma_len(bp); dmae->comp_addr_lo = (unsigned int )bp->slowpath_mapping + 3152U; dmae->comp_addr_hi = (unsigned int )((bp->slowpath_mapping + 3152ULL) >> 32); dmae->comp_val = 1624297646U; *stats_comp = 0U; bnx2x_hw_stats_post(bp); bnx2x_stats_comp(bp); return; } } static void bnx2x_prep_fw_stats_req(struct bnx2x *bp ) { int i ; int first_queue_query_index ; struct stats_query_header *stats_hdr ; dma_addr_t cur_data_offset ; struct stats_query_entry *cur_query_entry ; { stats_hdr = & (bp->fw_stats_req)->hdr; stats_hdr->cmd_num = bp->fw_stats_num; stats_hdr->drv_stats_counter = 0U; cur_data_offset = bp->fw_stats_data_mapping; stats_hdr->stats_counters_addrs.hi = (unsigned int )(cur_data_offset >> 32); stats_hdr->stats_counters_addrs.lo = (unsigned int )cur_data_offset; memset((void *)(& (bp->fw_stats_data)->storm_counters), 255, 32UL); cur_data_offset = bp->fw_stats_data_mapping + 32ULL; cur_query_entry = (struct stats_query_entry *)(& (bp->fw_stats_req)->query); cur_query_entry->kind = 1U; cur_query_entry->index = (unsigned int )bp->pfid & 1U; cur_query_entry->funcID = (unsigned short )bp->pfid; cur_query_entry->address.hi = (unsigned int )(cur_data_offset >> 32); cur_query_entry->address.lo = (unsigned int )cur_data_offset; cur_data_offset = bp->fw_stats_data_mapping + 56ULL; cur_query_entry = (struct stats_query_entry *)(& (bp->fw_stats_req)->query) + 1UL; cur_query_entry->kind = 2U; cur_query_entry->index = (unsigned int )bp->pfid & 1U; cur_query_entry->funcID = (unsigned short )bp->pfid; cur_query_entry->address.hi = (unsigned int )(cur_data_offset >> 32); cur_query_entry->address.lo = (unsigned int )cur_data_offset; if ((bp->flags & 32768U) == 0U) { cur_data_offset = bp->fw_stats_data_mapping + 64ULL; cur_query_entry = (struct stats_query_entry *)(& (bp->fw_stats_req)->query) + 2UL; cur_query_entry->kind = 4U; cur_query_entry->index = (unsigned int )bp->pfid & 1U; cur_query_entry->funcID = (unsigned short )bp->pfid; cur_query_entry->address.hi = (unsigned int )(cur_data_offset >> 32); cur_query_entry->address.lo = (unsigned int )cur_data_offset; } else { } cur_data_offset = bp->fw_stats_data_mapping + 128ULL; if ((bp->flags & 32768U) == 0U) { first_queue_query_index = 3; } else { first_queue_query_index = 2; } i = 0; goto ldv_51790; ldv_51789: cur_query_entry = (struct stats_query_entry *)(& (bp->fw_stats_req)->query) + (unsigned long )(first_queue_query_index + i); cur_query_entry->kind = 0U; cur_query_entry->index = bnx2x_stats_id(bp->fp + (unsigned long )i); cur_query_entry->funcID = (unsigned short )bp->pfid; cur_query_entry->address.hi = (unsigned int )(cur_data_offset >> 32); cur_query_entry->address.lo = (unsigned int )cur_data_offset; cur_data_offset = cur_data_offset + 152ULL; i = i + 1; ldv_51790: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_51789; } else { } if ((bp->flags & 32768U) == 0U) { cur_query_entry = (struct stats_query_entry *)(& (bp->fw_stats_req)->query) + (unsigned long )(first_queue_query_index + i); cur_query_entry->kind = 0U; cur_query_entry->index = bnx2x_stats_id(bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues)); cur_query_entry->funcID = (unsigned short )bp->pfid; cur_query_entry->address.hi = (unsigned int )(cur_data_offset >> 32); cur_query_entry->address.lo = (unsigned int )cur_data_offset; } else { } return; } } void bnx2x_memset_stats(struct bnx2x *bp ) { int i ; struct bnx2x_fp_stats *fp_stats ; { i = 0; goto ldv_51799; ldv_51798: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { fp_stats = bp->fp_stats + (unsigned long )i; memset((void *)(& fp_stats->old_tclient), 0, 56UL); memset((void *)(& fp_stats->old_uclient), 0, 56UL); memset((void *)(& fp_stats->old_xclient), 0, 40UL); if ((int )bp->stats_init) { memset((void *)(& fp_stats->eth_q_stats), 0, 204UL); memset((void *)(& fp_stats->eth_q_stats_old), 0, 156UL); } else { } } i = i + 1; ldv_51799: ; if (bp->num_queues > i) { goto ldv_51798; } else { } memset((void *)(& (bp->dev)->stats), 0, 184UL); if ((int )bp->stats_init) { memset((void *)(& bp->net_stats_old), 0, 4UL); memset((void *)(& bp->fw_stats_old), 0, 16UL); memset((void *)(& bp->eth_stats_old), 0, 8UL); memset((void *)(& bp->eth_stats), 0, 540UL); memset((void *)(& bp->func_stats), 0, 80UL); } else { } bp->stats_state = 0; if (bp->port.pmf != 0U && bp->port.port_stx != 0U) { bnx2x_port_stats_base_init(bp); } else { } bp->stats_init = 0; return; } } void bnx2x_stats_init(struct bnx2x *bp ) { int port ; int mb_idx ; long tmp ; { port = (int )bp->pfid & 1; mb_idx = ((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1); if ((bp->flags & 4194304U) != 0U) { bnx2x_memset_stats(bp); return; } else { } bp->stats_pending = 0U; bp->executer_idx = 0; bp->stats_counter = 0U; if ((bp->flags & 512U) == 0U) { bp->port.port_stx = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )port * 16UL) + 1640UL))); bp->func_stx = readl((void const volatile *)(bp->regview + (((unsigned long )bp->common.shmem_base + (unsigned long )mb_idx * 44UL) + 1680UL))); } else { bp->port.port_stx = 0U; bp->func_stx = 0U; } tmp = ldv__builtin_expect((bp->msg_enable & 131072) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]port_stx 0x%x func_stx 0x%x\n", "bnx2x_stats_init", 1618, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->port.port_stx, bp->func_stx); } else { } if ((! bp->stats_init && bp->port.pmf != 0U) && bp->port.port_stx != 0U) { bnx2x_stats_handle(bp, 0); } else { } port = (int )bp->pfid & 1; memset((void *)(& bp->port.old_nig_stats), 0, 72UL); bp->port.old_nig_stats.brb_discard = readl((void const volatile *)bp->regview + (unsigned long )(port * 56 + 67056)); bp->port.old_nig_stats.brb_truncate = readl((void const volatile *)bp->regview + (unsigned long )(port * 56 + 67064)); if (((((((((bp->common.chip_id >> 16 != 5770U && bp->common.chip_id >> 16 != 5797U) && bp->common.chip_id >> 16 != 5801U) && bp->common.chip_id >> 16 != 5774U) && bp->common.chip_id >> 16 != 5806U) && bp->common.chip_id >> 16 != 5807U) && ((bp->common.chip_id >> 16 != 5693U && bp->common.chip_id >> 16 != 5694U) && bp->common.chip_id >> 16 != 5695U)) && ((bp->common.chip_id >> 16 != 5793U && bp->common.chip_id >> 16 != 5794U) && bp->common.chip_id >> 16 != 5773U)) && (bp->common.chip_id >> 16 != 5796U && bp->common.chip_id >> 16 != 5803U)) && bp->common.chip_id >> 16 != 5805U) { bnx2x_read_dmae(bp, (u32 )(port * 80 + 67408), 2U); memcpy((void *)(& bp->port.old_nig_stats.egress_mac_pkt0_lo), (void const *)(& (bp->slowpath)->wb_data), 8UL); bnx2x_read_dmae(bp, (u32 )(port * 80 + 67424), 2U); memcpy((void *)(& bp->port.old_nig_stats.egress_mac_pkt1_lo), (void const *)(& (bp->slowpath)->wb_data), 8UL); } else { } bnx2x_prep_fw_stats_req(bp); if ((int )bp->stats_init) { if (bp->func_stx != 0U) { memset((void *)(& (bp->slowpath)->func_stats), 0, 80UL); bnx2x_func_stats_init(bp); bnx2x_hw_stats_post(bp); bnx2x_stats_comp(bp); } else { } } else { } bnx2x_memset_stats(bp); return; } } void bnx2x_save_statistics(struct bnx2x *bp ) { int i ; struct net_device_stats *nstats ; struct bnx2x_fastpath *fp ; struct bnx2x_eth_q_stats *qstats ; struct bnx2x_eth_q_stats_old *qstats_old ; struct bnx2x_eth_stats *estats ; struct bnx2x_fw_port_stats_old *fwstats ; { nstats = & (bp->dev)->stats; i = 0; goto ldv_51816; ldv_51815: fp = bp->fp + (unsigned long )i; qstats = & (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats; qstats_old = & (bp->fp_stats + (unsigned long )fp->index)->eth_q_stats_old; qstats_old->total_unicast_bytes_received_hi = qstats->total_unicast_bytes_received_hi; qstats_old->total_unicast_bytes_received_lo = qstats->total_unicast_bytes_received_lo; qstats_old->total_broadcast_bytes_received_hi = qstats->total_broadcast_bytes_received_hi; qstats_old->total_broadcast_bytes_received_lo = qstats->total_broadcast_bytes_received_lo; qstats_old->total_multicast_bytes_received_hi = qstats->total_multicast_bytes_received_hi; qstats_old->total_multicast_bytes_received_lo = qstats->total_multicast_bytes_received_lo; qstats_old->total_unicast_bytes_transmitted_hi = qstats->total_unicast_bytes_transmitted_hi; qstats_old->total_unicast_bytes_transmitted_lo = qstats->total_unicast_bytes_transmitted_lo; qstats_old->total_broadcast_bytes_transmitted_hi = qstats->total_broadcast_bytes_transmitted_hi; qstats_old->total_broadcast_bytes_transmitted_lo = qstats->total_broadcast_bytes_transmitted_lo; qstats_old->total_multicast_bytes_transmitted_hi = qstats->total_multicast_bytes_transmitted_hi; qstats_old->total_multicast_bytes_transmitted_lo = qstats->total_multicast_bytes_transmitted_lo; qstats_old->total_tpa_bytes_hi = qstats->total_tpa_bytes_hi; qstats_old->total_tpa_bytes_lo = qstats->total_tpa_bytes_lo; i = i + 1; ldv_51816: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_51815; } else { } bp->net_stats_old.rx_dropped = (u32 )nstats->rx_dropped; if (bp->port.pmf != 0U && (unsigned int )bp->mf_mode != 0U) { estats = & bp->eth_stats; fwstats = & bp->fw_stats_old; fwstats->mac_filter_discard = estats->mac_filter_discard; fwstats->mf_tag_discard = estats->mf_tag_discard; fwstats->brb_truncate_discard = estats->brb_truncate_discard; fwstats->mac_discard = estats->mac_discard; } else { } return; } } void bnx2x_afex_collect_stats(struct bnx2x *bp , void *void_afex_stats , u32 stats_type ) { int i ; struct afex_stats *afex_stats ; struct bnx2x_eth_stats *estats ; struct per_queue_stats *fcoe_q_stats ; struct tstorm_per_queue_stats *fcoe_q_tstorm_stats ; struct ustorm_per_queue_stats *fcoe_q_ustorm_stats ; struct xstorm_per_queue_stats *fcoe_q_xstorm_stats ; struct fcoe_statistics_params *fw_fcoe_stat ; struct bnx2x_eth_q_stats *qstats ; { afex_stats = (struct afex_stats *)void_afex_stats; estats = & bp->eth_stats; fcoe_q_stats = (struct per_queue_stats *)(& (bp->fw_stats_data)->queue_stats) + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues); fcoe_q_tstorm_stats = & fcoe_q_stats->tstorm_queue_statistics; fcoe_q_ustorm_stats = & fcoe_q_stats->ustorm_queue_statistics; fcoe_q_xstorm_stats = & fcoe_q_stats->xstorm_queue_statistics; fw_fcoe_stat = & (bp->fw_stats_data)->fcoe; memset((void *)afex_stats, 0, 128UL); i = 0; goto ldv_51835; ldv_51834: qstats = & (bp->fp_stats + (unsigned long )i)->eth_q_stats; afex_stats->rx_unicast_bytes_lo = afex_stats->rx_unicast_bytes_lo + qstats->total_unicast_bytes_received_lo; afex_stats->rx_unicast_bytes_hi = afex_stats->rx_unicast_bytes_hi + (qstats->total_unicast_bytes_received_hi + (afex_stats->rx_unicast_bytes_lo < qstats->total_unicast_bytes_received_lo ? 1U : 0U)); afex_stats->rx_broadcast_bytes_lo = afex_stats->rx_broadcast_bytes_lo + qstats->total_broadcast_bytes_received_lo; afex_stats->rx_broadcast_bytes_hi = afex_stats->rx_broadcast_bytes_hi + (qstats->total_broadcast_bytes_received_hi + (afex_stats->rx_broadcast_bytes_lo < qstats->total_broadcast_bytes_received_lo ? 1U : 0U)); afex_stats->rx_multicast_bytes_lo = afex_stats->rx_multicast_bytes_lo + qstats->total_multicast_bytes_received_lo; afex_stats->rx_multicast_bytes_hi = afex_stats->rx_multicast_bytes_hi + (qstats->total_multicast_bytes_received_hi + (afex_stats->rx_multicast_bytes_lo < qstats->total_multicast_bytes_received_lo ? 1U : 0U)); afex_stats->rx_unicast_frames_lo = afex_stats->rx_unicast_frames_lo + qstats->total_unicast_packets_received_lo; afex_stats->rx_unicast_frames_hi = afex_stats->rx_unicast_frames_hi + (qstats->total_unicast_packets_received_hi + (afex_stats->rx_unicast_frames_lo < qstats->total_unicast_packets_received_lo ? 1U : 0U)); afex_stats->rx_broadcast_frames_lo = afex_stats->rx_broadcast_frames_lo + qstats->total_broadcast_packets_received_lo; afex_stats->rx_broadcast_frames_hi = afex_stats->rx_broadcast_frames_hi + (qstats->total_broadcast_packets_received_hi + (afex_stats->rx_broadcast_frames_lo < qstats->total_broadcast_packets_received_lo ? 1U : 0U)); afex_stats->rx_multicast_frames_lo = afex_stats->rx_multicast_frames_lo + qstats->total_multicast_packets_received_lo; afex_stats->rx_multicast_frames_hi = afex_stats->rx_multicast_frames_hi + (qstats->total_multicast_packets_received_hi + (afex_stats->rx_multicast_frames_lo < qstats->total_multicast_packets_received_lo ? 1U : 0U)); afex_stats->rx_frames_discarded_lo = afex_stats->rx_frames_discarded_lo + qstats->total_packets_received_checksum_discarded_lo; afex_stats->rx_frames_discarded_hi = afex_stats->rx_frames_discarded_hi + (qstats->total_packets_received_checksum_discarded_hi + (afex_stats->rx_frames_discarded_lo < qstats->total_packets_received_checksum_discarded_lo ? 1U : 0U)); afex_stats->rx_frames_discarded_lo = afex_stats->rx_frames_discarded_lo + qstats->total_packets_received_ttl0_discarded_lo; afex_stats->rx_frames_discarded_hi = afex_stats->rx_frames_discarded_hi + (qstats->total_packets_received_ttl0_discarded_hi + (afex_stats->rx_frames_discarded_lo < qstats->total_packets_received_ttl0_discarded_lo ? 1U : 0U)); afex_stats->rx_frames_discarded_lo = afex_stats->rx_frames_discarded_lo + qstats->etherstatsoverrsizepkts_lo; afex_stats->rx_frames_discarded_hi = afex_stats->rx_frames_discarded_hi + (qstats->etherstatsoverrsizepkts_hi + (afex_stats->rx_frames_discarded_lo < qstats->etherstatsoverrsizepkts_lo ? 1U : 0U)); afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + qstats->no_buff_discard_lo; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (qstats->no_buff_discard_hi + (afex_stats->rx_frames_dropped_lo < qstats->no_buff_discard_lo ? 1U : 0U)); afex_stats->tx_unicast_bytes_lo = afex_stats->tx_unicast_bytes_lo + qstats->total_unicast_bytes_transmitted_lo; afex_stats->tx_unicast_bytes_hi = afex_stats->tx_unicast_bytes_hi + (qstats->total_unicast_bytes_transmitted_hi + (afex_stats->tx_unicast_bytes_lo < qstats->total_unicast_bytes_transmitted_lo ? 1U : 0U)); afex_stats->tx_broadcast_bytes_lo = afex_stats->tx_broadcast_bytes_lo + qstats->total_broadcast_bytes_transmitted_lo; afex_stats->tx_broadcast_bytes_hi = afex_stats->tx_broadcast_bytes_hi + (qstats->total_broadcast_bytes_transmitted_hi + (afex_stats->tx_broadcast_bytes_lo < qstats->total_broadcast_bytes_transmitted_lo ? 1U : 0U)); afex_stats->tx_multicast_bytes_lo = afex_stats->tx_multicast_bytes_lo + qstats->total_multicast_bytes_transmitted_lo; afex_stats->tx_multicast_bytes_hi = afex_stats->tx_multicast_bytes_hi + (qstats->total_multicast_bytes_transmitted_hi + (afex_stats->tx_multicast_bytes_lo < qstats->total_multicast_bytes_transmitted_lo ? 1U : 0U)); afex_stats->tx_unicast_frames_lo = afex_stats->tx_unicast_frames_lo + qstats->total_unicast_packets_transmitted_lo; afex_stats->tx_unicast_frames_hi = afex_stats->tx_unicast_frames_hi + (qstats->total_unicast_packets_transmitted_hi + (afex_stats->tx_unicast_frames_lo < qstats->total_unicast_packets_transmitted_lo ? 1U : 0U)); afex_stats->tx_broadcast_frames_lo = afex_stats->tx_broadcast_frames_lo + qstats->total_broadcast_packets_transmitted_lo; afex_stats->tx_broadcast_frames_hi = afex_stats->tx_broadcast_frames_hi + (qstats->total_broadcast_packets_transmitted_hi + (afex_stats->tx_broadcast_frames_lo < qstats->total_broadcast_packets_transmitted_lo ? 1U : 0U)); afex_stats->tx_multicast_frames_lo = afex_stats->tx_multicast_frames_lo + qstats->total_multicast_packets_transmitted_lo; afex_stats->tx_multicast_frames_hi = afex_stats->tx_multicast_frames_hi + (qstats->total_multicast_packets_transmitted_hi + (afex_stats->tx_multicast_frames_lo < qstats->total_multicast_packets_transmitted_lo ? 1U : 0U)); afex_stats->tx_frames_dropped_lo = afex_stats->tx_frames_dropped_lo + qstats->total_transmitted_dropped_packets_error_lo; afex_stats->tx_frames_dropped_hi = afex_stats->tx_frames_dropped_hi + (qstats->total_transmitted_dropped_packets_error_hi + (afex_stats->tx_frames_dropped_lo < qstats->total_transmitted_dropped_packets_error_lo ? 1U : 0U)); i = i + 1; ldv_51835: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_51834; } else { } if ((bp->flags & 32768U) == 0U) { afex_stats->rx_unicast_bytes_lo = afex_stats->rx_unicast_bytes_lo + fw_fcoe_stat->rx_stat0.fcoe_rx_byte_cnt; afex_stats->rx_unicast_bytes_hi = afex_stats->rx_unicast_bytes_hi + (afex_stats->rx_unicast_bytes_lo < fw_fcoe_stat->rx_stat0.fcoe_rx_byte_cnt ? 1U : 0U); afex_stats->rx_unicast_bytes_lo = afex_stats->rx_unicast_bytes_lo + fcoe_q_tstorm_stats->rcv_ucast_bytes.lo; afex_stats->rx_unicast_bytes_hi = afex_stats->rx_unicast_bytes_hi + (fcoe_q_tstorm_stats->rcv_ucast_bytes.hi + (afex_stats->rx_unicast_bytes_lo < fcoe_q_tstorm_stats->rcv_ucast_bytes.lo ? 1U : 0U)); afex_stats->rx_broadcast_bytes_lo = afex_stats->rx_broadcast_bytes_lo + fcoe_q_tstorm_stats->rcv_bcast_bytes.lo; afex_stats->rx_broadcast_bytes_hi = afex_stats->rx_broadcast_bytes_hi + (fcoe_q_tstorm_stats->rcv_bcast_bytes.hi + (afex_stats->rx_broadcast_bytes_lo < fcoe_q_tstorm_stats->rcv_bcast_bytes.lo ? 1U : 0U)); afex_stats->rx_multicast_bytes_lo = afex_stats->rx_multicast_bytes_lo + fcoe_q_tstorm_stats->rcv_mcast_bytes.lo; afex_stats->rx_multicast_bytes_hi = afex_stats->rx_multicast_bytes_hi + (fcoe_q_tstorm_stats->rcv_mcast_bytes.hi + (afex_stats->rx_multicast_bytes_lo < fcoe_q_tstorm_stats->rcv_mcast_bytes.lo ? 1U : 0U)); afex_stats->rx_unicast_frames_lo = afex_stats->rx_unicast_frames_lo + fw_fcoe_stat->rx_stat0.fcoe_rx_pkt_cnt; afex_stats->rx_unicast_frames_hi = afex_stats->rx_unicast_frames_hi + (afex_stats->rx_unicast_frames_lo < fw_fcoe_stat->rx_stat0.fcoe_rx_pkt_cnt ? 1U : 0U); afex_stats->rx_unicast_frames_lo = afex_stats->rx_unicast_frames_lo + fcoe_q_tstorm_stats->rcv_ucast_pkts; afex_stats->rx_unicast_frames_hi = afex_stats->rx_unicast_frames_hi + (afex_stats->rx_unicast_frames_lo < fcoe_q_tstorm_stats->rcv_ucast_pkts ? 1U : 0U); afex_stats->rx_broadcast_frames_lo = afex_stats->rx_broadcast_frames_lo + fcoe_q_tstorm_stats->rcv_bcast_pkts; afex_stats->rx_broadcast_frames_hi = afex_stats->rx_broadcast_frames_hi + (afex_stats->rx_broadcast_frames_lo < fcoe_q_tstorm_stats->rcv_bcast_pkts ? 1U : 0U); afex_stats->rx_multicast_frames_lo = afex_stats->rx_multicast_frames_lo + fcoe_q_tstorm_stats->rcv_ucast_pkts; afex_stats->rx_multicast_frames_hi = afex_stats->rx_multicast_frames_hi + (afex_stats->rx_multicast_frames_lo < fcoe_q_tstorm_stats->rcv_ucast_pkts ? 1U : 0U); afex_stats->rx_frames_discarded_lo = afex_stats->rx_frames_discarded_lo + fcoe_q_tstorm_stats->checksum_discard; afex_stats->rx_frames_discarded_hi = afex_stats->rx_frames_discarded_hi + (afex_stats->rx_frames_discarded_lo < fcoe_q_tstorm_stats->checksum_discard ? 1U : 0U); afex_stats->rx_frames_discarded_lo = afex_stats->rx_frames_discarded_lo + fcoe_q_tstorm_stats->pkts_too_big_discard; afex_stats->rx_frames_discarded_hi = afex_stats->rx_frames_discarded_hi + (afex_stats->rx_frames_discarded_lo < fcoe_q_tstorm_stats->pkts_too_big_discard ? 1U : 0U); afex_stats->rx_frames_discarded_lo = afex_stats->rx_frames_discarded_lo + fcoe_q_tstorm_stats->ttl0_discard; afex_stats->rx_frames_discarded_hi = afex_stats->rx_frames_discarded_hi + (afex_stats->rx_frames_discarded_lo < fcoe_q_tstorm_stats->ttl0_discard ? 1U : 0U); afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + (u32 )fcoe_q_tstorm_stats->no_buff_discard; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (u32 )(afex_stats->rx_frames_dropped_lo < (u32 )fcoe_q_tstorm_stats->no_buff_discard); afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + fcoe_q_ustorm_stats->ucast_no_buff_pkts; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (afex_stats->rx_frames_dropped_lo < fcoe_q_ustorm_stats->ucast_no_buff_pkts ? 1U : 0U); afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + fcoe_q_ustorm_stats->mcast_no_buff_pkts; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (afex_stats->rx_frames_dropped_lo < fcoe_q_ustorm_stats->mcast_no_buff_pkts ? 1U : 0U); afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + fcoe_q_ustorm_stats->bcast_no_buff_pkts; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (afex_stats->rx_frames_dropped_lo < fcoe_q_ustorm_stats->bcast_no_buff_pkts ? 1U : 0U); afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + fw_fcoe_stat->rx_stat1.fcoe_rx_drop_pkt_cnt; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (afex_stats->rx_frames_dropped_lo < fw_fcoe_stat->rx_stat1.fcoe_rx_drop_pkt_cnt ? 1U : 0U); afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + fw_fcoe_stat->rx_stat2.fcoe_rx_drop_pkt_cnt; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (afex_stats->rx_frames_dropped_lo < fw_fcoe_stat->rx_stat2.fcoe_rx_drop_pkt_cnt ? 1U : 0U); afex_stats->tx_unicast_bytes_lo = afex_stats->tx_unicast_bytes_lo + fw_fcoe_stat->tx_stat.fcoe_tx_byte_cnt; afex_stats->tx_unicast_bytes_hi = afex_stats->tx_unicast_bytes_hi + (afex_stats->tx_unicast_bytes_lo < fw_fcoe_stat->tx_stat.fcoe_tx_byte_cnt ? 1U : 0U); afex_stats->tx_unicast_bytes_lo = afex_stats->tx_unicast_bytes_lo + fcoe_q_xstorm_stats->ucast_bytes_sent.lo; afex_stats->tx_unicast_bytes_hi = afex_stats->tx_unicast_bytes_hi + (fcoe_q_xstorm_stats->ucast_bytes_sent.hi + (afex_stats->tx_unicast_bytes_lo < fcoe_q_xstorm_stats->ucast_bytes_sent.lo ? 1U : 0U)); afex_stats->tx_broadcast_bytes_lo = afex_stats->tx_broadcast_bytes_lo + fcoe_q_xstorm_stats->bcast_bytes_sent.lo; afex_stats->tx_broadcast_bytes_hi = afex_stats->tx_broadcast_bytes_hi + (fcoe_q_xstorm_stats->bcast_bytes_sent.hi + (afex_stats->tx_broadcast_bytes_lo < fcoe_q_xstorm_stats->bcast_bytes_sent.lo ? 1U : 0U)); afex_stats->tx_multicast_bytes_lo = afex_stats->tx_multicast_bytes_lo + fcoe_q_xstorm_stats->mcast_bytes_sent.lo; afex_stats->tx_multicast_bytes_hi = afex_stats->tx_multicast_bytes_hi + (fcoe_q_xstorm_stats->mcast_bytes_sent.hi + (afex_stats->tx_multicast_bytes_lo < fcoe_q_xstorm_stats->mcast_bytes_sent.lo ? 1U : 0U)); afex_stats->tx_unicast_frames_lo = afex_stats->tx_unicast_frames_lo + fw_fcoe_stat->tx_stat.fcoe_tx_pkt_cnt; afex_stats->tx_unicast_frames_hi = afex_stats->tx_unicast_frames_hi + (afex_stats->tx_unicast_frames_lo < fw_fcoe_stat->tx_stat.fcoe_tx_pkt_cnt ? 1U : 0U); afex_stats->tx_unicast_frames_lo = afex_stats->tx_unicast_frames_lo + fcoe_q_xstorm_stats->ucast_pkts_sent; afex_stats->tx_unicast_frames_hi = afex_stats->tx_unicast_frames_hi + (afex_stats->tx_unicast_frames_lo < fcoe_q_xstorm_stats->ucast_pkts_sent ? 1U : 0U); afex_stats->tx_broadcast_frames_lo = afex_stats->tx_broadcast_frames_lo + fcoe_q_xstorm_stats->bcast_pkts_sent; afex_stats->tx_broadcast_frames_hi = afex_stats->tx_broadcast_frames_hi + (afex_stats->tx_broadcast_frames_lo < fcoe_q_xstorm_stats->bcast_pkts_sent ? 1U : 0U); afex_stats->tx_multicast_frames_lo = afex_stats->tx_multicast_frames_lo + fcoe_q_xstorm_stats->mcast_pkts_sent; afex_stats->tx_multicast_frames_hi = afex_stats->tx_multicast_frames_hi + (afex_stats->tx_multicast_frames_lo < fcoe_q_xstorm_stats->mcast_pkts_sent ? 1U : 0U); afex_stats->tx_frames_dropped_lo = afex_stats->tx_frames_dropped_lo + fcoe_q_xstorm_stats->error_drop_pkts; afex_stats->tx_frames_dropped_hi = afex_stats->tx_frames_dropped_hi + (afex_stats->tx_frames_dropped_lo < fcoe_q_xstorm_stats->error_drop_pkts ? 1U : 0U); } else { } if (bp->port.pmf != 0U && stats_type == 2U) { afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + estats->mac_filter_discard; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (u32 )(afex_stats->rx_frames_dropped_lo < estats->mac_filter_discard); afex_stats->rx_frames_dropped_lo = afex_stats->rx_frames_dropped_lo + estats->brb_truncate_discard; afex_stats->rx_frames_dropped_hi = afex_stats->rx_frames_dropped_hi + (u32 )(afex_stats->rx_frames_dropped_lo < estats->brb_truncate_discard); afex_stats->rx_frames_discarded_lo = afex_stats->rx_frames_discarded_lo + estats->mac_discard; afex_stats->rx_frames_discarded_hi = afex_stats->rx_frames_discarded_hi + (u32 )(afex_stats->rx_frames_discarded_lo < estats->mac_discard); } else { } return; } } int bnx2x_stats_safe_exec(struct bnx2x *bp , void (*func_to_exec)(void * ) , void *cookie ) { int cnt ; int rc ; long tmp ; int tmp___0 ; int tmp___1 ; { cnt = 10; rc = 0; rc = down_timeout(& bp->stats_lock, 25L); tmp = ldv__builtin_expect(rc != 0, 0L); if (tmp != 0L) { printk("\vbnx2x: [%s:%d(%s)]Failed to take statistics lock for safe execution\n", "bnx2x_stats_safe_exec", 1979, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); goto out_no_lock; } else { } bnx2x_stats_comp(bp); goto ldv_51848; ldv_51847: tmp___0 = bnx2x_storm_stats_update(bp); if (tmp___0 != 0) { usleep_range(1000UL, 2000UL); } else { } ldv_51848: ; if ((unsigned int )bp->stats_pending != 0U) { tmp___1 = cnt; cnt = cnt - 1; if (tmp___1 != 0) { goto ldv_51847; } else { goto ldv_51849; } } else { } ldv_51849: ; if ((unsigned int )bp->stats_pending != 0U) { printk("\vbnx2x: [%s:%d(%s)]Failed to wait for stats pending to clear [possibly FW is stuck]\n", "bnx2x_stats_safe_exec", 1988, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -16; goto out; } else { } (*func_to_exec)(cookie); out: up(& bp->stats_lock); out_no_lock: ; return (rc); } } bool ldv_queue_work_on_123(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_124(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_125(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_126(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_127(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_137(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_139(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_138(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_141(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_140(struct workqueue_struct *ldv_func_arg1 ) ; extern int dcb_setapp(struct net_device * , struct dcb_app * ) ; extern int dcbnl_cee_notify(struct net_device * , int , int , u32 , u32 ) ; __inline static void bnx2x_link_sync_notify___0(struct bnx2x *bp ) { int func ; int vn ; { vn = 0; goto ldv_51927; ldv_51926: ; if ((int )bp->pfid >> 1 == vn) { goto ldv_51925; } else { } func = func_by_vn(bp, vn); writel(1U, (void volatile *)bp->regview + (unsigned long )((func + 10252) * 4)); ldv_51925: vn = vn + 1; ldv_51927: ; if (((unsigned int )bp->common.chip_port_mode == 0U ? 2 : 4) > vn) { goto ldv_51926; } else { } return; } } static void bnx2x_pfc_set_pfc(struct bnx2x *bp ) ; static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp ) ; static void bnx2x_dcbx_get_ets_pri_pg_tbl(struct bnx2x *bp , u32 *set_configuration_ets_pg , u32 *pri_pg_tbl ) ; static void bnx2x_dcbx_get_num_pg_traf_type(struct bnx2x *bp , u32 *pg_pri_orginal_spread , struct pg_help_data *help_data ) ; static void bnx2x_dcbx_fill_cos_params(struct bnx2x *bp , struct pg_help_data *help_data , struct dcbx_ets_feature *ets , u32 *pg_pri_orginal_spread ) ; static void bnx2x_dcbx_separate_pauseable_from_non(struct bnx2x *bp , struct cos_help_data *cos_data , u32 *pg_pri_orginal_spread , struct dcbx_ets_feature *ets ) ; static void bnx2x_dcbx_fw_struct(struct bnx2x *bp , struct bnx2x_func_tx_start_params *pfc_fw_cfg ) ; static void bnx2x_read_data(struct bnx2x *bp , u32 *buff , u32 addr , u32 len ) { int i ; { i = 0; goto ldv_51981; ldv_51980: *buff = readl((void const volatile *)bp->regview + (unsigned long )(addr + (u32 )i)); i = i + 4; buff = buff + 1; ldv_51981: ; if ((u32 )i < len) { goto ldv_51980; } else { } return; } } static void bnx2x_write_data(struct bnx2x *bp , u32 *buff , u32 addr , u32 len ) { int i ; { i = 0; goto ldv_51991; ldv_51990: writel(*buff, (void volatile *)bp->regview + (unsigned long )(addr + (u32 )i)); i = i + 4; buff = buff + 1; ldv_51991: ; if ((u32 )i < len) { goto ldv_51990; } else { } return; } } static void bnx2x_pfc_set(struct bnx2x *bp ) { struct bnx2x_nig_brb_pfc_port_params pfc_params ; u32 pri_bit ; u32 val ; int i ; { pfc_params.pause_enable = 0U; pfc_params.llfc_out_en = 0U; pfc_params.llfc_enable = 0U; pfc_params.pkt_priority_to_cos = 0U; pfc_params.num_of_rx_cos_priority_mask = (unsigned char)0; pfc_params.rx_cos_priority_mask[0] = 0U; pfc_params.rx_cos_priority_mask[1] = 0U; pfc_params.rx_cos_priority_mask[2] = 0U; pfc_params.rx_cos_priority_mask[3] = 0U; pfc_params.rx_cos_priority_mask[4] = 0U; pfc_params.rx_cos_priority_mask[5] = 0U; pfc_params.llfc_high_priority_classes = 0U; pfc_params.llfc_low_priority_classes = 0U; val = 0U; pfc_params.num_of_rx_cos_priority_mask = bp->dcbx_port_params.ets.num_of_cos; i = 0; goto ldv_52001; ldv_52000: pfc_params.rx_cos_priority_mask[i] = bp->dcbx_port_params.ets.cos_params[i].pri_bitmask & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))); i = i + 1; ldv_52001: ; if ((int )bp->dcbx_port_params.ets.num_of_cos > i) { goto ldv_52000; } else { } i = 0; goto ldv_52004; ldv_52003: pri_bit = (u32 )(1 << i); if (((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_bit) == 0U) { val = (u32 )(1 << i * 4) | val; } else { } i = i + 1; ldv_52004: ; if (i <= 7) { goto ldv_52003; } else { } pfc_params.pkt_priority_to_cos = val; pfc_params.llfc_low_priority_classes = (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))); pfc_params.llfc_high_priority_classes = 0U; bnx2x_acquire_phy_lock(bp); bp->link_params.feature_config_flags = bp->link_params.feature_config_flags | 2U; bnx2x_update_pfc(& bp->link_params, & bp->link_vars, & pfc_params); bnx2x_release_phy_lock(bp); return; } } static void bnx2x_pfc_clear(struct bnx2x *bp ) { struct bnx2x_nig_brb_pfc_port_params nig_params ; { nig_params.pause_enable = 0U; nig_params.llfc_out_en = 0U; nig_params.llfc_enable = 0U; nig_params.pkt_priority_to_cos = 0U; nig_params.num_of_rx_cos_priority_mask = (unsigned char)0; nig_params.rx_cos_priority_mask[0] = 0U; nig_params.rx_cos_priority_mask[1] = 0U; nig_params.rx_cos_priority_mask[2] = 0U; nig_params.rx_cos_priority_mask[3] = 0U; nig_params.rx_cos_priority_mask[4] = 0U; nig_params.rx_cos_priority_mask[5] = 0U; nig_params.llfc_high_priority_classes = 0U; nig_params.llfc_low_priority_classes = 0U; nig_params.pause_enable = 1U; bnx2x_acquire_phy_lock(bp); bp->link_params.feature_config_flags = bp->link_params.feature_config_flags & 4294967293U; bnx2x_update_pfc(& bp->link_params, & bp->link_vars, & nig_params); bnx2x_release_phy_lock(bp); return; } } static void bnx2x_dump_dcbx_drv_param(struct bnx2x *bp , struct dcbx_features *features , u32 error ) { u8 i ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; long tmp___10 ; long tmp___11 ; { i = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]local_mib.error %x\n", "bnx2x_dump_dcbx_drv_param", 129, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", error); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]local_mib.features.ets.enabled %x\n", "bnx2x_dump_dcbx_drv_param", 133, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", features->ets.enabled); } else { } i = 0U; goto ldv_52018; ldv_52017: tmp___1 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]local_mib.features.ets.pg_bw_tbl[%d] %d\n", "bnx2x_dump_dcbx_drv_param", 137, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i, (features->ets.pg_bw_tbl[(int )((unsigned int )i / 4U)] >> (~ ((int )i) & 3) * 8) & 255U); } else { } i = (u8 )((int )i + 1); ldv_52018: ; if ((unsigned int )i <= 7U) { goto ldv_52017; } else { } i = 0U; goto ldv_52021; ldv_52020: tmp___2 = ldv__builtin_expect((bp->msg_enable & 4) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]local_mib.features.ets.pri_pg_tbl[%d] %d\n", "bnx2x_dump_dcbx_drv_param", 141, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i, (features->ets.pri_pg_tbl[(int )((unsigned int )i / 8U)] >> ((~ ((int )((unsigned int )i / 2U)) & 3) * 2 + ((int )i & 1)) * 4) & 15U); } else { } i = (u8 )((int )i + 1); ldv_52021: ; if ((unsigned int )i <= 7U) { goto ldv_52020; } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.pfc.pri_en_bitmap %x\n", "bnx2x_dump_dcbx_drv_param", 145, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )features->pfc.pri_en_bitmap); } else { } tmp___4 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.pfc.pfc_caps %x\n", "bnx2x_dump_dcbx_drv_param", 147, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )features->pfc.pfc_caps); } else { } tmp___5 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.pfc.enabled %x\n", "bnx2x_dump_dcbx_drv_param", 149, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )features->pfc.enabled); } else { } tmp___6 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.app.default_pri %x\n", "bnx2x_dump_dcbx_drv_param", 152, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )features->app.default_pri); } else { } tmp___7 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.app.tc_supported %x\n", "bnx2x_dump_dcbx_drv_param", 154, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )features->app.tc_supported); } else { } tmp___8 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.app.enabled %x\n", "bnx2x_dump_dcbx_drv_param", 156, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )features->app.enabled); } else { } i = 0U; goto ldv_52024; ldv_52023: tmp___9 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___9 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.app.app_pri_tbl[%x].app_id %x\n", "bnx2x_dump_dcbx_drv_param", 160, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i, (int )features->app.app_pri_tbl[(int )i].app_id); } else { } tmp___10 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___10 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.app.app_pri_tbl[%x].pri_bitmap %x\n", "bnx2x_dump_dcbx_drv_param", 163, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i, (int )features->app.app_pri_tbl[(int )i].pri_bitmap); } else { } tmp___11 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_features.app.app_pri_tbl[%x].appBitfield %x\n", "bnx2x_dump_dcbx_drv_param", 166, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i, (int )features->app.app_pri_tbl[(int )i].appBitfield); } else { } i = (u8 )((int )i + 1); ldv_52024: ; if ((unsigned int )i <= 15U) { goto ldv_52023; } else { } return; } } static void bnx2x_dcbx_get_ap_priority(struct bnx2x *bp , u8 pri_bitmap , u8 llfc_traf_type ) { u32 pri ; u32 index ; u32 pri_mask ; u32 *ttp ; u32 __max1 ; u32 __max2 ; { pri = 8U; index = 7U; ttp = (u32 *)(& bp->dcbx_port_params.app.traffic_type_priority); goto ldv_52036; ldv_52035: pri_mask = (u32 )(1 << (int )index); if (((u32 )pri_bitmap & pri_mask) != 0U) { pri = index; } else { } index = index - 1U; ldv_52036: ; if (pri == 8U && index != 0U) { goto ldv_52035; } else { } if (pri <= 7U) { __max1 = *(ttp + (unsigned long )llfc_traf_type); __max2 = pri; *(ttp + (unsigned long )llfc_traf_type) = __max1 > __max2 ? __max1 : __max2; } else { } return; } } static void bnx2x_dcbx_get_ap_feature(struct bnx2x *bp , struct dcbx_app_priority_feature *app , u32 error ) { u8 index ; u32 *ttp ; long tmp ; long tmp___0 ; long tmp___1 ; struct dcbx_app_priority_entry *entry ; long tmp___2 ; { ttp = (u32 *)(& bp->dcbx_port_params.app.traffic_type_priority); if ((error & 4U) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_LOCAL_APP_ERROR\n", "bnx2x_dcbx_get_ap_feature", 198, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((error & 32U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_LOCAL_APP_MISMATCH\n", "bnx2x_dcbx_get_ap_feature", 201, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((error & 512U) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_REMOTE_APP_TLV_NOT_FOUND\n", "bnx2x_dcbx_get_ap_feature", 204, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((unsigned int )app->enabled != 0U && (error & 548U) == 0U) { bp->dcbx_port_params.app.enabled = 1U; index = 0U; goto ldv_52050; ldv_52049: *(ttp + (unsigned long )index) = 0U; index = (u8 )((int )index + 1); ldv_52050: ; if ((unsigned int )index <= 2U) { goto ldv_52049; } else { } if ((unsigned int )app->default_pri <= 7U) { *ttp = (u32 )app->default_pri; } else { } index = 0U; goto ldv_52054; ldv_52053: entry = (struct dcbx_app_priority_entry *)(& app->app_pri_tbl); if (((int )(entry + (unsigned long )index)->appBitfield & 16) != 0 && (unsigned int )(entry + (unsigned long )index)->app_id == 35078U) { bnx2x_dcbx_get_ap_priority(bp, (int )(entry + (unsigned long )index)->pri_bitmap, 1); } else { } if (((int )(entry + (unsigned long )index)->appBitfield & 32) != 0 && (unsigned int )(entry + (unsigned long )index)->app_id == 3260U) { bnx2x_dcbx_get_ap_priority(bp, (int )(entry + (unsigned long )index)->pri_bitmap, 2); } else { } index = (u8 )((int )index + 1); ldv_52054: ; if ((unsigned int )index <= 15U) { goto ldv_52053; } else { } } else { tmp___2 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_LOCAL_APP_DISABLED\n", "bnx2x_dcbx_get_ap_feature", 236, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->dcbx_port_params.app.enabled = 0U; index = 0U; goto ldv_52057; ldv_52056: *(ttp + (unsigned long )index) = 4294967295U; index = (u8 )((int )index + 1); ldv_52057: ; if ((unsigned int )index <= 2U) { goto ldv_52056; } else { } } return; } } static void bnx2x_dcbx_get_ets_feature(struct bnx2x *bp , struct dcbx_ets_feature *ets , u32 error ) { int i ; u32 pg_pri_orginal_spread[8U] ; unsigned int tmp ; struct pg_help_data pg_help_data ; struct bnx2x_dcbx_cos_params *cos_params ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { i = 0; pg_pri_orginal_spread[0] = 0U; tmp = 1U; while (1) { if (tmp >= 8U) { break; } else { } pg_pri_orginal_spread[tmp] = 0U; tmp = tmp + 1U; } cos_params = (struct bnx2x_dcbx_cos_params *)(& bp->dcbx_port_params.ets.cos_params); memset((void *)(& pg_help_data), 0, 28UL); if ((int )error & 1) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_LOCAL_ETS_ERROR\n", "bnx2x_dcbx_get_ets_feature", 255, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((error & 128U) != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_REMOTE_ETS_TLV_NOT_FOUND\n", "bnx2x_dcbx_get_ets_feature", 258, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } i = 0; goto ldv_52072; ldv_52071: (cos_params + (unsigned long )i)->pauseable = 0U; (cos_params + (unsigned long )i)->strict = 3U; (cos_params + (unsigned long )i)->bw_tbl = 4294967295U; (cos_params + (unsigned long )i)->pri_bitmask = 0U; i = i + 1; ldv_52072: ; if ((unsigned int )i <= 2U) { goto ldv_52071; } else { } if ((bp->dcbx_port_params.app.enabled != 0U && ets->enabled != 0U) && (error & 129U) == 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_LOCAL_ETS_ENABLE\n", "bnx2x_dcbx_get_ets_feature", 271, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->dcbx_port_params.ets.enabled = 1U; bnx2x_dcbx_get_ets_pri_pg_tbl(bp, (u32 *)(& pg_pri_orginal_spread), (u32 *)(& ets->pri_pg_tbl)); bnx2x_dcbx_get_num_pg_traf_type(bp, (u32 *)(& pg_pri_orginal_spread), & pg_help_data); bnx2x_dcbx_fill_cos_params(bp, & pg_help_data, ets, (u32 *)(& pg_pri_orginal_spread)); } else { tmp___3 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_LOCAL_ETS_DISABLED\n", "bnx2x_dcbx_get_ets_feature", 286, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->dcbx_port_params.ets.enabled = 0U; ets->pri_pg_tbl[0] = 0U; i = 0; goto ldv_52075; ldv_52074: ets->pg_bw_tbl[i / 4] = ets->pg_bw_tbl[i / 4] & (u32 )(~ (255 << (3 - i % 4) * 8)); ets->pg_bw_tbl[i / 4] = ets->pg_bw_tbl[i / 4] | (u32 )(1 << (3 - i % 4) * 8); i = i + 1; ldv_52075: ; if (i <= 7) { goto ldv_52074; } else { } } return; } } static void bnx2x_dcbx_get_pfc_feature(struct bnx2x *bp , struct dcbx_pfc_feature *pfc , u32 error ) { long tmp ; long tmp___0 ; long tmp___1 ; { if ((error & 2U) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_LOCAL_PFC_ERROR\n", "bnx2x_dcbx_get_pfc_feature", 299, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((error & 256U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_REMOTE_PFC_TLV_NOT_FOUND\n", "bnx2x_dcbx_get_pfc_feature", 302, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } if ((bp->dcbx_port_params.app.enabled != 0U && (unsigned int )pfc->enabled != 0U) && (error & 274U) == 0U) { bp->dcbx_port_params.pfc.enabled = 1U; bp->dcbx_port_params.pfc.priority_non_pauseable_mask = (u32 )(~ ((int )pfc->pri_en_bitmap)); } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCBX_LOCAL_PFC_DISABLED\n", "bnx2x_dcbx_get_pfc_feature", 310, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bp->dcbx_port_params.pfc.enabled = 0U; bp->dcbx_port_params.pfc.priority_non_pauseable_mask = 0U; } return; } } static void bnx2x_dcbx_map_nw(struct bnx2x *bp ) { int i ; u32 unmapped ; u32 *ttp ; u32 nw_prio ; struct bnx2x_dcbx_cos_params *cos_params ; long tmp ; { unmapped = 255U; ttp = (u32 *)(& bp->dcbx_port_params.app.traffic_type_priority); nw_prio = (u32 )(1 << (int )*ttp); cos_params = (struct bnx2x_dcbx_cos_params *)(& bp->dcbx_port_params.ets.cos_params); i = 0; goto ldv_52092; ldv_52091: unmapped = (u32 )(~ (1 << (int )*(ttp + (unsigned long )i))) & unmapped; i = i + 1; ldv_52092: ; if (i <= 2) { goto ldv_52091; } else { } i = 0; goto ldv_52099; ldv_52098: ; if (((cos_params + (unsigned long )i)->pri_bitmask & nw_prio) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]cos %d extended with 0x%08x\n", "bnx2x_dcbx_map_nw", 335, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, unmapped); } else { } (cos_params + (unsigned long )i)->pri_bitmask = (cos_params + (unsigned long )i)->pri_bitmask | unmapped; goto ldv_52097; } else { } i = i + 1; ldv_52099: ; if ((unsigned int )i <= 2U) { goto ldv_52098; } else { } ldv_52097: ; return; } } static void bnx2x_get_dcbx_drv_param(struct bnx2x *bp , struct dcbx_features *features , u32 error ) { { bnx2x_dcbx_get_ap_feature(bp, & features->app, error); bnx2x_dcbx_get_pfc_feature(bp, & features->pfc, error); bnx2x_dcbx_get_ets_feature(bp, & features->ets, error); bnx2x_dcbx_map_nw(bp); return; } } static int bnx2x_dcbx_read_mib(struct bnx2x *bp , u32 *base_mib_addr , u32 offset , int read_mib_type ) { int max_try_read ; u32 mib_size ; u32 prefix_seq_num ; u32 suffix_seq_num ; struct lldp_remote_mib *remote_mib ; struct lldp_local_mib *local_mib ; { max_try_read = 0; switch (read_mib_type) { case 0: mib_size = 100U; goto ldv_52118; case 1: mib_size = 100U; goto ldv_52118; default: ; return (1); } ldv_52118: offset = ((u32 )bp->pfid & 1U) * mib_size + offset; ldv_52125: bnx2x_read_data(bp, base_mib_addr, offset, mib_size); max_try_read = max_try_read + 1; switch (read_mib_type) { case 0: local_mib = (struct lldp_local_mib *)base_mib_addr; prefix_seq_num = local_mib->prefix_seq_num; suffix_seq_num = local_mib->suffix_seq_num; goto ldv_52122; case 1: remote_mib = (struct lldp_remote_mib *)base_mib_addr; prefix_seq_num = remote_mib->prefix_seq_num; suffix_seq_num = remote_mib->suffix_seq_num; goto ldv_52122; default: ; return (1); } ldv_52122: ; if (prefix_seq_num != suffix_seq_num && max_try_read <= 99) { goto ldv_52125; } else { } if (max_try_read > 99) { printk("\vbnx2x: [%s:%d(%s)]MIB could not be read\n", "bnx2x_dcbx_read_mib", 402, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (1); } else { } return (0); } } static void bnx2x_pfc_set_pfc(struct bnx2x *bp ) { int mfw_configured ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; { if (bp->common.shmem2_base != 0U) { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp > 188U) { tmp___0 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 188UL))); if ((tmp___0 & 4U) != 0U) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } } else { tmp___1 = 0; } mfw_configured = tmp___1; if (bp->dcbx_port_params.pfc.enabled != 0U && ((bp->dcbx_error & 64U) == 0U || mfw_configured != 0)) { bnx2x_pfc_set(bp); } else { bnx2x_pfc_clear(bp); } return; } } int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp ) { struct bnx2x_func_state_params func_params ; int rc ; long tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; func_params.f_obj = & bp->func_obj; func_params.cmd = 6; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); __set_bit(7L, (unsigned long volatile *)(& func_params.ramrod_flags)); tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]STOP TRAFFIC\n", "bnx2x_dcbx_stop_hw_tx", 437, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = bnx2x_func_state_change(bp, & func_params); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to hold traffic for HW configuration\n", "bnx2x_dcbx_stop_hw_tx", 441, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_dcbx_stop_hw_tx", 442, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); } else { } return (rc); } } int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp ) { struct bnx2x_func_state_params func_params ; struct bnx2x_func_tx_start_params *tx_params ; int rc ; long tmp ; { func_params.f_obj = (struct bnx2x_func_sp_obj *)0; func_params.cmd = 0; func_params.ramrod_flags = 0UL; func_params.params.tx_start.traffic_type_to_priority_cos[0].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[0].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[1].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[2].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[3].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[4].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[5].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[6].reserved1 = (unsigned short)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].priority = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].cos = (unsigned char)0; func_params.params.tx_start.traffic_type_to_priority_cos[7].reserved1 = (unsigned short)0; func_params.params.tx_start.dcb_enabled = (unsigned char)0; func_params.params.tx_start.dcb_version = (unsigned char)0; func_params.params.tx_start.dont_add_pri_0_en = (unsigned char)0; tx_params = & func_params.params.tx_start; func_params.f_obj = & bp->func_obj; func_params.cmd = 7; __set_bit(2L, (unsigned long volatile *)(& func_params.ramrod_flags)); __set_bit(7L, (unsigned long volatile *)(& func_params.ramrod_flags)); bnx2x_dcbx_fw_struct(bp, tx_params); tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]START TRAFFIC\n", "bnx2x_dcbx_resume_hw_tx", 463, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = bnx2x_func_state_change(bp, & func_params); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to resume traffic after HW configuration\n", "bnx2x_dcbx_resume_hw_tx", 467, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bp->panic = 1; printk("\vbnx2x: [%s:%d(%s)]driver assert\n", "bnx2x_dcbx_resume_hw_tx", 468, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_panic_dump(bp, 0); } else { } return (rc); } } static void bnx2x_dcbx_2cos_limit_update_ets_config(struct bnx2x *bp ) { struct bnx2x_dcbx_pg_params *ets ; int rc ; u32 bw_tbl_0 ; u32 bw_tbl_1 ; { ets = & bp->dcbx_port_params.ets; rc = 0; if ((unsigned int )ets->num_of_cos == 0U || (unsigned int )ets->num_of_cos > 2U) { printk("\vbnx2x: [%s:%d(%s)]Illegal number of COSes %d\n", "bnx2x_dcbx_2cos_limit_update_ets_config", 480, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ets->num_of_cos); return; } else { } if ((unsigned int )ets->num_of_cos == 1U) { return; } else { } if (((unsigned int )ets->cos_params[0].strict == 3U && ets->cos_params[0].bw_tbl == 4294967295U) || ((unsigned int )ets->cos_params[1].strict == 3U && ets->cos_params[1].bw_tbl == 4294967295U)) { printk("\vbnx2x: [%s:%d(%s)]all COS should have at least bw_limit or strictets->cos_params[0].strict= %xets->cos_params[0].bw_tbl= %xets->cos_params[1].strict= %xets->cos_params[1].bw_tbl= %x", "bnx2x_dcbx_2cos_limit_update_ets_config", 501, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )ets->cos_params[0].strict, ets->cos_params[0].bw_tbl, (int )ets->cos_params[1].strict, ets->cos_params[1].bw_tbl); return; } else { } if (ets->cos_params[0].bw_tbl != 4294967295U && ets->cos_params[1].bw_tbl != 4294967295U) { bw_tbl_0 = ets->cos_params[0].bw_tbl; bw_tbl_1 = ets->cos_params[1].bw_tbl; if (bw_tbl_0 == 0U) { bw_tbl_0 = 1U; bw_tbl_1 = 99U; } else if (bw_tbl_1 == 0U) { bw_tbl_1 = 1U; bw_tbl_0 = 99U; } else { } bnx2x_ets_bw_limit((struct link_params const *)(& bp->link_params), bw_tbl_0, bw_tbl_1); } else { if ((unsigned int )ets->cos_params[0].strict == 0U) { rc = bnx2x_ets_strict((struct link_params const *)(& bp->link_params), 0); } else if ((unsigned int )ets->cos_params[1].strict == 0U) { rc = bnx2x_ets_strict((struct link_params const *)(& bp->link_params), 1); } else { } if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]update_ets_params failed\n", "bnx2x_dcbx_2cos_limit_update_ets_config", 529, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } return; } } static void bnx2x_dcbx_update_ets_config(struct bnx2x *bp ) { struct bnx2x_dcbx_pg_params *ets ; struct bnx2x_ets_params ets_params ; u8 i ; int tmp ; { ets = & bp->dcbx_port_params.ets; ets_params.num_of_cos = 0U; ets_params.cos[0].state = 0; ets_params.cos[0].params.bw_params.bw = (unsigned char)0; ets_params.cos[1].state = 0; ets_params.cos[1].params.bw_params.bw = (unsigned char)0; ets_params.cos[2].state = 0; ets_params.cos[2].params.bw_params.bw = (unsigned char)0; ets_params.cos[3].state = 0; ets_params.cos[3].params.bw_params.bw = (unsigned char)0; ets_params.cos[4].state = 0; ets_params.cos[4].params.bw_params.bw = (unsigned char)0; ets_params.cos[5].state = 0; ets_params.cos[5].params.bw_params.bw = (unsigned char)0; ets_params.num_of_cos = ets->num_of_cos; i = 0U; goto ldv_52161; ldv_52160: ; if ((unsigned int )ets->cos_params[(int )i].strict != 3U) { if (ets->cos_params[(int )i].bw_tbl != 4294967295U) { printk("\vbnx2x: [%s:%d(%s)]COS can\'t be not BW and not SP\n", "bnx2x_dcbx_update_ets_config", 548, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } ets_params.cos[(int )i].state = 0; ets_params.cos[(int )i].params.sp_params.pri = ets->cos_params[(int )i].strict; } else { if (ets->cos_params[(int )i].bw_tbl == 4294967295U) { printk("\vbnx2x: [%s:%d(%s)]COS can\'t be not BW and not SP\n", "bnx2x_dcbx_update_ets_config", 557, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } ets_params.cos[(int )i].state = 1; ets_params.cos[(int )i].params.bw_params.bw = (unsigned char )ets->cos_params[(int )i].bw_tbl; } i = (u8 )((int )i + 1); ldv_52161: ; if ((int )ets->num_of_cos > (int )i) { goto ldv_52160; } else { } tmp = bnx2x_ets_e3b0_config((struct link_params const *)(& bp->link_params), (struct link_vars const *)(& bp->link_vars), & ets_params); if (tmp != 0) { printk("\vbnx2x: [%s:%d(%s)]bnx2x_ets_e3b0_config failed\n", "bnx2x_dcbx_update_ets_config", 569, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_ets_disabled(& bp->link_params, & bp->link_vars); } else { } return; } } static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp ) { int mfw_configured ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; { if (bp->common.shmem2_base != 0U) { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp > 188U) { tmp___0 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 188UL))); if ((tmp___0 & 4U) != 0U) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } } else { tmp___1 = 0; } mfw_configured = tmp___1; bnx2x_ets_disabled(& bp->link_params, & bp->link_vars); if (bp->dcbx_port_params.ets.enabled == 0U || ((bp->dcbx_error & 64U) != 0U && mfw_configured == 0)) { return; } else { } if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { bnx2x_dcbx_update_ets_config(bp); } else { bnx2x_dcbx_2cos_limit_update_ets_config(bp); } return; } } static int bnx2x_dcbx_read_shmem_remote_mib(struct bnx2x *bp ) { struct lldp_remote_mib remote_mib ; u32 dcbx_remote_mib_offset ; unsigned int tmp ; int rc ; long tmp___0 ; { remote_mib.prefix_seq_num = 0U; remote_mib.flags = 0U; remote_mib.features.ets.enabled = 0U; remote_mib.features.ets.pg_bw_tbl[0] = 0U; remote_mib.features.ets.pg_bw_tbl[1] = 0U; remote_mib.features.ets.pri_pg_tbl[0] = 0U; remote_mib.features.pfc.enabled = (unsigned char)0; remote_mib.features.pfc.reserved = (unsigned char)0; remote_mib.features.pfc.pfc_caps = (unsigned char)0; remote_mib.features.pfc.pri_en_bitmap = (unsigned char)0; remote_mib.features.app.enabled = (unsigned char)0; remote_mib.features.app.tc_supported = (unsigned char)0; remote_mib.features.app.default_pri = (unsigned char)0; remote_mib.features.app.reserved = (unsigned char)0; remote_mib.features.app.app_pri_tbl[0].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[0].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[0].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[1].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[1].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[1].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[2].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[2].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[2].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[3].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[3].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[3].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[4].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[4].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[4].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[5].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[5].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[5].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[6].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[6].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[6].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[7].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[7].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[7].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[8].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[8].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[8].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[9].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[9].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[9].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[10].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[10].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[10].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[11].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[11].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[11].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[12].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[12].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[12].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[13].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[13].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[13].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[14].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[14].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[14].app_id = (unsigned short)0; remote_mib.features.app.app_pri_tbl[15].appBitfield = (unsigned char)0; remote_mib.features.app.app_pri_tbl[15].pri_bitmap = (unsigned char)0; remote_mib.features.app.app_pri_tbl[15].app_id = (unsigned short)0; remote_mib.suffix_seq_num = 0U; tmp = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 48UL))); dcbx_remote_mib_offset = tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_remote_mib_offset 0x%x\n", "bnx2x_dcbx_read_shmem_remote_mib", 600, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dcbx_remote_mib_offset); } else { } if (dcbx_remote_mib_offset == 0U) { printk("\vbnx2x: [%s:%d(%s)]FW doesn\'t support dcbx_remote_mib_offset\n", "bnx2x_dcbx_read_shmem_remote_mib", 603, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } rc = bnx2x_dcbx_read_mib(bp, (u32 *)(& remote_mib), dcbx_remote_mib_offset, 1); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to read remote mib from FW\n", "bnx2x_dcbx_read_shmem_remote_mib", 611, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } bp->dcbx_remote_feat = remote_mib.features; bp->dcbx_remote_flags = remote_mib.flags; return (0); } } static int bnx2x_dcbx_read_shmem_neg_results(struct bnx2x *bp ) { struct lldp_local_mib local_mib ; u32 dcbx_neg_res_offset ; unsigned int tmp ; int rc ; long tmp___0 ; { local_mib.prefix_seq_num = 0U; local_mib.error = 0U; local_mib.features.ets.enabled = 0U; local_mib.features.ets.pg_bw_tbl[0] = 0U; local_mib.features.ets.pg_bw_tbl[1] = 0U; local_mib.features.ets.pri_pg_tbl[0] = 0U; local_mib.features.pfc.enabled = (unsigned char)0; local_mib.features.pfc.reserved = (unsigned char)0; local_mib.features.pfc.pfc_caps = (unsigned char)0; local_mib.features.pfc.pri_en_bitmap = (unsigned char)0; local_mib.features.app.enabled = (unsigned char)0; local_mib.features.app.tc_supported = (unsigned char)0; local_mib.features.app.default_pri = (unsigned char)0; local_mib.features.app.reserved = (unsigned char)0; local_mib.features.app.app_pri_tbl[0].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[0].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[0].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[1].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[1].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[1].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[2].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[2].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[2].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[3].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[3].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[3].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[4].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[4].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[4].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[5].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[5].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[5].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[6].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[6].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[6].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[7].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[7].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[7].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[8].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[8].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[8].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[9].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[9].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[9].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[10].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[10].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[10].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[11].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[11].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[11].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[12].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[12].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[12].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[13].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[13].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[13].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[14].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[14].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[14].app_id = (unsigned short)0; local_mib.features.app.app_pri_tbl[15].appBitfield = (unsigned char)0; local_mib.features.app.app_pri_tbl[15].pri_bitmap = (unsigned char)0; local_mib.features.app.app_pri_tbl[15].app_id = (unsigned short)0; local_mib.suffix_seq_num = 0U; tmp = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 44UL))); dcbx_neg_res_offset = tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_neg_res_offset 0x%x\n", "bnx2x_dcbx_read_shmem_neg_results", 628, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dcbx_neg_res_offset); } else { } if (dcbx_neg_res_offset == 0U) { printk("\vbnx2x: [%s:%d(%s)]FW doesn\'t support dcbx_neg_res_offset\n", "bnx2x_dcbx_read_shmem_neg_results", 631, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } rc = bnx2x_dcbx_read_mib(bp, (u32 *)(& local_mib), dcbx_neg_res_offset, 0); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to read local mib from FW\n", "bnx2x_dcbx_read_shmem_neg_results", 639, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } bp->dcbx_local_feat = local_mib.features; bp->dcbx_error = local_mib.error; return (0); } } __inline static u8 bnx2x_dcbx_dcbnl_app_up(struct dcbx_app_priority_entry *ent ) { u8 pri ; { pri = 7U; goto ldv_52187; ldv_52186: ; if (((int )ent->pri_bitmap >> (int )pri) & 1) { goto ldv_52185; } else { } pri = (u8 )((int )pri - 1); ldv_52187: ; if ((unsigned int )pri != 0U) { goto ldv_52186; } else { } ldv_52185: ; return (pri); } } __inline static u8 bnx2x_dcbx_dcbnl_app_idtype(struct dcbx_app_priority_entry *ent ) { { return (((int )ent->appBitfield & 48) == 32); } } int bnx2x_dcbnl_update_applist(struct bnx2x *bp , bool delall ) { int i ; int err ; struct dcbx_app_priority_entry *ent ; u8 up___0 ; u8 tmp ; struct dcb_app app ; { err = 0; i = 0; goto ldv_52201; ldv_52200: ent = (struct dcbx_app_priority_entry *)(& bp->dcbx_local_feat.app.app_pri_tbl) + (unsigned long )i; if ((int )ent->appBitfield & 1) { tmp = bnx2x_dcbx_dcbnl_app_up(ent); up___0 = tmp; if ((unsigned int )up___0 != 0U) { app.selector = bnx2x_dcbx_dcbnl_app_idtype(ent); app.protocol = ent->app_id; app.priority = (int )delall ? 0U : up___0; err = dcb_setapp(bp->dev, & app); } else { } } else { } i = i + 1; ldv_52201: ; if (i <= 15 && err == 0) { goto ldv_52200; } else { } return (err); } } __inline static void bnx2x_dcbx_update_tc_mapping(struct bnx2x *bp ) { u8 prio ; u8 cos ; long tmp ; { cos = 0U; goto ldv_52213; ldv_52212: prio = 0U; goto ldv_52210; ldv_52209: ; if ((bp->dcbx_port_params.ets.cos_params[(int )cos].pri_bitmask & (u32 )(1 << (int )prio)) != 0U) { bp->prio_to_cos[(int )prio] = cos; tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]tx_mapping %d --> %d\n", "bnx2x_dcbx_update_tc_mapping", 704, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )prio, (int )cos); } else { } } else { } prio = (u8 )((int )prio + 1); ldv_52210: ; if ((unsigned int )prio <= 7U) { goto ldv_52209; } else { } cos = (u8 )((int )cos + 1); ldv_52213: ; if ((int )bp->dcbx_port_params.ets.num_of_cos > (int )cos) { goto ldv_52212; } else { } bnx2x_schedule_sp_rtnl(bp, 0, 0U); return; } } void bnx2x_dcbx_set_params(struct bnx2x *bp , u32 state ) { long tmp ; int tmp___0 ; int tmp___1 ; long tmp___2 ; long tmp___3 ; { switch (state) { case 1U: tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_DCBX_STATE_NEG_RECEIVED\n", "bnx2x_dcbx_set_params", 721, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_dcbnl_update_applist(bp, 1); tmp___0 = bnx2x_dcbx_read_shmem_remote_mib(bp); if (tmp___0 != 0) { return; } else { } tmp___1 = bnx2x_dcbx_read_shmem_neg_results(bp); if (tmp___1 != 0) { return; } else { } bnx2x_dump_dcbx_drv_param(bp, & bp->dcbx_local_feat, bp->dcbx_error); bnx2x_get_dcbx_drv_param(bp, & bp->dcbx_local_feat, bp->dcbx_error); bnx2x_update_drv_flags(bp, 1U, 1U); bnx2x_dcbnl_update_applist(bp, 0); bnx2x_dcbx_update_tc_mapping(bp); if ((unsigned int )bp->mf_mode != 0U) { bnx2x_link_sync_notify___0(bp); } else { } bnx2x_schedule_sp_rtnl(bp, 9, 0U); return; case 2U: tmp___2 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_DCBX_STATE_TX_PAUSED\n", "bnx2x_dcbx_set_params", 770, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_pfc_set_pfc(bp); bnx2x_dcbx_update_ets_params(bp); bnx2x_set_local_cmng(bp); return; case 3U: tmp___3 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]BNX2X_DCBX_STATE_TX_RELEASED\n", "bnx2x_dcbx_set_params", 779, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_fw_command(bp, 2986344448U, 0U); dcbnl_cee_notify(bp->dev, 78, 26, 0U, 0U); return; default: printk("\vbnx2x: [%s:%d(%s)]Unknown DCBX_STATE\n", "bnx2x_dcbx_set_params", 789, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } return; } } static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp , u32 dcbx_lldp_params_offset ) { struct lldp_admin_mib admin_mib ; u32 i ; u32 other_traf_type ; u32 traf_type ; u32 offset ; struct dcbx_features *af ; struct bnx2x_config_dcbx_params *dp ; long tmp ; long tmp___0 ; struct bnx2x_admin_priority_app_table *table ; u32 tmp___1 ; { other_traf_type = 2U; traf_type = 0U; offset = (((u32 )bp->pfid & 1U) * 92U + dcbx_lldp_params_offset) + 80U; af = & admin_mib.features; dp = & bp->dcbx_config_params; memset((void *)(& admin_mib), 0, 92UL); bnx2x_read_data(bp, (u32 *)(& admin_mib), offset, 92U); if (bp->dcbx_enabled == 2) { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags | 1024U; } else { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags & 4294966271U; } if (dp->overwrite_settings == 1U) { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags & 4294905855U; admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags | ((dp->admin_dcbx_version << 12) & 65535U); af->ets.enabled = (u32 )((unsigned char )dp->admin_ets_enable); af->pfc.enabled = (unsigned char )dp->admin_pfc_enable; if (dp->admin_ets_configuration_tx_enable != 0U) { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags | 1U; } else { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags & 4294967294U; } if (dp->admin_pfc_tx_enable != 0U) { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags | 2U; } else { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags & 4294967293U; } if (dp->admin_application_priority_tx_enable != 0U) { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags | 4U; } else { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags & 4294967291U; } if (dp->admin_ets_willing != 0U) { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags | 32U; } else { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags & 4294967263U; } if (dp->admin_pfc_willing != 0U) { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags | 64U; } else { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags & 4294967231U; } if (dp->admin_app_priority_willing != 0U) { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags | 128U; } else { admin_mib.ver_cfg_flags = admin_mib.ver_cfg_flags & 4294967167U; } i = 0U; goto ldv_52237; ldv_52236: af->ets.pg_bw_tbl[i / 4U] = af->ets.pg_bw_tbl[i / 4U] & (u32 )(~ (255 << (int )((~ i & 3U) * 8U))); af->ets.pg_bw_tbl[i / 4U] = af->ets.pg_bw_tbl[i / 4U] | (u32 )((int )((unsigned char )dp->admin_configuration_bw_precentage[i]) << (int )((~ i & 3U) * 8U)); tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]pg_bw_tbl[%d] = %02x\n", "bnx2x_dcbx_admin_mib_updated_params", 871, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (af->ets.pg_bw_tbl[i / 4U] >> (int )((~ i & 3U) * 8U)) & 255U); } else { } i = i + 1U; ldv_52237: ; if (i <= 7U) { goto ldv_52236; } else { } i = 0U; goto ldv_52240; ldv_52239: af->ets.pri_pg_tbl[i / 8U] = af->ets.pri_pg_tbl[i / 8U] & (u32 )(~ (15 << (int )(((~ (i / 2U) & 3U) * 2U + (i & 1U)) * 4U))); af->ets.pri_pg_tbl[i / 8U] = af->ets.pri_pg_tbl[i / 8U] | (u32 )(((int )((unsigned char )dp->admin_configuration_ets_pg[i]) & 15) << (int )(((~ (i / 2U) & 3U) * 2U + (i & 1U)) * 4U)); tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pri_pg_tbl[%d] = %02x\n", "bnx2x_dcbx_admin_mib_updated_params", 879, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (af->ets.pri_pg_tbl[i / 8U] >> (int )(((~ (i / 2U) & 3U) * 2U + (i & 1U)) * 4U)) & 15U); } else { } i = i + 1U; ldv_52240: ; if (i <= 7U) { goto ldv_52239; } else { } af->pfc.pri_en_bitmap = (unsigned char )dp->admin_pfc_bitmap; i = 0U; goto ldv_52244; ldv_52243: ; if (dp->admin_priority_app_table[i].valid != 0U) { table = (struct bnx2x_admin_priority_app_table *)(& dp->admin_priority_app_table); if ((table + (unsigned long )i)->app_id == 35078U && (table + (unsigned long )i)->traffic_type == 0U) { traf_type = 0U; } else if ((table + (unsigned long )i)->app_id == 3260U && (table + (unsigned long )i)->traffic_type == 1U) { traf_type = 1U; } else { tmp___1 = other_traf_type; other_traf_type = other_traf_type + 1U; traf_type = tmp___1; } af->app.app_pri_tbl[traf_type].app_id = (u16 )(table + (unsigned long )i)->app_id; af->app.app_pri_tbl[traf_type].pri_bitmap = (unsigned char )(1 << (int )(table + (unsigned long )i)->priority); af->app.app_pri_tbl[traf_type].appBitfield = 1U; af->app.app_pri_tbl[traf_type].appBitfield = (u8 )((int )((signed char )af->app.app_pri_tbl[traf_type].appBitfield) | ((table + (unsigned long )i)->traffic_type == 0U ? 16 : 32)); } else { } i = i + 1U; ldv_52244: ; if (i <= 3U) { goto ldv_52243; } else { } af->app.default_pri = (unsigned char )dp->admin_default_priority; } else { } bnx2x_write_data(bp, (u32 *)(& admin_mib), offset, 92U); return; } } void bnx2x_dcbx_set_state(struct bnx2x *bp , bool dcb_on , u32 dcbx_enabled ) { long tmp ; { if (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U)) { bp->dcb_state = (u16 )dcb_on; bp->dcbx_enabled = (int )dcbx_enabled; } else { bp->dcb_state = 0U; bp->dcbx_enabled = -1; } tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCB state [%s:%s]\n", "bnx2x_dcbx_set_state", 935, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )dcb_on ? (char *)"ON" : (char *)"OFF", dcbx_enabled != 0U ? (dcbx_enabled != 1U ? (dcbx_enabled == 2U ? (char *)"on-chip with negotiation" : (char *)"invalid") : (char *)"on-chip static") : (char *)"user-mode"); } else { } return; } } void bnx2x_dcbx_init_params(struct bnx2x *bp ) { { bp->dcbx_config_params.admin_dcbx_version = 0U; bp->dcbx_config_params.admin_ets_willing = 1U; bp->dcbx_config_params.admin_pfc_willing = 1U; bp->dcbx_config_params.overwrite_settings = 1U; bp->dcbx_config_params.admin_ets_enable = 1U; bp->dcbx_config_params.admin_pfc_enable = 1U; bp->dcbx_config_params.admin_tc_supported_tx_enable = 1U; bp->dcbx_config_params.admin_ets_configuration_tx_enable = 1U; bp->dcbx_config_params.admin_pfc_tx_enable = 1U; bp->dcbx_config_params.admin_application_priority_tx_enable = 1U; bp->dcbx_config_params.admin_ets_reco_valid = 1U; bp->dcbx_config_params.admin_app_priority_willing = 1U; bp->dcbx_config_params.admin_configuration_bw_precentage[0] = 100U; bp->dcbx_config_params.admin_configuration_bw_precentage[1] = 0U; bp->dcbx_config_params.admin_configuration_bw_precentage[2] = 0U; bp->dcbx_config_params.admin_configuration_bw_precentage[3] = 0U; bp->dcbx_config_params.admin_configuration_bw_precentage[4] = 0U; bp->dcbx_config_params.admin_configuration_bw_precentage[5] = 0U; bp->dcbx_config_params.admin_configuration_bw_precentage[6] = 0U; bp->dcbx_config_params.admin_configuration_bw_precentage[7] = 0U; bp->dcbx_config_params.admin_configuration_ets_pg[0] = 0U; bp->dcbx_config_params.admin_configuration_ets_pg[1] = 0U; bp->dcbx_config_params.admin_configuration_ets_pg[2] = 0U; bp->dcbx_config_params.admin_configuration_ets_pg[3] = 0U; bp->dcbx_config_params.admin_configuration_ets_pg[4] = 0U; bp->dcbx_config_params.admin_configuration_ets_pg[5] = 0U; bp->dcbx_config_params.admin_configuration_ets_pg[6] = 0U; bp->dcbx_config_params.admin_configuration_ets_pg[7] = 0U; bp->dcbx_config_params.admin_recommendation_bw_precentage[0] = 100U; bp->dcbx_config_params.admin_recommendation_bw_precentage[1] = 0U; bp->dcbx_config_params.admin_recommendation_bw_precentage[2] = 0U; bp->dcbx_config_params.admin_recommendation_bw_precentage[3] = 0U; bp->dcbx_config_params.admin_recommendation_bw_precentage[4] = 0U; bp->dcbx_config_params.admin_recommendation_bw_precentage[5] = 0U; bp->dcbx_config_params.admin_recommendation_bw_precentage[6] = 0U; bp->dcbx_config_params.admin_recommendation_bw_precentage[7] = 0U; bp->dcbx_config_params.admin_recommendation_ets_pg[0] = 0U; bp->dcbx_config_params.admin_recommendation_ets_pg[1] = 1U; bp->dcbx_config_params.admin_recommendation_ets_pg[2] = 2U; bp->dcbx_config_params.admin_recommendation_ets_pg[3] = 3U; bp->dcbx_config_params.admin_recommendation_ets_pg[4] = 4U; bp->dcbx_config_params.admin_recommendation_ets_pg[5] = 5U; bp->dcbx_config_params.admin_recommendation_ets_pg[6] = 6U; bp->dcbx_config_params.admin_recommendation_ets_pg[7] = 7U; bp->dcbx_config_params.admin_pfc_bitmap = 0U; bp->dcbx_config_params.admin_priority_app_table[0].valid = 0U; bp->dcbx_config_params.admin_priority_app_table[1].valid = 0U; bp->dcbx_config_params.admin_priority_app_table[2].valid = 0U; bp->dcbx_config_params.admin_priority_app_table[3].valid = 0U; bp->dcbx_config_params.admin_default_priority = 0U; return; } } void bnx2x_dcbx_init(struct bnx2x *bp , bool update_shmem ) { u32 dcbx_lldp_params_offset ; long tmp ; long tmp___0 ; unsigned int tmp___1 ; { dcbx_lldp_params_offset = 0U; if (bp->port.pmf == 0U && (bp->flags & 2097152U) == 0U) { return; } else { } if (bp->dcbx_enabled <= 0) { return; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcb_state %d bp->port.pmf %d\n", "bnx2x_dcbx_init", 1009, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->dcb_state, bp->port.pmf); } else { } if ((unsigned int )bp->dcb_state == 1U) { if (bp->common.shmem2_base != 0U) { tmp___1 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___1 > 40U) { dcbx_lldp_params_offset = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 40UL))); tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbx_lldp_params_offset 0x%x\n", "bnx2x_dcbx_init", 1017, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dcbx_lldp_params_offset); } else { } bnx2x_update_drv_flags(bp, 1U, 0U); if (dcbx_lldp_params_offset != 0U) { bnx2x_acquire_hw_lock(bp, 13U); if ((int )update_shmem) { bnx2x_dcbx_admin_mib_updated_params(bp, dcbx_lldp_params_offset); } else { } bnx2x_fw_command(bp, 2952790016U, 0U); bnx2x_release_hw_lock(bp, 13U); } else { } } else { } } else { } } else { } return; } } static void bnx2x_dcbx_print_cos_params(struct bnx2x *bp , struct bnx2x_func_tx_start_params *pfc_fw_cfg ) { u8 pri ; u8 cos ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { pri = 0U; cos = 0U; tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]pfc_fw_cfg->dcb_version %x\n", "bnx2x_dcbx_print_cos_params", 1050, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pfc_fw_cfg->dcb_version); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pdev->params.dcbx_port_params.pfc.priority_non_pauseable_mask %x\n", "bnx2x_dcbx_print_cos_params", 1053, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->dcbx_port_params.pfc.priority_non_pauseable_mask); } else { } cos = 0U; goto ldv_52269; ldv_52268: tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pdev->params.dcbx_port_params.ets.cos_params[%d].pri_bitmask %x\n", "bnx2x_dcbx_print_cos_params", 1058, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cos, bp->dcbx_port_params.ets.cos_params[(int )cos].pri_bitmask); } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pdev->params.dcbx_port_params.ets.cos_params[%d].bw_tbl %x\n", "bnx2x_dcbx_print_cos_params", 1062, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cos, bp->dcbx_port_params.ets.cos_params[(int )cos].bw_tbl); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pdev->params.dcbx_port_params.ets.cos_params[%d].strict %x\n", "bnx2x_dcbx_print_cos_params", 1066, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cos, (int )bp->dcbx_port_params.ets.cos_params[(int )cos].strict); } else { } tmp___4 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pdev->params.dcbx_port_params.ets.cos_params[%d].pauseable %x\n", "bnx2x_dcbx_print_cos_params", 1070, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cos, (int )bp->dcbx_port_params.ets.cos_params[(int )cos].pauseable); } else { } cos = (u8 )((int )cos + 1); ldv_52269: ; if ((int )bp->dcbx_port_params.ets.num_of_cos > (int )cos) { goto ldv_52268; } else { } pri = 0U; goto ldv_52272; ldv_52271: tmp___5 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pfc_fw_cfg->traffic_type_to_priority_cos[%d].priority %x\n", "bnx2x_dcbx_print_cos_params", 1076, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pri, (int )pfc_fw_cfg->traffic_type_to_priority_cos[(int )pri].priority); } else { } tmp___6 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pfc_fw_cfg->traffic_type_to_priority_cos[%d].cos %x\n", "bnx2x_dcbx_print_cos_params", 1080, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )pri, (int )pfc_fw_cfg->traffic_type_to_priority_cos[(int )pri].cos); } else { } pri = (u8 )((int )pri + 1); ldv_52272: ; if ((unsigned int )pri <= 2U) { goto ldv_52271; } else { } return; } } static void bnx2x_dcbx_get_num_pg_traf_type(struct bnx2x *bp , u32 *pg_pri_orginal_spread , struct pg_help_data *help_data ) { bool pg_found ; u32 i ; u32 traf_type ; u32 add_traf_type ; u32 add_pg ; u32 *ttp ; struct pg_entry_help_data *data ; long tmp ; { pg_found = 0; ttp = (u32 *)(& bp->dcbx_port_params.app.traffic_type_priority); data = (struct pg_entry_help_data *)(& help_data->data); i = 0U; goto ldv_52287; ldv_52286: (data + (unsigned long )i)->pg = 255U; i = i + 1U; ldv_52287: ; if (i <= 2U) { goto ldv_52286; } else { } add_traf_type = 0U; goto ldv_52294; ldv_52293: pg_found = 0; if (*(ttp + (unsigned long )add_traf_type) <= 7U) { add_pg = (u32 )((unsigned char )*(pg_pri_orginal_spread + (unsigned long )*(ttp + (unsigned long )add_traf_type))); traf_type = 0U; goto ldv_52291; ldv_52290: ; if ((u32 )(data + (unsigned long )traf_type)->pg == add_pg) { if (((data + (unsigned long )traf_type)->pg_priority & (u32 )(1 << (int )*(ttp + (unsigned long )add_traf_type))) == 0U) { (data + (unsigned long )traf_type)->num_of_dif_pri = (u8 )((int )(data + (unsigned long )traf_type)->num_of_dif_pri + 1); } else { } (data + (unsigned long )traf_type)->pg_priority = (data + (unsigned long )traf_type)->pg_priority | (u32 )(1 << (int )*(ttp + (unsigned long )add_traf_type)); pg_found = 1; goto ldv_52289; } else { } traf_type = traf_type + 1U; ldv_52291: ; if (traf_type <= 2U) { goto ldv_52290; } else { } ldv_52289: ; if (! pg_found) { (data + (unsigned long )help_data->num_of_pg)->pg = (u8 )add_pg; (data + (unsigned long )help_data->num_of_pg)->pg_priority = (u32 )(1 << (int )*(ttp + (unsigned long )add_traf_type)); (data + (unsigned long )help_data->num_of_pg)->num_of_dif_pri = 1U; help_data->num_of_pg = (u8 )((int )help_data->num_of_pg + 1); } else { } } else { } tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]add_traf_type %d pg_found %s num_of_pg %d\n", "bnx2x_dcbx_get_num_pg_traf_type", 1128, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", add_traf_type, ! pg_found ? (char *)"NO" : (char *)"YES", (int )help_data->num_of_pg); } else { } add_traf_type = add_traf_type + 1U; ldv_52294: ; if (add_traf_type <= 2U) { goto ldv_52293; } else { } return; } } static void bnx2x_dcbx_ets_disabled_entry_data(struct bnx2x *bp , struct cos_help_data *cos_data , u32 pri_join_mask ) { { cos_data->data[0].pausable = ((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) == pri_join_mask; cos_data->data[0].pri_join_mask = pri_join_mask; cos_data->data[0].cos_bw = 100U; cos_data->num_of_cos = 1U; return; } } __inline static void bnx2x_dcbx_add_to_cos_bw(struct bnx2x *bp , struct cos_entry_help_data *data , u8 pg_bw ) { { if (data->cos_bw == 4294967295U) { data->cos_bw = (u32 )pg_bw; } else { data->cos_bw = data->cos_bw + (u32 )pg_bw; } return; } } static void bnx2x_dcbx_separate_pauseable_from_non(struct bnx2x *bp , struct cos_help_data *cos_data , u32 *pg_pri_orginal_spread , struct dcbx_ets_feature *ets ) { u32 pri_tested ; u8 i ; u8 entry ; u8 pg_entry ; u8 num_of_pri ; u32 tmp ; { pri_tested = 0U; i = 0U; entry = 0U; pg_entry = 0U; num_of_pri = 3U; cos_data->data[0].pausable = 1; cos_data->data[1].pausable = 0; tmp = 0U; cos_data->data[1].pri_join_mask = tmp; cos_data->data[0].pri_join_mask = tmp; i = 0U; goto ldv_52318; ldv_52317: pri_tested = (u32 )(1 << (int )bp->dcbx_port_params.app.traffic_type_priority[(int )i]); if ((bp->dcbx_port_params.pfc.priority_non_pauseable_mask & pri_tested) != 0U) { cos_data->data[1].pri_join_mask = cos_data->data[1].pri_join_mask | pri_tested; entry = 1U; } else { cos_data->data[0].pri_join_mask = cos_data->data[0].pri_join_mask | pri_tested; entry = 0U; } pg_entry = (unsigned char )*(pg_pri_orginal_spread + (unsigned long )bp->dcbx_port_params.app.traffic_type_priority[(int )i]); if ((unsigned int )pg_entry <= 7U) { bnx2x_dcbx_add_to_cos_bw(bp, (struct cos_entry_help_data *)(& cos_data->data) + (unsigned long )entry, (int )((u8 )(ets->pg_bw_tbl[(int )((unsigned int )pg_entry / 4U)] >> (~ ((int )pg_entry) & 3) * 8))); } else { cos_data->data[(int )entry].strict = 0U; } i = (u8 )((int )i + 1); ldv_52318: ; if ((int )i < (int )num_of_pri) { goto ldv_52317; } else { } if (cos_data->data[0].pri_join_mask == 0U && cos_data->data[1].pri_join_mask == 0U) { printk("\vbnx2x: [%s:%d(%s)]dcbx error: Both groups must have priorities\n", "bnx2x_dcbx_separate_pauseable_from_non", 1195, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static void bnx2x_dcbx_2cos_limit_cee_single_pg_to_cos_params(struct bnx2x *bp , struct pg_help_data *pg_help_data , struct cos_help_data *cos_data , u32 pri_join_mask , u8 num_of_dif_pri ) { u8 i ; u32 pri_tested ; u32 pri_mask_without_pri ; u32 *ttp ; bool tmp ; { i = 0U; pri_tested = 0U; pri_mask_without_pri = 0U; ttp = (u32 *)(& bp->dcbx_port_params.app.traffic_type_priority); if ((unsigned int )num_of_dif_pri == 1U) { bnx2x_dcbx_ets_disabled_entry_data(bp, cos_data, pri_join_mask); return; } else { } if ((unsigned int )pg_help_data->data[0].pg <= 7U) { if ((bp->dcbx_port_params.pfc.priority_non_pauseable_mask & pri_join_mask) != pri_join_mask && ((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) != pri_join_mask) { cos_data->data[0].pausable = 1; cos_data->data[1].pausable = 0; if ((unsigned int )num_of_dif_pri == 2U) { cos_data->data[0].cos_bw = 50U; cos_data->data[1].cos_bw = 50U; } else { } if ((unsigned int )num_of_dif_pri == 3U) { if (((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) != 0U && (((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) & (((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) - 1U)) == 0U) { cos_data->data[0].cos_bw = 33U; cos_data->data[1].cos_bw = 67U; } else { cos_data->data[0].cos_bw = 67U; cos_data->data[1].cos_bw = 33U; } } else { } } else if (((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) == pri_join_mask) { if ((unsigned int )num_of_dif_pri == 2U) { cos_data->data[0].cos_bw = 50U; cos_data->data[1].cos_bw = 50U; } else { cos_data->data[0].cos_bw = 67U; cos_data->data[1].cos_bw = 33U; } cos_data->data[1].pausable = 1; cos_data->data[0].pausable = 1; cos_data->data[0].pri_join_mask = (u32 )(~ ((int )((unsigned char )(1 << (int )*(ttp + 1UL))))) & pri_join_mask; cos_data->data[1].pri_join_mask = (u32 )(1 << (int )*(ttp + 1UL)); } else { bnx2x_dcbx_ets_disabled_entry_data(bp, cos_data, pri_join_mask); } } else if ((bp->dcbx_port_params.pfc.priority_non_pauseable_mask & pri_join_mask) != pri_join_mask && ((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) != pri_join_mask) { if (((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) > (bp->dcbx_port_params.pfc.priority_non_pauseable_mask & pri_join_mask)) { cos_data->data[0].strict = 0U; cos_data->data[1].strict = 1U; } else { cos_data->data[0].strict = 1U; cos_data->data[1].strict = 0U; } cos_data->data[0].pausable = 1; cos_data->data[1].pausable = 0; } else { tmp = ((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) == pri_join_mask; cos_data->data[1].pausable = tmp; cos_data->data[0].pausable = tmp; i = 0U; goto ldv_52334; ldv_52333: pri_tested = (u32 )(1 << (int )bp->dcbx_port_params.app.traffic_type_priority[(int )i]); pri_mask_without_pri = (u32 )(~ ((int )((unsigned char )pri_tested))) & pri_join_mask; if (pri_mask_without_pri < pri_tested) { goto ldv_52332; } else { } i = (u8 )((int )i + 1); ldv_52334: ; if ((unsigned int )i <= 2U) { goto ldv_52333; } else { } ldv_52332: ; if ((unsigned int )i == 3U) { printk("\vbnx2x: [%s:%d(%s)]Invalid value for pri_join_mask - could not find a priority\n", "bnx2x_dcbx_2cos_limit_cee_single_pg_to_cos_params", 1318, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } cos_data->data[0].pri_join_mask = pri_mask_without_pri; cos_data->data[1].pri_join_mask = pri_tested; cos_data->data[0].strict = 1U; cos_data->data[1].strict = 0U; } return; } } static void bnx2x_dcbx_2cos_limit_cee_two_pg_to_cos_params(struct bnx2x *bp , struct pg_help_data *pg_help_data , struct dcbx_ets_feature *ets , struct cos_help_data *cos_data , u32 *pg_pri_orginal_spread , u32 pri_join_mask , u8 num_of_dif_pri ) { u8 i ; u8 pg[2U] ; unsigned int tmp ; bool tmp___0 ; { i = 0U; pg[0] = 0U; tmp = 1U; while (1) { if (tmp >= 2U) { break; } else { } pg[tmp] = (unsigned char)0; tmp = tmp + 1U; } if ((bp->dcbx_port_params.pfc.priority_non_pauseable_mask & pri_join_mask) != pri_join_mask && ((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) != pri_join_mask) { if ((pg_help_data->data[0].pg_priority != (bp->dcbx_port_params.pfc.priority_non_pauseable_mask & pg_help_data->data[0].pg_priority) && pg_help_data->data[0].pg_priority != (pg_help_data->data[0].pg_priority & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))))) || (pg_help_data->data[1].pg_priority != (bp->dcbx_port_params.pfc.priority_non_pauseable_mask & pg_help_data->data[1].pg_priority) && pg_help_data->data[1].pg_priority != (pg_help_data->data[1].pg_priority & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask)))))) { bnx2x_dcbx_separate_pauseable_from_non(bp, cos_data, pg_pri_orginal_spread, ets); bp->dcbx_port_params.ets.enabled = 0U; return; } else { } cos_data->data[0].pausable = 1; cos_data->data[1].pausable = 0; if (pg_help_data->data[0].pg_priority == (pg_help_data->data[0].pg_priority & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))))) { cos_data->data[0].pri_join_mask = pg_help_data->data[0].pg_priority; pg[0] = pg_help_data->data[0].pg; cos_data->data[1].pri_join_mask = pg_help_data->data[1].pg_priority; pg[1] = pg_help_data->data[1].pg; } else { cos_data->data[0].pri_join_mask = pg_help_data->data[1].pg_priority; pg[0] = pg_help_data->data[1].pg; cos_data->data[1].pri_join_mask = pg_help_data->data[0].pg_priority; pg[1] = pg_help_data->data[0].pg; } } else { tmp___0 = ((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) == pri_join_mask; cos_data->data[1].pausable = tmp___0; cos_data->data[0].pausable = tmp___0; cos_data->data[0].pri_join_mask = pg_help_data->data[0].pg_priority; pg[0] = pg_help_data->data[0].pg; cos_data->data[1].pri_join_mask = pg_help_data->data[1].pg_priority; pg[1] = pg_help_data->data[1].pg; } i = 0U; goto ldv_52350; ldv_52349: ; if ((unsigned int )pg[(int )i] <= 7U) { cos_data->data[(int )i].cos_bw = (ets->pg_bw_tbl[(int )((unsigned int )pg[(int )i] / 4U)] >> (~ ((int )pg[(int )i]) & 3) * 8) & 255U; } else { cos_data->data[(int )i].strict = 0U; } i = (u8 )((int )i + 1); ldv_52350: ; if ((unsigned int )i <= 1U) { goto ldv_52349; } else { } return; } } static int bnx2x_dcbx_join_pgs(struct bnx2x *bp , struct dcbx_ets_feature *ets , struct pg_help_data *pg_help_data , u8 required_num_of_pg ) { u8 entry_joined ; u8 entry_removed ; u8 pg_joined ; { entry_joined = (unsigned int )pg_help_data->num_of_pg + 255U; entry_removed = (unsigned int )entry_joined + 1U; pg_joined = 0U; if ((unsigned int )required_num_of_pg == 0U || (unsigned int )pg_help_data->num_of_pg > 2U) { printk("\vbnx2x: [%s:%d(%s)]required_num_of_pg can\'t be zero\n", "bnx2x_dcbx_join_pgs", 1424, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } goto ldv_52367; ldv_52366: entry_joined = (unsigned int )pg_help_data->num_of_pg + 254U; entry_removed = (unsigned int )entry_joined + 1U; entry_removed = (u8 )((unsigned int )entry_removed % 3U); pg_help_data->data[(int )entry_joined].pg_priority = pg_help_data->data[(int )entry_joined].pg_priority | pg_help_data->data[(int )entry_removed].pg_priority; pg_help_data->data[(int )entry_joined].num_of_dif_pri = (int )pg_help_data->data[(int )entry_joined].num_of_dif_pri + (int )pg_help_data->data[(int )entry_removed].num_of_dif_pri; if ((unsigned int )pg_help_data->data[(int )entry_joined].pg == 15U || (unsigned int )pg_help_data->data[(int )entry_removed].pg == 15U) { pg_help_data->data[(int )entry_joined].pg = 15U; } else { pg_joined = (int )((u8 )(ets->pg_bw_tbl[(int )((unsigned int )pg_help_data->data[(int )entry_joined].pg / 4U)] >> (~ ((int )pg_help_data->data[(int )entry_joined].pg) & 3) * 8)) + (int )((u8 )(ets->pg_bw_tbl[(int )((unsigned int )pg_help_data->data[(int )entry_removed].pg / 4U)] >> (~ ((int )pg_help_data->data[(int )entry_removed].pg) & 3) * 8)); ets->pg_bw_tbl[(int )((unsigned int )pg_help_data->data[(int )entry_joined].pg / 4U)] = ets->pg_bw_tbl[(int )((unsigned int )pg_help_data->data[(int )entry_joined].pg / 4U)] & (u32 )(~ (255 << (~ ((int )pg_help_data->data[(int )entry_joined].pg) & 3) * 8)); ets->pg_bw_tbl[(int )((unsigned int )pg_help_data->data[(int )entry_joined].pg / 4U)] = ets->pg_bw_tbl[(int )((unsigned int )pg_help_data->data[(int )entry_joined].pg / 4U)] | (u32 )((int )pg_joined << (~ ((int )pg_help_data->data[(int )entry_joined].pg) & 3) * 8); } pg_help_data->num_of_pg = (u8 )((int )pg_help_data->num_of_pg - 1); ldv_52367: ; if ((int )pg_help_data->num_of_pg > (int )required_num_of_pg) { goto ldv_52366; } else { } return (0); } } static void bnx2x_dcbx_2cos_limit_cee_three_pg_to_cos_params(struct bnx2x *bp , struct pg_help_data *pg_help_data , struct dcbx_ets_feature *ets , struct cos_help_data *cos_data , u32 *pg_pri_orginal_spread , u32 pri_join_mask , u8 num_of_dif_pri ) { u8 i ; u32 pri_tested ; u8 entry ; u8 pg_entry ; bool b_found_strict ; u8 num_of_pri ; u32 tmp ; bool tmp___0 ; { i = 0U; pri_tested = 0U; entry = 0U; pg_entry = 0U; b_found_strict = 0; num_of_pri = 3U; tmp = 0U; cos_data->data[1].pri_join_mask = tmp; cos_data->data[0].pri_join_mask = tmp; if ((bp->dcbx_port_params.pfc.priority_non_pauseable_mask & pri_join_mask) != pri_join_mask && ((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) != pri_join_mask) { bnx2x_dcbx_separate_pauseable_from_non(bp, cos_data, pg_pri_orginal_spread, ets); } else { tmp___0 = ((u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask))) & pri_join_mask) == pri_join_mask; cos_data->data[1].pausable = tmp___0; cos_data->data[0].pausable = tmp___0; i = 0U; goto ldv_52385; ldv_52384: pri_tested = (u32 )(1 << (int )bp->dcbx_port_params.app.traffic_type_priority[(int )i]); pg_entry = (unsigned char )*(pg_pri_orginal_spread + (unsigned long )bp->dcbx_port_params.app.traffic_type_priority[(int )i]); if ((unsigned int )pg_entry <= 7U) { entry = 0U; if ((int )i == (int )num_of_pri + -1 && ! b_found_strict) { entry = 1U; } else { } cos_data->data[(int )entry].pri_join_mask = cos_data->data[(int )entry].pri_join_mask | pri_tested; bnx2x_dcbx_add_to_cos_bw(bp, (struct cos_entry_help_data *)(& cos_data->data) + (unsigned long )entry, (int )((u8 )(ets->pg_bw_tbl[(int )((unsigned int )pg_entry / 4U)] >> (~ ((int )pg_entry) & 3) * 8))); } else { b_found_strict = 1; cos_data->data[1].pri_join_mask = cos_data->data[1].pri_join_mask | pri_tested; cos_data->data[1].strict = 0U; } i = (u8 )((int )i + 1); ldv_52385: ; if ((int )i < (int )num_of_pri) { goto ldv_52384; } else { } } return; } } static void bnx2x_dcbx_2cos_limit_cee_fill_cos_params(struct bnx2x *bp , struct pg_help_data *help_data , struct dcbx_ets_feature *ets , struct cos_help_data *cos_data , u32 *pg_pri_orginal_spread , u32 pri_join_mask , u8 num_of_dif_pri ) { { cos_data->num_of_cos = 2U; switch ((int )help_data->num_of_pg) { case 1: bnx2x_dcbx_2cos_limit_cee_single_pg_to_cos_params(bp, help_data, cos_data, pri_join_mask, (int )num_of_dif_pri); goto ldv_52397; case 2: bnx2x_dcbx_2cos_limit_cee_two_pg_to_cos_params(bp, help_data, ets, cos_data, pg_pri_orginal_spread, pri_join_mask, (int )num_of_dif_pri); goto ldv_52397; case 3: bnx2x_dcbx_2cos_limit_cee_three_pg_to_cos_params(bp, help_data, ets, cos_data, pg_pri_orginal_spread, pri_join_mask, (int )num_of_dif_pri); goto ldv_52397; default: printk("\vbnx2x: [%s:%d(%s)]Wrong pg_help_data.num_of_pg\n", "bnx2x_dcbx_2cos_limit_cee_fill_cos_params", 1584, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_dcbx_ets_disabled_entry_data(bp, cos_data, pri_join_mask); } ldv_52397: ; return; } } static int bnx2x_dcbx_spread_strict_pri(struct bnx2x *bp , struct cos_help_data *cos_data , u8 entry , u8 num_spread_of_entries , u8 strict_app_pris ) { u8 strict_pri ; u8 num_of_app_pri ; u8 app_pri_bit ; struct cos_entry_help_data *data ; { strict_pri = 0U; num_of_app_pri = 8U; app_pri_bit = 0U; goto ldv_52414; ldv_52413: app_pri_bit = (u8 )(1 << ((int )num_of_app_pri + -1)); if ((unsigned int )((int )app_pri_bit & (int )strict_app_pris) != 0U) { data = (struct cos_entry_help_data *)(& cos_data->data) + (unsigned long )entry; num_spread_of_entries = (u8 )((int )num_spread_of_entries - 1); if ((unsigned int )num_spread_of_entries == 0U) { data->cos_bw = 4294967295U; data->strict = strict_pri; data->pri_join_mask = (u32 )strict_app_pris; data->pausable = (data->pri_join_mask & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask)))) != 0U; } else { strict_app_pris = (u8 )(~ ((int )((signed char )app_pri_bit)) & (int )((signed char )strict_app_pris)); data->cos_bw = 4294967295U; data->strict = strict_pri; data->pri_join_mask = (u32 )app_pri_bit; data->pausable = (data->pri_join_mask & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask)))) != 0U; } strict_pri = (unsigned int )strict_pri + 1U; entry = (u8 )((int )entry + 1); } else { } num_of_app_pri = (u8 )((int )num_of_app_pri - 1); ldv_52414: ; if ((unsigned int )num_spread_of_entries != 0U && (unsigned int )num_of_app_pri != 0U) { goto ldv_52413; } else { } if ((unsigned int )num_spread_of_entries != 0U) { printk("\vbnx2x: [%s:%d(%s)]Didn\'t succeed to spread strict priorities\n", "bnx2x_dcbx_spread_strict_pri", 1632, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } return (0); } } static u8 bnx2x_dcbx_cee_fill_strict_pri(struct bnx2x *bp , struct cos_help_data *cos_data , u8 entry , u8 num_spread_of_entries , u8 strict_app_pris ) { struct cos_entry_help_data *data ; int tmp ; { tmp = bnx2x_dcbx_spread_strict_pri(bp, cos_data, (int )entry, (int )num_spread_of_entries, (int )strict_app_pris); if (tmp != 0) { data = (struct cos_entry_help_data *)(& cos_data->data) + (unsigned long )entry; data->cos_bw = 4294967295U; data->strict = 0U; data->pri_join_mask = (u32 )strict_app_pris; data->pausable = (data->pri_join_mask & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask)))) != 0U; return (1U); } else { } return (num_spread_of_entries); } } static void bnx2x_dcbx_cee_fill_cos_params(struct bnx2x *bp , struct pg_help_data *help_data , struct dcbx_ets_feature *ets , struct cos_help_data *cos_data , u32 pri_join_mask ) { u8 need_num_of_entries ; u8 i ; u8 entry ; int tmp ; struct pg_entry_help_data *pg ; struct cos_entry_help_data *data ; u8 __min1 ; u8 __min2 ; u8 tmp___0 ; { need_num_of_entries = 0U; i = 0U; entry = 0U; if ((unsigned int )help_data->num_of_pg > 3U) { tmp = bnx2x_dcbx_join_pgs(bp, ets, help_data, 3); if (tmp != 0) { printk("\vbnx2x: [%s:%d(%s)]Unable to reduce the number of PGs - we will disables ETS\n", "bnx2x_dcbx_cee_fill_cos_params", 1681, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_dcbx_ets_disabled_entry_data(bp, cos_data, pri_join_mask); return; } else { } } else { } i = 0U; goto ldv_52442; ldv_52441: pg = (struct pg_entry_help_data *)(& help_data->data) + (unsigned long )i; if ((unsigned int )pg->pg <= 7U) { data = (struct cos_entry_help_data *)(& cos_data->data) + (unsigned long )entry; data->cos_bw = (ets->pg_bw_tbl[(int )((unsigned int )pg->pg / 4U)] >> (~ ((int )pg->pg) & 3) * 8) & 255U; data->strict = 3U; data->pri_join_mask = pg->pg_priority; data->pausable = (data->pri_join_mask & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask)))) != 0U; entry = (u8 )((int )entry + 1); } else { __min1 = pg->num_of_dif_pri; __min2 = 4U - (unsigned int )help_data->num_of_pg; need_num_of_entries = (u8 )((int )__min1 < (int )__min2 ? __min1 : __min2); tmp___0 = bnx2x_dcbx_cee_fill_strict_pri(bp, cos_data, (int )entry, (int )need_num_of_entries, (int )((u8 )pg->pg_priority)); entry = (int )tmp___0 + (int )entry; } i = (u8 )((int )i + 1); ldv_52442: ; if ((int )help_data->num_of_pg > (int )i) { goto ldv_52441; } else { } cos_data->num_of_cos = entry; return; } } static void bnx2x_dcbx_fill_cos_params(struct bnx2x *bp , struct pg_help_data *help_data , struct dcbx_ets_feature *ets , u32 *pg_pri_orginal_spread ) { struct cos_help_data cos_data ; u8 i ; u32 pri_join_mask ; u8 num_of_dif_pri ; struct bnx2x_dcbx_cos_params *p ; long tmp ; long tmp___0 ; { i = 0U; pri_join_mask = 0U; num_of_dif_pri = 0U; memset((void *)(& cos_data), 0, 40UL); i = 0U; goto ldv_52456; ldv_52455: ; if ((unsigned int )help_data->data[(int )i].pg != 15U && (unsigned int )help_data->data[(int )i].pg > 7U) { printk("\vbnx2x: [%s:%d(%s)]Invalid pg[%d] data %x\n", "bnx2x_dcbx_fill_cos_params", 1736, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i, (int )help_data->data[(int )i].pg); } else { } pri_join_mask = help_data->data[(int )i].pg_priority | pri_join_mask; num_of_dif_pri = (int )help_data->data[(int )i].num_of_dif_pri + (int )num_of_dif_pri; i = (u8 )((int )i + 1); ldv_52456: ; if ((int )help_data->num_of_pg > (int )i) { goto ldv_52455; } else { } cos_data.num_of_cos = 1U; i = 0U; goto ldv_52461; ldv_52460: cos_data.data[(int )i].pri_join_mask = 0U; cos_data.data[(int )i].pausable = 0; cos_data.data[(int )i].strict = 3U; cos_data.data[(int )i].cos_bw = 4294967295U; i = (u8 )((int )i + 1); ldv_52461: ; if ((unsigned int )i <= 2U) { goto ldv_52460; } else { } if ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U)) { bnx2x_dcbx_cee_fill_cos_params(bp, help_data, ets, & cos_data, pri_join_mask); } else { bnx2x_dcbx_2cos_limit_cee_fill_cos_params(bp, help_data, ets, & cos_data, pg_pri_orginal_spread, pri_join_mask, (int )num_of_dif_pri); } i = 0U; goto ldv_52465; ldv_52464: p = (struct bnx2x_dcbx_cos_params *)(& bp->dcbx_port_params.ets.cos_params) + (unsigned long )i; p->strict = cos_data.data[(int )i].strict; p->bw_tbl = cos_data.data[(int )i].cos_bw; p->pri_bitmask = cos_data.data[(int )i].pri_join_mask; p->pauseable = (u8 )cos_data.data[(int )i].pausable; if (p->bw_tbl != 4294967295U || (unsigned int )p->strict != 3U) { if (p->pri_bitmask == 0U) { printk("\vbnx2x: [%s:%d(%s)]Invalid pri_bitmask for %d\n", "bnx2x_dcbx_fill_cos_params", 1774, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i); } else { } if (((bp->common.chip_id >> 16 == 5730U || bp->common.chip_id >> 16 == 5731U) || bp->common.chip_id >> 16 == 5743U) || ((((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 0U : (bp->common.chip_id & 61440U) == 0U))) { if ((unsigned int )p->pauseable != 0U && (bp->dcbx_port_params.pfc.priority_non_pauseable_mask & p->pri_bitmask) != 0U) { printk("\vbnx2x: [%s:%d(%s)]Inconsistent config for pausable COS %d\n", "bnx2x_dcbx_fill_cos_params", 1782, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i); } else { } if ((unsigned int )p->pauseable == 0U && (p->pri_bitmask & (u32 )(~ ((int )((unsigned char )bp->dcbx_port_params.pfc.priority_non_pauseable_mask)))) != 0U) { printk("\vbnx2x: [%s:%d(%s)]Inconsistent config for nonpausable COS %d\n", "bnx2x_dcbx_fill_cos_params", 1788, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i); } else { } } else { } } else { } if ((unsigned int )p->pauseable != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]COS %d PAUSABLE prijoinmask 0x%x\n", "bnx2x_dcbx_fill_cos_params", 1794, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i, cos_data.data[(int )i].pri_join_mask); } else { } } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]COS %d NONPAUSABLE prijoinmask 0x%x\n", "bnx2x_dcbx_fill_cos_params", 1798, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )i, cos_data.data[(int )i].pri_join_mask); } else { } } i = (u8 )((int )i + 1); ldv_52465: ; if ((int )cos_data.num_of_cos > (int )i) { goto ldv_52464; } else { } bp->dcbx_port_params.ets.num_of_cos = cos_data.num_of_cos; return; } } static void bnx2x_dcbx_get_ets_pri_pg_tbl(struct bnx2x *bp , u32 *set_configuration_ets_pg , u32 *pri_pg_tbl ) { int i ; long tmp ; { i = 0; goto ldv_52475; ldv_52474: *(set_configuration_ets_pg + (unsigned long )i) = (*(pri_pg_tbl + (unsigned long )(i / 8)) >> ((3 - (i / 2) % 4) * 2 + i % 2) * 4) & 15U; tmp = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]set_configuration_ets_pg[%d] = 0x%x\n", "bnx2x_dcbx_get_ets_pri_pg_tbl", 1814, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, *(set_configuration_ets_pg + (unsigned long )i)); } else { } i = i + 1; ldv_52475: ; if (i <= 7) { goto ldv_52474; } else { } return; } } static void bnx2x_dcbx_fw_struct(struct bnx2x *bp , struct bnx2x_func_tx_start_params *pfc_fw_cfg ) { u16 pri_bit ; u8 cos ; u8 pri ; struct priority_cos *tt2cos ; u32 *ttp ; int mfw_configured ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; { pri_bit = 0U; cos = 0U; pri = 0U; ttp = (u32 *)(& bp->dcbx_port_params.app.traffic_type_priority); if (bp->common.shmem2_base != 0U) { tmp = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp > 188U) { tmp___0 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 188UL))); if ((tmp___0 & 4U) != 0U) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } } else { tmp___1 = 0; } mfw_configured = tmp___1; memset((void *)pfc_fw_cfg, 0, 36UL); if ((bp->dcbx_error & 64U) != 0U && mfw_configured == 0) { return; } else { } tt2cos = (struct priority_cos *)(& pfc_fw_cfg->traffic_type_to_priority_cos); bp->dcb_version = bp->dcb_version + 1; pfc_fw_cfg->dcb_version = (u8 )bp->dcb_version; pfc_fw_cfg->dcb_enabled = 1U; pri = 0U; goto ldv_52491; ldv_52490: (tt2cos + (unsigned long )pri)->priority = (u8 )*(ttp + (unsigned long )pri); pri_bit = (u16 )(1 << (int )(tt2cos + (unsigned long )pri)->priority); cos = 0U; goto ldv_52488; ldv_52487: ; if ((bp->dcbx_port_params.ets.cos_params[(int )cos].pri_bitmask & (u32 )pri_bit) != 0U) { (tt2cos + (unsigned long )pri)->cos = cos; } else { } cos = (u8 )((int )cos + 1); ldv_52488: ; if ((int )bp->dcbx_port_params.ets.num_of_cos > (int )cos) { goto ldv_52487; } else { } pri = (u8 )((int )pri + 1); ldv_52491: ; if ((unsigned int )pri <= 2U) { goto ldv_52490; } else { } pfc_fw_cfg->dont_add_pri_0_en = 1U; bnx2x_dcbx_print_cos_params(bp, pfc_fw_cfg); return; } } void bnx2x_dcbx_pmf_update(struct bnx2x *bp ) { int tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; { if (bp->common.shmem2_base != 0U) { tmp___0 = readl((void const volatile *)bp->regview + (unsigned long )bp->common.shmem2_base); if (tmp___0 > 188U) { tmp___1 = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + 188UL))); if ((int )tmp___1 & 1) { tmp = bnx2x_dcbx_read_shmem_neg_results(bp); if (tmp != 0) { return; } else { } bnx2x_dump_dcbx_drv_param(bp, & bp->dcbx_local_feat, bp->dcbx_error); bnx2x_get_dcbx_drv_param(bp, & bp->dcbx_local_feat, bp->dcbx_error); bnx2x_dcbnl_update_applist(bp, 0); dcbnl_cee_notify(bp->dev, 78, 26, 0U, 0U); bnx2x_dcbx_update_tc_mapping(bp); } else { } } else { } } else { } return; } } __inline static bool bnx2x_dcbnl_set_valid(struct bnx2x *bp ) { { return ((bool )((unsigned int )bp->dcb_state != 0U && (int )bp->dcbx_mode_uset)); } } static u8 bnx2x_dcbnl_get_state(struct net_device *netdev ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]state = %d\n", "bnx2x_dcbnl_get_state", 1911, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->dcb_state); } else { } return ((u8 )bp->dcb_state); } } static u8 bnx2x_dcbnl_set_state(struct net_device *netdev , u8 state ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]state = %s\n", "bnx2x_dcbnl_set_state", 1918, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state != 0U ? (char *)"on" : (char *)"off"); } else { } if ((unsigned int )state != 0U && (bp->dcbx_enabled == 0 || bp->dcbx_enabled == -1)) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Can not set dcbx to enabled while it is disabled in nvm\n", "bnx2x_dcbnl_set_state", 1923, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (1U); } else { } bnx2x_dcbx_set_state(bp, (unsigned int )state != 0U, (u32 )bp->dcbx_enabled); return (0U); } } static void bnx2x_dcbnl_get_perm_hw_addr(struct net_device *netdev , u8 *perm_addr ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]GET-PERM-ADDR\n", "bnx2x_dcbnl_get_perm_hw_addr", 1935, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } memcpy((void *)perm_addr, (void const *)netdev->dev_addr, (size_t )netdev->addr_len); if ((int )bp->cnic_loaded) { memcpy((void *)perm_addr + (unsigned long )netdev->addr_len, (void const *)(& bp->fip_mac), (size_t )netdev->addr_len); } else { } return; } } static void bnx2x_dcbnl_set_pg_tccfg_tx(struct net_device *netdev , int prio , u8 prio_type , u8 pgid , u8 bw_pct , u8 up_map ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]prio[%d] = %d\n", "bnx2x_dcbnl_set_pg_tccfg_tx", 1952, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prio, (int )pgid); } else { } tmp___1 = bnx2x_dcbnl_set_valid(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2 || prio > 7) { return; } else { } bp->dcbx_config_params.admin_configuration_ets_pg[prio] = (u32 )pgid; bp->dcbx_config_params.admin_ets_configuration_tx_enable = 1U; return; } } static void bnx2x_dcbnl_set_pg_bwgcfg_tx(struct net_device *netdev , int pgid , u8 bw_pct ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pgid[%d] = %d\n", "bnx2x_dcbnl_set_pg_bwgcfg_tx", 1977, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", pgid, (int )bw_pct); } else { } tmp___1 = bnx2x_dcbnl_set_valid(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2 || pgid > 7) { return; } else { } bp->dcbx_config_params.admin_configuration_bw_precentage[pgid] = (u32 )bw_pct; bp->dcbx_config_params.admin_ets_configuration_tx_enable = 1U; return; } } static void bnx2x_dcbnl_set_pg_tccfg_rx(struct net_device *netdev , int prio , u8 prio_type , u8 pgid , u8 bw_pct , u8 up_map ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Nothing to set; No RX support\n", "bnx2x_dcbnl_set_pg_tccfg_rx", 1991, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static void bnx2x_dcbnl_set_pg_bwgcfg_rx(struct net_device *netdev , int pgid , u8 bw_pct ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Nothing to set; No RX support\n", "bnx2x_dcbnl_set_pg_bwgcfg_rx", 1998, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } } static void bnx2x_dcbnl_get_pg_tccfg_tx(struct net_device *netdev , int prio , u8 *prio_type , u8 *pgid , u8 *bw_pct , u8 *up_map ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; u8 tmp___1 ; u8 tmp___2 ; u8 tmp___3 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]prio = %d\n", "bnx2x_dcbnl_get_pg_tccfg_tx", 2006, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prio); } else { } tmp___3 = 0U; *pgid = tmp___3; tmp___2 = tmp___3; *prio_type = tmp___2; tmp___1 = tmp___2; *bw_pct = tmp___1; *up_map = tmp___1; if ((unsigned int )bp->dcb_state == 0U || prio > 7) { return; } else { } *pgid = (unsigned int )((u8 )(bp->dcbx_local_feat.ets.pri_pg_tbl[prio / 8] >> ((3 - (prio / 2) % 4) * 2 + prio % 2) * 4)) & 15U; return; } } static void bnx2x_dcbnl_get_pg_bwgcfg_tx(struct net_device *netdev , int pgid , u8 *bw_pct ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pgid = %d\n", "bnx2x_dcbnl_get_pg_bwgcfg_tx", 2032, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", pgid); } else { } *bw_pct = 0U; if ((unsigned int )bp->dcb_state == 0U || pgid > 7) { return; } else { } *bw_pct = (u8 )(bp->dcbx_local_feat.ets.pg_bw_tbl[pgid / 4] >> (3 - pgid % 4) * 8); return; } } static void bnx2x_dcbnl_get_pg_tccfg_rx(struct net_device *netdev , int prio , u8 *prio_type , u8 *pgid , u8 *bw_pct , u8 *up_map ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; u8 tmp___1 ; u8 tmp___2 ; u8 tmp___3 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Nothing to get; No RX support\n", "bnx2x_dcbnl_get_pg_tccfg_rx", 2047, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___3 = 0U; *up_map = tmp___3; tmp___2 = tmp___3; *bw_pct = tmp___2; tmp___1 = tmp___2; *pgid = tmp___1; *prio_type = tmp___1; return; } } static void bnx2x_dcbnl_get_pg_bwgcfg_rx(struct net_device *netdev , int pgid , u8 *bw_pct ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Nothing to get; No RX support\n", "bnx2x_dcbnl_get_pg_bwgcfg_rx", 2056, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } *bw_pct = 0U; return; } } static void bnx2x_dcbnl_set_pfc_cfg(struct net_device *netdev , int prio , u8 setting ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]prio[%d] = %d\n", "bnx2x_dcbnl_set_pfc_cfg", 2065, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prio, (int )setting); } else { } tmp___1 = bnx2x_dcbnl_set_valid(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2 || prio > 7) { return; } else { } if ((unsigned int )setting != 0U) { bp->dcbx_config_params.admin_pfc_bitmap = bp->dcbx_config_params.admin_pfc_bitmap | (u32 )(1 << prio); bp->dcbx_config_params.admin_pfc_tx_enable = 1U; } else { bp->dcbx_config_params.admin_pfc_bitmap = bp->dcbx_config_params.admin_pfc_bitmap & (u32 )(~ (1 << prio)); } return; } } static void bnx2x_dcbnl_get_pfc_cfg(struct net_device *netdev , int prio , u8 *setting ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]prio = %d\n", "bnx2x_dcbnl_get_pfc_cfg", 2082, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", prio); } else { } *setting = 0U; if ((unsigned int )bp->dcb_state == 0U || prio > 7) { return; } else { } *setting = (unsigned int )((u8 )((int )bp->dcbx_local_feat.pfc.pri_en_bitmap >> prio)) & 1U; return; } } static u8 bnx2x_dcbnl_set_all(struct net_device *netdev ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; long tmp___4 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]SET-ALL\n", "bnx2x_dcbnl_set_all", 2096, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___1 = bnx2x_dcbnl_set_valid(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { return (1U); } else { } if ((unsigned int )bp->recovery_state != 0U) { netdev_err((struct net_device const *)bp->dev, "Handling parity error recovery. Try again later\n"); return (1U); } else { } tmp___3 = netif_running((struct net_device const *)bp->dev); if ((int )tmp___3) { bnx2x_update_drv_flags(bp, 4U, 1U); bnx2x_dcbx_init(bp, 1); } else { } tmp___4 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]set_dcbx_params done\n", "bnx2x_dcbnl_set_all", 2112, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0U); } } static u8 bnx2x_dcbnl_get_cap(struct net_device *netdev , int capid , u8 *cap ) { struct bnx2x *bp ; void *tmp ; u8 rval ; long tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; rval = 0U; if ((unsigned int )bp->dcb_state != 0U) { switch (capid) { case 2: *cap = 1U; goto ldv_52611; case 3: *cap = 1U; goto ldv_52611; case 4: *cap = 0U; goto ldv_52611; case 5: *cap = 128U; goto ldv_52611; case 6: *cap = 128U; goto ldv_52611; case 7: *cap = 1U; goto ldv_52611; case 8: *cap = 0U; goto ldv_52611; case 9: *cap = 22U; goto ldv_52611; default: printk("\vbnx2x: [%s:%d(%s)]Non valid capability ID\n", "bnx2x_dcbnl_get_cap", 2149, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rval = 1U; goto ldv_52611; } ldv_52611: ; } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCB disabled\n", "bnx2x_dcbnl_get_cap", 2154, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rval = 1U; } tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]capid %d:%x\n", "bnx2x_dcbnl_get_cap", 2158, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", capid, (int )*cap); } else { } return (rval); } } static int bnx2x_dcbnl_get_numtcs(struct net_device *netdev , int tcid , u8 *num ) { struct bnx2x *bp ; void *tmp ; u8 rval ; long tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; rval = 0U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]tcid %d\n", "bnx2x_dcbnl_get_numtcs", 2167, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tcid); } else { } if ((unsigned int )bp->dcb_state != 0U) { switch (tcid) { case 2: *num = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 3U : 2U; goto ldv_52630; case 3: *num = (((((((((bp->common.chip_id >> 16 == 5770U || bp->common.chip_id >> 16 == 5797U) || bp->common.chip_id >> 16 == 5801U) || bp->common.chip_id >> 16 == 5774U) || bp->common.chip_id >> 16 == 5806U) || bp->common.chip_id >> 16 == 5807U) || ((bp->common.chip_id >> 16 == 5693U || bp->common.chip_id >> 16 == 5694U) || bp->common.chip_id >> 16 == 5695U)) || ((bp->common.chip_id >> 16 == 5793U || bp->common.chip_id >> 16 == 5794U) || bp->common.chip_id >> 16 == 5773U)) || (bp->common.chip_id >> 16 == 5796U || bp->common.chip_id >> 16 == 5803U)) || bp->common.chip_id >> 16 == 5805U) && ((bp->common.chip_id & 61440U) > 20480U ? ((~ bp->common.chip_id & 61440U) >> 13) << 12 == 4096U : (bp->common.chip_id & 61440U) == 4096U) ? 3U : 2U; goto ldv_52630; default: printk("\vbnx2x: [%s:%d(%s)]Non valid TC-ID\n", "bnx2x_dcbnl_get_numtcs", 2180, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rval = 1U; goto ldv_52630; } ldv_52630: ; } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCB disabled\n", "bnx2x_dcbnl_get_numtcs", 2185, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rval = 1U; } return ((int )rval); } } static int bnx2x_dcbnl_set_numtcs(struct net_device *netdev , int tcid , u8 num ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]num tcs = %d; Not supported\n", "bnx2x_dcbnl_set_numtcs", 2195, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )num); } else { } return (-22); } } static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]state = %d\n", "bnx2x_dcbnl_get_pfc_state", 2202, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->dcbx_local_feat.pfc.enabled); } else { } if ((unsigned int )bp->dcb_state == 0U) { return (0U); } else { } return (bp->dcbx_local_feat.pfc.enabled); } } static void bnx2x_dcbnl_set_pfc_state(struct net_device *netdev , u8 state ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; u32 tmp___3 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]state = %s\n", "bnx2x_dcbnl_set_pfc_state", 2213, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state != 0U ? (char *)"on" : (char *)"off"); } else { } tmp___1 = bnx2x_dcbnl_set_valid(bp); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { return; } else { } tmp___3 = (unsigned int )state != 0U; bp->dcbx_config_params.admin_pfc_enable = tmp___3; bp->dcbx_config_params.admin_pfc_tx_enable = tmp___3; return; } } static void bnx2x_admin_app_set_ent(struct bnx2x_admin_priority_app_table *app_ent , u8 idtype , u16 idval , u8 up___0 ) { { app_ent->valid = 1U; switch ((int )idtype) { case 0: app_ent->traffic_type = 0U; goto ldv_52658; case 1: app_ent->traffic_type = 1U; goto ldv_52658; default: ; goto ldv_52658; } ldv_52658: app_ent->app_id = (u32 )idval; app_ent->priority = (u32 )up___0; return; } } static bool bnx2x_admin_app_is_equal(struct bnx2x_admin_priority_app_table *app_ent , u8 idtype , u16 idval ) { { if (app_ent->valid == 0U) { return (0); } else { } switch ((int )idtype) { case 0: ; if (app_ent->traffic_type != 0U) { return (0); } else { } goto ldv_52667; case 1: ; if (app_ent->traffic_type != 1U) { return (0); } else { } goto ldv_52667; default: ; return (0); } ldv_52667: ; if (app_ent->app_id != (u32 )idval) { return (0); } else { } return (1); } } static int bnx2x_set_admin_app_up(struct bnx2x *bp , u8 idtype , u16 idval , u8 up___0 ) { int i ; int ff ; struct bnx2x_admin_priority_app_table *app_ent ; bool tmp ; { i = 0; ff = -1; goto ldv_52681; ldv_52680: app_ent = (struct bnx2x_admin_priority_app_table *)(& bp->dcbx_config_params.admin_priority_app_table) + (unsigned long )i; tmp = bnx2x_admin_app_is_equal(app_ent, (int )idtype, (int )idval); if ((int )tmp) { goto ldv_52679; } else { } if (ff < 0 && app_ent->valid == 0U) { ff = i; } else { } i = i + 1; ldv_52681: ; if (i <= 3) { goto ldv_52680; } else { } ldv_52679: ; if (i <= 3) { bp->dcbx_config_params.admin_priority_app_table[i].priority = (u32 )up___0; } else if (ff >= 0) { bnx2x_admin_app_set_ent((struct bnx2x_admin_priority_app_table *)(& bp->dcbx_config_params.admin_priority_app_table) + (unsigned long )ff, (int )idtype, (int )idval, (int )up___0); } else { printk("\vbnx2x: [%s:%d(%s)]Application table is too large\n", "bnx2x_set_admin_app_up", 2292, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-16); } if ((unsigned int )up___0 != 0U) { bp->dcbx_config_params.admin_application_priority_tx_enable = 1U; } else { } return (0); } } static int bnx2x_dcbnl_set_app_up(struct net_device *netdev , u8 idtype , u16 idval , u8 up___0 ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; long tmp___1 ; bool tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]app_type %d, app_id %x, prio bitmap %d\n", "bnx2x_dcbnl_set_app_up", 2309, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )idtype, (int )idval, (int )up___0); } else { } tmp___2 = bnx2x_dcbnl_set_valid(bp); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbnl call not valid\n", "bnx2x_dcbnl_set_app_up", 2312, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } switch ((int )idtype) { case 0: ; case 1: ; goto ldv_52693; default: tmp___4 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Wrong ID type\n", "bnx2x_dcbnl_set_app_up", 2322, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } ldv_52693: tmp___5 = bnx2x_set_admin_app_up(bp, (int )idtype, (int )idval, (int )up___0); return (tmp___5); } } static u8 bnx2x_dcbnl_get_dcbx(struct net_device *netdev ) { struct bnx2x *bp ; void *tmp ; u8 state ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; state = 6U; if (bp->dcbx_enabled == 1) { state = (u8 )((unsigned int )state | 16U); } else { } return (state); } } static u8 bnx2x_dcbnl_set_dcbx(struct net_device *netdev , u8 state ) { struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]state = %02x\n", "bnx2x_dcbnl_set_dcbx", 2344, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )state); } else { } if (((int )state & 22) != (int )state) { printk("\vbnx2x: [%s:%d(%s)]Requested DCBX mode %x is beyond advertised capabilities\n", "bnx2x_dcbnl_set_dcbx", 2350, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )state); return (1U); } else { } if ((unsigned int )bp->dcb_state != 1U) { printk("\vbnx2x: [%s:%d(%s)]DCB turned off, DCBX configuration is invalid\n", "bnx2x_dcbnl_set_dcbx", 2355, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (1U); } else { } if (((int )state & 16) != 0) { bp->dcbx_enabled = 1; } else { bp->dcbx_enabled = 2; } bp->dcbx_mode_uset = 1; return (0U); } } static u8 bnx2x_dcbnl_get_featcfg(struct net_device *netdev , int featid , u8 *flags ) { struct bnx2x *bp ; void *tmp ; u8 rval ; long tmp___0 ; long tmp___1 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; rval = 0U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]featid %d\n", "bnx2x_dcbnl_get_featcfg", 2374, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", featid); } else { } if ((unsigned int )bp->dcb_state != 0U) { *flags = 0U; switch (featid) { case 2: ; if (bp->dcbx_local_feat.ets.enabled != 0U) { *flags = (u8 )((unsigned int )*flags | 2U); } else { } if ((bp->dcbx_error & 65U) != 0U) { *flags = (u8 )((unsigned int )*flags | 1U); } else { } goto ldv_52715; case 3: ; if ((unsigned int )bp->dcbx_local_feat.pfc.enabled != 0U) { *flags = (u8 )((unsigned int )*flags | 2U); } else { } if ((bp->dcbx_error & 82U) != 0U) { *flags = (u8 )((unsigned int )*flags | 1U); } else { } goto ldv_52715; case 4: ; if ((unsigned int )bp->dcbx_local_feat.app.enabled != 0U) { *flags = (u8 )((unsigned int )*flags | 2U); } else { } if ((bp->dcbx_error & 100U) != 0U) { *flags = (u8 )((unsigned int )*flags | 1U); } else { } goto ldv_52715; default: printk("\vbnx2x: [%s:%d(%s)]Non valid feature-ID\n", "bnx2x_dcbnl_get_featcfg", 2403, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rval = 1U; goto ldv_52715; } ldv_52715: ; } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]DCB disabled\n", "bnx2x_dcbnl_get_featcfg", 2408, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rval = 1U; } return (rval); } } static u8 bnx2x_dcbnl_set_featcfg(struct net_device *netdev , int featid , u8 flags ) { struct bnx2x *bp ; void *tmp ; u8 rval ; long tmp___0 ; long tmp___1 ; bool tmp___2 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; rval = 0U; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]featid = %d flags = %02x\n", "bnx2x_dcbnl_set_featcfg", 2421, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", featid, (int )flags); } else { } tmp___2 = bnx2x_dcbnl_set_valid(bp); if ((int )tmp___2) { switch (featid) { case 2: bp->dcbx_config_params.admin_ets_enable = ((int )flags & 2) != 0; bp->dcbx_config_params.admin_ets_willing = ((int )flags & 4) != 0; goto ldv_52728; case 3: bp->dcbx_config_params.admin_pfc_enable = ((int )flags & 2) != 0; bp->dcbx_config_params.admin_pfc_willing = ((int )flags & 4) != 0; goto ldv_52728; case 4: bp->dcbx_config_params.admin_app_priority_willing = ((int )flags & 4) != 0; goto ldv_52728; default: printk("\vbnx2x: [%s:%d(%s)]Non valid feature-ID\n", "bnx2x_dcbnl_set_featcfg", 2444, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rval = 1U; goto ldv_52728; } ldv_52728: ; } else { tmp___1 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]dcbnl call not valid\n", "bnx2x_dcbnl_set_featcfg", 2449, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rval = 1U; } return (rval); } } static int bnx2x_peer_appinfo(struct net_device *netdev , struct dcb_peer_app_info *info , u16 *app_count ) { int i ; struct bnx2x *bp ; void *tmp ; long tmp___0 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]APP-INFO\n", "bnx2x_peer_appinfo", 2462, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } info->willing = (__u8 )(bp->dcbx_remote_flags & 1024U); info->error = (__u8 )(bp->dcbx_remote_flags & 64U); *app_count = 0U; i = 0; goto ldv_52741; ldv_52740: ; if ((int )bp->dcbx_remote_feat.app.app_pri_tbl[i].appBitfield & 1) { *app_count = (u16 )((int )*app_count + 1); } else { } i = i + 1; ldv_52741: ; if (i <= 15) { goto ldv_52740; } else { } return (0); } } static int bnx2x_peer_apptable(struct net_device *netdev , struct dcb_app *table ) { int i ; int j ; struct bnx2x *bp ; void *tmp ; long tmp___0 ; struct dcbx_app_priority_entry *ent ; int tmp___1 ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; tmp___0 = ldv__builtin_expect((bp->msg_enable & 134217728) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]APP-TABLE\n", "bnx2x_peer_apptable", 2481, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } i = 0; j = 0; goto ldv_52753; ldv_52752: ent = (struct dcbx_app_priority_entry *)(& bp->dcbx_remote_feat.app.app_pri_tbl) + (unsigned long )i; if ((int )ent->appBitfield & 1) { (table + (unsigned long )j)->selector = bnx2x_dcbx_dcbnl_app_idtype(ent); (table + (unsigned long )j)->priority = bnx2x_dcbx_dcbnl_app_up(ent); tmp___1 = j; j = j + 1; (table + (unsigned long )tmp___1)->protocol = ent->app_id; } else { } i = i + 1; ldv_52753: ; if (i <= 15) { goto ldv_52752; } else { } return (0); } } static int bnx2x_cee_peer_getpg(struct net_device *netdev , struct cee_pg *pg ) { int i ; struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; pg->willing = (__u8 )(bp->dcbx_remote_flags & 256U); i = 0; goto ldv_52762; ldv_52761: pg->pg_bw[i] = (__u8 )(bp->dcbx_remote_feat.ets.pg_bw_tbl[i / 4] >> (3 - i % 4) * 8); pg->prio_pg[i] = (unsigned int )((__u8 )(bp->dcbx_remote_feat.ets.pri_pg_tbl[i / 8] >> ((3 - (i / 2) % 4) * 2 + i % 2) * 4)) & 15U; i = i + 1; ldv_52762: ; if (i <= 7) { goto ldv_52761; } else { } return (0); } } static int bnx2x_cee_peer_getpfc(struct net_device *netdev , struct cee_pfc *pfc ) { struct bnx2x *bp ; void *tmp ; { tmp = netdev_priv((struct net_device const *)netdev); bp = (struct bnx2x *)tmp; pfc->tcs_supported = bp->dcbx_remote_feat.pfc.pfc_caps; pfc->pfc_en = bp->dcbx_remote_feat.pfc.pri_en_bitmap; return (0); } } struct dcbnl_rtnl_ops const bnx2x_dcbnl_ops = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & bnx2x_dcbnl_get_state, & bnx2x_dcbnl_set_state, & bnx2x_dcbnl_get_perm_hw_addr, & bnx2x_dcbnl_set_pg_tccfg_tx, & bnx2x_dcbnl_set_pg_bwgcfg_tx, & bnx2x_dcbnl_set_pg_tccfg_rx, & bnx2x_dcbnl_set_pg_bwgcfg_rx, & bnx2x_dcbnl_get_pg_tccfg_tx, & bnx2x_dcbnl_get_pg_bwgcfg_tx, & bnx2x_dcbnl_get_pg_tccfg_rx, & bnx2x_dcbnl_get_pg_bwgcfg_rx, & bnx2x_dcbnl_set_pfc_cfg, & bnx2x_dcbnl_get_pfc_cfg, & bnx2x_dcbnl_set_all, & bnx2x_dcbnl_get_cap, & bnx2x_dcbnl_get_numtcs, & bnx2x_dcbnl_set_numtcs, & bnx2x_dcbnl_get_pfc_state, & bnx2x_dcbnl_set_pfc_state, 0, 0, 0, 0, & bnx2x_dcbnl_set_app_up, 0, & bnx2x_dcbnl_get_featcfg, & bnx2x_dcbnl_set_featcfg, & bnx2x_dcbnl_get_dcbx, & bnx2x_dcbnl_set_dcbx, & bnx2x_peer_appinfo, & bnx2x_peer_apptable, & bnx2x_cee_peer_getpg, & bnx2x_cee_peer_getpfc}; void ldv_initialize_dcbnl_rtnl_ops_10(void) { void *tmp ; { tmp = ldv_init_zalloc(3008UL); bnx2x_dcbnl_ops_group0 = (struct net_device *)tmp; return; } } void ldv_main_exported_10(void) { int ldvarg148 ; int ldvarg139 ; u8 ldvarg162 ; struct cee_pfc *ldvarg117 ; void *tmp ; u8 ldvarg130 ; int ldvarg159 ; u8 *ldvarg143 ; void *tmp___0 ; int ldvarg150 ; int ldvarg133 ; u8 *ldvarg124 ; void *tmp___1 ; int ldvarg116 ; u16 ldvarg127 ; int ldvarg164 ; u8 ldvarg147 ; int ldvarg119 ; int ldvarg135 ; u8 *ldvarg120 ; void *tmp___2 ; struct cee_pg *ldvarg166 ; void *tmp___3 ; int ldvarg156 ; u8 *ldvarg153 ; void *tmp___4 ; int ldvarg123 ; u8 ldvarg126 ; u8 ldvarg128 ; int ldvarg144 ; u8 *ldvarg122 ; void *tmp___5 ; u8 ldvarg137 ; u8 *ldvarg151 ; void *tmp___6 ; u8 *ldvarg154 ; void *tmp___7 ; u8 *ldvarg121 ; void *tmp___8 ; u8 ldvarg158 ; u8 *ldvarg160 ; void *tmp___9 ; struct dcb_peer_app_info *ldvarg142 ; void *tmp___10 ; u8 ldvarg161 ; u8 *ldvarg149 ; void *tmp___11 ; u8 ldvarg129 ; u8 ldvarg163 ; u8 ldvarg138 ; u8 *ldvarg132 ; void *tmp___12 ; int ldvarg152 ; u8 ldvarg140 ; u8 *ldvarg145 ; void *tmp___13 ; u8 ldvarg167 ; u8 *ldvarg155 ; void *tmp___14 ; struct dcb_app *ldvarg125 ; void *tmp___15 ; u8 ldvarg165 ; int ldvarg168 ; u8 ldvarg136 ; u8 *ldvarg115 ; void *tmp___16 ; u8 ldvarg118 ; u16 *ldvarg141 ; void *tmp___17 ; u8 *ldvarg157 ; void *tmp___18 ; int ldvarg146 ; u8 ldvarg134 ; u8 ldvarg131 ; int tmp___19 ; { tmp = ldv_init_zalloc(4UL); ldvarg117 = (struct cee_pfc *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg143 = (u8 *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg124 = (u8 *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg120 = (u8 *)tmp___2; tmp___3 = ldv_init_zalloc(20UL); ldvarg166 = (struct cee_pg *)tmp___3; tmp___4 = ldv_init_zalloc(1UL); ldvarg153 = (u8 *)tmp___4; tmp___5 = ldv_init_zalloc(1UL); ldvarg122 = (u8 *)tmp___5; tmp___6 = ldv_init_zalloc(1UL); ldvarg151 = (u8 *)tmp___6; tmp___7 = ldv_init_zalloc(1UL); ldvarg154 = (u8 *)tmp___7; tmp___8 = ldv_init_zalloc(1UL); ldvarg121 = (u8 *)tmp___8; tmp___9 = ldv_init_zalloc(1UL); ldvarg160 = (u8 *)tmp___9; tmp___10 = ldv_init_zalloc(2UL); ldvarg142 = (struct dcb_peer_app_info *)tmp___10; tmp___11 = ldv_init_zalloc(1UL); ldvarg149 = (u8 *)tmp___11; tmp___12 = ldv_init_zalloc(1UL); ldvarg132 = (u8 *)tmp___12; tmp___13 = ldv_init_zalloc(1UL); ldvarg145 = (u8 *)tmp___13; tmp___14 = ldv_init_zalloc(1UL); ldvarg155 = (u8 *)tmp___14; tmp___15 = ldv_init_zalloc(4UL); ldvarg125 = (struct dcb_app *)tmp___15; tmp___16 = ldv_init_zalloc(1UL); ldvarg115 = (u8 *)tmp___16; tmp___17 = ldv_init_zalloc(2UL); ldvarg141 = (u16 *)tmp___17; tmp___18 = ldv_init_zalloc(1UL); ldvarg157 = (u8 *)tmp___18; ldv_memset((void *)(& ldvarg148), 0, 4UL); ldv_memset((void *)(& ldvarg139), 0, 4UL); ldv_memset((void *)(& ldvarg162), 0, 1UL); ldv_memset((void *)(& ldvarg130), 0, 1UL); ldv_memset((void *)(& ldvarg159), 0, 4UL); ldv_memset((void *)(& ldvarg150), 0, 4UL); ldv_memset((void *)(& ldvarg133), 0, 4UL); ldv_memset((void *)(& ldvarg116), 0, 4UL); ldv_memset((void *)(& ldvarg127), 0, 2UL); ldv_memset((void *)(& ldvarg164), 0, 4UL); ldv_memset((void *)(& ldvarg147), 0, 1UL); ldv_memset((void *)(& ldvarg119), 0, 4UL); ldv_memset((void *)(& ldvarg135), 0, 4UL); ldv_memset((void *)(& ldvarg156), 0, 4UL); ldv_memset((void *)(& ldvarg123), 0, 4UL); ldv_memset((void *)(& ldvarg126), 0, 1UL); ldv_memset((void *)(& ldvarg128), 0, 1UL); ldv_memset((void *)(& ldvarg144), 0, 4UL); ldv_memset((void *)(& ldvarg137), 0, 1UL); ldv_memset((void *)(& ldvarg158), 0, 1UL); ldv_memset((void *)(& ldvarg161), 0, 1UL); ldv_memset((void *)(& ldvarg129), 0, 1UL); ldv_memset((void *)(& ldvarg163), 0, 1UL); ldv_memset((void *)(& ldvarg138), 0, 1UL); ldv_memset((void *)(& ldvarg152), 0, 4UL); ldv_memset((void *)(& ldvarg140), 0, 1UL); ldv_memset((void *)(& ldvarg167), 0, 1UL); ldv_memset((void *)(& ldvarg165), 0, 1UL); ldv_memset((void *)(& ldvarg168), 0, 4UL); ldv_memset((void *)(& ldvarg136), 0, 1UL); ldv_memset((void *)(& ldvarg118), 0, 1UL); ldv_memset((void *)(& ldvarg146), 0, 4UL); ldv_memset((void *)(& ldvarg134), 0, 1UL); ldv_memset((void *)(& ldvarg131), 0, 1UL); tmp___19 = __VERIFIER_nondet_int(); switch (tmp___19) { case 0: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_pfc_cfg(bnx2x_dcbnl_ops_group0, ldvarg168, (int )ldvarg167); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 1: ; if (ldv_state_variable_10 == 1) { bnx2x_cee_peer_getpg(bnx2x_dcbnl_ops_group0, ldvarg166); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 2: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_pg_tccfg_rx(bnx2x_dcbnl_ops_group0, ldvarg164, (int )ldvarg163, (int )ldvarg162, (int )ldvarg165, (int )ldvarg161); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 3: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_perm_hw_addr(bnx2x_dcbnl_ops_group0, ldvarg160); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 4: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_pg_bwgcfg_tx(bnx2x_dcbnl_ops_group0, ldvarg159, (int )ldvarg158); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 5: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_pg_tccfg_tx(bnx2x_dcbnl_ops_group0, ldvarg156, ldvarg155, ldvarg154, ldvarg157, ldvarg153); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 6: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_pfc_state(bnx2x_dcbnl_ops_group0); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 7: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_pfc_cfg(bnx2x_dcbnl_ops_group0, ldvarg152, ldvarg151); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 8: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_pg_bwgcfg_tx(bnx2x_dcbnl_ops_group0, ldvarg150, ldvarg149); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 9: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_dcbx(bnx2x_dcbnl_ops_group0); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 10: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_numtcs(bnx2x_dcbnl_ops_group0, ldvarg148, (int )ldvarg147); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 11: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_pg_bwgcfg_rx(bnx2x_dcbnl_ops_group0, ldvarg146, ldvarg145); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 12: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_numtcs(bnx2x_dcbnl_ops_group0, ldvarg144, ldvarg143); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 13: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_state(bnx2x_dcbnl_ops_group0); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 14: ; if (ldv_state_variable_10 == 1) { bnx2x_peer_appinfo(bnx2x_dcbnl_ops_group0, ldvarg142, ldvarg141); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 15: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_pg_tccfg_tx(bnx2x_dcbnl_ops_group0, ldvarg139, (int )ldvarg138, (int )ldvarg137, (int )ldvarg140, (int )ldvarg136); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 16: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_featcfg(bnx2x_dcbnl_ops_group0, ldvarg135, (int )ldvarg134); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 17: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_cap(bnx2x_dcbnl_ops_group0, ldvarg133, ldvarg132); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 18: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_pfc_state(bnx2x_dcbnl_ops_group0, (int )ldvarg131); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 19: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_state(bnx2x_dcbnl_ops_group0, (int )ldvarg130); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 20: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_all(bnx2x_dcbnl_ops_group0); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 21: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_dcbx(bnx2x_dcbnl_ops_group0, (int )ldvarg129); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 22: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_app_up(bnx2x_dcbnl_ops_group0, (int )ldvarg128, (int )ldvarg127, (int )ldvarg126); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 23: ; if (ldv_state_variable_10 == 1) { bnx2x_peer_apptable(bnx2x_dcbnl_ops_group0, ldvarg125); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 24: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_pg_tccfg_rx(bnx2x_dcbnl_ops_group0, ldvarg123, ldvarg122, ldvarg121, ldvarg124, ldvarg120); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 25: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_set_pg_bwgcfg_rx(bnx2x_dcbnl_ops_group0, ldvarg119, (int )ldvarg118); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 26: ; if (ldv_state_variable_10 == 1) { bnx2x_cee_peer_getpfc(bnx2x_dcbnl_ops_group0, ldvarg117); ldv_state_variable_10 = 1; } else { } goto ldv_52831; case 27: ; if (ldv_state_variable_10 == 1) { bnx2x_dcbnl_get_featcfg(bnx2x_dcbnl_ops_group0, ldvarg116, ldvarg115); ldv_state_variable_10 = 1; } else { } goto ldv_52831; default: ldv_stop(); } ldv_52831: ; return; } } 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 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_138(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_139(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_140(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_141(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static 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); } } extern void __list_del_entry(struct list_head * ) ; __inline static void list_move_tail(struct list_head *list , struct list_head *head ) { { __list_del_entry(list); list_add_tail(list, head); return; } } __inline static int list_is_last(struct list_head const *list , struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)list->next) == (unsigned long )head); } } __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } __inline static void __list_splice(struct list_head const *list , struct list_head *prev , struct list_head *next ) { struct list_head *first ; struct list_head *last ; { first = list->next; last = list->prev; first->prev = prev; prev->next = first; last->next = next; next->prev = last; return; } } __inline static void list_splice_init(struct list_head *list , struct list_head *head ) { int tmp ; { tmp = list_empty((struct list_head const *)list); if (tmp == 0) { __list_splice((struct list_head const *)list, head, head->next); INIT_LIST_HEAD(list); } else { } return; } } __inline static int atomic_cmpxchg(atomic_t *v , int old , int new ) { int __ret ; int __old ; int __new ; u8 volatile *__ptr ; u16 volatile *__ptr___0 ; u32 volatile *__ptr___1 ; u64 volatile *__ptr___2 ; { __old = old; __new = new; switch (4UL) { case 1UL: __ptr = (u8 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgb %2,%1": "=a" (__ret), "+m" (*__ptr): "q" (__new), "0" (__old): "memory"); goto ldv_5679; case 2UL: __ptr___0 = (u16 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgw %2,%1": "=a" (__ret), "+m" (*__ptr___0): "r" (__new), "0" (__old): "memory"); goto ldv_5679; case 4UL: __ptr___1 = (u32 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgl %2,%1": "=a" (__ret), "+m" (*__ptr___1): "r" (__new), "0" (__old): "memory"); goto ldv_5679; case 8UL: __ptr___2 = (u64 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgq %2,%1": "=a" (__ret), "+m" (*__ptr___2): "r" (__new), "0" (__old): "memory"); goto ldv_5679; default: __cmpxchg_wrong_size(); } ldv_5679: ; return (__ret); } } bool ldv_queue_work_on_151(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_153(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_152(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_155(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_154(struct workqueue_struct *ldv_func_arg1 ) ; __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 u32 crc32c(u32 , void const * , unsigned int ) ; int bnx2x_get_q_logical_state(struct bnx2x *bp , struct bnx2x_queue_sp_obj *obj ) ; void bnx2x_init_vlan_obj(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *vlan_obj , u8 cl_id , u32 cid , u8 func_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type , struct bnx2x_credit_pool_obj *vlans_pool ) ; int bnx2x_vlan_mac_h_read_lock(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) ; void bnx2x_vlan_mac_h_read_unlock(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) ; __inline static void __storm_memset_struct___0(struct bnx2x *bp , u32 addr , size_t size , u32 *data ) { int i ; { i = 0; goto ldv_51536; ldv_51535: writel(*(data + (unsigned long )i), (void volatile *)bp->regview + (unsigned long )((u32 )(i * 4) + addr)); i = i + 1; ldv_51536: ; if ((size_t )i < size / 4UL) { goto ldv_51535; } else { } return; } } __inline static void bnx2x_exe_queue_init(struct bnx2x *bp , struct bnx2x_exe_queue_obj *o , int exe_len , union bnx2x_qable_obj *owner , int (*validate)(struct bnx2x * , union bnx2x_qable_obj * , struct bnx2x_exeq_elem * ) , int (*remove)(struct bnx2x * , union bnx2x_qable_obj * , struct bnx2x_exeq_elem * ) , int (*optimize)(struct bnx2x * , union bnx2x_qable_obj * , struct bnx2x_exeq_elem * ) , int (*exec)(struct bnx2x * , union bnx2x_qable_obj * , struct list_head * , unsigned long * ) , struct bnx2x_exeq_elem *(*get)(struct bnx2x_exe_queue_obj * , struct bnx2x_exeq_elem * ) ) { struct lock_class_key __key ; long tmp ; { memset((void *)o, 0, 160UL); INIT_LIST_HEAD(& o->exe_queue); INIT_LIST_HEAD(& o->pending_comp); spinlock_check(& o->lock); __raw_spin_lock_init(& o->lock.__annonCompField18.rlock, "&(&o->lock)->rlock", & __key); o->exe_chunk_len = exe_len; o->owner = owner; o->validate = validate; o->remove = remove; o->optimize = optimize; o->execute = exec; o->get = get; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setup the execution queue with the chunk length of %d\n", "bnx2x_exe_queue_init", 74, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", exe_len); } else { } return; } } __inline static void bnx2x_exe_queue_free_elem(struct bnx2x *bp , struct bnx2x_exeq_elem *elem ) { long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Deleting an exe_queue element\n", "bnx2x_exe_queue_free_elem", 80, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } kfree((void const *)elem); return; } } __inline static int bnx2x_exe_queue_length(struct bnx2x_exe_queue_obj *o ) { struct bnx2x_exeq_elem *elem ; int cnt ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { cnt = 0; spin_lock_bh(& o->lock); __mptr = (struct list_head const *)o->exe_queue.next; elem = (struct bnx2x_exeq_elem *)__mptr; goto ldv_51629; ldv_51628: cnt = cnt + 1; __mptr___0 = (struct list_head const *)elem->link.next; elem = (struct bnx2x_exeq_elem *)__mptr___0; ldv_51629: ; if ((unsigned long )elem != (unsigned long )o) { goto ldv_51628; } else { } spin_unlock_bh(& o->lock); return (cnt); } } __inline static int bnx2x_exe_queue_add(struct bnx2x *bp , struct bnx2x_exe_queue_obj *o , struct bnx2x_exeq_elem *elem , bool restore ) { int rc ; long tmp ; { spin_lock_bh(& o->lock); if (! restore) { rc = (*(o->optimize))(bp, o->owner, elem); if (rc != 0) { goto free_and_exit; } else { } rc = (*(o->validate))(bp, o->owner, elem); if (rc != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Preamble failed: %d\n", "bnx2x_exe_queue_add", 127, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } goto free_and_exit; } else { } } else { } list_add_tail(& elem->link, & o->exe_queue); spin_unlock_bh(& o->lock); return (0); free_and_exit: bnx2x_exe_queue_free_elem(bp, elem); spin_unlock_bh(& o->lock); return (rc); } } __inline static void __bnx2x_exe_queue_reset_pending(struct bnx2x *bp , struct bnx2x_exe_queue_obj *o ) { struct bnx2x_exeq_elem *elem ; struct list_head const *__mptr ; int tmp ; { goto ldv_51648; ldv_51647: __mptr = (struct list_head const *)o->pending_comp.next; elem = (struct bnx2x_exeq_elem *)__mptr; list_del(& elem->link); bnx2x_exe_queue_free_elem(bp, elem); ldv_51648: tmp = list_empty((struct list_head const *)(& o->pending_comp)); if (tmp == 0) { goto ldv_51647; } else { } return; } } __inline static int bnx2x_exe_queue_step(struct bnx2x *bp , struct bnx2x_exe_queue_obj *o , unsigned long *ramrod_flags ) { struct bnx2x_exeq_elem *elem ; struct bnx2x_exeq_elem spacer ; int cur_len ; int rc ; long tmp ; int tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; int __ret_warn_on ; long tmp___2 ; int tmp___3 ; { cur_len = 0; memset((void *)(& spacer), 0, 64UL); tmp___1 = list_empty((struct list_head const *)(& o->pending_comp)); if (tmp___1 == 0) { tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)ramrod_flags); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]RAMROD_DRV_CLR_ONLY requested: resetting a pending_comp list\n", "bnx2x_exe_queue_step", 188, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } __bnx2x_exe_queue_reset_pending(bp, o); } else { return (1); } } else { } goto ldv_51666; ldv_51665: __mptr = (struct list_head const *)o->exe_queue.next; elem = (struct bnx2x_exeq_elem *)__mptr; __ret_warn_on = elem->cmd_len == 0; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 201); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (elem->cmd_len + cur_len <= o->exe_chunk_len) { cur_len = elem->cmd_len + cur_len; list_add_tail(& spacer.link, & o->pending_comp); __asm__ volatile ("mfence": : : "memory"); list_move_tail(& elem->link, & o->pending_comp); list_del(& spacer.link); } else { goto ldv_51664; } ldv_51666: tmp___3 = list_empty((struct list_head const *)(& o->exe_queue)); if (tmp___3 == 0) { goto ldv_51665; } else { } ldv_51664: ; if (cur_len == 0) { return (0); } else { } rc = (*(o->execute))(bp, o->owner, & o->pending_comp, ramrod_flags); if (rc < 0) { list_splice_init(& o->pending_comp, & o->exe_queue); } else if (rc == 0) { __bnx2x_exe_queue_reset_pending(bp, o); } else { } return (rc); } } __inline static bool bnx2x_exe_queue_empty(struct bnx2x_exe_queue_obj *o ) { bool empty ; int tmp ; int tmp___0 ; int tmp___1 ; { tmp = list_empty((struct list_head const *)(& o->exe_queue)); empty = tmp != 0; __asm__ volatile ("mfence": : : "memory"); if ((int )empty) { tmp___0 = list_empty((struct list_head const *)(& o->pending_comp)); if (tmp___0 != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return ((bool )tmp___1); } } __inline static struct bnx2x_exeq_elem *bnx2x_exe_queue_alloc_elem(struct bnx2x *bp ) { long tmp ; void *tmp___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Allocating a new exe_queue element\n", "bnx2x_exe_queue_alloc_elem", 249, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___0 = kzalloc(64UL, 32U); return ((struct bnx2x_exeq_elem *)tmp___0); } } static bool bnx2x_raw_check_pending(struct bnx2x_raw_obj *o ) { int tmp ; { tmp = variable_test_bit((long )o->state, (unsigned long const volatile *)o->pstate); return (tmp != 0); } } static void bnx2x_raw_clear_pending(struct bnx2x_raw_obj *o ) { { __asm__ volatile ("": : : "memory"); clear_bit((long )o->state, (unsigned long volatile *)o->pstate); __asm__ volatile ("": : : "memory"); return; } } static void bnx2x_raw_set_pending(struct bnx2x_raw_obj *o ) { { __asm__ volatile ("": : : "memory"); set_bit((long )o->state, (unsigned long volatile *)o->pstate); __asm__ volatile ("": : : "memory"); return; } } __inline static int bnx2x_state_wait(struct bnx2x *bp , int state , unsigned long *pstate ) { int cnt ; long tmp ; int tmp___0 ; int tmp___1 ; { cnt = 5000; if ((bp->common.chip_id & 61440U) > 20480U && (bp->common.chip_id & 4096U) == 0U) { cnt = cnt * 20; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]waiting for state to become %d\n", "bnx2x_state_wait", 290, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", state); } else { } __might_sleep("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 292, 0); goto ldv_51692; ldv_51691: tmp___0 = variable_test_bit((long )state, (unsigned long const volatile *)pstate); if (tmp___0 == 0) { return (0); } else { } usleep_range(1000UL, 2000UL); if (bp->panic != 0) { return (-5); } else { } ldv_51692: tmp___1 = cnt; cnt = cnt - 1; if (tmp___1 != 0) { goto ldv_51691; } else { } printk("\vbnx2x: [%s:%d(%s)]timeout waiting for state %d\n", "bnx2x_state_wait", 308, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", state); return (-16); } } static int bnx2x_raw_wait(struct bnx2x *bp , struct bnx2x_raw_obj *raw ) { int tmp ; { tmp = bnx2x_state_wait(bp, raw->state, raw->pstate); return (tmp); } } static bool bnx2x_get_cam_offset_mac(struct bnx2x_vlan_mac_obj *o , int *offset ) { struct bnx2x_credit_pool_obj *mp ; int __ret_warn_on ; long tmp ; bool tmp___0 ; { mp = o->macs_pool; __ret_warn_on = (unsigned long )mp == (unsigned long )((struct bnx2x_credit_pool_obj *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 327); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = (*(mp->get_entry))(mp, offset); return (tmp___0); } } static bool bnx2x_get_credit_mac(struct bnx2x_vlan_mac_obj *o ) { struct bnx2x_credit_pool_obj *mp ; int __ret_warn_on ; long tmp ; bool tmp___0 ; { mp = o->macs_pool; __ret_warn_on = (unsigned long )mp == (unsigned long )((struct bnx2x_credit_pool_obj *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 336); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = (*(mp->get))(mp, 1); return (tmp___0); } } static bool bnx2x_get_cam_offset_vlan(struct bnx2x_vlan_mac_obj *o , int *offset ) { struct bnx2x_credit_pool_obj *vp ; int __ret_warn_on ; long tmp ; bool tmp___0 ; { vp = o->vlans_pool; __ret_warn_on = (unsigned long )vp == (unsigned long )((struct bnx2x_credit_pool_obj *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 345); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = (*(vp->get_entry))(vp, offset); return (tmp___0); } } static bool bnx2x_get_credit_vlan(struct bnx2x_vlan_mac_obj *o ) { struct bnx2x_credit_pool_obj *vp ; int __ret_warn_on ; long tmp ; bool tmp___0 ; { vp = o->vlans_pool; __ret_warn_on = (unsigned long )vp == (unsigned long )((struct bnx2x_credit_pool_obj *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 354); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = (*(vp->get))(vp, 1); return (tmp___0); } } static bool bnx2x_put_cam_offset_mac(struct bnx2x_vlan_mac_obj *o , int offset ) { struct bnx2x_credit_pool_obj *mp ; bool tmp ; { mp = o->macs_pool; tmp = (*(mp->put_entry))(mp, offset); return (tmp); } } static bool bnx2x_put_credit_mac(struct bnx2x_vlan_mac_obj *o ) { struct bnx2x_credit_pool_obj *mp ; bool tmp ; { mp = o->macs_pool; tmp = (*(mp->put))(mp, 1); return (tmp); } } static bool bnx2x_put_cam_offset_vlan(struct bnx2x_vlan_mac_obj *o , int offset ) { struct bnx2x_credit_pool_obj *vp ; bool tmp ; { vp = o->vlans_pool; tmp = (*(vp->put_entry))(vp, offset); return (tmp); } } static bool bnx2x_put_credit_vlan(struct bnx2x_vlan_mac_obj *o ) { struct bnx2x_credit_pool_obj *vp ; bool tmp ; { vp = o->vlans_pool; tmp = (*(vp->put))(vp, 1); return (tmp); } } static int __bnx2x_vlan_mac_h_write_trylock(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) { long tmp ; long tmp___0 ; { if ((unsigned int )o->head_reader != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_lock writer - There are readers; Busy\n", "__bnx2x_vlan_mac_h_write_trylock", 399, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-16); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_lock writer - Taken\n", "__bnx2x_vlan_mac_h_write_trylock", 403, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } } static void __bnx2x_vlan_mac_h_exec_pending(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) { int rc ; unsigned long ramrod_flags ; long tmp ; { ramrod_flags = o->saved_ramrod_flags; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_lock execute pending command with ramrod flags %lu\n", "__bnx2x_vlan_mac_h_exec_pending", 423, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ramrod_flags); } else { } o->head_exe_request = 0; o->saved_ramrod_flags = 0UL; rc = bnx2x_exe_queue_step(bp, & o->exe_queue, & ramrod_flags); if (rc != 0 && rc != 1) { printk("\vbnx2x: [%s:%d(%s)]execution of pending commands failed with rc %d\n", "__bnx2x_vlan_mac_h_exec_pending", 429, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } return; } } static void __bnx2x_vlan_mac_h_pend(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , unsigned long ramrod_flags ) { long tmp ; { o->head_exe_request = 1; o->saved_ramrod_flags = ramrod_flags; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Placing pending execution with ramrod flags %lu\n", "__bnx2x_vlan_mac_h_pend", 452, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ramrod_flags); } else { } return; } } static void __bnx2x_vlan_mac_h_write_unlock(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) { long tmp ; { goto ldv_51766; ldv_51765: tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_lock - writer release encountered a pending request\n", "__bnx2x_vlan_mac_h_write_unlock", 472, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } __bnx2x_vlan_mac_h_exec_pending(bp, o); ldv_51766: ; if ((int )o->head_exe_request) { goto ldv_51765; } else { } return; } } static int __bnx2x_vlan_mac_h_read_lock(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) { long tmp ; { o->head_reader = (u8 )((int )o->head_reader + 1); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_lock - locked reader - number %d\n", "__bnx2x_vlan_mac_h_read_lock", 493, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )o->head_reader); } else { } return (0); } } int bnx2x_vlan_mac_h_read_lock(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) { int rc ; { spin_lock_bh(& o->exe_queue.lock); rc = __bnx2x_vlan_mac_h_read_lock(bp, o); spin_unlock_bh(& o->exe_queue.lock); return (rc); } } static void __bnx2x_vlan_mac_h_read_unlock(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) { long tmp ; long tmp___0 ; { if ((unsigned int )o->head_reader == 0U) { printk("\vbnx2x: [%s:%d(%s)]Need to release vlan mac reader lock, but lock isn\'t taken\n", "__bnx2x_vlan_mac_h_read_unlock", 532, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { o->head_reader = (u8 )((int )o->head_reader - 1); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_lock - decreased readers to %d\n", "__bnx2x_vlan_mac_h_read_unlock", 539, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )o->head_reader); } else { } } if ((unsigned int )o->head_reader == 0U && (int )o->head_exe_request) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_lock - reader release encountered a pending request\n", "__bnx2x_vlan_mac_h_read_unlock", 546, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } __bnx2x_vlan_mac_h_write_unlock(bp, o); } else { } return; } } void bnx2x_vlan_mac_h_read_unlock(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) { { spin_lock_bh(& o->exe_queue.lock); __bnx2x_vlan_mac_h_read_unlock(bp, o); spin_unlock_bh(& o->exe_queue.lock); return; } } static int bnx2x_get_n_elements(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , int n , u8 *base , u8 stride , u8 size ) { struct bnx2x_vlan_mac_registry_elem *pos ; u8 *next ; int counter ; int read_lock ; long tmp ; struct list_head const *__mptr ; long tmp___0 ; struct list_head const *__mptr___0 ; long tmp___1 ; { next = base; counter = 0; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]get_n_elements - taking vlan_mac_lock (reader)\n", "bnx2x_get_n_elements", 579, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } read_lock = bnx2x_vlan_mac_h_read_lock(bp, o); if (read_lock != 0) { printk("\vbnx2x: [%s:%d(%s)]get_n_elements failed to get vlan mac reader lock; Access without lock\n", "bnx2x_get_n_elements", 582, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } __mptr = (struct list_head const *)o->head.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr; goto ldv_51805; ldv_51804: ; if (counter < n) { memcpy((void *)next, (void const *)(& pos->u), (size_t )size); counter = counter + 1; tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]copied element number %d to address %p element was:\n", "bnx2x_get_n_elements", 590, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", counter, next); } else { } next = next + (unsigned long )((int )stride + (int )size); } else { } __mptr___0 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr___0; ldv_51805: ; if ((unsigned long )(& pos->link) != (unsigned long )(& o->head)) { goto ldv_51804; } else { } if (read_lock == 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]get_n_elements - releasing vlan_mac_lock (reader)\n", "bnx2x_get_n_elements", 596, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_vlan_mac_h_read_unlock(bp, o); } else { } return (counter * 6); } } static int bnx2x_check_mac_add(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , union bnx2x_classification_ramrod_data *data ) { struct bnx2x_vlan_mac_registry_elem *pos ; long tmp ; bool tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; bool tmp___2 ; struct list_head const *__mptr___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Checking MAC %pM for ADD command\n", "bnx2x_check_mac_add", 610, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (u8 *)(& data->mac.mac)); } else { } tmp___0 = is_valid_ether_addr((u8 const *)(& data->mac.mac)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (-22); } else { } __mptr = (struct list_head const *)o->head.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr; goto ldv_51819; ldv_51818: tmp___2 = ether_addr_equal((u8 const *)(& data->mac.mac), (u8 const *)(& pos->u.mac.mac)); if ((int )tmp___2 && (int )data->mac.is_inner_mac == (int )pos->u.mac.is_inner_mac) { return (-17); } else { } __mptr___0 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr___0; ldv_51819: ; if ((unsigned long )(& pos->link) != (unsigned long )(& o->head)) { goto ldv_51818; } else { } return (0); } } static int bnx2x_check_vlan_add(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , union bnx2x_classification_ramrod_data *data ) { struct bnx2x_vlan_mac_registry_elem *pos ; long tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Checking VLAN %d for ADD command\n", "bnx2x_check_vlan_add", 630, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )data->vlan.vlan); } else { } __mptr = (struct list_head const *)o->head.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr; goto ldv_51833; ldv_51832: ; if ((int )data->vlan.vlan == (int )pos->u.vlan.vlan) { return (-17); } else { } __mptr___0 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr___0; ldv_51833: ; if ((unsigned long )(& pos->link) != (unsigned long )(& o->head)) { goto ldv_51832; } else { } return (0); } } static struct bnx2x_vlan_mac_registry_elem *bnx2x_check_mac_del(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , union bnx2x_classification_ramrod_data *data ) { struct bnx2x_vlan_mac_registry_elem *pos ; long tmp ; struct list_head const *__mptr ; bool tmp___0 ; struct list_head const *__mptr___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Checking MAC %pM for DEL command\n", "bnx2x_check_mac_del", 647, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (u8 *)(& data->mac.mac)); } else { } __mptr = (struct list_head const *)o->head.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr; goto ldv_51847; ldv_51846: tmp___0 = ether_addr_equal((u8 const *)(& data->mac.mac), (u8 const *)(& pos->u.mac.mac)); if ((int )tmp___0 && (int )data->mac.is_inner_mac == (int )pos->u.mac.is_inner_mac) { return (pos); } else { } __mptr___0 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr___0; ldv_51847: ; if ((unsigned long )(& pos->link) != (unsigned long )(& o->head)) { goto ldv_51846; } else { } return ((struct bnx2x_vlan_mac_registry_elem *)0); } } static struct bnx2x_vlan_mac_registry_elem *bnx2x_check_vlan_del(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , union bnx2x_classification_ramrod_data *data ) { struct bnx2x_vlan_mac_registry_elem *pos ; long tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Checking VLAN %d for DEL command\n", "bnx2x_check_vlan_del", 664, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )data->vlan.vlan); } else { } __mptr = (struct list_head const *)o->head.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr; goto ldv_51861; ldv_51860: ; if ((int )data->vlan.vlan == (int )pos->u.vlan.vlan) { return (pos); } else { } __mptr___0 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr___0; ldv_51861: ; if ((unsigned long )(& pos->link) != (unsigned long )(& o->head)) { goto ldv_51860; } else { } return ((struct bnx2x_vlan_mac_registry_elem *)0); } } static bool bnx2x_check_move(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *src_o , struct bnx2x_vlan_mac_obj *dst_o , union bnx2x_classification_ramrod_data *data ) { struct bnx2x_vlan_mac_registry_elem *pos ; int rc ; { pos = (*(src_o->check_del))(bp, src_o, data); rc = (*(dst_o->check_add))(bp, dst_o, data); if (rc != 0 || (unsigned long )pos == (unsigned long )((struct bnx2x_vlan_mac_registry_elem *)0)) { return (0); } else { } return (1); } } static bool bnx2x_check_move_always_err(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *src_o , struct bnx2x_vlan_mac_obj *dst_o , union bnx2x_classification_ramrod_data *data ) { { return (0); } } __inline static u8 bnx2x_vlan_mac_get_rx_tx_flag(struct bnx2x_vlan_mac_obj *o ) { struct bnx2x_raw_obj *raw ; u8 rx_tx_flag ; { raw = & o->raw; rx_tx_flag = 0U; if ((unsigned int )raw->obj_type == 1U || (unsigned int )raw->obj_type == 2U) { rx_tx_flag = (u8 )((unsigned int )rx_tx_flag | 2U); } else { } if ((unsigned int )raw->obj_type == 0U || (unsigned int )raw->obj_type == 2U) { rx_tx_flag = (u8 )((unsigned int )rx_tx_flag | 1U); } else { } return (rx_tx_flag); } } static void bnx2x_set_mac_in_nig(struct bnx2x *bp , bool add , unsigned char *dev_addr , int index ) { u32 wb_data[2U] ; u32 reg_offset ; long tmp ; { reg_offset = (int )bp->pfid & 1 ? 90560U : 90496U; if ((unsigned int )bp->mf_mode != 2U && (unsigned int )bp->mf_mode != 3U) { return; } else { } if (index > 8) { return; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Going to %s LLH configuration at entry %d\n", "bnx2x_set_mac_in_nig", 738, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )add ? (char *)"ADD" : (char *)"DELETE", index); } else { } if ((int )add) { reg_offset = (u32 )(index * 8) + reg_offset; wb_data[0] = (u32 )(((((int )*(dev_addr + 2UL) << 24) | ((int )*(dev_addr + 3UL) << 16)) | ((int )*(dev_addr + 4UL) << 8)) | (int )*(dev_addr + 5UL)); wb_data[1] = (u32 )(((int )*dev_addr << 8) | (int )*(dev_addr + 1UL)); memcpy((void *)(& (bp->slowpath)->wb_data), (void const *)(& wb_data), 8UL); bnx2x_write_dmae(bp, bp->slowpath_mapping + 4416ULL, reg_offset, 2U); } else { } writel((unsigned int )add, (void volatile *)bp->regview + (unsigned long )(((int )bp->pfid & 1 ? 90464 : 90432) + index * 4)); return; } } __inline static void bnx2x_vlan_mac_set_cmd_hdr_e2(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , bool add , int opcode , struct eth_classify_cmd_header *hdr ) { struct bnx2x_raw_obj *raw ; u8 tmp ; { raw = & o->raw; hdr->client_id = raw->cl_id; hdr->func_id = raw->func_id; tmp = bnx2x_vlan_mac_get_rx_tx_flag(o); hdr->cmd_general_data = (u8 )((int )hdr->cmd_general_data | (int )tmp); if ((int )add) { hdr->cmd_general_data = (u8 )((unsigned int )hdr->cmd_general_data | 16U); } else { } hdr->cmd_general_data = (u8 )((int )((signed char )hdr->cmd_general_data) | (int )((signed char )(opcode << 2))); return; } } __inline static void bnx2x_vlan_mac_set_rdata_hdr_e2(u32 cid , int type , struct eth_classify_header *hdr , int rule_cnt ) { { hdr->echo = (cid & 131071U) | (u32 )(type << 17); hdr->rule_cnt = (unsigned char )rule_cnt; return; } } static void bnx2x_set_one_mac_e2(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , struct bnx2x_exeq_elem *elem , int rule_idx , int cam_offset ) { struct bnx2x_raw_obj *raw ; struct eth_classify_rules_ramrod_data *data ; int rule_cnt ; int cmd ; union eth_classify_rule_cmd *rule_entry ; bool add ; unsigned long *vlan_mac_flags ; u8 *mac ; int tmp ; int tmp___0 ; long tmp___1 ; { raw = & o->raw; data = (struct eth_classify_rules_ramrod_data *)raw->rdata; rule_cnt = rule_idx + 1; cmd = (int )elem->cmd_data.vlan_mac.cmd; rule_entry = (union eth_classify_rule_cmd *)(& data->rules) + (unsigned long )rule_idx; add = cmd == 0; vlan_mac_flags = & elem->cmd_data.vlan_mac.vlan_mac_flags; mac = (u8 *)(& elem->cmd_data.vlan_mac.u.mac.mac); if (cmd != 2) { tmp___0 = constant_test_bit(2L, (unsigned long const volatile *)vlan_mac_flags); if (tmp___0 != 0) { bnx2x_set_mac_in_nig(bp, (int )add, mac, 0); } else { tmp = constant_test_bit(1L, (unsigned long const volatile *)vlan_mac_flags); if (tmp != 0) { bnx2x_set_mac_in_nig(bp, (int )add, mac, 1); } else { } } } else { } if (rule_idx == 0) { memset((void *)data, 0, 264UL); } else { } bnx2x_vlan_mac_set_cmd_hdr_e2(bp, o, (int )add, 0, & rule_entry->mac.header); tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to %s MAC %pM for Queue %d\n", "bnx2x_set_one_mac_e2", 854, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )add ? (char *)"add" : (char *)"delete", mac, (int )raw->cl_id); } else { } bnx2x_set_fw_mac_addr(& rule_entry->mac.mac_msb, & rule_entry->mac.mac_mid, & rule_entry->mac.mac_lsb, mac); rule_entry->mac.inner_mac = (unsigned short )elem->cmd_data.vlan_mac.u.mac.is_inner_mac; if (cmd == 2) { rule_entry = rule_entry + 1; rule_cnt = rule_cnt + 1; bnx2x_vlan_mac_set_cmd_hdr_e2(bp, elem->cmd_data.vlan_mac.target_obj, 1, 0, & rule_entry->mac.header); bnx2x_set_fw_mac_addr(& rule_entry->mac.mac_msb, & rule_entry->mac.mac_mid, & rule_entry->mac.mac_lsb, mac); rule_entry->mac.inner_mac = (unsigned short )elem->cmd_data.vlan_mac.u.mac.is_inner_mac; } else { } bnx2x_vlan_mac_set_rdata_hdr_e2(raw->cid, raw->state, & data->header, rule_cnt); return; } } __inline static void bnx2x_vlan_mac_set_rdata_hdr_e1x(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , int type , int cam_offset , struct mac_configuration_hdr *hdr ) { struct bnx2x_raw_obj *r ; { r = & o->raw; hdr->length = 1U; hdr->offset = (unsigned char )cam_offset; hdr->client_id = 255U; hdr->echo = (r->cid & 131071U) | (u32 )(type << 17); return; } } __inline static void bnx2x_vlan_mac_set_cfg_entry_e1x(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , bool add , int opcode , u8 *mac , u16 vlan_id , struct mac_configuration_entry *cfg_entry ) { struct bnx2x_raw_obj *r ; u32 cl_bit_vec ; { r = & o->raw; cl_bit_vec = (u32 )(1 << (int )r->cl_id); cfg_entry->clients_bit_vector = cl_bit_vec; cfg_entry->pf_id = r->func_id; cfg_entry->vlan_id = vlan_id; if ((int )add) { cfg_entry->flags = (unsigned int )cfg_entry->flags & 254U; cfg_entry->flags = (u8 )((unsigned int )cfg_entry->flags | 1U); cfg_entry->flags = (unsigned int )cfg_entry->flags & 243U; cfg_entry->flags = (u8 )((int )((signed char )cfg_entry->flags) | (int )((signed char )(opcode << 2))); bnx2x_set_fw_mac_addr(& cfg_entry->msb_mac_addr, & cfg_entry->middle_mac_addr, & cfg_entry->lsb_mac_addr, mac); } else { cfg_entry->flags = (unsigned int )cfg_entry->flags & 254U; cfg_entry->flags = cfg_entry->flags; } return; } } __inline static void bnx2x_vlan_mac_set_rdata_e1x(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , int type , int cam_offset , bool add , u8 *mac , u16 vlan_id , int opcode , struct mac_configuration_cmd *config ) { struct mac_configuration_entry *cfg_entry ; struct bnx2x_raw_obj *raw ; long tmp ; { cfg_entry = (struct mac_configuration_entry *)(& config->config_table); raw = & o->raw; bnx2x_vlan_mac_set_rdata_hdr_e1x(bp, o, type, cam_offset, & config->hdr); bnx2x_vlan_mac_set_cfg_entry_e1x(bp, o, (int )add, opcode, mac, (int )vlan_id, cfg_entry); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]%s MAC %pM CLID %d CAM offset %d\n", "bnx2x_vlan_mac_set_rdata_e1x", 954, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )add ? (char *)"setting" : (char *)"clearing", mac, (int )raw->cl_id, cam_offset); } else { } return; } } static void bnx2x_set_one_mac_e1x(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , struct bnx2x_exeq_elem *elem , int rule_idx , int cam_offset ) { struct bnx2x_raw_obj *raw ; struct mac_configuration_cmd *config ; bool add ; { raw = & o->raw; config = (struct mac_configuration_cmd *)raw->rdata; add = (unsigned int )elem->cmd_data.vlan_mac.cmd == 0U; memset((void *)config, 0, 1032UL); bnx2x_vlan_mac_set_rdata_e1x(bp, o, raw->state, cam_offset, (int )add, (u8 *)(& elem->cmd_data.vlan_mac.u.mac.mac), 0, 0, config); return; } } static void bnx2x_set_one_vlan_e2(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , struct bnx2x_exeq_elem *elem , int rule_idx , int cam_offset ) { struct bnx2x_raw_obj *raw ; struct eth_classify_rules_ramrod_data *data ; int rule_cnt ; union eth_classify_rule_cmd *rule_entry ; enum bnx2x_vlan_mac_cmd cmd ; bool add ; u16 vlan ; long tmp ; { raw = & o->raw; data = (struct eth_classify_rules_ramrod_data *)raw->rdata; rule_cnt = rule_idx + 1; rule_entry = (union eth_classify_rule_cmd *)(& data->rules) + (unsigned long )rule_idx; cmd = elem->cmd_data.vlan_mac.cmd; add = (unsigned int )cmd == 0U; vlan = elem->cmd_data.vlan_mac.u.vlan.vlan; if (rule_idx == 0) { memset((void *)data, 0, 264UL); } else { } bnx2x_vlan_mac_set_cmd_hdr_e2(bp, o, (int )add, 1, & rule_entry->vlan.header); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to %s VLAN %d\n", "bnx2x_set_one_vlan_e2", 1012, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )add ? (char *)"add" : (char *)"delete", (int )vlan); } else { } rule_entry->vlan.vlan = vlan; if ((unsigned int )cmd == 2U) { rule_entry = rule_entry + 1; rule_cnt = rule_cnt + 1; bnx2x_vlan_mac_set_cmd_hdr_e2(bp, elem->cmd_data.vlan_mac.target_obj, 1, 1, & rule_entry->vlan.header); rule_entry->vlan.vlan = vlan; } else { } bnx2x_vlan_mac_set_rdata_hdr_e2(raw->cid, raw->state, & data->header, rule_cnt); return; } } static int bnx2x_vlan_mac_restore(struct bnx2x *bp , struct bnx2x_vlan_mac_ramrod_params *p , struct bnx2x_vlan_mac_registry_elem **ppos ) { struct bnx2x_vlan_mac_registry_elem *pos ; struct bnx2x_vlan_mac_obj *o ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp___0 ; int tmp___1 ; { o = p->vlan_mac_obj; tmp = list_empty((struct list_head const *)(& o->head)); if (tmp != 0) { *ppos = (struct bnx2x_vlan_mac_registry_elem *)0; return (0); } else { } if ((unsigned long )*ppos == (unsigned long )((struct bnx2x_vlan_mac_registry_elem *)0)) { __mptr = (struct list_head const *)o->head.next; *ppos = (struct bnx2x_vlan_mac_registry_elem *)__mptr; } else { __mptr___0 = (struct list_head const *)(*ppos)->link.next; *ppos = (struct bnx2x_vlan_mac_registry_elem *)__mptr___0; } pos = *ppos; tmp___0 = list_is_last((struct list_head const *)(& pos->link), (struct list_head const *)(& o->head)); if (tmp___0 != 0) { *ppos = (struct bnx2x_vlan_mac_registry_elem *)0; } else { } memcpy((void *)(& p->user_req.u), (void const *)(& pos->u), 10UL); p->user_req.cmd = 0; p->user_req.vlan_mac_flags = pos->vlan_mac_flags; __set_bit(4L, (unsigned long volatile *)(& p->ramrod_flags)); tmp___1 = bnx2x_config_vlan_mac(bp, p); return (tmp___1); } } static struct bnx2x_exeq_elem *bnx2x_exeq_get_mac(struct bnx2x_exe_queue_obj *o , struct bnx2x_exeq_elem *elem ) { struct bnx2x_exeq_elem *pos ; struct bnx2x_mac_ramrod_data *data ; struct list_head const *__mptr ; int tmp ; struct list_head const *__mptr___0 ; { data = & elem->cmd_data.vlan_mac.u.mac; __mptr = (struct list_head const *)o->exe_queue.next; pos = (struct bnx2x_exeq_elem *)__mptr; goto ldv_52001; ldv_52000: tmp = memcmp((void const *)(& pos->cmd_data.vlan_mac.u.mac), (void const *)data, 7UL); if (tmp == 0 && (unsigned int )pos->cmd_data.vlan_mac.cmd == (unsigned int )elem->cmd_data.vlan_mac.cmd) { return (pos); } else { } __mptr___0 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_exeq_elem *)__mptr___0; ldv_52001: ; if ((unsigned long )pos != (unsigned long )o) { goto ldv_52000; } else { } return ((struct bnx2x_exeq_elem *)0); } } static struct bnx2x_exeq_elem *bnx2x_exeq_get_vlan(struct bnx2x_exe_queue_obj *o , struct bnx2x_exeq_elem *elem ) { struct bnx2x_exeq_elem *pos ; struct bnx2x_vlan_ramrod_data *data ; struct list_head const *__mptr ; int tmp ; struct list_head const *__mptr___0 ; { data = & elem->cmd_data.vlan_mac.u.vlan; __mptr = (struct list_head const *)o->exe_queue.next; pos = (struct bnx2x_exeq_elem *)__mptr; goto ldv_52014; ldv_52013: tmp = memcmp((void const *)(& pos->cmd_data.vlan_mac.u.vlan), (void const *)data, 2UL); if (tmp == 0 && (unsigned int )pos->cmd_data.vlan_mac.cmd == (unsigned int )elem->cmd_data.vlan_mac.cmd) { return (pos); } else { } __mptr___0 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_exeq_elem *)__mptr___0; ldv_52014: ; if ((unsigned long )pos != (unsigned long )o) { goto ldv_52013; } else { } return ((struct bnx2x_exeq_elem *)0); } } __inline static int bnx2x_validate_vlan_mac_add(struct bnx2x *bp , union bnx2x_qable_obj *qo , struct bnx2x_exeq_elem *elem ) { struct bnx2x_vlan_mac_obj *o ; struct bnx2x_exe_queue_obj *exeq ; int rc ; long tmp ; long tmp___0 ; struct bnx2x_exeq_elem *tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; { o = & qo->vlan_mac; exeq = & o->exe_queue; rc = (*(o->check_add))(bp, o, & elem->cmd_data.vlan_mac.u); if (rc != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]ADD command is not allowed considering current registry state.\n", "bnx2x_validate_vlan_mac_add", 1162, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (rc); } else { } tmp___1 = (*(exeq->get))(exeq, elem); if ((unsigned long )tmp___1 != (unsigned long )((struct bnx2x_exeq_elem *)0)) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]There is a pending ADD command already\n", "bnx2x_validate_vlan_mac_add", 1170, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-17); } else { } tmp___2 = constant_test_bit(4L, (unsigned long const volatile *)(& elem->cmd_data.vlan_mac.vlan_mac_flags)); if (tmp___2 == 0) { tmp___3 = (*(o->get_credit))(o); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { return (-22); } else { } } else { } return (0); } } __inline static int bnx2x_validate_vlan_mac_del(struct bnx2x *bp , union bnx2x_qable_obj *qo , struct bnx2x_exeq_elem *elem ) { struct bnx2x_vlan_mac_obj *o ; struct bnx2x_vlan_mac_registry_elem *pos ; struct bnx2x_exe_queue_obj *exeq ; struct bnx2x_exeq_elem query_elem ; long tmp ; struct bnx2x_exeq_elem *tmp___0 ; long tmp___1 ; struct bnx2x_exeq_elem *tmp___2 ; int tmp___3 ; bool tmp___4 ; int tmp___5 ; { o = & qo->vlan_mac; exeq = & o->exe_queue; pos = (*(o->check_del))(bp, o, & elem->cmd_data.vlan_mac.u); if ((unsigned long )pos == (unsigned long )((struct bnx2x_vlan_mac_registry_elem *)0)) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]DEL command is not allowed considering current registry state\n", "bnx2x_validate_vlan_mac_del", 1213, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-17); } else { } memcpy((void *)(& query_elem), (void const *)elem, 64UL); query_elem.cmd_data.vlan_mac.cmd = 2; tmp___0 = (*(exeq->get))(exeq, & query_elem); if ((unsigned long )tmp___0 != (unsigned long )((struct bnx2x_exeq_elem *)0)) { printk("\vbnx2x: [%s:%d(%s)]There is a pending MOVE command already\n", "bnx2x_validate_vlan_mac_del", 1225, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } tmp___2 = (*(exeq->get))(exeq, elem); if ((unsigned long )tmp___2 != (unsigned long )((struct bnx2x_exeq_elem *)0)) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]There is a pending DEL command already\n", "bnx2x_validate_vlan_mac_del", 1231, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-17); } else { } tmp___3 = constant_test_bit(4L, (unsigned long const volatile *)(& elem->cmd_data.vlan_mac.vlan_mac_flags)); if (tmp___3 == 0) { tmp___4 = (*(o->put_credit))(o); if (tmp___4) { tmp___5 = 0; } else { tmp___5 = 1; } if (tmp___5) { printk("\vbnx2x: [%s:%d(%s)]Failed to return a credit\n", "bnx2x_validate_vlan_mac_del", 1239, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } } else { } return (0); } } __inline static int bnx2x_validate_vlan_mac_move(struct bnx2x *bp , union bnx2x_qable_obj *qo , struct bnx2x_exeq_elem *elem ) { struct bnx2x_vlan_mac_obj *src_o ; struct bnx2x_vlan_mac_obj *dest_o ; struct bnx2x_exeq_elem query_elem ; struct bnx2x_exe_queue_obj *src_exeq ; struct bnx2x_exe_queue_obj *dest_exeq ; long tmp ; bool tmp___0 ; int tmp___1 ; struct bnx2x_exeq_elem *tmp___2 ; long tmp___3 ; struct bnx2x_exeq_elem *tmp___4 ; struct bnx2x_exeq_elem *tmp___5 ; int tmp___6 ; bool tmp___7 ; int tmp___8 ; int tmp___9 ; bool tmp___10 ; int tmp___11 ; { src_o = & qo->vlan_mac; dest_o = elem->cmd_data.vlan_mac.target_obj; src_exeq = & src_o->exe_queue; dest_exeq = & dest_o->exe_queue; tmp___0 = (*(src_o->check_move))(bp, src_o, dest_o, & elem->cmd_data.vlan_mac.u); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]MOVE command is not allowed considering current registry state\n", "bnx2x_validate_vlan_mac_move", 1273, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } memcpy((void *)(& query_elem), (void const *)elem, 64UL); query_elem.cmd_data.vlan_mac.cmd = 1; tmp___2 = (*(src_exeq->get))(src_exeq, & query_elem); if ((unsigned long )tmp___2 != (unsigned long )((struct bnx2x_exeq_elem *)0)) { printk("\vbnx2x: [%s:%d(%s)]There is a pending DEL command on the source queue already\n", "bnx2x_validate_vlan_mac_move", 1286, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } tmp___4 = (*(src_exeq->get))(src_exeq, elem); if ((unsigned long )tmp___4 != (unsigned long )((struct bnx2x_exeq_elem *)0)) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]There is a pending MOVE command already\n", "bnx2x_validate_vlan_mac_move", 1292, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-17); } else { } query_elem.cmd_data.vlan_mac.cmd = 0; tmp___5 = (*(dest_exeq->get))(dest_exeq, & query_elem); if ((unsigned long )tmp___5 != (unsigned long )((struct bnx2x_exeq_elem *)0)) { printk("\vbnx2x: [%s:%d(%s)]There is a pending ADD command on the destination queue already\n", "bnx2x_validate_vlan_mac_move", 1299, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } tmp___6 = constant_test_bit(5L, (unsigned long const volatile *)(& elem->cmd_data.vlan_mac.vlan_mac_flags)); if (tmp___6 == 0) { tmp___7 = (*(dest_o->get_credit))(dest_o); if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { return (-22); } else { } } else { } tmp___9 = constant_test_bit(4L, (unsigned long const volatile *)(& elem->cmd_data.vlan_mac.vlan_mac_flags)); if (tmp___9 == 0) { tmp___10 = (*(src_o->put_credit))(src_o); if (tmp___10) { tmp___11 = 0; } else { tmp___11 = 1; } if (tmp___11) { (*(dest_o->put_credit))(dest_o); return (-22); } else { } } else { } return (0); } } static int bnx2x_validate_vlan_mac(struct bnx2x *bp , union bnx2x_qable_obj *qo , struct bnx2x_exeq_elem *elem ) { int tmp ; int tmp___0 ; int tmp___1 ; { switch ((unsigned int )elem->cmd_data.vlan_mac.cmd) { case 0U: tmp = bnx2x_validate_vlan_mac_add(bp, qo, elem); return (tmp); case 1U: tmp___0 = bnx2x_validate_vlan_mac_del(bp, qo, elem); return (tmp___0); case 2U: tmp___1 = bnx2x_validate_vlan_mac_move(bp, qo, elem); return (tmp___1); default: ; return (-22); } } } static int bnx2x_remove_vlan_mac(struct bnx2x *bp , union bnx2x_qable_obj *qo , struct bnx2x_exeq_elem *elem ) { int rc ; int tmp ; bool tmp___0 ; bool tmp___1 ; { rc = 0; tmp = constant_test_bit(4L, (unsigned long const volatile *)(& elem->cmd_data.vlan_mac.vlan_mac_flags)); if (tmp != 0) { return (0); } else { } switch ((unsigned int )elem->cmd_data.vlan_mac.cmd) { case 0U: ; case 2U: tmp___0 = (*(qo->vlan_mac.put_credit))(& qo->vlan_mac); rc = (int )tmp___0; goto ldv_52063; case 1U: tmp___1 = (*(qo->vlan_mac.get_credit))(& qo->vlan_mac); rc = (int )tmp___1; goto ldv_52063; default: ; return (-22); } ldv_52063: ; if (rc != 1) { return (-22); } else { } return (0); } } static int bnx2x_wait_vlan_mac(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o ) { int cnt ; int rc ; struct bnx2x_exe_queue_obj *exeq ; struct bnx2x_raw_obj *raw ; bool tmp ; int tmp___0 ; int tmp___1 ; { cnt = 5000; exeq = & o->exe_queue; raw = & o->raw; goto ldv_52075; ldv_52074: rc = (*(raw->wait_comp))(bp, raw); if (rc != 0) { return (rc); } else { } tmp = bnx2x_exe_queue_empty(exeq); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { usleep_range(1000UL, 2000UL); } else { return (0); } ldv_52075: tmp___1 = cnt; cnt = cnt - 1; if (tmp___1 != 0) { goto ldv_52074; } else { } return (-16); } } static int __bnx2x_vlan_mac_execute_step(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , unsigned long *ramrod_flags ) { int rc ; long tmp ; { rc = 0; spin_lock_bh(& o->exe_queue.lock); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_execute_step - trying to take writer lock\n", "__bnx2x_vlan_mac_execute_step", 1403, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = __bnx2x_vlan_mac_h_write_trylock(bp, o); if (rc != 0) { __bnx2x_vlan_mac_h_pend(bp, o, *ramrod_flags); rc = 1; } else { rc = bnx2x_exe_queue_step(bp, & o->exe_queue, ramrod_flags); } spin_unlock_bh(& o->exe_queue.lock); return (rc); } } static int bnx2x_complete_vlan_mac(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , union event_ring_elem *cqe , unsigned long *ramrod_flags ) { struct bnx2x_raw_obj *r ; int rc ; int tmp ; bool tmp___0 ; int tmp___1 ; { r = & o->raw; spin_lock_bh(& o->exe_queue.lock); __bnx2x_exe_queue_reset_pending(bp, & o->exe_queue); (*(r->clear_pending))(r); spin_unlock_bh(& o->exe_queue.lock); if ((unsigned int )cqe->message.error != 0U) { return (-22); } else { } tmp = constant_test_bit(6L, (unsigned long const volatile *)ramrod_flags); if (tmp != 0) { rc = __bnx2x_vlan_mac_execute_step(bp, o, ramrod_flags); if (rc < 0) { return (rc); } else { } } else { } tmp___0 = bnx2x_exe_queue_empty(& o->exe_queue); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (1); } else { } return (0); } } static int bnx2x_optimize_vlan_mac(struct bnx2x *bp , union bnx2x_qable_obj *qo , struct bnx2x_exeq_elem *elem ) { struct bnx2x_exeq_elem query ; struct bnx2x_exeq_elem *pos ; struct bnx2x_vlan_mac_obj *o ; struct bnx2x_exe_queue_obj *exeq ; bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; { o = & qo->vlan_mac; exeq = & o->exe_queue; memcpy((void *)(& query), (void const *)elem, 64UL); switch ((unsigned int )elem->cmd_data.vlan_mac.cmd) { case 0U: query.cmd_data.vlan_mac.cmd = 1; goto ldv_52102; case 1U: query.cmd_data.vlan_mac.cmd = 0; goto ldv_52102; default: ; return (0); } ldv_52102: pos = (*(exeq->get))(exeq, & query); if ((unsigned long )pos != (unsigned long )((struct bnx2x_exeq_elem *)0)) { tmp___3 = constant_test_bit(4L, (unsigned long const volatile *)(& pos->cmd_data.vlan_mac.vlan_mac_flags)); if (tmp___3 == 0) { if ((unsigned int )query.cmd_data.vlan_mac.cmd == 0U) { tmp___1 = (*(o->put_credit))(o); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { printk("\vbnx2x: [%s:%d(%s)]Failed to return the credit for the optimized ADD command\n", "bnx2x_optimize_vlan_mac", 1508, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { goto _L; } } else { _L: /* CIL Label */ tmp = (*(o->get_credit))(o); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { printk("\vbnx2x: [%s:%d(%s)]Failed to recover the credit from the optimized DEL command\n", "bnx2x_optimize_vlan_mac", 1511, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } } } else { } tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Optimizing %s command\n", "bnx2x_optimize_vlan_mac", 1518, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )elem->cmd_data.vlan_mac.cmd == 0U ? (char *)"ADD" : (char *)"DEL"); } else { } list_del(& pos->link); bnx2x_exe_queue_free_elem(bp, pos); return (1); } else { } return (0); } } __inline static int bnx2x_vlan_mac_get_registry_elem(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , struct bnx2x_exeq_elem *elem , bool restore , struct bnx2x_vlan_mac_registry_elem **re ) { enum bnx2x_vlan_mac_cmd cmd ; struct bnx2x_vlan_mac_registry_elem *reg_elem ; void *tmp ; int __ret_warn_on ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; long tmp___3 ; { cmd = elem->cmd_data.vlan_mac.cmd; if (! restore && ((unsigned int )cmd == 0U || (unsigned int )cmd == 2U)) { tmp = kzalloc(48UL, 32U); reg_elem = (struct bnx2x_vlan_mac_registry_elem *)tmp; if ((unsigned long )reg_elem == (unsigned long )((struct bnx2x_vlan_mac_registry_elem *)0)) { return (-12); } else { } tmp___1 = (*(o->get_cam_offset))(o, & reg_elem->cam_offset); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 1561); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); kfree((void const *)reg_elem); return (-22); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Got cam offset %d\n", "bnx2x_vlan_mac_get_registry_elem", 1566, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", reg_elem->cam_offset); } else { } memcpy((void *)(& reg_elem->u), (void const *)(& elem->cmd_data.vlan_mac.u), 10UL); reg_elem->vlan_mac_flags = elem->cmd_data.vlan_mac.vlan_mac_flags; } else { reg_elem = (*(o->check_del))(bp, o, & elem->cmd_data.vlan_mac.u); } *re = reg_elem; return (0); } } static int bnx2x_execute_vlan_mac(struct bnx2x *bp , union bnx2x_qable_obj *qo , struct list_head *exe_chunk , unsigned long *ramrod_flags ) { struct bnx2x_exeq_elem *elem ; struct bnx2x_vlan_mac_obj *o ; struct bnx2x_vlan_mac_obj *cam_obj ; struct bnx2x_raw_obj *r ; int rc ; int idx ; bool restore ; int tmp ; bool drv_only ; int tmp___0 ; struct bnx2x_vlan_mac_registry_elem *reg_elem ; enum bnx2x_vlan_mac_cmd cmd ; int __ret_warn_on ; bool tmp___1 ; long tmp___2 ; struct list_head const *__mptr ; int __ret_warn_on___0 ; long tmp___3 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; int __ret_warn_on___1 ; long tmp___4 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; struct list_head const *__mptr___4 ; { o = & qo->vlan_mac; r = & o->raw; idx = 0; tmp = constant_test_bit(4L, (unsigned long const volatile *)ramrod_flags); restore = tmp != 0; tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)ramrod_flags); drv_only = tmp___0 != 0; if (! drv_only) { tmp___1 = (*(r->check_pending))(r); __ret_warn_on = (int )tmp___1; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 1610); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); (*(r->set_pending))(r); __mptr = (struct list_head const *)exe_chunk->next; elem = (struct bnx2x_exeq_elem *)__mptr; goto ldv_52144; ldv_52143: cmd = elem->cmd_data.vlan_mac.cmd; if ((unsigned int )cmd == 2U) { cam_obj = elem->cmd_data.vlan_mac.target_obj; } else { cam_obj = o; } rc = bnx2x_vlan_mac_get_registry_elem(bp, cam_obj, elem, (int )restore, & reg_elem); if (rc != 0) { goto error_exit; } else { } __ret_warn_on___0 = (unsigned long )reg_elem == (unsigned long )((struct bnx2x_vlan_mac_registry_elem *)0); tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 1632); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (! restore && ((unsigned int )cmd == 0U || (unsigned int )cmd == 2U)) { list_add(& reg_elem->link, & cam_obj->head); } else { } (*(o->set_one_rule))(bp, o, elem, idx, reg_elem->cam_offset); if ((unsigned int )cmd == 2U) { idx = idx + 2; } else { idx = idx + 1; } __mptr___0 = (struct list_head const *)elem->link.next; elem = (struct bnx2x_exeq_elem *)__mptr___0; ldv_52144: ; if ((unsigned long )(& elem->link) != (unsigned long )exe_chunk) { goto ldv_52143; } else { } rc = bnx2x_sp_post(bp, o->ramrod_cmd, (int )r->cid, (unsigned int )(r->rdata_mapping >> 32), (unsigned int )r->rdata_mapping, 0); if (rc != 0) { goto error_exit; } else { } } else { } __mptr___1 = (struct list_head const *)exe_chunk->next; elem = (struct bnx2x_exeq_elem *)__mptr___1; goto ldv_52153; ldv_52152: cmd = elem->cmd_data.vlan_mac.cmd; if ((unsigned int )cmd == 1U || (unsigned int )cmd == 2U) { reg_elem = (*(o->check_del))(bp, o, & elem->cmd_data.vlan_mac.u); __ret_warn_on___1 = (unsigned long )reg_elem == (unsigned long )((struct bnx2x_vlan_mac_registry_elem *)0); tmp___4 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 1674); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); (*(o->put_cam_offset))(o, reg_elem->cam_offset); list_del(& reg_elem->link); kfree((void const *)reg_elem); } else { } __mptr___2 = (struct list_head const *)elem->link.next; elem = (struct bnx2x_exeq_elem *)__mptr___2; ldv_52153: ; if ((unsigned long )(& elem->link) != (unsigned long )exe_chunk) { goto ldv_52152; } else { } if (! drv_only) { return (1); } else { return (0); } error_exit: (*(r->clear_pending))(r); __mptr___3 = (struct list_head const *)exe_chunk->next; elem = (struct bnx2x_exeq_elem *)__mptr___3; goto ldv_52160; ldv_52159: cmd = elem->cmd_data.vlan_mac.cmd; if ((unsigned int )cmd == 2U) { cam_obj = elem->cmd_data.vlan_mac.target_obj; } else { cam_obj = o; } if (! restore && ((unsigned int )cmd == 0U || (unsigned int )cmd == 2U)) { reg_elem = (*(o->check_del))(bp, cam_obj, & elem->cmd_data.vlan_mac.u); if ((unsigned long )reg_elem != (unsigned long )((struct bnx2x_vlan_mac_registry_elem *)0)) { list_del(& reg_elem->link); kfree((void const *)reg_elem); } else { } } else { } __mptr___4 = (struct list_head const *)elem->link.next; elem = (struct bnx2x_exeq_elem *)__mptr___4; ldv_52160: ; if ((unsigned long )(& elem->link) != (unsigned long )exe_chunk) { goto ldv_52159; } else { } return (rc); } } __inline static int bnx2x_vlan_mac_push_new_cmd(struct bnx2x *bp , struct bnx2x_vlan_mac_ramrod_params *p ) { struct bnx2x_exeq_elem *elem ; struct bnx2x_vlan_mac_obj *o ; bool restore ; int tmp ; int tmp___0 ; { o = p->vlan_mac_obj; tmp = constant_test_bit(4L, (unsigned long const volatile *)(& p->ramrod_flags)); restore = tmp != 0; elem = bnx2x_exe_queue_alloc_elem(bp); if ((unsigned long )elem == (unsigned long )((struct bnx2x_exeq_elem *)0)) { return (-12); } else { } switch ((unsigned int )p->user_req.cmd) { case 2U: elem->cmd_len = 2; goto ldv_52170; default: elem->cmd_len = 1; } ldv_52170: memcpy((void *)(& elem->cmd_data.vlan_mac), (void const *)(& p->user_req), 40UL); tmp___0 = bnx2x_exe_queue_add(bp, & o->exe_queue, elem, (int )restore); return (tmp___0); } } int bnx2x_config_vlan_mac(struct bnx2x *bp , struct bnx2x_vlan_mac_ramrod_params *p ) { int rc ; struct bnx2x_vlan_mac_obj *o ; unsigned long *ramrod_flags ; bool cont ; int tmp ; struct bnx2x_raw_obj *raw ; bool tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int max_iterations ; int tmp___6 ; bool tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; { rc = 0; o = p->vlan_mac_obj; ramrod_flags = & p->ramrod_flags; tmp = constant_test_bit(6L, (unsigned long const volatile *)ramrod_flags); cont = tmp != 0; raw = & o->raw; if (! cont) { rc = bnx2x_vlan_mac_push_new_cmd(bp, p); if (rc != 0) { return (rc); } else { } } else { } tmp___0 = bnx2x_exe_queue_empty(& o->exe_queue); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { rc = 1; } else { } tmp___3 = constant_test_bit(3L, (unsigned long const volatile *)ramrod_flags); if (tmp___3 != 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]RAMROD_DRV_CLR_ONLY requested: clearing a pending bit.\n", "bnx2x_config_vlan_mac", 1776, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } (*(raw->clear_pending))(raw); } else { } if ((int )cont) { goto _L; } else { tmp___4 = constant_test_bit(5L, (unsigned long const volatile *)ramrod_flags); if (tmp___4 != 0) { goto _L; } else { tmp___5 = constant_test_bit(2L, (unsigned long const volatile *)ramrod_flags); if (tmp___5 != 0) { _L: /* CIL Label */ rc = __bnx2x_vlan_mac_execute_step(bp, p->vlan_mac_obj, & p->ramrod_flags); if (rc < 0) { return (rc); } else { } } else { } } } tmp___10 = constant_test_bit(2L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___10 != 0) { tmp___6 = bnx2x_exe_queue_length(& o->exe_queue); max_iterations = tmp___6 + 1; goto ldv_52184; ldv_52183: rc = (*(raw->wait_comp))(bp, raw); if (rc != 0) { return (rc); } else { } rc = __bnx2x_vlan_mac_execute_step(bp, p->vlan_mac_obj, & p->ramrod_flags); if (rc < 0) { return (rc); } else { } ldv_52184: tmp___7 = bnx2x_exe_queue_empty(& o->exe_queue); if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { tmp___9 = max_iterations; max_iterations = max_iterations - 1; if (tmp___9 != 0) { goto ldv_52183; } else { goto ldv_52185; } } else { } ldv_52185: ; return (0); } else { } return (rc); } } static int bnx2x_vlan_mac_del_all(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *o , unsigned long *vlan_mac_flags , unsigned long *ramrod_flags ) { struct bnx2x_vlan_mac_registry_elem *pos ; struct bnx2x_vlan_mac_ramrod_params p ; struct bnx2x_exe_queue_obj *exeq ; struct bnx2x_exeq_elem *exeq_pos ; struct bnx2x_exeq_elem *exeq_pos_n ; unsigned long flags ; int read_lock ; int rc ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; long tmp ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; long tmp___0 ; int tmp___1 ; { pos = (struct bnx2x_vlan_mac_registry_elem *)0; exeq = & o->exe_queue; rc = 0; spin_lock_bh(& exeq->lock); __mptr = (struct list_head const *)exeq->exe_queue.next; exeq_pos = (struct bnx2x_exeq_elem *)__mptr; __mptr___0 = (struct list_head const *)exeq_pos->link.next; exeq_pos_n = (struct bnx2x_exeq_elem *)__mptr___0; goto ldv_52208; ldv_52207: flags = exeq_pos->cmd_data.vlan_mac.vlan_mac_flags; if (((*vlan_mac_flags ^ flags) & 15UL) == 0UL) { rc = (*(exeq->remove))(bp, exeq->owner, exeq_pos); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to remove command\n", "bnx2x_vlan_mac_del_all", 1856, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); spin_unlock_bh(& exeq->lock); return (rc); } else { } list_del(& exeq_pos->link); bnx2x_exe_queue_free_elem(bp, exeq_pos); } else { } exeq_pos = exeq_pos_n; __mptr___1 = (struct list_head const *)exeq_pos_n->link.next; exeq_pos_n = (struct bnx2x_exeq_elem *)__mptr___1; ldv_52208: ; if ((unsigned long )exeq_pos != (unsigned long )exeq) { goto ldv_52207; } else { } spin_unlock_bh(& exeq->lock); memset((void *)(& p), 0, 56UL); p.vlan_mac_obj = o; p.ramrod_flags = *ramrod_flags; p.user_req.cmd = 1; __clear_bit(2L, (unsigned long volatile *)(& p.ramrod_flags)); __clear_bit(5L, (unsigned long volatile *)(& p.ramrod_flags)); __clear_bit(6L, (unsigned long volatile *)(& p.ramrod_flags)); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_del_all -- taking vlan_mac_lock (reader)\n", "bnx2x_vlan_mac_del_all", 1880, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } read_lock = bnx2x_vlan_mac_h_read_lock(bp, o); if (read_lock != 0) { return (read_lock); } else { } __mptr___2 = (struct list_head const *)o->head.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr___2; goto ldv_52215; ldv_52214: flags = pos->vlan_mac_flags; if (((*vlan_mac_flags ^ flags) & 15UL) == 0UL) { p.user_req.vlan_mac_flags = pos->vlan_mac_flags; memcpy((void *)(& p.user_req.u), (void const *)(& pos->u), 10UL); rc = bnx2x_config_vlan_mac(bp, & p); if (rc < 0) { printk("\vbnx2x: [%s:%d(%s)]Failed to add a new DEL command\n", "bnx2x_vlan_mac_del_all", 1893, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); bnx2x_vlan_mac_h_read_unlock(bp, o); return (rc); } else { } } else { } __mptr___3 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_vlan_mac_registry_elem *)__mptr___3; ldv_52215: ; if ((unsigned long )(& pos->link) != (unsigned long )(& o->head)) { goto ldv_52214; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]vlan_mac_del_all -- releasing vlan_mac_lock (reader)\n", "bnx2x_vlan_mac_del_all", 1900, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_vlan_mac_h_read_unlock(bp, o); p.ramrod_flags = *ramrod_flags; __set_bit(6L, (unsigned long volatile *)(& p.ramrod_flags)); tmp___1 = bnx2x_config_vlan_mac(bp, & p); return (tmp___1); } } __inline static void bnx2x_init_raw_obj(struct bnx2x_raw_obj *raw , u8 cl_id , u32 cid , u8 func_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type ) { { raw->func_id = func_id; raw->cid = cid; raw->cl_id = cl_id; raw->rdata = rdata; raw->rdata_mapping = rdata_mapping; raw->state = state; raw->pstate = pstate; raw->obj_type = type; raw->check_pending = & bnx2x_raw_check_pending; raw->clear_pending = & bnx2x_raw_clear_pending; raw->set_pending = & bnx2x_raw_set_pending; raw->wait_comp = & bnx2x_raw_wait; return; } } __inline static void bnx2x_init_vlan_mac_common(struct bnx2x_vlan_mac_obj *o , u8 cl_id , u32 cid , u8 func_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type , struct bnx2x_credit_pool_obj *macs_pool , struct bnx2x_credit_pool_obj *vlans_pool ) { { INIT_LIST_HEAD(& o->head); o->head_reader = 0U; o->head_exe_request = 0; o->saved_ramrod_flags = 0UL; o->macs_pool = macs_pool; o->vlans_pool = vlans_pool; o->delete_all = & bnx2x_vlan_mac_del_all; o->restore = & bnx2x_vlan_mac_restore; o->complete = & bnx2x_complete_vlan_mac; o->wait = & bnx2x_wait_vlan_mac; bnx2x_init_raw_obj(& o->raw, (int )cl_id, cid, (int )func_id, rdata, rdata_mapping, state, pstate, type); return; } } void bnx2x_init_mac_obj(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *mac_obj , u8 cl_id , u32 cid , u8 func_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type , struct bnx2x_credit_pool_obj *macs_pool ) { union bnx2x_qable_obj *qable_obj ; { qable_obj = (union bnx2x_qable_obj *)mac_obj; bnx2x_init_vlan_mac_common(mac_obj, (int )cl_id, cid, (int )func_id, rdata, rdata_mapping, state, pstate, type, macs_pool, (struct bnx2x_credit_pool_obj *)0); mac_obj->get_credit = & bnx2x_get_credit_mac; mac_obj->put_credit = & bnx2x_put_credit_mac; mac_obj->get_cam_offset = & bnx2x_get_cam_offset_mac; mac_obj->put_cam_offset = & bnx2x_put_cam_offset_mac; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { mac_obj->set_one_rule = & bnx2x_set_one_mac_e1x; mac_obj->check_del = & bnx2x_check_mac_del; mac_obj->check_add = & bnx2x_check_mac_add; mac_obj->check_move = & bnx2x_check_move_always_err; mac_obj->ramrod_cmd = 13; bnx2x_exe_queue_init(bp, & mac_obj->exe_queue, 1, qable_obj, & bnx2x_validate_vlan_mac, & bnx2x_remove_vlan_mac, & bnx2x_optimize_vlan_mac, & bnx2x_execute_vlan_mac, & bnx2x_exeq_get_mac); } else { mac_obj->set_one_rule = & bnx2x_set_one_mac_e2; mac_obj->check_del = & bnx2x_check_mac_del; mac_obj->check_add = & bnx2x_check_mac_add; mac_obj->check_move = & bnx2x_check_move; mac_obj->ramrod_cmd = 9; mac_obj->get_n_elements = & bnx2x_get_n_elements; bnx2x_exe_queue_init(bp, & mac_obj->exe_queue, 16, qable_obj, & bnx2x_validate_vlan_mac, & bnx2x_remove_vlan_mac, & bnx2x_optimize_vlan_mac, & bnx2x_execute_vlan_mac, & bnx2x_exeq_get_mac); } return; } } void bnx2x_init_vlan_obj(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *vlan_obj , u8 cl_id , u32 cid , u8 func_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type , struct bnx2x_credit_pool_obj *vlans_pool ) { union bnx2x_qable_obj *qable_obj ; { qable_obj = (union bnx2x_qable_obj *)vlan_obj; bnx2x_init_vlan_mac_common(vlan_obj, (int )cl_id, cid, (int )func_id, rdata, rdata_mapping, state, pstate, type, (struct bnx2x_credit_pool_obj *)0, vlans_pool); vlan_obj->get_credit = & bnx2x_get_credit_vlan; vlan_obj->put_credit = & bnx2x_put_credit_vlan; vlan_obj->get_cam_offset = & bnx2x_get_cam_offset_vlan; vlan_obj->put_cam_offset = & bnx2x_put_cam_offset_vlan; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { printk("\vbnx2x: [%s:%d(%s)]Do not support chips others than E2 and newer\n", "bnx2x_init_vlan_obj", 2023, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c"), "i" (2024), "i" (12UL)); ldv_52270: ; goto ldv_52270; } else { vlan_obj->set_one_rule = & bnx2x_set_one_vlan_e2; vlan_obj->check_del = & bnx2x_check_vlan_del; vlan_obj->check_add = & bnx2x_check_vlan_add; vlan_obj->check_move = & bnx2x_check_move; vlan_obj->ramrod_cmd = 9; vlan_obj->get_n_elements = & bnx2x_get_n_elements; bnx2x_exe_queue_init(bp, & vlan_obj->exe_queue, 16, qable_obj, & bnx2x_validate_vlan_mac, & bnx2x_remove_vlan_mac, & bnx2x_optimize_vlan_mac, & bnx2x_execute_vlan_mac, & bnx2x_exeq_get_vlan); } return; } } __inline static void __storm_memset_mac_filters(struct bnx2x *bp , struct tstorm_eth_mac_filter_config *mac_filters , u16 pf_id ) { size_t size ; u32 addr ; { size = 32UL; addr = ((unsigned int )(bp->iro_arr + 206UL)->base + (unsigned int )((int )pf_id * (int )(bp->iro_arr + 206UL)->m1)) + 4390912U; __storm_memset_struct___0(bp, addr, size, (u32 *)mac_filters); return; } } static int bnx2x_set_rx_mode_e1x(struct bnx2x *bp , struct bnx2x_rx_mode_ramrod_params *p ) { u32 mask ; struct tstorm_eth_mac_filter_config *mac_filters ; u8 drop_all_ucast ; u8 drop_all_mcast ; u8 accp_all_ucast ; u8 accp_all_bcast ; u8 accp_all_mcast ; u8 unmatched_unicast ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; long tmp___5 ; { mask = (u32 )(1 << (int )p->cl_id); mac_filters = (struct tstorm_eth_mac_filter_config *)p->rdata; drop_all_ucast = 1U; drop_all_mcast = 1U; accp_all_ucast = 0U; accp_all_bcast = 0U; accp_all_mcast = 0U; unmatched_unicast = 0U; tmp = constant_test_bit(0L, (unsigned long const volatile *)(& p->rx_accept_flags)); if (tmp != 0) { drop_all_ucast = 0U; } else { } tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& p->rx_accept_flags)); if (tmp___0 != 0) { drop_all_mcast = 0U; } else { } tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& p->rx_accept_flags)); if (tmp___1 != 0) { drop_all_ucast = 0U; accp_all_ucast = 1U; } else { } tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)(& p->rx_accept_flags)); if (tmp___2 != 0) { drop_all_mcast = 0U; accp_all_mcast = 1U; } else { } tmp___3 = constant_test_bit(4L, (unsigned long const volatile *)(& p->rx_accept_flags)); if (tmp___3 != 0) { accp_all_bcast = 1U; } else { } tmp___4 = constant_test_bit(5L, (unsigned long const volatile *)(& p->rx_accept_flags)); if (tmp___4 != 0) { unmatched_unicast = 1U; } else { } mac_filters->ucast_drop_all = (unsigned int )drop_all_ucast != 0U ? mac_filters->ucast_drop_all | mask : mac_filters->ucast_drop_all & ~ mask; mac_filters->mcast_drop_all = (unsigned int )drop_all_mcast != 0U ? mac_filters->mcast_drop_all | mask : mac_filters->mcast_drop_all & ~ mask; mac_filters->ucast_accept_all = (unsigned int )accp_all_ucast != 0U ? mac_filters->ucast_accept_all | mask : mac_filters->ucast_accept_all & ~ mask; mac_filters->mcast_accept_all = (unsigned int )accp_all_mcast != 0U ? mac_filters->mcast_accept_all | mask : mac_filters->mcast_accept_all & ~ mask; mac_filters->bcast_accept_all = (unsigned int )accp_all_bcast != 0U ? mac_filters->bcast_accept_all | mask : mac_filters->bcast_accept_all & ~ mask; mac_filters->unmatched_unicast = (unsigned int )unmatched_unicast != 0U ? mac_filters->unmatched_unicast | mask : mac_filters->unmatched_unicast & ~ mask; tmp___5 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]drop_ucast 0x%x\ndrop_mcast 0x%x\n accp_ucast 0x%x\naccp_mcast 0x%x\naccp_bcast 0x%x\n", "bnx2x_set_rx_mode_e1x", 2127, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", mac_filters->ucast_drop_all, mac_filters->mcast_drop_all, mac_filters->ucast_accept_all, mac_filters->mcast_accept_all, mac_filters->bcast_accept_all); } else { } __storm_memset_mac_filters(bp, mac_filters, (int )p->func_id); clear_bit((long )p->state, (unsigned long volatile *)p->pstate); __asm__ volatile ("": : : "memory"); return (0); } } __inline static void bnx2x_rx_mode_set_rdata_hdr_e2(u32 cid , struct eth_classify_header *hdr , u8 rule_cnt ) { { hdr->echo = cid; hdr->rule_cnt = rule_cnt; return; } } __inline static void bnx2x_rx_mode_set_cmd_state_e2(struct bnx2x *bp , unsigned long *accept_flags , struct eth_filter_rules_cmd *cmd , bool clear_accept_all ) { u16 state ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { state = 9U; tmp = constant_test_bit(0L, (unsigned long const volatile *)accept_flags); if (tmp != 0) { state = (unsigned int )state & 65534U; } else { } tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)accept_flags); if (tmp___0 != 0) { state = (unsigned int )state & 65527U; } else { } tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)accept_flags); if (tmp___1 != 0) { state = (unsigned int )state & 65534U; state = (u16 )((unsigned int )state | 2U); } else { } tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)accept_flags); if (tmp___2 != 0) { state = (u16 )((unsigned int )state | 16U); state = (unsigned int )state & 65527U; } else { } tmp___3 = constant_test_bit(4L, (unsigned long const volatile *)accept_flags); if (tmp___3 != 0) { state = (u16 )((unsigned int )state | 32U); } else { } tmp___4 = constant_test_bit(5L, (unsigned long const volatile *)accept_flags); if (tmp___4 != 0) { state = (unsigned int )state & 65534U; state = (u16 )((unsigned int )state | 4U); } else { } tmp___5 = constant_test_bit(6L, (unsigned long const volatile *)accept_flags); if (tmp___5 != 0) { state = (u16 )((unsigned int )state | 64U); } else { } if ((int )clear_accept_all) { state = (unsigned int )state & 65519U; state = (unsigned int )state & 65503U; state = (unsigned int )state & 65533U; state = (unsigned int )state & 65531U; } else { } cmd->state = state; return; } } static int bnx2x_set_rx_mode_e2(struct bnx2x *bp , struct bnx2x_rx_mode_ramrod_params *p ) { struct eth_filter_rules_ramrod_data *data ; int rc ; u8 rule_idx ; u8 tmp ; int tmp___0 ; u8 tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; long tmp___6 ; { data = (struct eth_filter_rules_ramrod_data *)p->rdata; rule_idx = 0U; memset((void *)data, 0, 264UL); tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___0 != 0) { data->rules[(int )rule_idx].client_id = p->cl_id; data->rules[(int )rule_idx].func_id = p->func_id; data->rules[(int )rule_idx].cmd_general_data = 2U; tmp = rule_idx; rule_idx = (u8 )((int )rule_idx + 1); bnx2x_rx_mode_set_cmd_state_e2(bp, & p->tx_accept_flags, (struct eth_filter_rules_cmd *)(& data->rules) + (unsigned long )tmp, 0); } else { } tmp___2 = constant_test_bit(1L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___2 != 0) { data->rules[(int )rule_idx].client_id = p->cl_id; data->rules[(int )rule_idx].func_id = p->func_id; data->rules[(int )rule_idx].cmd_general_data = 1U; tmp___1 = rule_idx; rule_idx = (u8 )((int )rule_idx + 1); bnx2x_rx_mode_set_cmd_state_e2(bp, & p->rx_accept_flags, (struct eth_filter_rules_cmd *)(& data->rules) + (unsigned long )tmp___1, 0); } else { } tmp___5 = constant_test_bit(0L, (unsigned long const volatile *)(& p->rx_mode_flags)); if (tmp___5 != 0) { tmp___3 = constant_test_bit(0L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___3 != 0) { data->rules[(int )rule_idx].client_id = (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->cl_id; data->rules[(int )rule_idx].func_id = p->func_id; data->rules[(int )rule_idx].cmd_general_data = 2U; bnx2x_rx_mode_set_cmd_state_e2(bp, & p->tx_accept_flags, (struct eth_filter_rules_cmd *)(& data->rules) + (unsigned long )rule_idx, 1); rule_idx = (u8 )((int )rule_idx + 1); } else { } tmp___4 = constant_test_bit(1L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___4 != 0) { data->rules[(int )rule_idx].client_id = (bp->fp + (unsigned long )((uint )bp->num_queues - bp->num_cnic_queues))->cl_id; data->rules[(int )rule_idx].func_id = p->func_id; data->rules[(int )rule_idx].cmd_general_data = 1U; bnx2x_rx_mode_set_cmd_state_e2(bp, & p->rx_accept_flags, (struct eth_filter_rules_cmd *)(& data->rules) + (unsigned long )rule_idx, 1); rule_idx = (u8 )((int )rule_idx + 1); } else { } } else { } bnx2x_rx_mode_set_rdata_hdr_e2(p->cid, & data->header, (int )rule_idx); tmp___6 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to configure %d rules, rx_accept_flags 0x%lx, tx_accept_flags 0x%lx\n", "bnx2x_set_rx_mode_e2", 2278, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )data->header.rule_cnt, p->rx_accept_flags, p->tx_accept_flags); } else { } rc = bnx2x_sp_post(bp, 10, (int )p->cid, (unsigned int )(p->rdata_mapping >> 32), (unsigned int )p->rdata_mapping, 0); if (rc != 0) { return (rc); } else { } return (1); } } static int bnx2x_wait_rx_mode_comp_e2(struct bnx2x *bp , struct bnx2x_rx_mode_ramrod_params *p ) { int tmp ; { tmp = bnx2x_state_wait(bp, p->state, p->pstate); return (tmp); } } static int bnx2x_empty_rx_mode_wait(struct bnx2x *bp , struct bnx2x_rx_mode_ramrod_params *p ) { { return (0); } } int bnx2x_config_rx_mode(struct bnx2x *bp , struct bnx2x_rx_mode_ramrod_params *p ) { int rc ; int tmp ; { rc = (*((p->rx_mode_obj)->config_rx_mode))(bp, p); if (rc < 0) { return (rc); } else { } tmp = constant_test_bit(2L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp != 0) { rc = (*((p->rx_mode_obj)->wait_comp))(bp, p); if (rc != 0) { return (rc); } else { } } else { } return (rc); } } void bnx2x_init_rx_mode_obj(struct bnx2x *bp , struct bnx2x_rx_mode_obj *o ) { { if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { o->wait_comp = & bnx2x_empty_rx_mode_wait; o->config_rx_mode = & bnx2x_set_rx_mode_e1x; } else { o->wait_comp = & bnx2x_wait_rx_mode_comp_e2; o->config_rx_mode = & bnx2x_set_rx_mode_e2; } return; } } __inline static u8 bnx2x_mcast_bin_from_mac(u8 *mac ) { u32 tmp ; { tmp = crc32c(0U, (void const *)mac, 6U); return ((u8 )(tmp >> 24)); } } static int bnx2x_mcast_wait(struct bnx2x *bp , struct bnx2x_mcast_obj *o ) { int tmp ; int tmp___0 ; { tmp = bnx2x_state_wait(bp, o->sched_state, o->raw.pstate); if (tmp != 0) { return (-16); } else { tmp___0 = (*(o->raw.wait_comp))(bp, & o->raw); if (tmp___0 != 0) { return (-16); } else { } } return (0); } } static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp , struct bnx2x_mcast_obj *o , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) { int total_sz ; struct bnx2x_pending_mcast_cmd *new_cmd ; struct bnx2x_mcast_mac_elem *cur_mac ; struct bnx2x_mcast_list_elem *pos ; int macs_list_len ; void *tmp ; long tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { cur_mac = (struct bnx2x_mcast_mac_elem *)0; macs_list_len = (unsigned int )cmd == 0U ? p->mcast_list_len : 0; if (p->mcast_list_len == 0) { return (0); } else { } total_sz = (int )((unsigned int )((unsigned long )macs_list_len) * 24U + 48U); tmp = kzalloc((size_t )total_sz, 32U); new_cmd = (struct bnx2x_pending_mcast_cmd *)tmp; if ((unsigned long )new_cmd == (unsigned long )((struct bnx2x_pending_mcast_cmd *)0)) { return (-12); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to enqueue a new %d command. macs_list_len=%d\n", "bnx2x_mcast_enqueue_cmd", 2409, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd, macs_list_len); } else { } INIT_LIST_HEAD(& new_cmd->data.macs_head); new_cmd->type = (int )cmd; new_cmd->done = 0; switch ((unsigned int )cmd) { case 0U: cur_mac = (struct bnx2x_mcast_mac_elem *)new_cmd + 48U; __mptr = (struct list_head const *)p->mcast_list.next; pos = (struct bnx2x_mcast_list_elem *)__mptr; goto ldv_52366; ldv_52365: memcpy((void *)(& cur_mac->mac), (void const *)pos->mac, 6UL); list_add_tail(& cur_mac->link, & new_cmd->data.macs_head); cur_mac = cur_mac + 1; __mptr___0 = (struct list_head const *)pos->link.next; pos = (struct bnx2x_mcast_list_elem *)__mptr___0; ldv_52366: ; if ((unsigned long )(& pos->link) != (unsigned long )(& p->mcast_list)) { goto ldv_52365; } else { } goto ldv_52368; case 2U: new_cmd->data.macs_num = (u32 )p->mcast_list_len; goto ldv_52368; case 3U: new_cmd->data.next_bin = 0; goto ldv_52368; default: kfree((void const *)new_cmd); printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_mcast_enqueue_cmd", 2442, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd); return (-22); } ldv_52368: list_add_tail(& new_cmd->link, & o->pending_cmds_head); (*(o->set_sched))(o); return (1); } } __inline static int bnx2x_mcast_get_next_bin(struct bnx2x_mcast_obj *o , int last ) { int i ; int j ; int inner_start ; int cur_bit ; { inner_start = last % 64; i = last / 64; goto ldv_52384; ldv_52383: ; if (o->registry.aprox_match.vec[i] != 0ULL) { j = inner_start; goto ldv_52381; ldv_52380: cur_bit = i * 64 + j; if ((int )(o->registry.aprox_match.vec[cur_bit >> 6] >> (cur_bit & 63)) & 1) { return (cur_bit); } else { } j = j + 1; ldv_52381: ; if (j <= 63) { goto ldv_52380; } else { } } else { } inner_start = 0; i = i + 1; ldv_52384: ; if (i <= 3) { goto ldv_52383; } else { } return (-1); } } __inline static int bnx2x_mcast_clear_first_bin(struct bnx2x_mcast_obj *o ) { int cur_bit ; int tmp ; { tmp = bnx2x_mcast_get_next_bin(o, 0); cur_bit = tmp; if (cur_bit >= 0) { o->registry.aprox_match.vec[cur_bit >> 6] = o->registry.aprox_match.vec[cur_bit >> 6] & ~ (1ULL << (cur_bit & 63)); } else { } return (cur_bit); } } __inline static u8 bnx2x_mcast_get_rx_tx_flag(struct bnx2x_mcast_obj *o ) { struct bnx2x_raw_obj *raw ; u8 rx_tx_flag ; { raw = & o->raw; rx_tx_flag = 0U; if ((unsigned int )raw->obj_type == 1U || (unsigned int )raw->obj_type == 2U) { rx_tx_flag = (u8 )((unsigned int )rx_tx_flag | 2U); } else { } if ((unsigned int )raw->obj_type == 0U || (unsigned int )raw->obj_type == 2U) { rx_tx_flag = (u8 )((unsigned int )rx_tx_flag | 1U); } else { } return (rx_tx_flag); } } static void bnx2x_mcast_set_one_rule_e2(struct bnx2x *bp , struct bnx2x_mcast_obj *o , int idx , union bnx2x_mcast_config_data *cfg_data , enum bnx2x_mcast_cmd cmd ) { struct bnx2x_raw_obj *r ; struct eth_multicast_rules_ramrod_data *data ; u8 func_id ; u8 rx_tx_add_flag ; u8 tmp ; int bin ; u8 tmp___0 ; long tmp___1 ; { r = & o->raw; data = (struct eth_multicast_rules_ramrod_data *)r->rdata; func_id = r->func_id; tmp = bnx2x_mcast_get_rx_tx_flag(o); rx_tx_add_flag = tmp; if ((unsigned int )cmd == 0U || (unsigned int )cmd == 3U) { rx_tx_add_flag = (u8 )((unsigned int )rx_tx_add_flag | 4U); } else { } data->rules[idx].cmd_general_data = (u8 )((int )data->rules[idx].cmd_general_data | (int )rx_tx_add_flag); switch ((unsigned int )cmd) { case 0U: tmp___0 = bnx2x_mcast_bin_from_mac(cfg_data->mac); bin = (int )tmp___0; o->registry.aprox_match.vec[bin >> 6] = o->registry.aprox_match.vec[bin >> 6] | (1ULL << (bin & 63)); goto ldv_52408; case 2U: bin = bnx2x_mcast_clear_first_bin(o); goto ldv_52408; case 3U: bin = (int )cfg_data->bin; goto ldv_52408; default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_mcast_set_one_rule_e2", 2554, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd); return; } ldv_52408: tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]%s bin %d\n", "bnx2x_mcast_set_one_rule_e2", 2560, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ((int )rx_tx_add_flag & 4) != 0 ? (char *)"Setting" : (char *)"Clearing", bin); } else { } data->rules[idx].bin_id = (unsigned char )bin; data->rules[idx].func_id = func_id; data->rules[idx].engine_id = o->engine_id; return; } } __inline static int bnx2x_mcast_handle_restore_cmd_e2(struct bnx2x *bp , struct bnx2x_mcast_obj *o , int start_bin , int *rdata_idx ) { int cur_bin ; int cnt ; union bnx2x_mcast_config_data cfg_data ; long tmp ; { cnt = *rdata_idx; cfg_data.mac = (u8 *)0U; cur_bin = bnx2x_mcast_get_next_bin(o, start_bin); goto ldv_52425; ldv_52424: cfg_data.bin = (unsigned char )cur_bin; (*(o->set_one_rule))(bp, o, cnt, & cfg_data, 3); cnt = cnt + 1; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to configure a bin %d\n", "bnx2x_mcast_handle_restore_cmd_e2", 2594, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cur_bin); } else { } if (o->max_cmd_len <= cnt) { goto ldv_52423; } else { } cur_bin = bnx2x_mcast_get_next_bin(o, cur_bin + 1); ldv_52425: ; if (cur_bin >= 0) { goto ldv_52424; } else { } ldv_52423: *rdata_idx = cnt; return (cur_bin); } } __inline static void bnx2x_mcast_hdl_pending_add_e2(struct bnx2x *bp , struct bnx2x_mcast_obj *o , struct bnx2x_pending_mcast_cmd *cmd_pos , int *line_idx ) { struct bnx2x_mcast_mac_elem *pmac_pos ; struct bnx2x_mcast_mac_elem *pmac_pos_n ; int cnt ; union bnx2x_mcast_config_data cfg_data ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; long tmp ; struct list_head const *__mptr___1 ; int tmp___0 ; { cnt = *line_idx; cfg_data.mac = (u8 *)0U; __mptr = (struct list_head const *)cmd_pos->data.macs_head.next; pmac_pos = (struct bnx2x_mcast_mac_elem *)__mptr; __mptr___0 = (struct list_head const *)pmac_pos->link.next; pmac_pos_n = (struct bnx2x_mcast_mac_elem *)__mptr___0; goto ldv_52445; ldv_52444: cfg_data.mac = (u8 *)(& pmac_pos->mac); (*(o->set_one_rule))(bp, o, cnt, & cfg_data, (enum bnx2x_mcast_cmd )cmd_pos->type); cnt = cnt + 1; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to configure %pM mcast MAC\n", "bnx2x_mcast_hdl_pending_add_e2", 2625, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (u8 *)(& pmac_pos->mac)); } else { } list_del(& pmac_pos->link); if (o->max_cmd_len <= cnt) { goto ldv_52443; } else { } pmac_pos = pmac_pos_n; __mptr___1 = (struct list_head const *)pmac_pos_n->link.next; pmac_pos_n = (struct bnx2x_mcast_mac_elem *)__mptr___1; ldv_52445: ; if ((unsigned long )(& pmac_pos->link) != (unsigned long )(& cmd_pos->data.macs_head)) { goto ldv_52444; } else { } ldv_52443: *line_idx = cnt; tmp___0 = list_empty((struct list_head const *)(& cmd_pos->data.macs_head)); if (tmp___0 != 0) { cmd_pos->done = 1; } else { } return; } } __inline static void bnx2x_mcast_hdl_pending_del_e2(struct bnx2x *bp , struct bnx2x_mcast_obj *o , struct bnx2x_pending_mcast_cmd *cmd_pos , int *line_idx ) { int cnt ; long tmp ; { cnt = *line_idx; goto ldv_52456; ldv_52455: (*(o->set_one_rule))(bp, o, cnt, (union bnx2x_mcast_config_data *)0, (enum bnx2x_mcast_cmd )cmd_pos->type); cnt = cnt + 1; cmd_pos->data.macs_num = cmd_pos->data.macs_num - 1U; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Deleting MAC. %d left,cnt is %d\n", "bnx2x_mcast_hdl_pending_del_e2", 2657, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cmd_pos->data.macs_num, cnt); } else { } if (o->max_cmd_len <= cnt) { goto ldv_52454; } else { } ldv_52456: ; if (cmd_pos->data.macs_num != 0U) { goto ldv_52455; } else { } ldv_52454: *line_idx = cnt; if (cmd_pos->data.macs_num == 0U) { cmd_pos->done = 1; } else { } return; } } __inline static void bnx2x_mcast_hdl_pending_restore_e2(struct bnx2x *bp , struct bnx2x_mcast_obj *o , struct bnx2x_pending_mcast_cmd *cmd_pos , int *line_idx ) { { cmd_pos->data.next_bin = (*(o->hdl_restore))(bp, o, cmd_pos->data.next_bin, line_idx); if (cmd_pos->data.next_bin < 0) { cmd_pos->done = 1; } else { cmd_pos->data.next_bin = cmd_pos->data.next_bin + 1; } return; } } __inline static int bnx2x_mcast_handle_pending_cmds_e2(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p ) { struct bnx2x_pending_mcast_cmd *cmd_pos ; struct bnx2x_pending_mcast_cmd *cmd_pos_n ; int cnt ; struct bnx2x_mcast_obj *o ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { cnt = 0; o = p->mcast_obj; __mptr = (struct list_head const *)o->pending_cmds_head.next; cmd_pos = (struct bnx2x_pending_mcast_cmd *)__mptr; __mptr___0 = (struct list_head const *)cmd_pos->link.next; cmd_pos_n = (struct bnx2x_pending_mcast_cmd *)__mptr___0; goto ldv_52485; ldv_52484: ; switch (cmd_pos->type) { case 0: bnx2x_mcast_hdl_pending_add_e2(bp, o, cmd_pos, & cnt); goto ldv_52478; case 2: bnx2x_mcast_hdl_pending_del_e2(bp, o, cmd_pos, & cnt); goto ldv_52478; case 3: bnx2x_mcast_hdl_pending_restore_e2(bp, o, cmd_pos, & cnt); goto ldv_52478; default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_mcast_handle_pending_cmds_e2", 2712, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cmd_pos->type); return (-22); } ldv_52478: ; if ((int )cmd_pos->done) { list_del(& cmd_pos->link); kfree((void const *)cmd_pos); } else { } if (o->max_cmd_len <= cnt) { goto ldv_52483; } else { } cmd_pos = cmd_pos_n; __mptr___1 = (struct list_head const *)cmd_pos_n->link.next; cmd_pos_n = (struct bnx2x_pending_mcast_cmd *)__mptr___1; ldv_52485: ; if ((unsigned long )(& cmd_pos->link) != (unsigned long )(& o->pending_cmds_head)) { goto ldv_52484; } else { } ldv_52483: ; return (cnt); } } __inline static void bnx2x_mcast_hdl_add(struct bnx2x *bp , struct bnx2x_mcast_obj *o , struct bnx2x_mcast_ramrod_params *p , int *line_idx ) { struct bnx2x_mcast_list_elem *mlist_pos ; union bnx2x_mcast_config_data cfg_data ; int cnt ; struct list_head const *__mptr ; long tmp ; struct list_head const *__mptr___0 ; { cfg_data.mac = (u8 *)0U; cnt = *line_idx; __mptr = (struct list_head const *)p->mcast_list.next; mlist_pos = (struct bnx2x_mcast_list_elem *)__mptr; goto ldv_52501; ldv_52500: cfg_data.mac = mlist_pos->mac; (*(o->set_one_rule))(bp, o, cnt, & cfg_data, 0); cnt = cnt + 1; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to configure %pM mcast MAC\n", "bnx2x_mcast_hdl_add", 2747, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", mlist_pos->mac); } else { } __mptr___0 = (struct list_head const *)mlist_pos->link.next; mlist_pos = (struct bnx2x_mcast_list_elem *)__mptr___0; ldv_52501: ; if ((unsigned long )(& mlist_pos->link) != (unsigned long )(& p->mcast_list)) { goto ldv_52500; } else { } *line_idx = cnt; return; } } __inline static void bnx2x_mcast_hdl_del(struct bnx2x *bp , struct bnx2x_mcast_obj *o , struct bnx2x_mcast_ramrod_params *p , int *line_idx ) { int cnt ; int i ; long tmp ; { cnt = *line_idx; i = 0; goto ldv_52513; ldv_52512: (*(o->set_one_rule))(bp, o, cnt, (union bnx2x_mcast_config_data *)0, 2); cnt = cnt + 1; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Deleting MAC. %d left\n", "bnx2x_mcast_hdl_del", 2765, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (p->mcast_list_len - i) + -1); } else { } i = i + 1; ldv_52513: ; if (p->mcast_list_len > i) { goto ldv_52512; } else { } *line_idx = cnt; return; } } __inline static int bnx2x_mcast_handle_current_cmd(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd , int start_cnt ) { struct bnx2x_mcast_obj *o ; int cnt ; long tmp ; { o = p->mcast_obj; cnt = start_cnt; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]p->mcast_list_len=%d\n", "bnx2x_mcast_handle_current_cmd", 2791, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", p->mcast_list_len); } else { } switch ((unsigned int )cmd) { case 0U: bnx2x_mcast_hdl_add(bp, o, p, & cnt); goto ldv_52525; case 2U: bnx2x_mcast_hdl_del(bp, o, p, & cnt); goto ldv_52525; case 3U: (*(o->hdl_restore))(bp, o, 0, & cnt); goto ldv_52525; default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_mcast_handle_current_cmd", 2807, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd); return (-22); } ldv_52525: p->mcast_list_len = 0; return (cnt); } } static int bnx2x_mcast_validate_e2(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) { struct bnx2x_mcast_obj *o ; int reg_sz ; int tmp ; { o = p->mcast_obj; tmp = (*(o->get_registry_size))(o); reg_sz = tmp; switch ((unsigned int )cmd) { case 2U: (*(o->set_registry_size))(o, 0); case 3U: p->mcast_list_len = reg_sz; goto ldv_52538; case 0U: ; case 1U: (*(o->set_registry_size))(o, p->mcast_list_len + reg_sz); goto ldv_52538; default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_mcast_validate_e2", 2852, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd); return (-22); } ldv_52538: o->total_pending_num = o->total_pending_num + p->mcast_list_len; return (0); } } static void bnx2x_mcast_revert_e2(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , int old_num_bins ) { struct bnx2x_mcast_obj *o ; { o = p->mcast_obj; (*(o->set_registry_size))(o, old_num_bins); o->total_pending_num = o->total_pending_num - p->mcast_list_len; return; } } __inline static void bnx2x_mcast_set_rdata_hdr_e2(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , u8 len ) { struct bnx2x_raw_obj *r ; struct eth_multicast_rules_ramrod_data *data ; { r = & (p->mcast_obj)->raw; data = (struct eth_multicast_rules_ramrod_data *)r->rdata; data->header.echo = (r->cid & 131071U) | 1179648U; data->header.rule_cnt = len; return; } } __inline static int bnx2x_mcast_refresh_registry_e2(struct bnx2x *bp , struct bnx2x_mcast_obj *o ) { int i ; int cnt ; u64 elem ; { cnt = 0; i = 0; goto ldv_52567; ldv_52566: elem = o->registry.aprox_match.vec[i]; goto ldv_52564; ldv_52563: elem = (elem - 1ULL) & elem; cnt = cnt + 1; ldv_52564: ; if (elem != 0ULL) { goto ldv_52563; } else { } i = i + 1; ldv_52567: ; if (i <= 3) { goto ldv_52566; } else { } (*(o->set_registry_size))(o, cnt); return (0); } } static int bnx2x_mcast_setup_e2(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) { struct bnx2x_raw_obj *raw ; struct bnx2x_mcast_obj *o ; struct eth_multicast_rules_ramrod_data *data ; int cnt ; int rc ; int tmp ; int __ret_warn_on ; long tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; int tmp___2 ; { raw = & (p->mcast_obj)->raw; o = p->mcast_obj; data = (struct eth_multicast_rules_ramrod_data *)raw->rdata; cnt = 0; memset((void *)data, 0, 264UL); cnt = bnx2x_mcast_handle_pending_cmds_e2(bp, p); tmp = list_empty((struct list_head const *)(& o->pending_cmds_head)); if (tmp != 0) { (*(o->clear_sched))(o); } else { } if (p->mcast_list_len > 0) { cnt = bnx2x_mcast_handle_current_cmd(bp, p, cmd, cnt); } else { } o->total_pending_num = o->total_pending_num - cnt; __ret_warn_on = o->total_pending_num < 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 2955); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = o->max_cmd_len < cnt; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 2956); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); bnx2x_mcast_set_rdata_hdr_e2(bp, p, (int )((unsigned char )cnt)); if (o->total_pending_num == 0) { bnx2x_mcast_refresh_registry_e2(bp, o); } else { } tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___2 != 0) { (*(raw->clear_pending))(raw); return (0); } else { rc = bnx2x_sp_post(bp, 11, (int )raw->cid, (unsigned int )(raw->rdata_mapping >> 32), (unsigned int )raw->rdata_mapping, 0); if (rc != 0) { return (rc); } else { } return (1); } } } static int bnx2x_mcast_validate_e1h(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) { { if ((unsigned int )cmd == 2U || (unsigned int )cmd == 3U) { p->mcast_list_len = 1; } else { } return (0); } } static void bnx2x_mcast_revert_e1h(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , int old_num_bins ) { { return; } } __inline static void bnx2x_mcast_hdl_add_e1h(struct bnx2x *bp , struct bnx2x_mcast_obj *o , struct bnx2x_mcast_ramrod_params *p , u32 *mc_filter ) { struct bnx2x_mcast_list_elem *mlist_pos ; int bit ; struct list_head const *__mptr ; u8 tmp ; long tmp___0 ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)p->mcast_list.next; mlist_pos = (struct bnx2x_mcast_list_elem *)__mptr; goto ldv_52607; ldv_52606: tmp = bnx2x_mcast_bin_from_mac(mlist_pos->mac); bit = (int )tmp; *(mc_filter + (unsigned long )(bit >> 5)) = *(mc_filter + (unsigned long )(bit >> 5)) | (u32 )(1 << (bit & 31)); tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to configure %pM mcast MAC, bin %d\n", "bnx2x_mcast_hdl_add_e1h", 3041, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", mlist_pos->mac, bit); } else { } o->registry.aprox_match.vec[bit >> 6] = o->registry.aprox_match.vec[bit >> 6] | (1ULL << (bit & 63)); __mptr___0 = (struct list_head const *)mlist_pos->link.next; mlist_pos = (struct bnx2x_mcast_list_elem *)__mptr___0; ldv_52607: ; if ((unsigned long )(& mlist_pos->link) != (unsigned long )(& p->mcast_list)) { goto ldv_52606; } else { } return; } } __inline static void bnx2x_mcast_hdl_restore_e1h(struct bnx2x *bp , struct bnx2x_mcast_obj *o , struct bnx2x_mcast_ramrod_params *p , u32 *mc_filter ) { int bit ; long tmp ; { bit = bnx2x_mcast_get_next_bin(o, 0); goto ldv_52618; ldv_52617: *(mc_filter + (unsigned long )(bit >> 5)) = *(mc_filter + (unsigned long )(bit >> 5)) | (u32 )(1 << (bit & 31)); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to set bin %d\n", "bnx2x_mcast_hdl_restore_e1h", 3059, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bit); } else { } bit = bnx2x_mcast_get_next_bin(o, bit + 1); ldv_52618: ; if (bit >= 0) { goto ldv_52617; } else { } return; } } static int bnx2x_mcast_setup_e1h(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) { int i ; struct bnx2x_mcast_obj *o ; struct bnx2x_raw_obj *r ; u32 mc_filter[8U] ; unsigned int tmp ; long tmp___0 ; int tmp___1 ; { o = p->mcast_obj; r = & o->raw; tmp___1 = constant_test_bit(3L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___1 == 0) { mc_filter[0] = 0U; tmp = 1U; while (1) { if (tmp >= 8U) { break; } else { } mc_filter[tmp] = 0U; tmp = tmp + 1U; } switch ((unsigned int )cmd) { case 0U: bnx2x_mcast_hdl_add_e1h(bp, o, p, (u32 *)(& mc_filter)); goto ldv_52630; case 2U: tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Invalidating multicast MACs configuration\n", "bnx2x_mcast_setup_e1h", 3091, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } memset((void *)(& o->registry.aprox_match.vec), 0, 32UL); goto ldv_52630; case 3U: bnx2x_mcast_hdl_restore_e1h(bp, o, p, (u32 *)(& mc_filter)); goto ldv_52630; default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_mcast_setup_e1h", 3103, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd); return (-22); } ldv_52630: i = 0; goto ldv_52636; ldv_52635: writel(mc_filter[i], (void volatile *)bp->regview + (unsigned long )((((unsigned int )(bp->iro_arr + 207UL)->base + (unsigned int )((int )bp->pfid * (int )(bp->iro_arr + 207UL)->m1)) + (unsigned int )(i * 4)) + 4390912U)); i = i + 1; ldv_52636: ; if (i <= 7) { goto ldv_52635; } else { } } else { memset((void *)(& o->registry.aprox_match.vec), 0, 32UL); } (*(r->clear_pending))(r); return (0); } } static int bnx2x_mcast_validate_e1(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) { struct bnx2x_mcast_obj *o ; int reg_sz ; int tmp ; long tmp___0 ; long tmp___1 ; { o = p->mcast_obj; tmp = (*(o->get_registry_size))(o); reg_sz = tmp; switch ((unsigned int )cmd) { case 2U: (*(o->set_registry_size))(o, 0); case 3U: p->mcast_list_len = reg_sz; tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Command %d, p->mcast_list_len=%d\n", "bnx2x_mcast_validate_e1", 3138, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd, p->mcast_list_len); } else { } goto ldv_52648; case 0U: ; case 1U: ; if (p->mcast_list_len > o->max_cmd_len) { printk("\vbnx2x: [%s:%d(%s)]Can\'t configure more than %d multicast MACs on 57710\n", "bnx2x_mcast_validate_e1", 3149, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", o->max_cmd_len); return (-22); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]p->mcast_list_len=%d\n", "bnx2x_mcast_validate_e1", 3156, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", p->mcast_list_len); } else { } if (p->mcast_list_len > 0) { (*(o->set_registry_size))(o, p->mcast_list_len); } else { } goto ldv_52648; default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_mcast_validate_e1", 3163, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd); return (-22); } ldv_52648: ; if (p->mcast_list_len != 0) { o->total_pending_num = o->total_pending_num + o->max_cmd_len; } else { } return (0); } } static void bnx2x_mcast_revert_e1(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , int old_num_macs ) { struct bnx2x_mcast_obj *o ; { o = p->mcast_obj; (*(o->set_registry_size))(o, old_num_macs); if (p->mcast_list_len != 0) { o->total_pending_num = o->total_pending_num - o->max_cmd_len; } else { } return; } } static void bnx2x_mcast_set_one_rule_e1(struct bnx2x *bp , struct bnx2x_mcast_obj *o , int idx , union bnx2x_mcast_config_data *cfg_data , enum bnx2x_mcast_cmd cmd ) { struct bnx2x_raw_obj *r ; struct mac_configuration_cmd *data ; { r = & o->raw; data = (struct mac_configuration_cmd *)r->rdata; if ((unsigned int )cmd == 0U || (unsigned int )cmd == 3U) { bnx2x_set_fw_mac_addr(& data->config_table[idx].msb_mac_addr, & data->config_table[idx].middle_mac_addr, & data->config_table[idx].lsb_mac_addr, cfg_data->mac); data->config_table[idx].vlan_id = 0U; data->config_table[idx].pf_id = r->func_id; data->config_table[idx].clients_bit_vector = (unsigned int )(1 << (int )r->cl_id); data->config_table[idx].flags = (unsigned int )data->config_table[idx].flags & 254U; data->config_table[idx].flags = (u8 )((unsigned int )data->config_table[idx].flags | 1U); } else { } return; } } __inline static void bnx2x_mcast_set_rdata_hdr_e1(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , u8 len ) { struct bnx2x_raw_obj *r ; struct mac_configuration_cmd *data ; u8 offset ; { r = & (p->mcast_obj)->raw; data = (struct mac_configuration_cmd *)r->rdata; offset = (bp->common.chip_id & 61440U) > 20480U ? (unsigned int )((u8 )((int )r->func_id + 1)) * 16U : (unsigned int )((u8 )((int )r->func_id + 1)) * 64U; data->hdr.offset = offset; data->hdr.client_id = 255U; data->hdr.echo = (r->cid & 131071U) | 1179648U; data->hdr.length = len; return; } } __inline static int bnx2x_mcast_handle_restore_cmd_e1(struct bnx2x *bp , struct bnx2x_mcast_obj *o , int start_idx , int *rdata_idx ) { struct bnx2x_mcast_mac_elem *elem ; int i ; union bnx2x_mcast_config_data cfg_data ; struct list_head const *__mptr ; long tmp ; struct list_head const *__mptr___0 ; { i = 0; cfg_data.mac = (u8 *)0U; __mptr = (struct list_head const *)o->registry.exact_match.macs.next; elem = (struct bnx2x_mcast_mac_elem *)__mptr; goto ldv_52690; ldv_52689: cfg_data.mac = (u8 *)(& elem->mac); (*(o->set_one_rule))(bp, o, i, & cfg_data, 3); i = i + 1; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to configure %pM mcast MAC\n", "bnx2x_mcast_handle_restore_cmd_e1", 3275, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cfg_data.mac); } else { } __mptr___0 = (struct list_head const *)elem->link.next; elem = (struct bnx2x_mcast_mac_elem *)__mptr___0; ldv_52690: ; if ((unsigned long )(& elem->link) != (unsigned long )(& o->registry.exact_match.macs)) { goto ldv_52689; } else { } *rdata_idx = i; return (-1); } } __inline static int bnx2x_mcast_handle_pending_cmds_e1(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p ) { struct bnx2x_pending_mcast_cmd *cmd_pos ; struct bnx2x_mcast_mac_elem *pmac_pos ; struct bnx2x_mcast_obj *o ; union bnx2x_mcast_config_data cfg_data ; int cnt ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; long tmp___0 ; struct list_head const *__mptr___1 ; long tmp___1 ; { o = p->mcast_obj; cfg_data.mac = (u8 *)0U; cnt = 0; tmp = list_empty((struct list_head const *)(& o->pending_cmds_head)); if (tmp != 0) { return (0); } else { } __mptr = (struct list_head const *)o->pending_cmds_head.next; cmd_pos = (struct bnx2x_pending_mcast_cmd *)__mptr; switch (cmd_pos->type) { case 0: __mptr___0 = (struct list_head const *)cmd_pos->data.macs_head.next; pmac_pos = (struct bnx2x_mcast_mac_elem *)__mptr___0; goto ldv_52710; ldv_52709: cfg_data.mac = (u8 *)(& pmac_pos->mac); (*(o->set_one_rule))(bp, o, cnt, & cfg_data, (enum bnx2x_mcast_cmd )cmd_pos->type); cnt = cnt + 1; tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to configure %pM mcast MAC\n", "bnx2x_mcast_handle_pending_cmds_e1", 3309, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (u8 *)(& pmac_pos->mac)); } else { } __mptr___1 = (struct list_head const *)pmac_pos->link.next; pmac_pos = (struct bnx2x_mcast_mac_elem *)__mptr___1; ldv_52710: ; if ((unsigned long )(& pmac_pos->link) != (unsigned long )(& cmd_pos->data.macs_head)) { goto ldv_52709; } else { } goto ldv_52712; case 2: cnt = (int )cmd_pos->data.macs_num; tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]About to delete %d multicast MACs\n", "bnx2x_mcast_handle_pending_cmds_e1", 3315, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cnt); } else { } goto ldv_52712; case 3: (*(o->hdl_restore))(bp, o, 0, & cnt); goto ldv_52712; default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_mcast_handle_pending_cmds_e1", 3323, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cmd_pos->type); return (-22); } ldv_52712: list_del(& cmd_pos->link); kfree((void const *)cmd_pos); return (cnt); } } __inline static void bnx2x_get_fw_mac_addr(__le16 *fw_hi , __le16 *fw_mid , __le16 *fw_lo , u8 *mac ) { { *(mac + 1UL) = *((u8 *)fw_hi); *mac = *((u8 *)fw_hi + 1UL); *(mac + 3UL) = *((u8 *)fw_mid); *(mac + 2UL) = *((u8 *)fw_mid + 1UL); *(mac + 5UL) = *((u8 *)fw_lo); *(mac + 4UL) = *((u8 *)fw_lo + 1UL); return; } } __inline static int bnx2x_mcast_refresh_registry_e1(struct bnx2x *bp , struct bnx2x_mcast_obj *o ) { struct bnx2x_raw_obj *raw ; struct bnx2x_mcast_mac_elem *elem ; struct mac_configuration_cmd *data ; int i ; int len ; int tmp ; void *tmp___0 ; long tmp___1 ; struct list_head const *__mptr ; long tmp___2 ; { raw = & o->raw; data = (struct mac_configuration_cmd *)raw->rdata; if ((int )data->config_table[0].flags & 1) { len = (int )data->hdr.length; tmp = list_empty((struct list_head const *)(& o->registry.exact_match.macs)); if (tmp == 0) { return (0); } else { } tmp___0 = kcalloc((size_t )len, 24UL, 32U); elem = (struct bnx2x_mcast_mac_elem *)tmp___0; if ((unsigned long )elem == (unsigned long )((struct bnx2x_mcast_mac_elem *)0)) { printk("\vbnx2x: [%s:%d(%s)]Failed to allocate registry memory\n", "bnx2x_mcast_refresh_registry_e1", 3384, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } else { } i = 0; goto ldv_52733; ldv_52732: bnx2x_get_fw_mac_addr(& data->config_table[i].msb_mac_addr, & data->config_table[i].middle_mac_addr, & data->config_table[i].lsb_mac_addr, (u8 *)(& elem->mac)); tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Adding registry entry for [%pM]\n", "bnx2x_mcast_refresh_registry_e1", 3395, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (u8 *)(& elem->mac)); } else { } list_add_tail(& elem->link, & o->registry.exact_match.macs); i = i + 1; elem = elem + 1; ldv_52733: ; if (i < len) { goto ldv_52732; } else { } } else { __mptr = (struct list_head const *)o->registry.exact_match.macs.next; elem = (struct bnx2x_mcast_mac_elem *)__mptr; tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Deleting a registry\n", "bnx2x_mcast_refresh_registry_e1", 3402, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } kfree((void const *)elem); INIT_LIST_HEAD(& o->registry.exact_match.macs); } return (0); } } static int bnx2x_mcast_setup_e1(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) { struct bnx2x_mcast_obj *o ; struct bnx2x_raw_obj *raw ; struct mac_configuration_cmd *data ; int cnt ; int i ; int rc ; int tmp ; int __ret_warn_on ; long tmp___0 ; int tmp___1 ; { o = p->mcast_obj; raw = & o->raw; data = (struct mac_configuration_cmd *)raw->rdata; cnt = 0; memset((void *)data, 0, 1032UL); i = 0; goto ldv_52749; ldv_52748: data->config_table[i].flags = (unsigned int )data->config_table[i].flags & 254U; data->config_table[i].flags = data->config_table[i].flags; i = i + 1; ldv_52749: ; if (o->max_cmd_len > i) { goto ldv_52748; } else { } cnt = bnx2x_mcast_handle_pending_cmds_e1(bp, p); tmp = list_empty((struct list_head const *)(& o->pending_cmds_head)); if (tmp != 0) { (*(o->clear_sched))(o); } else { } if (cnt == 0) { cnt = bnx2x_mcast_handle_current_cmd(bp, p, cmd, 0); } else { } o->total_pending_num = o->total_pending_num - o->max_cmd_len; __ret_warn_on = o->max_cmd_len < cnt; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c", 3447); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); bnx2x_mcast_set_rdata_hdr_e1(bp, p, (int )((unsigned char )cnt)); rc = bnx2x_mcast_refresh_registry_e1(bp, o); if (rc != 0) { return (rc); } else { } tmp___1 = constant_test_bit(3L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___1 != 0) { (*(raw->clear_pending))(raw); return (0); } else { rc = bnx2x_sp_post(bp, 13, (int )raw->cid, (unsigned int )(raw->rdata_mapping >> 32), (unsigned int )raw->rdata_mapping, 0); if (rc != 0) { return (rc); } else { } return (1); } } } static int bnx2x_mcast_get_registry_size_exact(struct bnx2x_mcast_obj *o ) { { return (o->registry.exact_match.num_macs_set); } } static int bnx2x_mcast_get_registry_size_aprox(struct bnx2x_mcast_obj *o ) { { return (o->registry.aprox_match.num_bins_set); } } static void bnx2x_mcast_set_registry_size_exact(struct bnx2x_mcast_obj *o , int n ) { { o->registry.exact_match.num_macs_set = n; return; } } static void bnx2x_mcast_set_registry_size_aprox(struct bnx2x_mcast_obj *o , int n ) { { o->registry.aprox_match.num_bins_set = n; return; } } int bnx2x_config_mcast(struct bnx2x *bp , struct bnx2x_mcast_ramrod_params *p , enum bnx2x_mcast_cmd cmd ) { struct bnx2x_mcast_obj *o ; struct bnx2x_raw_obj *r ; int rc ; int old_reg_size ; bool tmp ; int tmp___0 ; long tmp___1 ; bool tmp___2 ; int tmp___3 ; bool tmp___4 ; int tmp___5 ; { o = p->mcast_obj; r = & o->raw; rc = 0; old_reg_size = (*(o->get_registry_size))(o); rc = (*(o->validate))(bp, p, cmd); if (rc != 0) { return (rc); } else { } if (p->mcast_list_len == 0) { tmp = (*(o->check_sched))(o); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (0); } else { } } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]o->total_pending_num=%d p->mcast_list_len=%d o->max_cmd_len=%d\n", "bnx2x_config_mcast", 3534, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", o->total_pending_num, p->mcast_list_len, o->max_cmd_len); } else { } tmp___2 = (*(r->check_pending))(r); if ((int )tmp___2 || (o->max_cmd_len > 0 && o->total_pending_num > o->max_cmd_len)) { rc = (*(o->enqueue_cmd))(bp, p->mcast_obj, p, cmd); if (rc < 0) { goto error_exit1; } else { } p->mcast_list_len = 0; } else { } tmp___4 = (*(r->check_pending))(r); if (tmp___4) { tmp___5 = 0; } else { tmp___5 = 1; } if (tmp___5) { (*(r->set_pending))(r); rc = (*(o->config_mcast))(bp, p, cmd); if (rc < 0) { goto error_exit2; } else { } tmp___3 = constant_test_bit(2L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___3 != 0) { rc = (*(o->wait_comp))(bp, o); } else { } } else { } return (rc); error_exit2: (*(r->clear_pending))(r); error_exit1: (*(o->revert))(bp, p, old_reg_size); return (rc); } } static void bnx2x_mcast_clear_sched(struct bnx2x_mcast_obj *o ) { { __asm__ volatile ("": : : "memory"); clear_bit((long )o->sched_state, (unsigned long volatile *)o->raw.pstate); __asm__ volatile ("": : : "memory"); return; } } static void bnx2x_mcast_set_sched(struct bnx2x_mcast_obj *o ) { { __asm__ volatile ("": : : "memory"); set_bit((long )o->sched_state, (unsigned long volatile *)o->raw.pstate); __asm__ volatile ("": : : "memory"); return; } } static bool bnx2x_mcast_check_sched(struct bnx2x_mcast_obj *o ) { int tmp ; { tmp = variable_test_bit((long )o->sched_state, (unsigned long const volatile *)o->raw.pstate); return (tmp != 0); } } static bool bnx2x_mcast_check_pending(struct bnx2x_mcast_obj *o ) { bool tmp ; bool tmp___0 ; int tmp___1 ; { tmp = (*(o->raw.check_pending))(& o->raw); if ((int )tmp) { tmp___1 = 1; } else { tmp___0 = (*(o->check_sched))(o); if ((int )tmp___0) { tmp___1 = 1; } else { tmp___1 = 0; } } return ((bool )tmp___1); } } void bnx2x_init_mcast_obj(struct bnx2x *bp , struct bnx2x_mcast_obj *mcast_obj , u8 mcast_cl_id , u32 mcast_cid , u8 func_id , u8 engine_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type ) { { memset((void *)mcast_obj, 0, 256UL); bnx2x_init_raw_obj(& mcast_obj->raw, (int )mcast_cl_id, mcast_cid, (int )func_id, rdata, rdata_mapping, state, pstate, type); mcast_obj->engine_id = engine_id; INIT_LIST_HEAD(& mcast_obj->pending_cmds_head); mcast_obj->sched_state = 10; mcast_obj->check_sched = & bnx2x_mcast_check_sched; mcast_obj->set_sched = & bnx2x_mcast_set_sched; mcast_obj->clear_sched = & bnx2x_mcast_clear_sched; if (bp->common.chip_id >> 16 == 5710U) { mcast_obj->config_mcast = & bnx2x_mcast_setup_e1; mcast_obj->enqueue_cmd = & bnx2x_mcast_enqueue_cmd; mcast_obj->hdl_restore = & bnx2x_mcast_handle_restore_cmd_e1; mcast_obj->check_pending = & bnx2x_mcast_check_pending; if ((bp->common.chip_id & 61440U) > 20480U) { mcast_obj->max_cmd_len = 16; } else { mcast_obj->max_cmd_len = 64; } mcast_obj->wait_comp = & bnx2x_mcast_wait; mcast_obj->set_one_rule = & bnx2x_mcast_set_one_rule_e1; mcast_obj->validate = & bnx2x_mcast_validate_e1; mcast_obj->revert = & bnx2x_mcast_revert_e1; mcast_obj->get_registry_size = & bnx2x_mcast_get_registry_size_exact; mcast_obj->set_registry_size = & bnx2x_mcast_set_registry_size_exact; INIT_LIST_HEAD(& mcast_obj->registry.exact_match.macs); } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { mcast_obj->config_mcast = & bnx2x_mcast_setup_e1h; mcast_obj->enqueue_cmd = (int (*)(struct bnx2x * , struct bnx2x_mcast_obj * , struct bnx2x_mcast_ramrod_params * , enum bnx2x_mcast_cmd ))0; mcast_obj->hdl_restore = (int (*)(struct bnx2x * , struct bnx2x_mcast_obj * , int , int * ))0; mcast_obj->check_pending = & bnx2x_mcast_check_pending; mcast_obj->max_cmd_len = -1; mcast_obj->wait_comp = & bnx2x_mcast_wait; mcast_obj->set_one_rule = (void (*)(struct bnx2x * , struct bnx2x_mcast_obj * , int , union bnx2x_mcast_config_data * , enum bnx2x_mcast_cmd ))0; mcast_obj->validate = & bnx2x_mcast_validate_e1h; mcast_obj->revert = & bnx2x_mcast_revert_e1h; mcast_obj->get_registry_size = & bnx2x_mcast_get_registry_size_aprox; mcast_obj->set_registry_size = & bnx2x_mcast_set_registry_size_aprox; } else { mcast_obj->config_mcast = & bnx2x_mcast_setup_e2; mcast_obj->enqueue_cmd = & bnx2x_mcast_enqueue_cmd; mcast_obj->hdl_restore = & bnx2x_mcast_handle_restore_cmd_e2; mcast_obj->check_pending = & bnx2x_mcast_check_pending; mcast_obj->max_cmd_len = 16; mcast_obj->wait_comp = & bnx2x_mcast_wait; mcast_obj->set_one_rule = & bnx2x_mcast_set_one_rule_e2; mcast_obj->validate = & bnx2x_mcast_validate_e2; mcast_obj->revert = & bnx2x_mcast_revert_e2; mcast_obj->get_registry_size = & bnx2x_mcast_get_registry_size_aprox; mcast_obj->set_registry_size = & bnx2x_mcast_set_registry_size_aprox; } return; } } __inline static bool __atomic_add_ifless(atomic_t *v , int a , int u ) { int c ; int old ; long tmp ; long tmp___0 ; { c = atomic_read((atomic_t const *)v); ldv_52812: tmp = ldv__builtin_expect(c + a >= u, 0L); if (tmp != 0L) { return (0); } else { } old = atomic_cmpxchg(v, c, c + a); tmp___0 = ldv__builtin_expect(old == c, 1L); if (tmp___0 != 0L) { goto ldv_52811; } else { } c = old; goto ldv_52812; ldv_52811: ; return (1); } } __inline static bool __atomic_dec_ifmoe(atomic_t *v , int a , int u ) { int c ; int old ; long tmp ; long tmp___0 ; { c = atomic_read((atomic_t const *)v); ldv_52821: tmp = ldv__builtin_expect(c - a < u, 0L); if (tmp != 0L) { return (0); } else { } old = atomic_cmpxchg(v, c, c - a); tmp___0 = ldv__builtin_expect(old == c, 1L); if (tmp___0 != 0L) { goto ldv_52820; } else { } c = old; goto ldv_52821; ldv_52820: ; return (1); } } static bool bnx2x_credit_pool_get(struct bnx2x_credit_pool_obj *o , int cnt ) { bool rc ; { __asm__ volatile ("mfence": : : "memory"); rc = __atomic_dec_ifmoe(& o->credit, cnt, 0); __asm__ volatile ("mfence": : : "memory"); return (rc); } } static bool bnx2x_credit_pool_put(struct bnx2x_credit_pool_obj *o , int cnt ) { bool rc ; { __asm__ volatile ("mfence": : : "memory"); rc = __atomic_add_ifless(& o->credit, cnt, o->pool_sz + 1); __asm__ volatile ("mfence": : : "memory"); return (rc); } } static int bnx2x_credit_pool_check(struct bnx2x_credit_pool_obj *o ) { int cur_credit ; { __asm__ volatile ("mfence": : : "memory"); cur_credit = atomic_read((atomic_t const *)(& o->credit)); return (cur_credit); } } static bool bnx2x_credit_pool_always_true(struct bnx2x_credit_pool_obj *o , int cnt ) { { return (1); } } static bool bnx2x_credit_pool_get_entry(struct bnx2x_credit_pool_obj *o , int *offset ) { int idx ; int vec ; int i ; { *offset = -1; vec = 0; goto ldv_52852; ldv_52851: ; if (o->pool_mirror[vec] == 0ULL) { goto ldv_52847; } else { } idx = vec * 64; i = 0; goto ldv_52849; ldv_52848: ; if ((int )(o->pool_mirror[idx >> 6] >> (idx & 63)) & 1) { o->pool_mirror[idx >> 6] = o->pool_mirror[idx >> 6] & ~ (1ULL << (idx & 63)); *offset = o->base_pool_offset + idx; return (1); } else { } idx = idx + 1; i = i + 1; ldv_52849: ; if (i <= 63) { goto ldv_52848; } else { } ldv_52847: vec = vec + 1; ldv_52852: ; if (vec <= 3) { goto ldv_52851; } else { } return (0); } } static bool bnx2x_credit_pool_put_entry(struct bnx2x_credit_pool_obj *o , int offset ) { { if (o->base_pool_offset > offset) { return (0); } else { } offset = offset - o->base_pool_offset; if (o->pool_sz <= offset) { return (0); } else { } o->pool_mirror[offset >> 6] = o->pool_mirror[offset >> 6] | (1ULL << (offset & 63)); return (1); } } static bool bnx2x_credit_pool_put_entry_always_true(struct bnx2x_credit_pool_obj *o , int offset ) { { return (1); } } static bool bnx2x_credit_pool_get_entry_always_true(struct bnx2x_credit_pool_obj *o , int *offset ) { { *offset = -1; return (1); } } __inline static void bnx2x_init_credit_pool(struct bnx2x_credit_pool_obj *p , int base , int credit ) { { memset((void *)p, 0, 88UL); memset((void *)(& p->pool_mirror), 255, 32UL); atomic_set(& p->credit, credit); p->pool_sz = credit; p->base_pool_offset = base; __asm__ volatile ("mfence": : : "memory"); p->check = & bnx2x_credit_pool_check; if (credit >= 0) { p->put = & bnx2x_credit_pool_put; p->get = & bnx2x_credit_pool_get; p->put_entry = & bnx2x_credit_pool_put_entry; p->get_entry = & bnx2x_credit_pool_get_entry; } else { p->put = & bnx2x_credit_pool_always_true; p->get = & bnx2x_credit_pool_always_true; p->put_entry = & bnx2x_credit_pool_put_entry_always_true; p->get_entry = & bnx2x_credit_pool_get_entry_always_true; } if (base < 0) { p->put_entry = & bnx2x_credit_pool_put_entry_always_true; p->get_entry = & bnx2x_credit_pool_get_entry_always_true; } else { } return; } } void bnx2x_init_mac_credit_pool(struct bnx2x *bp , struct bnx2x_credit_pool_obj *p , u8 func_id , u8 func_num ) { int cam_sz ; { if (bp->common.chip_id >> 16 == 5710U) { if ((bp->common.chip_id & 61440U) <= 20480U) { cam_sz = 32; } else { cam_sz = -11; } bnx2x_init_credit_pool(p, (int )func_id * cam_sz, cam_sz); } else if (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U) { if ((unsigned int )func_num != 0U) { if ((bp->common.chip_id & 61440U) <= 20480U) { cam_sz = 256 / ((int )func_num * 2); } else { cam_sz = 5; } bnx2x_init_credit_pool(p, (int )func_id * cam_sz, cam_sz); } else { bnx2x_init_credit_pool(p, 0, 0); } } else if ((unsigned int )func_num != 0U) { if ((bp->common.chip_id & 61440U) <= 20480U) { cam_sz = 272 / (int )func_num; } else { cam_sz = 5; } bnx2x_init_credit_pool(p, -1, cam_sz); } else { bnx2x_init_credit_pool(p, 0, 0); } return; } } void bnx2x_init_vlan_credit_pool(struct bnx2x *bp , struct bnx2x_credit_pool_obj *p , u8 func_id , u8 func_num ) { int credit ; { if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { bnx2x_init_credit_pool(p, 0, -1); } else if ((unsigned int )func_num != 0U) { credit = 272 / (int )func_num; bnx2x_init_credit_pool(p, (int )func_id * credit, credit); } else { bnx2x_init_credit_pool(p, 0, 0); } return; } } __inline static void bnx2x_debug_print_ind_table(struct bnx2x *bp , struct bnx2x_config_rss_params *p ) { int i ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Setting indirection table to:\n", "bnx2x_debug_print_ind_table", 3991, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]0x0000: ", "bnx2x_debug_print_ind_table", 3992, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } i = 0; goto ldv_52892; ldv_52891: tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("0x%02x ", (int )p->ind_table[i]); } else { } if (i + 1 <= 127 && ((i + 1) & 3) == 0) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\n"); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___3 != 0L) { printk("\rbnx2x: [%s:%d(%s)]0x%04x: ", "bnx2x_debug_print_ind_table", 4000, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i + 1); } else { } } else { } i = i + 1; ldv_52892: ; if (i <= 127) { goto ldv_52891; } else { } tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___4 != 0L) { printk("\n"); } else { } return; } } static int bnx2x_setup_rss(struct bnx2x *bp , struct bnx2x_config_rss_params *p ) { struct bnx2x_rss_config_obj *o ; struct bnx2x_raw_obj *r ; struct eth_rss_update_ramrod_data *data ; u16 caps ; u8 rss_mode ; int rc ; long tmp ; int tmp___0 ; int tmp___1 ; long 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 ; long tmp___11 ; { o = p->rss_obj; r = & o->raw; data = (struct eth_rss_update_ramrod_data *)r->rdata; caps = 0U; rss_mode = 0U; memset((void *)data, 0, 184UL); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Configuring RSS\n", "bnx2x_setup_rss", 4028, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } data->echo = (r->cid & 131071U) | (u32 )(r->state << 17); tmp___1 = constant_test_bit(0L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___1 != 0) { rss_mode = 0U; } else { tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___0 != 0) { rss_mode = 1U; } else { } } data->rss_mode = rss_mode; tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\rbnx2x: [%s:%d(%s)]rss_mode=%d\n", "bnx2x_setup_rss", 4042, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )rss_mode); } else { } tmp___3 = constant_test_bit(3L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___3 != 0) { caps = (u16 )((unsigned int )caps | 1U); } else { } tmp___4 = constant_test_bit(4L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___4 != 0) { caps = (u16 )((unsigned int )caps | 2U); } else { } tmp___5 = constant_test_bit(5L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___5 != 0) { caps = (u16 )((unsigned int )caps | 4U); } else { } tmp___6 = constant_test_bit(6L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___6 != 0) { caps = (u16 )((unsigned int )caps | 16U); } else { } tmp___7 = constant_test_bit(7L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___7 != 0) { caps = (u16 )((unsigned int )caps | 32U); } else { } tmp___8 = constant_test_bit(8L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___8 != 0) { caps = (u16 )((unsigned int )caps | 64U); } else { } tmp___9 = constant_test_bit(9L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___9 != 0) { caps = (u16 )((unsigned int )caps | 1024U); } else { } tmp___10 = constant_test_bit(2L, (unsigned long const volatile *)(& p->rss_flags)); if (tmp___10 != 0) { memcpy((void *)(& data->rss_key), (void const *)(& p->rss_key), 40UL); caps = (u16 )((unsigned int )caps | 2048U); } else { } data->capabilities = caps; data->rss_result_mask = p->rss_result_mask; data->rss_engine_id = o->engine_id; tmp___11 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___11 != 0L) { printk("\rbnx2x: [%s:%d(%s)]rss_engine_id=%d\n", "bnx2x_setup_rss", 4081, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )data->rss_engine_id); } else { } memcpy((void *)(& data->indirection_table), (void const *)(& p->ind_table), 128UL); memcpy((void *)(& o->ind_table), (void const *)(& p->ind_table), 128UL); if ((bp->msg_enable & 32) != 0) { bnx2x_debug_print_ind_table(bp, p); } else { } rc = bnx2x_sp_post(bp, 12, (int )r->cid, (unsigned int )(r->rdata_mapping >> 32), (unsigned int )r->rdata_mapping, 0); if (rc < 0) { return (rc); } else { } return (1); } } void bnx2x_get_rss_ind_table(struct bnx2x_rss_config_obj *rss_obj , u8 *ind_table ) { { memcpy((void *)ind_table, (void const *)(& rss_obj->ind_table), 128UL); return; } } int bnx2x_config_rss(struct bnx2x *bp , struct bnx2x_config_rss_params *p ) { int rc ; struct bnx2x_rss_config_obj *o ; struct bnx2x_raw_obj *r ; long tmp ; int tmp___0 ; int tmp___1 ; { o = p->rss_obj; r = & o->raw; tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Not configuring RSS ramrod_flags=%lx\n", "bnx2x_config_rss", 4129, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", p->ramrod_flags); } else { } return (0); } else { } (*(r->set_pending))(r); rc = (*(o->config_rss))(bp, p); if (rc < 0) { (*(r->clear_pending))(r); return (rc); } else { } tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& p->ramrod_flags)); if (tmp___1 != 0) { rc = (*(r->wait_comp))(bp, r); } else { } return (rc); } } void bnx2x_init_rss_config_obj(struct bnx2x *bp , struct bnx2x_rss_config_obj *rss_obj , u8 cl_id , u32 cid , u8 func_id , u8 engine_id , void *rdata , dma_addr_t rdata_mapping , int state , unsigned long *pstate , bnx2x_obj_type type ) { { bnx2x_init_raw_obj(& rss_obj->raw, (int )cl_id, cid, (int )func_id, rdata, rdata_mapping, state, pstate, type); rss_obj->engine_id = engine_id; rss_obj->config_rss = & bnx2x_setup_rss; return; } } int bnx2x_queue_state_change(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; int rc ; int pending_bit ; unsigned long *pending ; long tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { o = params->q_obj; pending = & o->pending; rc = (*(o->check_transition))(bp, o, params); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]check transition returned an error. rc %d\n", "bnx2x_queue_state_change", 4185, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (-22); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]pending bit was=%lx\n", "bnx2x_queue_state_change", 4190, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", o->pending); } else { } pending_bit = (*(o->set_pending))(o, params); tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]pending bit now=%lx\n", "bnx2x_queue_state_change", 4192, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", o->pending); } else { } tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)(& params->ramrod_flags)); if (tmp___2 != 0) { (*(o->complete_cmd))(bp, o, (enum bnx2x_queue_cmd )pending_bit); } else { rc = (*(o->send_cmd))(bp, params); if (rc != 0) { o->next_state = 9; clear_bit((long )pending_bit, (unsigned long volatile *)pending); __asm__ volatile ("": : : "memory"); return (rc); } else { } tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& params->ramrod_flags)); if (tmp___1 != 0) { rc = (*(o->wait_comp))(bp, o, (enum bnx2x_queue_cmd )pending_bit); if (rc != 0) { return (rc); } else { } return (0); } else { } } tmp___3 = variable_test_bit((long )pending_bit, (unsigned long const volatile *)pending); return (tmp___3 != 0); } } static int bnx2x_queue_set_pending(struct bnx2x_queue_sp_obj *obj , struct bnx2x_queue_state_params *params ) { enum bnx2x_queue_cmd cmd ; enum bnx2x_queue_cmd bit ; { cmd = params->cmd; if ((unsigned int )cmd == 4U || (unsigned int )cmd == 3U) { bit = 5; } else { bit = cmd; } set_bit((long )bit, (unsigned long volatile *)(& obj->pending)); return ((int )bit); } } static int bnx2x_queue_wait_comp(struct bnx2x *bp , struct bnx2x_queue_sp_obj *o , enum bnx2x_queue_cmd cmd ) { int tmp ; { tmp = bnx2x_state_wait(bp, (int )cmd, & o->pending); return (tmp); } } static int bnx2x_queue_comp_cmd(struct bnx2x *bp , struct bnx2x_queue_sp_obj *o , enum bnx2x_queue_cmd cmd ) { unsigned long cur_pending ; int tmp ; long tmp___0 ; long tmp___1 ; { cur_pending = o->pending; tmp = test_and_clear_bit((long )cmd, (unsigned long volatile *)(& cur_pending)); if (tmp == 0) { printk("\vbnx2x: [%s:%d(%s)]Bad MC reply %d for queue %d in state %d pending 0x%lx, next_state %d\n", "bnx2x_queue_comp_cmd", 4262, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd, o->cids[0], (unsigned int )o->state, cur_pending, (unsigned int )o->next_state); return (-22); } else { } if ((int )o->next_tx_only >= (int )o->max_cos) { printk("\vbnx2x: [%s:%d(%s)]illegal value for next tx_only: %d. max cos was %d", "bnx2x_queue_comp_cmd", 4271, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )o->next_tx_only, (int )o->max_cos); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Completing command %d for queue %d, setting state to %d\n", "bnx2x_queue_comp_cmd", 4275, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd, o->cids[0], (unsigned int )o->next_state); } else { } if ((unsigned int )o->next_tx_only != 0U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\rbnx2x: [%s:%d(%s)]primary cid %d: num tx-only cons %d\n", "bnx2x_queue_comp_cmd", 4279, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", o->cids[0], (int )o->next_tx_only); } else { } } else { } o->state = o->next_state; o->num_tx_only = o->next_tx_only; o->next_state = 9; __asm__ volatile ("sfence": : : "memory"); clear_bit((long )cmd, (unsigned long volatile *)(& o->pending)); __asm__ volatile ("": : : "memory"); return (0); } } static void bnx2x_q_fill_setup_data_e2(struct bnx2x *bp , struct bnx2x_queue_state_params *cmd_params , struct client_init_ramrod_data *data ) { struct bnx2x_queue_setup_params *params ; int tmp ; { params = & cmd_params->params.setup; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& params->flags)); data->rx.tpa_en = (u8 )((int )((signed char )data->rx.tpa_en) | (int )((signed char )((unsigned int )((unsigned char )tmp) * 2U))); return; } } static void bnx2x_q_fill_init_general_data(struct bnx2x *bp , struct bnx2x_queue_sp_obj *o , struct bnx2x_general_setup_params *params , struct client_init_general_data *gen_data , unsigned long *flags ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; { gen_data->client_id = o->cl_id; tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)flags); if (tmp___0 != 0) { gen_data->statistics_counter_id = params->stat_id; gen_data->statistics_en_flg = 1U; tmp = constant_test_bit(4L, (unsigned long const volatile *)flags); gen_data->statistics_zero_flg = (u8 )tmp; } else { gen_data->statistics_counter_id = 0U; } tmp___1 = constant_test_bit(12L, (unsigned long const volatile *)flags); gen_data->is_fcoe_flg = (u8 )tmp___1; tmp___2 = constant_test_bit(5L, (unsigned long const volatile *)flags); gen_data->activate_flg = (u8 )tmp___2; gen_data->sp_client_id = params->spcl_id; gen_data->mtu = params->mtu; gen_data->func_id = o->func_id; gen_data->cos = params->cos; tmp___3 = constant_test_bit(12L, (unsigned long const volatile *)flags); gen_data->traffic_type = tmp___3 != 0; gen_data->fp_hsi_ver = params->fp_hsi; tmp___4 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___4 != 0L) { printk("\rbnx2x: [%s:%d(%s)]flags: active %d, cos %d, stats en %d\n", "bnx2x_q_fill_init_general_data", 4342, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )gen_data->activate_flg, (int )gen_data->cos, (int )gen_data->statistics_en_flg); } else { } return; } } static void bnx2x_q_fill_init_tx_data(struct bnx2x_queue_sp_obj *o , struct bnx2x_txq_setup_params *params , struct client_init_tx_data *tx_data , unsigned long *flags ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; { tmp = constant_test_bit(17L, (unsigned long const volatile *)flags); tx_data->enforce_security_flg = (u8 )tmp; tx_data->default_vlan = params->default_vlan; tmp___0 = constant_test_bit(15L, (unsigned long const volatile *)flags); tx_data->default_vlan_flg = (u8 )tmp___0; tmp___1 = constant_test_bit(16L, (unsigned long const volatile *)flags); tx_data->tx_switching_flg = (u8 )tmp___1; tmp___2 = constant_test_bit(18L, (unsigned long const volatile *)flags); tx_data->anti_spoofing_flg = (u8 )tmp___2; tmp___3 = constant_test_bit(20L, (unsigned long const volatile *)flags); tx_data->force_default_pri_flg = (u8 )tmp___3; tmp___4 = constant_test_bit(21L, (unsigned long const volatile *)flags); tx_data->refuse_outband_vlan_flg = (u8 )tmp___4; tmp___5 = constant_test_bit(23L, (unsigned long const volatile *)flags); tx_data->tunnel_lso_inc_ip_id = (u8 )tmp___5; tmp___6 = constant_test_bit(22L, (unsigned long const volatile *)flags); tx_data->tunnel_non_lso_pcsum_location = tmp___6 == 0; tx_data->tx_status_block_id = params->fw_sb_id; tx_data->tx_sb_index_number = params->sb_cq_index; tx_data->tss_leading_client_id = params->tss_leading_cl_id; tx_data->tx_bd_page_base.lo = (unsigned int )params->dscr_map; tx_data->tx_bd_page_base.hi = (unsigned int )(params->dscr_map >> 32); tx_data->state = 0U; return; } } static void bnx2x_q_fill_init_pause_data(struct bnx2x_queue_sp_obj *o , struct rxq_pause_params *params , struct client_init_rx_data *rx_data ) { { rx_data->cqe_pause_thr_low = params->rcq_th_lo; rx_data->cqe_pause_thr_high = params->rcq_th_hi; rx_data->bd_pause_thr_low = params->bd_th_lo; rx_data->bd_pause_thr_high = params->bd_th_hi; rx_data->sge_pause_thr_low = params->sge_th_lo; rx_data->sge_pause_thr_high = params->sge_th_hi; rx_data->rx_cos_mask = params->pri_map; return; } } static void bnx2x_q_fill_init_rx_data(struct bnx2x_queue_sp_obj *o , struct bnx2x_rxq_setup_params *params , struct client_init_rx_data *rx_data , unsigned long *flags ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; { tmp = constant_test_bit(0L, (unsigned long const volatile *)flags); rx_data->tpa_en = (u8 )tmp; tmp___0 = constant_test_bit(2L, (unsigned long const volatile *)flags); rx_data->tpa_en = (u8 )((int )((signed char )rx_data->tpa_en) | (int )((signed char )((unsigned int )((unsigned char )tmp___0) * 4U))); rx_data->vmqueue_mode_en_flg = 0U; rx_data->cache_line_alignment_log_size = params->cache_line_log; tmp___1 = constant_test_bit(11L, (unsigned long const volatile *)flags); rx_data->enable_dynamic_hc = (u8 )tmp___1; rx_data->max_sges_for_packet = params->max_sges_pkt; rx_data->client_qzone_id = params->cl_qzone_id; rx_data->max_agg_size = params->tpa_agg_sz; rx_data->state = 9U; rx_data->drop_ip_cs_err_flg = 0U; rx_data->drop_tcp_cs_err_flg = 0U; rx_data->drop_ttl0_flg = 0U; rx_data->drop_udp_cs_err_flg = 0U; tmp___2 = constant_test_bit(7L, (unsigned long const volatile *)flags); rx_data->inner_vlan_removal_enable_flg = (u8 )tmp___2; tmp___3 = constant_test_bit(6L, (unsigned long const volatile *)flags); rx_data->outer_vlan_removal_enable_flg = (u8 )tmp___3; rx_data->status_block_id = params->fw_sb_id; rx_data->rx_sb_index_number = params->sb_cq_index; rx_data->max_tpa_queues = params->max_tpa_queues; rx_data->max_bytes_on_bd = params->buf_sz; rx_data->sge_buff_size = params->sge_buf_sz; rx_data->bd_page_base.lo = (unsigned int )params->dscr_map; rx_data->bd_page_base.hi = (unsigned int )(params->dscr_map >> 32); rx_data->sge_page_base.lo = (unsigned int )params->sge_map; rx_data->sge_page_base.hi = (unsigned int )(params->sge_map >> 32); rx_data->cqe_page_base.lo = (unsigned int )params->rcq_map; rx_data->cqe_page_base.hi = (unsigned int )(params->rcq_map >> 32); tmp___4 = constant_test_bit(13L, (unsigned long const volatile *)flags); rx_data->is_leading_rss = (u8 )tmp___4; tmp___5 = constant_test_bit(14L, (unsigned long const volatile *)flags); if (tmp___5 != 0) { rx_data->approx_mcast_engine_id = params->mcast_engine_id; rx_data->is_approx_mcast = 1U; } else { } rx_data->rss_engine_id = params->rss_engine_id; tmp___6 = constant_test_bit(19L, (unsigned long const volatile *)flags); rx_data->silent_vlan_removal_flg = (u8 )tmp___6; rx_data->silent_vlan_value = params->silent_removal_value; rx_data->silent_vlan_mask = params->silent_removal_mask; return; } } static void bnx2x_q_fill_setup_data_cmn(struct bnx2x *bp , struct bnx2x_queue_state_params *cmd_params , struct client_init_ramrod_data *data ) { { bnx2x_q_fill_init_general_data(bp, cmd_params->q_obj, & cmd_params->params.setup.gen_params, & data->general, & cmd_params->params.setup.flags); bnx2x_q_fill_init_tx_data(cmd_params->q_obj, & cmd_params->params.setup.txq_params, & data->tx, & cmd_params->params.setup.flags); bnx2x_q_fill_init_rx_data(cmd_params->q_obj, & cmd_params->params.setup.rxq_params, & data->rx, & cmd_params->params.setup.flags); bnx2x_q_fill_init_pause_data(cmd_params->q_obj, & cmd_params->params.setup.pause_params, & data->rx); return; } } static void bnx2x_q_fill_setup_tx_only(struct bnx2x *bp , struct bnx2x_queue_state_params *cmd_params , struct tx_queue_init_ramrod_data *data ) { long tmp ; { bnx2x_q_fill_init_general_data(bp, cmd_params->q_obj, & cmd_params->params.tx_only.gen_params, & data->general, & cmd_params->params.tx_only.flags); bnx2x_q_fill_init_tx_data(cmd_params->q_obj, & cmd_params->params.tx_only.txq_params, & data->tx, & cmd_params->params.tx_only.flags); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]cid %d, tx bd page lo %x hi %x", "bnx2x_q_fill_setup_tx_only", 4507, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (cmd_params->q_obj)->cids[0], data->tx.tx_bd_page_base.lo, data->tx.tx_bd_page_base.hi); } else { } return; } } __inline static int bnx2x_q_init(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; struct bnx2x_queue_init_params *init ; u16 hc_usec ; u8 cos ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; { o = params->q_obj; init = & params->params.init; tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& o->type)); if (tmp___0 != 0) { tmp___1 = constant_test_bit(9L, (unsigned long const volatile *)(& init->tx.flags)); if (tmp___1 != 0) { hc_usec = (unsigned int )init->tx.hc_rate != 0U ? (u16 )(1000000 / (int )init->tx.hc_rate) : 0U; tmp = constant_test_bit(10L, (unsigned long const volatile *)(& init->tx.flags)); bnx2x_update_coalesce_sb_index(bp, (int )init->tx.fw_sb_id, (int )init->tx.sb_cq_index, tmp == 0, (int )hc_usec); } else { } } else { } tmp___3 = constant_test_bit(0L, (unsigned long const volatile *)(& o->type)); if (tmp___3 != 0) { tmp___4 = constant_test_bit(9L, (unsigned long const volatile *)(& init->rx.flags)); if (tmp___4 != 0) { hc_usec = (unsigned int )init->rx.hc_rate != 0U ? (u16 )(1000000 / (int )init->rx.hc_rate) : 0U; tmp___2 = constant_test_bit(10L, (unsigned long const volatile *)(& init->rx.flags)); bnx2x_update_coalesce_sb_index(bp, (int )init->rx.fw_sb_id, (int )init->rx.sb_cq_index, tmp___2 == 0, (int )hc_usec); } else { } } else { } cos = 0U; goto ldv_53009; ldv_53008: tmp___5 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___5 != 0L) { printk("\rbnx2x: [%s:%d(%s)]setting context validation. cid %d, cos %d\n", "bnx2x_q_init", 4554, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", o->cids[(int )cos], (int )cos); } else { } tmp___6 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]context pointer %p\n", "bnx2x_q_init", 4555, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", init->cxts[(int )cos]); } else { } bnx2x_set_ctx_validation(bp, init->cxts[(int )cos], o->cids[(int )cos]); cos = (u8 )((int )cos + 1); ldv_53009: ; if ((int )o->max_cos > (int )cos) { goto ldv_53008; } else { } (*(o->complete_cmd))(bp, o, 0); __asm__ volatile ("": : : "memory"); __asm__ volatile ("mfence": : : "memory"); return (0); } } __inline static int bnx2x_q_send_setup_e1x(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; struct client_init_ramrod_data *rdata ; dma_addr_t data_mapping ; int ramrod ; int tmp ; { o = params->q_obj; rdata = (struct client_init_ramrod_data *)o->rdata; data_mapping = o->rdata_mapping; ramrod = 1; memset((void *)rdata, 0, 120UL); bnx2x_q_fill_setup_data_cmn(bp, params, rdata); tmp = bnx2x_sp_post(bp, ramrod, (int )o->cids[0], (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 0); return (tmp); } } __inline static int bnx2x_q_send_setup_e2(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; struct client_init_ramrod_data *rdata ; dma_addr_t data_mapping ; int ramrod ; int tmp ; { o = params->q_obj; rdata = (struct client_init_ramrod_data *)o->rdata; data_mapping = o->rdata_mapping; ramrod = 1; memset((void *)rdata, 0, 120UL); bnx2x_q_fill_setup_data_cmn(bp, params, rdata); bnx2x_q_fill_setup_data_e2(bp, params, rdata); tmp = bnx2x_sp_post(bp, ramrod, (int )o->cids[0], (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 0); return (tmp); } } __inline static int bnx2x_q_send_setup_tx_only(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; struct tx_queue_init_ramrod_data *rdata ; dma_addr_t data_mapping ; int ramrod ; struct bnx2x_queue_setup_tx_only_params *tx_only_params ; u8 cid_index ; long tmp ; long tmp___0 ; int tmp___1 ; { o = params->q_obj; rdata = (struct tx_queue_init_ramrod_data *)o->rdata; data_mapping = o->rdata_mapping; ramrod = 4; tx_only_params = & params->params.tx_only; cid_index = tx_only_params->cid_index; if ((int )o->max_cos <= (int )cid_index) { printk("\vbnx2x: [%s:%d(%s)]queue[%d]: cid_index (%d) is out of range\n", "bnx2x_q_send_setup_tx_only", 4635, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )o->cl_id, (int )cid_index); return (-22); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]parameters received: cos: %d sp-id: %d\n", "bnx2x_q_send_setup_tx_only", 4641, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tx_only_params->gen_params.cos, (int )tx_only_params->gen_params.spcl_id); } else { } memset((void *)rdata, 0, 40UL); bnx2x_q_fill_setup_tx_only(bp, params, rdata); tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]sending tx-only ramrod: cid %d, client-id %d, sp-client id %d, cos %d\n", "bnx2x_q_send_setup_tx_only", 4651, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", o->cids[(int )cid_index], (int )rdata->general.client_id, (int )rdata->general.sp_client_id, (int )rdata->general.cos); } else { } tmp___1 = bnx2x_sp_post(bp, ramrod, (int )o->cids[(int )cid_index], (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 0); return (tmp___1); } } static void bnx2x_q_fill_update_data(struct bnx2x *bp , struct bnx2x_queue_sp_obj *obj , struct bnx2x_queue_update_params *params , struct client_update_ramrod_data *data ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; { data->client_id = obj->cl_id; data->func_id = obj->func_id; data->default_vlan = params->def_vlan; tmp = constant_test_bit(0L, (unsigned long const volatile *)(& params->update_flags)); data->inner_vlan_removal_enable_flg = (u8 )tmp; tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& params->update_flags)); data->inner_vlan_removal_change_flg = (u8 )tmp___0; tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& params->update_flags)); data->outer_vlan_removal_enable_flg = (u8 )tmp___1; tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)(& params->update_flags)); data->outer_vlan_removal_change_flg = (u8 )tmp___2; tmp___3 = constant_test_bit(4L, (unsigned long const volatile *)(& params->update_flags)); data->anti_spoofing_enable_flg = (u8 )tmp___3; tmp___4 = constant_test_bit(5L, (unsigned long const volatile *)(& params->update_flags)); data->anti_spoofing_change_flg = (u8 )tmp___4; tmp___5 = constant_test_bit(6L, (unsigned long const volatile *)(& params->update_flags)); data->activate_flg = (u8 )tmp___5; tmp___6 = constant_test_bit(7L, (unsigned long const volatile *)(& params->update_flags)); data->activate_change_flg = (u8 )tmp___6; tmp___7 = constant_test_bit(8L, (unsigned long const volatile *)(& params->update_flags)); data->default_vlan_enable_flg = (u8 )tmp___7; tmp___8 = constant_test_bit(9L, (unsigned long const volatile *)(& params->update_flags)); data->default_vlan_change_flg = (u8 )tmp___8; tmp___9 = constant_test_bit(10L, (unsigned long const volatile *)(& params->update_flags)); data->silent_vlan_change_flg = (u8 )tmp___9; tmp___10 = constant_test_bit(11L, (unsigned long const volatile *)(& params->update_flags)); data->silent_vlan_removal_flg = (u8 )tmp___10; data->silent_vlan_value = params->silent_removal_value; data->silent_vlan_mask = params->silent_removal_mask; tmp___11 = constant_test_bit(13L, (unsigned long const volatile *)(& params->update_flags)); data->tx_switching_flg = (u8 )tmp___11; tmp___12 = constant_test_bit(12L, (unsigned long const volatile *)(& params->update_flags)); data->tx_switching_change_flg = (u8 )tmp___12; tmp___13 = constant_test_bit(15L, (unsigned long const volatile *)(& params->update_flags)); data->handle_ptp_pkts_flg = (u8 )tmp___13; tmp___14 = constant_test_bit(14L, (unsigned long const volatile *)(& params->update_flags)); data->handle_ptp_pkts_change_flg = (u8 )tmp___14; return; } } __inline static int bnx2x_q_send_update(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; struct client_update_ramrod_data *rdata ; dma_addr_t data_mapping ; struct bnx2x_queue_update_params *update_params ; u8 cid_index ; int tmp ; { o = params->q_obj; rdata = (struct client_update_ramrod_data *)o->rdata; data_mapping = o->rdata_mapping; update_params = & params->params.update; cid_index = update_params->cid_index; if ((int )o->max_cos <= (int )cid_index) { printk("\vbnx2x: [%s:%d(%s)]queue[%d]: cid_index (%d) is out of range\n", "bnx2x_q_send_update", 4749, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )o->cl_id, (int )cid_index); return (-22); } else { } memset((void *)rdata, 0, 32UL); bnx2x_q_fill_update_data(bp, o, update_params, rdata); tmp = bnx2x_sp_post(bp, 5, (int )o->cids[(int )cid_index], (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 0); return (tmp); } } __inline static int bnx2x_q_send_deactivate(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_update_params *update ; int tmp ; { update = & params->params.update; memset((void *)update, 0, 16UL); __set_bit(7L, (unsigned long volatile *)(& update->update_flags)); tmp = bnx2x_q_send_update(bp, params); return (tmp); } } __inline static int bnx2x_q_send_activate(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_update_params *update ; int tmp ; { update = & params->params.update; memset((void *)update, 0, 16UL); __set_bit(6L, (unsigned long volatile *)(& update->update_flags)); __set_bit(7L, (unsigned long volatile *)(& update->update_flags)); tmp = bnx2x_q_send_update(bp, params); return (tmp); } } static void bnx2x_q_fill_update_tpa_data(struct bnx2x *bp , struct bnx2x_queue_sp_obj *obj , struct bnx2x_queue_update_tpa_params *params , struct tpa_update_ramrod_data *data ) { { data->client_id = obj->cl_id; data->complete_on_both_clients = params->complete_on_both_clients; data->dont_verify_rings_pause_thr_flg = params->dont_verify_thr; data->max_agg_size = params->max_agg_sz; data->max_sges_for_packet = params->max_sges_pkt; data->max_tpa_queues = params->max_tpa_queues; data->sge_buff_size = params->sge_buff_sz; data->sge_page_base_hi = (unsigned int )(params->sge_map >> 32); data->sge_page_base_lo = (unsigned int )params->sge_map; data->sge_pause_thr_high = params->sge_pause_thr_high; data->sge_pause_thr_low = params->sge_pause_thr_low; data->tpa_mode = params->tpa_mode; data->update_ipv4 = params->update_ipv4; data->update_ipv6 = params->update_ipv6; return; } } __inline static int bnx2x_q_send_update_tpa(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; struct tpa_update_ramrod_data *rdata ; dma_addr_t data_mapping ; struct bnx2x_queue_update_tpa_params *update_tpa_params ; u16 type ; int tmp ; { o = params->q_obj; rdata = (struct tpa_update_ramrod_data *)o->rdata; data_mapping = o->rdata_mapping; update_tpa_params = & params->params.update_tpa; memset((void *)rdata, 0, 24UL); bnx2x_q_fill_update_tpa_data(bp, o, update_tpa_params, rdata); type = (int )((u16 )o->func_id) << 8U; tmp = bnx2x_sp_post(bp, 8, (int )o->cids[0], (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, (int )type); return (tmp); } } __inline static int bnx2x_q_send_halt(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; int tmp ; { o = params->q_obj; tmp = bnx2x_sp_post(bp, 2, (int )o->cids[0], 0U, (u32 )o->cl_id, 0); return (tmp); } } __inline static int bnx2x_q_send_cfc_del(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; u8 cid_idx ; int tmp ; { o = params->q_obj; cid_idx = params->params.cfc_del.cid_index; if ((int )o->max_cos <= (int )cid_idx) { printk("\vbnx2x: [%s:%d(%s)]queue[%d]: cid_index (%d) is out of range\n", "bnx2x_q_send_cfc_del", 4887, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )o->cl_id, (int )cid_idx); return (-22); } else { } tmp = bnx2x_sp_post(bp, 4, (int )o->cids[(int )cid_idx], 0U, 0U, 8); return (tmp); } } __inline static int bnx2x_q_send_terminate(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; u8 cid_index ; int tmp ; { o = params->q_obj; cid_index = params->params.terminate.cid_index; if ((int )o->max_cos <= (int )cid_index) { printk("\vbnx2x: [%s:%d(%s)]queue[%d]: cid_index (%d) is out of range\n", "bnx2x_q_send_terminate", 4903, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )o->cl_id, (int )cid_index); return (-22); } else { } tmp = bnx2x_sp_post(bp, 7, (int )o->cids[(int )cid_index], 0U, 0U, 0); return (tmp); } } __inline static int bnx2x_q_send_empty(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { struct bnx2x_queue_sp_obj *o ; int tmp ; { o = params->q_obj; tmp = bnx2x_sp_post(bp, 6, (int )o->cids[0], 0U, 0U, 0); return (tmp); } } __inline static int bnx2x_queue_send_cmd_cmn(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { 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 ; { switch ((unsigned int )params->cmd) { case 0U: tmp = bnx2x_q_init(bp, params); return (tmp); case 2U: tmp___0 = bnx2x_q_send_setup_tx_only(bp, params); return (tmp___0); case 3U: tmp___1 = bnx2x_q_send_deactivate(bp, params); return (tmp___1); case 4U: tmp___2 = bnx2x_q_send_activate(bp, params); return (tmp___2); case 5U: tmp___3 = bnx2x_q_send_update(bp, params); return (tmp___3); case 6U: tmp___4 = bnx2x_q_send_update_tpa(bp, params); return (tmp___4); case 7U: tmp___5 = bnx2x_q_send_halt(bp, params); return (tmp___5); case 8U: tmp___6 = bnx2x_q_send_cfc_del(bp, params); return (tmp___6); case 9U: tmp___7 = bnx2x_q_send_terminate(bp, params); return (tmp___7); case 10U: tmp___8 = bnx2x_q_send_empty(bp, params); return (tmp___8); default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_queue_send_cmd_cmn", 4946, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )params->cmd); return (-22); } } } static int bnx2x_queue_send_cmd_e1x(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { int tmp ; int tmp___0 ; { switch ((unsigned int )params->cmd) { case 1U: tmp = bnx2x_q_send_setup_e1x(bp, params); return (tmp); case 0U: ; case 2U: ; case 3U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 8U: ; case 9U: ; case 10U: tmp___0 = bnx2x_queue_send_cmd_cmn(bp, params); return (tmp___0); default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_queue_send_cmd_e1x", 4969, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )params->cmd); return (-22); } } } static int bnx2x_queue_send_cmd_e2(struct bnx2x *bp , struct bnx2x_queue_state_params *params ) { int tmp ; int tmp___0 ; { switch ((unsigned int )params->cmd) { case 1U: tmp = bnx2x_q_send_setup_e2(bp, params); return (tmp); case 0U: ; case 2U: ; case 3U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 8U: ; case 9U: ; case 10U: tmp___0 = bnx2x_queue_send_cmd_cmn(bp, params); return (tmp___0); default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_queue_send_cmd_e2", 4992, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )params->cmd); return (-22); } } } static int bnx2x_queue_chk_transition(struct bnx2x *bp , struct bnx2x_queue_sp_obj *o , struct bnx2x_queue_state_params *params ) { enum bnx2x_q_state state ; enum bnx2x_q_state next_state ; enum bnx2x_queue_cmd cmd ; struct bnx2x_queue_update_params *update_params ; u8 next_tx_only ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; long tmp___7 ; long tmp___8 ; { state = o->state; next_state = 9; cmd = params->cmd; update_params = & params->params.update; next_tx_only = o->num_tx_only; tmp = constant_test_bit(3L, (unsigned long const volatile *)(& params->ramrod_flags)); if (tmp != 0) { o->pending = 0UL; o->next_state = 9; } else { } if (o->pending != 0UL) { printk("\vbnx2x: [%s:%d(%s)]Blocking transition since pending was %lx\n", "bnx2x_queue_chk_transition", 5036, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", o->pending); return (-16); } else { } switch ((unsigned int )state) { case 0U: ; if ((unsigned int )cmd == 0U) { next_state = 1; } else { } goto ldv_53165; case 1U: ; if ((unsigned int )cmd == 1U) { tmp___0 = constant_test_bit(5L, (unsigned long const volatile *)(& params->params.setup.flags)); if (tmp___0 != 0) { next_state = 2; } else { next_state = 5; } } else { } goto ldv_53165; case 2U: ; if ((unsigned int )cmd == 3U) { next_state = 5; } else if ((unsigned int )cmd == 10U || (unsigned int )cmd == 6U) { next_state = 2; } else if ((unsigned int )cmd == 2U) { next_state = 3; next_tx_only = 1U; } else if ((unsigned int )cmd == 7U) { next_state = 6; } else if ((unsigned int )cmd == 5U) { tmp___1 = constant_test_bit(7L, (unsigned long const volatile *)(& update_params->update_flags)); if (tmp___1 != 0) { tmp___2 = constant_test_bit(6L, (unsigned long const volatile *)(& update_params->update_flags)); if (tmp___2 == 0) { next_state = 5; } else { next_state = 2; } } else { next_state = 2; } } else { } goto ldv_53165; case 3U: ; if ((unsigned int )cmd == 9U) { next_state = 4; } else if ((unsigned int )cmd == 2U) { next_state = 3; next_tx_only = (unsigned int )o->num_tx_only + 1U; } else if ((unsigned int )cmd == 10U || (unsigned int )cmd == 6U) { next_state = 3; } else if ((unsigned int )cmd == 5U) { tmp___3 = constant_test_bit(7L, (unsigned long const volatile *)(& update_params->update_flags)); if (tmp___3 != 0) { tmp___4 = constant_test_bit(6L, (unsigned long const volatile *)(& update_params->update_flags)); if (tmp___4 == 0) { next_state = 5; } else { next_state = 3; } } else { next_state = 3; } } else { } goto ldv_53165; case 4U: ; if ((unsigned int )cmd == 8U) { next_tx_only = (unsigned int )o->num_tx_only + 255U; if ((unsigned int )next_tx_only == 0U) { next_state = 2; } else { next_state = 3; } } else { } goto ldv_53165; case 5U: ; if ((unsigned int )cmd == 4U) { next_state = 2; } else if ((unsigned int )cmd == 10U || (unsigned int )cmd == 6U) { next_state = 5; } else if ((unsigned int )cmd == 7U) { next_state = 6; } else if ((unsigned int )cmd == 5U) { tmp___5 = constant_test_bit(7L, (unsigned long const volatile *)(& update_params->update_flags)); if (tmp___5 != 0) { tmp___6 = constant_test_bit(6L, (unsigned long const volatile *)(& update_params->update_flags)); if (tmp___6 != 0) { if ((unsigned int )o->num_tx_only == 0U) { next_state = 2; } else { next_state = 3; } } else { next_state = 5; } } else { next_state = 5; } } else { } goto ldv_53165; case 6U: ; if ((unsigned int )cmd == 9U) { next_state = 7; } else { } goto ldv_53165; case 7U: ; if ((unsigned int )cmd == 8U) { next_state = 0; } else { } goto ldv_53165; default: printk("\vbnx2x: [%s:%d(%s)]Illegal state: %d\n", "bnx2x_queue_chk_transition", 5162, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state); } ldv_53165: ; if ((unsigned int )next_state != 9U) { tmp___7 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Good state transition: %d(%d)->%d\n", "bnx2x_queue_chk_transition", 5168, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state, (unsigned int )cmd, (unsigned int )next_state); } else { } o->next_state = next_state; o->next_tx_only = next_tx_only; return (0); } else { } tmp___8 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___8 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Bad state transition request: %d %d\n", "bnx2x_queue_chk_transition", 5174, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state, (unsigned int )cmd); } else { } return (-22); } } void bnx2x_init_queue_obj(struct bnx2x *bp , struct bnx2x_queue_sp_obj *obj , u8 cl_id , u32 *cids , u8 cid_cnt , u8 func_id , void *rdata , dma_addr_t rdata_mapping , unsigned long type ) { long tmp ; { memset((void *)obj, 0, 104UL); tmp = ldv__builtin_expect((unsigned int )cid_cnt > 3U, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c"), "i" (5188), "i" (12UL)); ldv_53185: ; goto ldv_53185; } else { } memcpy((void *)(& obj->cids), (void const *)cids, (unsigned long )cid_cnt * 4UL); obj->max_cos = cid_cnt; obj->cl_id = cl_id; obj->func_id = func_id; obj->rdata = rdata; obj->rdata_mapping = rdata_mapping; obj->type = type; obj->next_state = 9; if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { obj->send_cmd = & bnx2x_queue_send_cmd_e1x; } else { obj->send_cmd = & bnx2x_queue_send_cmd_e2; } obj->check_transition = & bnx2x_queue_chk_transition; obj->complete_cmd = & bnx2x_queue_comp_cmd; obj->wait_comp = & bnx2x_queue_wait_comp; obj->set_pending = & bnx2x_queue_set_pending; return; } } int bnx2x_get_q_logical_state(struct bnx2x *bp , struct bnx2x_queue_sp_obj *obj ) { { switch ((unsigned int )obj->state) { case 2U: ; case 3U: ; return (0); case 0U: ; case 1U: ; case 4U: ; case 5U: ; case 6U: ; case 7U: ; case 8U: ; return (1); default: ; return (-22); } } } enum bnx2x_func_state bnx2x_func_get_state(struct bnx2x *bp , struct bnx2x_func_sp_obj *o ) { { if (o->pending != 0UL) { return (4); } else { } __asm__ volatile ("lfence": : : "memory"); return (o->state); } } static int bnx2x_func_wait_comp(struct bnx2x *bp , struct bnx2x_func_sp_obj *o , enum bnx2x_func_cmd cmd ) { int tmp ; { tmp = bnx2x_state_wait(bp, (int )cmd, & o->pending); return (tmp); } } __inline static int bnx2x_func_state_change_comp(struct bnx2x *bp , struct bnx2x_func_sp_obj *o , enum bnx2x_func_cmd cmd ) { unsigned long cur_pending ; int tmp ; long tmp___0 ; { cur_pending = o->pending; tmp = test_and_clear_bit((long )cmd, (unsigned long volatile *)(& cur_pending)); if (tmp == 0) { printk("\vbnx2x: [%s:%d(%s)]Bad MC reply %d for func %d in state %d pending 0x%lx, next_state %d\n", "bnx2x_func_state_change_comp", 5274, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd, (int )bp->pfid, (unsigned int )o->state, cur_pending, (unsigned int )o->next_state); return (-22); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Completing command %d for func %d, setting state to %d\n", "bnx2x_func_state_change_comp", 5280, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmd, (int )bp->pfid, (unsigned int )o->next_state); } else { } o->state = o->next_state; o->next_state = 4; __asm__ volatile ("sfence": : : "memory"); clear_bit((long )cmd, (unsigned long volatile *)(& o->pending)); __asm__ volatile ("": : : "memory"); return (0); } } static int bnx2x_func_comp_cmd(struct bnx2x *bp , struct bnx2x_func_sp_obj *o , enum bnx2x_func_cmd cmd ) { int rc ; int tmp ; { tmp = bnx2x_func_state_change_comp(bp, o, cmd); rc = tmp; return (rc); } } static int bnx2x_func_chk_transition(struct bnx2x *bp , struct bnx2x_func_sp_obj *o , struct bnx2x_func_state_params *params ) { enum bnx2x_func_state state ; enum bnx2x_func_state next_state ; enum bnx2x_func_cmd cmd ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; long tmp___6 ; long tmp___7 ; { state = o->state; next_state = 4; cmd = params->cmd; tmp = constant_test_bit(3L, (unsigned long const volatile *)(& params->ramrod_flags)); if (tmp != 0) { o->pending = 0UL; o->next_state = 4; } else { } if (o->pending != 0UL) { return (-16); } else { } switch ((unsigned int )state) { case 0U: ; if ((unsigned int )cmd == 0U) { next_state = 1; } else { } goto ldv_53231; case 1U: ; if ((unsigned int )cmd == 1U) { next_state = 2; } else if ((unsigned int )cmd == 3U) { next_state = 0; } else { } goto ldv_53231; case 2U: ; if ((unsigned int )cmd == 2U) { next_state = 1; } else if ((unsigned int )cmd == 4U) { tmp___3 = constant_test_bit(2L, (unsigned long const volatile *)(& o->pending)); if (tmp___3 == 0) { next_state = 2; } else { goto _L___2; } } else _L___2: /* CIL Label */ if ((unsigned int )cmd == 5U) { tmp___2 = constant_test_bit(2L, (unsigned long const volatile *)(& o->pending)); if (tmp___2 == 0) { next_state = 2; } else { goto _L___1; } } else _L___1: /* CIL Label */ if ((unsigned int )cmd == 8U) { tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& o->pending)); if (tmp___1 == 0) { next_state = 2; } else { goto _L___0; } } else _L___0: /* CIL Label */ if ((unsigned int )cmd == 9U) { tmp___0 = constant_test_bit(2L, (unsigned long const volatile *)(& o->pending)); if (tmp___0 == 0) { next_state = 2; } else { goto _L; } } else _L: /* CIL Label */ if ((unsigned int )cmd == 6U) { next_state = 3; } else { } goto ldv_53231; case 3U: ; if ((unsigned int )cmd == 8U) { tmp___5 = constant_test_bit(2L, (unsigned long const volatile *)(& o->pending)); if (tmp___5 == 0) { next_state = 3; } else { goto _L___4; } } else _L___4: /* CIL Label */ if ((unsigned int )cmd == 9U) { tmp___4 = constant_test_bit(2L, (unsigned long const volatile *)(& o->pending)); if (tmp___4 == 0) { next_state = 3; } else { goto _L___3; } } else _L___3: /* CIL Label */ if ((unsigned int )cmd == 7U) { next_state = 2; } else { } goto ldv_53231; default: printk("\vbnx2x: [%s:%d(%s)]Unknown state: %d\n", "bnx2x_func_chk_transition", 5410, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state); } ldv_53231: ; if ((unsigned int )next_state != 4U) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___6 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Good function state transition: %d(%d)->%d\n", "bnx2x_func_chk_transition", 5416, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state, (unsigned int )cmd, (unsigned int )next_state); } else { } o->next_state = next_state; return (0); } else { } tmp___7 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___7 != 0L) { printk("\rbnx2x: [%s:%d(%s)]Bad function state transition request: %d %d\n", "bnx2x_func_chk_transition", 5422, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )state, (unsigned int )cmd); } else { } return (-22); } } __inline static int bnx2x_func_init_func(struct bnx2x *bp , struct bnx2x_func_sp_drv_ops const *drv ) { int tmp ; { tmp = (*(drv->init_hw_func))(bp); return (tmp); } } __inline static int bnx2x_func_init_port(struct bnx2x *bp , struct bnx2x_func_sp_drv_ops const *drv ) { int rc ; int tmp ; int tmp___0 ; { tmp = (*(drv->init_hw_port))(bp); rc = tmp; if (rc != 0) { return (rc); } else { } tmp___0 = bnx2x_func_init_func(bp, drv); return (tmp___0); } } __inline static int bnx2x_func_init_cmn_chip(struct bnx2x *bp , struct bnx2x_func_sp_drv_ops const *drv ) { int rc ; int tmp ; int tmp___0 ; { tmp = (*(drv->init_hw_cmn_chip))(bp); rc = tmp; if (rc != 0) { return (rc); } else { } tmp___0 = bnx2x_func_init_port(bp, drv); return (tmp___0); } } __inline static int bnx2x_func_init_cmn(struct bnx2x *bp , struct bnx2x_func_sp_drv_ops const *drv ) { int rc ; int tmp ; int tmp___0 ; { tmp = (*(drv->init_hw_cmn))(bp); rc = tmp; if (rc != 0) { return (rc); } else { } tmp___0 = bnx2x_func_init_port(bp, drv); return (tmp___0); } } static int bnx2x_func_hw_init(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { u32 load_code ; struct bnx2x_func_sp_obj *o ; struct bnx2x_func_sp_drv_ops const *drv ; int rc ; long tmp ; { load_code = params->params.hw_init.load_phase; o = params->f_obj; drv = (struct bnx2x_func_sp_drv_ops const *)o->drv; rc = 0; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]function %d load_code %x\n", "bnx2x_func_hw_init", 5513, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->pf_num, load_code); } else { } rc = (*(drv->gunzip_init))(bp); if (rc != 0) { return (rc); } else { } rc = (*(drv->init_fw))(bp); if (rc != 0) { printk("\vbnx2x: [%s:%d(%s)]Error loading firmware\n", "bnx2x_func_hw_init", 5523, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); goto init_err; } else { } switch (load_code) { case 269680640U: rc = bnx2x_func_init_cmn_chip(bp, drv); if (rc != 0) { goto init_err; } else { } goto ldv_53267; case 269484032U: rc = bnx2x_func_init_cmn(bp, drv); if (rc != 0) { goto init_err; } else { } goto ldv_53267; case 269549568U: rc = bnx2x_func_init_port(bp, drv); if (rc != 0) { goto init_err; } else { } goto ldv_53267; case 269615104U: rc = bnx2x_func_init_func(bp, drv); if (rc != 0) { goto init_err; } else { } goto ldv_53267; default: printk("\vbnx2x: [%s:%d(%s)]Unknown load_code (0x%x) from MCP\n", "bnx2x_func_hw_init", 5554, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", load_code); rc = -22; } ldv_53267: ; init_err: (*(drv->gunzip_end))(bp); if (rc == 0) { (*(o->complete_cmd))(bp, o, 0); } else { } return (rc); } } __inline static void bnx2x_func_reset_func(struct bnx2x *bp , struct bnx2x_func_sp_drv_ops const *drv ) { { (*(drv->reset_hw_func))(bp); return; } } __inline static void bnx2x_func_reset_port(struct bnx2x *bp , struct bnx2x_func_sp_drv_ops const *drv ) { { (*(drv->reset_hw_port))(bp); bnx2x_func_reset_func(bp, drv); return; } } __inline static void bnx2x_func_reset_cmn(struct bnx2x *bp , struct bnx2x_func_sp_drv_ops const *drv ) { { bnx2x_func_reset_port(bp, drv); (*(drv->reset_hw_cmn))(bp); return; } } __inline static int bnx2x_func_hw_reset(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { u32 reset_phase ; struct bnx2x_func_sp_obj *o ; struct bnx2x_func_sp_drv_ops const *drv ; long tmp ; { reset_phase = params->params.hw_reset.reset_phase; o = params->f_obj; drv = (struct bnx2x_func_sp_drv_ops const *)o->drv; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]function %d reset_phase %x\n", "bnx2x_func_hw_reset", 5632, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->pf_num, reset_phase); } else { } switch (reset_phase) { case 537919488U: bnx2x_func_reset_cmn(bp, drv); goto ldv_53293; case 537985024U: bnx2x_func_reset_port(bp, drv); goto ldv_53293; case 538050560U: bnx2x_func_reset_func(bp, drv); goto ldv_53293; default: printk("\vbnx2x: [%s:%d(%s)]Unknown reset_phase (0x%x) from MCP\n", "bnx2x_func_hw_reset", 5646, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", reset_phase); goto ldv_53293; } ldv_53293: (*(o->complete_cmd))(bp, o, 3); return (0); } } __inline static int bnx2x_func_send_start(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { struct bnx2x_func_sp_obj *o ; struct function_start_data *rdata ; dma_addr_t data_mapping ; struct bnx2x_func_start_params *start_params ; int tmp ; { o = params->f_obj; rdata = (struct function_start_data *)o->rdata; data_mapping = o->rdata_mapping; start_params = & params->params.start; memset((void *)rdata, 0, 24UL); rdata->function_mode = (unsigned char )start_params->mf_mode; rdata->sd_vlan_tag = start_params->sd_vlan_tag; rdata->path_id = bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (unsigned int )bp->pf_num & 1U : 0U; rdata->network_cos_mode = start_params->network_cos_mode; rdata->tunnel_mode = start_params->tunnel_mode; rdata->gre_tunnel_type = start_params->gre_tunnel_type; rdata->inner_gre_rss_en = start_params->inner_gre_rss_en; rdata->vxlan_dst_port = 4789U; rdata->sd_accept_mf_clss_fail = start_params->class_fail; if ((unsigned int )start_params->class_fail_ethtype != 0U) { rdata->sd_accept_mf_clss_fail_match_ethtype = 1U; rdata->sd_accept_mf_clss_fail_ethtype = start_params->class_fail_ethtype; } else { } rdata->sd_vlan_force_pri_flg = start_params->sd_vlan_force_pri; rdata->sd_vlan_force_pri_val = start_params->sd_vlan_force_pri_val; if ((unsigned int )start_params->sd_vlan_eth_type != 0U) { rdata->sd_vlan_eth_type = start_params->sd_vlan_eth_type; } else { rdata->sd_vlan_eth_type = 33024U; } rdata->no_added_tags = start_params->no_added_tags; tmp = bnx2x_sp_post(bp, 1, 0, (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 8); return (tmp); } } __inline static int bnx2x_func_send_switch_update(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { struct bnx2x_func_sp_obj *o ; struct function_update_data *rdata ; dma_addr_t data_mapping ; struct bnx2x_func_switch_update_params *switch_update_params ; 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 ; { o = params->f_obj; rdata = (struct function_update_data *)o->rdata; data_mapping = o->rdata_mapping; switch_update_params = & params->params.switch_update; memset((void *)rdata, 0, 32UL); tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& switch_update_params->changes)); if (tmp___0 != 0) { rdata->tx_switch_suspend_change_flg = 1U; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& switch_update_params->changes)); rdata->tx_switch_suspend = (u8 )tmp; } else { } tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& switch_update_params->changes)); if (tmp___1 != 0) { rdata->sd_vlan_tag_change_flg = 1U; rdata->sd_vlan_tag = switch_update_params->vlan; } else { } tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)(& switch_update_params->changes)); if (tmp___2 != 0) { rdata->sd_vlan_eth_type_change_flg = 1U; rdata->sd_vlan_eth_type = switch_update_params->vlan_eth_type; } else { } tmp___4 = constant_test_bit(4L, (unsigned long const volatile *)(& switch_update_params->changes)); if (tmp___4 != 0) { rdata->sd_vlan_force_pri_change_flg = 1U; tmp___3 = constant_test_bit(5L, (unsigned long const volatile *)(& switch_update_params->changes)); if (tmp___3 != 0) { rdata->sd_vlan_force_pri_flg = 1U; } else { } rdata->sd_vlan_force_pri_flg = switch_update_params->vlan_force_prio; } else { } tmp___7 = constant_test_bit(6L, (unsigned long const volatile *)(& switch_update_params->changes)); if (tmp___7 != 0) { rdata->update_tunn_cfg_flg = 1U; tmp___5 = constant_test_bit(7L, (unsigned long const volatile *)(& switch_update_params->changes)); if (tmp___5 != 0) { rdata->tunn_clss_en = 1U; } else { } tmp___6 = constant_test_bit(8L, (unsigned long const volatile *)(& switch_update_params->changes)); if (tmp___6 != 0) { rdata->inner_gre_rss_en = 1U; } else { } rdata->tunnel_mode = switch_update_params->tunnel_mode; rdata->gre_tunnel_type = switch_update_params->gre_tunnel_type; rdata->vxlan_dst_port = 4789U; } else { } rdata->echo = 0U; tmp___8 = bnx2x_sp_post(bp, 3, 0, (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 8); return (tmp___8); } } __inline static int bnx2x_func_send_afex_update(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { struct bnx2x_func_sp_obj *o ; struct function_update_data *rdata ; dma_addr_t data_mapping ; struct bnx2x_func_afex_update_params *afex_update_params ; long tmp ; int tmp___0 ; { o = params->f_obj; rdata = (struct function_update_data *)o->afex_rdata; data_mapping = o->afex_rdata_mapping; afex_update_params = & params->params.afex_update; memset((void *)rdata, 0, 32UL); rdata->vif_id_change_flg = 1U; rdata->vif_id = afex_update_params->vif_id; rdata->afex_default_vlan_change_flg = 1U; rdata->afex_default_vlan = afex_update_params->afex_default_vlan; rdata->allowed_priorities_change_flg = 1U; rdata->allowed_priorities = afex_update_params->allowed_priorities; rdata->echo = 1U; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]afex: sending func_update vif_id 0x%x dvlan 0x%x prio 0x%x\n", "bnx2x_func_send_afex_update", 5808, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )rdata->vif_id, (int )rdata->afex_default_vlan, (int )rdata->allowed_priorities); } else { } tmp___0 = bnx2x_sp_post(bp, 3, 0, (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 8); return (tmp___0); } } __inline static int bnx2x_func_send_afex_viflists(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { struct bnx2x_func_sp_obj *o ; struct afex_vif_list_ramrod_data *rdata ; struct bnx2x_func_afex_viflists_params *afex_vif_params ; u64 *p_rdata ; long tmp ; int tmp___0 ; { o = params->f_obj; rdata = (struct afex_vif_list_ramrod_data *)o->afex_rdata; afex_vif_params = & params->params.afex_viflists; p_rdata = (u64 *)rdata; memset((void *)rdata, 0, 8UL); rdata->vif_list_index = afex_vif_params->vif_list_index; rdata->func_bit_map = afex_vif_params->func_bit_map; rdata->afex_vif_list_command = afex_vif_params->afex_vif_list_command; rdata->func_to_clear = afex_vif_params->func_to_clear; rdata->echo = afex_vif_params->afex_vif_list_command; tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]afex: ramrod lists, cmd 0x%x index 0x%x func_bit_map 0x%x func_to_clr 0x%x\n", "bnx2x_func_send_afex_viflists", 5846, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )rdata->afex_vif_list_command, (int )rdata->vif_list_index, (int )rdata->func_bit_map, (int )rdata->func_to_clear); } else { } tmp___0 = bnx2x_sp_post(bp, 9, 0, (unsigned int )(*p_rdata >> 32), (unsigned int )*p_rdata, 8); return (tmp___0); } } __inline static int bnx2x_func_send_stop(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { int tmp ; { tmp = bnx2x_sp_post(bp, 2, 0, 0U, 0U, 8); return (tmp); } } __inline static int bnx2x_func_send_tx_stop(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { int tmp ; { tmp = bnx2x_sp_post(bp, 7, 0, 0U, 0U, 8); return (tmp); } } __inline static int bnx2x_func_send_tx_start(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { struct bnx2x_func_sp_obj *o ; struct flow_control_configuration *rdata ; dma_addr_t data_mapping ; struct bnx2x_func_tx_start_params *tx_start_params ; int i ; int tmp ; { o = params->f_obj; rdata = (struct flow_control_configuration *)o->rdata; data_mapping = o->rdata_mapping; tx_start_params = & params->params.tx_start; memset((void *)rdata, 0, 40UL); rdata->dcb_enabled = tx_start_params->dcb_enabled; rdata->dcb_version = tx_start_params->dcb_version; rdata->dont_add_pri_0_en = tx_start_params->dont_add_pri_0_en; i = 0; goto ldv_53351; ldv_53350: rdata->traffic_type_to_priority_cos[i] = tx_start_params->traffic_type_to_priority_cos[i]; i = i + 1; ldv_53351: ; if ((unsigned int )i <= 7U) { goto ldv_53350; } else { } tmp = bnx2x_sp_post(bp, 8, 0, (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 8); return (tmp); } } __inline static int bnx2x_func_send_set_timesync(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { struct bnx2x_func_sp_obj *o ; struct set_timesync_ramrod_data *rdata ; dma_addr_t data_mapping ; struct bnx2x_func_set_timesync_params *set_timesync_params ; long tmp ; int tmp___0 ; { o = params->f_obj; rdata = (struct set_timesync_ramrod_data *)o->rdata; data_mapping = o->rdata_mapping; set_timesync_params = & params->params.set_timesync; memset((void *)rdata, 0, 16UL); rdata->drift_adjust_cmd = set_timesync_params->drift_adjust_cmd; rdata->offset_cmd = set_timesync_params->offset_cmd; rdata->add_sub_drift_adjust_value = set_timesync_params->add_sub_drift_adjust_value; rdata->drift_adjust_value = set_timesync_params->drift_adjust_value; rdata->drift_adjust_period = set_timesync_params->drift_adjust_period; rdata->offset_delta.lo = (unsigned int )set_timesync_params->offset_delta; rdata->offset_delta.hi = (unsigned int )(set_timesync_params->offset_delta >> 32); tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\rbnx2x: [%s:%d(%s)]Set timesync command params: drift_cmd = %d, offset_cmd = %d, add_sub_drift = %d, drift_val = %d, drift_period = %d, offset_lo = %d, offset_hi = %d\n", "bnx2x_func_send_set_timesync", 5928, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )rdata->drift_adjust_cmd, (int )rdata->offset_cmd, (int )rdata->add_sub_drift_adjust_value, (int )rdata->drift_adjust_value, rdata->drift_adjust_period, rdata->offset_delta.lo, rdata->offset_delta.hi); } else { } tmp___0 = bnx2x_sp_post(bp, 10, 0, (unsigned int )(data_mapping >> 32), (unsigned int )data_mapping, 8); return (tmp___0); } } static int bnx2x_func_send_cmd(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { 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 ; { switch ((unsigned int )params->cmd) { case 0U: tmp = bnx2x_func_hw_init(bp, params); return (tmp); case 1U: tmp___0 = bnx2x_func_send_start(bp, params); return (tmp___0); case 2U: tmp___1 = bnx2x_func_send_stop(bp, params); return (tmp___1); case 3U: tmp___2 = bnx2x_func_hw_reset(bp, params); return (tmp___2); case 4U: tmp___3 = bnx2x_func_send_afex_update(bp, params); return (tmp___3); case 5U: tmp___4 = bnx2x_func_send_afex_viflists(bp, params); return (tmp___4); case 6U: tmp___5 = bnx2x_func_send_tx_stop(bp, params); return (tmp___5); case 7U: tmp___6 = bnx2x_func_send_tx_start(bp, params); return (tmp___6); case 8U: tmp___7 = bnx2x_func_send_switch_update(bp, params); return (tmp___7); case 9U: tmp___8 = bnx2x_func_send_set_timesync(bp, params); return (tmp___8); default: printk("\vbnx2x: [%s:%d(%s)]Unknown command: %d\n", "bnx2x_func_send_cmd", 5960, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )params->cmd); return (-22); } } } void bnx2x_init_func_obj(struct bnx2x *bp , struct bnx2x_func_sp_obj *obj , void *rdata , dma_addr_t rdata_mapping , void *afex_rdata , dma_addr_t afex_rdata_mapping , struct bnx2x_func_sp_drv_ops *drv_iface ) { struct lock_class_key __key ; { memset((void *)obj, 0, 248UL); __mutex_init(& obj->one_pending_mutex, "&obj->one_pending_mutex", & __key); obj->rdata = rdata; obj->rdata_mapping = rdata_mapping; obj->afex_rdata = afex_rdata; obj->afex_rdata_mapping = afex_rdata_mapping; obj->send_cmd = & bnx2x_func_send_cmd; obj->check_transition = & bnx2x_func_chk_transition; obj->complete_cmd = & bnx2x_func_comp_cmd; obj->wait_comp = & bnx2x_func_wait_comp; obj->drv = drv_iface; return; } } int bnx2x_func_state_change(struct bnx2x *bp , struct bnx2x_func_state_params *params ) { struct bnx2x_func_sp_obj *o ; int rc ; int cnt ; enum bnx2x_func_cmd cmd ; unsigned long *pending ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { o = params->f_obj; cnt = 300; cmd = params->cmd; pending = & o->pending; mutex_lock_nested(& o->one_pending_mutex, 0U); rc = (*(o->check_transition))(bp, o, params); if (rc == -16) { tmp = constant_test_bit(7L, (unsigned long const volatile *)(& params->ramrod_flags)); if (tmp != 0) { goto ldv_53398; ldv_53397: mutex_unlock(& o->one_pending_mutex); msleep(10U); mutex_lock_nested(& o->one_pending_mutex, 0U); rc = (*(o->check_transition))(bp, o, params); ldv_53398: ; if (rc == -16) { cnt = cnt - 1; if (cnt > 0) { goto ldv_53397; } else { goto ldv_53399; } } else { } ldv_53399: ; if (rc == -16) { mutex_unlock(& o->one_pending_mutex); printk("\vbnx2x: [%s:%d(%s)]timeout waiting for previous ramrod completion\n", "bnx2x_func_state_change", 6022, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } } else { goto _L; } } else _L: /* CIL Label */ if (rc != 0) { mutex_unlock(& o->one_pending_mutex); return (rc); } else { } set_bit((long )cmd, (unsigned long volatile *)pending); tmp___1 = constant_test_bit(3L, (unsigned long const volatile *)(& params->ramrod_flags)); if (tmp___1 != 0) { bnx2x_func_state_change_comp(bp, o, cmd); mutex_unlock(& o->one_pending_mutex); } else { rc = (*(o->send_cmd))(bp, params); mutex_unlock(& o->one_pending_mutex); if (rc != 0) { o->next_state = 4; clear_bit((long )cmd, (unsigned long volatile *)pending); __asm__ volatile ("": : : "memory"); return (rc); } else { } tmp___0 = constant_test_bit(2L, (unsigned long const volatile *)(& params->ramrod_flags)); if (tmp___0 != 0) { rc = (*(o->wait_comp))(bp, o, cmd); if (rc != 0) { return (rc); } else { } return (0); } else { } } tmp___2 = variable_test_bit((long )cmd, (unsigned long const volatile *)pending); return (tmp___2 != 0); } } bool ldv_queue_work_on_151(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_152(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_153(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_154(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_155(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void warn_slowpath_fmt(char const * , int const , char const * , ...) ; bool ldv_queue_work_on_165(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_167(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_166(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_169(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_168(struct workqueue_struct *ldv_func_arg1 ) ; void bnx2x_lock_vf_pf_channel(struct bnx2x *bp , struct bnx2x_virtf *vf , enum channel_tlvs tlv ) ; void bnx2x_unlock_vf_pf_channel(struct bnx2x *bp , struct bnx2x_virtf *vf , enum channel_tlvs expected_tlv ) ; __inline static struct bnx2x_vf_queue *vfq_get(struct bnx2x_virtf *vf , u8 index ) { { return (vf->vfqs + (unsigned long )index); } } __inline static u8 vf_igu_sb(struct bnx2x_virtf *vf , u16 sb_idx ) { { return ((int )vf->igu_base_id + (int )((u8 )sb_idx)); } } __inline static u8 vf_hc_qzone(struct bnx2x_virtf *vf , u16 sb_idx ) { u8 tmp ; { tmp = vf_igu_sb(vf, (int )sb_idx); return (tmp); } } static u8 vfq_cl_id(struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q ) { { return ((int )vf->igu_base_id + (int )((u8 )q->index)); } } __inline static u8 vfq_qzone_id(struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q ) { u8 tmp ; { tmp = vfq_cl_id(vf, q); return (tmp); } } void bnx2x_vf_mbx(struct bnx2x *bp ) ; void bnx2x_vf_enable_mbx(struct bnx2x *bp , u8 abs_vfid ) ; int bnx2x_vf_acquire(struct bnx2x *bp , struct bnx2x_virtf *vf , struct vf_pf_resc_request *resc ) ; int bnx2x_vf_init(struct bnx2x *bp , struct bnx2x_virtf *vf , dma_addr_t *sb_map ) ; void bnx2x_vfop_qctor_dump_tx(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_queue_init_params *init_params , struct bnx2x_queue_setup_params *setup_params , u16 q_idx , u16 sb_idx ) ; void bnx2x_vfop_qctor_dump_rx(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_queue_init_params *init_params , struct bnx2x_queue_setup_params *setup_params , u16 q_idx , u16 sb_idx ) ; void bnx2x_vfop_qctor_prep(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q , struct bnx2x_vf_queue_construct_params *p , unsigned long q_type ) ; int bnx2x_vf_mac_vlan_config_list(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mac_vlan_filters *filters , int qid , bool drv_only ) ; int bnx2x_vf_queue_setup(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid , struct bnx2x_vf_queue_construct_params *qctor ) ; int bnx2x_vf_queue_teardown(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid ) ; int bnx2x_vf_mcast(struct bnx2x *bp , struct bnx2x_virtf *vf , bnx2x_mac_addr_t *mcasts , int mc_num , bool drv_only ) ; int bnx2x_vf_rxmode(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid , unsigned long accept_flags ) ; int bnx2x_vf_close(struct bnx2x *bp , struct bnx2x_virtf *vf ) ; int bnx2x_vf_free(struct bnx2x *bp , struct bnx2x_virtf *vf ) ; int bnx2x_vf_rss_update(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_config_rss_params *rss ) ; int bnx2x_vf_tpa_update(struct bnx2x *bp , struct bnx2x_virtf *vf , struct vfpf_tpa_tlv *tlv , struct bnx2x_queue_update_tpa_params *params ) ; int bnx2x_vf_release(struct bnx2x *bp , struct bnx2x_virtf *vf ) ; int bnx2x_vf_idx_by_abs_fid(struct bnx2x *bp , u16 abs_vfid ) ; u8 bnx2x_vf_max_queue_cnt(struct bnx2x *bp , struct bnx2x_virtf *vf ) ; int bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp , u8 abs_vfid ) ; void bnx2x_vf_enable_access(struct bnx2x *bp , u8 abs_vfid ) ; bool bnx2x_tlv_supported(u16 tlvtype ) ; u32 bnx2x_crc_vf_bulletin(struct pf_vf_bulletin_content *bulletin ) ; int bnx2x_post_vf_bulletin(struct bnx2x *bp , int vf ) ; void bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin , bool support_long ) ; int bnx2x_iov_link_update_vf(struct bnx2x *bp , int idx ) ; __inline static void bnx2x_del_all_napi___1(struct bnx2x *bp ) { int i ; { i = 0; goto ldv_51359; ldv_51358: napi_hash_del(& (bp->fp + (unsigned long )i)->napi); netif_napi_del(& (bp->fp + (unsigned long )i)->napi); i = i + 1; ldv_51359: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_51358; } else { } return; } } static int bnx2x_vfpf_teardown_queue(struct bnx2x *bp , int qidx ) ; static void bnx2x_add_tlv(struct bnx2x *bp , void *tlvs_list , u16 offset , u16 type , u16 length ) { struct channel_tlv *tl ; { tl = (struct channel_tlv *)tlvs_list + (unsigned long )offset; tl->type = type; tl->length = length; return; } } static void bnx2x_vfpf_prep(struct bnx2x *bp , struct vfpf_first_tlv *first_tlv , u16 type , u16 length ) { long tmp ; { mutex_lock_nested(& bp->vf2pf_mutex, 0U); tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]preparing to send %d tlv over vf pf channel\n", "bnx2x_vfpf_prep", 44, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )type); } else { } memset((void *)bp->vf2pf_mbox, 0, 2048UL); bnx2x_add_tlv(bp, (void *)(& first_tlv->tl), 0, (int )type, (int )length); first_tlv->resp_msg_offset = 1024U; return; } } static void bnx2x_vfpf_finalize(struct bnx2x *bp , struct vfpf_first_tlv *first_tlv ) { long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]done sending [%d] tlv over vf pf channel\n", "bnx2x_vfpf_finalize", 61, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )first_tlv->tl.type); } else { } mutex_unlock(& bp->vf2pf_mutex); return; } } static void *bnx2x_search_tlv_list(struct bnx2x *bp , void *tlvs_list , enum channel_tlvs req_tlv ) { struct channel_tlv *tlv ; long tmp ; { tlv = (struct channel_tlv *)tlvs_list; ldv_51627: ; if ((unsigned int )tlv->type == (unsigned int )req_tlv) { return ((void *)tlv); } else { } if ((unsigned int )tlv->length == 0U) { printk("\v[%s:%d(%s)]Found TLV with length 0\n", "bnx2x_search_tlv_list", 77, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return ((void *)0); } else { } tlvs_list = tlvs_list + (unsigned long )tlv->length; tlv = (struct channel_tlv *)tlvs_list; if ((unsigned int )tlv->type != 12U) { goto ldv_51627; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]TLV list does not contain %d TLV\n", "bnx2x_search_tlv_list", 85, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )req_tlv); } else { } return ((void *)0); } } static void bnx2x_dp_tlv_list(struct bnx2x *bp , void *tlvs_list ) { int i ; struct channel_tlv *tlv ; long tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; { i = 1; tlv = (struct channel_tlv *)tlvs_list; goto ldv_51639; ldv_51638: tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]TLV number %d: type %d, length %d\n", "bnx2x_dp_tlv_list", 99, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (int )tlv->type, (int )tlv->length); } else { } tlvs_list = tlvs_list + (unsigned long )tlv->length; tlv = (struct channel_tlv *)tlvs_list; i = i + 1; if (i > 50) { __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_fmt("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c", 111, "corrupt tlvs"); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } else { } ldv_51639: ; if ((unsigned int )tlv->type != 12U) { goto ldv_51638; } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]TLV number %d: type %d, length %d\n", "bnx2x_dp_tlv_list", 118, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (int )tlv->type, (int )tlv->length); } else { } return; } } bool bnx2x_tlv_supported(u16 tlvtype ) { { return ((bool )((unsigned int )tlvtype != 0U && (unsigned int )tlvtype <= 19U)); } } __inline static int bnx2x_pfvf_status_codes(int rc ) { { switch (rc) { case 0: ; return (1); case -12: ; return (4); default: ; return (2); } } } static int bnx2x_send_msg2pf(struct bnx2x *bp , u8 *done , dma_addr_t msg_mapping ) { struct cstorm_vf_zone_data *zone_data ; int tout ; int interval ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { zone_data = (struct cstorm_vf_zone_data *)bp->regview + 30208U; tout = 100; interval = 100; if ((unsigned int )*done != 0U) { printk("\v[%s:%d(%s)]done was non zero before message to pf was sent\n", "bnx2x_send_msg2pf", 146, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c", 147); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (-22); } else { } bnx2x_sample_bulletin(bp); if ((bp->old_bulletin.valid_bitmap & 4ULL) != 0ULL) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]detecting channel down. Aborting message\n", "bnx2x_send_msg2pf", 156, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } *done = 1U; return (-22); } else { } writel((unsigned int )msg_mapping, (void volatile *)(& zone_data->non_trigger.vf_pf_channel.msg_addr_lo)); writel((unsigned int )(msg_mapping >> 32), (void volatile *)(& zone_data->non_trigger.vf_pf_channel.msg_addr_hi)); __asm__ volatile ("sfence": : : "memory"); writeb(1, (void volatile *)(& zone_data->trigger.vf_pf_channel.addr_valid)); goto ldv_51662; ldv_51661: msleep((unsigned int )interval); tout = tout + -1; tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("."); } else { } ldv_51662: ; if (tout >= 0 && (unsigned int )*done == 0U) { goto ldv_51661; } else { } if ((unsigned int )*done == 0U) { printk("\v[%s:%d(%s)]PF response has timed out\n", "bnx2x_send_msg2pf", 185, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-11); } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]Got a response from PF\n", "bnx2x_send_msg2pf", 188, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } } static int bnx2x_get_vf_id(struct bnx2x *bp , u32 *vf_id ) { u32 me_reg ; int tout ; int interval ; int tmp ; long tmp___0 ; { tout = 10; interval = 100; ldv_51673: me_reg = readl((void const volatile *)bp->doorbells); if ((me_reg & 256U) != 0U && (me_reg & 8U) == 0U) { goto ldv_51671; } else { } msleep((unsigned int )interval); printk("\v[%s:%d(%s)]Invalid ME register value: 0x%08x\n. Is pf driver up?", "bnx2x_get_vf_id", 206, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", me_reg); tmp = tout; tout = tout - 1; if (tmp > 0) { goto ldv_51673; } else { } ldv_51671: ; if ((me_reg & 256U) == 0U || (me_reg & 8U) != 0U) { printk("\v[%s:%d(%s)]Invalid ME register value: 0x%08x\n", "bnx2x_get_vf_id", 210, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", me_reg); return (-22); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]valid ME register value: 0x%08x\n", "bnx2x_get_vf_id", 214, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", me_reg); } else { } *vf_id = (me_reg & 32256U) >> 9; return (0); } } int bnx2x_vfpf_acquire(struct bnx2x *bp , u8 tx_count , u8 rx_count ) { int rc ; int attempts ; struct vfpf_acquire_tlv *req ; struct pfvf_acquire_resp_tlv *resp ; struct vfpf_port_phys_id_resp_tlv *phys_port_resp ; struct vfpf_fp_hsi_resp_tlv *fp_hsi_resp ; u32 vf_id ; bool resources_acquired ; int tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; u8 _min1 ; u8 _min2 ; u8 _min1___0 ; u8 _min2___0 ; u8 _min1___1 ; u8 _min2___1 ; u8 _min1___2 ; u8 _min2___2 ; u8 _min1___3 ; u8 _min2___3 ; u8 _min1___4 ; u8 _min2___4 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; bool tmp___6 ; { rc = 0; attempts = 0; req = & (bp->vf2pf_mbox)->req.acquire; resp = & (bp->vf2pf_mbox)->resp.acquire_resp; resources_acquired = 0; bnx2x_vfpf_prep(bp, & req->first_tlv, 1, 32); tmp = bnx2x_get_vf_id(bp, & vf_id); if (tmp != 0) { rc = -11; goto out; } else { } req->vfdev_info.vf_id = (u8 )vf_id; req->vfdev_info.vf_os = 0U; req->vfdev_info.fp_hsi_ver = 2U; req->resc_request.num_rxqs = rx_count; req->resc_request.num_txqs = tx_count; req->resc_request.num_sbs = bp->igu_sb_cnt; req->resc_request.num_mac_filters = 1U; req->resc_request.num_mc_filters = 10U; req->bulletin_addr = bp->pf2vf_bulletin_mapping; bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 17, 4); req->vfdev_info.caps = (u8 )((unsigned int )req->vfdev_info.caps | 1U); bnx2x_add_tlv(bp, (void *)req, (int )((unsigned int )req->first_tlv.tl.length + 4U), 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); goto ldv_51708; ldv_51707: tmp___0 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]attempting to acquire resources\n", "bnx2x_vfpf_acquire", 269, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { goto out; } else { } memcpy((void *)(& bp->acquire_resp), (void const *)resp, 120UL); attempts = attempts + 1; if ((unsigned int )bp->acquire_resp.hdr.status == 1U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]resources acquired\n", "bnx2x_vfpf_acquire", 289, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } resources_acquired = 1; } else if ((unsigned int )bp->acquire_resp.hdr.status == 4U && attempts <= 2) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]PF unwilling to fulfill resource request. Try PF recommended amount\n", "bnx2x_vfpf_acquire", 295, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } _min1 = req->resc_request.num_txqs; _min2 = bp->acquire_resp.resc.num_txqs; req->resc_request.num_txqs = (u8 )((int )_min1 < (int )_min2 ? _min1 : _min2); _min1___0 = req->resc_request.num_rxqs; _min2___0 = bp->acquire_resp.resc.num_rxqs; req->resc_request.num_rxqs = (u8 )((int )_min1___0 < (int )_min2___0 ? _min1___0 : _min2___0); _min1___1 = req->resc_request.num_sbs; _min2___1 = bp->acquire_resp.resc.num_sbs; req->resc_request.num_sbs = (u8 )((int )_min1___1 < (int )_min2___1 ? _min1___1 : _min2___1); _min1___2 = req->resc_request.num_mac_filters; _min2___2 = bp->acquire_resp.resc.num_mac_filters; req->resc_request.num_mac_filters = (u8 )((int )_min1___2 < (int )_min2___2 ? _min1___2 : _min2___2); _min1___3 = req->resc_request.num_vlan_filters; _min2___3 = bp->acquire_resp.resc.num_vlan_filters; req->resc_request.num_vlan_filters = (u8 )((int )_min1___3 < (int )_min2___3 ? _min1___3 : _min2___3); _min1___4 = req->resc_request.num_mc_filters; _min2___4 = bp->acquire_resp.resc.num_mc_filters; req->resc_request.num_mc_filters = (u8 )((int )_min1___4 < (int )_min2___4 ? _min1___4 : _min2___4); memset((void *)(& (bp->vf2pf_mbox)->resp), 0, 1024UL); } else { tmp___3 = bnx2x_search_tlv_list(bp, (void *)resp, 19); fp_hsi_resp = (struct vfpf_fp_hsi_resp_tlv *)tmp___3; if ((unsigned long )fp_hsi_resp != (unsigned long )((struct vfpf_fp_hsi_resp_tlv *)0) && (unsigned int )fp_hsi_resp->is_supported == 0U) { printk("\v[%s:%d(%s)]Old hypervisor - doesn\'t support current fastpath HSI version; Need to downgrade VF driver [or upgrade hypervisor]\n", "bnx2x_vfpf_acquire", 325, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { printk("\v[%s:%d(%s)]Failed to get the requested amount of resources: %d. Breaking...\n", "bnx2x_vfpf_acquire", 328, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->acquire_resp.hdr.status); } rc = -11; goto out; } ldv_51708: ; if (! resources_acquired) { goto ldv_51707; } else { } tmp___4 = bnx2x_search_tlv_list(bp, (void *)resp, 17); phys_port_resp = (struct vfpf_port_phys_id_resp_tlv *)tmp___4; if ((unsigned long )phys_port_resp != (unsigned long )((struct vfpf_port_phys_id_resp_tlv *)0)) { memcpy((void *)(& bp->phys_port_id), (void const *)(& phys_port_resp->id), 6UL); bp->flags = bp->flags | 16777216U; } else { } tmp___5 = bnx2x_search_tlv_list(bp, (void *)resp, 19); fp_hsi_resp = (struct vfpf_fp_hsi_resp_tlv *)tmp___5; bp->common.chip_id = bp->common.chip_id | (bp->acquire_resp.pfdev_info.chip_num & 65535U); bp->link_params.chip_id = bp->common.chip_id; bp->db_size = bp->acquire_resp.pfdev_info.db_size; bp->common.int_block = 1U; bp->common.chip_port_mode = 1U; bp->igu_dsb_id = 255U; bp->mf_ov = 0U; bp->mf_mode = 0U; bp->common.flash_size = 0; bp->flags = bp->flags | 57352U; bp->igu_sb_cnt = bp->acquire_resp.resc.num_sbs; bp->igu_base_sb = bp->acquire_resp.resc.hw_sbs[0].hw_sb_id; strlcpy((char *)(& bp->fw_ver), (char const *)(& bp->acquire_resp.pfdev_info.fw_ver), 32UL); tmp___6 = is_valid_ether_addr((u8 const *)(& bp->acquire_resp.resc.current_mac_addr)); if ((int )tmp___6) { memcpy((void *)(bp->dev)->dev_addr, (void const *)(& bp->acquire_resp.resc.current_mac_addr), 6UL); } else { } out: bnx2x_vfpf_finalize(bp, & req->first_tlv); return (rc); } } int bnx2x_vfpf_release(struct bnx2x *bp ) { struct vfpf_release_tlv *req ; struct pfvf_general_resp_tlv *resp ; u32 rc ; u32 vf_id ; int tmp ; int tmp___0 ; long tmp___1 ; { req = & (bp->vf2pf_mbox)->req.release; resp = & (bp->vf2pf_mbox)->resp.general_resp; bnx2x_vfpf_prep(bp, & req->first_tlv, 9, 12); tmp = bnx2x_get_vf_id(bp, & vf_id); if (tmp != 0) { rc = 4294967285U; goto out; } else { } req->vf_id = (u16 )vf_id; bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); tmp___0 = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); rc = (u32 )tmp___0; if (rc != 0U) { goto out; } else { } if ((unsigned int )resp->hdr.status == 1U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]vf released\n", "bnx2x_vfpf_release", 421, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { printk("\v[%s:%d(%s)]PF failed our release request - are we out of sync? Response status: %d\n", "bnx2x_vfpf_release", 425, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )resp->hdr.status); rc = 4294967285U; goto out; } out: bnx2x_vfpf_finalize(bp, & req->first_tlv); return ((int )rc); } } int bnx2x_vfpf_init(struct bnx2x *bp ) { struct vfpf_init_tlv *req ; struct pfvf_general_resp_tlv *resp ; int rc ; int i ; long tmp ; { req = & (bp->vf2pf_mbox)->req.init; resp = & (bp->vf2pf_mbox)->resp.general_resp; bnx2x_vfpf_prep(bp, & req->first_tlv, 2, 168); i = 0; goto ldv_51727; ldv_51726: req->sb_addr[i] = (bp->fp + (unsigned long )i)->status_blk_mapping; i = i + 1; ldv_51727: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_51726; } else { } req->stats_addr = bp->fw_stats_data_mapping + 128ULL; req->stats_stride = 152U; bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { goto out; } else { } if ((unsigned int )resp->hdr.status != 1U) { printk("\v[%s:%d(%s)]INIT VF failed: %d. Breaking...\n", "bnx2x_vfpf_init", 469, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )resp->hdr.status); rc = -11; goto out; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]INIT VF Succeeded\n", "bnx2x_vfpf_init", 474, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } out: bnx2x_vfpf_finalize(bp, & req->first_tlv); return (rc); } } void bnx2x_vfpf_close_vf(struct bnx2x *bp ) { struct vfpf_close_tlv *req ; struct pfvf_general_resp_tlv *resp ; int i ; int rc ; u32 vf_id ; int tmp ; { req = & (bp->vf2pf_mbox)->req.close; resp = & (bp->vf2pf_mbox)->resp.general_resp; tmp = bnx2x_get_vf_id(bp, & vf_id); if (tmp != 0) { goto free_irq; } else { } i = 0; goto ldv_51742; ldv_51741: ; if ((bp->flags & 32768U) != 0U && (uint )i == (uint )bp->num_queues - bp->num_cnic_queues) { } else { bnx2x_vfpf_teardown_queue(bp, i); } i = i + 1; ldv_51742: ; if (bp->num_queues > i) { goto ldv_51741; } else { } bnx2x_vfpf_config_mac(bp, (bp->dev)->dev_addr, (int )(bp->fp)->index, 0); bnx2x_vfpf_prep(bp, & req->first_tlv, 8, 12); req->vf_id = (u16 )vf_id; bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { printk("\v[%s:%d(%s)]Sending CLOSE failed. rc was: %d\n", "bnx2x_vfpf_close_vf", 517, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else if ((unsigned int )resp->hdr.status != 1U) { printk("\v[%s:%d(%s)]Sending CLOSE failed: pf response was %d\n", "bnx2x_vfpf_close_vf", 521, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )resp->hdr.status); } else { } bnx2x_vfpf_finalize(bp, & req->first_tlv); free_irq: bnx2x_netif_stop(bp, 0); bnx2x_del_all_napi___1(bp); bnx2x_free_irq(bp); return; } } static void bnx2x_leading_vfq_init(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q ) { u8 cl_id ; u8 tmp ; u8 func_id ; { tmp = vfq_cl_id(vf, q); cl_id = tmp; func_id = (unsigned int )vf->abs_vfid + 8U; bnx2x_init_mac_obj(bp, & q->mac_obj, (int )cl_id, q->cid, (int )func_id, (bp->vfdb)->sp_dma.addr + (unsigned long )vf->index * 1360UL, (bp->vfdb)->sp_dma.mapping + (unsigned long long )((unsigned long )vf->index * 1360UL), 0, & vf->filter_state, 2, & bp->macs_pool); bnx2x_init_vlan_obj(bp, & q->vlan_obj, (int )cl_id, q->cid, (int )func_id, (bp->vfdb)->sp_dma.addr + ((unsigned long )vf->index * 1360UL + 264UL), ((bp->vfdb)->sp_dma.mapping + (unsigned long long )((unsigned long )vf->index * 1360UL)) + 264ULL, 1, & vf->filter_state, 2, & bp->vlans_pool); bnx2x_init_mcast_obj(bp, & vf->mcast_obj, (int )cl_id, q->cid, (int )func_id, (int )func_id, (bp->vfdb)->sp_dma.addr + ((unsigned long )vf->index * 1360UL + 792UL), ((bp->vfdb)->sp_dma.mapping + (unsigned long long )((unsigned long )vf->index * 1360UL)) + 792ULL, 9, & vf->filter_state, 2); bnx2x_init_rss_config_obj(bp, & vf->rss_conf_obj, (int )cl_id, q->cid, (int )func_id, (int )func_id, (bp->vfdb)->sp_dma.addr + ((unsigned long )vf->index * 1360UL + 1176UL), ((bp->vfdb)->sp_dma.mapping + (unsigned long long )((unsigned long )vf->index * 1360UL)) + 1176ULL, 11, & vf->filter_state, 2); vf->leading_rss = (int )cl_id; q->is_leading = 1; q->sp_initialized = 1; return; } } int bnx2x_vfpf_setup_q(struct bnx2x *bp , struct bnx2x_fastpath *fp , bool is_leading ) { struct vfpf_setup_q_tlv *req ; struct pfvf_general_resp_tlv *resp ; u8 fp_idx ; u16 tpa_agg_size ; u16 flags ; int rc ; u32 __min1 ; u32 __min1___0 ; u32 __min2 ; u32 __min2___0 ; int _max1 ; int _max2 ; int _min1 ; int _min2 ; { req = & (bp->vf2pf_mbox)->req.setup_q; resp = & (bp->vf2pf_mbox)->resp.general_resp; fp_idx = fp->index; tpa_agg_size = 0U; flags = 0U; bnx2x_vfpf_prep(bp, & req->first_tlv, 3, 96); if ((unsigned int )fp->mode != 0U) { flags = (u16 )((unsigned int )flags | 1U); flags = (u16 )((unsigned int )flags | 2U); if ((unsigned int )fp->mode == 2U) { flags = (u16 )((unsigned int )flags | 4U); } else { } __min1___0 = 8U; __min2 = 17U; __min1 = (__min1___0 < __min2 ? __min1___0 : __min2) * 4096U; __min2___0 = 65535U; tpa_agg_size = (u16 )(__min1 < __min2___0 ? __min1 : __min2___0); } else { } if ((int )is_leading) { flags = (u16 )((unsigned int )flags | 1024U); } else { } flags = (u16 )((unsigned int )flags | 16U); flags = (u16 )((unsigned int )flags | 8U); flags = (u16 )((unsigned int )flags | 64U); req->vf_qid = fp_idx; req->param_valid = 3U; req->rxq.rcq_addr = fp->rx_comp_mapping; req->rxq.rcq_np_addr = fp->rx_comp_mapping + 4096ULL; req->rxq.rxq_addr = fp->rx_desc_mapping; req->rxq.sge_addr = fp->rx_sge_mapping; req->rxq.vf_sb = fp_idx; req->rxq.sb_index = 1U; req->rxq.hc_rate = (unsigned int )bp->rx_ticks != 0U ? (u16 )(1000000 / (int )bp->rx_ticks) : 0U; req->rxq.mtu = (u16 )(bp->dev)->mtu; req->rxq.buf_sz = (u16 )fp->rx_buf_size; req->rxq.sge_buf_sz = 4096U; req->rxq.tpa_agg_sz = tpa_agg_size; req->rxq.max_sge_pkt = (u8 )(((bp->dev)->mtu + 4095U) >> 12); req->rxq.max_sge_pkt = req->rxq.max_sge_pkt; req->rxq.flags = flags; req->rxq.drop_flags = 0U; _max1 = 6; _min1 = 8; _min2 = 6; _max2 = _min1 < _min2 ? _min1 : _min2; req->rxq.cache_line_log = (u8 )(_max1 > _max2 ? _max1 : _max2); req->rxq.stat_id = 65535U; req->txq.txq_addr = (fp->txdata_ptr[0])->tx_desc_mapping; req->txq.vf_sb = fp_idx; req->txq.sb_index = 5U; req->txq.hc_rate = (unsigned int )bp->tx_ticks != 0U ? (u16 )(1000000 / (int )bp->tx_ticks) : 0U; req->txq.flags = (u32 )flags; req->txq.traffic_type = 0U; bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { printk("\v[%s:%d(%s)]Sending SETUP_Q message for queue[%d] failed!\n", "bnx2x_vfpf_setup_q", 655, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp_idx); } else { } if ((unsigned int )resp->hdr.status != 1U) { printk("\v[%s:%d(%s)]Status of SETUP_Q for queue[%d] is %d\n", "bnx2x_vfpf_setup_q", 659, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )fp_idx, (int )resp->hdr.status); rc = -22; } else { } bnx2x_vfpf_finalize(bp, & req->first_tlv); return (rc); } } static int bnx2x_vfpf_teardown_queue(struct bnx2x *bp , int qidx ) { struct vfpf_q_op_tlv *req ; struct pfvf_general_resp_tlv *resp ; int rc ; { req = & (bp->vf2pf_mbox)->req.q_op; resp = & (bp->vf2pf_mbox)->resp.general_resp; bnx2x_vfpf_prep(bp, & req->first_tlv, 7, 12); req->vf_qid = (u8 )qidx; bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { printk("\v[%s:%d(%s)]Sending TEARDOWN for queue %d failed: %d\n", "bnx2x_vfpf_teardown_queue", 691, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", qidx, rc); goto out; } else { } if ((unsigned int )resp->hdr.status != 1U) { printk("\v[%s:%d(%s)]TEARDOWN for queue %d failed: %d\n", "bnx2x_vfpf_teardown_queue", 698, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", qidx, (int )resp->hdr.status); rc = -22; } else { } out: bnx2x_vfpf_finalize(bp, & req->first_tlv); return (rc); } } int bnx2x_vfpf_config_mac(struct bnx2x *bp , u8 *addr , u8 vf_qid , bool set ) { struct vfpf_set_q_filters_tlv *req ; struct pfvf_general_resp_tlv *resp ; struct pf_vf_bulletin_content bulletin ; int rc ; long tmp ; enum sample_bulletin_result tmp___0 ; { req = & (bp->vf2pf_mbox)->req.set_q_filters; resp = & (bp->vf2pf_mbox)->resp.general_resp; bulletin = (bp->pf2vf_bulletin)->content; rc = 0; bnx2x_vfpf_prep(bp, & req->first_tlv, 4, 596); req->flags = 1U; req->vf_qid = vf_qid; req->n_mac_vlan_filters = 1U; req->filters[0].flags = 1U; if ((int )set) { req->filters[0].flags = req->filters[0].flags | 256U; } else { } bnx2x_sample_bulletin(bp); memcpy((void *)(& req->filters[0].mac), (void const *)addr, 6UL); bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { printk("\v[%s:%d(%s)]failed to send message to pf. rc was %d\n", "bnx2x_vfpf_config_mac", 744, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); goto out; } else { } goto ldv_51802; ldv_51801: tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vfpf SET MAC failed. Check bulletin board for new posts\n", "bnx2x_vfpf_config_mac", 751, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } memcpy((void *)(bp->dev)->dev_addr, (void const *)(& bulletin.mac), 6UL); tmp___0 = bnx2x_sample_bulletin(bp); if ((unsigned int )tmp___0 == 1U) { memcpy((void *)(& req->filters[0].mac), (void const *)(bp->dev)->dev_addr, 6UL); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); } else { goto ldv_51800; } ldv_51802: ; if ((unsigned int )resp->hdr.status == 2U) { goto ldv_51801; } else { } ldv_51800: ; if ((unsigned int )resp->hdr.status != 1U) { printk("\v[%s:%d(%s)]vfpf SET MAC failed: %d\n", "bnx2x_vfpf_config_mac", 772, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )resp->hdr.status); rc = -22; } else { } out: bnx2x_vfpf_finalize(bp, & req->first_tlv); return (rc); } } int bnx2x_vfpf_config_rss(struct bnx2x *bp , struct bnx2x_config_rss_params *params ) { struct pfvf_general_resp_tlv *resp ; struct vfpf_rss_tlv *req ; int rc ; long tmp ; long tmp___0 ; { resp = & (bp->vf2pf_mbox)->resp.general_resp; req = & (bp->vf2pf_mbox)->req.update_rss; rc = 0; bnx2x_vfpf_prep(bp, & req->first_tlv, 16, 184); bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); memcpy((void *)(& req->ind_table), (void const *)(& params->ind_table), 128UL); memcpy((void *)(& req->rss_key), (void const *)(& params->rss_key), 40UL); req->ind_table_size = 128U; req->rss_key_size = 10U; req->rss_result_mask = params->rss_result_mask; if ((int )params->rss_flags & 1) { req->rss_flags = req->rss_flags | 1U; } else { } if ((params->rss_flags & 2UL) != 0UL) { req->rss_flags = req->rss_flags | 2U; } else { } if ((params->rss_flags & 4UL) != 0UL) { req->rss_flags = req->rss_flags | 4U; } else { } if ((params->rss_flags & 8UL) != 0UL) { req->rss_flags = req->rss_flags | 8U; } else { } if ((params->rss_flags & 16UL) != 0UL) { req->rss_flags = req->rss_flags | 16U; } else { } if ((params->rss_flags & 32UL) != 0UL) { req->rss_flags = req->rss_flags | 32U; } else { } if ((params->rss_flags & 64UL) != 0UL) { req->rss_flags = req->rss_flags | 64U; } else { } if ((params->rss_flags & 128UL) != 0UL) { req->rss_flags = req->rss_flags | 128U; } else { } if ((params->rss_flags & 256UL) != 0UL) { req->rss_flags = req->rss_flags | 256U; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]rss flags %x\n", "bnx2x_vfpf_config_rss", 823, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", req->rss_flags); } else { } bnx2x_dp_tlv_list(bp, (void *)req); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { printk("\v[%s:%d(%s)]failed to send message to pf. rc was %d\n", "bnx2x_vfpf_config_rss", 831, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); goto out; } else { } if ((unsigned int )resp->hdr.status != 1U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]Failed to send rss message to PF over VF-PF channel [%d]\n", "bnx2x_vfpf_config_rss", 842, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )resp->hdr.status); } else { } } else { } out: bnx2x_vfpf_finalize(bp, & req->first_tlv); return (rc); } } int bnx2x_vfpf_set_mcast(struct net_device *dev ) { struct bnx2x *bp ; void *tmp ; struct vfpf_set_q_filters_tlv *req ; struct pfvf_general_resp_tlv *resp ; int rc ; int i ; struct netdev_hw_addr *ha ; long tmp___0 ; long tmp___1 ; struct list_head const *__mptr ; long tmp___2 ; struct list_head const *__mptr___0 ; long tmp___3 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; req = & (bp->vf2pf_mbox)->req.set_q_filters; resp = & (bp->vf2pf_mbox)->resp.general_resp; i = 0; if ((unsigned int )bp->state != 12288U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]state is %x, returning\n", "bnx2x_vfpf_set_mcast", 859, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->state); } else { } return (-22); } else { } bnx2x_vfpf_prep(bp, & req->first_tlv, 4, 596); tmp___1 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]dev->flags = %x\n", "bnx2x_vfpf_set_mcast", 868, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", dev->flags); } else { } __mptr = (struct list_head const *)dev->mc.list.next; ha = (struct netdev_hw_addr *)__mptr; goto ldv_51827; ldv_51826: tmp___2 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]Adding mcast MAC: %pM\n", "bnx2x_vfpf_set_mcast", 872, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned char *)(& ha->addr)); } else { } memcpy((void *)(& req->multicast) + (unsigned long )i, (void const *)(& ha->addr), 6UL); i = i + 1; __mptr___0 = (struct list_head const *)ha->list.next; ha = (struct netdev_hw_addr *)__mptr___0; ldv_51827: ; if ((unsigned long )(& ha->list) != (unsigned long )(& dev->mc.list)) { goto ldv_51826; } else { } if (i > 31) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp___3 != 0L) { printk("\r[%s:%d(%s)]VF supports not more than %d multicast MAC addresses\n", "bnx2x_vfpf_set_mcast", 883, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", 32); } else { } return (-22); } else { } req->n_multicast = (u8 )i; req->flags = req->flags | 2U; req->vf_qid = 0U; bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { printk("\v[%s:%d(%s)]Sending a message failed: %d\n", "bnx2x_vfpf_set_mcast", 899, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); goto out; } else { } if ((unsigned int )resp->hdr.status != 1U) { printk("\v[%s:%d(%s)]Set Rx mode/multicast failed: %d\n", "bnx2x_vfpf_set_mcast", 905, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )resp->hdr.status); rc = -22; } else { } out: bnx2x_vfpf_finalize(bp, & req->first_tlv); return (0); } } int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp ) { int mode ; struct vfpf_set_q_filters_tlv *req ; struct pfvf_general_resp_tlv *resp ; int rc ; long tmp ; { mode = (int )bp->rx_mode; req = & (bp->vf2pf_mbox)->req.set_q_filters; resp = & (bp->vf2pf_mbox)->resp.general_resp; bnx2x_vfpf_prep(bp, & req->first_tlv, 4, 596); tmp = ldv__builtin_expect((bp->msg_enable & 32) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]Rx mode is %d\n", "bnx2x_vfpf_storm_rx_mode", 925, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", mode); } else { } if (mode == 0) { req->rx_mask = 0U; } else { req->rx_mask = 2U; req->rx_mask = req->rx_mask | 1U; req->rx_mask = req->rx_mask | 16U; } req->flags = req->flags | 4U; req->vf_qid = 0U; bnx2x_add_tlv(bp, (void *)req, (int )req->first_tlv.tl.length, 12, 8); bnx2x_dp_tlv_list(bp, (void *)req); rc = bnx2x_send_msg2pf(bp, & resp->hdr.status, bp->vf2pf_mbox_mapping); if (rc != 0) { printk("\v[%s:%d(%s)]Sending a message failed: %d\n", "bnx2x_vfpf_storm_rx_mode", 951, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } if ((unsigned int )resp->hdr.status != 1U) { printk("\v[%s:%d(%s)]Set Rx mode failed: %d\n", "bnx2x_vfpf_storm_rx_mode", 954, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )resp->hdr.status); rc = -22; } else { } bnx2x_vfpf_finalize(bp, & req->first_tlv); return (rc); } } static void storm_memset_vf_mbx_ack(struct bnx2x *bp , u16 abs_fid ) { u32 addr ; { addr = ((unsigned int )(bp->iro_arr + 159UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 159UL)->m1)) + 4259840U; writeb(0, (void volatile *)bp->regview + (unsigned long )addr); return; } } static void storm_memset_vf_mbx_valid(struct bnx2x *bp , u16 abs_fid ) { u32 addr ; { addr = ((unsigned int )(bp->iro_arr + 160UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 160UL)->m1)) + 4259840U; writeb(1, (void volatile *)bp->regview + (unsigned long )addr); return; } } void bnx2x_vf_enable_mbx(struct bnx2x *bp , u8 abs_vfid ) { { bnx2x_vf_flr_clnup_epilog(bp, (int )abs_vfid); storm_memset_vf_mbx_ack(bp, (int )abs_vfid); storm_memset_vf_mbx_valid(bp, (int )abs_vfid); bnx2x_vf_enable_access(bp, (int )abs_vfid); return; } } static int bnx2x_copy32_vf_dmae(struct bnx2x *bp , u8 from_vf , dma_addr_t pf_addr , u8 vfid , u32 vf_addr_hi , u32 vf_addr_lo , u32 len32 ) { struct dmae_command dmae ; int tmp ; { if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { printk("\v[%s:%d(%s)]Chip revision does not support VFs\n", "bnx2x_copy32_vf_dmae", 1001, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-3); } else { } if (bp->dmae_ready == 0) { printk("\v[%s:%d(%s)]DMAE is not ready, can not copy\n", "bnx2x_copy32_vf_dmae", 1006, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-3); } else { } bnx2x_prep_dmae_with_comp(bp, & dmae, 0, 1); if ((unsigned int )from_vf != 0U) { dmae.opcode_iov = (unsigned int )((u16 )vfid) | 64U; dmae.opcode = dmae.opcode | 524288U; dmae.src_addr_lo = vf_addr_lo; dmae.src_addr_hi = vf_addr_hi; dmae.dst_addr_lo = (unsigned int )pf_addr; dmae.dst_addr_hi = (unsigned int )(pf_addr >> 32); } else { dmae.opcode_iov = (u16 )((int )((short )((int )vfid << 8)) | 16384); dmae.opcode = dmae.opcode; dmae.src_addr_lo = (unsigned int )pf_addr; dmae.src_addr_hi = (unsigned int )(pf_addr >> 32); dmae.dst_addr_lo = vf_addr_lo; dmae.dst_addr_hi = vf_addr_hi; } dmae.len = (u16 )len32; tmp = bnx2x_issue_dmae_with_comp(bp, & dmae, & (bp->slowpath)->wb_comp); return (tmp); } } static void bnx2x_vf_mbx_resp_single_tlv(struct bnx2x *bp , struct bnx2x_virtf *vf ) { struct bnx2x_vf_mbx *mbx ; u16 length ; u16 type ; { mbx = (struct bnx2x_vf_mbx *)(& (bp->vfdb)->mbxs) + (unsigned long )vf->index; type = mbx->first_tlv.tl.type; length = (unsigned int )type == 1U ? 120U : 8U; bnx2x_add_tlv(bp, (void *)(& (mbx->msg)->resp), 0, (int )type, (int )length); bnx2x_add_tlv(bp, (void *)(& (mbx->msg)->resp), (int )length, 12, 8); return; } } static void bnx2x_vf_mbx_resp_send_msg(struct bnx2x *bp , struct bnx2x_virtf *vf , int vf_rc ) { struct bnx2x_vf_mbx *mbx ; struct pfvf_general_resp_tlv *resp ; dma_addr_t pf_addr ; u64 vf_addr ; int rc ; long tmp ; int tmp___0 ; { mbx = (struct bnx2x_vf_mbx *)(& (bp->vfdb)->mbxs) + (unsigned long )vf->index; resp = & (mbx->msg)->resp.general_resp; bnx2x_dp_tlv_list(bp, (void *)resp); tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]mailbox vf address hi 0x%x, lo 0x%x, offset 0x%x\n", "bnx2x_vf_mbx_resp_send_msg", 1070, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", mbx->vf_addr_hi, mbx->vf_addr_lo, mbx->first_tlv.resp_msg_offset); } else { } tmp___0 = bnx2x_pfvf_status_codes(vf_rc); resp->hdr.status = (u8 )tmp___0; vf_addr = (((unsigned long long )mbx->vf_addr_hi << 32) + (unsigned long long )mbx->vf_addr_lo) + (unsigned long long )mbx->first_tlv.resp_msg_offset; pf_addr = mbx->msg_mapping + 1024ULL; vf_addr = vf_addr + 8ULL; pf_addr = pf_addr + 8ULL; rc = bnx2x_copy32_vf_dmae(bp, 0, pf_addr, (int )vf->abs_vfid, (unsigned int )(vf_addr >> 32), (unsigned int )vf_addr, 254U); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to copy response body to VF %d\n", "bnx2x_vf_mbx_resp_send_msg", 1091, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); goto mbx_error; } else { } vf_addr = vf_addr - 8ULL; pf_addr = pf_addr - 8ULL; storm_memset_vf_mbx_ack(bp, (int )vf->abs_vfid); __asm__ volatile ("": : : "memory"); rc = bnx2x_copy32_vf_dmae(bp, 0, pf_addr, (int )vf->abs_vfid, (unsigned int )(vf_addr >> 32), (unsigned int )vf_addr, 2U); bnx2x_unlock_vf_pf_channel(bp, vf, (enum channel_tlvs )mbx->first_tlv.tl.type); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to copy response status to VF %d\n", "bnx2x_vf_mbx_resp_send_msg", 1114, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); goto mbx_error; } else { } return; mbx_error: bnx2x_vf_release(bp, vf); return; } } static void bnx2x_vf_mbx_resp(struct bnx2x *bp , struct bnx2x_virtf *vf , int rc ) { { bnx2x_vf_mbx_resp_single_tlv(bp, vf); bnx2x_vf_mbx_resp_send_msg(bp, vf, rc); return; } } static void bnx2x_vf_mbx_resp_phys_port(struct bnx2x *bp , struct bnx2x_virtf *vf , void *buffer , u16 *offset ) { struct vfpf_port_phys_id_resp_tlv *port_id ; { if ((bp->flags & 16777216U) == 0U) { return; } else { } bnx2x_add_tlv(bp, buffer, (int )*offset, 17, 12); port_id = (struct vfpf_port_phys_id_resp_tlv *)buffer + (unsigned long )*offset; memcpy((void *)(& port_id->id), (void const *)(& bp->phys_port_id), 6UL); *offset = (unsigned int )*offset + 12U; return; } } static void bnx2x_vf_mbx_resp_fp_hsi_ver(struct bnx2x *bp , struct bnx2x_virtf *vf , void *buffer , u16 *offset ) { struct vfpf_fp_hsi_resp_tlv *fp_hsi ; { bnx2x_add_tlv(bp, buffer, (int )*offset, 19, 8); fp_hsi = (struct vfpf_fp_hsi_resp_tlv *)buffer + (unsigned long )*offset; fp_hsi->is_supported = (unsigned int )vf->fp_hsi <= 2U; *offset = (unsigned int )*offset + 8U; return; } } static void bnx2x_vf_mbx_acquire_resp(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx , int vfop_status ) { int i ; struct pfvf_acquire_resp_tlv *resp ; struct pf_vf_resc *resc ; u8 status ; int tmp ; u16 length ; u8 tmp___0 ; u8 tmp___1 ; struct pf_vf_bulletin_content *bulletin ; struct bnx2x_vf_queue *tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; void *tmp___9 ; { resp = & (mbx->msg)->resp.acquire_resp; resc = & resp->resc; tmp = bnx2x_pfvf_status_codes(vfop_status); status = (u8 )tmp; memset((void *)resp, 0, 120UL); resp->pfdev_info.chip_num = bp->common.chip_id; resp->pfdev_info.db_size = bp->db_size; resp->pfdev_info.indices_per_sb = 8U; resp->pfdev_info.pf_cap = 13U; bnx2x_fill_fw_str(bp, (char *)(& resp->pfdev_info.fw_ver), 32UL); if ((unsigned int )status == 4U || (unsigned int )status == 1U) { if ((int )vf->alloc_resc.num_rxqs != 0) { resc->num_rxqs = (u8 )((int )vf->alloc_resc.num_rxqs); } else { tmp___0 = bnx2x_vf_max_queue_cnt(bp, vf); resc->num_rxqs = tmp___0; } if ((int )vf->alloc_resc.num_txqs != 0) { resc->num_txqs = (u8 )((int )vf->alloc_resc.num_txqs); } else { tmp___1 = bnx2x_vf_max_queue_cnt(bp, vf); resc->num_txqs = tmp___1; } resc->num_sbs = vf->alloc_resc.num_sbs; resc->num_mac_filters = vf->alloc_resc.num_mac_filters; resc->num_vlan_filters = (unsigned int )vf->alloc_resc.num_vlan_filters + 255U; resc->num_mc_filters = 0U; if ((unsigned int )status == 1U) { bulletin = (struct pf_vf_bulletin_content *)(bp->vfdb)->bulletin_dma.addr + (unsigned long )vf->index; i = 0; goto ldv_51914; ldv_51913: tmp___2 = vfq_get(vf, (int )((u8 )i)); resc->hw_qid[i] = vfq_qzone_id(vf, tmp___2); i = i + 1; ldv_51914: ; if ((int )vf->alloc_resc.num_rxqs > i) { goto ldv_51913; } else { } i = 0; goto ldv_51917; ldv_51916: resc->hw_sbs[i].hw_sb_id = vf_igu_sb(vf, (int )((u16 )i)); resc->hw_sbs[i].sb_qid = vf_hc_qzone(vf, (int )((u16 )i)); i = i + 1; ldv_51917: ; if ((int )vf->alloc_resc.num_sbs > i) { goto ldv_51916; } else { } if ((int )bulletin->valid_bitmap & 1) { memcpy((void *)(& resc->current_mac_addr), (void const *)(& bulletin->mac), 6UL); } else { } } else { } } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___3 != 0L) { printk("\r[%s:%d(%s)]VF[%d] ACQUIRE_RESPONSE: pfdev_info- chip_num=0x%x, db_size=%d, idx_per_sb=%d, pf_cap=0x%x\nresources- n_rxq-%d, n_txq-%d, n_sbs-%d, n_macs-%d, n_vlans-%d, n_mcs-%d, fw_ver: \'%s\'\n", "bnx2x_vf_mbx_acquire_resp", 1244, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, resp->pfdev_info.chip_num, (int )resp->pfdev_info.db_size, (int )resp->pfdev_info.indices_per_sb, resp->pfdev_info.pf_cap, (int )resc->num_rxqs, (int )resc->num_txqs, (int )resc->num_sbs, (int )resc->num_mac_filters, (int )resc->num_vlan_filters, (int )resc->num_mc_filters, (char *)(& resp->pfdev_info.fw_ver)); } else { } tmp___4 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___4 != 0L) { printk("hw_qids- [ "); } else { } i = 0; goto ldv_51921; ldv_51920: tmp___5 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___5 != 0L) { printk("%d ", (int )resc->hw_qid[i]); } else { } i = i + 1; ldv_51921: ; if ((int )vf->alloc_resc.num_rxqs > i) { goto ldv_51920; } else { } tmp___6 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___6 != 0L) { printk("], sb_info- [ "); } else { } i = 0; goto ldv_51924; ldv_51923: tmp___7 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___7 != 0L) { printk("%d:%d ", (int )resc->hw_sbs[i].hw_sb_id, (int )resc->hw_sbs[i].sb_qid); } else { } i = i + 1; ldv_51924: ; if ((int )vf->alloc_resc.num_sbs > i) { goto ldv_51923; } else { } tmp___8 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___8 != 0L) { printk("]\n"); } else { } length = 120U; bnx2x_add_tlv(bp, (void *)(& (mbx->msg)->resp), 0, 1, (int )length); tmp___9 = bnx2x_search_tlv_list(bp, (void *)(& (mbx->msg)->req), 17); if ((unsigned long )tmp___9 != (unsigned long )((void *)0)) { bnx2x_vf_mbx_resp_phys_port(bp, vf, (void *)(& (mbx->msg)->resp), & length); } else { } bnx2x_vf_mbx_resp_fp_hsi_ver(bp, vf, (void *)(& (mbx->msg)->resp), & length); bnx2x_add_tlv(bp, (void *)(& (mbx->msg)->resp), (int )length, 12, 8); bnx2x_vf_mbx_resp_send_msg(bp, vf, vfop_status); return; } } static bool bnx2x_vf_mbx_is_windows_vm(struct bnx2x *bp , struct vfpf_acquire_tlv *acquire ) { { if ((acquire->bulletin_addr == 0ULL || (unsigned int )acquire->resc_request.num_mc_filters == 32U) || ((int )acquire->vfdev_info.vf_os & 224) == 32) { return (1); } else { } return (0); } } static int bnx2x_vf_mbx_acquire_chk_dorq(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { void *tmp ; bool tmp___0 ; { tmp = bnx2x_search_tlv_list(bp, (void *)(& (mbx->msg)->req), 17); if ((unsigned long )tmp != (unsigned long )((void *)0)) { return (0); } else { } tmp___0 = bnx2x_vf_mbx_is_windows_vm(bp, & (mbx->msg)->req.acquire); if ((int )tmp___0) { return (0); } else { } return (-95); } } static void bnx2x_vf_mbx_acquire(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { int rc ; struct vfpf_acquire_tlv *acquire ; long tmp ; long tmp___0 ; u8 __max1 ; u8 __max2 ; bool tmp___1 ; long tmp___2 ; long tmp___3 ; { acquire = & (mbx->msg)->req.acquire; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] ACQUIRE: vfdev_info- vf_id %d, vf_os %d resources- n_rxq-%d, n_txq-%d, n_sbs-%d, n_macs-%d, n_vlans-%d, n_mcs-%d\n", "bnx2x_vf_mbx_acquire", 1329, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )acquire->vfdev_info.vf_id, (int )acquire->vfdev_info.vf_os, (int )acquire->resc_request.num_rxqs, (int )acquire->resc_request.num_txqs, (int )acquire->resc_request.num_sbs, (int )acquire->resc_request.num_mac_filters, (int )acquire->resc_request.num_vlan_filters, (int )acquire->resc_request.num_mc_filters); } else { } rc = bnx2x_vf_mbx_acquire_chk_dorq(bp, vf, mbx); if (rc != 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]VF [%d] - Can\'t support acquire request due to doorbell mismatch. Please update VM driver\n", "bnx2x_vf_mbx_acquire", 1339, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } goto out; } else { } tmp___1 = bnx2x_vf_mbx_is_windows_vm(bp, & (mbx->msg)->req.acquire); if ((int )tmp___1) { vf->fp_hsi = acquire->vfdev_info.fp_hsi_ver; } else { __max1 = acquire->vfdev_info.fp_hsi_ver; __max2 = 2U; vf->fp_hsi = (u8 )((int )__max1 > (int )__max2 ? __max1 : __max2); } if ((unsigned int )vf->fp_hsi > 2U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]VF [%d] - Can\'t support acquire request since VF requests a FW version which is too new [%02x > %02x]\n", "bnx2x_vf_mbx_acquire", 1355, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )acquire->vfdev_info.fp_hsi_ver, 2); } else { } rc = -22; goto out; } else { } rc = bnx2x_vf_acquire(bp, vf, & acquire->resc_request); vf->bulletin_map = acquire->bulletin_addr; if ((int )acquire->vfdev_info.caps & 1) { tmp___3 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___3 != 0L) { printk("\r[%s:%d(%s)]VF[%d] supports long bulletin boards\n", "bnx2x_vf_mbx_acquire", 1367, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } vf->cfg_flags = (u16 )((unsigned int )vf->cfg_flags | 128U); } else { vf->cfg_flags = (unsigned int )vf->cfg_flags & 65407U; } out: bnx2x_vf_mbx_acquire_resp(bp, vf, mbx, rc); return; } } static void bnx2x_vf_mbx_init_vf(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { struct vfpf_init_tlv *init ; int rc ; { init = & (mbx->msg)->req.init; vf->spq_map = init->spq_addr; vf->fw_stat_map = init->stats_addr; vf->stats_stride = init->stats_stride; rc = bnx2x_vf_init(bp, vf, (dma_addr_t *)(& init->sb_addr)); if ((int )init->flags & 1) { vf->cfg_flags = (u16 )((unsigned int )vf->cfg_flags | 64U); } else { } if (((int )vf->cfg_flags & 128) != 0) { bnx2x_iov_link_update_vf(bp, (int )vf->index); } else { } bnx2x_vf_mbx_resp(bp, vf, rc); return; } } static void bnx2x_vf_mbx_set_q_flags(struct bnx2x *bp , u32 mbx_q_flags , unsigned long *sp_q_flags ) { { if ((int )mbx_q_flags & 1) { __set_bit(0L, (unsigned long volatile *)sp_q_flags); } else { } if ((mbx_q_flags & 2U) != 0U) { __set_bit(1L, (unsigned long volatile *)sp_q_flags); } else { } if ((mbx_q_flags & 4U) != 0U) { __set_bit(2L, (unsigned long volatile *)sp_q_flags); } else { } if ((mbx_q_flags & 16U) != 0U) { __set_bit(3L, (unsigned long volatile *)sp_q_flags); } else { } if ((mbx_q_flags & 64U) != 0U) { __set_bit(7L, (unsigned long volatile *)sp_q_flags); } else { } if ((mbx_q_flags & 128U) != 0U) { __set_bit(8L, (unsigned long volatile *)sp_q_flags); } else { } if ((mbx_q_flags & 256U) != 0U) { __set_bit(9L, (unsigned long volatile *)sp_q_flags); } else { } if ((mbx_q_flags & 512U) != 0U) { __set_bit(11L, (unsigned long volatile *)sp_q_flags); } else { } if ((mbx_q_flags & 1024U) != 0U) { __set_bit(13L, (unsigned long volatile *)sp_q_flags); } else { } if ((unsigned int )bp->mf_mode == 1U) { __set_bit(6L, (unsigned long volatile *)sp_q_flags); } else { } return; } } static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { struct vfpf_setup_q_tlv *setup_q ; struct bnx2x_vf_queue_construct_params qctor ; int rc ; struct bnx2x_vf_queue *q ; struct bnx2x_vf_queue *tmp ; unsigned long q_type ; struct bnx2x_queue_init_params *init_p ; struct bnx2x_queue_setup_params *setup_p ; struct bnx2x_txq_setup_params *txq_params ; struct bnx2x_rxq_setup_params *rxq_params ; u8 mcast_id ; { setup_q = & (mbx->msg)->req.setup_q; rc = 0; if ((int )setup_q->vf_qid >= (int )vf->alloc_resc.num_rxqs) { printk("\v[%s:%d(%s)]vf_qid %d invalid, max queue count is %d\n", "bnx2x_vf_mbx_setup_q", 1440, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )setup_q->vf_qid, (int )vf->alloc_resc.num_rxqs); rc = -22; goto response; } else { } if (((int )setup_q->param_valid & 3) != 0) { tmp = vfq_get(vf, (int )setup_q->vf_qid); q = tmp; q_type = 0UL; if ((unsigned int )q->index == 0U) { bnx2x_leading_vfq_init(bp, vf, q); } else { } memset((void *)(& qctor), 0, 248UL); setup_p = & qctor.prep_qsetup; init_p = & qctor.qstate.params.init; __set_bit(5L, (unsigned long volatile *)(& setup_p->flags)); if (((int )setup_q->param_valid & 2) != 0) { txq_params = & setup_p->txq_params; __set_bit(1L, (unsigned long volatile *)(& q_type)); q->sb_idx = (u16 )setup_q->txq.vf_sb; init_p->tx.hc_rate = setup_q->txq.hc_rate; init_p->tx.sb_cq_index = setup_q->txq.sb_index; bnx2x_vf_mbx_set_q_flags(bp, setup_q->txq.flags, & init_p->tx.flags); bnx2x_vf_mbx_set_q_flags(bp, setup_q->txq.flags, & setup_p->flags); txq_params->dscr_map = setup_q->txq.txq_addr; txq_params->sb_cq_index = setup_q->txq.sb_index; txq_params->traffic_type = (u16 )setup_q->txq.traffic_type; bnx2x_vfop_qctor_dump_tx(bp, vf, init_p, setup_p, (int )q->index, (int )q->sb_idx); } else { } if ((int )setup_q->param_valid & 1) { rxq_params = & setup_p->rxq_params; __set_bit(0L, (unsigned long volatile *)(& q_type)); q->sb_idx = (u16 )setup_q->rxq.vf_sb; init_p->rx.hc_rate = setup_q->rxq.hc_rate; init_p->rx.sb_cq_index = setup_q->rxq.sb_index; bnx2x_vf_mbx_set_q_flags(bp, (u32 )setup_q->rxq.flags, & init_p->rx.flags); bnx2x_vf_mbx_set_q_flags(bp, (u32 )setup_q->rxq.flags, & setup_p->flags); setup_p->gen_params.mtu = setup_q->rxq.mtu; rxq_params->drop_flags = (u16 )setup_q->rxq.drop_flags; rxq_params->dscr_map = setup_q->rxq.rxq_addr; rxq_params->sge_map = setup_q->rxq.sge_addr; rxq_params->rcq_map = setup_q->rxq.rcq_addr; rxq_params->rcq_np_map = setup_q->rxq.rcq_np_addr; rxq_params->buf_sz = setup_q->rxq.buf_sz; rxq_params->tpa_agg_sz = setup_q->rxq.tpa_agg_sz; rxq_params->max_sges_pkt = setup_q->rxq.max_sge_pkt; rxq_params->sge_buf_sz = setup_q->rxq.sge_buf_sz; rxq_params->cache_line_log = setup_q->rxq.cache_line_log; rxq_params->sb_cq_index = setup_q->rxq.sb_index; if ((unsigned int )q->index == 0U) { mcast_id = (unsigned int )vf->abs_vfid + 8U; rxq_params->mcast_engine_id = mcast_id; __set_bit(14L, (unsigned long volatile *)(& setup_p->flags)); } else { } bnx2x_vfop_qctor_dump_rx(bp, vf, init_p, setup_p, (int )q->index, (int )q->sb_idx); } else { } bnx2x_vfop_qctor_prep(bp, vf, q, & qctor, q_type); rc = bnx2x_vf_queue_setup(bp, vf, (int )q->index, & qctor); if (rc != 0) { goto response; } else { } } else { } response: bnx2x_vf_mbx_resp(bp, vf, rc); return; } } static int bnx2x_vf_mbx_macvlan_list(struct bnx2x *bp , struct bnx2x_virtf *vf , struct vfpf_set_q_filters_tlv *tlv , struct bnx2x_vf_mac_vlan_filters **pfl , u32 type_flag ) { int i ; int j ; struct bnx2x_vf_mac_vlan_filters *fl ; size_t fsz ; void *tmp ; struct vfpf_q_mac_vlan_filter *msg_filter ; { fl = (struct bnx2x_vf_mac_vlan_filters *)0; fsz = (unsigned long )tlv->n_mac_vlan_filters * 24UL + 8UL; tmp = kzalloc(fsz, 208U); fl = (struct bnx2x_vf_mac_vlan_filters *)tmp; if ((unsigned long )fl == (unsigned long )((struct bnx2x_vf_mac_vlan_filters *)0)) { return (-12); } else { } i = 0; j = 0; goto ldv_51990; ldv_51989: msg_filter = (struct vfpf_q_mac_vlan_filter *)(& tlv->filters) + (unsigned long )i; if ((msg_filter->flags & type_flag) != type_flag) { goto ldv_51988; } else { } if (type_flag == 1U) { fl->filters[j].mac = (u8 *)(& msg_filter->mac); fl->filters[j].type = 1; } else { fl->filters[j].vid = msg_filter->vlan_tag; fl->filters[j].type = 2; } fl->filters[j].add = (msg_filter->flags & 256U) != 0U; fl->count = fl->count + 1; ldv_51988: i = i + 1; ldv_51990: ; if ((int )tlv->n_mac_vlan_filters > i) { goto ldv_51989; } else { } if (fl->count == 0) { kfree((void const *)fl); } else { *pfl = fl; } return (0); } } static void bnx2x_vf_mbx_dp_q_filter(struct bnx2x *bp , int msglvl , int idx , struct vfpf_q_mac_vlan_filter *filter ) { long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { tmp = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]MAC-VLAN[%d] -- flags=0x%x\n", "bnx2x_vf_mbx_dp_q_filter", 1604, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", idx, filter->flags); } else { } if ((filter->flags & 2U) != 0U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___0 != 0L) { printk(", vlan=%d", (int )filter->vlan_tag); } else { } } else { } if ((int )filter->flags & 1) { tmp___1 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___1 != 0L) { printk(", MAC=%pM", (u8 *)(& filter->mac)); } else { } } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___2 != 0L) { printk("\n"); } else { } return; } } static void bnx2x_vf_mbx_dp_q_filters(struct bnx2x *bp , int msglvl , struct vfpf_set_q_filters_tlv *filters ) { int i ; long tmp ; long tmp___0 ; { if ((int )filters->flags & 1) { i = 0; goto ldv_52006; ldv_52005: bnx2x_vf_mbx_dp_q_filter(bp, msglvl, i, (struct vfpf_q_mac_vlan_filter *)(& filters->filters) + (unsigned long )i); i = i + 1; ldv_52006: ; if ((int )filters->n_mac_vlan_filters > i) { goto ldv_52005; } else { } } else { } if ((filters->flags & 4U) != 0U) { tmp = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]RX-MASK=0x%x\n", "bnx2x_vf_mbx_dp_q_filters", 1623, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", filters->rx_mask); } else { } } else { } if ((filters->flags & 2U) != 0U) { i = 0; goto ldv_52010; ldv_52009: tmp___0 = ldv__builtin_expect((bp->msg_enable & msglvl) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]MULTICAST=%pM\n", "bnx2x_vf_mbx_dp_q_filters", 1627, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (u8 *)(& filters->multicast) + (unsigned long )i); } else { } i = i + 1; ldv_52010: ; if ((int )filters->n_multicast > i) { goto ldv_52009; } else { } } else { } return; } } static int bnx2x_vf_mbx_qfilters(struct bnx2x *bp , struct bnx2x_virtf *vf ) { int rc ; struct vfpf_set_q_filters_tlv *msg ; struct bnx2x_vf_mac_vlan_filters *fl ; unsigned long accept ; struct pf_vf_bulletin_content *bulletin ; { rc = 0; msg = & (((struct bnx2x_vf_mbx *)(& (bp->vfdb)->mbxs) + (unsigned long )vf->index)->msg)->req.set_q_filters; if ((int )msg->flags & 1) { fl = (struct bnx2x_vf_mac_vlan_filters *)0; rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, & fl, 1U); if (rc != 0) { goto op_err; } else { } if ((unsigned long )fl != (unsigned long )((struct bnx2x_vf_mac_vlan_filters *)0)) { rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, (int )msg->vf_qid, 0); if (rc != 0) { goto op_err; } else { } } else { } fl = (struct bnx2x_vf_mac_vlan_filters *)0; rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, & fl, 2U); if (rc != 0) { goto op_err; } else { } if ((unsigned long )fl != (unsigned long )((struct bnx2x_vf_mac_vlan_filters *)0)) { rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, (int )msg->vf_qid, 0); if (rc != 0) { goto op_err; } else { } } else { } } else { } if ((msg->flags & 4U) != 0U) { accept = 0UL; bulletin = (struct pf_vf_bulletin_content *)(bp->vfdb)->bulletin_dma.addr + (unsigned long )vf->index; if (msg->rx_mask != 0U) { __set_bit(0L, (unsigned long volatile *)(& accept)); __set_bit(1L, (unsigned long volatile *)(& accept)); __set_bit(4L, (unsigned long volatile *)(& accept)); } else { } if ((bulletin->valid_bitmap & 2ULL) == 0ULL) { __set_bit(6L, (unsigned long volatile *)(& accept)); } else { } rc = bnx2x_vf_rxmode(bp, vf, (int )msg->vf_qid, accept); if (rc != 0) { goto op_err; } else { } } else { } if ((msg->flags & 2U) != 0U) { rc = bnx2x_vf_mcast(bp, vf, (bnx2x_mac_addr_t *)(& msg->multicast), (int )msg->n_multicast, 0); if (rc != 0) { goto op_err; } else { } } else { } op_err: ; if (rc != 0) { printk("\v[%s:%d(%s)]QFILTERS[%d:%d] error: rc %d\n", "bnx2x_vf_mbx_qfilters", 1713, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )msg->vf_qid, rc); } else { } return (rc); } } static int bnx2x_filters_validate_mac(struct bnx2x *bp , struct bnx2x_virtf *vf , struct vfpf_set_q_filters_tlv *filters ) { struct pf_vf_bulletin_content *bulletin ; int rc ; bool tmp ; int tmp___0 ; { bulletin = (struct pf_vf_bulletin_content *)(bp->vfdb)->bulletin_dma.addr + (unsigned long )vf->index; rc = 0; if ((int )bulletin->valid_bitmap & 1) { if ((unsigned int )filters->n_mac_vlan_filters > 1U) { printk("\v[%s:%d(%s)]VF[%d] requested the addition of multiple macs after set_vf_mac ndo was called\n", "bnx2x_filters_validate_mac", 1733, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); rc = -1; goto response; } else { } if ((unsigned int )filters->n_mac_vlan_filters == 1U) { tmp = ether_addr_equal((u8 const *)(& ((struct vfpf_q_mac_vlan_filter *)(& filters->filters))->mac), (u8 const *)(& bulletin->mac)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { printk("\v[%s:%d(%s)]VF[%d] requested the addition of a mac address not matching the one configured by set_vf_mac ndo\n", "bnx2x_filters_validate_mac", 1742, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); rc = -1; goto response; } else { } } else { } } else { } response: ; return (rc); } } static int bnx2x_filters_validate_vlan(struct bnx2x *bp , struct bnx2x_virtf *vf , struct vfpf_set_q_filters_tlv *filters ) { struct pf_vf_bulletin_content *bulletin ; int rc ; int i ; { bulletin = (struct pf_vf_bulletin_content *)(bp->vfdb)->bulletin_dma.addr + (unsigned long )vf->index; rc = 0; if ((bulletin->valid_bitmap & 2ULL) != 0ULL) { i = 0; goto ldv_52043; ldv_52042: ; if ((filters->filters[i].flags & 2U) != 0U) { printk("\v[%s:%d(%s)]VF[%d] attempted to configure vlan but one was already set by Hypervisor. Aborting request\n", "bnx2x_filters_validate_vlan", 1769, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); rc = -1; goto response; } else { } i = i + 1; ldv_52043: ; if ((int )filters->n_mac_vlan_filters > i) { goto ldv_52042; } else { } } else { } if ((int )filters->vf_qid > (int )vf->alloc_resc.num_rxqs) { rc = -1; goto response; } else { } response: ; return (rc); } } static void bnx2x_vf_mbx_set_q_filters(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { struct vfpf_set_q_filters_tlv *filters ; int rc ; long tmp ; { filters = & (mbx->msg)->req.set_q_filters; rc = bnx2x_filters_validate_mac(bp, vf, filters); if (rc != 0) { goto response; } else { } rc = bnx2x_filters_validate_vlan(bp, vf, filters); if (rc != 0) { goto response; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] Q_FILTERS: queue[%d]\n", "bnx2x_vf_mbx_set_q_filters", 1803, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )filters->vf_qid); } else { } bnx2x_vf_mbx_dp_q_filters(bp, 8388608, filters); rc = bnx2x_vf_mbx_qfilters(bp, vf); response: bnx2x_vf_mbx_resp(bp, vf, rc); return; } } static void bnx2x_vf_mbx_teardown_q(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { int qid ; int rc ; long tmp ; { qid = (int )(mbx->msg)->req.q_op.vf_qid; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] Q_TEARDOWN: vf_qid=%d\n", "bnx2x_vf_mbx_teardown_q", 1820, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid); } else { } rc = bnx2x_vf_queue_teardown(bp, vf, qid); bnx2x_vf_mbx_resp(bp, vf, rc); return; } } static void bnx2x_vf_mbx_close_vf(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { int rc ; long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] VF_CLOSE\n", "bnx2x_vf_mbx_close_vf", 1831, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } rc = bnx2x_vf_close(bp, vf); bnx2x_vf_mbx_resp(bp, vf, rc); return; } } static void bnx2x_vf_mbx_release_vf(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { int rc ; long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] VF_RELEASE\n", "bnx2x_vf_mbx_release_vf", 1842, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } rc = bnx2x_vf_free(bp, vf); bnx2x_vf_mbx_resp(bp, vf, rc); return; } } static void bnx2x_vf_mbx_update_rss(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { struct bnx2x_config_rss_params rss ; struct vfpf_rss_tlv *rss_tlv ; int rc ; { rss_tlv = & (mbx->msg)->req.update_rss; rc = 0; if ((unsigned int )rss_tlv->ind_table_size != 128U || (unsigned int )rss_tlv->rss_key_size != 10U) { printk("\v[%s:%d(%s)]failing rss configuration of vf %d due to size mismatch\n", "bnx2x_vf_mbx_update_rss", 1858, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->index); rc = -22; goto mbx_resp; } else { } memset((void *)(& rss), 0, 200UL); memcpy((void *)(& rss.ind_table), (void const *)(& rss_tlv->ind_table), 128UL); memcpy((void *)(& rss.rss_key), (void const *)(& rss_tlv->rss_key), 40UL); rss.rss_obj = & vf->rss_conf_obj; rss.rss_result_mask = rss_tlv->rss_result_mask; rss.rss_flags = 0UL; rss.ramrod_flags = 0UL; if ((int )rss_tlv->rss_flags & 1) { __set_bit(0L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if ((rss_tlv->rss_flags & 2U) != 0U) { __set_bit(1L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if ((rss_tlv->rss_flags & 4U) != 0U) { __set_bit(2L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if ((rss_tlv->rss_flags & 8U) != 0U) { __set_bit(3L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if ((rss_tlv->rss_flags & 16U) != 0U) { __set_bit(4L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if ((rss_tlv->rss_flags & 32U) != 0U) { __set_bit(5L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if ((rss_tlv->rss_flags & 64U) != 0U) { __set_bit(6L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if ((rss_tlv->rss_flags & 128U) != 0U) { __set_bit(7L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if ((rss_tlv->rss_flags & 256U) != 0U) { __set_bit(8L, (unsigned long volatile *)(& rss.rss_flags)); } else { } if (((rss_tlv->rss_flags & 16U) == 0U && (rss_tlv->rss_flags & 32U) != 0U) || ((rss_tlv->rss_flags & 128U) == 0U && (rss_tlv->rss_flags & 256U) != 0U)) { printk("\v[%s:%d(%s)]about to hit a FW assert. aborting...\n", "bnx2x_vf_mbx_update_rss", 1899, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -22; goto mbx_resp; } else { } rc = bnx2x_vf_rss_update(bp, vf, & rss); mbx_resp: bnx2x_vf_mbx_resp(bp, vf, rc); return; } } static int bnx2x_validate_tpa_params(struct bnx2x *bp , struct vfpf_tpa_tlv *tpa_tlv ) { int rc ; { rc = 0; if ((unsigned int )tpa_tlv->tpa_client_info.max_sges_for_packet > 3U) { rc = -22; printk("\v[%s:%d(%s)]TPA update: max_sges received %d, max is %d\n", "bnx2x_validate_tpa_params", 1919, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tpa_tlv->tpa_client_info.max_sges_for_packet, 3); } else { } if ((int )tpa_tlv->tpa_client_info.max_tpa_queues > (bp->common.chip_id >> 16 == 5710U ? 32 : 64)) { rc = -22; printk("\v[%s:%d(%s)]TPA update: max_tpa_queues received %d, max is %d\n", "bnx2x_validate_tpa_params", 1926, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )tpa_tlv->tpa_client_info.max_tpa_queues, bp->common.chip_id >> 16 == 5710U ? 32 : 64); } else { } return (rc); } } static void bnx2x_vf_mbx_update_tpa(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { struct bnx2x_queue_update_tpa_params vf_op_params ; struct vfpf_tpa_tlv *tpa_tlv ; int rc ; int tmp ; { tpa_tlv = & (mbx->msg)->req.update_tpa; rc = 0; memset((void *)(& vf_op_params), 0, 24UL); tmp = bnx2x_validate_tpa_params(bp, tpa_tlv); if (tmp != 0) { goto mbx_resp; } else { } vf_op_params.complete_on_both_clients = tpa_tlv->tpa_client_info.complete_on_both_clients; vf_op_params.dont_verify_thr = tpa_tlv->tpa_client_info.dont_verify_thr; vf_op_params.max_agg_sz = tpa_tlv->tpa_client_info.max_agg_size; vf_op_params.max_sges_pkt = tpa_tlv->tpa_client_info.max_sges_for_packet; vf_op_params.max_tpa_queues = tpa_tlv->tpa_client_info.max_tpa_queues; vf_op_params.sge_buff_sz = tpa_tlv->tpa_client_info.sge_buff_size; vf_op_params.sge_pause_thr_high = tpa_tlv->tpa_client_info.sge_pause_thr_high; vf_op_params.sge_pause_thr_low = tpa_tlv->tpa_client_info.sge_pause_thr_low; vf_op_params.tpa_mode = tpa_tlv->tpa_client_info.tpa_mode; vf_op_params.update_ipv4 = tpa_tlv->tpa_client_info.update_ipv4; vf_op_params.update_ipv6 = tpa_tlv->tpa_client_info.update_ipv6; rc = bnx2x_vf_tpa_update(bp, vf, tpa_tlv, & vf_op_params); mbx_resp: bnx2x_vf_mbx_resp(bp, vf, rc); return; } } static void bnx2x_vf_mbx_request(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mbx *mbx ) { int i ; long tmp ; bool tmp___0 ; { tmp___0 = bnx2x_tlv_supported((int )mbx->first_tlv.tl.type); if ((int )tmp___0) { bnx2x_lock_vf_pf_channel(bp, vf, (enum channel_tlvs )mbx->first_tlv.tl.type); switch ((int )mbx->first_tlv.tl.type) { case 1: bnx2x_vf_mbx_acquire(bp, vf, mbx); return; case 2: bnx2x_vf_mbx_init_vf(bp, vf, mbx); return; case 3: bnx2x_vf_mbx_setup_q(bp, vf, mbx); return; case 4: bnx2x_vf_mbx_set_q_filters(bp, vf, mbx); return; case 7: bnx2x_vf_mbx_teardown_q(bp, vf, mbx); return; case 8: bnx2x_vf_mbx_close_vf(bp, vf, mbx); return; case 9: bnx2x_vf_mbx_release_vf(bp, vf, mbx); return; case 16: bnx2x_vf_mbx_update_rss(bp, vf, mbx); return; case 18: bnx2x_vf_mbx_update_tpa(bp, vf, mbx); return; } } else { printk("\v[%s:%d(%s)]unknown TLV. type %d length %d vf->state was %d. first 20 bytes of mailbox buffer:\n", "bnx2x_vf_mbx_request", 2026, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )mbx->first_tlv.tl.type, (int )mbx->first_tlv.tl.length, (int )vf->state); i = 0; goto ldv_52118; ldv_52117: tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("%x ", (int )(mbx->msg)->req.tlv_buf_size.tlv_buffer[i]); } else { } i = i + 1; ldv_52118: ; if (i <= 19) { goto ldv_52117; } else { } } if ((unsigned int )vf->state == 1U || (unsigned int )vf->state == 2U) { bnx2x_vf_mbx_resp(bp, vf, 3); } else { storm_memset_vf_mbx_ack(bp, (int )vf->abs_vfid); __asm__ volatile ("": : : "memory"); bnx2x_unlock_vf_pf_channel(bp, vf, (enum channel_tlvs )mbx->first_tlv.tl.type); } return; } } void bnx2x_vf_mbx_schedule(struct bnx2x *bp , struct vf_pf_event_data *vfpf_event ) { u8 vf_idx ; long tmp ; int tmp___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf pf event received: vfid %d, address_hi %x, address lo %x", "bnx2x_vf_mbx_schedule", 2055, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vfpf_event->vf_id, vfpf_event->msg_addr_hi, vfpf_event->msg_addr_lo); } else { } if ((u32 )vfpf_event->vf_id - (bp->vfdb)->sriov.first_vf_in_pf > (u32 )(bp->vfdb)->sriov.nr_virtfn) { printk("\v[%s:%d(%s)]Illegal vf_id %d max allowed: %d\n", "bnx2x_vf_mbx_schedule", 2062, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vfpf_event->vf_id, (int )(bp->vfdb)->sriov.nr_virtfn); return; } else { } tmp___0 = bnx2x_vf_idx_by_abs_fid(bp, (int )vfpf_event->vf_id); vf_idx = (u8 )tmp___0; mutex_lock_nested(& (bp->vfdb)->event_mutex, 0U); ((struct bnx2x_vf_mbx *)(& (bp->vfdb)->mbxs) + (unsigned long )vf_idx)->vf_addr_hi = vfpf_event->msg_addr_hi; ((struct bnx2x_vf_mbx *)(& (bp->vfdb)->mbxs) + (unsigned long )vf_idx)->vf_addr_lo = vfpf_event->msg_addr_lo; (bp->vfdb)->event_occur = (bp->vfdb)->event_occur | (1ULL << (int )vf_idx); mutex_unlock(& (bp->vfdb)->event_mutex); bnx2x_schedule_iov_task(bp, 0); return; } } void bnx2x_vf_mbx(struct bnx2x *bp ) { struct bnx2x_vfdb *vfdb ; u64 events ; u8 vf_idx ; int rc ; struct bnx2x_vf_mbx *mbx ; struct bnx2x_virtf *vf ; long tmp ; { vfdb = bp->vfdb; if ((unsigned long )vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return; } else { } mutex_lock_nested(& vfdb->event_mutex, 0U); events = vfdb->event_occur; vfdb->event_occur = 0ULL; mutex_unlock(& vfdb->event_mutex); vf_idx = 0U; goto ldv_52138; ldv_52137: mbx = (struct bnx2x_vf_mbx *)(& (bp->vfdb)->mbxs) + (unsigned long )vf_idx; vf = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )vf_idx : (struct bnx2x_virtf *)0; if (((events >> (int )vf_idx) & 1ULL) == 0ULL) { goto ldv_52135; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]Handling vf pf event vfid %d, address: [%x:%x], resp_offset 0x%x\n", "bnx2x_vf_mbx", 2105, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf_idx, mbx->vf_addr_hi, mbx->vf_addr_lo, mbx->first_tlv.resp_msg_offset); } else { } rc = bnx2x_copy32_vf_dmae(bp, 1, mbx->msg_mapping, (int )vf->abs_vfid, mbx->vf_addr_hi, mbx->vf_addr_lo, 256U); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to copy request VF %d\n", "bnx2x_vf_mbx", 2114, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); bnx2x_vf_release(bp, vf); return; } else { } mbx->first_tlv = (mbx->msg)->req.first_tlv; memset((void *)(& (mbx->msg)->resp), 0, 1024UL); bnx2x_vf_mbx_request(bp, vf, mbx); ldv_52135: vf_idx = (u8 )((int )vf_idx + 1); ldv_52138: ; if ((int )((unsigned short )vf_idx) < (int )(bp->vfdb)->sriov.nr_virtfn) { goto ldv_52137; } else { } return; } } void bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin , bool support_long ) { { bulletin->length = (int )support_long ? 48U : 32U; bulletin->crc = bnx2x_crc_vf_bulletin(bulletin); return; } } int bnx2x_post_vf_bulletin(struct bnx2x *bp , int vf ) { struct pf_vf_bulletin_content *bulletin ; dma_addr_t pf_addr ; dma_addr_t vf_addr ; int rc ; { bulletin = (struct pf_vf_bulletin_content *)(bp->vfdb)->bulletin_dma.addr + (unsigned long )vf; pf_addr = (bp->vfdb)->bulletin_dma.mapping + (unsigned long long )((unsigned long )vf * 48UL); vf_addr = ((bp->vfdb)->vfs + (unsigned long )vf)->bulletin_map; if ((unsigned int )((bp->vfdb)->vfs + (unsigned long )vf)->state != 2U && (unsigned int )((bp->vfdb)->vfs + (unsigned long )vf)->state != 1U) { return (0); } else { } bulletin->version = (u16 )((int )bulletin->version + 1); bnx2x_vf_bulletin_finalize(bulletin, ((int )((bp->vfdb)->vfs + (unsigned long )vf)->cfg_flags & 128) != 0); rc = bnx2x_copy32_vf_dmae(bp, 0, pf_addr, (int )((bp->vfdb)->vfs + (unsigned long )vf)->abs_vfid, (unsigned int )(vf_addr >> 32), (unsigned int )vf_addr, (unsigned int )bulletin->length / 4U); return (rc); } } bool ldv_queue_work_on_165(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_166(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_167(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_168(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_169(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_179(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_181(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_180(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_183(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_182(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_delayed_work___1(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = ldv_queue_delayed_work_on_180(8192, wq, dwork, delay); return (tmp); } } extern int pci_find_ext_capability(struct pci_dev * , int ) ; extern struct pci_dev *pci_get_domain_bus_and_slot(int , unsigned int , unsigned int ) ; __inline static struct pci_dev *pci_get_bus_and_slot(unsigned int bus , unsigned int devfn ) { struct pci_dev *tmp ; { tmp = pci_get_domain_bus_and_slot(0, bus, devfn); return (tmp); } } 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_sriov(struct pci_dev * , int ) ; extern void pci_disable_sriov(struct pci_dev * ) ; extern int pci_vfs_assigned(struct pci_dev * ) ; static u8 vfq_cl_id___0(struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q ) { { return ((int )vf->igu_base_id + (int )((u8 )q->index)); } } __inline static u8 vfq_stat_id(struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q ) { u8 tmp ; { if (((int )vf->cfg_flags & 64) != 0) { return ((u8 )vf->leading_rss); } else { tmp = vfq_cl_id___0(vf, q); return (tmp); } } } __inline static u8 vfq_qzone_id___0(struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q ) { u8 tmp ; { tmp = vfq_cl_id___0(vf, q); return (tmp); } } void bnx2x_vf_handle_flr_event(struct bnx2x *bp ) ; static int bnx2x_vf_op_prep(struct bnx2x *bp , int vfidx , struct bnx2x_virtf **vf , struct pf_vf_bulletin_content **bulletin , bool test_queue ) ; static void storm_memset_vf_to_pf___0(struct bnx2x *bp , u16 abs_fid , u16 pf_id ) { { writeb((int )((unsigned char )pf_id), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 48UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 48UL)->m1)) + 4325376U)); writeb((int )((unsigned char )pf_id), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 154UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 154UL)->m1)) + 4259840U)); writeb((int )((unsigned char )pf_id), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 108UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 108UL)->m1)) + 4390912U)); writeb((int )((unsigned char )pf_id), (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 183UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 183UL)->m1)) + 4194304U)); return; } } static void storm_memset_func_en___0(struct bnx2x *bp , u16 abs_fid , u8 enable ) { { writeb((int )enable, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 47UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 47UL)->m1)) + 4325376U)); writeb((int )enable, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 153UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 153UL)->m1)) + 4259840U)); writeb((int )enable, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 107UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 107UL)->m1)) + 4390912U)); writeb((int )enable, (void volatile *)bp->regview + (unsigned long )(((unsigned int )(bp->iro_arr + 182UL)->base + (unsigned int )((int )abs_fid * (int )(bp->iro_arr + 182UL)->m1)) + 4194304U)); return; } } int bnx2x_vf_idx_by_abs_fid(struct bnx2x *bp , u16 abs_vfid ) { int idx ; { idx = 0; goto ldv_52486; ldv_52485: ; if ((int )((unsigned short )((bp->vfdb)->vfs + (unsigned long )idx)->abs_vfid) == (int )abs_vfid) { goto ldv_52484; } else { } idx = idx + 1; ldv_52486: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > idx) { goto ldv_52485; } else { } ldv_52484: ; return (idx); } } static struct bnx2x_virtf *bnx2x_vf_by_abs_fid(struct bnx2x *bp , u16 abs_vfid ) { u16 idx ; int tmp ; { tmp = bnx2x_vf_idx_by_abs_fid(bp, (int )abs_vfid); idx = (unsigned short )tmp; return ((int )(bp->vfdb)->sriov.nr_virtfn > (int )idx ? ((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )idx : (struct bnx2x_virtf *)0) : (struct bnx2x_virtf *)0); } } static void bnx2x_vf_igu_ack_sb(struct bnx2x *bp , struct bnx2x_virtf *vf , u8 igu_sb_id , u8 segment , u16 index , u8 op , u8 update ) { u32 ctl ; u32 igu_addr_data ; u32 igu_addr_ctl ; u32 func_encode ; u32 addr_encode ; struct igu_regular cmd_data ; long tmp ; long tmp___0 ; { igu_addr_data = 1245476U; igu_addr_ctl = 1245484U; func_encode = (u32 )vf->abs_vfid; addr_encode = (u32 )((int )igu_sb_id + 1280); cmd_data.sb_id_and_flags = 0U; cmd_data.reserved_2 = 0U; cmd_data.sb_id_and_flags = (u32 )((((int )index | ((int )segment << 21)) | ((int )update << 24)) | ((int )op << 25)); ctl = ((func_encode << 12) | addr_encode) | 1048576U; tmp = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]write 0x%08x to IGU(via GRC) addr 0x%x\n", "bnx2x_vf_igu_ack_sb", 99, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cmd_data.sb_id_and_flags, igu_addr_data); } else { } writel(cmd_data.sb_id_and_flags, (void volatile *)bp->regview + (unsigned long )igu_addr_data); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]write 0x%08x to IGU(via GRC) addr 0x%x\n", "bnx2x_vf_igu_ack_sb", 105, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ctl, igu_addr_ctl); } else { } writel(ctl, (void volatile *)bp->regview + (unsigned long )igu_addr_ctl); __asm__ volatile ("": : : "memory"); __asm__ volatile ("": : : "memory"); return; } } static bool bnx2x_validate_vf_sp_objs(struct bnx2x *bp , struct bnx2x_virtf *vf , bool print_err ) { long tmp ; { if (! (vf->vfqs)->sp_initialized) { if ((int )print_err) { printk("\v[%s:%d(%s)]Slowpath objects not yet initialized!\n", "bnx2x_validate_vf_sp_objs", 117, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]Slowpath objects not yet initialized!\n", "bnx2x_validate_vf_sp_objs", 119, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } return (0); } else { } return (1); } } void bnx2x_vfop_qctor_dump_tx(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_queue_init_params *init_params , struct bnx2x_queue_setup_params *setup_params , u16 q_idx , u16 sb_idx ) { long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] Q_SETUP: txq[%d]-- vfsb=%d, sb-index=%d, hc-rate=%d, flags=0x%lx, traffic-type=%d", "bnx2x_vfop_qctor_dump_tx", 139, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )q_idx, (int )sb_idx, (int )init_params->tx.sb_cq_index, (int )init_params->tx.hc_rate, setup_params->flags, (int )setup_params->txq_params.traffic_type); } else { } return; } } void bnx2x_vfop_qctor_dump_rx(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_queue_init_params *init_params , struct bnx2x_queue_setup_params *setup_params , u16 q_idx , u16 sb_idx ) { struct bnx2x_rxq_setup_params *rxq_params ; long tmp ; { rxq_params = & setup_params->rxq_params; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] Q_SETUP: rxq[%d]-- vfsb=%d, sb-index=%d, hc-rate=%d, mtu=%d, buf-size=%d\nsge-size=%d, max_sge_pkt=%d, tpa-agg-size=%d, flags=0x%lx, drop-flags=0x%x, cache-log=%d\n", "bnx2x_vfop_qctor_dump_rx", 163, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )q_idx, (int )sb_idx, (int )init_params->rx.sb_cq_index, (int )init_params->rx.hc_rate, (int )setup_params->gen_params.mtu, (int )rxq_params->buf_sz, (int )rxq_params->sge_buf_sz, (int )rxq_params->max_sges_pkt, (int )rxq_params->tpa_agg_sz, setup_params->flags, (int )rxq_params->drop_flags, (int )rxq_params->cache_line_log); } else { } return; } } void bnx2x_vfop_qctor_prep(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q , struct bnx2x_vf_queue_construct_params *p , unsigned long q_type ) { struct bnx2x_queue_init_params *init_p ; struct bnx2x_queue_setup_params *setup_p ; int tmp ; int tmp___0 ; int tmp___1 ; struct bnx2x_rxq_setup_params *rxq_p ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { init_p = & p->qstate.params.init; setup_p = & p->prep_qsetup; tmp = constant_test_bit(9L, (unsigned long const volatile *)(& init_p->rx.flags)); if (tmp != 0) { __set_bit(10L, (unsigned long volatile *)(& init_p->rx.flags)); } else { } tmp___0 = constant_test_bit(9L, (unsigned long const volatile *)(& init_p->tx.flags)); if (tmp___0 != 0) { __set_bit(10L, (unsigned long volatile *)(& init_p->tx.flags)); } else { } init_p->rx.fw_sb_id = vf_igu_sb(vf, (int )q->sb_idx); init_p->tx.fw_sb_id = vf_igu_sb(vf, (int )q->sb_idx); init_p->cxts[0] = q->cxt; setup_p->gen_params.spcl_id = vf->sp_cl_id; setup_p->gen_params.stat_id = vfq_stat_id(vf, q); setup_p->gen_params.fp_hsi = vf->fp_hsi; if (((int )vf->cfg_flags & 2) != 0) { printk("\v[%s:%d(%s)]No support for pause to VFs (abs_vfid: %d)\n", "bnx2x_vfop_qctor_prep", 205, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } tmp___1 = constant_test_bit(3L, (unsigned long const volatile *)(& setup_p->flags)); if (tmp___1 != 0) { __set_bit(4L, (unsigned long volatile *)(& setup_p->flags)); } else { } __set_bit(16L, (unsigned long volatile *)(& setup_p->flags)); __set_bit(17L, (unsigned long volatile *)(& setup_p->flags)); __set_bit(18L, (unsigned long volatile *)(& setup_p->flags)); tmp___3 = constant_test_bit(0L, (unsigned long const volatile *)(& q_type)); if (tmp___3 != 0) { rxq_p = & setup_p->rxq_params; rxq_p->cl_qzone_id = vfq_qzone_id___0(vf, q); rxq_p->fw_sb_id = vf_igu_sb(vf, (int )q->sb_idx); rxq_p->rss_engine_id = (unsigned int )vf->abs_vfid + 8U; tmp___2 = constant_test_bit(0L, (unsigned long const volatile *)(& setup_p->flags)); if (tmp___2 != 0) { rxq_p->max_tpa_queues = 8U; } else { } } else { } tmp___4 = constant_test_bit(1L, (unsigned long const volatile *)(& q_type)); if (tmp___4 != 0) { setup_p->txq_params.tss_leading_cl_id = (u8 )vf->leading_rss; setup_p->txq_params.fw_sb_id = vf_igu_sb(vf, (int )q->sb_idx); } else { } return; } } static int bnx2x_vf_queue_create(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid , struct bnx2x_vf_queue_construct_params *qctor ) { struct bnx2x_queue_state_params *q_params ; int rc ; long tmp ; long tmp___0 ; int tmp___1 ; u8 tmp___2 ; { rc = 0; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d:%d]\n", "bnx2x_vf_queue_create", 246, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid); } else { } q_params = & qctor->qstate; q_params->q_obj = & (vf->vfqs + (unsigned long )qid)->sp_obj; set_bit(2L, (unsigned long volatile *)(& q_params->ramrod_flags)); tmp___1 = bnx2x_get_q_logical_state(bp, q_params->q_obj); if (tmp___1 == 0) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]queue was already up. Aborting gracefully\n", "bnx2x_vf_queue_create", 255, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } goto out; } else { } q_params->cmd = 0; rc = bnx2x_queue_state_change(bp, q_params); if (rc != 0) { goto out; } else { } memcpy((void *)(& q_params->params.setup), (void const *)(& qctor->prep_qsetup), 112UL); q_params->cmd = 1; rc = bnx2x_queue_state_change(bp, q_params); if (rc != 0) { goto out; } else { } tmp___2 = vf_igu_sb(vf, (int )(vf->vfqs + (unsigned long )qid)->sb_idx); bnx2x_vf_igu_ack_sb(bp, vf, (int )tmp___2, 0, 0, 0, 0); out: ; return (rc); } } static int bnx2x_vf_queue_destroy(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid ) { enum bnx2x_queue_cmd cmds[3U] ; struct bnx2x_queue_state_params q_params ; int rc ; int i ; long tmp ; long tmp___0 ; int tmp___1 ; { cmds[0] = 7; cmds[1] = 9; cmds[2] = 8; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d]\n", "bnx2x_vf_queue_destroy", 288, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } memset((void *)(& q_params), 0, 136UL); q_params.q_obj = & (vf->vfqs + (unsigned long )qid)->sp_obj; set_bit(2L, (unsigned long volatile *)(& q_params.ramrod_flags)); tmp___1 = bnx2x_get_q_logical_state(bp, q_params.q_obj); if (tmp___1 == 1) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]queue was already stopped. Aborting gracefully\n", "bnx2x_vf_queue_destroy", 297, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } goto out; } else { } i = 0; goto ldv_52568; ldv_52567: q_params.cmd = cmds[i]; rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to run Queue command %d\n", "bnx2x_vf_queue_destroy", 306, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )cmds[i]); return (rc); } else { } i = i + 1; ldv_52568: ; if ((unsigned int )i <= 2U) { goto ldv_52567; } else { } out: ; if ((unsigned long )(vf->vfqs + (unsigned long )qid)->cxt != (unsigned long )((struct eth_context *)0)) { ((vf->vfqs + (unsigned long )qid)->cxt)->ustorm_ag_context.cdu_usage = 0U; ((vf->vfqs + (unsigned long )qid)->cxt)->xstorm_ag_context.cdu_reserved = 0U; } else { } return (0); } } static void bnx2x_vf_set_igu_info(struct bnx2x *bp , u8 igu_sb_id , u8 abs_vfid ) { struct bnx2x_virtf *vf ; struct bnx2x_virtf *tmp ; { tmp = bnx2x_vf_by_abs_fid(bp, (int )abs_vfid); vf = tmp; if ((unsigned long )vf != (unsigned long )((struct bnx2x_virtf *)0)) { if ((unsigned int )(bp->vfdb)->first_vf_igu_entry == 0U) { (bp->vfdb)->first_vf_igu_entry = (u16 )igu_sb_id; } else { } if ((unsigned int )vf->alloc_resc.num_sbs == 0U) { vf->igu_base_id = igu_sb_id; } else { } vf->alloc_resc.num_sbs = (u8 )((int )vf->alloc_resc.num_sbs + 1); vf->sb_count = (u8 )((int )vf->sb_count + 1); } else { } (bp->vfdb)->vf_sbs_pool = (u16 )((int )(bp->vfdb)->vf_sbs_pool + 1); return; } } __inline static void bnx2x_vf_vlan_credit(struct bnx2x *bp , struct bnx2x_vlan_mac_obj *obj , atomic_t *counter ) { struct list_head *pos ; int read_lock ; int cnt ; long tmp ; { cnt = 0; read_lock = bnx2x_vlan_mac_h_read_lock(bp, obj); if (read_lock != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 1048576) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]Failed to take vlan mac read head; continuing anyway\n", "bnx2x_vf_vlan_credit", 349, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } pos = obj->head.next; goto ldv_52586; ldv_52585: cnt = cnt + 1; pos = pos->next; ldv_52586: ; if ((unsigned long )(& obj->head) != (unsigned long )pos) { goto ldv_52585; } else { } if (read_lock == 0) { bnx2x_vlan_mac_h_read_unlock(bp, obj); } else { } atomic_set(counter, cnt); return; } } static int bnx2x_vf_vlan_mac_clear(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid , bool drv_only , bool mac ) { struct bnx2x_vlan_mac_ramrod_params ramrod ; int rc ; long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d] - deleting all %s\n", "bnx2x_vf_vlan_mac_clear", 367, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )mac ? (char *)"MACs" : (char *)"VLANs"); } else { } memset((void *)(& ramrod), 0, 56UL); if ((int )mac) { set_bit(1L, (unsigned long volatile *)(& ramrod.user_req.vlan_mac_flags)); ramrod.vlan_mac_obj = & (vf->vfqs + (unsigned long )qid)->mac_obj; } else { set_bit(4L, (unsigned long volatile *)(& ramrod.user_req.vlan_mac_flags)); ramrod.vlan_mac_obj = & (vf->vfqs + (unsigned long )qid)->vlan_obj; } ramrod.user_req.cmd = 1; set_bit(5L, (unsigned long volatile *)(& ramrod.ramrod_flags)); if ((int )drv_only) { set_bit(3L, (unsigned long volatile *)(& ramrod.ramrod_flags)); } else { set_bit(2L, (unsigned long volatile *)(& ramrod.ramrod_flags)); } rc = (*((ramrod.vlan_mac_obj)->delete_all))(bp, ramrod.vlan_mac_obj, & ramrod.user_req.vlan_mac_flags, & ramrod.ramrod_flags); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to delete all %s\n", "bnx2x_vf_vlan_mac_clear", 394, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )mac ? (char *)"MACs" : (char *)"VLANs"); return (rc); } else { } if (! mac) { atomic_set(& (vf->vfqs + (unsigned long )qid)->vlan_count, 0); } else { } return (0); } } static int bnx2x_vf_mac_vlan_config(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid , struct bnx2x_vf_mac_vlan_filter *filter , bool drv_only ) { struct bnx2x_vlan_mac_ramrod_params ramrod ; int rc ; long tmp ; int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d] - %s a %s filter\n", "bnx2x_vf_mac_vlan_config", 415, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )filter->add ? (char *)"Adding" : (char *)"Deleting", filter->type == 1 ? (char *)"MAC" : (char *)"VLAN"); } else { } memset((void *)(& ramrod), 0, 56UL); if (filter->type == 2) { set_bit(4L, (unsigned long volatile *)(& ramrod.user_req.vlan_mac_flags)); ramrod.vlan_mac_obj = & (vf->vfqs + (unsigned long )qid)->vlan_obj; ramrod.user_req.u.vlan.vlan = filter->vid; } else { set_bit(1L, (unsigned long volatile *)(& ramrod.user_req.vlan_mac_flags)); ramrod.vlan_mac_obj = & (vf->vfqs + (unsigned long )qid)->mac_obj; memcpy((void *)(& ramrod.user_req.u.mac.mac), (void const *)filter->mac, 6UL); } ramrod.user_req.cmd = (int )filter->add ? 0 : 1; if ((int )filter->add && filter->type == 2) { tmp___1 = atomic_read((atomic_t const *)(& (vf->vfqs + (unsigned long )qid)->vlan_count)); if (tmp___1 >= (int )vf->alloc_resc.num_vlan_filters) { tmp___0 = atomic_read((atomic_t const *)(& (vf->vfqs + (unsigned long )qid)->vlan_count)); printk("\v[%s:%d(%s)]No credits for vlan [%d >= %d]\n", "bnx2x_vf_mac_vlan_config", 438, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", tmp___0, (int )vf->alloc_resc.num_vlan_filters); return (-12); } else { } } else { } set_bit(5L, (unsigned long volatile *)(& ramrod.ramrod_flags)); if ((int )drv_only) { set_bit(3L, (unsigned long volatile *)(& ramrod.ramrod_flags)); } else { set_bit(2L, (unsigned long volatile *)(& ramrod.ramrod_flags)); } rc = bnx2x_config_vlan_mac(bp, & ramrod); if (rc != 0 && rc != -17) { printk("\v[%s:%d(%s)]Failed to %s %s\n", "bnx2x_vf_mac_vlan_config", 454, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )filter->add ? (char *)"add" : (char *)"delete", filter->type == 1 ? (char *)"MAC" : (char *)"VLAN"); return (rc); } else { } if (filter->type == 2) { bnx2x_vf_vlan_credit(bp, ramrod.vlan_mac_obj, & (vf->vfqs + (unsigned long )qid)->vlan_count); } else { } return (0); } } int bnx2x_vf_mac_vlan_config_list(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_mac_vlan_filters *filters , int qid , bool drv_only ) { int rc ; int i ; long tmp ; bool tmp___0 ; int tmp___1 ; { rc = 0; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d]\n", "bnx2x_vf_mac_vlan_config_list", 472, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } tmp___0 = bnx2x_validate_vf_sp_objs(bp, vf, 1); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (-22); } else { } i = 0; goto ldv_52620; ldv_52619: rc = bnx2x_vf_mac_vlan_config(bp, vf, qid, (struct bnx2x_vf_mac_vlan_filter *)(& filters->filters) + (unsigned long )i, (int )drv_only); if (rc != 0) { goto ldv_52618; } else { } i = i + 1; ldv_52620: ; if (filters->count > i) { goto ldv_52619; } else { } ldv_52618: ; if (filters->count != i) { printk("\v[%s:%d(%s)]Managed only %d/%d filters - rolling back\n", "bnx2x_vf_mac_vlan_config_list", 488, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, filters->count + 1); goto ldv_52622; ldv_52621: filters->filters[i].add = (bool )(! ((int )filters->filters[i].add != 0)); bnx2x_vf_mac_vlan_config(bp, vf, qid, (struct bnx2x_vf_mac_vlan_filter *)(& filters->filters) + (unsigned long )i, (int )drv_only); ldv_52622: i = i - 1; if (i >= 0) { goto ldv_52621; } else { } } else { } kfree((void const *)filters); return (rc); } } int bnx2x_vf_queue_setup(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid , struct bnx2x_vf_queue_construct_params *qctor ) { int rc ; long tmp ; struct bnx2x_vf_mac_vlan_filter filter ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d:%d]\n", "bnx2x_vf_queue_setup", 508, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid); } else { } rc = bnx2x_vf_queue_create(bp, vf, qid, qctor); if (rc != 0) { goto op_err; } else { } if (qid == 0) { memset((void *)(& filter), 0, 24UL); filter.type = 2; filter.add = 1; filter.vid = 0U; rc = bnx2x_vf_mac_vlan_config(bp, vf, qid, & filter, 0); if (rc != 0) { goto op_err; } else { } } else { } vf->cfg_flags = (u16 )((unsigned int )vf->cfg_flags | 32U); bnx2x_schedule_sp_rtnl(bp, 8, 8388608U); return (0); op_err: printk("\v[%s:%d(%s)]QSETUP[%d:%d] error: rc %d\n", "bnx2x_vf_queue_setup", 533, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid, rc); return (rc); } } static int bnx2x_vf_queue_flr(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid ) { int rc ; long tmp ; bool tmp___0 ; struct bnx2x_queue_state_params qstate ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d:%d]\n", "bnx2x_vf_queue_flr", 542, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid); } else { } if (qid == 0) { tmp___0 = bnx2x_validate_vf_sp_objs(bp, vf, 0); if ((int )tmp___0) { rc = bnx2x_vf_vlan_mac_clear(bp, vf, qid, 1, 0); if (rc != 0) { goto op_err; } else { } rc = bnx2x_vf_vlan_mac_clear(bp, vf, qid, 1, 1); if (rc != 0) { goto op_err; } else { } } else { } } else { } if ((unsigned int )(vf->vfqs + (unsigned long )qid)->sp_obj.state != 0U) { memset((void *)(& qstate), 0, 136UL); qstate.q_obj = & (vf->vfqs + (unsigned long )qid)->sp_obj; (qstate.q_obj)->state = 6; qstate.cmd = 9; set_bit(2L, (unsigned long volatile *)(& qstate.ramrod_flags)); rc = bnx2x_queue_state_change(bp, & qstate); if (rc != 0) { goto op_err; } else { } } else { } return (0); op_err: printk("\v[%s:%d(%s)]vf[%d:%d] error: rc %d\n", "bnx2x_vf_queue_flr", 571, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid, rc); return (rc); } } int bnx2x_vf_mcast(struct bnx2x *bp , struct bnx2x_virtf *vf , bnx2x_mac_addr_t *mcasts , int mc_num , bool drv_only ) { struct bnx2x_mcast_list_elem *mc ; struct bnx2x_mcast_ramrod_params mcast ; int rc ; int i ; long tmp ; void *tmp___0 ; { mc = (struct bnx2x_mcast_list_elem *)0; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d]\n", "bnx2x_vf_mcast", 582, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } memset((void *)(& mcast), 0, 40UL); mcast.mcast_obj = & vf->mcast_obj; if ((int )drv_only) { set_bit(3L, (unsigned long volatile *)(& mcast.ramrod_flags)); } else { set_bit(2L, (unsigned long volatile *)(& mcast.ramrod_flags)); } if (mc_num != 0) { tmp___0 = kzalloc((unsigned long )mc_num * 24UL, 208U); mc = (struct bnx2x_mcast_list_elem *)tmp___0; if ((unsigned long )mc == (unsigned long )((struct bnx2x_mcast_list_elem *)0)) { printk("\v[%s:%d(%s)]Cannot Configure multicasts due to lack of memory\n", "bnx2x_vf_mcast", 595, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-12); } else { } } else { } mcast.mcast_list_len = vf->mcast_list_len; vf->mcast_list_len = mc_num; rc = bnx2x_config_mcast(bp, & mcast, 2); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to remove multicasts\n", "bnx2x_vf_mcast", 605, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); kfree((void const *)mc); return (rc); } else { } if (mc_num != 0) { INIT_LIST_HEAD(& mcast.mcast_list); i = 0; goto ldv_52656; ldv_52655: (mc + (unsigned long )i)->mac = (u8 *)mcasts + (unsigned long )i; list_add_tail(& (mc + (unsigned long )i)->link, & mcast.mcast_list); i = i + 1; ldv_52656: ; if (i < mc_num) { goto ldv_52655; } else { } mcast.mcast_list_len = mc_num; rc = bnx2x_config_mcast(bp, & mcast, 0); if (rc != 0) { printk("\v[%s:%d(%s)]Faled to add multicasts\n", "bnx2x_vf_mcast", 623, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } kfree((void const *)mc); } else { } return (rc); } } static void bnx2x_vf_prep_rx_mode(struct bnx2x *bp , u8 qid , struct bnx2x_rx_mode_ramrod_params *ramrod , struct bnx2x_virtf *vf , unsigned long accept_flags ) { struct bnx2x_vf_queue *vfq ; struct bnx2x_vf_queue *tmp ; { tmp = vfq_get(vf, (int )qid); vfq = tmp; memset((void *)ramrod, 0, 80UL); ramrod->cid = vfq->cid; ramrod->cl_id = vfq_cl_id___0(vf, vfq); ramrod->rx_mode_obj = & bp->rx_mode_obj; ramrod->func_id = (unsigned int )vf->abs_vfid + 8U; ramrod->rx_accept_flags = accept_flags; ramrod->tx_accept_flags = accept_flags; ramrod->pstate = & vf->filter_state; ramrod->state = 3; set_bit(3L, (unsigned long volatile *)(& vf->filter_state)); set_bit(1L, (unsigned long volatile *)(& ramrod->ramrod_flags)); set_bit(0L, (unsigned long volatile *)(& ramrod->ramrod_flags)); ramrod->rdata = (bp->vfdb)->sp_dma.addr + ((unsigned long )vf->index * 1360UL + 528UL); ramrod->rdata_mapping = ((bp->vfdb)->sp_dma.mapping + (unsigned long long )((unsigned long )vf->index * 1360UL)) + 528ULL; return; } } int bnx2x_vf_rxmode(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid , unsigned long accept_flags ) { struct bnx2x_rx_mode_ramrod_params ramrod ; long tmp ; struct bnx2x_vf_queue *tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d]\n", "bnx2x_vf_rxmode", 660, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } bnx2x_vf_prep_rx_mode(bp, (int )((u8 )qid), & ramrod, vf, accept_flags); set_bit(2L, (unsigned long volatile *)(& ramrod.ramrod_flags)); tmp___0 = vfq_get(vf, (int )((u8 )qid)); tmp___0->accept_flags = ramrod.rx_accept_flags; tmp___1 = bnx2x_config_rx_mode(bp, & ramrod); return (tmp___1); } } int bnx2x_vf_queue_teardown(struct bnx2x *bp , struct bnx2x_virtf *vf , int qid ) { int rc ; long tmp ; bool tmp___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d:%d]\n", "bnx2x_vf_queue_teardown", 672, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid); } else { } if (qid == 0) { rc = bnx2x_vf_rxmode(bp, vf, qid, 0UL); if (rc != 0) { goto op_err; } else { } tmp___0 = bnx2x_validate_vf_sp_objs(bp, vf, 1); if ((int )tmp___0) { rc = bnx2x_vf_vlan_mac_clear(bp, vf, qid, 0, 0); if (rc != 0) { goto op_err; } else { } rc = bnx2x_vf_vlan_mac_clear(bp, vf, qid, 0, 1); if (rc != 0) { goto op_err; } else { } rc = bnx2x_vf_mcast(bp, vf, (bnx2x_mac_addr_t *)0, 0, 0); if (rc != 0) { goto op_err; } else { } } else { } } else { } rc = bnx2x_vf_queue_destroy(bp, vf, qid); if (rc != 0) { goto op_err; } else { } return (rc); op_err: printk("\v[%s:%d(%s)]vf[%d:%d] error: rc %d\n", "bnx2x_vf_queue_teardown", 703, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid, rc); return (rc); } } static void bnx2x_vf_enable_internal(struct bnx2x *bp , u8 enable ) { { writel((unsigned int )enable != 0U, (void volatile *)bp->regview + 37944U); return; } } static void bnx2x_vf_semi_clear_err(struct bnx2x *bp , u8 abs_vfid ) { { writel((unsigned int )abs_vfid, (void volatile *)bp->regview + 1573760U); writel((unsigned int )abs_vfid, (void volatile *)bp->regview + 3146624U); writel((unsigned int )abs_vfid, (void volatile *)bp->regview + 2098048U); writel((unsigned int )abs_vfid, (void volatile *)bp->regview + 2622336U); return; } } static void bnx2x_vf_pglue_clear_err(struct bnx2x *bp , u8 abs_vfid ) { u32 was_err_group ; u32 was_err_reg ; { was_err_group = (u32 )(((bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? ((int )bp->pf_num & 1) * 2 : 0) + (int )abs_vfid) >> 5); was_err_reg = 0U; switch (was_err_group) { case 0U: was_err_reg = 38008U; goto ldv_52697; case 1U: was_err_reg = 38012U; goto ldv_52697; case 2U: was_err_reg = 38016U; goto ldv_52697; case 3U: was_err_reg = 38004U; goto ldv_52697; } ldv_52697: writel(1U << ((int )abs_vfid & 31), (void volatile *)bp->regview + (unsigned long )was_err_reg); return; } } static void bnx2x_vf_igu_reset(struct bnx2x *bp , struct bnx2x_virtf *vf ) { int i ; u32 val ; long tmp ; u8 igu_sb_id ; u8 tmp___0 ; { bnx2x_pretend_func(bp, (int )((unsigned short )((int )((short )((unsigned int )bp->pf_num | 8U)) | (int )((short )((int )vf->abs_vfid << 4))))); writel(0U, (void volatile *)bp->regview + 1245532U); writel(0U, (void volatile *)bp->regview + 1245536U); writel(0U, (void volatile *)bp->regview + 1245540U); writel(0U, (void volatile *)bp->regview + 1245544U); writel(0U, (void volatile *)bp->regview + 1245496U); writel(0U, (void volatile *)bp->regview + 1245500U); val = readl((void const volatile *)bp->regview + 1245552U); val = val | 3U; if (((int )vf->cfg_flags & 8) != 0) { val = val | 16U; } else { } val = val & 4294967283U; val = (u32 )(((int )bp->pf_num >> 1) << 2) | val; writel(val, (void volatile *)bp->regview + 1245552U); tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]value in IGU_REG_VF_CONFIGURATION of vf %d after write is 0x%08x\n", "bnx2x_vf_igu_reset", 776, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, val); } else { } bnx2x_pretend_func(bp, (int )bp->pf_num); i = 0; goto ldv_52710; ldv_52709: tmp___0 = vf_igu_sb(vf, (int )((u16 )i)); igu_sb_id = tmp___0; writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )igu_sb_id + 313344) * 4)); bnx2x_igu_clear_sb_gen(bp, (int )vf->abs_vfid, (int )igu_sb_id, 0); bnx2x_vf_igu_ack_sb(bp, vf, (int )igu_sb_id, 0, 0, 1, 1); i = i + 1; ldv_52710: ; if ((int )vf->alloc_resc.num_sbs > i) { goto ldv_52709; } else { } return; } } void bnx2x_vf_enable_access(struct bnx2x *bp , u8 abs_vfid ) { long tmp ; { storm_memset_vf_to_pf___0(bp, (int )((unsigned int )((u16 )abs_vfid) + 8U), (int )bp->pfid); storm_memset_func_en___0(bp, (int )((unsigned int )((u16 )abs_vfid) + 8U), 1); bnx2x_vf_semi_clear_err(bp, (int )abs_vfid); bnx2x_vf_pglue_clear_err(bp, (int )abs_vfid); bnx2x_pretend_func(bp, (int )((unsigned short )((int )((short )((unsigned int )bp->pf_num | 8U)) | (int )((short )((int )abs_vfid << 4))))); tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]enabling internal access for vf %x\n", "bnx2x_vf_enable_access", 809, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )abs_vfid); } else { } bnx2x_vf_enable_internal(bp, 1); bnx2x_pretend_func(bp, (int )bp->pf_num); return; } } static void bnx2x_vf_enable_traffic(struct bnx2x *bp , struct bnx2x_virtf *vf ) { { bnx2x_vf_igu_reset(bp, vf); bnx2x_pretend_func(bp, (int )((unsigned short )((int )((short )((unsigned int )bp->pf_num | 8U)) | (int )((short )((int )vf->abs_vfid << 4))))); writel(0U, (void volatile *)bp->regview + 1311468U); bnx2x_pretend_func(bp, (int )bp->pf_num); return; } } static u8 bnx2x_vf_is_pcie_pending(struct bnx2x *bp , u8 abs_vfid ) { struct pci_dev *dev ; struct bnx2x_virtf *vf ; struct bnx2x_virtf *tmp ; u8 tmp___0 ; { tmp = bnx2x_vf_by_abs_fid(bp, (int )abs_vfid); vf = tmp; if ((unsigned long )vf == (unsigned long )((struct bnx2x_virtf *)0)) { return (0U); } else { } dev = pci_get_bus_and_slot(vf->bus, vf->devfn); if ((unsigned long )dev != (unsigned long )((struct pci_dev *)0)) { tmp___0 = bnx2x_is_pcie_pending(dev); return (tmp___0); } else { } return (0U); } } int bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp , u8 abs_vfid ) { u8 tmp ; { tmp = bnx2x_vf_is_pcie_pending(bp, (int )abs_vfid); if ((unsigned int )tmp != 0U) { printk("\v[%s:%d(%s)]PCIE Transactions still pending\n", "bnx2x_vf_flr_clnup_epilog", 843, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } } static void bnx2x_iov_re_set_vlan_filters(struct bnx2x *bp , struct bnx2x_virtf *vf , int new ) { int num ; int diff ; bool rc ; long tmp ; long tmp___0 ; { num = (int )vf->alloc_resc.num_vlan_filters; diff = new - num; rc = 1; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d] - %d vlan filter credits [previously %d]\n", "bnx2x_iov_re_set_vlan_filters", 857, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, new, num); } else { } if (diff > 0) { rc = (*(bp->vlans_pool.get))(& bp->vlans_pool, diff); } else if (diff < 0) { rc = (*(bp->vlans_pool.put))(& bp->vlans_pool, - diff); } else { } if ((int )rc) { vf->alloc_resc.num_vlan_filters = (u8 )new; } else { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]vf[%d] - Failed to configure vlan filter credits change\n", "bnx2x_iov_re_set_vlan_filters", 868, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } } return; } } static void bnx2x_iov_static_resc(struct bnx2x *bp , struct bnx2x_virtf *vf ) { struct vf_pf_resc_request *resc ; u16 vlan_count ; int tmp ; int tmp___0 ; { resc = & vf->alloc_resc; vlan_count = 0U; resc->num_rxqs = 0U; resc->num_txqs = 0U; resc->num_mac_filters = 1U; bnx2x_iov_re_set_vlan_filters(bp, vf, 0); tmp = (*(bp->vlans_pool.check))(& bp->vlans_pool); vlan_count = (u16 )tmp; tmp___0 = __ilog2_u32((u32 )vlan_count); vlan_count = (u16 )(1 << tmp___0); bnx2x_iov_re_set_vlan_filters(bp, vf, (int )vlan_count / (int )(bp->vfdb)->sriov.nr_virtfn); resc->num_mc_filters = 0U; resc->num_sbs = vf->sb_count; return; } } static void bnx2x_vf_free_resc(struct bnx2x *bp , struct bnx2x_virtf *vf ) { { bnx2x_iov_static_resc(bp, vf); vf->state = 0U; return; } } static void bnx2x_vf_flr_clnup_hw(struct bnx2x *bp , struct bnx2x_virtf *vf ) { u32 poll_cnt ; u32 tmp ; int tmp___0 ; { tmp = bnx2x_flr_clnup_poll_count(bp); poll_cnt = tmp; bnx2x_pretend_func(bp, (int )((unsigned short )((int )((short )((unsigned int )bp->pf_num | 8U)) | (int )((short )((int )vf->abs_vfid << 4))))); bnx2x_flr_clnup_poll_hw_counter(bp, 1508128U, (char *)"DQ VF usage counter timed out", poll_cnt); bnx2x_pretend_func(bp, (int )bp->pf_num); tmp___0 = bnx2x_send_final_clnup(bp, (int )((unsigned int )vf->abs_vfid + 8U), poll_cnt); if (tmp___0 != 0) { printk("\v[%s:%d(%s)]VF[%d] Final cleanup timed-out\n", "bnx2x_vf_flr_clnup_hw", 923, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } bnx2x_tx_hw_flushed(bp, poll_cnt); return; } } static void bnx2x_vf_flr(struct bnx2x *bp , struct bnx2x_virtf *vf ) { int rc ; int i ; long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d]\n", "bnx2x_vf_flr", 933, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } i = 0; goto ldv_52766; ldv_52765: rc = bnx2x_vf_queue_flr(bp, vf, i); if (rc != 0) { goto out; } else { } i = i + 1; ldv_52766: ; if ((int )vf->alloc_resc.num_rxqs > i) { goto ldv_52765; } else { } bnx2x_vf_mcast(bp, vf, (bnx2x_mac_addr_t *)0, 0, 1); bnx2x_vf_flr_clnup_hw(bp, vf); bnx2x_vf_free_resc(bp, vf); bnx2x_vf_enable_mbx(bp, (int )vf->abs_vfid); return; out: printk("\v[%s:%d(%s)]vf[%d:%d] failed flr: rc %d\n", "bnx2x_vf_flr", 958, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, i, rc); return; } } static void bnx2x_vf_flr_clnup(struct bnx2x *bp ) { struct bnx2x_virtf *vf ; int i ; long tmp ; long tmp___0 ; { i = 0; goto ldv_52776; ldv_52775: ; if ((unsigned int )((bp->vfdb)->vfs + (unsigned long )i)->state != 3U || ! ((bp->vfdb)->vfs + (unsigned long )i)->flr_clnup_stage) { goto ldv_52773; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]next vf to cleanup: %d. Num of vfs: %d\n", "bnx2x_vf_flr_clnup", 973, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i, (int )(bp->vfdb)->sriov.nr_virtfn); } else { } vf = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )i : (struct bnx2x_virtf *)0; bnx2x_lock_vf_pf_channel(bp, vf, 13); bnx2x_vf_flr(bp, vf); vf->flr_clnup_stage = 0; bnx2x_unlock_vf_pf_channel(bp, vf, 13); ldv_52773: i = i + 1; ldv_52776: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > i) { goto ldv_52775; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]DRV_STATUS_VF_DISABLED ACK for vfs 0x%x 0x%x\n", "bnx2x_vf_flr_clnup", 996, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->vfdb)->flrd_vfs[0], (bp->vfdb)->flrd_vfs[1]); } else { } i = 0; goto ldv_52779; ldv_52778: writel((bp->vfdb)->flrd_vfs[i], (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + (((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) * 2UL + (unsigned long )i) + 17UL) * 4UL))); i = i + 1; ldv_52779: ; if (i <= 1) { goto ldv_52778; } else { } bnx2x_fw_command(bp, 3221225472U, 0U); i = 0; goto ldv_52782; ldv_52781: writel(0U, (void volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + (((unsigned long )(((int )bp->pfid & 1) + ((int )bp->pfid >> 1) * ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || (unsigned int )bp->common.chip_port_mode == 0U ? 2 : 1)) * 2UL + (unsigned long )i) + 17UL) * 4UL))); i = i + 1; ldv_52782: ; if (i <= 1) { goto ldv_52781; } else { } return; } } void bnx2x_vf_handle_flr_event(struct bnx2x *bp ) { int i ; long tmp ; struct bnx2x_virtf *vf ; u32 reset ; long tmp___0 ; { i = 0; goto ldv_52789; ldv_52788: (bp->vfdb)->flrd_vfs[i] = readl((void const volatile *)(bp->regview + ((unsigned long )bp->common.shmem2_base + ((unsigned long )i + 15UL) * 4UL))); i = i + 1; ldv_52789: ; if (i <= 1) { goto ldv_52788; } else { } tmp = ldv__builtin_expect((bp->msg_enable & 65536) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]DRV_STATUS_VF_DISABLED received for vfs 0x%x 0x%x\n", "bnx2x_vf_handle_flr_event", 1020, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->vfdb)->flrd_vfs[0], (bp->vfdb)->flrd_vfs[1]); } else { } i = 0; goto ldv_52795; ldv_52794: vf = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )i : (struct bnx2x_virtf *)0; reset = 0U; if ((unsigned int )vf->abs_vfid <= 31U) { reset = (bp->vfdb)->flrd_vfs[0] & (u32 )(1 << (int )vf->abs_vfid); } else { reset = (bp->vfdb)->flrd_vfs[1] & (u32 )(1 << ((int )vf->abs_vfid + -32)); } if (reset != 0U) { vf->state = 3U; vf->flr_clnup_stage = 1; tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]Initiating Final cleanup for VF %d\n", "bnx2x_vf_handle_flr_event", 1039, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } } else { } i = i + 1; ldv_52795: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > i) { goto ldv_52794; } else { } bnx2x_vf_flr_clnup(bp); return; } } void bnx2x_iov_init_dq(struct bnx2x *bp ) { { if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return; } else { } writel(0U, (void volatile *)bp->regview + 1507752U); writel(6U, (void volatile *)bp->regview + 1507820U); writel(1024U, (void volatile *)bp->regview + 1507744U); writel(4U, (void volatile *)bp->regview + 1507748U); writel(3U, (void volatile *)bp->regview + 1507828U); writel(1U, (void volatile *)bp->regview + 1507864U); writel(0U, (void volatile *)bp->regview + 1507928U); writel(0U, (void volatile *)bp->regview + 1507992U); writel(131071U, (void volatile *)bp->regview + 1508056U); writel(64U, (void volatile *)bp->regview + 1508160U); return; } } void bnx2x_iov_init_dmae(struct bnx2x *bp ) { int tmp ; { tmp = pci_find_ext_capability(bp->pdev, 16); if (tmp != 0) { writel(0U, (void volatile *)bp->regview + 1056892U); } else { } return; } } static int bnx2x_vf_bus(struct bnx2x *bp , int vfid ) { struct pci_dev *dev ; struct bnx2x_sriov *iov ; { dev = bp->pdev; iov = & (bp->vfdb)->sriov; return ((int )((unsigned int )(dev->bus)->number + (((dev->devfn + (unsigned int )iov->offset) + (unsigned int )((int )iov->stride * vfid)) >> 8))); } } static int bnx2x_vf_devfn(struct bnx2x *bp , int vfid ) { struct pci_dev *dev ; struct bnx2x_sriov *iov ; { dev = bp->pdev; iov = & (bp->vfdb)->sriov; return ((int )((dev->devfn + (unsigned int )iov->offset) + (unsigned int )((int )iov->stride * vfid)) & 255); } } static void bnx2x_vf_set_bars(struct bnx2x *bp , struct bnx2x_virtf *vf ) { int i ; int n ; struct pci_dev *dev ; struct bnx2x_sriov *iov ; u64 start ; u32 size ; { dev = bp->pdev; iov = & (bp->vfdb)->sriov; i = 0; n = 0; goto ldv_52826; ldv_52825: start = dev->resource[i + 7].start; size = dev->resource[i + 7].start != 0ULL || dev->resource[i + 7].end != dev->resource[i + 7].start ? ((u32 )dev->resource[i + 7].end - (u32 )dev->resource[i + 7].start) + 1U : 0U; size = size / (u32 )iov->total; vf->bars[n].bar = (u64 )((u32 )vf->abs_vfid * size) + start; vf->bars[n].size = size; i = i + 2; n = n + 1; ldv_52826: ; if (i <= 5) { goto ldv_52825; } else { } return; } } static int bnx2x_ari_enabled(struct pci_dev *dev ) { { return ((unsigned long )(dev->bus)->self != (unsigned long )((struct pci_dev *)0) && (unsigned int )*((unsigned char *)(dev->bus)->self + 2530UL) != 0U); } } static int bnx2x_get_vf_igu_cam_info(struct bnx2x *bp ) { int sb_id ; u32 val ; u8 fid ; u8 current_pf ; long tmp ; long tmp___0 ; { current_pf = 0U; sb_id = 0; goto ldv_52841; ldv_52840: val = readl((void const volatile *)bp->regview + (unsigned long )((sb_id + 312320) * 4)); if ((val & 1U) == 0U) { goto ldv_52838; } else { } fid = (u8 )((val & 16256U) >> 7); if (((int )fid & 64) != 0) { current_pf = (unsigned int )fid & 7U; } else if ((int )bp->pfid == (int )current_pf) { bnx2x_vf_set_igu_info(bp, (int )((u8 )sb_id), (int )fid & 63); } else { } tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]%s[%d], igu_sb_id=%d, msix=%d\n", "bnx2x_get_vf_igu_cam_info", 1151, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", ((int )fid & 64) != 0 ? (char *)"PF" : (char *)"VF", ((int )fid & 64) != 0 ? (int )fid & 7 : (int )fid & 63, sb_id, (val & 126U) >> 1); } else { } ldv_52838: sb_id = sb_id + 1; ldv_52841: ; if (sb_id <= 135) { goto ldv_52840; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]vf_sbs_pool is %d\n", "bnx2x_get_vf_igu_cam_info", 1153, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )(bp->vfdb)->vf_sbs_pool); } else { } return ((int )(bp->vfdb)->vf_sbs_pool); } } static void __bnx2x_iov_free_vfdb(struct bnx2x *bp ) { { if ((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0)) { kfree((void const *)(bp->vfdb)->vfqs); kfree((void const *)(bp->vfdb)->vfs); kfree((void const *)bp->vfdb); } else { } bp->vfdb = (struct bnx2x_vfdb *)0; return; } } static int bnx2x_sriov_pci_cfg_info(struct bnx2x *bp , struct bnx2x_sriov *iov ) { int pos ; struct pci_dev *dev ; long tmp ; { dev = bp->pdev; pos = pci_find_ext_capability(dev, 16); if (pos == 0) { printk("\v[%s:%d(%s)]failed to find SRIOV capability in device\n", "bnx2x_sriov_pci_cfg_info", 1174, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-19); } else { } iov->pos = pos; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]sriov ext pos %d\n", "bnx2x_sriov_pci_cfg_info", 1179, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", pos); } else { } pci_read_config_word((struct pci_dev const *)dev, pos + 8, & iov->ctrl); pci_read_config_word((struct pci_dev const *)dev, pos + 14, & iov->total); pci_read_config_word((struct pci_dev const *)dev, pos + 12, & iov->initial); pci_read_config_word((struct pci_dev const *)dev, pos + 20, & iov->offset); pci_read_config_word((struct pci_dev const *)dev, pos + 22, & iov->stride); pci_read_config_dword((struct pci_dev const *)dev, pos + 28, & iov->pgsz); pci_read_config_dword((struct pci_dev const *)dev, pos + 4, & iov->cap); pci_read_config_byte((struct pci_dev const *)dev, pos + 18, & iov->link); return (0); } } static int bnx2x_sriov_info(struct bnx2x *bp , struct bnx2x_sriov *iov ) { u32 val ; int tmp ; long tmp___0 ; { tmp = bnx2x_sriov_pci_cfg_info(bp, iov); if (tmp != 0) { return (-19); } else { } iov->nres = 0; val = readl((void const volatile *)bp->regview + 9764U); iov->first_vf_in_pf = (val & 15U) * 8U - (bp->common.chip_id >> 16 != 5710U && (bp->common.chip_id >> 16 != 5711U && bp->common.chip_id >> 16 != 5712U) ? (u32 )(((int )bp->pf_num & 1) * 64) : 0U); tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]IOV info[%d]: first vf %d, nres %d, cap 0x%x, ctrl 0x%x, total %d, initial %d, num vfs %d, offset %d, stride %d, page size 0x%x\n", "bnx2x_sriov_info", 1215, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bp->pfid, iov->first_vf_in_pf, iov->nres, iov->cap, (int )iov->ctrl, (int )iov->total, (int )iov->initial, (int )iov->nr_virtfn, (int )iov->offset, (int )iov->stride, iov->pgsz); } else { } return (0); } } int bnx2x_iov_init_one(struct bnx2x *bp , int int_mode_param , int num_vfs_param ) { int err ; int i ; struct bnx2x_sriov *iov ; struct pci_dev *dev ; int tmp ; int __y ; int __y___0 ; int __y___1 ; int __y___2 ; int __y___3 ; int __y___4 ; int __y___5 ; int __y___6 ; int tmp___0 ; void *tmp___1 ; u16 __min1 ; u16 __min2 ; long tmp___2 ; void *tmp___3 ; struct lock_class_key __key ; int tmp___4 ; void *tmp___5 ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; long tmp___6 ; { dev = bp->pdev; bp->vfdb = (struct bnx2x_vfdb *)0; if ((bp->flags & 4194304U) != 0U) { return (0); } else { } tmp = pci_find_ext_capability(dev, 16); if (tmp == 0) { return (0); } else { } if (bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) { return (0); } else { } if (num_vfs_param == 0) { return (0); } else { } __y___3 = 8; __y___4 = 8; __y___5 = 8; __y___6 = 8; if ((uint )(((int )bp->igu_sb_cnt - (int )bp->cnic_support) * 3) + (uint )bp->cnic_support * (((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___3) + 4294967295U) / (uint )__y___3) * (uint )__y___3 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___4) + 4294967295U) / (uint )__y___4) * (uint )__y___4 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___5) + 4294967295U) / (uint )__y___5) * (uint )__y___5 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___6) + 4294967295U) / (uint )__y___6) * (uint )__y___6 + 8U) & 15U) == 8U ? 16U : 0U)) - ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos) + 2U) > 1023U) { __y = 8; __y___0 = 8; __y___1 = 8; __y___2 = 8; printk("\v[%s:%d(%s)]PF cids %d are overspilling into vf space (starts at %d). Abort SRIOV\n", "bnx2x_iov_init_one", 1249, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (uint )(((int )bp->igu_sb_cnt - (int )bp->cnic_support) * 3) + (uint )bp->cnic_support * (((((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y) + 4294967295U) / (uint )__y) * (uint )__y + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___0) + 4294967295U) / (uint )__y___0) * (uint )__y___0 + 8U) & 15U)) + ((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___1) + 4294967295U) / (uint )__y___1) * (uint )__y___1 + (((((((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos + (uint )__y___2) + 4294967295U) / (uint )__y___2) * (uint )__y___2 + 8U) & 15U) == 8U ? 16U : 0U)) - ((uint )bp->num_queues - bp->num_cnic_queues) * (uint )bp->max_cos) + 2U), 1024); return (0); } else { } if (int_mode_param == 2 || int_mode_param == 1) { printk("\v[%s:%d(%s)]Forced MSI/INTx mode is incompatible with SRIOV\n", "bnx2x_iov_init_one", 1256, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (0); } else { } err = -5; tmp___0 = bnx2x_ari_enabled(bp->pdev); if (tmp___0 == 0) { printk("\v[%s:%d(%s)]ARI not supported (check pci bridge ARI forwarding), SRIOV can not be enabled\n", "bnx2x_iov_init_one", 1263, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (0); } else { } if ((bp->common.chip_id >> 16 == 5710U || (bp->common.chip_id >> 16 == 5711U || bp->common.chip_id >> 16 == 5712U)) || ((int )bp->common.int_block & 2) != 0) { printk("\v[%s:%d(%s)]IGU not normal mode, SRIOV can not be enabled\n", "bnx2x_iov_init_one", 1269, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (0); } else { } tmp___1 = kzalloc(3288UL, 208U); bp->vfdb = (struct bnx2x_vfdb *)tmp___1; if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { printk("\v[%s:%d(%s)]failed to allocate vf database\n", "bnx2x_iov_init_one", 1276, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); err = -12; goto failed; } else { } iov = & (bp->vfdb)->sriov; err = bnx2x_sriov_info(bp, iov); if (err != 0) { goto failed; } else { } if ((unsigned int )iov->total == 0U) { goto failed; } else { } __min1 = iov->total; __min2 = (u16 )num_vfs_param; iov->nr_virtfn = (u16 )((int )__min1 < (int )__min2 ? __min1 : __min2); tmp___2 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]num_vfs_param was %d, nr_virtfn was %d\n", "bnx2x_iov_init_one", 1298, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", num_vfs_param, (int )iov->nr_virtfn); } else { } tmp___3 = kzalloc((unsigned long )(bp->vfdb)->sriov.nr_virtfn * 832UL, 208U); (bp->vfdb)->vfs = (struct bnx2x_virtf *)tmp___3; if ((unsigned long )(bp->vfdb)->vfs == (unsigned long )((struct bnx2x_virtf *)0)) { printk("\v[%s:%d(%s)]failed to allocate vf array\n", "bnx2x_iov_init_one", 1304, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); err = -12; goto failed; } else { } i = 0; goto ldv_52891; ldv_52890: ((bp->vfdb)->vfs + (unsigned long )i)->index = (u8 )i; ((bp->vfdb)->vfs + (unsigned long )i)->abs_vfid = (int )((u8 )iov->first_vf_in_pf) + (int )((u8 )i); ((bp->vfdb)->vfs + (unsigned long )i)->state = 0U; __mutex_init(& ((bp->vfdb)->vfs + (unsigned long )i)->op_mutex, "&bnx2x_vf(bp, i, op_mutex)", & __key); ((bp->vfdb)->vfs + (unsigned long )i)->op_current = 0; i = i + 1; ldv_52891: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > i) { goto ldv_52890; } else { } tmp___4 = bnx2x_get_vf_igu_cam_info(bp); if (tmp___4 == 0) { printk("\v[%s:%d(%s)]No entries in IGU CAM for vfs\n", "bnx2x_iov_init_one", 1320, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); err = -22; goto failed; } else { } tmp___5 = kzalloc(60416UL, 208U); (bp->vfdb)->vfqs = (struct bnx2x_vf_queue *)tmp___5; if ((unsigned long )(bp->vfdb)->vfqs == (unsigned long )((struct bnx2x_vf_queue *)0)) { printk("\v[%s:%d(%s)]failed to allocate vf queue array\n", "bnx2x_iov_init_one", 1331, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); err = -12; goto failed; } else { } __mutex_init(& (bp->vfdb)->event_mutex, "&bp->vfdb->event_mutex", & __key___0); __mutex_init(& (bp->vfdb)->bulletin_mutex, "&bp->vfdb->bulletin_mutex", & __key___1); return (0); failed: tmp___6 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___6 != 0L) { printk("\r[%s:%d(%s)]Failed err=%d\n", "bnx2x_iov_init_one", 1343, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", err); } else { } __bnx2x_iov_free_vfdb(bp); return (err); } } void bnx2x_iov_remove_one(struct bnx2x *bp ) { int vf_idx ; long tmp ; { if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return; } else { } bnx2x_disable_sriov(bp); vf_idx = 0; goto ldv_52901; ldv_52900: bnx2x_pretend_func(bp, (int )((unsigned short )((int )((short )((unsigned int )bp->pf_num | 8U)) | (int )((short )(((int )((unsigned short )(bp->vfdb)->sriov.first_vf_in_pf) + (int )((unsigned short )vf_idx)) << 4))))); tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]disabling internal access for vf %d\n", "bnx2x_iov_remove_one", 1365, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->vfdb)->sriov.first_vf_in_pf + (u32 )vf_idx); } else { } bnx2x_vf_enable_internal(bp, 0); bnx2x_pretend_func(bp, (int )bp->pf_num); vf_idx = vf_idx + 1; ldv_52901: ; if ((int )(bp->vfdb)->sriov.total > vf_idx) { goto ldv_52900; } else { } __bnx2x_iov_free_vfdb(bp); return; } } void bnx2x_iov_free_mem(struct bnx2x *bp ) { int i ; struct hw_dma *cxt ; { if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return; } else { } i = 0; goto ldv_52909; ldv_52908: cxt = (struct hw_dma *)(& (bp->vfdb)->context) + (unsigned long )i; if ((unsigned long )cxt->addr != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, cxt->size, cxt->addr, cxt->mapping, (struct dma_attrs *)0); cxt->addr = (void *)0; cxt->mapping = 0ULL; } else { } i = i + 1; ldv_52909: ; if ((unsigned int )i <= 31U) { goto ldv_52908; } else { } if ((unsigned long )(bp->vfdb)->sp_dma.addr != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, (bp->vfdb)->sp_dma.size, (bp->vfdb)->sp_dma.addr, (bp->vfdb)->sp_dma.mapping, (struct dma_attrs *)0); (bp->vfdb)->sp_dma.addr = (void *)0; (bp->vfdb)->sp_dma.mapping = 0ULL; } else { } if ((unsigned long )(bp->vfdb)->mbx_dma.addr != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, (bp->vfdb)->mbx_dma.size, (bp->vfdb)->mbx_dma.addr, (bp->vfdb)->mbx_dma.mapping, (struct dma_attrs *)0); (bp->vfdb)->mbx_dma.addr = (void *)0; (bp->vfdb)->mbx_dma.mapping = 0ULL; } else { } if ((unsigned long )(bp->vfdb)->bulletin_dma.addr != (unsigned long )((void *)0)) { dma_free_attrs(& (bp->pdev)->dev, (bp->vfdb)->bulletin_dma.size, (bp->vfdb)->bulletin_dma.addr, (bp->vfdb)->bulletin_dma.mapping, (struct dma_attrs *)0); (bp->vfdb)->bulletin_dma.addr = (void *)0; (bp->vfdb)->bulletin_dma.mapping = 0ULL; } else { } return; } } int bnx2x_iov_alloc_mem(struct bnx2x *bp ) { size_t tot_size ; int i ; int rc ; struct hw_dma *cxt ; size_t __min1 ; size_t __min2 ; void *x ; void *tmp ; long tmp___0 ; void *x___0 ; void *tmp___1 ; long tmp___2 ; int __y ; void *x___1 ; void *tmp___3 ; long tmp___4 ; void *x___2 ; void *tmp___5 ; long tmp___6 ; { rc = 0; if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return (rc); } else { } tot_size = (unsigned long )(((bp->vfdb)->sriov.first_vf_in_pf + (u32 )(bp->vfdb)->sriov.nr_virtfn) * 16U) * 1024UL; i = 0; goto ldv_52926; ldv_52925: cxt = (struct hw_dma *)(& (bp->vfdb)->context) + (unsigned long )i; __min1 = tot_size; __min2 = 32768UL; cxt->size = __min1 < __min2 ? __min1 : __min2; if (cxt->size != 0UL) { tmp = dma_zalloc_coherent(& (bp->pdev)->dev, cxt->size, & cxt->mapping, 208U); x = tmp; if ((unsigned long )x != (unsigned long )((void *)0)) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_iov_alloc_mem", 1417, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cxt->mapping, x); } else { } } else { } cxt->addr = x; if ((unsigned long )cxt->addr == (unsigned long )((void *)0)) { goto alloc_mem_err; } else { } } else { cxt->addr = (void *)0; cxt->mapping = 0ULL; } tot_size = tot_size - cxt->size; i = i + 1; ldv_52926: ; if ((unsigned int )i <= 31U) { goto ldv_52925; } else { } tot_size = (unsigned long )(bp->vfdb)->sriov.nr_virtfn * 1360UL; tmp___1 = dma_zalloc_coherent(& (bp->pdev)->dev, tot_size, & (bp->vfdb)->sp_dma.mapping, 208U); x___0 = tmp___1; if ((unsigned long )x___0 != (unsigned long )((void *)0)) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_iov_alloc_mem", 1430, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->vfdb)->sp_dma.mapping, x___0); } else { } } else { } (bp->vfdb)->sp_dma.addr = x___0; if ((unsigned long )(bp->vfdb)->sp_dma.addr == (unsigned long )((void *)0)) { goto alloc_mem_err; } else { } (bp->vfdb)->sp_dma.size = tot_size; __y = 8; tot_size = (unsigned long )(bp->vfdb)->sriov.nr_virtfn * ((((unsigned long )(__y + -1) + 2048UL) / (unsigned long )__y) * (unsigned long )__y); tmp___3 = dma_zalloc_coherent(& (bp->pdev)->dev, tot_size, & (bp->vfdb)->mbx_dma.mapping, 208U); x___1 = tmp___3; if ((unsigned long )x___1 != (unsigned long )((void *)0)) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___4 != 0L) { printk("\r[%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_iov_alloc_mem", 1438, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->vfdb)->mbx_dma.mapping, x___1); } else { } } else { } (bp->vfdb)->mbx_dma.addr = x___1; if ((unsigned long )(bp->vfdb)->mbx_dma.addr == (unsigned long )((void *)0)) { goto alloc_mem_err; } else { } (bp->vfdb)->mbx_dma.size = tot_size; tot_size = (unsigned long )(bp->vfdb)->sriov.nr_virtfn * 48UL; tmp___5 = dma_zalloc_coherent(& (bp->pdev)->dev, tot_size, & (bp->vfdb)->bulletin_dma.mapping, 208U); x___2 = tmp___5; if ((unsigned long )x___2 != (unsigned long )((void *)0)) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___6 != 0L) { printk("\r[%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_iov_alloc_mem", 1447, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (bp->vfdb)->bulletin_dma.mapping, x___2); } else { } } else { } (bp->vfdb)->bulletin_dma.addr = x___2; if ((unsigned long )(bp->vfdb)->bulletin_dma.addr == (unsigned long )((void *)0)) { goto alloc_mem_err; } else { } (bp->vfdb)->bulletin_dma.size = tot_size; return (0); alloc_mem_err: ; return (-12); } } static void bnx2x_vfq_init(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_vf_queue *q ) { u8 cl_id ; u8 tmp ; u8 func_id ; unsigned long q_type ; long tmp___0 ; { tmp = vfq_cl_id___0(vf, q); cl_id = tmp; func_id = (unsigned int )vf->abs_vfid + 8U; q_type = 0UL; set_bit(1L, (unsigned long volatile *)(& q_type)); set_bit(0L, (unsigned long volatile *)(& q_type)); bnx2x_init_queue_obj(bp, & q->sp_obj, (int )cl_id, & q->cid, 1, (int )func_id, (bp->vfdb)->sp_dma.addr + ((unsigned long )vf->index * 1360UL + 1056UL), ((bp->vfdb)->sp_dma.mapping + (unsigned long long )((unsigned long )vf->index * 1360UL)) + 1056ULL, q_type); q->sp_initialized = 0; tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]initialized vf %d\'s queue object. func id set to %d. cid set to 0x%x\n", "bnx2x_vfq_init", 1481, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )q->sp_obj.func_id, q->cid); } else { } return; } } static int bnx2x_max_speed_cap(struct bnx2x *bp ) { u32 supported ; int tmp ; { tmp = bnx2x_get_link_cfg_idx(bp); supported = bp->port.supported[tmp]; if ((supported & 6291456U) != 0U) { return (20000); } else { } return (10000); } } int bnx2x_iov_link_update_vf(struct bnx2x *bp , int idx ) { struct bnx2x_link_report_data *state ; struct pf_vf_bulletin_content *bulletin ; struct bnx2x_virtf *vf ; bool update ; int rc ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; { state = & bp->last_reported_link; update = 1; rc = 0; rc = bnx2x_vf_op_prep(bp, idx, & vf, & bulletin, 0); if (rc != 0) { return (rc); } else { } mutex_lock_nested(& (bp->vfdb)->bulletin_mutex, 0U); if ((unsigned int )vf->link_cfg == 0U) { bulletin->valid_bitmap = bulletin->valid_bitmap | 8ULL; bulletin->link_speed = state->line_speed; bulletin->link_flags = 0U; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& state->link_report_flags)); if (tmp != 0) { bulletin->link_flags = bulletin->link_flags | 1U; } else { } tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& state->link_report_flags)); if (tmp___0 != 0) { bulletin->link_flags = bulletin->link_flags | 2U; } else { } tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& state->link_report_flags)); if (tmp___1 != 0) { bulletin->link_flags = bulletin->link_flags | 4U; } else { } tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)(& state->link_report_flags)); if (tmp___2 != 0) { bulletin->link_flags = bulletin->link_flags | 8U; } else { } } else if ((unsigned int )vf->link_cfg == 2U && (bulletin->link_flags & 1U) == 0U) { bulletin->valid_bitmap = bulletin->valid_bitmap | 8ULL; bulletin->link_flags = bulletin->link_flags | 1U; } else if ((unsigned int )vf->link_cfg == 1U && (int )bulletin->link_flags & 1) { bulletin->valid_bitmap = bulletin->valid_bitmap | 8ULL; tmp___3 = bnx2x_max_speed_cap(bp); bulletin->link_speed = (u16 )tmp___3; bulletin->link_flags = bulletin->link_flags & 4294967294U; } else { update = 0; } if ((int )update) { tmp___4 = ldv__builtin_expect((bp->msg_enable & 8388612) != 0, 0L); if (tmp___4 != 0L) { printk("\r[%s:%d(%s)]vf %d mode %u speed %d flags %x\n", "bnx2x_iov_link_update_vf", 1543, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", idx, (int )vf->link_cfg, (int )bulletin->link_speed, bulletin->link_flags); } else { } rc = bnx2x_post_vf_bulletin(bp, idx); if (rc != 0) { printk("\v[%s:%d(%s)]failed to update VF[%d] bulletin\n", "bnx2x_iov_link_update_vf", 1548, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", idx); goto out; } else { } } else { } out: mutex_unlock(& (bp->vfdb)->bulletin_mutex); return (rc); } } int bnx2x_set_vf_link_state(struct net_device *dev , int idx , int link_state ) { struct bnx2x *bp ; void *tmp ; struct bnx2x_virtf *vf ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; vf = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )idx : (struct bnx2x_virtf *)0; if ((unsigned long )vf == (unsigned long )((struct bnx2x_virtf *)0)) { return (-22); } else { } if ((int )vf->link_cfg == link_state) { return (0); } else { } vf->link_cfg = (u8 )link_state; tmp___0 = bnx2x_iov_link_update_vf(bp, idx); return (tmp___0); } } void bnx2x_iov_link_update(struct bnx2x *bp ) { int vfid ; { if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return; } else { } vfid = 0; goto ldv_52972; ldv_52971: bnx2x_iov_link_update_vf(bp, vfid); vfid = vfid + 1; ldv_52972: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > vfid) { goto ldv_52971; } else { } return; } } int bnx2x_iov_nic_init(struct bnx2x *bp ) { int vfid ; long tmp ; long tmp___0 ; struct bnx2x_virtf *vf ; int base_vf_cid ; union cdu_context *base_cxt ; long tmp___1 ; int __y ; int __y___0 ; struct bnx2x_virtf *vf___0 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; { if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vfdb was not allocated\n", "bnx2x_iov_nic_init", 1591, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]num of vfs: %d\n", "bnx2x_iov_nic_init", 1595, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )(bp->vfdb)->sriov.nr_virtfn); } else { } msleep(100U); vfid = 0; goto ldv_52987; ldv_52986: vf = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )vfid : (struct bnx2x_virtf *)0; base_vf_cid = (int )(((bp->vfdb)->sriov.first_vf_in_pf + (u32 )vfid) * 16U); base_cxt = (union cdu_context *)((struct hw_dma *)(& (bp->vfdb)->context) + (unsigned long )base_vf_cid / 32UL)->addr + ((unsigned long )base_vf_cid & 31UL); tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]VF[%d] Max IGU SBs: %d, base vf cid 0x%x, base cid 0x%x, base cxt %p\n", "bnx2x_iov_nic_init", 1614, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )vf->alloc_resc.num_sbs, base_vf_cid, base_vf_cid + 1024, base_cxt); } else { } bnx2x_iov_static_resc(bp, vf); vf->filter_state = 0UL; vf->sp_cl_id = (bp->fp)->cl_id; vf->mcast_list_len = 0; bnx2x_init_mcast_obj(bp, & vf->mcast_obj, 255, 255U, 255, 255, (bp->vfdb)->sp_dma.addr + ((unsigned long )vf->index * 1360UL + 792UL), ((bp->vfdb)->sp_dma.mapping + (unsigned long long )((unsigned long )vf->index * 1360UL)) + 792ULL, 9, & vf->filter_state, 2); __y = 8; ((struct bnx2x_vf_mbx *)(& (bp->vfdb)->mbxs) + (unsigned long )vfid)->msg = (struct bnx2x_vf_mbx_msg *)(bp->vfdb)->mbx_dma.addr + (unsigned long )vfid * ((((unsigned long )(__y + -1) + 2048UL) / (unsigned long )__y) * (unsigned long )__y); __y___0 = 8; ((struct bnx2x_vf_mbx *)(& (bp->vfdb)->mbxs) + (unsigned long )vfid)->msg_mapping = (bp->vfdb)->mbx_dma.mapping + (unsigned long long )((unsigned long )vfid * ((((unsigned long )(__y___0 + -1) + 2048UL) / (unsigned long )__y___0) * (unsigned long )__y___0)); bnx2x_vf_enable_mbx(bp, (int )vf->abs_vfid); vfid = vfid + 1; ldv_52987: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > vfid) { goto ldv_52986; } else { } vfid = 0; goto ldv_52991; ldv_52990: vf___0 = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )vfid : (struct bnx2x_virtf *)0; tmp___2 = bnx2x_vf_bus(bp, vfid); vf___0->bus = (unsigned int )tmp___2; tmp___3 = bnx2x_vf_devfn(bp, vfid); vf___0->devfn = (unsigned int )tmp___3; bnx2x_vf_set_bars(bp, vf___0); tmp___4 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___4 != 0L) { printk("\r[%s:%d(%s)]VF info[%d]: bus 0x%x, devfn 0x%x, bar0 [0x%x, %d], bar1 [0x%x, %d], bar2 [0x%x, %d]\n", "bnx2x_iov_nic_init", 1663, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf___0->abs_vfid, vf___0->bus, vf___0->devfn, (unsigned int )vf___0->bars[0].bar, vf___0->bars[0].size, (unsigned int )vf___0->bars[1].bar, vf___0->bars[1].size, (unsigned int )vf___0->bars[2].bar, vf___0->bars[2].size); } else { } vfid = vfid + 1; ldv_52991: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > vfid) { goto ldv_52990; } else { } return (0); } } int bnx2x_iov_chip_cleanup(struct bnx2x *bp ) { int i ; { if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return (0); } else { } i = 0; goto ldv_52998; ldv_52997: bnx2x_vf_release(bp, (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )i : (struct bnx2x_virtf *)0); i = i + 1; ldv_52998: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > i) { goto ldv_52997; } else { } return (0); } } int bnx2x_iov_init_ilt(struct bnx2x *bp , u16 line ) { int i ; struct bnx2x_ilt *ilt ; struct hw_dma *hw_cxt ; { ilt = bp->ilt; if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return ((int )line); } else { } i = 0; goto ldv_53008; ldv_53007: hw_cxt = (struct hw_dma *)(& (bp->vfdb)->context) + (unsigned long )i; (ilt->lines + (unsigned long )((int )line + i))->page = hw_cxt->addr; (ilt->lines + (unsigned long )((int )line + i))->page_mapping = hw_cxt->mapping; (ilt->lines + (unsigned long )((int )line + i))->size = (u32 )hw_cxt->size; i = i + 1; ldv_53008: ; if ((unsigned int )i <= 31U) { goto ldv_53007; } else { } return ((int )line + i); } } static u8 bnx2x_iov_is_vf_cid(struct bnx2x *bp , u16 cid ) { { return ((u8 )((unsigned int )cid > 1023U && (int )cid + -1024 <= 1023)); } } static void bnx2x_vf_handle_classification_eqe(struct bnx2x *bp , struct bnx2x_vf_queue *vfq , union event_ring_elem *elem ) { unsigned long ramrod_flags ; int rc ; long tmp ; { ramrod_flags = 0UL; rc = 0; set_bit(6L, (unsigned long volatile *)(& ramrod_flags)); switch (elem->message.data.eth_event.echo >> 17) { case 0U: rc = (*(vfq->mac_obj.complete))(bp, & vfq->mac_obj, elem, & ramrod_flags); goto ldv_53022; case 1U: rc = (*(vfq->vlan_obj.complete))(bp, & vfq->vlan_obj, elem, & ramrod_flags); goto ldv_53022; default: printk("\v[%s:%d(%s)]Unsupported classification command: %d\n", "bnx2x_vf_handle_classification_eqe", 1732, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", elem->message.data.eth_event.echo); return; } ldv_53022: ; if (rc < 0) { printk("\v[%s:%d(%s)]Failed to schedule new commands: %d\n", "bnx2x_vf_handle_classification_eqe", 1736, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else if (rc > 0) { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]Scheduled next pending commands...\n", "bnx2x_vf_handle_classification_eqe", 1738, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } } else { } return; } } static void bnx2x_vf_handle_mcast_eqe(struct bnx2x *bp , struct bnx2x_virtf *vf ) { struct bnx2x_mcast_ramrod_params rparam ; int rc ; bool tmp ; { rparam.mcast_obj = (struct bnx2x_mcast_obj *)0; rparam.ramrod_flags = 0UL; rparam.mcast_list.next = 0; rparam.mcast_list.prev = 0; rparam.mcast_list_len = 0; rparam.mcast_obj = & vf->mcast_obj; (*(vf->mcast_obj.raw.clear_pending))(& vf->mcast_obj.raw); tmp = (*(vf->mcast_obj.check_pending))(& vf->mcast_obj); if ((int )tmp) { rc = bnx2x_config_mcast(bp, & rparam, 1); if (rc < 0) { printk("\v[%s:%d(%s)]Failed to send pending mcast commands: %d\n", "bnx2x_vf_handle_mcast_eqe", 1756, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); } else { } } else { } return; } } static void bnx2x_vf_handle_filters_eqe(struct bnx2x *bp , struct bnx2x_virtf *vf ) { { __asm__ volatile ("": : : "memory"); clear_bit(3L, (unsigned long volatile *)(& vf->filter_state)); __asm__ volatile ("": : : "memory"); return; } } static void bnx2x_vf_handle_rss_update_eqe(struct bnx2x *bp , struct bnx2x_virtf *vf ) { { (*(vf->rss_conf_obj.raw.clear_pending))(& vf->rss_conf_obj.raw); return; } } int bnx2x_iov_eq_sp_event(struct bnx2x *bp , union event_ring_elem *elem ) { struct bnx2x_virtf *vf ; int qidx ; int abs_vfid ; u8 opcode ; u16 cid ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; u8 tmp___3 ; long tmp___4 ; struct bnx2x_vf_queue *tmp___5 ; struct bnx2x_vf_queue *tmp___6 ; long tmp___7 ; struct bnx2x_vf_queue *tmp___8 ; long tmp___9 ; long tmp___10 ; long tmp___11 ; { qidx = 0; cid = 65535U; if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return (1); } else { } opcode = elem->message.opcode; switch ((int )opcode) { case 3: cid = (u16 )elem->message.data.cfc_del_event.cid; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]checking cfc-del comp cid=%d\n", "bnx2x_iov_eq_sp_event", 1794, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cid); } else { } goto ldv_53052; case 15: ; case 17: ; case 16: ; case 11: cid = (u16 )elem->message.data.eth_event.echo; tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]checking filtering comp cid=%d\n", "bnx2x_iov_eq_sp_event", 1802, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cid); } else { } goto ldv_53052; case 8: abs_vfid = (int )elem->message.data.vf_flr_event.vf_id; tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]Got VF FLR notification abs_vfid=%d\n", "bnx2x_iov_eq_sp_event", 1807, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", abs_vfid); } else { } goto get_vf; case 9: abs_vfid = (int )elem->message.data.malicious_vf_event.vf_id; printk("\v[%s:%d(%s)]Got VF MALICIOUS notification abs_vfid=%d err_id=0x%x\n", "bnx2x_iov_eq_sp_event", 1813, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", abs_vfid, (int )elem->message.data.malicious_vf_event.err_id); goto get_vf; default: ; return (1); } ldv_53052: tmp___3 = bnx2x_iov_is_vf_cid(bp, (int )cid); if ((unsigned int )tmp___3 == 0U) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]cid is outside vf range: %d\n", "bnx2x_iov_eq_sp_event", 1821, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cid); } else { } return (1); } else { } qidx = (int )cid & 15; abs_vfid = ((int )cid >> 4) & 63; get_vf: vf = bnx2x_vf_by_abs_fid(bp, (int )((u16 )abs_vfid)); if ((unsigned long )vf == (unsigned long )((struct bnx2x_virtf *)0)) { printk("\v[%s:%d(%s)]EQ completion for unknown VF, cid %d, abs_vfid %d\n", "bnx2x_iov_eq_sp_event", 1836, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )cid, abs_vfid); return (0); } else { } switch ((int )opcode) { case 3: tmp___4 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___4 != 0L) { printk("\r[%s:%d(%s)]got VF [%d:%d] cfc delete ramrod\n", "bnx2x_iov_eq_sp_event", 1843, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qidx); } else { } tmp___5 = vfq_get(vf, (int )((u8 )qidx)); tmp___6 = vfq_get(vf, (int )((u8 )qidx)); (*(tmp___5->sp_obj.complete_cmd))(bp, & tmp___6->sp_obj, 8); goto ldv_53062; case 15: tmp___7 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___7 != 0L) { printk("\r[%s:%d(%s)]got VF [%d:%d] set mac/vlan ramrod\n", "bnx2x_iov_eq_sp_event", 1851, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qidx); } else { } tmp___8 = vfq_get(vf, (int )((u8 )qidx)); bnx2x_vf_handle_classification_eqe(bp, tmp___8, elem); goto ldv_53062; case 17: tmp___9 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___9 != 0L) { printk("\r[%s:%d(%s)]got VF [%d:%d] set mcast ramrod\n", "bnx2x_iov_eq_sp_event", 1856, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qidx); } else { } bnx2x_vf_handle_mcast_eqe(bp, vf); goto ldv_53062; case 16: tmp___10 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___10 != 0L) { printk("\r[%s:%d(%s)]got VF [%d:%d] set rx-mode ramrod\n", "bnx2x_iov_eq_sp_event", 1861, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qidx); } else { } bnx2x_vf_handle_filters_eqe(bp, vf); goto ldv_53062; case 11: tmp___11 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___11 != 0L) { printk("\r[%s:%d(%s)]got VF [%d:%d] RSS update ramrod\n", "bnx2x_iov_eq_sp_event", 1866, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qidx); } else { } bnx2x_vf_handle_rss_update_eqe(bp, vf); case 8: ; case 9: ; return (0); } ldv_53062: ; return (0); } } static struct bnx2x_virtf *bnx2x_vf_by_cid(struct bnx2x *bp , int vf_cid ) { int abs_vfid ; struct bnx2x_virtf *tmp ; { abs_vfid = (vf_cid >> 4) & 63; tmp = bnx2x_vf_by_abs_fid(bp, (int )((u16 )abs_vfid)); return (tmp); } } void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp , int vf_cid , struct bnx2x_queue_sp_obj **q_obj ) { struct bnx2x_virtf *vf ; int q_index ; { if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return; } else { } vf = bnx2x_vf_by_cid(bp, vf_cid); if ((unsigned long )vf != (unsigned long )((struct bnx2x_virtf *)0)) { q_index = vf_cid & 15; *q_obj = & (vf->vfqs + (unsigned long )q_index)->sp_obj; } else { printk("\v[%s:%d(%s)]No vf matching cid %d\n", "bnx2x_iov_set_queue_sp_obj", 1905, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vf_cid); } return; } } void bnx2x_iov_adjust_stats_req(struct bnx2x *bp ) { int i ; int first_queue_query_index ; int num_queues_req ; dma_addr_t cur_data_offset ; struct stats_query_entry *cur_query_entry ; u8 stats_count ; bool is_fcoe ; long tmp ; int j ; struct bnx2x_virtf *vf ; long tmp___0 ; long tmp___1 ; struct bnx2x_vf_queue *rxq ; struct bnx2x_vf_queue *tmp___2 ; dma_addr_t q_stats_addr ; int tmp___3 ; long tmp___4 ; { stats_count = 0U; is_fcoe = 0; if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return; } else { } if ((bp->flags & 32768U) == 0U) { is_fcoe = 1; } else { } num_queues_req = (int )(bp->num_ethernet_queues + (uint )is_fcoe); first_queue_query_index = (int )is_fcoe ? 3 : 2; tmp = ldv__builtin_expect((bp->msg_enable & 8519680) == 8519680, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]BNX2X_NUM_ETH_QUEUES %d, is_fcoe %d, first_queue_query_index %d => determined the last non virtual statistics query index is %d. Will add queries on top of that\n", "bnx2x_iov_adjust_stats_req", 1932, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->num_ethernet_queues, (int )is_fcoe, first_queue_query_index, first_queue_query_index + num_queues_req); } else { } cur_data_offset = (bp->fw_stats_data_mapping + (unsigned long long )((unsigned long )num_queues_req * 152UL)) + 128ULL; cur_query_entry = (struct stats_query_entry *)(& (bp->fw_stats_req)->query) + (unsigned long )(first_queue_query_index + num_queues_req); i = 0; goto ldv_53103; ldv_53102: vf = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )i : (struct bnx2x_virtf *)0; if ((unsigned int )vf->state != 2U) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8519680) == 8519680, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]vf %d not enabled so no stats for it\n", "bnx2x_iov_adjust_stats_req", 1948, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } goto ldv_53095; } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]add addresses for vf %d\n", "bnx2x_iov_adjust_stats_req", 1952, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } j = 0; goto ldv_53101; ldv_53100: tmp___2 = vfq_get(vf, (int )((u8 )j)); rxq = tmp___2; q_stats_addr = vf->fw_stat_map + (dma_addr_t )((int )vf->stats_stride * j); tmp___3 = bnx2x_get_q_logical_state(bp, & rxq->sp_obj); if (tmp___3 == 1) { goto ldv_53098; } else { } cur_query_entry->kind = 0U; cur_query_entry->index = vfq_stat_id(vf, rxq); cur_query_entry->funcID = (unsigned int )((unsigned short )vf->abs_vfid) + 8U; cur_query_entry->address.hi = (unsigned int )(q_stats_addr >> 32); cur_query_entry->address.lo = (unsigned int )q_stats_addr; tmp___4 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___4 != 0L) { printk("\r[%s:%d(%s)]added address %x %x for vf %d queue %d client %d\n", "bnx2x_iov_adjust_stats_req", 1977, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", cur_query_entry->address.hi, cur_query_entry->address.lo, (int )cur_query_entry->funcID, j, (int )cur_query_entry->index); } else { } cur_query_entry = cur_query_entry + 1; cur_data_offset = cur_data_offset + 152ULL; stats_count = (u8 )((int )stats_count + 1); if (((int )vf->cfg_flags & 64) != 0) { goto ldv_53099; } else { } ldv_53098: j = j + 1; ldv_53101: ; if ((int )vf->alloc_resc.num_rxqs > j) { goto ldv_53100; } else { } ldv_53099: ; ldv_53095: i = i + 1; ldv_53103: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > i) { goto ldv_53102; } else { } (bp->fw_stats_req)->hdr.cmd_num = (int )bp->fw_stats_num + (int )stats_count; return; } } static void bnx2x_vf_qtbl_set_q(struct bnx2x *bp , u8 abs_vfid , u8 qid , u8 enable ) { u32 reg ; u32 val ; { reg = (u32 )(((int )qid + 265472) * 4); val = (unsigned int )enable != 0U ? (unsigned int )abs_vfid | 64U : 0U; writel(val, (void volatile *)bp->regview + (unsigned long )reg); return; } } static void bnx2x_vf_clr_qtbl(struct bnx2x *bp , struct bnx2x_virtf *vf ) { int i ; struct bnx2x_vf_queue *tmp ; u8 tmp___0 ; { i = 0; goto ldv_53119; ldv_53118: tmp = vfq_get(vf, (int )((u8 )i)); tmp___0 = vfq_qzone_id___0(vf, tmp); bnx2x_vf_qtbl_set_q(bp, (int )vf->abs_vfid, (int )tmp___0, 0); i = i + 1; ldv_53119: ; if ((int )vf->alloc_resc.num_rxqs > i) { goto ldv_53118; } else { } return; } } static void bnx2x_vf_igu_disable(struct bnx2x *bp , struct bnx2x_virtf *vf ) { u32 val ; { bnx2x_pretend_func(bp, (int )((unsigned short )((int )((short )((unsigned int )bp->pf_num | 8U)) | (int )((short )((int )vf->abs_vfid << 4))))); val = readl((void const volatile *)bp->regview + 1245552U); val = val & 4294967264U; writel(val, (void volatile *)bp->regview + 1245552U); bnx2x_pretend_func(bp, (int )bp->pf_num); return; } } u8 bnx2x_vf_max_queue_cnt(struct bnx2x *bp , struct bnx2x_virtf *vf ) { u8 __min1 ; u8 __min1___0 ; u8 __min2 ; u8 __min2___0 ; { __min1___0 = vf->alloc_resc.num_sbs; __min2 = 16U; __min1 = (u8 )((int )__min1___0 < (int )__min2 ? __min1___0 : __min2); __min2___0 = 16U; return ((u8 )((int )__min1 < (int )__min2___0 ? __min1 : __min2___0)); } } static int bnx2x_vf_chk_avail_resc(struct bnx2x *bp , struct bnx2x_virtf *vf , struct vf_pf_resc_request *req_resc ) { u8 rxq_cnt ; u8 tmp ; int tmp___0 ; u8 txq_cnt ; u8 tmp___1 ; int tmp___2 ; { if ((int )vf->alloc_resc.num_rxqs != 0) { tmp___0 = (u8 )((int )vf->alloc_resc.num_rxqs); } else { tmp = bnx2x_vf_max_queue_cnt(bp, vf); tmp___0 = tmp; } rxq_cnt = tmp___0; if ((int )vf->alloc_resc.num_txqs != 0) { tmp___2 = (u8 )((int )vf->alloc_resc.num_txqs); } else { tmp___1 = bnx2x_vf_max_queue_cnt(bp, vf); tmp___2 = tmp___1; } txq_cnt = tmp___2; return (((((int )req_resc->num_rxqs <= (int )rxq_cnt && (int )req_resc->num_txqs <= (int )txq_cnt) && (int )req_resc->num_sbs <= (int )vf->alloc_resc.num_sbs) && (int )req_resc->num_mac_filters <= (int )vf->alloc_resc.num_mac_filters) && (int )req_resc->num_vlan_filters <= (int )vf->alloc_resc.num_vlan_filters + -1); } } int bnx2x_vf_acquire(struct bnx2x *bp , struct bnx2x_virtf *vf , struct vf_pf_resc_request *resc ) { int base_vf_cid ; union cdu_context *base_cxt ; int i ; long tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; u8 tmp___3 ; u8 tmp___4 ; long tmp___5 ; long tmp___6 ; struct bnx2x_vf_queue *q ; struct bnx2x_vf_queue *tmp___7 ; long tmp___8 ; { base_vf_cid = (int )(((bp->vfdb)->sriov.first_vf_in_pf + (u32 )vf->index) * 16U); base_cxt = (union cdu_context *)((struct hw_dma *)(& (bp->vfdb)->context) + (unsigned long )base_vf_cid / 32UL)->addr + ((unsigned long )base_vf_cid & 31UL); if ((unsigned int )vf->state == 1U) { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] Trying to re-acquire resources (VF was not released or FLR\'d)\n", "bnx2x_vf_acquire", 2062, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } tmp___0 = bnx2x_vf_chk_avail_resc(bp, vf, resc); if (tmp___0 == 0) { printk("\v[%s:%d(%s)]VF[%d] When re-acquiring resources, requested numbers must be <= then previously acquired numbers\n", "bnx2x_vf_acquire", 2066, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); return (-22); } else { } return (0); } else { } if ((unsigned int )vf->state != 0U && (unsigned int )vf->state != 3U) { printk("\v[%s:%d(%s)]VF[%d] Can not acquire a VF with state %d\n", "bnx2x_vf_acquire", 2075, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )vf->state); return (-22); } else { } tmp___2 = bnx2x_vf_chk_avail_resc(bp, vf, resc); if (tmp___2 == 0) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]cannot fulfill vf resource request. Placing maximal available values in response\n", "bnx2x_vf_acquire", 2085, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-12); } else { } vf->alloc_resc.num_sbs = resc->num_sbs; if ((int )resc->num_rxqs != 0) { vf->alloc_resc.num_rxqs = (u8 )((int )resc->num_rxqs); } else { tmp___3 = bnx2x_vf_max_queue_cnt(bp, vf); vf->alloc_resc.num_rxqs = tmp___3; } if ((int )resc->num_txqs != 0) { vf->alloc_resc.num_txqs = (u8 )((int )resc->num_txqs); } else { tmp___4 = bnx2x_vf_max_queue_cnt(bp, vf); vf->alloc_resc.num_txqs = tmp___4; } if ((unsigned int )resc->num_mac_filters != 0U) { vf->alloc_resc.num_mac_filters = resc->num_mac_filters; } else { } bnx2x_iov_re_set_vlan_filters(bp, vf, (int )resc->num_vlan_filters + 1); tmp___5 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___5 != 0L) { printk("\r[%s:%d(%s)]Fulfilling vf request: sb count %d, tx_count %d, rx_count %d, mac_rules_count %d, vlan_rules_count %d\n", "bnx2x_vf_acquire", 2103, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->alloc_resc.num_sbs, (int )vf->alloc_resc.num_rxqs, (int )vf->alloc_resc.num_txqs, (int )vf->alloc_resc.num_mac_filters, (int )vf->alloc_resc.num_vlan_filters + -1); } else { } if ((unsigned long )vf->vfqs == (unsigned long )((struct bnx2x_vf_queue *)0)) { tmp___6 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___6 != 0L) { printk("\r[%s:%d(%s)]vf->vfqs was not allocated\n", "bnx2x_vf_acquire", 2107, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (-22); } else { } i = 0; goto ldv_53154; ldv_53153: tmp___7 = vfq_get(vf, (int )((u8 )i)); q = tmp___7; if ((unsigned long )q == (unsigned long )((struct bnx2x_vf_queue *)0)) { printk("\v[%s:%d(%s)]q number %d was not allocated\n", "bnx2x_vf_acquire", 2115, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", i); return (-22); } else { } q->index = (u16 )i; q->cxt = & (base_cxt + (unsigned long )i)->eth; q->cid = (u32 )((base_vf_cid + 1024) + i); tmp___8 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___8 != 0L) { printk("\r[%s:%d(%s)]VFQ[%d:%d]: index %d, cid 0x%x, cxt %p\n", "bnx2x_vf_acquire", 2124, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, i, (int )q->index, q->cid, q->cxt); } else { } bnx2x_vfq_init(bp, vf, q); i = i + 1; ldv_53154: ; if ((int )vf->alloc_resc.num_rxqs > i) { goto ldv_53153; } else { } vf->state = 1U; return (0); } } int bnx2x_vf_init(struct bnx2x *bp , struct bnx2x_virtf *vf , dma_addr_t *sb_map ) { struct bnx2x_func_init_params func_init ; u16 flags ; int i ; u8 tmp ; u8 tmp___0 ; long tmp___1 ; int tmp___2 ; struct bnx2x_vf_queue *tmp___3 ; u8 tmp___4 ; { func_init.fw_stat_map = 0ULL; func_init.spq_map = 0ULL; func_init.func_flgs = (unsigned short)0; func_init.func_id = (unsigned short)0; func_init.pf_id = (unsigned short)0; func_init.spq_prod = (unsigned short)0; flags = 0U; i = 0; goto ldv_53165; ldv_53164: tmp = vf_igu_sb(vf, (int )((u16 )i)); tmp___0 = vf_igu_sb(vf, (int )((u16 )i)); bnx2x_init_sb(bp, *(sb_map + (unsigned long )i), (int )vf->abs_vfid, 1, (int )tmp___0, (int )tmp); i = i + 1; ldv_53165: ; if ((int )vf->alloc_resc.num_sbs > i) { goto ldv_53164; } else { } if ((unsigned int )vf->state != 1U) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]VF[%d] is not in VF_ACQUIRED, but %d\n", "bnx2x_vf_init", 2149, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (int )vf->state); } else { } return (-22); } else { } msleep(100U); tmp___2 = bnx2x_vf_flr_clnup_epilog(bp, (int )vf->abs_vfid); if (tmp___2 != 0) { return (-16); } else { } writel(0U, (void volatile *)bp->regview + (unsigned long )(((int )vf->abs_vfid + 311808) * 4)); if ((int )vf->cfg_flags & 1) { flags = (u16 )((unsigned int )flags | 18U); } else { } if (((int )vf->cfg_flags & 4) != 0) { flags = (u16 )((unsigned int )flags | 8U); } else { } if ((unsigned int )vf->alloc_resc.num_rxqs > 1U) { flags = (u16 )((unsigned int )flags | 1U); } else { } func_init.func_flgs = flags; func_init.pf_id = (u16 )bp->pfid; func_init.func_id = (unsigned int )((u16 )vf->abs_vfid) + 8U; func_init.fw_stat_map = vf->fw_stat_map; func_init.spq_map = vf->spq_map; func_init.spq_prod = 0U; bnx2x_func_init(bp, & func_init); bnx2x_vf_enable_access(bp, (int )vf->abs_vfid); bnx2x_vf_enable_traffic(bp, vf); i = 0; goto ldv_53169; ldv_53168: tmp___3 = vfq_get(vf, (int )((u8 )i)); tmp___4 = vfq_qzone_id___0(vf, tmp___3); bnx2x_vf_qtbl_set_q(bp, (int )vf->abs_vfid, (int )tmp___4, 1); i = i + 1; ldv_53169: ; if ((int )vf->alloc_resc.num_rxqs > i) { goto ldv_53168; } else { } vf->state = 2U; bnx2x_post_vf_bulletin(bp, (int )vf->index); return (0); } } static void bnx2x_set_vf_state(void *cookie ) { struct set_vf_state_cookie *p ; { p = (struct set_vf_state_cookie *)cookie; (p->vf)->state = p->state; return; } } int bnx2x_vf_close(struct bnx2x *bp , struct bnx2x_virtf *vf ) { int rc ; int i ; long tmp ; long tmp___0 ; long tmp___1 ; struct set_vf_state_cookie cookie ; long tmp___2 ; { rc = 0; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d]\n", "bnx2x_vf_close", 2215, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } i = 0; goto ldv_53187; ldv_53186: rc = bnx2x_vf_queue_teardown(bp, vf, i); if (rc != 0) { goto op_err; } else { } i = i + 1; ldv_53187: ; if ((int )vf->alloc_resc.num_rxqs > i) { goto ldv_53186; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]disabling igu\n", "bnx2x_vf_close", 2225, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_vf_igu_disable(bp, vf); tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]clearing qtbl\n", "bnx2x_vf_close", 2229, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_vf_clr_qtbl(bp, vf); cookie.vf = vf; cookie.state = 1U; rc = bnx2x_stats_safe_exec(bp, & bnx2x_set_vf_state, (void *)(& cookie)); if (rc != 0) { goto op_err; } else { } tmp___2 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]set state to acquired\n", "bnx2x_vf_close", 2246, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return (0); op_err: printk("\v[%s:%d(%s)]vf[%d] CLOSE error: rc %d\n", "bnx2x_vf_close", 2250, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, rc); return (rc); } } int bnx2x_vf_free(struct bnx2x *bp , struct bnx2x_virtf *vf ) { int rc ; long tmp ; long tmp___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]VF[%d] STATE: %s\n", "bnx2x_vf_free", 2267, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (unsigned int )vf->state != 0U ? ((unsigned int )vf->state != 1U ? ((unsigned int )vf->state != 2U ? ((unsigned int )vf->state == 3U ? (char *)"Reset" : (char *)"Unknown") : (char *)"Enabled") : (char *)"Acquired") : (char *)"Free"); } else { } switch ((int )vf->state) { case 2: rc = bnx2x_vf_close(bp, vf); if (rc != 0) { goto op_err; } else { } case 1: tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]about to free resources\n", "bnx2x_vf_free", 2276, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_vf_free_resc(bp, vf); goto ldv_53199; case 0: ; case 3: ; default: ; goto ldv_53199; } ldv_53199: ; return (0); op_err: printk("\v[%s:%d(%s)]VF[%d] RELEASE error: rc %d\n", "bnx2x_vf_free", 2287, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, rc); return (rc); } } int bnx2x_vf_rss_update(struct bnx2x *bp , struct bnx2x_virtf *vf , struct bnx2x_config_rss_params *rss ) { long tmp ; int tmp___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d]\n", "bnx2x_vf_rss_update", 2294, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } set_bit(2L, (unsigned long volatile *)(& rss->ramrod_flags)); tmp___0 = bnx2x_config_rss(bp, rss); return (tmp___0); } } int bnx2x_vf_tpa_update(struct bnx2x *bp , struct bnx2x_virtf *vf , struct vfpf_tpa_tlv *tlv , struct bnx2x_queue_update_tpa_params *params ) { __u64 *sge_addr ; struct bnx2x_queue_state_params qstate ; int qid ; int rc ; long tmp ; long tmp___0 ; { sge_addr = (__u64 *)(& tlv->tpa_client_info.sge_addr); rc = 0; tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]vf[%d]\n", "bnx2x_vf_tpa_update", 2307, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } memset((void *)(& qstate), 0, 136UL); memcpy((void *)(& qstate.params.update_tpa), (void const *)params, 24UL); qstate.cmd = 6; set_bit(2L, (unsigned long volatile *)(& qstate.ramrod_flags)); qid = 0; goto ldv_53221; ldv_53220: qstate.q_obj = & (vf->vfqs + (unsigned long )qid)->sp_obj; qstate.params.update_tpa.sge_map = *(sge_addr + (unsigned long )qid); tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]sge_addr[%d:%d] %08x:%08x\n", "bnx2x_vf_tpa_update", 2321, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, qid, (unsigned int )(*(sge_addr + (unsigned long )qid) >> 32), (unsigned int )*(sge_addr + (unsigned long )qid)); } else { } rc = bnx2x_queue_state_change(bp, & qstate); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to configure sge_addr %08x:%08x for [%d:%d]\n", "bnx2x_vf_tpa_update", 2326, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )(*(sge_addr + (unsigned long )qid) >> 32), (unsigned int )*(sge_addr + (unsigned long )qid), (int )vf->abs_vfid, qid); return (rc); } else { } qid = qid + 1; ldv_53221: ; if ((int )vf->alloc_resc.num_rxqs > qid) { goto ldv_53220; } else { } return (rc); } } int bnx2x_vf_release(struct bnx2x *bp , struct bnx2x_virtf *vf ) { int rc ; long tmp ; int __ret_warn_on ; long tmp___0 ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]PF releasing vf %d\n", "bnx2x_vf_release", 2342, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid); } else { } bnx2x_lock_vf_pf_channel(bp, vf, 11); rc = bnx2x_vf_free(bp, vf); if (rc != 0) { __ret_warn_on = rc != 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_fmt("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c", 2349, "VF[%d] Failed to allocate resources for release op- rc=%d\n", (int )vf->abs_vfid, rc); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } bnx2x_unlock_vf_pf_channel(bp, vf, 11); return (rc); } } void bnx2x_lock_vf_pf_channel(struct bnx2x *bp , struct bnx2x_virtf *vf , enum channel_tlvs tlv ) { bool tmp ; int tmp___0 ; long tmp___1 ; { tmp = bnx2x_tlv_supported((int )((u16 )tlv)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { printk("\v[%s:%d(%s)]attempting to lock with unsupported tlv. Aborting\n", "bnx2x_lock_vf_pf_channel", 2359, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return; } else { } mutex_lock_nested(& vf->op_mutex, 0U); vf->op_current = tlv; tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]VF[%d]: vf pf channel locked by %d\n", "bnx2x_lock_vf_pf_channel", 2371, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (unsigned int )tlv); } else { } return; } } void bnx2x_unlock_vf_pf_channel(struct bnx2x *bp , struct bnx2x_virtf *vf , enum channel_tlvs expected_tlv ) { enum channel_tlvs current_tlv ; bool tmp ; int tmp___0 ; int __ret_warn_on ; long tmp___1 ; long tmp___2 ; { if ((unsigned long )vf == (unsigned long )((struct bnx2x_virtf *)0)) { printk("\v[%s:%d(%s)]VF was %p\n", "bnx2x_unlock_vf_pf_channel", 2380, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vf); return; } else { } current_tlv = vf->op_current; tmp = bnx2x_tlv_supported((int )((u16 )expected_tlv)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } __ret_warn_on = (unsigned int )vf->op_current != (unsigned int )expected_tlv; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_fmt("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11114/dscv_tempdir/dscv/ri/08_1a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c", 2392, "lock mismatch: expected %d found %d", (unsigned int )expected_tlv, (unsigned int )vf->op_current); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); vf->op_current = 0; mutex_unlock(& vf->op_mutex); tmp___2 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]VF[%d]: vf pf channel unlocked by %d\n", "bnx2x_unlock_vf_pf_channel", 2402, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vf->abs_vfid, (unsigned int )current_tlv); } else { } return; } } static int bnx2x_set_pf_tx_switching(struct bnx2x *bp , bool enable ) { struct bnx2x_queue_state_params q_params ; u32 prev_flags ; int i ; int rc ; int tmp ; struct bnx2x_fastpath *fp ; long tmp___0 ; { prev_flags = bp->flags; if ((int )enable) { bp->flags = bp->flags | 262144U; } else { bp->flags = bp->flags & 4294705151U; } if (bp->flags == prev_flags) { return (0); } else { } if ((unsigned int )bp->state != 12288U) { return (0); } else { tmp = bnx2x_get_q_logical_state(bp, & (bp->sp_objs + (unsigned long )(bp->fp)->index)->q_obj); if (tmp != 0) { return (0); } else { } } memset((void *)(& q_params), 0, 136UL); __set_bit(2L, (unsigned long volatile *)(& q_params.ramrod_flags)); q_params.cmd = 5; __set_bit(12L, (unsigned long volatile *)(& q_params.params.update.update_flags)); if ((int )enable) { __set_bit(13L, (unsigned long volatile *)(& q_params.params.update.update_flags)); } else { __clear_bit(13L, (unsigned long volatile *)(& q_params.params.update.update_flags)); } i = 0; goto ldv_53257; ldv_53256: fp = bp->fp + (unsigned long )i; q_params.q_obj = & (bp->sp_objs + (unsigned long )fp->index)->q_obj; rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to configure Tx switching\n", "bnx2x_set_pf_tx_switching", 2450, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (rc); } else { } i = i + 1; ldv_53257: ; if ((uint )i < bp->num_ethernet_queues) { goto ldv_53256; } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]%s Tx Switching\n", "bnx2x_set_pf_tx_switching", 2455, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )enable ? (char *)"Enabled" : (char *)"Disabled"); } else { } return (0); } } int bnx2x_sriov_configure(struct pci_dev *dev , int num_vfs_param ) { struct bnx2x *bp ; void *tmp ; void *tmp___0 ; long tmp___1 ; int tmp___2 ; { tmp = pci_get_drvdata(dev); tmp___0 = netdev_priv((struct net_device const *)tmp); bp = (struct bnx2x *)tmp___0; if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { printk("\v[%s:%d(%s)]failed to configure SR-IOV since vfdb was not allocated. Check dmesg for errors in probe stage\n", "bnx2x_sriov_configure", 2464, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]bnx2x_sriov_configure called with %d, BNX2X_NR_VIRTFN(bp) was %d\n", "bnx2x_sriov_configure", 2469, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", num_vfs_param, (int )(bp->vfdb)->sriov.nr_virtfn); } else { } if ((unsigned int )bp->state != 12288U) { printk("\v[%s:%d(%s)]VF num configuration via sysfs not supported while PF is down\n", "bnx2x_sriov_configure", 2473, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } if ((int )(bp->vfdb)->sriov.nr_virtfn < num_vfs_param) { printk("\v[%s:%d(%s)]truncating requested number of VFs (%d) down to maximum allowed (%d)\n", "bnx2x_sriov_configure", 2480, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", num_vfs_param, (int )(bp->vfdb)->sriov.nr_virtfn); num_vfs_param = (int )(bp->vfdb)->sriov.nr_virtfn; } else { } bp->requested_nr_virtfn = (u16 )num_vfs_param; if (num_vfs_param == 0) { bnx2x_set_pf_tx_switching(bp, 0); bnx2x_disable_sriov(bp); return (0); } else { tmp___2 = bnx2x_enable_sriov(bp); return (tmp___2); } } } int bnx2x_enable_sriov(struct bnx2x *bp ) { int rc ; int req_vfs ; int vf_idx ; int sb_idx ; int vfq_idx ; int qcount ; int first_vf ; u32 igu_entry ; u32 address ; u16 num_vf_queues ; u16 __min1 ; u16 __min2 ; struct bnx2x_virtf *vf ; long tmp ; long tmp___0 ; struct bnx2x_virtf *vf___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { rc = 0; req_vfs = (int )bp->requested_nr_virtfn; if (req_vfs == 0) { return (0); } else { } first_vf = (int )(bp->vfdb)->sriov.first_vf_in_pf; __min1 = 16U; __min2 = (u16 )((int )(bp->vfdb)->vf_sbs_pool / req_vfs); num_vf_queues = (u16 )((int )__min1 < (int )__min2 ? __min1 : __min2); vf_idx = 0; goto ldv_53283; ldv_53282: vf = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )vf_idx : (struct bnx2x_virtf *)0; vf->sb_count = 0U; ((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )vf_idx : (struct bnx2x_virtf *)0)->alloc_resc.num_sbs = 0U; vf_idx = vf_idx + 1; ldv_53283: ; if (vf_idx < req_vfs) { goto ldv_53282; } else { } (bp->vfdb)->vf_sbs_pool = 0U; sb_idx = (int )(bp->vfdb)->first_vf_igu_entry; address = (u32 )((sb_idx + 312320) * 4); vf_idx = first_vf; goto ldv_53290; ldv_53289: vfq_idx = 0; goto ldv_53287; ldv_53286: igu_entry = (u32 )(((vf_idx << 7) | (vfq_idx << 1)) | 1); tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]assigning sb %d to vf %d\n", "bnx2x_enable_sriov", 2530, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", sb_idx, vf_idx); } else { } writel(igu_entry, (void volatile *)bp->regview + (unsigned long )address); sb_idx = sb_idx + 1; address = address + 4U; vfq_idx = vfq_idx + 1; ldv_53287: ; if ((int )num_vf_queues > vfq_idx) { goto ldv_53286; } else { } vf_idx = vf_idx + 1; ldv_53290: ; if (first_vf + req_vfs > vf_idx) { goto ldv_53289; } else { } bnx2x_get_vf_igu_cam_info(bp); tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]vf_sbs_pool %d, num_vf_queues %d\n", "bnx2x_enable_sriov", 2541, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )(bp->vfdb)->vf_sbs_pool, (int )num_vf_queues); } else { } qcount = 0; vf_idx = 0; goto ldv_53294; ldv_53293: vf___0 = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )vf_idx : (struct bnx2x_virtf *)0; vf___0->vfqs = (bp->vfdb)->vfqs + (unsigned long )qcount; qcount = (int )vf___0->alloc_resc.num_sbs + qcount; bnx2x_iov_static_resc(bp, vf___0); vf_idx = vf_idx + 1; ldv_53294: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > vf_idx) { goto ldv_53293; } else { } vf_idx = first_vf; goto ldv_53297; ldv_53296: bnx2x_pretend_func(bp, (int )((unsigned short )((int )((short )((unsigned int )bp->pf_num | 8U)) | (int )((short )((int )((unsigned short )vf_idx) << 4))))); writel((unsigned int )num_vf_queues - 1U, (void volatile *)bp->regview + 9756U); tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]set msix vec num in VF %d cfg space to %d\n", "bnx2x_enable_sriov", 2562, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vf_idx, (int )num_vf_queues + -1); } else { } vf_idx = vf_idx + 1; ldv_53297: ; if (first_vf + req_vfs > vf_idx) { goto ldv_53296; } else { } bnx2x_pretend_func(bp, (int )bp->pf_num); tmp___2 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]about to call enable sriov\n", "bnx2x_enable_sriov", 2569, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } bnx2x_disable_sriov(bp); rc = bnx2x_set_pf_tx_switching(bp, 1); if (rc != 0) { return (rc); } else { } rc = pci_enable_sriov(bp->pdev, req_vfs); if (rc != 0) { printk("\v[%s:%d(%s)]pci_enable_sriov failed with %d\n", "bnx2x_enable_sriov", 2578, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", rc); return (rc); } else { } tmp___3 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___3 != 0L) { printk("\r[%s:%d(%s)]sriov enabled (%d vfs)\n", "bnx2x_enable_sriov", 2581, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", req_vfs); } else { } return (req_vfs); } } void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp ) { int vfidx ; struct pf_vf_bulletin_content *bulletin ; long tmp ; { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]configuring vlan for VFs from sp-task\n", "bnx2x_pf_set_vfs_vlan", 2590, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } vfidx = 0; goto ldv_53306; ldv_53305: bulletin = (struct pf_vf_bulletin_content *)(bp->vfdb)->bulletin_dma.addr + (unsigned long )vfidx; if (((int )((unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )vfidx : (struct bnx2x_virtf *)0)->cfg_flags & 32) != 0) { bnx2x_set_vf_vlan(bp->dev, vfidx, (int )bulletin->vlan, 0); } else { } vfidx = vfidx + 1; ldv_53306: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > vfidx) { goto ldv_53305; } else { } return; } } void bnx2x_disable_sriov(struct bnx2x *bp ) { long tmp ; int tmp___0 ; { tmp___0 = pci_vfs_assigned(bp->pdev); if (tmp___0 != 0) { tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]Unloading driver while VFs are assigned - VFs will not be deallocated\n", "bnx2x_disable_sriov", 2602, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); } else { } return; } else { } pci_disable_sriov(bp->pdev); return; } } static int bnx2x_vf_op_prep(struct bnx2x *bp , int vfidx , struct bnx2x_virtf **vf , struct pf_vf_bulletin_content **bulletin , bool test_queue ) { { if ((unsigned int )bp->state != 12288U) { printk("\v[%s:%d(%s)]PF is down - can\'t utilize iov-related functionality\n", "bnx2x_vf_op_prep", 2615, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { printk("\v[%s:%d(%s)]sriov is disabled - can\'t utilize iov-related functionality\n", "bnx2x_vf_op_prep", 2620, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } if ((int )(bp->vfdb)->sriov.nr_virtfn <= vfidx) { printk("\v[%s:%d(%s)]VF is uninitialized - can\'t utilize iov-related functionality. vfidx was %d BNX2X_NR_VIRTFN was %d\n", "bnx2x_vf_op_prep", 2626, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vfidx, (int )(bp->vfdb)->sriov.nr_virtfn); return (-22); } else { } *vf = (unsigned long )bp->vfdb != (unsigned long )((struct bnx2x_vfdb *)0) && (unsigned long )(bp->vfdb)->vfs != (unsigned long )((struct bnx2x_virtf *)0) ? (bp->vfdb)->vfs + (unsigned long )vfidx : (struct bnx2x_virtf *)0; *bulletin = (struct pf_vf_bulletin_content *)(bp->vfdb)->bulletin_dma.addr + (unsigned long )vfidx; if ((unsigned long )*vf == (unsigned long )((struct bnx2x_virtf *)0)) { printk("\v[%s:%d(%s)]Unable to get VF structure for vfidx %d\n", "bnx2x_vf_op_prep", 2635, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vfidx); return (-22); } else { } if ((int )test_queue && (unsigned long )(*vf)->vfqs == (unsigned long )((struct bnx2x_vf_queue *)0)) { printk("\v[%s:%d(%s)]vfqs struct is null. Was this invoked before dynamically enabling SR-IOV? vfidx was %d\n", "bnx2x_vf_op_prep", 2641, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vfidx); return (-22); } else { } if ((unsigned long )*bulletin == (unsigned long )((struct pf_vf_bulletin_content *)0)) { printk("\v[%s:%d(%s)]Bulletin Board struct is null for vfidx %d\n", "bnx2x_vf_op_prep", 2647, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vfidx); return (-22); } else { } return (0); } } int bnx2x_get_vf_config(struct net_device *dev , int vfidx , struct ifla_vf_info *ivi ) { struct bnx2x *bp ; void *tmp ; struct bnx2x_virtf *vf ; struct pf_vf_bulletin_content *bulletin ; struct bnx2x_vlan_mac_obj *mac_obj ; struct bnx2x_vlan_mac_obj *vlan_obj ; int rc ; bool tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; vf = (struct bnx2x_virtf *)0; bulletin = (struct pf_vf_bulletin_content *)0; rc = bnx2x_vf_op_prep(bp, vfidx, & vf, & bulletin, 1); if (rc != 0) { return (rc); } else { } mac_obj = & (vf->vfqs)->mac_obj; vlan_obj = & (vf->vfqs)->vlan_obj; if ((unsigned long )mac_obj == (unsigned long )((struct bnx2x_vlan_mac_obj *)0) || (unsigned long )vlan_obj == (unsigned long )((struct bnx2x_vlan_mac_obj *)0)) { printk("\v[%s:%d(%s)]VF partially initialized\n", "bnx2x_get_vf_config", 2672, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } ivi->vf = (__u32 )vfidx; ivi->qos = 0U; ivi->max_tx_rate = 10000U; ivi->min_tx_rate = 0U; ivi->spoofchk = 1U; if ((unsigned int )vf->state == 2U) { tmp___0 = bnx2x_validate_vf_sp_objs(bp, vf, 0); if ((int )tmp___0) { (*(mac_obj->get_n_elements))(bp, mac_obj, 1, (u8 *)(& ivi->mac), 0, 6); (*(vlan_obj->get_n_elements))(bp, vlan_obj, 1, (u8 *)(& ivi->vlan), 0, 4); } else { } } else { mutex_lock_nested(& (bp->vfdb)->bulletin_mutex, 0U); if ((int )bulletin->valid_bitmap & 1) { memcpy((void *)(& ivi->mac), (void const *)(& bulletin->mac), 6UL); } else { eth_zero_addr((u8 *)(& ivi->mac)); } if ((bulletin->valid_bitmap & 2ULL) != 0ULL) { memcpy((void *)(& ivi->vlan), (void const *)(& bulletin->vlan), 4UL); } else { memset((void *)(& ivi->vlan), 0, 4UL); } mutex_unlock(& (bp->vfdb)->bulletin_mutex); } return (0); } } int bnx2x_set_vf_mac(struct net_device *dev , int vfidx , u8 *mac ) { struct bnx2x *bp ; void *tmp ; int rc ; int q_logical_state ; struct bnx2x_virtf *vf ; struct pf_vf_bulletin_content *bulletin ; bool tmp___0 ; int tmp___1 ; unsigned long ramrod_flags ; struct bnx2x_vlan_mac_obj *mac_obj ; bool tmp___2 ; int tmp___3 ; { tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; vf = (struct bnx2x_virtf *)0; bulletin = (struct pf_vf_bulletin_content *)0; tmp___0 = is_valid_ether_addr((u8 const *)mac); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { printk("\v[%s:%d(%s)]mac address invalid\n", "bnx2x_set_vf_mac", 2739, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); return (-22); } else { } rc = bnx2x_vf_op_prep(bp, vfidx, & vf, & bulletin, 1); if (rc != 0) { return (rc); } else { } mutex_lock_nested(& (bp->vfdb)->bulletin_mutex, 0U); bulletin->valid_bitmap = bulletin->valid_bitmap | 1ULL; memcpy((void *)(& bulletin->mac), (void const *)mac, 6UL); rc = bnx2x_post_vf_bulletin(bp, vfidx); mutex_unlock(& (bp->vfdb)->bulletin_mutex); if (rc != 0) { printk("\v[%s:%d(%s)]failed to update VF[%d] bulletin\n", "bnx2x_set_vf_mac", 2763, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vfidx); return (rc); } else { } q_logical_state = bnx2x_get_q_logical_state(bp, & (vf->vfqs)->sp_obj); if ((unsigned int )vf->state == 2U && q_logical_state == 0) { ramrod_flags = 0UL; tmp___2 = bnx2x_validate_vf_sp_objs(bp, vf, 1); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return (-22); } else { } bnx2x_lock_vf_pf_channel(bp, vf, 14); mac_obj = & (vf->vfqs)->mac_obj; rc = bnx2x_del_all_macs(bp, mac_obj, 1, 1); if (rc != 0) { printk("\v[%s:%d(%s)]failed to delete eth macs\n", "bnx2x_set_vf_mac", 2786, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -22; goto out; } else { } rc = bnx2x_del_all_macs(bp, mac_obj, 0, 1); if (rc != 0) { printk("\v[%s:%d(%s)]failed to delete uc_list macs\n", "bnx2x_set_vf_mac", 2794, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -22; goto out; } else { } __set_bit(2L, (unsigned long volatile *)(& ramrod_flags)); bnx2x_set_mac_one(bp, (u8 *)(& bulletin->mac), mac_obj, 1, 1, & ramrod_flags); out: bnx2x_unlock_vf_pf_channel(bp, vf, 14); } else { } return (rc); } } int bnx2x_set_vf_vlan(struct net_device *dev , int vfidx , u16 vlan , u8 qos ) { struct bnx2x_queue_state_params q_params ; struct bnx2x_vlan_mac_ramrod_params ramrod_param ; struct bnx2x_queue_update_params *update_params ; struct pf_vf_bulletin_content *bulletin ; struct bnx2x_rx_mode_ramrod_params rx_ramrod ; struct bnx2x *bp ; void *tmp ; struct bnx2x_vlan_mac_obj *vlan_obj ; unsigned long vlan_mac_flags ; unsigned long ramrod_flags ; struct bnx2x_virtf *vf ; unsigned long accept_flags ; int rc ; long tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; { q_params.q_obj = (struct bnx2x_queue_sp_obj *)0; q_params.cmd = 0; q_params.ramrod_flags = 0UL; q_params.params.setup.gen_params.stat_id = (unsigned char)0; q_params.params.setup.gen_params.spcl_id = (unsigned char)0; q_params.params.setup.gen_params.mtu = (unsigned short)0; q_params.params.setup.gen_params.cos = (unsigned char)0; q_params.params.setup.gen_params.fp_hsi = (unsigned char)0; q_params.params.setup.txq_params.dscr_map = 0ULL; q_params.params.setup.txq_params.fw_sb_id = (unsigned char)0; q_params.params.setup.txq_params.sb_cq_index = (unsigned char)0; q_params.params.setup.txq_params.cos = (unsigned char)0; q_params.params.setup.txq_params.traffic_type = (unsigned short)0; q_params.params.setup.txq_params.tss_leading_cl_id = (unsigned char)0; q_params.params.setup.txq_params.default_vlan = (unsigned short)0; q_params.params.setup.rxq_params.dscr_map = 0ULL; q_params.params.setup.rxq_params.sge_map = 0ULL; q_params.params.setup.rxq_params.rcq_map = 0ULL; q_params.params.setup.rxq_params.rcq_np_map = 0ULL; q_params.params.setup.rxq_params.drop_flags = (unsigned short)0; q_params.params.setup.rxq_params.buf_sz = (unsigned short)0; q_params.params.setup.rxq_params.fw_sb_id = (unsigned char)0; q_params.params.setup.rxq_params.cl_qzone_id = (unsigned char)0; q_params.params.setup.rxq_params.tpa_agg_sz = (unsigned short)0; q_params.params.setup.rxq_params.sge_buf_sz = (unsigned short)0; q_params.params.setup.rxq_params.max_sges_pkt = (unsigned char)0; q_params.params.setup.rxq_params.max_tpa_queues = (unsigned char)0; q_params.params.setup.rxq_params.rss_engine_id = (unsigned char)0; q_params.params.setup.rxq_params.mcast_engine_id = (unsigned char)0; q_params.params.setup.rxq_params.cache_line_log = (unsigned char)0; q_params.params.setup.rxq_params.sb_cq_index = (unsigned char)0; q_params.params.setup.rxq_params.silent_removal_value = (unsigned short)0; q_params.params.setup.rxq_params.silent_removal_mask = (unsigned short)0; q_params.params.setup.pause_params.bd_th_lo = (unsigned short)0; q_params.params.setup.pause_params.bd_th_hi = (unsigned short)0; q_params.params.setup.pause_params.rcq_th_lo = (unsigned short)0; q_params.params.setup.pause_params.rcq_th_hi = (unsigned short)0; q_params.params.setup.pause_params.sge_th_lo = (unsigned short)0; q_params.params.setup.pause_params.sge_th_hi = (unsigned short)0; q_params.params.setup.pause_params.pri_map = (unsigned short)0; q_params.params.setup.flags = 0UL; bulletin = (struct pf_vf_bulletin_content *)0; tmp = netdev_priv((struct net_device const *)dev); bp = (struct bnx2x *)tmp; vlan_mac_flags = 0UL; ramrod_flags = 0UL; vf = (struct bnx2x_virtf *)0; if ((unsigned int )vlan > 4095U) { printk("\v[%s:%d(%s)]illegal vlan value %d\n", "bnx2x_set_vf_vlan", 2827, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )vlan); return (-22); } else { } tmp___0 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]configuring VF %d with VLAN %d qos %d\n", "bnx2x_set_vf_vlan", 2832, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", vfidx, (int )vlan, 0); } else { } rc = bnx2x_vf_op_prep(bp, vfidx, & vf, & bulletin, 1); if (rc != 0) { return (rc); } else { } mutex_lock_nested(& (bp->vfdb)->bulletin_mutex, 0U); if ((unsigned int )vlan != 0U) { bulletin->valid_bitmap = bulletin->valid_bitmap | 2ULL; } else { bulletin->valid_bitmap = bulletin->valid_bitmap & 0xfffffffffffffffdULL; } bulletin->vlan = vlan; mutex_unlock(& (bp->vfdb)->bulletin_mutex); if ((unsigned int )vf->state != 2U) { return (rc); } else { tmp___1 = bnx2x_get_q_logical_state(bp, & (vf->vfqs)->sp_obj); if (tmp___1 != 0) { return (rc); } else { } } tmp___2 = bnx2x_validate_vf_sp_objs(bp, vf, 1); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return (-22); } else { } bnx2x_lock_vf_pf_channel(bp, vf, 15); __set_bit(2L, (unsigned long volatile *)(& ramrod_flags)); vlan_obj = & (vf->vfqs)->vlan_obj; rc = (*(vlan_obj->delete_all))(bp, vlan_obj, & vlan_mac_flags, & ramrod_flags); if (rc != 0) { printk("\v[%s:%d(%s)]failed to delete vlans\n", "bnx2x_set_vf_vlan", 2874, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -22; goto out; } else { } accept_flags = (vf->vfqs)->accept_flags; if ((unsigned int )vlan != 0U) { clear_bit(6L, (unsigned long volatile *)(& accept_flags)); } else { set_bit(6L, (unsigned long volatile *)(& accept_flags)); } bnx2x_vf_prep_rx_mode(bp, 0, & rx_ramrod, vf, accept_flags); (vf->vfqs)->accept_flags = accept_flags; bnx2x_config_rx_mode(bp, & rx_ramrod); memset((void *)(& ramrod_param), 0, 56UL); __set_bit(2L, (unsigned long volatile *)(& ramrod_flags)); ramrod_param.vlan_mac_obj = vlan_obj; ramrod_param.ramrod_flags = ramrod_flags; set_bit(4L, (unsigned long volatile *)(& ramrod_param.user_req.vlan_mac_flags)); ramrod_param.user_req.u.vlan.vlan = vlan; ramrod_param.user_req.cmd = 0; rc = bnx2x_config_vlan_mac(bp, & ramrod_param); if (rc != 0) { printk("\v[%s:%d(%s)]failed to configure vlan\n", "bnx2x_set_vf_vlan", 2902, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); rc = -22; goto out; } else { } __set_bit(2L, (unsigned long volatile *)(& q_params.ramrod_flags)); q_params.cmd = 5; q_params.q_obj = & (vf->vfqs)->sp_obj; update_params = & q_params.params.update; __set_bit(9L, (unsigned long volatile *)(& update_params->update_flags)); __set_bit(10L, (unsigned long volatile *)(& update_params->update_flags)); if ((unsigned int )vlan == 0U) { __clear_bit(8L, (unsigned long volatile *)(& update_params->update_flags)); __clear_bit(11L, (unsigned long volatile *)(& update_params->update_flags)); } else { __set_bit(8L, (unsigned long volatile *)(& update_params->update_flags)); __set_bit(11L, (unsigned long volatile *)(& update_params->update_flags)); update_params->def_vlan = vlan; update_params->silent_removal_value = (unsigned int )vlan & 4095U; update_params->silent_removal_mask = 4095U; } rc = bnx2x_queue_state_change(bp, & q_params); if (rc != 0) { printk("\v[%s:%d(%s)]Failed to configure default VLAN\n", "bnx2x_set_vf_vlan", 2944, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?"); goto out; } else { } out: vf->cfg_flags = (unsigned int )vf->cfg_flags & 65503U; bnx2x_unlock_vf_pf_channel(bp, vf, 15); return (rc); } } u32 bnx2x_crc_vf_bulletin(struct pf_vf_bulletin_content *bulletin ) { u32 tmp ; { tmp = crc32_le(0U, (unsigned char const *)bulletin + 4U, (unsigned long )bulletin->length - 4UL); return (tmp); } } enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp ) { struct pf_vf_bulletin_content *bulletin ; int attempts ; u32 crc ; bool tmp ; int tmp___0 ; long tmp___1 ; { attempts = 0; goto ldv_53378; ldv_53377: memcpy((void *)(& bp->shadow_bulletin), (void const *)bp->pf2vf_bulletin, 512UL); crc = bnx2x_crc_vf_bulletin(& bp->shadow_bulletin.content); if (bp->shadow_bulletin.content.crc == crc) { goto ldv_53375; } else { } printk("\v[%s:%d(%s)]bad crc on bulletin board. Contained %x computed %x\n", "bnx2x_sample_bulletin", 2995, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->shadow_bulletin.content.crc, crc); attempts = attempts + 1; ldv_53378: ; if (attempts <= 4) { goto ldv_53377; } else { } ldv_53375: ; if (attempts > 4) { printk("\v[%s:%d(%s)]pf to vf bulletin board crc was wrong %d consecutive times. Aborting\n", "bnx2x_sample_bulletin", 3000, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", attempts); return (2); } else { } bulletin = & bp->shadow_bulletin.content; if ((int )bp->old_bulletin.version == (int )bulletin->version) { return (0); } else { } if ((int )bulletin->valid_bitmap & 1) { tmp = ether_addr_equal((u8 const *)(& bulletin->mac), (u8 const *)(& bp->old_bulletin.mac)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { memcpy((void *)(bp->dev)->dev_addr, (void const *)(& bulletin->mac), 6UL); } else { } } else { } if ((bulletin->valid_bitmap & 8ULL) != 0ULL) { tmp___1 = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp___1 != 0L) { printk("\r[%s:%d(%s)]link update speed %d flags %x\n", "bnx2x_sample_bulletin", 3018, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (int )bulletin->link_speed, bulletin->link_flags); } else { } bp->vf_link_vars.line_speed = bulletin->link_speed; bp->vf_link_vars.link_report_flags = 0UL; if ((int )bulletin->link_flags & 1) { __set_bit(1L, (unsigned long volatile *)(& bp->vf_link_vars.link_report_flags)); } else { } if ((bulletin->link_flags & 2U) != 0U) { __set_bit(0L, (unsigned long volatile *)(& bp->vf_link_vars.link_report_flags)); } else { } if ((bulletin->link_flags & 4U) != 0U) { __set_bit(2L, (unsigned long volatile *)(& bp->vf_link_vars.link_report_flags)); } else { } if ((bulletin->link_flags & 8U) != 0U) { __set_bit(3L, (unsigned long volatile *)(& bp->vf_link_vars.link_report_flags)); } else { } __bnx2x_link_report(bp); } else { } memcpy((void *)(& bp->old_bulletin), (void const *)bulletin, 48UL); return (1); } } void bnx2x_timer_sriov(struct bnx2x *bp ) { { bnx2x_sample_bulletin(bp); if ((bp->old_bulletin.valid_bitmap & 4ULL) != 0ULL) { bnx2x_schedule_sp_rtnl(bp, 6, 8388608U); } else { } return; } } void *bnx2x_vf_doorbells(struct bnx2x *bp ) { { return (bp->regview + 31744UL); } } void bnx2x_vf_pci_dealloc(struct bnx2x *bp ) { { if ((unsigned long )bp->vf2pf_mbox != (unsigned long )((struct bnx2x_vf_mbx_msg *)0)) { dma_free_attrs(& (bp->pdev)->dev, 2048UL, (void *)bp->vf2pf_mbox, bp->vf2pf_mbox_mapping, (struct dma_attrs *)0); bp->vf2pf_mbox = (struct bnx2x_vf_mbx_msg *)0; bp->vf2pf_mbox_mapping = 0ULL; } else { } if ((unsigned long )bp->vf2pf_mbox != (unsigned long )((struct bnx2x_vf_mbx_msg *)0)) { dma_free_attrs(& (bp->pdev)->dev, 512UL, (void *)bp->vf2pf_mbox, bp->pf2vf_bulletin_mapping, (struct dma_attrs *)0); bp->vf2pf_mbox = (struct bnx2x_vf_mbx_msg *)0; bp->pf2vf_bulletin_mapping = 0ULL; } else { } return; } } int bnx2x_vf_pci_alloc(struct bnx2x *bp ) { struct lock_class_key __key ; void *x ; void *tmp ; long tmp___0 ; void *x___0 ; void *tmp___1 ; long tmp___2 ; { __mutex_init(& bp->vf2pf_mutex, "&bp->vf2pf_mutex", & __key); tmp = dma_zalloc_coherent(& (bp->pdev)->dev, 2048UL, & bp->vf2pf_mbox_mapping, 208U); x = tmp; if ((unsigned long )x != (unsigned long )((void *)0)) { tmp___0 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___0 != 0L) { printk("\r[%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_vf_pci_alloc", 3078, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->vf2pf_mbox_mapping, x); } else { } } else { } bp->vf2pf_mbox = (struct bnx2x_vf_mbx_msg *)x; if ((unsigned long )bp->vf2pf_mbox == (unsigned long )((struct bnx2x_vf_mbx_msg *)0)) { goto alloc_mem_err; } else { } tmp___1 = dma_zalloc_coherent(& (bp->pdev)->dev, 512UL, & bp->pf2vf_bulletin_mapping, 208U); x___0 = tmp___1; if ((unsigned long )x___0 != (unsigned long )((void *)0)) { tmp___2 = ldv__builtin_expect((bp->msg_enable & 8192) != 0, 0L); if (tmp___2 != 0L) { printk("\r[%s:%d(%s)]BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", "bnx2x_vf_pci_alloc", 3084, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", bp->pf2vf_bulletin_mapping, x___0); } else { } } else { } bp->pf2vf_bulletin = (union pf_vf_bulletin *)x___0; if ((unsigned long )bp->pf2vf_bulletin == (unsigned long )((union pf_vf_bulletin *)0)) { goto alloc_mem_err; } else { } bnx2x_vf_bulletin_finalize(& (bp->pf2vf_bulletin)->content, 1); return (0); alloc_mem_err: bnx2x_vf_pci_dealloc(bp); return (-12); } } void bnx2x_iov_channel_down(struct bnx2x *bp ) { int vf_idx ; struct pf_vf_bulletin_content *bulletin ; { if ((unsigned long )bp->vfdb == (unsigned long )((struct bnx2x_vfdb *)0)) { return; } else { } vf_idx = 0; goto ldv_53404; ldv_53403: bulletin = (struct pf_vf_bulletin_content *)(bp->vfdb)->bulletin_dma.addr + (unsigned long )vf_idx; bulletin->valid_bitmap = bulletin->valid_bitmap | 4ULL; bnx2x_post_vf_bulletin(bp, vf_idx); vf_idx = vf_idx + 1; ldv_53404: ; if ((int )(bp->vfdb)->sriov.nr_virtfn > vf_idx) { goto ldv_53403; } else { } return; } } void bnx2x_iov_task(struct work_struct *work ) { struct bnx2x *bp ; struct work_struct const *__mptr ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { __mptr = (struct work_struct const *)work; bp = (struct bnx2x *)__mptr + 0xfffffffffffff9d0UL; tmp = netif_running((struct net_device const *)bp->dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } tmp___1 = test_and_clear_bit(1L, (unsigned long volatile *)(& bp->iov_task_state)); if (tmp___1 != 0) { bnx2x_vf_handle_flr_event(bp); } else { } tmp___2 = test_and_clear_bit(0L, (unsigned long volatile *)(& bp->iov_task_state)); if (tmp___2 != 0) { bnx2x_vf_mbx(bp); } else { } return; } } void bnx2x_schedule_iov_task(struct bnx2x *bp , enum bnx2x_iov_flag flag ) { long tmp ; { __asm__ volatile ("": : : "memory"); set_bit((long )flag, (unsigned long volatile *)(& bp->iov_task_state)); __asm__ volatile ("": : : "memory"); tmp = ldv__builtin_expect((bp->msg_enable & 8388608) != 0, 0L); if (tmp != 0L) { printk("\r[%s:%d(%s)]Scheduling iov task [Flag: %d]\n", "bnx2x_schedule_iov_task", 3138, (unsigned long )bp->dev != (unsigned long )((struct net_device *)0) ? (char *)(& (bp->dev)->name) : (char *)"?", (unsigned int )flag); } else { } queue_delayed_work___1(bnx2x_iov_wq, & bp->iov_task, 0UL); return; } } bool ldv_queue_work_on_179(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_180(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_181(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_182(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_183(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } extern void *memset(void * , int , size_t ) ; __inline static void ldv_error(void) { { ERROR: ; __VERIFIER_error(); } } bool ldv_is_err(void const *ptr ) { { return ((unsigned long )ptr > 2012UL); } } void *ldv_err_ptr(long error ) { { return ((void *)(2012L - error)); } } long ldv_ptr_err(void const *ptr ) { { return ((long )(2012UL - (unsigned long )ptr)); } } bool ldv_is_err_or_null(void const *ptr ) { bool tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { tmp = ldv_is_err(ptr); if ((int )tmp) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((bool )tmp___0); } } int ldv_module_refcounter = 1; void ldv_module_get(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { ldv_module_refcounter = ldv_module_refcounter + 1; } else { } return; } } int ldv_try_module_get(struct module *module ) { int module_get_succeeded ; { if ((unsigned long )module != (unsigned long )((struct module *)0)) { module_get_succeeded = ldv_undef_int(); if (module_get_succeeded == 1) { ldv_module_refcounter = ldv_module_refcounter + 1; return (1); } else { return (0); } } else { } return (0); } } void ldv_module_put(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { if (ldv_module_refcounter <= 1) { ldv_error(); } else { } ldv_module_refcounter = ldv_module_refcounter - 1; } else { } return; } } void ldv_module_put_and_exit(void) { { ldv_module_put((struct module *)1); LDV_STOP: ; goto LDV_STOP; } } unsigned int ldv_module_refcount(void) { { return ((unsigned int )(ldv_module_refcounter + -1)); } } void ldv_check_final_state(void) { { if (ldv_module_refcounter != 1) { ldv_error(); } else { } return; } }