/* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ struct device; typedef signed char __s8; typedef unsigned char __u8; typedef short __s16; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef long long __s64; typedef unsigned long long __u64; typedef signed char s8; typedef unsigned char u8; typedef short s16; typedef unsigned short u16; typedef int s32; typedef unsigned int u32; typedef long long s64; typedef unsigned long long u64; typedef long __kernel_long_t; typedef unsigned long __kernel_ulong_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; typedef __kernel_ulong_t __kernel_size_t; typedef __kernel_long_t __kernel_ssize_t; typedef long long __kernel_loff_t; typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef __u16 __le16; typedef __u16 __be16; typedef __u32 __le32; typedef __u32 __be32; typedef __u64 __le64; typedef __u32 __wsum; 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 unsigned long uintptr_t; typedef __kernel_loff_t loff_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef __kernel_time_t time_t; typedef __s32 int32_t; typedef __u8 uint8_t; typedef __u32 uint32_t; typedef __u64 uint64_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef u64 dma_addr_t; typedef unsigned int gfp_t; typedef unsigned int fmode_t; typedef unsigned int oom_flags_t; typedef u64 phys_addr_t; typedef phys_addr_t resource_size_t; struct __anonstruct_atomic_t_6 { int counter ; }; typedef struct __anonstruct_atomic_t_6 atomic_t; struct __anonstruct_atomic64_t_7 { long counter ; }; typedef struct __anonstruct_atomic64_t_7 atomic64_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct hlist_node; struct hlist_head { struct hlist_node *first ; }; struct hlist_node { struct hlist_node *next ; struct hlist_node **pprev ; }; struct callback_head { struct callback_head *next ; void (*func)(struct callback_head * ) ; }; struct kernel_symbol { unsigned long value ; char const *name ; }; struct module; 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 int base1 : 8 ; unsigned int type : 4 ; unsigned int s : 1 ; unsigned int dpl : 2 ; unsigned int p : 1 ; unsigned int limit : 4 ; unsigned int avl : 1 ; unsigned int l : 1 ; unsigned int d : 1 ; unsigned int g : 1 ; unsigned int base2 : 8 ; }; 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 pgdval_t; typedef unsigned long pgprotval_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 paravirt_callee_save { void *func ; }; struct pv_irq_ops { struct paravirt_callee_save save_fl ; struct paravirt_callee_save restore_fl ; struct paravirt_callee_save irq_disable ; struct paravirt_callee_save irq_enable ; void (*safe_halt)(void) ; void (*halt)(void) ; void (*adjust_exception_frame)(void) ; }; struct arch_spinlock; typedef u16 __ticket_t; typedef u32 __ticketpair_t; struct __raw_tickets { __ticket_t head ; __ticket_t tail ; }; union __anonunion____missing_field_name_15 { __ticketpair_t head_tail ; struct __raw_tickets tickets ; }; struct arch_spinlock { union __anonunion____missing_field_name_15 __annonCompField7 ; }; typedef struct arch_spinlock arch_spinlock_t; struct __anonstruct____missing_field_name_17 { u32 read ; s32 write ; }; union __anonunion_arch_rwlock_t_16 { s64 lock ; struct __anonstruct____missing_field_name_17 __annonCompField8 ; }; typedef union __anonunion_arch_rwlock_t_16 arch_rwlock_t; typedef void (*ctor_fn_t)(void); struct net_device; struct file_operations; struct completion; struct pid; enum system_states { SYSTEM_BOOTING = 0, SYSTEM_RUNNING = 1, SYSTEM_HALT = 2, SYSTEM_POWER_OFF = 3, SYSTEM_RESTART = 4 } ; struct lockdep_map; 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_18 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion____missing_field_name_18 __annonCompField9 ; }; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct cpumask { unsigned long bits[128U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct static_key; struct seq_operations; struct i387_fsave_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct____missing_field_name_23 { u64 rip ; u64 rdp ; }; struct __anonstruct____missing_field_name_24 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion____missing_field_name_22 { struct __anonstruct____missing_field_name_23 __annonCompField13 ; struct __anonstruct____missing_field_name_24 __annonCompField14 ; }; union __anonunion____missing_field_name_25 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion____missing_field_name_22 __annonCompField15 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion____missing_field_name_25 __annonCompField16 ; }; struct i387_soft_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct ymmh_struct { u32 ymmh_space[64U] ; }; struct lwp_struct { u8 reserved[128U] ; }; struct bndregs_struct { u64 bndregs[8U] ; }; struct bndcsr_struct { u64 cfg_reg_u ; u64 status_reg ; }; struct xsave_hdr_struct { u64 xstate_bv ; u64 reserved1[2U] ; u64 reserved2[5U] ; }; struct xsave_struct { struct i387_fxsave_struct i387 ; struct xsave_hdr_struct xsave_hdr ; struct ymmh_struct ymmh ; struct lwp_struct lwp ; struct bndregs_struct bndregs ; struct bndcsr_struct bndcsr ; }; union thread_xstate { struct i387_fsave_struct fsave ; struct i387_fxsave_struct fxsave ; struct i387_soft_struct soft ; struct xsave_struct xsave ; }; struct fpu { unsigned int last_cpu ; unsigned int has_fpu ; union thread_xstate *state ; }; struct kmem_cache; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned long usersp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_nr ; unsigned long error_code ; struct fpu fpu ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; unsigned char fpu_counter ; }; typedef atomic64_t atomic_long_t; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; }; 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 int class_idx : 13 ; unsigned int irq_context : 2 ; unsigned int trylock : 1 ; unsigned int read : 2 ; unsigned int check : 2 ; unsigned int hardirqs_off : 1 ; unsigned int references : 11 ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct____missing_field_name_29 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion____missing_field_name_28 { struct raw_spinlock rlock ; struct __anonstruct____missing_field_name_29 __annonCompField18 ; }; struct spinlock { union __anonunion____missing_field_name_28 __annonCompField19 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_30 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_30 rwlock_t; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; char const *name ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct timespec; typedef int pao_T__; typedef int pao_T_____0; struct jump_entry; struct static_key_mod; struct static_key { atomic_t enabled ; struct jump_entry *entries ; struct static_key_mod *next ; }; typedef u64 jump_label_t; struct jump_entry { jump_label_t code ; jump_label_t target ; jump_label_t key ; }; struct seqcount { unsigned int sequence ; struct lockdep_map dep_map ; }; typedef struct seqcount seqcount_t; struct __anonstruct_seqlock_t_35 { struct seqcount seqcount ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_35 seqlock_t; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct completion { unsigned int done ; wait_queue_head_t wait ; }; struct notifier_block; struct idr_layer { int prefix ; unsigned long bitmap[4U] ; struct idr_layer *ary[256U] ; int count ; int layer ; struct callback_head callback_head ; }; struct idr { struct idr_layer *hint ; struct idr_layer *top ; struct idr_layer *id_free ; int layers ; int id_free_cnt ; int cur ; spinlock_t lock ; }; struct ida_bitmap { long nr_busy ; unsigned long bitmap[15U] ; }; struct ida { struct idr idr ; struct ida_bitmap *free_bitmap ; }; 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 dentry; struct iattr; struct vm_area_struct; 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 ; }; union __anonunion_u_36 { struct completion *completion ; struct kernfs_node *removed_list ; }; union __anonunion____missing_field_name_37 { 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 ; union __anonunion_u_36 u ; void const *ns ; unsigned int hash ; union __anonunion____missing_field_name_37 __annonCompField21 ; void *priv ; unsigned short flags ; umode_t mode ; unsigned int ino ; struct kernfs_iattrs *iattr ; }; struct kernfs_dir_ops { 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 ; struct ida ino_ida ; struct kernfs_dir_ops *dir_ops ; }; struct vm_operations_struct; struct kernfs_open_file { struct kernfs_node *kn ; struct file *file ; struct mutex mutex ; int event ; struct list_head list ; 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 ) ; 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 timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct user_namespace; struct __anonstruct_kuid_t_38 { uid_t val ; }; typedef struct __anonstruct_kuid_t_38 kuid_t; struct __anonstruct_kgid_t_39 { gid_t val ; }; typedef struct __anonstruct_kgid_t_39 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 bin_attribute; struct attribute { char const *name ; umode_t mode ; bool ignore_lockdep : 1 ; 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 ; }; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct tvec_base; struct timer_list { struct list_head entry ; unsigned long expires ; struct tvec_base *base ; void (*function)(unsigned long ) ; unsigned long data ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; struct 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 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 int state_initialized : 1 ; unsigned int state_in_sysfs : 1 ; unsigned int state_add_uevent_sent : 1 ; unsigned int state_remove_uevent_sent : 1 ; unsigned int uevent_suppress : 1 ; }; struct kobj_type { void (*release)(struct kobject * ) ; struct sysfs_ops const *sysfs_ops ; struct attribute **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject * ) ; void const *(*namespace)(struct kobject * ) ; }; struct kobj_uevent_env { char *envp[32U] ; int envp_idx ; char buf[2048U] ; int buflen ; }; struct kset_uevent_ops { int (* const filter)(struct kset * , struct kobject * ) ; char const *(* const name)(struct kset * , struct kobject * ) ; int (* const uevent)(struct kset * , struct kobject * , struct kobj_uevent_env * ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops const *uevent_ops ; }; struct inode; struct cdev { struct kobject kobj ; struct module *owner ; struct file_operations const *ops ; struct list_head list ; dev_t dev ; unsigned int count ; }; struct backing_dev_info; 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 klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct __anonstruct_nodemask_t_40 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_40 nodemask_t; 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 pm_message { int event ; }; typedef struct pm_message pm_message_t; struct dev_pm_ops { int (*prepare)(struct device * ) ; void (*complete)(struct device * ) ; int (*suspend)(struct device * ) ; int (*resume)(struct device * ) ; int (*freeze)(struct device * ) ; int (*thaw)(struct device * ) ; int (*poweroff)(struct device * ) ; int (*restore)(struct device * ) ; int (*suspend_late)(struct device * ) ; int (*resume_early)(struct device * ) ; int (*freeze_late)(struct device * ) ; int (*thaw_early)(struct device * ) ; int (*poweroff_late)(struct device * ) ; int (*restore_early)(struct device * ) ; int (*suspend_noirq)(struct device * ) ; int (*resume_noirq)(struct device * ) ; int (*freeze_noirq)(struct device * ) ; int (*thaw_noirq)(struct device * ) ; int (*poweroff_noirq)(struct device * ) ; int (*restore_noirq)(struct device * ) ; int (*runtime_suspend)(struct device * ) ; int (*runtime_resume)(struct device * ) ; int (*runtime_idle)(struct device * ) ; }; enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ; enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ; struct wakeup_source; struct pm_subsys_data { spinlock_t lock ; unsigned int refcount ; struct list_head clock_list ; }; struct dev_pm_qos; struct dev_pm_info { pm_message_t power_state ; unsigned int can_wakeup : 1 ; unsigned int async_suspend : 1 ; bool is_prepared : 1 ; bool is_suspended : 1 ; bool ignore_children : 1 ; bool early_init : 1 ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; bool wakeup_path : 1 ; bool syscore : 1 ; struct timer_list suspend_timer ; unsigned long timer_expires ; struct work_struct work ; wait_queue_head_t wait_queue ; atomic_t usage_count ; atomic_t child_count ; unsigned int disable_depth : 3 ; unsigned int idle_notification : 1 ; unsigned int request_pending : 1 ; unsigned int deferred_resume : 1 ; unsigned int run_wake : 1 ; unsigned int runtime_auto : 1 ; unsigned int no_callbacks : 1 ; unsigned int irq_safe : 1 ; unsigned int use_autosuspend : 1 ; unsigned int timer_autosuspends : 1 ; unsigned int 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 ; struct dev_pm_qos *qos ; }; struct dev_pm_domain { struct dev_pm_ops ops ; }; struct rw_semaphore; struct rw_semaphore { long count ; raw_spinlock_t wait_lock ; struct list_head wait_list ; struct lockdep_map dep_map ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct blocking_notifier_head { struct rw_semaphore rwsem ; struct notifier_block *head ; }; struct ctl_table; struct pci_dev; struct pci_bus; struct __anonstruct_mm_context_t_105 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_105 mm_context_t; struct device_node; struct llist_node; struct llist_node { struct llist_node *next ; }; 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 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 *iommu_ops ; struct subsys_private *p ; struct lock_class_key lock_key ; }; struct device_type; struct of_device_id; struct acpi_device_id; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; struct of_device_id const *of_match_table ; struct acpi_device_id const *acpi_match_table ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct attribute_group const **groups ; struct dev_pm_ops const *pm ; struct driver_private *p ; }; struct 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 acpi_device; struct acpi_dev_node { struct acpi_device *companion ; }; struct dma_coherent_mem; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; struct dev_pin_info *pins ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct dev_archdata archdata ; struct device_node *of_node ; struct acpi_dev_node acpi_node ; dev_t devt ; u32 id ; spinlock_t devres_lock ; struct list_head devres_head ; struct klist_node knode_class ; struct class *class ; struct attribute_group const **groups ; void (*release)(struct device * ) ; struct iommu_group *iommu_group ; bool offline_disabled : 1 ; bool offline : 1 ; }; struct wakeup_source { char const *name ; struct list_head entry ; spinlock_t lock ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active : 1 ; bool autosleep_enabled : 1 ; }; enum iio_chan_type { IIO_VOLTAGE = 0, IIO_CURRENT = 1, IIO_POWER = 2, IIO_ACCEL = 3, IIO_ANGL_VEL = 4, IIO_MAGN = 5, IIO_LIGHT = 6, IIO_INTENSITY = 7, IIO_PROXIMITY = 8, IIO_TEMP = 9, IIO_INCLI = 10, IIO_ROT = 11, IIO_ANGL = 12, IIO_TIMESTAMP = 13, IIO_CAPACITANCE = 14, IIO_ALTVOLTAGE = 15, IIO_CCT = 16, IIO_PRESSURE = 17, IIO_HUMIDITYRELATIVE = 18 } ; enum iio_event_type { IIO_EV_TYPE_THRESH = 0, IIO_EV_TYPE_MAG = 1, IIO_EV_TYPE_ROC = 2, IIO_EV_TYPE_THRESH_ADAPTIVE = 3, IIO_EV_TYPE_MAG_ADAPTIVE = 4 } ; enum iio_event_info { IIO_EV_INFO_ENABLE = 0, IIO_EV_INFO_VALUE = 1, IIO_EV_INFO_HYSTERESIS = 2 } ; enum iio_event_direction { IIO_EV_DIR_EITHER = 0, IIO_EV_DIR_RISING = 1, IIO_EV_DIR_FALLING = 2 } ; enum iio_shared_by { IIO_SEPARATE = 0, IIO_SHARED_BY_TYPE = 1, IIO_SHARED_BY_DIR = 2, IIO_SHARED_BY_ALL = 3 } ; enum iio_endian { IIO_CPU = 0, IIO_BE = 1, IIO_LE = 2 } ; struct iio_chan_spec; struct iio_dev; struct iio_chan_spec_ext_info { char const *name ; enum iio_shared_by shared ; ssize_t (*read)(struct iio_dev * , uintptr_t , struct iio_chan_spec const * , char * ) ; ssize_t (*write)(struct iio_dev * , uintptr_t , struct iio_chan_spec const * , char const * , size_t ) ; uintptr_t private ; }; struct iio_event_spec { enum iio_event_type type ; enum iio_event_direction dir ; unsigned long mask_separate ; unsigned long mask_shared_by_type ; unsigned long mask_shared_by_dir ; unsigned long mask_shared_by_all ; }; struct __anonstruct_scan_type_133 { char sign ; u8 realbits ; u8 storagebits ; u8 shift ; enum iio_endian endianness ; }; struct iio_chan_spec { enum iio_chan_type type ; int channel ; int channel2 ; unsigned long address ; int scan_index ; struct __anonstruct_scan_type_133 scan_type ; long info_mask_separate ; long info_mask_shared_by_type ; long info_mask_shared_by_dir ; long info_mask_shared_by_all ; struct iio_event_spec const *event_spec ; unsigned int num_event_specs ; struct iio_chan_spec_ext_info const *ext_info ; char const *extend_name ; char const *datasheet_name ; unsigned int modified : 1 ; unsigned int indexed : 1 ; unsigned int output : 1 ; unsigned int differential : 1 ; }; struct iio_trigger; struct iio_info { struct module *driver_module ; struct attribute_group *event_attrs ; struct attribute_group const *attrs ; int (*read_raw)(struct iio_dev * , struct iio_chan_spec const * , int * , int * , long ) ; int (*write_raw)(struct iio_dev * , struct iio_chan_spec const * , int , int , long ) ; int (*write_raw_get_fmt)(struct iio_dev * , struct iio_chan_spec const * , long ) ; int (*read_event_config)(struct iio_dev * , struct iio_chan_spec const * , enum iio_event_type , enum iio_event_direction ) ; int (*write_event_config)(struct iio_dev * , struct iio_chan_spec const * , enum iio_event_type , enum iio_event_direction , int ) ; int (*read_event_value)(struct iio_dev * , struct iio_chan_spec const * , enum iio_event_type , enum iio_event_direction , enum iio_event_info , int * , int * ) ; int (*write_event_value)(struct iio_dev * , struct iio_chan_spec const * , enum iio_event_type , enum iio_event_direction , enum iio_event_info , int , int ) ; int (*validate_trigger)(struct iio_dev * , struct iio_trigger * ) ; int (*update_scan_mode)(struct iio_dev * , unsigned long const * ) ; int (*debugfs_reg_access)(struct iio_dev * , unsigned int , unsigned int , unsigned int * ) ; }; struct iio_buffer_setup_ops { int (*preenable)(struct iio_dev * ) ; int (*postenable)(struct iio_dev * ) ; int (*predisable)(struct iio_dev * ) ; int (*postdisable)(struct iio_dev * ) ; bool (*validate_scan_mask)(struct iio_dev * , unsigned long const * ) ; }; struct iio_event_interface; struct iio_buffer; struct iio_poll_func; struct iio_dev { int id ; int modes ; int currentmode ; struct device dev ; struct iio_event_interface *event_interface ; struct iio_buffer *buffer ; struct list_head buffer_list ; int scan_bytes ; struct mutex mlock ; unsigned long const *available_scan_masks ; unsigned int masklength ; unsigned long const *active_scan_mask ; bool scan_timestamp ; unsigned int scan_index_timestamp ; struct iio_trigger *trig ; struct iio_poll_func *pollfunc ; struct iio_chan_spec const *channels ; int num_channels ; struct list_head channel_attr_list ; struct attribute_group chan_attr_group ; char const *name ; struct iio_info const *info ; struct mutex info_exist_lock ; struct iio_buffer_setup_ops const *setup_ops ; struct cdev chrdev ; struct attribute_group const *groups[7U] ; int groupcounter ; unsigned long flags ; struct dentry *debugfs_dentry ; unsigned int cached_reg_addr ; }; struct plist_head { struct list_head node_list ; }; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; struct pm_qos_request { struct plist_node node ; int pm_qos_class ; struct delayed_work work ; }; struct pm_qos_flags_request { struct list_head node ; s32 flags ; }; enum dev_pm_qos_req_type { DEV_PM_QOS_LATENCY = 1, DEV_PM_QOS_FLAGS = 2 } ; union __anonunion_data_134 { struct plist_node pnode ; struct pm_qos_flags_request flr ; }; struct dev_pm_qos_request { enum dev_pm_qos_req_type type ; union __anonunion_data_134 data ; struct device *dev ; }; enum pm_qos_type { PM_QOS_UNITIALIZED = 0, PM_QOS_MAX = 1, PM_QOS_MIN = 2 } ; struct pm_qos_constraints { struct plist_head list ; s32 target_value ; s32 default_value ; enum pm_qos_type type ; struct blocking_notifier_head *notifiers ; }; struct pm_qos_flags { struct list_head list ; s32 effective_flags ; }; struct dev_pm_qos { struct pm_qos_constraints latency ; struct pm_qos_flags flags ; struct dev_pm_qos_request *latency_req ; struct dev_pm_qos_request *flags_req ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct 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_137 { struct arch_uprobe_task autask ; unsigned long vaddr ; }; struct __anonstruct____missing_field_name_138 { struct callback_head dup_xol_work ; unsigned long dup_xol_addr ; }; union __anonunion____missing_field_name_136 { struct __anonstruct____missing_field_name_137 __annonCompField34 ; struct __anonstruct____missing_field_name_138 __annonCompField35 ; }; struct uprobe; struct return_instance; struct uprobe_task { enum uprobe_task_state state ; union __anonunion____missing_field_name_136 __annonCompField36 ; 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; union __anonunion____missing_field_name_139 { struct address_space *mapping ; void *s_mem ; }; union __anonunion____missing_field_name_141 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct____missing_field_name_145 { unsigned int inuse : 16 ; unsigned int objects : 15 ; unsigned int frozen : 1 ; }; union __anonunion____missing_field_name_144 { atomic_t _mapcount ; struct __anonstruct____missing_field_name_145 __annonCompField39 ; int units ; }; struct __anonstruct____missing_field_name_143 { union __anonunion____missing_field_name_144 __annonCompField40 ; atomic_t _count ; }; union __anonunion____missing_field_name_142 { unsigned long counters ; struct __anonstruct____missing_field_name_143 __annonCompField41 ; unsigned int active ; }; struct __anonstruct____missing_field_name_140 { union __anonunion____missing_field_name_141 __annonCompField38 ; union __anonunion____missing_field_name_142 __annonCompField42 ; }; struct __anonstruct____missing_field_name_147 { struct page *next ; int pages ; int pobjects ; }; struct slab; union __anonunion____missing_field_name_146 { struct list_head lru ; struct __anonstruct____missing_field_name_147 __annonCompField44 ; struct list_head list ; struct slab *slab_page ; struct callback_head callback_head ; pgtable_t pmd_huge_pte ; }; union __anonunion____missing_field_name_148 { 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_139 __annonCompField37 ; struct __anonstruct____missing_field_name_140 __annonCompField43 ; union __anonunion____missing_field_name_146 __annonCompField45 ; union __anonunion____missing_field_name_148 __annonCompField46 ; unsigned long debug_flags ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_linear_150 { struct rb_node rb ; unsigned long rb_subtree_last ; }; union __anonunion_shared_149 { struct __anonstruct_linear_150 linear ; struct list_head nonlinear ; }; struct anon_vma; struct mempolicy; struct vm_area_struct { unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; struct rb_node vm_rb ; unsigned long rb_subtree_gap ; struct mm_struct *vm_mm ; pgprot_t vm_page_prot ; unsigned long vm_flags ; union __anonunion_shared_149 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 ; struct vm_area_struct *mmap_cache ; 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 ; 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 ; }; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; nodemask_t nodes_to_scan ; int nid ; }; 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 user_struct; struct writeback_control; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *page ; }; struct vm_operations_struct { void (*open)(struct vm_area_struct * ) ; void (*close)(struct vm_area_struct * ) ; int (*fault)(struct vm_area_struct * , struct vm_fault * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; int (*migrate)(struct vm_area_struct * , nodemask_t const * , nodemask_t const * , unsigned long ) ; int (*remap_pages)(struct vm_area_struct * , unsigned long , unsigned long , unsigned long ) ; }; struct scatterlist { unsigned long sg_magic ; unsigned long page_link ; unsigned int offset ; unsigned int length ; dma_addr_t dma_address ; unsigned int dma_length ; }; struct sg_table { struct scatterlist *sgl ; unsigned int nents ; unsigned int orig_nents ; }; typedef s32 dma_cookie_t; struct dql { unsigned int num_queued ; unsigned int adj_limit ; unsigned int last_obj_cnt ; unsigned int limit ; unsigned int num_completed ; unsigned int prev_ovlimit ; unsigned int prev_num_queued ; unsigned int prev_last_obj_cnt ; unsigned int lowest_slack ; unsigned long slack_start_time ; unsigned int max_limit ; unsigned int min_limit ; unsigned int slack_hold_time ; }; struct sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; typedef unsigned short __kernel_sa_family_t; struct cred; typedef __kernel_sa_family_t sa_family_t; struct sockaddr { sa_family_t sa_family ; char sa_data[14U] ; }; struct msghdr { void *msg_name ; int msg_namelen ; struct iovec *msg_iov ; __kernel_size_t msg_iovlen ; void *msg_control ; __kernel_size_t msg_controllen ; unsigned int msg_flags ; }; struct __anonstruct_sync_serial_settings_152 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_152 sync_serial_settings; struct __anonstruct_te1_settings_153 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_153 te1_settings; struct __anonstruct_raw_hdlc_proto_154 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_154 raw_hdlc_proto; struct __anonstruct_fr_proto_155 { 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_155 fr_proto; struct __anonstruct_fr_proto_pvc_156 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_156 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_157 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_157 fr_proto_pvc_info; struct __anonstruct_cisco_proto_158 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_158 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_159 { 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_159 ifs_ifsu ; }; union __anonunion_ifr_ifrn_160 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_161 { 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_160 ifr_ifrn ; union __anonunion_ifr_ifru_161 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_164 { spinlock_t lock ; unsigned int count ; }; union __anonunion____missing_field_name_163 { struct __anonstruct____missing_field_name_164 __annonCompField47 ; }; struct lockref { union __anonunion____missing_field_name_163 __annonCompField48 ; }; struct nameidata; struct vfsmount; struct __anonstruct____missing_field_name_166 { u32 hash ; u32 len ; }; union __anonunion____missing_field_name_165 { struct __anonstruct____missing_field_name_166 __annonCompField49 ; u64 hash_len ; }; struct qstr { union __anonunion____missing_field_name_165 __annonCompField50 ; unsigned char const *name ; }; struct dentry_operations; union __anonunion_d_u_167 { struct list_head d_child ; struct callback_head d_rcu ; }; struct dentry { unsigned int d_flags ; seqcount_t d_seq ; struct hlist_bl_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct inode *d_inode ; unsigned char d_iname[32U] ; 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 ; union __anonunion_d_u_167 d_u ; struct list_head d_subdirs ; struct hlist_node d_alias ; }; 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 path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct list_lru_node { spinlock_t lock ; struct list_head list ; long nr_items ; }; struct list_lru { struct list_lru_node *node ; nodemask_t active_nodes ; }; struct radix_tree_node; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct callback_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct block_device; struct io_context; struct cgroup_subsys_state; struct export_operations; struct kiocb; struct pipe_inode_info; struct poll_table_struct; struct kstatfs; struct swap_info_struct; struct iattr { unsigned int ia_valid ; umode_t ia_mode ; kuid_t ia_uid ; kgid_t ia_gid ; loff_t ia_size ; struct timespec ia_atime ; struct timespec ia_mtime ; struct timespec ia_ctime ; struct file *ia_file ; }; struct percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct fs_disk_quota { __s8 d_version ; __s8 d_flags ; __u16 d_fieldmask ; __u32 d_id ; __u64 d_blk_hardlimit ; __u64 d_blk_softlimit ; __u64 d_ino_hardlimit ; __u64 d_ino_softlimit ; __u64 d_bcount ; __u64 d_icount ; __s32 d_itimer ; __s32 d_btimer ; __u16 d_iwarns ; __u16 d_bwarns ; __s32 d_padding2 ; __u64 d_rtb_hardlimit ; __u64 d_rtb_softlimit ; __u64 d_rtbcount ; __s32 d_rtbtimer ; __u16 d_rtbwarns ; __s16 d_padding3 ; char d_padding4[8U] ; }; struct fs_qfilestat { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; }; typedef struct fs_qfilestat fs_qfilestat_t; struct fs_quota_stat { __s8 qs_version ; __u16 qs_flags ; __s8 qs_pad ; fs_qfilestat_t qs_uquota ; fs_qfilestat_t qs_gquota ; __u32 qs_incoredqs ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; }; struct fs_qfilestatv { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; __u32 qfs_pad ; }; struct fs_quota_statv { __s8 qs_version ; __u8 qs_pad1 ; __u16 qs_flags ; __u32 qs_incoredqs ; struct fs_qfilestatv qs_uquota ; struct fs_qfilestatv qs_gquota ; struct fs_qfilestatv qs_pquota ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; __u64 qs_pad2[8U] ; }; struct dquot; typedef __kernel_uid32_t projid_t; struct __anonstruct_kprojid_t_169 { projid_t val ; }; typedef struct __anonstruct_kprojid_t_169 kprojid_t; struct if_dqinfo { __u64 dqi_bgrace ; __u64 dqi_igrace ; __u32 dqi_flags ; __u32 dqi_valid ; }; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion____missing_field_name_170 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion____missing_field_name_170 __annonCompField51 ; enum quota_type type ; }; struct mem_dqblk { qsize_t dqb_bhardlimit ; qsize_t dqb_bsoftlimit ; qsize_t dqb_curspace ; qsize_t dqb_rsvspace ; qsize_t dqb_ihardlimit ; qsize_t dqb_isoftlimit ; qsize_t dqb_curinodes ; time_t dqb_btime ; time_t dqb_itime ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_maxblimit ; qsize_t dqi_maxilimit ; void *dqi_priv ; }; struct dquot { struct hlist_node dq_hash ; struct list_head dq_inuse ; struct list_head dq_free ; struct list_head dq_dirty ; struct mutex dq_lock ; atomic_t dq_count ; wait_queue_head_t dq_wait_unused ; struct super_block *dq_sb ; struct kqid dq_id ; loff_t dq_off ; unsigned long dq_flags ; struct mem_dqblk dq_dqb ; }; struct quota_format_ops { int (*check_quota_file)(struct super_block * , int ) ; int (*read_file_info)(struct super_block * , int ) ; int (*write_file_info)(struct super_block * , int ) ; int (*free_file_info)(struct super_block * , int ) ; int (*read_dqblk)(struct dquot * ) ; int (*commit_dqblk)(struct dquot * ) ; int (*release_dqblk)(struct dquot * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_on_meta)(struct super_block * , int , int ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_sync)(struct super_block * , int ) ; int (*get_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*set_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*get_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*get_xstate)(struct super_block * , struct fs_quota_stat * ) ; int (*set_xstate)(struct super_block * , unsigned int , int ) ; int (*get_xstatev)(struct super_block * , struct fs_quota_statv * ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct rw_semaphore dqptr_sem ; struct inode *files[2U] ; struct mem_dqinfo info[2U] ; struct quota_format_ops const *ops[2U] ; }; union __anonunion_arg_172 { char *buf ; void *data ; }; struct __anonstruct_read_descriptor_t_171 { size_t written ; size_t count ; union __anonunion_arg_172 arg ; int error ; }; typedef struct __anonstruct_read_descriptor_t_171 read_descriptor_t; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned int , unsigned int ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(int , struct kiocb * , struct iovec const * , loff_t , unsigned long ) ; int (*get_xip_mem)(struct address_space * , unsigned long , int , void ** , unsigned long * ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , read_descriptor_t * , unsigned long ) ; 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 ; unsigned int i_mmap_writable ; struct rb_root i_mmap ; struct list_head i_mmap_nonlinear ; struct mutex i_mmap_mutex ; unsigned long nrpages ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; struct backing_dev_info *backing_dev_info ; spinlock_t private_lock ; struct list_head private_list ; void *private_data ; }; struct request_queue; struct hd_struct; struct gendisk; struct block_device { dev_t bd_dev ; int bd_openers ; struct inode *bd_inode ; struct super_block *bd_super ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; bool bd_write_holder ; struct list_head bd_holder_disks ; struct block_device *bd_contains ; unsigned int bd_block_size ; struct hd_struct *bd_part ; unsigned int bd_part_count ; int bd_invalidated ; struct gendisk *bd_disk ; struct request_queue *bd_queue ; struct list_head bd_list ; unsigned long bd_private ; int bd_fsfreeze_count ; struct mutex bd_fsfreeze_mutex ; }; struct posix_acl; struct inode_operations; union __anonunion____missing_field_name_173 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion____missing_field_name_174 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock; union __anonunion____missing_field_name_175 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; struct inode { umode_t i_mode ; unsigned short i_opflags ; kuid_t i_uid ; kgid_t i_gid ; unsigned int i_flags ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; struct inode_operations const *i_op ; struct super_block *i_sb ; struct address_space *i_mapping ; void *i_security ; unsigned long i_ino ; union __anonunion____missing_field_name_173 __annonCompField52 ; dev_t i_rdev ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; unsigned int i_blkbits ; blkcnt_t i_blocks ; unsigned long i_state ; struct mutex i_mutex ; unsigned long dirtied_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion____missing_field_name_174 __annonCompField53 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; struct file_operations const *i_fop ; struct file_lock *i_flock ; struct address_space i_data ; struct dquot *i_dquot[2U] ; struct list_head i_devices ; union __anonunion____missing_field_name_175 __annonCompField54 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; atomic_t i_readcount ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; kuid_t uid ; kuid_t euid ; int signum ; }; struct file_ra_state { unsigned long start ; unsigned int size ; unsigned int async_size ; unsigned int ra_pages ; unsigned int mmap_miss ; loff_t prev_pos ; }; union __anonunion_f_u_176 { struct llist_node fu_llist ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_176 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 ; unsigned long f_mnt_write_state ; }; struct files_struct; typedef struct files_struct *fl_owner_t; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; }; struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock * , struct file_lock * ) ; unsigned long (*lm_owner_key)(struct file_lock * ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , struct file_lock * , int ) ; void (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock ** , int ) ; }; struct net; struct nlm_lockowner; struct nfs_lock_info { u32 state ; struct nlm_lockowner *owner ; struct list_head list ; }; struct nfs4_lock_state; struct nfs4_lock_info { struct nfs4_lock_state *owner ; }; struct fasync_struct; struct __anonstruct_afs_178 { struct list_head link ; int state ; }; union __anonunion_fl_u_177 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_178 afs ; }; struct file_lock { struct file_lock *fl_next ; 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_177 fl_u ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct callback_head fa_rcu ; }; struct sb_writers { struct percpu_counter counter[3U] ; wait_queue_head_t wait ; int frozen ; wait_queue_head_t wait_unfrozen ; struct lockdep_map lock_map[3U] ; }; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; unsigned char s_blocksize_bits ; unsigned long s_blocksize ; loff_t s_maxbytes ; struct file_system_type *s_type ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head s_mounts ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; struct quota_info s_dquot ; struct sb_writers s_writers ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; struct shrinker s_shrink ; atomic_long_t s_remove_count ; int s_readonly_remount ; struct workqueue_struct *s_dio_done_wq ; struct list_lru s_dentry_lru ; struct list_lru s_inode_lru ; struct callback_head rcu ; }; 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 { int (*actor)(void * , 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 (*aio_read)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; ssize_t (*aio_write)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; int (*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 (*open)(struct inode * , struct file * ) ; int (*flush)(struct file * , fl_owner_t ) ; int (*release)(struct inode * , struct file * ) ; int (*fsync)(struct file * , loff_t , loff_t , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; int (*show_fdinfo)(struct seq_file * , struct file * ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; int (*create)(struct inode * , struct dentry * , umode_t , bool ) ; int (*link)(struct dentry * , struct inode * , struct dentry * ) ; int (*unlink)(struct inode * , struct dentry * ) ; int (*symlink)(struct inode * , struct dentry * , char const * ) ; int (*mkdir)(struct inode * , struct dentry * , umode_t ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , umode_t , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; int (*update_time)(struct inode * , struct timespec * , int ) ; int (*atomic_open)(struct inode * , struct dentry * , struct file * , unsigned int , umode_t , int * ) ; 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_fs)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; long (*nr_cached_objects)(struct super_block * , int ) ; long (*free_cached_objects)(struct super_block * , long , int ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , void * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct hlist_head fs_supers ; struct lock_class_key s_lock_key ; struct lock_class_key s_umount_key ; struct lock_class_key s_vfs_rename_key ; struct lock_class_key s_writers_key[3U] ; struct lock_class_key i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; }; typedef unsigned long cputime_t; struct __anonstruct_sigset_t_179 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_179 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_181 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_182 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_183 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_184 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_185 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_186 { long _band ; int _fd ; }; struct __anonstruct__sigsys_187 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_180 { int _pad[28U] ; struct __anonstruct__kill_181 _kill ; struct __anonstruct__timer_182 _timer ; struct __anonstruct__rt_183 _rt ; struct __anonstruct__sigchld_184 _sigchld ; struct __anonstruct__sigfault_185 _sigfault ; struct __anonstruct__sigpoll_186 _sigpoll ; struct __anonstruct__sigsys_187 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_180 _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 ; }; 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 resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; unsigned int active_bases ; unsigned int clock_was_set ; ktime_t expires_next ; int hres_active ; int hang_detected ; unsigned long nr_events ; unsigned long nr_retries ; unsigned long nr_hangs ; ktime_t max_hang_time ; struct hrtimer_clock_base clock_base[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 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_191 { struct ctl_table *ctl_table ; int used ; int count ; int nreg ; }; union __anonunion____missing_field_name_190 { struct __anonstruct____missing_field_name_191 __annonCompField55 ; struct callback_head rcu ; }; struct ctl_table_set; struct ctl_table_header { union __anonunion____missing_field_name_190 __annonCompField56 ; 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 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_192 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion____missing_field_name_193 { time_t expiry ; time_t revoked_at ; }; struct __anonstruct____missing_field_name_195 { struct key_type *type ; char *description ; }; union __anonunion____missing_field_name_194 { struct keyring_index_key index_key ; struct __anonstruct____missing_field_name_195 __annonCompField59 ; }; union __anonunion_type_data_196 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_198 { unsigned long value ; void *rcudata ; void *data ; void *data2[2U] ; }; union __anonunion____missing_field_name_197 { union __anonunion_payload_198 payload ; struct assoc_array keys ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion____missing_field_name_192 __annonCompField57 ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion____missing_field_name_193 __annonCompField58 ; 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_194 __annonCompField60 ; union __anonunion_type_data_196 type_data ; union __anonunion____missing_field_name_197 __annonCompField61 ; }; 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 futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct cfs_rq; struct task_group; struct sighand_struct { atomic_t count ; struct k_sigaction action[64U] ; spinlock_t siglock ; wait_queue_head_t signalfd_wqh ; }; struct pacct_struct { int ac_flag ; long ac_exitcode ; unsigned long ac_mem ; cputime_t ac_utime ; cputime_t ac_stime ; unsigned long ac_minflt ; unsigned long ac_majflt ; }; struct cpu_itimer { cputime_t expires ; cputime_t incr ; u32 error ; u32 incr_error ; }; struct cputime { cputime_t utime ; cputime_t stime ; }; struct task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime cputime ; int running ; raw_spinlock_t lock ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; 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 int is_child_subreaper : 1 ; unsigned int 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 ; 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 ; struct rw_semaphore group_rwsem ; oom_flags_t oom_flags ; short oom_score_adj ; short oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; atomic_t files ; atomic_t sigpending ; atomic_t inotify_watches ; atomic_t inotify_devs ; atomic_t fanotify_listeners ; atomic_long_t epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; kuid_t uid ; atomic_long_t locked_vm ; }; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; struct task_delay_info { spinlock_t lock ; unsigned int flags ; struct timespec blkio_start ; struct timespec blkio_end ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; struct timespec freepages_start ; struct timespec freepages_end ; u64 freepages_delay ; u32 freepages_count ; }; struct uts_namespace; struct load_weight { unsigned long weight ; u32 inv_weight ; }; struct sched_avg { u32 runnable_avg_sum ; u32 runnable_avg_period ; u64 last_runnable_update ; s64 decay_count ; unsigned long load_avg_contrib ; }; struct sched_statistics { u64 wait_start ; u64 wait_max ; u64 wait_count ; u64 wait_sum ; u64 iowait_count ; u64 iowait_sum ; u64 sleep_start ; u64 sleep_max ; s64 sum_sleep_runtime ; u64 block_start ; u64 block_max ; u64 exec_max ; u64 slice_max ; u64 nr_migrations_cold ; u64 nr_failed_migrations_affine ; u64 nr_failed_migrations_running ; u64 nr_failed_migrations_hot ; u64 nr_forced_migrations ; u64 nr_wakeups ; u64 nr_wakeups_sync ; u64 nr_wakeups_migrate ; u64 nr_wakeups_local ; u64 nr_wakeups_remote ; u64 nr_wakeups_affine ; u64 nr_wakeups_affine_attempts ; u64 nr_wakeups_passive ; u64 nr_wakeups_idle ; }; struct sched_entity { struct load_weight load ; struct rb_node run_node ; struct list_head group_node ; unsigned int on_rq ; u64 exec_start ; u64 sum_exec_runtime ; u64 vruntime ; u64 prev_sum_exec_runtime ; u64 nr_migrations ; struct sched_statistics statistics ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; struct sched_avg avg ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned 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 ; struct hrtimer dl_timer ; }; struct mem_cgroup; struct memcg_batch_info { int do_batch ; struct mem_cgroup *memcg ; unsigned long nr_pages ; unsigned long memsw_nr_pages ; }; struct memcg_oom_info { struct mem_cgroup *memcg ; gfp_t gfp_mask ; int order ; unsigned int may_oom : 1 ; }; struct sched_class; struct css_set; 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 ; 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 ; unsigned int brk_randomized : 1 ; struct task_rss_stat rss_stat ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int jobctl ; unsigned int personality ; unsigned int in_execve : 1 ; unsigned int in_iowait : 1 ; unsigned int no_new_privs : 1 ; unsigned int sched_reset_on_fork : 1 ; unsigned int sched_contributes_to_load : 1 ; 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 ; struct timespec start_time ; struct timespec real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; char comm[16U] ; int link_count ; int total_link_count ; struct sysv_sem sysvsem ; unsigned long last_switch_count ; struct thread_struct thread ; struct fs_struct *fs ; struct files_struct *files ; struct nsproxy *nsproxy ; struct signal_struct *signal ; struct sighand_struct *sighand ; sigset_t blocked ; sigset_t real_blocked ; sigset_t saved_sigmask ; struct sigpending pending ; unsigned long sas_ss_sp ; size_t sas_ss_size ; int (*notifier)(void * ) ; void *notifier_data ; sigset_t *notifier_mask ; struct callback_head *task_works ; struct audit_context *audit_context ; kuid_t loginuid ; unsigned int sessionid ; struct seccomp seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; raw_spinlock_t pi_lock ; struct rb_root pi_waiters ; struct rb_node *pi_waiters_leftmost ; struct rt_mutex_waiter *pi_blocked_on ; struct task_struct *pi_top_task ; 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 ; int numa_migrate_deferred ; unsigned long numa_migrate_retry ; u64 node_stamp ; 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_buffer ; unsigned long numa_faults_locality[2U] ; 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 ; 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_batch_info memcg_batch ; unsigned int memcg_kmem_skip_account ; struct memcg_oom_info memcg_oom ; struct uprobe_task *utask ; unsigned int sequential_io ; unsigned int sequential_io_avg ; }; typedef s32 compat_long_t; typedef u32 compat_uptr_t; 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_21707 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_21707 socket_state; struct socket_wq { wait_queue_head_t wait ; struct fasync_struct *fasync_list ; struct callback_head rcu ; }; struct proto_ops; struct socket { socket_state state ; short type ; unsigned long flags ; struct socket_wq *wq ; struct file *file ; struct sock *sk ; struct proto_ops const *ops ; }; struct proto_ops { int family ; struct module *owner ; int (*release)(struct socket * ) ; int (*bind)(struct socket * , struct sockaddr * , int ) ; int (*connect)(struct socket * , struct sockaddr * , int , int ) ; int (*socketpair)(struct socket * , struct socket * ) ; int (*accept)(struct socket * , struct socket * , int ) ; int (*getname)(struct socket * , struct sockaddr * , int * , int ) ; unsigned int (*poll)(struct file * , struct socket * , struct poll_table_struct * ) ; int (*ioctl)(struct socket * , unsigned int , unsigned long ) ; int (*compat_ioctl)(struct socket * , unsigned int , unsigned long ) ; int (*listen)(struct socket * , int ) ; int (*shutdown)(struct socket * , int ) ; int (*setsockopt)(struct socket * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct socket * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct socket * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct socket * , int , int , char * , int * ) ; int (*sendmsg)(struct kiocb * , struct socket * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , struct socket * , struct msghdr * , size_t , int ) ; int (*mmap)(struct file * , struct socket * , struct vm_area_struct * ) ; ssize_t (*sendpage)(struct socket * , struct page * , int , size_t , int ) ; ssize_t (*splice_read)(struct socket * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*set_peek_off)(struct sock * , int ) ; }; struct kmem_cache_cpu { void **freelist ; unsigned long tid ; struct page *page ; struct page *partial ; unsigned int stat[26U] ; }; struct kmem_cache_order_objects { unsigned long x ; }; struct memcg_cache_params; struct kmem_cache_node; struct kmem_cache { struct kmem_cache_cpu *cpu_slab ; unsigned long flags ; unsigned long min_partial ; int size ; int object_size ; int offset ; int cpu_partial ; struct kmem_cache_order_objects oo ; struct kmem_cache_order_objects max ; struct kmem_cache_order_objects min ; gfp_t allocflags ; int refcount ; void (*ctor)(void * ) ; int inuse ; int align ; int reserved ; char const *name ; struct list_head list ; struct kobject kobj ; struct memcg_cache_params *memcg_params ; int max_attr_size ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1024U] ; }; struct __anonstruct____missing_field_name_215 { struct callback_head callback_head ; struct kmem_cache *memcg_caches[0U] ; }; struct __anonstruct____missing_field_name_216 { struct mem_cgroup *memcg ; struct list_head list ; struct kmem_cache *root_cache ; bool dead ; atomic_t nr_pages ; struct work_struct destroy ; }; union __anonunion____missing_field_name_214 { struct __anonstruct____missing_field_name_215 __annonCompField63 ; struct __anonstruct____missing_field_name_216 __annonCompField64 ; }; struct memcg_cache_params { bool is_root_cache ; union __anonunion____missing_field_name_214 __annonCompField65 ; }; struct exception_table_entry { int insn ; int fixup ; }; struct in6_addr; struct sk_buff; struct dma_attrs { unsigned long flags[1U] ; }; enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ; struct dma_map_ops { void *(*alloc)(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ) ; void (*free)(struct device * , size_t , void * , dma_addr_t , struct dma_attrs * ) ; int (*mmap)(struct device * , struct vm_area_struct * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; int (*get_sgtable)(struct device * , struct sg_table * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; dma_addr_t (*map_page)(struct device * , struct page * , unsigned long , size_t , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_page)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ) ; int (*map_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*sync_single_for_cpu)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_single_for_device)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_sg_for_cpu)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; void (*sync_sg_for_device)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; int (*mapping_error)(struct device * , dma_addr_t ) ; int (*dma_supported)(struct device * , u64 ) ; int (*set_dma_mask)(struct device * , u64 ) ; int is_phys ; }; typedef u64 netdev_features_t; struct nf_conntrack { atomic_t use ; }; struct nf_bridge_info { atomic_t use ; unsigned int mask ; struct net_device *physindev ; struct net_device *physoutdev ; unsigned long data[4U] ; }; struct sk_buff_head { struct sk_buff *next ; struct sk_buff *prev ; __u32 qlen ; spinlock_t lock ; }; typedef unsigned int sk_buff_data_t; struct sec_path; struct __anonstruct____missing_field_name_220 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion____missing_field_name_219 { __wsum csum ; struct __anonstruct____missing_field_name_220 __annonCompField67 ; }; union __anonunion____missing_field_name_221 { unsigned int napi_id ; dma_cookie_t dma_cookie ; }; union __anonunion____missing_field_name_222 { __u32 mark ; __u32 dropcount ; __u32 reserved_tailroom ; }; struct sk_buff { struct sk_buff *next ; struct sk_buff *prev ; ktime_t tstamp ; struct sock *sk ; struct net_device *dev ; char cb[48U] ; unsigned long _skb_refdst ; struct sec_path *sp ; unsigned int len ; unsigned int data_len ; __u16 mac_len ; __u16 hdr_len ; union __anonunion____missing_field_name_219 __annonCompField68 ; __u32 priority ; __u8 local_df : 1 ; __u8 cloned : 1 ; __u8 ip_summed : 2 ; __u8 nohdr : 1 ; __u8 nfctinfo : 3 ; __u8 pkt_type : 3 ; __u8 fclone : 2 ; __u8 ipvs_property : 1 ; __u8 peeked : 1 ; __u8 nf_trace : 1 ; __be16 protocol ; void (*destructor)(struct sk_buff * ) ; struct nf_conntrack *nfct ; struct nf_bridge_info *nf_bridge ; int skb_iif ; __u32 rxhash ; __be16 vlan_proto ; __u16 vlan_tci ; __u16 tc_index ; __u16 tc_verd ; __u16 queue_mapping ; __u8 ndisc_nodetype : 2 ; __u8 pfmemalloc : 1 ; __u8 ooo_okay : 1 ; __u8 l4_rxhash : 1 ; __u8 wifi_acked_valid : 1 ; __u8 wifi_acked : 1 ; __u8 no_fcs : 1 ; __u8 head_frag : 1 ; __u8 encapsulation : 1 ; union __anonunion____missing_field_name_221 __annonCompField69 ; __u32 secmark ; union __anonunion____missing_field_name_222 __annonCompField70 ; __be16 inner_protocol ; __u16 inner_transport_header ; __u16 inner_network_header ; __u16 inner_mac_header ; __u16 transport_header ; __u16 network_header ; __u16 mac_header ; sk_buff_data_t tail ; sk_buff_data_t end ; unsigned char *head ; unsigned char *data ; unsigned int truesize ; atomic_t users ; }; struct dst_entry; struct rtable; struct ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_proto ; }; struct ethtool_cmd { __u32 cmd ; __u32 supported ; __u32 advertising ; __u16 speed ; __u8 duplex ; __u8 port ; __u8 phy_address ; __u8 transceiver ; __u8 autoneg ; __u8 mdio_support ; __u32 maxtxpkt ; __u32 maxrxpkt ; __u16 speed_hi ; __u8 eth_tp_mdix ; __u8 eth_tp_mdix_ctrl ; __u32 lp_advertising ; __u32 reserved[2U] ; }; struct ethtool_drvinfo { __u32 cmd ; char driver[32U] ; char version[32U] ; char fw_version[32U] ; char bus_info[32U] ; char reserved1[32U] ; char reserved2[12U] ; __u32 n_priv_flags ; __u32 n_stats ; __u32 testinfo_len ; __u32 eedump_len ; __u32 regdump_len ; }; struct ethtool_wolinfo { __u32 cmd ; __u32 supported ; __u32 wolopts ; __u8 sopass[6U] ; }; struct ethtool_regs { __u32 cmd ; __u32 version ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eeprom { __u32 cmd ; __u32 magic ; __u32 offset ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eee { __u32 cmd ; __u32 supported ; __u32 advertised ; __u32 lp_advertised ; __u32 eee_active ; __u32 eee_enabled ; __u32 tx_lpi_enabled ; __u32 tx_lpi_timer ; __u32 reserved[2U] ; }; struct ethtool_modinfo { __u32 cmd ; __u32 type ; __u32 eeprom_len ; __u32 reserved[8U] ; }; struct ethtool_coalesce { __u32 cmd ; __u32 rx_coalesce_usecs ; __u32 rx_max_coalesced_frames ; __u32 rx_coalesce_usecs_irq ; __u32 rx_max_coalesced_frames_irq ; __u32 tx_coalesce_usecs ; __u32 tx_max_coalesced_frames ; __u32 tx_coalesce_usecs_irq ; __u32 tx_max_coalesced_frames_irq ; __u32 stats_block_coalesce_usecs ; __u32 use_adaptive_rx_coalesce ; __u32 use_adaptive_tx_coalesce ; __u32 pkt_rate_low ; __u32 rx_coalesce_usecs_low ; __u32 rx_max_coalesced_frames_low ; __u32 tx_coalesce_usecs_low ; __u32 tx_max_coalesced_frames_low ; __u32 pkt_rate_high ; __u32 rx_coalesce_usecs_high ; __u32 rx_max_coalesced_frames_high ; __u32 tx_coalesce_usecs_high ; __u32 tx_max_coalesced_frames_high ; __u32 rate_sample_interval ; }; struct ethtool_ringparam { __u32 cmd ; __u32 rx_max_pending ; __u32 rx_mini_max_pending ; __u32 rx_jumbo_max_pending ; __u32 tx_max_pending ; __u32 rx_pending ; __u32 rx_mini_pending ; __u32 rx_jumbo_pending ; __u32 tx_pending ; }; struct ethtool_channels { __u32 cmd ; __u32 max_rx ; __u32 max_tx ; __u32 max_other ; __u32 max_combined ; __u32 rx_count ; __u32 tx_count ; __u32 other_count ; __u32 combined_count ; }; struct ethtool_pauseparam { __u32 cmd ; __u32 autoneg ; __u32 rx_pause ; __u32 tx_pause ; }; struct ethtool_test { __u32 cmd ; __u32 flags ; __u32 reserved ; __u32 len ; __u64 data[0U] ; }; struct ethtool_stats { __u32 cmd ; __u32 n_stats ; __u64 data[0U] ; }; struct ethtool_tcpip4_spec { __be32 ip4src ; __be32 ip4dst ; __be16 psrc ; __be16 pdst ; __u8 tos ; }; struct ethtool_ah_espip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 spi ; __u8 tos ; }; struct ethtool_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union ethtool_flow_union { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[52U] ; }; struct ethtool_flow_ext { __u8 padding[2U] ; unsigned char h_dest[6U] ; __be16 vlan_etype ; __be16 vlan_tci ; __be32 data[2U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union ethtool_flow_union h_u ; struct ethtool_flow_ext h_ext ; union ethtool_flow_union m_u ; struct ethtool_flow_ext m_ext ; __u64 ring_cookie ; __u32 location ; }; struct ethtool_rxnfc { __u32 cmd ; __u32 flow_type ; __u64 data ; struct ethtool_rx_flow_spec fs ; __u32 rule_cnt ; __u32 rule_locs[0U] ; }; struct ethtool_flash { __u32 cmd ; __u32 region ; char data[128U] ; }; struct ethtool_dump { __u32 cmd ; __u32 version ; __u32 flag ; __u32 len ; __u8 data[0U] ; }; struct ethtool_ts_info { __u32 cmd ; __u32 so_timestamping ; __s32 phc_index ; __u32 tx_types ; __u32 tx_reserved[3U] ; __u32 rx_filters ; __u32 rx_reserved[3U] ; }; enum ethtool_phys_id_state { ETHTOOL_ID_INACTIVE = 0, ETHTOOL_ID_ACTIVE = 1, ETHTOOL_ID_ON = 2, ETHTOOL_ID_OFF = 3 } ; struct ethtool_ops { int (*get_settings)(struct net_device * , struct ethtool_cmd * ) ; int (*set_settings)(struct net_device * , struct ethtool_cmd * ) ; void (*get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) ; int (*get_regs_len)(struct net_device * ) ; void (*get_regs)(struct net_device * , struct ethtool_regs * , void * ) ; void (*get_wol)(struct net_device * , struct ethtool_wolinfo * ) ; int (*set_wol)(struct net_device * , struct ethtool_wolinfo * ) ; u32 (*get_msglevel)(struct net_device * ) ; void (*set_msglevel)(struct net_device * , u32 ) ; int (*nway_reset)(struct net_device * ) ; u32 (*get_link)(struct net_device * ) ; int (*get_eeprom_len)(struct net_device * ) ; int (*get_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; int (*set_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*get_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*set_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; void (*get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; int (*set_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; void (*self_test)(struct net_device * , struct ethtool_test * , u64 * ) ; void (*get_strings)(struct net_device * , u32 , u8 * ) ; int (*set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) ; void (*get_ethtool_stats)(struct net_device * , struct ethtool_stats * , u64 * ) ; int (*begin)(struct net_device * ) ; void (*complete)(struct net_device * ) ; u32 (*get_priv_flags)(struct net_device * ) ; int (*set_priv_flags)(struct net_device * , u32 ) ; int (*get_sset_count)(struct net_device * , int ) ; int (*get_rxnfc)(struct net_device * , struct ethtool_rxnfc * , u32 * ) ; int (*set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*flash_device)(struct net_device * , struct ethtool_flash * ) ; int (*reset)(struct net_device * , u32 * ) ; u32 (*get_rxfh_indir_size)(struct net_device * ) ; int (*get_rxfh_indir)(struct net_device * , u32 * ) ; int (*set_rxfh_indir)(struct net_device * , u32 const * ) ; void (*get_channels)(struct net_device * , struct ethtool_channels * ) ; int (*set_channels)(struct net_device * , struct ethtool_channels * ) ; int (*get_dump_flag)(struct net_device * , struct ethtool_dump * ) ; int (*get_dump_data)(struct net_device * , struct ethtool_dump * , void * ) ; int (*set_dump)(struct net_device * , struct ethtool_dump * ) ; int (*get_ts_info)(struct net_device * , struct ethtool_ts_info * ) ; int (*get_module_info)(struct net_device * , struct ethtool_modinfo * ) ; int (*get_module_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_eee)(struct net_device * , struct ethtool_eee * ) ; int (*set_eee)(struct net_device * , struct ethtool_eee * ) ; }; struct prot_inuse; struct netns_core { struct ctl_table_header *sysctl_hdr ; int sysctl_somaxconn ; struct prot_inuse *inuse ; }; struct u64_stats_sync { }; struct ipstats_mib { u64 mibs[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[8U] ; }; struct linux_mib { unsigned long mibs[97U] ; }; struct linux_xfrm_mib { unsigned long mibs[29U] ; }; struct proc_dir_entry; struct netns_mib { struct tcp_mib *tcp_statistics[1U] ; struct ipstats_mib *ip_statistics[1U] ; struct linux_mib *net_statistics[1U] ; struct udp_mib *udp_statistics[1U] ; struct udp_mib *udplite_statistics[1U] ; struct icmp_mib *icmp_statistics[1U] ; struct icmpmsg_mib *icmpmsg_statistics ; struct proc_dir_entry *proc_net_devsnmp6 ; struct udp_mib *udp_stats_in6[1U] ; struct udp_mib *udplite_stats_in6[1U] ; struct ipstats_mib *ipv6_statistics[1U] ; struct icmpv6_mib *icmpv6_statistics[1U] ; struct icmpv6msg_mib *icmpv6msg_statistics ; struct linux_xfrm_mib *xfrm_statistics[1U] ; }; struct netns_unix { int sysctl_max_dgram_qlen ; struct ctl_table_header *ctl ; }; struct netns_packet { struct mutex sklist_lock ; struct hlist_head sklist ; }; struct netns_frags { int nqueues ; struct list_head lru_list ; spinlock_t lru_lock ; struct percpu_counter mem ; int timeout ; int high_thresh ; int low_thresh ; }; struct tcpm_hash_bucket; struct ipv4_devconf; struct fib_rules_ops; struct fib_table; struct local_ports { seqlock_t lock ; int 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 ; struct sock *fibnl ; struct sock **icmp_sk ; struct inet_peer_base *peers ; struct tcpm_hash_bucket *tcp_metrics_hash ; unsigned int tcp_metrics_hash_log ; struct netns_frags frags ; struct xt_table *iptable_filter ; struct xt_table *iptable_mangle ; struct xt_table *iptable_raw ; struct xt_table *arptable_filter ; struct xt_table *iptable_security ; struct xt_table *nat_table ; int sysctl_icmp_echo_ignore_all ; int sysctl_icmp_echo_ignore_broadcasts ; int sysctl_icmp_ignore_bogus_error_responses ; int sysctl_icmp_ratelimit ; int sysctl_icmp_ratemask ; int sysctl_icmp_errors_use_inbound_ifaddr ; struct local_ports sysctl_local_ports ; int sysctl_tcp_ecn ; int sysctl_ip_no_pmtu_disc ; int sysctl_ip_fwd_use_pmtu ; kgid_t sysctl_ping_group_range[2U] ; atomic_t dev_addr_genid ; struct list_head mr_tables ; struct fib_rules_ops *mr_rules_ops ; atomic_t rt_genid ; }; struct neighbour; struct dst_ops { unsigned short family ; __be16 protocol ; unsigned int gc_thresh ; int (*gc)(struct dst_ops * ) ; struct dst_entry *(*check)(struct dst_entry * , __u32 ) ; unsigned int (*default_advmss)(struct dst_entry const * ) ; unsigned int (*mtu)(struct dst_entry const * ) ; u32 *(*cow_metrics)(struct dst_entry * , unsigned long ) ; void (*destroy)(struct dst_entry * ) ; void (*ifdown)(struct dst_entry * , struct net_device * , int ) ; struct dst_entry *(*negative_advice)(struct dst_entry * ) ; void (*link_failure)(struct sk_buff * ) ; void (*update_pmtu)(struct dst_entry * , struct sock * , struct sk_buff * , u32 ) ; void (*redirect)(struct dst_entry * , struct sock * , struct sk_buff * ) ; int (*local_out)(struct sk_buff * ) ; struct neighbour *(*neigh_lookup)(struct dst_entry const * , struct sk_buff * , void const * ) ; struct kmem_cache *kmem_cachep ; struct percpu_counter pcpuc_entries ; }; struct netns_sysctl_ipv6 { struct ctl_table_header *hdr ; struct ctl_table_header *route_hdr ; struct ctl_table_header *icmp_hdr ; struct ctl_table_header *frags_hdr ; 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 icmpv6_time ; int anycast_src_echo_reply ; }; struct ipv6_devconf; struct rt6_info; struct rt6_statistics; struct fib6_table; struct netns_ipv6 { struct netns_sysctl_ipv6 sysctl ; struct ipv6_devconf *devconf_all ; struct ipv6_devconf *devconf_dflt ; struct inet_peer_base *peers ; struct netns_frags frags ; struct xt_table *ip6table_filter ; struct xt_table *ip6table_mangle ; struct xt_table *ip6table_raw ; struct xt_table *ip6table_security ; struct xt_table *ip6table_nat ; struct rt6_info *ip6_null_entry ; struct rt6_statistics *rt6_stats ; struct timer_list ip6_fib_timer ; struct hlist_head *fib_table_hash ; struct fib6_table *fib6_main_tbl ; struct dst_ops ip6_dst_ops ; unsigned int ip6_rt_gc_expire ; unsigned long ip6_rt_last_gc ; struct rt6_info *ip6_prohibit_entry ; struct rt6_info *ip6_blk_hole_entry ; struct fib6_table *fib6_local_tbl ; struct fib_rules_ops *fib6_rules_ops ; struct sock **icmp_sk ; struct sock *ndisc_sk ; struct sock *tcp_sk ; struct sock *igmp_sk ; struct list_head mr6_tables ; struct fib_rules_ops *mr6_rules_ops ; atomic_t dev_addr_genid ; atomic_t rt_genid ; }; struct netns_nf_frag { struct netns_sysctl_ipv6 sysctl ; struct netns_frags frags ; }; struct sctp_mib; struct netns_sctp { struct sctp_mib *sctp_statistics[1U] ; struct proc_dir_entry *proc_net_sctp ; struct ctl_table_header *sysctl_header ; struct sock *ctl_sock ; struct list_head local_addr_list ; struct list_head addr_waitq ; struct timer_list addr_wq_timer ; struct list_head auto_asconf_splist ; spinlock_t addr_wq_lock ; spinlock_t local_addr_lock ; unsigned int rto_initial ; unsigned int rto_min ; unsigned int rto_max ; int rto_alpha ; int rto_beta ; int max_burst ; int cookie_preserve_enable ; char *sctp_hmac_alg ; unsigned int valid_cookie_life ; unsigned int sack_timeout ; unsigned int hb_interval ; int max_retrans_association ; int max_retrans_path ; int max_retrans_init ; int pf_retrans ; int sndbuf_policy ; int rcvbuf_policy ; int default_auto_asconf ; int addip_enable ; int addip_noauth ; int prsctp_enable ; int auth_enable ; int scope_policy ; int rwnd_upd_shift ; unsigned long max_autoclose ; }; struct netns_dccp { struct sock *v4_ctl_sk ; struct sock *v6_ctl_sk ; }; union __anonunion_in6_u_225 { __u8 u6_addr8[16U] ; __be16 u6_addr16[8U] ; __be32 u6_addr32[4U] ; }; struct in6_addr { union __anonunion_in6_u_225 in6_u ; }; struct nlattr; 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 ; struct ebt_table *broute_table ; struct ebt_table *frame_filter ; struct ebt_table *frame_nat ; bool ulog_warn_deprecated ; bool ebt_ulog_warn_deprecated ; }; struct hlist_nulls_node; struct hlist_nulls_head { struct hlist_nulls_node *first ; }; struct hlist_nulls_node { struct hlist_nulls_node *next ; struct hlist_nulls_node **pprev ; }; struct nf_proto_net { struct ctl_table_header *ctl_table_header ; struct ctl_table *ctl_table ; struct ctl_table_header *ctl_compat_header ; struct ctl_table *ctl_compat_table ; unsigned int users ; }; struct nf_generic_net { struct nf_proto_net pn ; unsigned int timeout ; }; struct nf_tcp_net { struct nf_proto_net pn ; unsigned int timeouts[14U] ; unsigned int tcp_loose ; unsigned int tcp_be_liberal ; unsigned int tcp_max_retrans ; }; struct nf_udp_net { struct nf_proto_net pn ; unsigned int timeouts[2U] ; }; struct nf_icmp_net { struct nf_proto_net pn ; unsigned int timeout ; }; struct nf_ip_net { struct nf_generic_net generic ; struct nf_tcp_net tcp ; struct nf_udp_net udp ; struct nf_icmp_net icmp ; struct nf_icmp_net icmpv6 ; struct ctl_table_header *ctl_table_header ; struct ctl_table *ctl_table ; }; struct ip_conntrack_stat; struct nf_ct_event_notifier; struct nf_exp_event_notifier; struct netns_ct { atomic_t count ; unsigned int expect_count ; 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 ; unsigned int sysctl_events_retry_timeout ; 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 ; struct kmem_cache *nf_conntrack_cachep ; struct hlist_nulls_head *hash ; struct hlist_head *expect_hash ; struct hlist_nulls_head unconfirmed ; struct hlist_nulls_head dying ; struct hlist_nulls_head tmpl ; 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 ; u8 gencursor ; u8 genctr ; }; struct xfrm_policy_hash { struct hlist_head *table ; unsigned int hmask ; }; struct netns_xfrm { struct list_head state_all ; struct hlist_head *state_bydst ; struct hlist_head *state_bysrc ; struct hlist_head *state_byspi ; unsigned int state_hmask ; unsigned int state_num ; struct work_struct state_hash_work ; struct hlist_head state_gc_list ; struct work_struct state_gc_work ; struct list_head policy_all ; struct hlist_head *policy_byidx ; unsigned int policy_idx_hmask ; struct hlist_head policy_inexact[6U] ; struct xfrm_policy_hash policy_bydst[6U] ; unsigned int policy_count[6U] ; struct work_struct policy_hash_work ; struct sock *nlsk ; struct sock *nlsk_stash ; u32 sysctl_aevent_etime ; u32 sysctl_aevent_rseqth ; int sysctl_larval_drop ; u32 sysctl_acq_expires ; struct ctl_table_header *sysctl_hdr ; struct dst_ops xfrm4_dst_ops ; struct dst_ops xfrm6_dst_ops ; spinlock_t xfrm_state_lock ; spinlock_t xfrm_policy_sk_bundle_lock ; rwlock_t xfrm_policy_lock ; struct mutex xfrm_cfg_mutex ; }; struct net_generic; struct netns_ipvs; struct net { atomic_t passive ; atomic_t count ; spinlock_t rules_mod_lock ; struct list_head list ; struct list_head cleanup_list ; struct list_head exit_list ; struct user_namespace *user_ns ; unsigned int proc_inum ; struct proc_dir_entry *proc_net ; struct proc_dir_entry *proc_net_stat ; struct ctl_table_set sysctls ; struct sock *rtnl ; struct sock *genl_sock ; struct list_head dev_base_head ; struct hlist_head *dev_name_head ; struct hlist_head *dev_index_head ; unsigned int dev_base_seq ; int ifindex ; 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_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 sock *diag_nlsk ; atomic_t fnhe_genid ; }; struct dsa_chip_data { struct device *mii_bus ; int sw_addr ; char *port_names[12U] ; s8 *rtable ; }; struct dsa_platform_data { struct device *netdev ; int nr_chips ; struct dsa_chip_data *chip ; }; struct dsa_switch; struct dsa_switch_tree { struct dsa_platform_data *pd ; struct net_device *master_netdev ; __be16 tag_protocol ; s8 cpu_switch ; s8 cpu_port ; int link_poll_needed ; struct work_struct link_poll_work ; struct timer_list link_poll_timer ; struct dsa_switch *ds[4U] ; }; struct dsa_switch_driver; struct mii_bus; struct dsa_switch { struct dsa_switch_tree *dst ; int index ; struct dsa_chip_data *pd ; struct dsa_switch_driver *drv ; struct mii_bus *master_mii_bus ; u32 dsa_port_mask ; u32 phys_port_mask ; struct mii_bus *slave_mii_bus ; struct net_device *ports[12U] ; }; struct dsa_switch_driver { struct list_head list ; __be16 tag_protocol ; int priv_size ; char *(*probe)(struct mii_bus * , int ) ; int (*setup)(struct dsa_switch * ) ; int (*set_addr)(struct dsa_switch * , u8 * ) ; int (*phy_read)(struct dsa_switch * , int , int ) ; int (*phy_write)(struct dsa_switch * , int , int , u16 ) ; void (*poll_link)(struct dsa_switch * ) ; void (*get_strings)(struct dsa_switch * , int , uint8_t * ) ; void (*get_ethtool_stats)(struct dsa_switch * , int , uint64_t * ) ; int (*get_sset_count)(struct dsa_switch * ) ; }; struct ieee_ets { __u8 willing ; __u8 ets_cap ; __u8 cbs ; __u8 tc_tx_bw[8U] ; __u8 tc_rx_bw[8U] ; __u8 tc_tsa[8U] ; __u8 prio_tc[8U] ; __u8 tc_reco_bw[8U] ; __u8 tc_reco_tsa[8U] ; __u8 reco_prio_tc[8U] ; }; struct ieee_maxrate { __u64 tc_maxrate[8U] ; }; struct ieee_pfc { __u8 pfc_cap ; __u8 pfc_en ; __u8 mbc ; __u16 delay ; __u64 requests[8U] ; __u64 indications[8U] ; }; struct cee_pg { __u8 willing ; __u8 error ; __u8 pg_en ; __u8 tcs_supported ; __u8 pg_bw[8U] ; __u8 prio_pg[8U] ; }; struct cee_pfc { __u8 willing ; __u8 error ; __u8 pfc_en ; __u8 tcs_supported ; }; struct dcb_app { __u8 selector ; __u8 priority ; __u16 protocol ; }; struct dcb_peer_app_info { __u8 willing ; __u8 error ; }; struct dcbnl_rtnl_ops { int (*ieee_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_setets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_getmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_setmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_getpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_setpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_getapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_setapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_delapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_peer_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_peer_getpfc)(struct net_device * , struct ieee_pfc * ) ; u8 (*getstate)(struct net_device * ) ; u8 (*setstate)(struct net_device * , u8 ) ; void (*getpermhwaddr)(struct net_device * , u8 * ) ; void (*setpgtccfgtx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgtx)(struct net_device * , int , u8 ) ; void (*setpgtccfgrx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgrx)(struct net_device * , int , u8 ) ; void (*getpgtccfgtx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgtx)(struct net_device * , int , u8 * ) ; void (*getpgtccfgrx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgrx)(struct net_device * , int , u8 * ) ; void (*setpfccfg)(struct net_device * , int , u8 ) ; void (*getpfccfg)(struct net_device * , int , u8 * ) ; u8 (*setall)(struct net_device * ) ; u8 (*getcap)(struct net_device * , int , u8 * ) ; int (*getnumtcs)(struct net_device * , int , u8 * ) ; int (*setnumtcs)(struct net_device * , int , u8 ) ; u8 (*getpfcstate)(struct net_device * ) ; void (*setpfcstate)(struct net_device * , u8 ) ; void (*getbcncfg)(struct net_device * , int , u32 * ) ; void (*setbcncfg)(struct net_device * , int , u32 ) ; void (*getbcnrp)(struct net_device * , int , u8 * ) ; void (*setbcnrp)(struct net_device * , int , u8 ) ; u8 (*setapp)(struct net_device * , u8 , u16 , u8 ) ; u8 (*getapp)(struct net_device * , u8 , u16 ) ; u8 (*getfeatcfg)(struct net_device * , int , u8 * ) ; u8 (*setfeatcfg)(struct net_device * , int , u8 ) ; u8 (*getdcbx)(struct net_device * ) ; u8 (*setdcbx)(struct net_device * , u8 ) ; int (*peer_getappinfo)(struct net_device * , struct dcb_peer_app_info * , u16 * ) ; int (*peer_getapptable)(struct net_device * , struct dcb_app * ) ; int (*cee_peer_getpg)(struct net_device * , struct cee_pg * ) ; int (*cee_peer_getpfc)(struct net_device * , struct cee_pfc * ) ; }; struct taskstats { __u16 version ; __u32 ac_exitcode ; __u8 ac_flag ; __u8 ac_nice ; __u64 cpu_count ; __u64 cpu_delay_total ; __u64 blkio_count ; __u64 blkio_delay_total ; __u64 swapin_count ; __u64 swapin_delay_total ; __u64 cpu_run_real_total ; __u64 cpu_run_virtual_total ; char ac_comm[32U] ; __u8 ac_sched ; __u8 ac_pad[3U] ; __u32 ac_uid ; __u32 ac_gid ; __u32 ac_pid ; __u32 ac_ppid ; __u32 ac_btime ; __u64 ac_etime ; __u64 ac_utime ; __u64 ac_stime ; __u64 ac_minflt ; __u64 ac_majflt ; __u64 coremem ; __u64 virtmem ; __u64 hiwater_rss ; __u64 hiwater_vm ; __u64 read_char ; __u64 write_char ; __u64 read_syscalls ; __u64 write_syscalls ; __u64 read_bytes ; __u64 write_bytes ; __u64 cancelled_write_bytes ; __u64 nvcsw ; __u64 nivcsw ; __u64 ac_utimescaled ; __u64 ac_stimescaled ; __u64 cpu_scaled_run_real_total ; __u64 freepages_count ; __u64 freepages_delay_total ; }; struct xattr_handler { char const *prefix ; int flags ; size_t (*list)(struct dentry * , char * , size_t , char const * , size_t , int ) ; int (*get)(struct dentry * , char const * , void * , size_t , int ) ; int (*set)(struct dentry * , char const * , void const * , size_t , int , int ) ; }; struct simple_xattrs { struct list_head head ; spinlock_t lock ; }; struct percpu_ref; typedef void percpu_ref_func_t(struct percpu_ref * ); struct percpu_ref { atomic_t count ; unsigned int *pcpu_count ; percpu_ref_func_t *release ; percpu_ref_func_t *confirm_kill ; struct callback_head rcu ; }; struct cgroupfs_root; struct cgroup_subsys; struct cgroup; struct cgroup_subsys_state { struct cgroup *cgroup ; struct cgroup_subsys *ss ; struct percpu_ref refcnt ; struct cgroup_subsys_state *parent ; unsigned long flags ; struct callback_head callback_head ; struct work_struct destroy_work ; }; struct cgroup_name { struct callback_head callback_head ; char name[] ; }; struct cgroup { unsigned long flags ; int id ; int nr_css ; struct list_head sibling ; struct list_head children ; struct list_head files ; struct cgroup *parent ; struct dentry *dentry ; u64 serial_nr ; struct cgroup_name *name ; struct cgroup_subsys_state *subsys[12U] ; struct cgroupfs_root *root ; struct list_head cset_links ; struct list_head release_list ; struct list_head pidlists ; struct mutex pidlist_mutex ; struct cgroup_subsys_state dummy_css ; struct callback_head callback_head ; struct work_struct destroy_work ; struct simple_xattrs xattrs ; }; struct cgroupfs_root { struct super_block *sb ; unsigned long subsys_mask ; int hierarchy_id ; struct cgroup top_cgroup ; int number_of_cgroups ; struct list_head root_list ; unsigned long flags ; struct idr cgroup_idr ; char release_agent_path[4096U] ; char name[64U] ; }; struct css_set { atomic_t refcount ; struct hlist_node hlist ; struct list_head tasks ; struct list_head cgrp_links ; struct cgroup_subsys_state *subsys[12U] ; struct callback_head callback_head ; }; struct cftype { char name[64U] ; int private ; umode_t mode ; size_t max_write_len ; unsigned int flags ; struct cgroup_subsys *ss ; 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 ) ; int (*write_string)(struct cgroup_subsys_state * , struct cftype * , char const * ) ; int (*trigger)(struct cgroup_subsys_state * , unsigned int ) ; }; struct cftype_set { struct list_head node ; struct cftype *cfts ; }; struct cgroup_taskset; 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_free)(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 subsys_id ; int disabled ; int early_init ; bool broken_hierarchy ; bool warned_broken_hierarchy ; char const *name ; struct cgroupfs_root *root ; struct list_head cftsets ; struct cftype *base_cftypes ; struct cftype_set base_cftset ; struct module *module ; }; enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ; typedef enum irqreturn irqreturn_t; 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_info { __u32 vf ; __u8 mac[32U] ; __u32 vlan ; __u32 qos ; __u32 tx_rate ; __u32 spoofchk ; __u32 linkstate ; }; struct netpoll_info; struct phy_device; struct wireless_dev; enum netdev_tx { __NETDEV_TX_MIN = (-0x7FFFFFFF-1), NETDEV_TX_OK = 0, NETDEV_TX_BUSY = 16, NETDEV_TX_LOCKED = 32 } ; typedef enum netdev_tx netdev_tx_t; struct net_device_stats { unsigned long rx_packets ; unsigned long tx_packets ; unsigned long rx_bytes ; unsigned long tx_bytes ; unsigned long rx_errors ; unsigned long tx_errors ; unsigned long rx_dropped ; unsigned long tx_dropped ; unsigned long multicast ; unsigned long collisions ; unsigned long rx_length_errors ; unsigned long rx_over_errors ; unsigned long rx_crc_errors ; unsigned long rx_frame_errors ; unsigned long rx_fifo_errors ; unsigned long rx_missed_errors ; unsigned long tx_aborted_errors ; unsigned long tx_carrier_errors ; unsigned long tx_fifo_errors ; unsigned long tx_heartbeat_errors ; unsigned long tx_window_errors ; unsigned long rx_compressed ; unsigned long tx_compressed ; }; struct neigh_parms; struct netdev_hw_addr { 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 (*rebuild)(struct sk_buff * ) ; int (*cache)(struct neighbour const * , struct hh_cache * , __be16 ) ; void (*cache_update)(struct hh_cache * , struct net_device const * , unsigned char const * ) ; }; 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 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 ; }; 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_port_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 * , gfp_t ) ; 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_tx_rate)(struct net_device * , int , int ) ; int (*ndo_set_vf_spoofchk)(struct net_device * , int , bool ) ; int (*ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) ; int (*ndo_set_vf_link_state)(struct net_device * , int , int ) ; int (*ndo_set_vf_port)(struct net_device * , int , struct nlattr ** ) ; int (*ndo_get_vf_port)(struct net_device * , int , struct sk_buff * ) ; int (*ndo_setup_tc)(struct net_device * , u8 ) ; int (*ndo_fcoe_enable)(struct net_device * ) ; int (*ndo_fcoe_disable)(struct net_device * ) ; int (*ndo_fcoe_ddp_setup)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_ddp_done)(struct net_device * , u16 ) ; int (*ndo_fcoe_ddp_target)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_get_hbainfo)(struct net_device * , struct netdev_fcoe_hbainfo * ) ; int (*ndo_fcoe_get_wwn)(struct net_device * , u64 * , int ) ; int (*ndo_rx_flow_steer)(struct net_device * , struct sk_buff const * , u16 , u32 ) ; int (*ndo_add_slave)(struct net_device * , struct net_device * ) ; int (*ndo_del_slave)(struct net_device * , struct net_device * ) ; netdev_features_t (*ndo_fix_features)(struct net_device * , netdev_features_t ) ; int (*ndo_set_features)(struct net_device * , netdev_features_t ) ; int (*ndo_neigh_construct)(struct neighbour * ) ; void (*ndo_neigh_destroy)(struct neighbour * ) ; int (*ndo_fdb_add)(struct ndmsg * , struct nlattr ** , struct net_device * , unsigned char const * , u16 ) ; int (*ndo_fdb_del)(struct ndmsg * , struct nlattr ** , struct net_device * , unsigned char const * ) ; int (*ndo_fdb_dump)(struct sk_buff * , struct netlink_callback * , struct net_device * , int ) ; int (*ndo_bridge_setlink)(struct net_device * , struct nlmsghdr * ) ; int (*ndo_bridge_getlink)(struct sk_buff * , u32 , u32 , struct net_device * , u32 ) ; int (*ndo_bridge_dellink)(struct net_device * , struct nlmsghdr * ) ; int (*ndo_change_carrier)(struct net_device * , bool ) ; int (*ndo_get_phys_port_id)(struct net_device * , struct netdev_phys_port_id * ) ; 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 * ) ; }; enum ldv_28065 { NETREG_UNINITIALIZED = 0, NETREG_REGISTERED = 1, NETREG_UNREGISTERING = 2, NETREG_UNREGISTERED = 3, NETREG_RELEASED = 4, NETREG_DUMMY = 5 } ; enum ldv_28066 { RTNL_LINK_INITIALIZED = 0, RTNL_LINK_INITIALIZING = 1 } ; struct __anonstruct_adj_list_236 { struct list_head upper ; struct list_head lower ; }; struct __anonstruct_all_adj_list_237 { struct list_head upper ; struct list_head lower ; }; struct iw_handler_def; struct iw_public_data; struct forwarding_accel_ops; struct vlan_info; struct tipc_bearer; struct in_device; struct dn_dev; struct inet6_dev; struct cpu_rmap; struct pcpu_lstats; struct pcpu_sw_netstats; struct pcpu_dstats; struct pcpu_vstats; union __anonunion____missing_field_name_238 { 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 ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_list ; struct list_head close_list ; struct __anonstruct_adj_list_236 adj_list ; struct __anonstruct_all_adj_list_237 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 iflink ; struct net_device_stats stats ; atomic_long_t rx_dropped ; struct iw_handler_def const *wireless_handlers ; struct iw_public_data *wireless_data ; struct net_device_ops const *netdev_ops ; struct ethtool_ops const *ethtool_ops ; struct forwarding_accel_ops const *fwd_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 ; spinlock_t addr_list_lock ; struct netdev_hw_addr_list uc ; struct netdev_hw_addr_list mc ; struct netdev_hw_addr_list dev_addrs ; struct kset *queues_kset ; bool uc_promisc ; 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 ; unsigned long last_rx ; unsigned char *dev_addr ; struct netdev_rx_queue *_rx ; unsigned int num_rx_queues ; unsigned int real_num_rx_queues ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; struct netdev_queue *ingress_queue ; unsigned char broadcast[32U] ; struct netdev_queue *_tx ; unsigned int num_tx_queues ; unsigned int real_num_tx_queues ; struct Qdisc *qdisc ; unsigned long tx_queue_len ; spinlock_t tx_global_lock ; struct xps_dev_maps *xps_maps ; struct cpu_rmap *rx_cpu_rmap ; unsigned long trans_start ; int watchdog_timeo ; struct timer_list watchdog_timer ; int *pcpu_refcnt ; struct list_head todo_list ; struct hlist_node index_hlist ; struct list_head link_watch_list ; enum ldv_28065 reg_state : 8 ; bool dismantle ; enum ldv_28066 rtnl_link_state : 16 ; void (*destructor)(struct net_device * ) ; struct netpoll_info *npinfo ; struct net *nd_net ; union __anonunion____missing_field_name_238 __annonCompField74 ; 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 ; struct dcbnl_rtnl_ops const *dcbnl_ops ; u8 num_tc ; struct netdev_tc_txq tc_to_txq[16U] ; u8 prio_tc_map[16U] ; unsigned int fcoe_ddp_xid ; struct netprio_map *priomap ; struct phy_device *phydev ; struct lock_class_key *qdisc_tx_busylock ; int group ; struct pm_qos_request pm_qos_req ; }; struct pcpu_sw_netstats { u64 rx_packets ; u64 rx_bytes ; u64 tx_packets ; u64 tx_bytes ; struct u64_stats_sync syncp ; }; 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; struct pcie_link_state; struct pci_vpd; struct pci_sriov; struct pci_ats; struct pci_driver; union __anonunion____missing_field_name_242 { 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 ; u8 pcie_mpss : 3 ; u8 rom_base_reg ; u8 pin ; u16 pcie_flags_reg ; struct pci_driver *driver ; u64 dma_mask ; struct device_dma_parameters dma_parms ; pci_power_t current_state ; u8 pm_cap ; unsigned int pme_support : 5 ; unsigned int pme_interrupt : 1 ; unsigned int pme_poll : 1 ; unsigned int d1_support : 1 ; unsigned int d2_support : 1 ; unsigned int no_d1d2 : 1 ; unsigned int no_d3cold : 1 ; unsigned int d3cold_allowed : 1 ; unsigned int mmio_always_on : 1 ; unsigned int wakeup_prepared : 1 ; unsigned int runtime_d3cold : 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 int transparent : 1 ; unsigned int multifunction : 1 ; unsigned int is_added : 1 ; unsigned int is_busmaster : 1 ; unsigned int no_msi : 1 ; unsigned int block_cfg_access : 1 ; unsigned int broken_parity_status : 1 ; unsigned int irq_reroute_variant : 2 ; unsigned int msi_enabled : 1 ; unsigned int msix_enabled : 1 ; unsigned int ari_enabled : 1 ; unsigned int is_managed : 1 ; unsigned int needs_freset : 1 ; unsigned int state_saved : 1 ; unsigned int is_physfn : 1 ; unsigned int is_virtfn : 1 ; unsigned int reset_fn : 1 ; unsigned int is_hotplug_bridge : 1 ; unsigned int __aer_firmware_first_valid : 1 ; unsigned int __aer_firmware_first : 1 ; unsigned int broken_intx_masking : 1 ; unsigned int io_window_1k : 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_242 __annonCompField75 ; struct pci_ats *ats ; phys_addr_t rom ; size_t romlen ; }; struct pci_ops; struct msi_chip; 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_chip *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 int is_added : 1 ; }; struct pci_ops { 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 (*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 msix_entry { u32 vector ; u16 entry ; }; struct res_counter { unsigned long long usage ; unsigned long long max_usage ; unsigned long long limit ; unsigned long long soft_limit ; unsigned long long failcnt ; spinlock_t lock ; struct res_counter *parent ; }; struct kioctx; typedef int kiocb_cancel_fn(struct kiocb * ); union __anonunion_ki_obj_243 { void *user ; struct task_struct *tsk ; }; struct eventfd_ctx; struct kiocb { struct file *ki_filp ; struct kioctx *ki_ctx ; kiocb_cancel_fn *ki_cancel ; void *private ; union __anonunion_ki_obj_243 ki_obj ; __u64 ki_user_data ; loff_t ki_pos ; size_t ki_nbytes ; struct list_head ki_list ; struct eventfd_ctx *ki_eventfd ; }; struct sock_filter { __u16 code ; __u8 jt ; __u8 jf ; __u32 k ; }; union __anonunion____missing_field_name_244 { struct sock_filter insns[0U] ; struct work_struct work ; }; struct sk_filter { atomic_t refcnt ; unsigned int len ; struct callback_head rcu ; unsigned int (*bpf_func)(struct sk_buff const * , struct sock_filter const * ) ; union __anonunion____missing_field_name_244 __annonCompField76 ; }; 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 neigh_table; struct neigh_parms { struct net *net ; struct net_device *dev ; struct neigh_parms *next ; int (*neigh_setup)(struct neighbour * ) ; void (*neigh_cleanup)(struct neighbour * ) ; struct neigh_table *tbl ; void *sysctl_table ; int dead ; atomic_t refcnt ; struct callback_head callback_head ; int reachable_time ; int data[12U] ; 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 ; struct net *net ; struct net_device *dev ; u8 flags ; u8 key[0U] ; }; struct neigh_hash_table { struct neighbour **hash_buckets ; unsigned int hash_shift ; __u32 hash_rnd[4U] ; struct callback_head rcu ; }; struct neigh_table { struct neigh_table *next ; int family ; int entry_size ; int key_len ; __u32 (*hash)(void const * , struct net_device const * , __u32 * ) ; int (*constructor)(struct neighbour * ) ; int (*pconstructor)(struct pneigh_entry * ) ; void (*pdestructor)(struct pneigh_entry * ) ; void (*proxy_redo)(struct sk_buff * ) ; char *id ; struct neigh_parms parms ; int gc_interval ; int gc_thresh1 ; int gc_thresh2 ; int gc_thresh3 ; unsigned long last_flush ; struct delayed_work gc_work ; struct timer_list proxy_timer ; struct sk_buff_head proxy_queue ; atomic_t entries ; rwlock_t lock ; unsigned long last_rand ; struct neigh_statistics *stats ; struct neigh_hash_table *nht ; struct pneigh_entry **phash_buckets ; }; struct dn_route; union __anonunion____missing_field_name_249 { 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 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_249 __annonCompField77 ; }; struct __anonstruct_socket_lock_t_250 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_250 socket_lock_t; struct proto; typedef __u32 __portpair; typedef __u64 __addrpair; struct __anonstruct____missing_field_name_252 { __be32 skc_daddr ; __be32 skc_rcv_saddr ; }; union __anonunion____missing_field_name_251 { __addrpair skc_addrpair ; struct __anonstruct____missing_field_name_252 __annonCompField78 ; }; union __anonunion____missing_field_name_253 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; struct __anonstruct____missing_field_name_255 { __be16 skc_dport ; __u16 skc_num ; }; union __anonunion____missing_field_name_254 { __portpair skc_portpair ; struct __anonstruct____missing_field_name_255 __annonCompField81 ; }; union __anonunion____missing_field_name_256 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; union __anonunion____missing_field_name_257 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; struct sock_common { union __anonunion____missing_field_name_251 __annonCompField79 ; union __anonunion____missing_field_name_253 __annonCompField80 ; union __anonunion____missing_field_name_254 __annonCompField82 ; unsigned short skc_family ; unsigned char volatile skc_state ; unsigned char skc_reuse : 4 ; unsigned char skc_reuseport : 4 ; int skc_bound_dev_if ; union __anonunion____missing_field_name_256 __annonCompField83 ; struct proto *skc_prot ; struct net *skc_net ; struct in6_addr skc_v6_daddr ; struct in6_addr skc_v6_rcv_saddr ; int skc_dontcopy_begin[0U] ; union __anonunion____missing_field_name_257 __annonCompField84 ; int skc_tx_queue_mapping ; atomic_t skc_refcnt ; int skc_dontcopy_end[0U] ; }; struct cg_proto; struct __anonstruct_sk_backlog_258 { 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_258 sk_backlog ; int sk_forward_alloc ; __u32 sk_rxhash ; 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 int sk_shutdown : 2 ; unsigned int sk_no_check : 2 ; unsigned int sk_userlocks : 4 ; unsigned int sk_protocol : 8 ; unsigned int sk_type : 16 ; 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 ; unsigned short sk_ack_backlog ; unsigned short sk_max_ack_backlog ; __u32 sk_priority ; __u32 sk_cgrp_prioidx ; struct pid *sk_peer_pid ; struct cred const *sk_peer_cred ; long sk_rcvtimeo ; long sk_sndtimeo ; void *sk_protinfo ; struct timer_list sk_timer ; ktime_t sk_stamp ; struct socket *sk_socket ; void *sk_user_data ; struct page_frag sk_frag ; struct sk_buff *sk_send_head ; __s32 sk_peek_off ; int sk_write_pending ; void *sk_security ; __u32 sk_mark ; u32 sk_classid ; struct cg_proto *sk_cgrp ; void (*sk_state_change)(struct sock * ) ; void (*sk_data_ready)(struct sock * , int ) ; void (*sk_write_space)(struct sock * ) ; void (*sk_error_report)(struct sock * ) ; int (*sk_backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*sk_destruct)(struct sock * ) ; }; struct request_sock_ops; struct timewait_sock_ops; struct inet_hashinfo; struct raw_hashinfo; struct udp_table; union __anonunion_h_259 { struct inet_hashinfo *hashinfo ; struct udp_table *udp_table ; struct raw_hashinfo *raw_hash ; }; struct proto { void (*close)(struct sock * , long ) ; int (*connect)(struct sock * , struct sockaddr * , int ) ; int (*disconnect)(struct sock * , int ) ; struct sock *(*accept)(struct sock * , int , int * ) ; int (*ioctl)(struct sock * , int , unsigned long ) ; int (*init)(struct sock * ) ; void (*destroy)(struct sock * ) ; void (*shutdown)(struct sock * , int ) ; int (*setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_ioctl)(struct sock * , unsigned int , unsigned long ) ; int (*sendmsg)(struct kiocb * , struct sock * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , struct sock * , struct msghdr * , size_t , int , int , int * ) ; int (*sendpage)(struct sock * , struct page * , int , size_t , int ) ; int (*bind)(struct sock * , struct sockaddr * , int ) ; int (*backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*release_cb)(struct sock * ) ; void (*mtu_reduced)(struct sock * ) ; void (*hash)(struct sock * ) ; void (*unhash)(struct sock * ) ; void (*rehash)(struct sock * ) ; int (*get_port)(struct sock * , unsigned short ) ; void (*clear_sk)(struct sock * , int ) ; unsigned int inuse_idx ; 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_259 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 res_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 sock * , struct request_sock * ) ; }; struct request_sock { struct sock_common __req_common ; struct request_sock *dl_next ; u16 mss ; u8 num_retrans ; u8 cookie_ts : 1 ; u8 num_timeout : 7 ; u32 window_clamp ; u32 rcv_wnd ; u32 ts_recent ; unsigned long expires ; struct request_sock_ops const *rsk_ops ; struct sock *sk ; u32 secid ; u32 peer_secid ; }; struct timewait_sock_ops { struct kmem_cache *twsk_slab ; char *twsk_slab_name ; unsigned int twsk_obj_size ; int (*twsk_unique)(struct sock * , struct sock * , void * ) ; void (*twsk_destructor)(struct sock * ) ; }; 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 optimistic_dad ; __s32 mc_forwarding ; __s32 disable_ipv6 ; __s32 accept_dad ; __s32 force_tllao ; __s32 ndisc_notify ; __s32 suppress_frag_ndisc ; void *sysctl ; }; 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 ; spinlock_t aca_lock ; unsigned long aca_cstamp ; unsigned long aca_tstamp ; }; struct ipv6_devstat { struct proc_dir_entry *proc_dir_entry ; struct ipstats_mib *ipv6[1U] ; 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 ; unsigned long tstamp ; struct callback_head rcu ; }; union __anonunion____missing_field_name_273 { __be32 a4 ; __be32 a6[4U] ; }; struct inetpeer_addr_base { union __anonunion____missing_field_name_273 __annonCompField85 ; }; struct inetpeer_addr { struct inetpeer_addr_base addr ; __u16 family ; }; union __anonunion____missing_field_name_274 { struct list_head gc_list ; struct callback_head gc_rcu ; }; struct __anonstruct____missing_field_name_276 { atomic_t rid ; atomic_t ip_id_count ; }; union __anonunion____missing_field_name_275 { struct __anonstruct____missing_field_name_276 __annonCompField87 ; 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[15U] ; u32 rate_tokens ; unsigned long rate_last ; union __anonunion____missing_field_name_274 __annonCompField86 ; union __anonunion____missing_field_name_275 __annonCompField88 ; __u32 dtime ; atomic_t refcnt ; }; struct inet_peer_base { struct inet_peer *root ; seqlock_t lock ; u32 flush_seq ; int total ; }; 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 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] ; atomic_t bsockets ; }; struct udp_hslot { struct hlist_nulls_head head ; int count ; spinlock_t lock ; }; struct udp_table { struct udp_hslot *hash ; struct udp_hslot *hash2 ; unsigned int mask ; unsigned int log ; }; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; struct elf64_sym { Elf64_Word st_name ; unsigned char st_info ; unsigned char st_other ; Elf64_Half st_shndx ; Elf64_Addr st_value ; Elf64_Xword st_size ; }; typedef struct elf64_sym Elf64_Sym; struct 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_284 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct kernel_param_ops const *ops ; u16 perm ; s16 level ; union __anonunion____missing_field_name_284 __annonCompField90 ; }; 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 tracepoint; struct tracepoint_func { void *func ; void *data ; }; struct tracepoint { char const *name ; struct static_key key ; void (*regfunc)(void) ; void (*unregfunc)(void) ; struct tracepoint_func *funcs ; }; struct 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 * ) ; }; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ; struct module_ref { unsigned long incs ; unsigned long decs ; }; struct module_sect_attrs; struct module_notes_attrs; struct ftrace_event_call; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; bool sig_ok ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; unsigned int init_ro_size ; unsigned int core_ro_size ; struct mod_arch_specific arch ; unsigned int taints ; unsigned int num_bugs ; struct list_head bug_list ; struct bug_entry *bug_table ; Elf64_Sym *symtab ; Elf64_Sym *core_symtab ; unsigned int num_symtab ; unsigned int core_num_syms ; char *strtab ; char *core_strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; char *args ; void *percpu ; unsigned int percpu_size ; unsigned int num_tracepoints ; struct tracepoint * const *tracepoints_ptrs ; struct jump_entry *jump_entries ; unsigned int num_jump_entries ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct ftrace_event_call **trace_events ; unsigned int num_trace_events ; unsigned int num_ftrace_callsites ; unsigned long *ftrace_callsites ; struct list_head source_list ; struct list_head target_list ; void (*exit)(void) ; struct module_ref *refptr ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct hwtstamp_config { int flags ; int tx_type ; int rx_filter ; }; 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 ldv_36829 { PTP_CLK_REQ_EXTTS = 0, PTP_CLK_REQ_PEROUT = 1, PTP_CLK_REQ_PPS = 2 } ; union __anonunion____missing_field_name_291 { struct ptp_extts_request extts ; struct ptp_perout_request perout ; }; struct ptp_clock_request { enum ldv_36829 type ; union __anonunion____missing_field_name_291 __annonCompField92 ; }; 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 pps ; int (*adjfreq)(struct ptp_clock_info * , s32 ) ; int (*adjtime)(struct ptp_clock_info * , s64 ) ; int (*gettime)(struct ptp_clock_info * , struct timespec * ) ; int (*settime)(struct ptp_clock_info * , struct timespec const * ) ; int (*enable)(struct ptp_clock_info * , struct ptp_clock_request * , int ) ; }; struct ptp_clock; enum i40e_status_code { I40E_SUCCESS = 0, I40E_ERR_NVM = -1, I40E_ERR_NVM_CHECKSUM = -2, I40E_ERR_PHY = -3, I40E_ERR_CONFIG = -4, I40E_ERR_PARAM = -5, I40E_ERR_MAC_TYPE = -6, I40E_ERR_UNKNOWN_PHY = -7, I40E_ERR_LINK_SETUP = -8, I40E_ERR_ADAPTER_STOPPED = -9, I40E_ERR_INVALID_MAC_ADDR = -10, I40E_ERR_DEVICE_NOT_SUPPORTED = -11, I40E_ERR_MASTER_REQUESTS_PENDING = -12, I40E_ERR_INVALID_LINK_SETTINGS = -13, I40E_ERR_AUTONEG_NOT_COMPLETE = -14, I40E_ERR_RESET_FAILED = -15, I40E_ERR_SWFW_SYNC = -16, I40E_ERR_NO_AVAILABLE_VSI = -17, I40E_ERR_NO_MEMORY = -18, I40E_ERR_BAD_PTR = -19, I40E_ERR_RING_FULL = -20, I40E_ERR_INVALID_PD_ID = -21, I40E_ERR_INVALID_QP_ID = -22, I40E_ERR_INVALID_CQ_ID = -23, I40E_ERR_INVALID_CEQ_ID = -24, I40E_ERR_INVALID_AEQ_ID = -25, I40E_ERR_INVALID_SIZE = -26, I40E_ERR_INVALID_ARP_INDEX = -27, I40E_ERR_INVALID_FPM_FUNC_ID = -28, I40E_ERR_QP_INVALID_MSG_SIZE = -29, I40E_ERR_QP_TOOMANY_WRS_POSTED = -30, I40E_ERR_INVALID_FRAG_COUNT = -31, I40E_ERR_QUEUE_EMPTY = -32, I40E_ERR_INVALID_ALIGNMENT = -33, I40E_ERR_FLUSHED_QUEUE = -34, I40E_ERR_INVALID_PUSH_PAGE_INDEX = -35, I40E_ERR_INVALID_IMM_DATA_SIZE = -36, I40E_ERR_TIMEOUT = -37, I40E_ERR_OPCODE_MISMATCH = -38, I40E_ERR_CQP_COMPL_ERROR = -39, I40E_ERR_INVALID_VF_ID = -40, I40E_ERR_INVALID_HMCFN_ID = -41, I40E_ERR_BACKING_PAGE_ERROR = -42, I40E_ERR_NO_PBLCHUNKS_AVAILABLE = -43, I40E_ERR_INVALID_PBLE_INDEX = -44, I40E_ERR_INVALID_SD_INDEX = -45, I40E_ERR_INVALID_PAGE_DESC_INDEX = -46, I40E_ERR_INVALID_SD_TYPE = -47, I40E_ERR_MEMCPY_FAILED = -48, I40E_ERR_INVALID_HMC_OBJ_INDEX = -49, I40E_ERR_INVALID_HMC_OBJ_COUNT = -50, I40E_ERR_INVALID_SRQ_ARM_LIMIT = -51, I40E_ERR_SRQ_ENABLED = -52, I40E_ERR_ADMIN_QUEUE_ERROR = -53, I40E_ERR_ADMIN_QUEUE_TIMEOUT = -54, I40E_ERR_BUF_TOO_SHORT = -55, I40E_ERR_ADMIN_QUEUE_FULL = -56, I40E_ERR_ADMIN_QUEUE_NO_WORK = -57, I40E_ERR_BAD_IWARP_CQE = -58, I40E_ERR_NVM_BLANK_MODE = -59, I40E_ERR_NOT_IMPLEMENTED = -60, I40E_ERR_PE_DOORBELL_NOT_ENABLED = -61, I40E_ERR_DIAG_TEST_FAILED = -62, I40E_ERR_NOT_READY = -63, I40E_NOT_SUPPORTED = -64, I40E_ERR_FIRMWARE_API_VERSION = -65 } ; struct i40e_dma_mem { void *va ; dma_addr_t pa ; u32 size ; }; struct i40e_virt_mem { void *va ; u32 size ; }; typedef enum i40e_status_code i40e_status; struct __anonstruct_internal_294 { __le32 param0 ; __le32 param1 ; __le32 param2 ; __le32 param3 ; }; struct __anonstruct_external_295 { __le32 param0 ; __le32 param1 ; __le32 addr_high ; __le32 addr_low ; }; union __anonunion_params_293 { struct __anonstruct_internal_294 internal ; struct __anonstruct_external_295 external ; u8 raw[16U] ; }; struct i40e_aq_desc { __le16 flags ; __le16 opcode ; __le16 datalen ; __le16 retval ; __le32 cookie_high ; __le32 cookie_low ; union __anonunion_params_293 params ; }; enum i40e_admin_queue_err { I40E_AQ_RC_OK = 0, I40E_AQ_RC_EPERM = 1, I40E_AQ_RC_ENOENT = 2, I40E_AQ_RC_ESRCH = 3, I40E_AQ_RC_EINTR = 4, I40E_AQ_RC_EIO = 5, I40E_AQ_RC_ENXIO = 6, I40E_AQ_RC_E2BIG = 7, I40E_AQ_RC_EAGAIN = 8, I40E_AQ_RC_ENOMEM = 9, I40E_AQ_RC_EACCES = 10, I40E_AQ_RC_EFAULT = 11, I40E_AQ_RC_EBUSY = 12, I40E_AQ_RC_EEXIST = 13, I40E_AQ_RC_EINVAL = 14, I40E_AQ_RC_ENOTTY = 15, I40E_AQ_RC_ENOSPC = 16, I40E_AQ_RC_ENOSYS = 17, I40E_AQ_RC_ERANGE = 18, I40E_AQ_RC_EFLUSHED = 19, I40E_AQ_RC_BAD_ADDR = 20, I40E_AQ_RC_EMODE = 21, I40E_AQ_RC_EFBIG = 22 } ; enum i40e_admin_queue_opc { i40e_aqc_opc_get_version = 1, i40e_aqc_opc_driver_version = 2, i40e_aqc_opc_queue_shutdown = 3, i40e_aqc_opc_request_resource = 8, i40e_aqc_opc_release_resource = 9, i40e_aqc_opc_list_func_capabilities = 10, i40e_aqc_opc_list_dev_capabilities = 11, i40e_aqc_opc_set_cppm_configuration = 259, i40e_aqc_opc_set_arp_proxy_entry = 260, i40e_aqc_opc_set_ns_proxy_entry = 261, i40e_aqc_opc_mng_laa = 262, i40e_aqc_opc_mac_address_read = 263, i40e_aqc_opc_mac_address_write = 264, i40e_aqc_opc_clear_pxe_mode = 272, i40e_aqc_opc_get_switch_config = 512, i40e_aqc_opc_add_statistics = 513, i40e_aqc_opc_remove_statistics = 514, i40e_aqc_opc_set_port_parameters = 515, i40e_aqc_opc_get_switch_resource_alloc = 516, i40e_aqc_opc_add_vsi = 528, i40e_aqc_opc_update_vsi_parameters = 529, i40e_aqc_opc_get_vsi_parameters = 530, i40e_aqc_opc_add_pv = 544, i40e_aqc_opc_update_pv_parameters = 545, i40e_aqc_opc_get_pv_parameters = 546, i40e_aqc_opc_add_veb = 560, i40e_aqc_opc_update_veb_parameters = 561, i40e_aqc_opc_get_veb_parameters = 562, i40e_aqc_opc_delete_element = 579, i40e_aqc_opc_add_macvlan = 592, i40e_aqc_opc_remove_macvlan = 593, i40e_aqc_opc_add_vlan = 594, i40e_aqc_opc_remove_vlan = 595, i40e_aqc_opc_set_vsi_promiscuous_modes = 596, i40e_aqc_opc_add_tag = 597, i40e_aqc_opc_remove_tag = 598, i40e_aqc_opc_add_multicast_etag = 599, i40e_aqc_opc_remove_multicast_etag = 600, i40e_aqc_opc_update_tag = 601, i40e_aqc_opc_add_control_packet_filter = 602, i40e_aqc_opc_remove_control_packet_filter = 603, i40e_aqc_opc_add_cloud_filters = 604, i40e_aqc_opc_remove_cloud_filters = 605, i40e_aqc_opc_add_mirror_rule = 608, i40e_aqc_opc_delete_mirror_rule = 609, i40e_aqc_opc_set_storm_control_config = 640, i40e_aqc_opc_get_storm_control_config = 641, i40e_aqc_opc_dcb_ignore_pfc = 769, i40e_aqc_opc_dcb_updated = 770, i40e_aqc_opc_configure_vsi_bw_limit = 1024, i40e_aqc_opc_configure_vsi_ets_sla_bw_limit = 1030, i40e_aqc_opc_configure_vsi_tc_bw = 1031, i40e_aqc_opc_query_vsi_bw_config = 1032, i40e_aqc_opc_query_vsi_ets_sla_config = 1034, i40e_aqc_opc_configure_switching_comp_bw_limit = 1040, i40e_aqc_opc_enable_switching_comp_ets = 1043, i40e_aqc_opc_modify_switching_comp_ets = 1044, i40e_aqc_opc_disable_switching_comp_ets = 1045, i40e_aqc_opc_configure_switching_comp_ets_bw_limit = 1046, i40e_aqc_opc_configure_switching_comp_bw_config = 1047, i40e_aqc_opc_query_switching_comp_ets_config = 1048, i40e_aqc_opc_query_port_ets_config = 1049, i40e_aqc_opc_query_switching_comp_bw_config = 1050, i40e_aqc_opc_suspend_port_tx = 1051, i40e_aqc_opc_resume_port_tx = 1052, i40e_aqc_opc_query_hmc_resource_profile = 1280, i40e_aqc_opc_set_hmc_resource_profile = 1281, i40e_aqc_opc_get_phy_abilities = 1536, i40e_aqc_opc_set_phy_config = 1537, i40e_aqc_opc_set_mac_config = 1539, i40e_aqc_opc_set_link_restart_an = 1541, i40e_aqc_opc_get_link_status = 1543, i40e_aqc_opc_set_phy_int_mask = 1555, i40e_aqc_opc_get_local_advt_reg = 1556, i40e_aqc_opc_set_local_advt_reg = 1557, i40e_aqc_opc_get_partner_advt = 1558, i40e_aqc_opc_set_lb_modes = 1560, i40e_aqc_opc_get_phy_wol_caps = 1569, i40e_aqc_opc_set_phy_reset = 1570, i40e_aqc_opc_upload_ext_phy_fm = 1573, i40e_aqc_opc_nvm_read = 1793, i40e_aqc_opc_nvm_erase = 1794, i40e_aqc_opc_nvm_update = 1795, i40e_aqc_opc_send_msg_to_pf = 2049, i40e_aqc_opc_send_msg_to_vf = 2050, i40e_aqc_opc_send_msg_to_peer = 2051, i40e_aqc_opc_alternate_write = 2304, i40e_aqc_opc_alternate_write_indirect = 2305, i40e_aqc_opc_alternate_read = 2306, i40e_aqc_opc_alternate_read_indirect = 2307, i40e_aqc_opc_alternate_write_done = 2308, i40e_aqc_opc_alternate_set_mode = 2309, i40e_aqc_opc_alternate_clear_port = 2310, i40e_aqc_opc_lldp_get_mib = 2560, i40e_aqc_opc_lldp_update_mib = 2561, i40e_aqc_opc_lldp_add_tlv = 2562, i40e_aqc_opc_lldp_update_tlv = 2563, i40e_aqc_opc_lldp_delete_tlv = 2564, i40e_aqc_opc_lldp_stop = 2565, i40e_aqc_opc_lldp_start = 2566, i40e_aqc_opc_add_udp_tunnel = 2816, i40e_aqc_opc_del_udp_tunnel = 2817, i40e_aqc_opc_tunnel_key_structure = 2832, i40e_aqc_opc_event_lan_overflow = 4097, i40e_aqc_opc_oem_parameter_change = 65024, i40e_aqc_opc_oem_device_status_change = 65025, i40e_aqc_opc_debug_get_deviceid = 65280, i40e_aqc_opc_debug_set_mode = 65281, i40e_aqc_opc_debug_read_reg = 65283, i40e_aqc_opc_debug_write_reg = 65284, i40e_aqc_opc_debug_read_reg_sg = 65285, i40e_aqc_opc_debug_write_reg_sg = 65286, i40e_aqc_opc_debug_modify_reg = 65287, i40e_aqc_opc_debug_dump_internals = 65288, i40e_aqc_opc_debug_modify_internals = 65289 } ; struct i40e_aqc_list_capabilities_element_resp { __le16 id ; u8 major_rev ; u8 minor_rev ; __le32 number ; __le32 logical_id ; __le32 phys_id ; u8 reserved[16U] ; }; struct i40e_aqc_get_switch_config_header_resp { __le16 num_reported ; __le16 num_total ; u8 reserved[12U] ; }; struct i40e_aqc_switch_config_element_resp { u8 element_type ; u8 revision ; __le16 seid ; __le16 uplink_seid ; __le16 downlink_seid ; u8 reserved[3U] ; u8 connection_type ; __le16 scheduler_id ; __le16 element_info ; }; struct i40e_aqc_get_switch_config_resp { struct i40e_aqc_get_switch_config_header_resp header ; struct i40e_aqc_switch_config_element_resp element[1U] ; }; struct i40e_aqc_vsi_properties_data { __le16 valid_sections ; __le16 switch_id ; u8 sw_reserved[2U] ; u8 sec_flags ; u8 sec_reserved ; __le16 pvid ; __le16 fcoe_pvid ; u8 port_vlan_flags ; u8 pvlan_reserved[3U] ; __le32 ingress_table ; __le32 egress_table ; __le16 cas_pv_tag ; u8 cas_pv_flags ; u8 cas_pv_reserved ; __le16 mapping_flags ; __le16 queue_mapping[16U] ; __le16 tc_mapping[8U] ; u8 queueing_opt_flags ; u8 queueing_opt_reserved[3U] ; u8 up_enable_bits ; u8 sched_reserved ; __le32 outer_up_table ; u8 cmd_reserved[8U] ; __le16 qs_handle[8U] ; __le16 stat_counter_idx ; __le16 sched_id ; u8 resp_reserved[12U] ; }; struct i40e_aqc_add_macvlan_element_data { u8 mac_addr[6U] ; __le16 vlan_tag ; __le16 flags ; __le16 queue_number ; u8 match_method ; u8 reserved1[3U] ; }; struct i40e_aqc_remove_macvlan_element_data { u8 mac_addr[6U] ; __le16 vlan_tag ; u8 flags ; u8 reserved[3U] ; u8 error_code ; u8 reply_reserved[3U] ; }; struct i40e_aqc_configure_vsi_tc_bw_data { u8 tc_valid_bits ; u8 reserved[3U] ; u8 tc_bw_credits[8U] ; u8 reserved1[4U] ; __le16 qs_handles[8U] ; }; struct i40e_aqc_query_vsi_bw_config_resp { u8 tc_valid_bits ; u8 tc_suspended_bits ; u8 reserved[14U] ; __le16 qs_handles[8U] ; u8 reserved1[4U] ; __le16 port_bw_limit ; u8 reserved2[2U] ; u8 max_bw ; u8 reserved3[23U] ; }; struct i40e_aqc_query_vsi_ets_sla_config_resp { u8 tc_valid_bits ; u8 reserved[3U] ; u8 share_credits[8U] ; __le16 credits[8U] ; __le16 tc_bw_max[2U] ; }; struct i40e_aqc_configure_switching_comp_bw_config_data { u8 tc_valid_bits ; u8 reserved[2U] ; u8 absolute_credits ; u8 tc_bw_share_credits[8U] ; u8 reserved1[20U] ; }; struct i40e_aqc_query_switching_comp_ets_config_resp { u8 tc_valid_bits ; u8 reserved[35U] ; __le16 port_bw_limit ; u8 reserved1[2U] ; u8 tc_bw_max ; u8 reserved2[23U] ; }; struct i40e_aqc_query_switching_comp_bw_config_resp { u8 tc_valid_bits ; u8 reserved[2U] ; u8 absolute_credits_enable ; u8 tc_bw_share_credits[8U] ; __le16 tc_bw_limits[8U] ; __le16 tc_bw_max[2U] ; }; enum i40e_aq_phy_type { I40E_PHY_TYPE_SGMII = 0, I40E_PHY_TYPE_1000BASE_KX = 1, I40E_PHY_TYPE_10GBASE_KX4 = 2, I40E_PHY_TYPE_10GBASE_KR = 3, I40E_PHY_TYPE_40GBASE_KR4 = 4, I40E_PHY_TYPE_XAUI = 5, I40E_PHY_TYPE_XFI = 6, I40E_PHY_TYPE_SFI = 7, I40E_PHY_TYPE_XLAUI = 8, I40E_PHY_TYPE_XLPPI = 9, I40E_PHY_TYPE_40GBASE_CR4_CU = 10, I40E_PHY_TYPE_10GBASE_CR1_CU = 11, I40E_PHY_TYPE_100BASE_TX = 17, I40E_PHY_TYPE_1000BASE_T = 18, I40E_PHY_TYPE_10GBASE_T = 19, I40E_PHY_TYPE_10GBASE_SR = 20, I40E_PHY_TYPE_10GBASE_LR = 21, I40E_PHY_TYPE_10GBASE_SFPP_CU = 22, I40E_PHY_TYPE_10GBASE_CR1 = 23, I40E_PHY_TYPE_40GBASE_CR4 = 24, I40E_PHY_TYPE_40GBASE_SR4 = 25, I40E_PHY_TYPE_40GBASE_LR4 = 26, I40E_PHY_TYPE_20GBASE_KR2 = 27, I40E_PHY_TYPE_MAX = 28 } ; enum i40e_aq_link_speed { I40E_LINK_SPEED_UNKNOWN = 0, I40E_LINK_SPEED_100MB = 2, I40E_LINK_SPEED_1GB = 4, I40E_LINK_SPEED_10GB = 8, I40E_LINK_SPEED_40GB = 16, I40E_LINK_SPEED_20GB = 32 } ; struct i40e_aqc_get_link_status { __le16 command_flags ; u8 phy_type ; u8 link_speed ; u8 link_info ; u8 an_info ; u8 ext_info ; u8 loopback ; __le16 max_frame_size ; u8 config ; u8 reserved[5U] ; }; struct i40e_aqc_lan_overflow { __le32 prtdcb_rupto ; __le32 otx_ctl ; u8 reserved[8U] ; }; struct i40e_aqc_lldp_get_mib { u8 type ; u8 reserved1 ; __le16 local_len ; __le16 remote_len ; u8 reserved2[2U] ; __le32 addr_high ; __le32 addr_low ; }; union __anonunion_r_299 { struct i40e_dma_mem *asq_bi ; struct i40e_dma_mem *arq_bi ; }; struct i40e_adminq_ring { struct i40e_virt_mem dma_head ; struct i40e_dma_mem desc_buf ; struct i40e_virt_mem cmd_buf ; union __anonunion_r_299 r ; u16 count ; u16 rx_buf_len ; u16 next_to_use ; u16 next_to_clean ; u32 head ; u32 tail ; u32 len ; }; struct i40e_asq_cmd_details { void *callback ; u64 cookie ; u16 flags_ena ; u16 flags_dis ; bool async ; bool postpone ; }; struct i40e_arq_event_info { struct i40e_aq_desc desc ; u16 msg_size ; u8 *msg_buf ; }; struct i40e_adminq_info { struct i40e_adminq_ring arq ; struct i40e_adminq_ring asq ; u16 num_arq_entries ; u16 num_asq_entries ; u16 arq_buf_size ; u16 asq_buf_size ; u16 fw_maj_ver ; u16 fw_min_ver ; u16 api_maj_ver ; u16 api_min_ver ; struct mutex asq_mutex ; struct mutex arq_mutex ; enum i40e_admin_queue_err asq_last_status ; enum i40e_admin_queue_err arq_last_status ; }; struct i40e_hw; struct i40e_hmc_obj_info { u64 base ; u32 max_cnt ; u32 cnt ; u64 size ; }; enum i40e_sd_entry_type { I40E_SD_TYPE_INVALID = 0, I40E_SD_TYPE_PAGED = 1, I40E_SD_TYPE_DIRECT = 2 } ; struct i40e_hmc_bp { enum i40e_sd_entry_type entry_type ; struct i40e_dma_mem addr ; u32 sd_pd_index ; u32 ref_cnt ; }; struct i40e_hmc_pd_entry { struct i40e_hmc_bp bp ; u32 sd_index ; bool valid ; }; struct i40e_hmc_pd_table { struct i40e_dma_mem pd_page_addr ; struct i40e_hmc_pd_entry *pd_entry ; struct i40e_virt_mem pd_entry_virt_mem ; u32 ref_cnt ; u32 sd_index ; }; union __anonunion_u_300 { struct i40e_hmc_pd_table pd_table ; struct i40e_hmc_bp bp ; }; struct i40e_hmc_sd_entry { enum i40e_sd_entry_type entry_type ; bool valid ; union __anonunion_u_300 u ; }; struct i40e_hmc_sd_table { struct i40e_virt_mem addr ; u32 sd_cnt ; u32 ref_cnt ; struct i40e_hmc_sd_entry *sd_entry ; }; struct i40e_hmc_info { u32 signature ; u8 hmc_fn_id ; u16 first_sd_index ; struct i40e_hmc_obj_info *hmc_obj ; struct i40e_virt_mem hmc_obj_virt_mem ; struct i40e_hmc_sd_table sd_table ; }; struct i40e_hmc_obj_rxq { u16 head ; u8 cpuid ; u64 base ; u16 qlen ; u8 dbuff ; u8 hbuff ; u8 dtype ; u8 dsize ; u8 crcstrip ; u8 fc_ena ; u8 l2tsel ; u8 hsplit_0 ; u8 hsplit_1 ; u8 showiv ; u16 rxmax ; u8 tphrdesc_ena ; u8 tphwdesc_ena ; u8 tphdata_ena ; u8 tphhead_ena ; u8 lrxqthresh ; }; struct i40e_hmc_obj_txq { u16 head ; u8 new_context ; u64 base ; u8 fc_ena ; u8 timesync_ena ; u8 fd_ena ; u8 alt_vlan_ena ; u16 thead_wb ; u16 cpuid ; u8 head_wb_ena ; u16 qlen ; u8 tphrdesc_ena ; u8 tphrpacket_ena ; u8 tphwdesc_ena ; u64 head_wb_addr ; u32 crc ; u16 rdylist ; u8 rdylist_act ; }; enum i40e_hmc_model { I40E_HMC_MODEL_DIRECT_PREFERRED = 0, I40E_HMC_MODEL_DIRECT_ONLY = 1, I40E_HMC_MODEL_PAGED_ONLY = 2, I40E_HMC_MODEL_UNKNOWN = 3 } ; enum i40e_mac_type { I40E_MAC_UNKNOWN = 0, I40E_MAC_X710 = 1, I40E_MAC_XL710 = 2, I40E_MAC_VF = 3, I40E_MAC_GENERIC = 4 } ; enum i40e_media_type { I40E_MEDIA_TYPE_UNKNOWN = 0, I40E_MEDIA_TYPE_FIBER = 1, I40E_MEDIA_TYPE_BASET = 2, I40E_MEDIA_TYPE_BACKPLANE = 3, I40E_MEDIA_TYPE_CX4 = 4, I40E_MEDIA_TYPE_DA = 5, I40E_MEDIA_TYPE_VIRTUAL = 6 } ; enum i40e_fc_mode { I40E_FC_NONE = 0, I40E_FC_RX_PAUSE = 1, I40E_FC_TX_PAUSE = 2, I40E_FC_FULL = 3, I40E_FC_PFC = 4, I40E_FC_DEFAULT = 5 } ; enum i40e_vsi_type { I40E_VSI_MAIN = 0, I40E_VSI_VMDQ1 = 1, I40E_VSI_VMDQ2 = 2, I40E_VSI_CTRL = 3, I40E_VSI_FCOE = 4, I40E_VSI_MIRROR = 5, I40E_VSI_SRIOV = 6, I40E_VSI_FDIR = 7, I40E_VSI_TYPE_UNKNOWN = 8 } ; struct i40e_link_status { enum i40e_aq_phy_type phy_type ; enum i40e_aq_link_speed link_speed ; u8 link_info ; u8 an_info ; u8 ext_info ; u8 loopback ; bool lse_enable ; }; struct i40e_phy_info { struct i40e_link_status link_info ; struct i40e_link_status link_info_old ; u32 autoneg_advertised ; u32 phy_id ; u32 module_type ; bool get_link_info ; enum i40e_media_type media_type ; }; struct i40e_hw_capabilities { u32 switch_mode ; u32 management_mode ; u32 npar_enable ; u32 os2bmc ; u32 valid_functions ; bool sr_iov_1_1 ; bool vmdq ; bool evb_802_1_qbg ; bool evb_802_1_qbh ; bool dcb ; bool fcoe ; bool mfp_mode_1 ; bool mgmt_cem ; bool ieee_1588 ; bool iwarp ; bool fd ; u32 fd_filters_guaranteed ; u32 fd_filters_best_effort ; bool rss ; u32 rss_table_size ; u32 rss_table_entry_width ; bool led[30U] ; bool sdp[30U] ; u32 nvm_image_type ; u32 num_flow_director_filters ; u32 num_vfs ; u32 vf_base_id ; u32 num_vsis ; u32 num_rx_qp ; u32 num_tx_qp ; u32 base_queue ; u32 num_msix_vectors ; u32 num_msix_vectors_vf ; u32 led_pin_num ; u32 sdp_pin_num ; u32 mdio_port_num ; u32 mdio_port_mode ; u8 rx_buf_chain_len ; u32 enabled_tcmap ; u32 maxtc ; }; struct i40e_mac_info { enum i40e_mac_type type ; u8 addr[6U] ; u8 perm_addr[6U] ; u8 san_addr[6U] ; u16 max_fcoeq ; }; struct i40e_nvm_info { u64 hw_semaphore_timeout ; u64 hw_semaphore_wait ; u32 timeout ; u16 sr_size ; bool blank_nvm_mode ; u16 version ; u32 eetrack ; }; enum i40e_bus_type { i40e_bus_type_unknown = 0, i40e_bus_type_pci = 1, i40e_bus_type_pcix = 2, i40e_bus_type_pci_express = 3, i40e_bus_type_reserved = 4 } ; enum i40e_bus_speed { i40e_bus_speed_unknown = 0, i40e_bus_speed_33 = 33, i40e_bus_speed_66 = 66, i40e_bus_speed_100 = 100, i40e_bus_speed_120 = 120, i40e_bus_speed_133 = 133, i40e_bus_speed_2500 = 2500, i40e_bus_speed_5000 = 5000, i40e_bus_speed_8000 = 8000, i40e_bus_speed_reserved = 8001 } ; enum i40e_bus_width { i40e_bus_width_unknown = 0, i40e_bus_width_pcie_x1 = 1, i40e_bus_width_pcie_x2 = 2, i40e_bus_width_pcie_x4 = 4, i40e_bus_width_pcie_x8 = 8, i40e_bus_width_32 = 32, i40e_bus_width_64 = 64, i40e_bus_width_reserved = 65 } ; struct i40e_bus_info { enum i40e_bus_speed speed ; enum i40e_bus_width width ; enum i40e_bus_type type ; u16 func ; u16 device ; u16 lan_id ; }; struct i40e_fc_info { enum i40e_fc_mode current_mode ; enum i40e_fc_mode requested_mode ; }; struct i40e_ieee_ets_config { u8 willing ; u8 cbs ; u8 maxtcs ; u8 prioritytable[8U] ; u8 tcbwtable[8U] ; u8 tsatable[8U] ; }; struct i40e_ieee_ets_recommend { u8 prioritytable[8U] ; u8 tcbwtable[8U] ; u8 tsatable[8U] ; }; struct i40e_ieee_pfc_config { u8 willing ; u8 mbc ; u8 pfccap ; u8 pfcenable ; }; struct i40e_ieee_app_priority_table { u8 priority ; u8 selector ; u16 protocolid ; }; struct i40e_dcbx_config { u32 numapps ; struct i40e_ieee_ets_config etscfg ; struct i40e_ieee_ets_recommend etsrec ; struct i40e_ieee_pfc_config pfc ; struct i40e_ieee_app_priority_table app[32U] ; }; struct i40e_hw { u8 *hw_addr ; void *back ; struct i40e_phy_info phy ; struct i40e_mac_info mac ; struct i40e_bus_info bus ; struct i40e_nvm_info nvm ; struct i40e_fc_info fc ; u16 device_id ; u16 vendor_id ; u16 subsystem_device_id ; u16 subsystem_vendor_id ; u8 revision_id ; u8 port ; bool adapter_stopped ; struct i40e_hw_capabilities dev_caps ; struct i40e_hw_capabilities func_caps ; u16 fdir_shared_filter_count ; u8 pf_id ; u16 main_vsi_seid ; u16 numa_node ; struct i40e_adminq_info aq ; struct i40e_hmc_info hmc ; u16 dcbx_status ; struct i40e_dcbx_config local_dcbx_config ; struct i40e_dcbx_config remote_dcbx_config ; u32 debug_mask ; }; struct i40e_driver_version { u8 major_version ; u8 minor_version ; u8 build_version ; u8 subbuild_version ; }; struct i40e_tx_desc { __le64 buffer_addr ; __le64 cmd_type_offset_bsz ; }; struct i40e_vsi_context { u16 seid ; u16 uplink_seid ; u16 vsi_number ; u16 vsis_allocated ; u16 vsis_unallocated ; u16 flags ; u8 pf_num ; u8 vf_num ; u8 connection_type ; struct i40e_aqc_vsi_properties_data info ; }; struct i40e_eth_stats { u64 rx_bytes ; u64 rx_unicast ; u64 rx_multicast ; u64 rx_broadcast ; u64 rx_discards ; u64 rx_errors ; u64 rx_missed ; u64 rx_unknown_protocol ; u64 tx_bytes ; u64 tx_unicast ; u64 tx_multicast ; u64 tx_broadcast ; u64 tx_discards ; u64 tx_errors ; }; struct i40e_hw_port_stats { struct i40e_eth_stats eth ; u64 tx_dropped_link_down ; u64 crc_errors ; u64 illegal_bytes ; u64 error_bytes ; u64 mac_local_faults ; u64 mac_remote_faults ; u64 rx_length_errors ; u64 link_xon_rx ; u64 link_xoff_rx ; u64 priority_xon_rx[8U] ; u64 priority_xoff_rx[8U] ; u64 link_xon_tx ; u64 link_xoff_tx ; u64 priority_xon_tx[8U] ; u64 priority_xoff_tx[8U] ; u64 priority_xon_2_xoff[8U] ; u64 rx_size_64 ; u64 rx_size_127 ; u64 rx_size_255 ; u64 rx_size_511 ; u64 rx_size_1023 ; u64 rx_size_1522 ; u64 rx_size_big ; u64 rx_undersize ; u64 rx_fragments ; u64 rx_oversize ; u64 rx_jabber ; u64 tx_size_64 ; u64 tx_size_127 ; u64 tx_size_255 ; u64 tx_size_511 ; u64 tx_size_1023 ; u64 tx_size_1522 ; u64 tx_size_big ; u64 mac_short_packet_dropped ; u64 checksum_error ; }; enum i40e_switch_element_types { I40E_SWITCH_ELEMENT_TYPE_MAC = 1, I40E_SWITCH_ELEMENT_TYPE_PF = 2, I40E_SWITCH_ELEMENT_TYPE_VF = 3, I40E_SWITCH_ELEMENT_TYPE_EMP = 4, I40E_SWITCH_ELEMENT_TYPE_BMC = 6, I40E_SWITCH_ELEMENT_TYPE_PE = 16, I40E_SWITCH_ELEMENT_TYPE_VEB = 17, I40E_SWITCH_ELEMENT_TYPE_PA = 18, I40E_SWITCH_ELEMENT_TYPE_VSI = 19 } ; enum i40e_hash_filter_size { I40E_HASH_FILTER_SIZE_1K = 0, I40E_HASH_FILTER_SIZE_2K = 1, I40E_HASH_FILTER_SIZE_4K = 2, I40E_HASH_FILTER_SIZE_8K = 3, I40E_HASH_FILTER_SIZE_16K = 4, I40E_HASH_FILTER_SIZE_32K = 5, I40E_HASH_FILTER_SIZE_64K = 6, I40E_HASH_FILTER_SIZE_128K = 7, I40E_HASH_FILTER_SIZE_256K = 8, I40E_HASH_FILTER_SIZE_512K = 9, I40E_HASH_FILTER_SIZE_1M = 10 } ; enum i40e_dma_cntx_size { I40E_DMA_CNTX_SIZE_512 = 0, I40E_DMA_CNTX_SIZE_1K = 1, I40E_DMA_CNTX_SIZE_2K = 2, I40E_DMA_CNTX_SIZE_4K = 3, I40E_DMA_CNTX_SIZE_8K = 4, I40E_DMA_CNTX_SIZE_16K = 5, I40E_DMA_CNTX_SIZE_32K = 6, I40E_DMA_CNTX_SIZE_64K = 7, I40E_DMA_CNTX_SIZE_128K = 8, I40E_DMA_CNTX_SIZE_256K = 9 } ; enum i40e_hash_lut_size { I40E_HASH_LUT_SIZE_128 = 0, I40E_HASH_LUT_SIZE_512 = 1 } ; struct i40e_filter_control_settings { enum i40e_hash_filter_size pe_filt_num ; enum i40e_dma_cntx_size pe_cntx_num ; enum i40e_hash_filter_size fcoe_filt_num ; enum i40e_dma_cntx_size fcoe_cntx_num ; enum i40e_hash_lut_size hash_lut_size ; bool enable_fdir ; bool enable_ethtype ; bool enable_macvlan ; }; struct i40e_virtchnl_ether_addr { u8 addr[6U] ; u8 pad[2U] ; }; struct i40e_pf; struct i40e_vf { struct i40e_pf *pf ; u16 vf_id ; enum i40e_switch_element_types parent_type ; u16 stag ; struct i40e_virtchnl_ether_addr default_lan_addr ; struct i40e_virtchnl_ether_addr default_fcoe_addr ; u16 port_vlan_id ; bool pf_set_mac ; u8 lan_vsi_index ; u8 lan_vsi_id ; u8 num_queue_pairs ; u64 num_mdd_events ; u64 num_invalid_msgs ; u64 num_valid_msgs ; unsigned long vf_caps ; unsigned long vf_states ; }; struct i40e_tx_buffer { struct i40e_tx_desc *next_to_watch ; unsigned long time_stamp ; struct sk_buff *skb ; unsigned int bytecount ; unsigned short gso_segs ; dma_addr_t dma ; __u32 len ; u32 tx_flags ; }; struct i40e_rx_buffer { struct sk_buff *skb ; dma_addr_t dma ; struct page *page ; dma_addr_t page_dma ; unsigned int page_offset ; }; struct i40e_queue_stats { u64 packets ; u64 bytes ; }; struct i40e_tx_queue_stats { u64 restart_queue ; u64 tx_busy ; u64 tx_done_old ; }; struct i40e_rx_queue_stats { u64 non_eop_descs ; u64 alloc_page_failed ; u64 alloc_buff_failed ; }; union __anonunion____missing_field_name_321 { struct i40e_tx_buffer *tx_bi ; struct i40e_rx_buffer *rx_bi ; }; union __anonunion____missing_field_name_322 { struct i40e_tx_queue_stats tx_stats ; struct i40e_rx_queue_stats rx_stats ; }; struct i40e_vsi; struct i40e_q_vector; struct i40e_ring { struct i40e_ring *next ; void *desc ; struct device *dev ; struct net_device *netdev ; union __anonunion____missing_field_name_321 __annonCompField94 ; unsigned long state ; u16 queue_index ; u8 dcb_tc ; u8 *tail ; u16 count ; u16 reg_idx ; u16 rx_hdr_len ; u16 rx_buf_len ; u8 dtype ; u8 hsplit ; u16 next_to_use ; u16 next_to_clean ; u8 atr_sample_rate ; u8 atr_count ; unsigned long last_rx_timestamp ; bool ring_active ; struct i40e_queue_stats stats ; struct u64_stats_sync syncp ; union __anonunion____missing_field_name_322 __annonCompField95 ; unsigned int size ; dma_addr_t dma ; struct i40e_vsi *vsi ; struct i40e_q_vector *q_vector ; struct callback_head rcu ; }; enum i40e_latency_range { I40E_LOWEST_LATENCY = 0, I40E_LOW_LATENCY = 1, I40E_BULK_LATENCY = 2 } ; struct i40e_ring_container { struct i40e_ring *ring ; unsigned int total_bytes ; unsigned int total_packets ; u16 count ; enum i40e_latency_range latency_range ; u16 itr ; }; enum i40e_interrupt_policy { I40E_INTERRUPT_BEST_CASE = 0, I40E_INTERRUPT_MEDIUM = 1, I40E_INTERRUPT_LOWEST = 2 } ; struct i40e_lump_tracking { u16 num_entries ; u16 search_hint ; u16 list[0U] ; }; struct i40e_tc_info { u16 qoffset ; u16 qcount ; u8 netdev_tc ; }; struct i40e_tc_configuration { u8 numtc ; u8 enabled_tc ; struct i40e_tc_info tc_info[8U] ; }; struct i40e_veb; struct i40e_aqc_get_switch_config_data; struct i40e_pf { struct pci_dev *pdev ; struct i40e_hw hw ; unsigned long state ; unsigned long link_check_timeout ; struct msix_entry *msix_entries ; u16 num_msix_entries ; bool fc_autoneg_status ; u16 eeprom_version ; u16 num_vmdq_vsis ; u16 num_vmdq_qps ; u16 num_vmdq_msix ; u16 num_req_vfs ; u16 num_vf_qps ; u16 num_lan_qps ; u16 num_lan_msix ; int queues_left ; u16 rss_size ; u16 rss_size_max ; u16 fdir_pf_filter_count ; u8 atr_sample_rate ; bool wol_en ; __be16 vxlan_ports[16U] ; u16 pending_vxlan_bitmap ; enum i40e_interrupt_policy int_policy ; u16 rx_itr_default ; u16 tx_itr_default ; u16 msg_enable ; char misc_int_name[25U] ; u16 adminq_work_limit ; int service_timer_period ; struct timer_list service_timer ; struct work_struct service_task ; u64 flags ; bool stat_offsets_loaded ; struct i40e_hw_port_stats stats ; struct i40e_hw_port_stats stats_offsets ; u32 tx_timeout_count ; u32 tx_timeout_recovery_level ; unsigned long tx_timeout_last_recovery ; u32 hw_csum_rx_error ; u32 led_status ; u16 corer_count ; u16 globr_count ; u16 empr_count ; u16 pfr_count ; u16 sw_int_count ; struct mutex switch_mutex ; u16 lan_vsi ; u16 lan_veb ; u16 next_vsi ; struct i40e_vsi **vsi ; struct i40e_veb *veb[16U] ; struct i40e_lump_tracking *qp_pile ; struct i40e_lump_tracking *irq_pile ; u16 pf_seid ; u16 main_vsi_seid ; u16 mac_seid ; struct i40e_aqc_get_switch_config_data *sw_config ; struct kobject *switch_kobj ; struct dentry *i40e_dbg_pf ; u16 instance ; struct i40e_vf *vf ; int num_alloc_vfs ; u32 vf_aq_requests ; u16 dcbx_cap ; u32 fcoe_hmc_filt_num ; u32 fcoe_hmc_cntx_num ; struct i40e_filter_control_settings filter_settings ; struct ptp_clock *ptp_clock ; struct ptp_clock_info ptp_caps ; struct sk_buff *ptp_tx_skb ; struct work_struct ptp_tx_work ; struct hwtstamp_config tstamp_config ; unsigned long ptp_tx_start ; unsigned long last_rx_ptp_check ; spinlock_t tmreg_lock ; u64 ptp_base_adj ; u32 tx_hwtstamp_timeouts ; u32 rx_hwtstamp_cleared ; bool ptp_tx ; bool ptp_rx ; }; struct i40e_mac_filter { struct list_head list ; u8 macaddr[6U] ; s16 vlan ; u8 counter ; bool is_vf ; bool is_netdev ; bool changed ; }; struct i40e_veb { struct i40e_pf *pf ; u16 idx ; u16 veb_idx ; u16 seid ; u16 uplink_seid ; u16 stats_idx ; u8 enabled_tc ; u16 flags ; u16 bw_limit ; u8 bw_max_quanta ; bool is_abs_credits ; u8 bw_tc_share_credits[8U] ; u16 bw_tc_limit_credits[8U] ; u8 bw_tc_max_quanta[8U] ; struct kobject *kobj ; bool stat_offsets_loaded ; struct i40e_eth_stats stats ; struct i40e_eth_stats stats_offsets ; }; struct i40e_vsi { struct net_device *netdev ; unsigned long active_vlans[64U] ; bool netdev_registered ; bool stat_offsets_loaded ; u32 current_netdev_flags ; unsigned long state ; unsigned long flags ; struct list_head mac_filter_list ; struct rtnl_link_stats64 net_stats ; struct rtnl_link_stats64 net_stats_offsets ; struct i40e_eth_stats eth_stats ; struct i40e_eth_stats eth_stats_offsets ; u32 tx_restart ; u32 tx_busy ; u32 rx_buf_failed ; u32 rx_page_failed ; struct i40e_ring **rx_rings ; struct i40e_ring **tx_rings ; u16 work_limit ; u16 rx_itr_setting ; u16 tx_itr_setting ; u16 max_frame ; u16 rx_hdr_len ; u16 rx_buf_len ; u8 dtype ; struct i40e_q_vector **q_vectors ; int num_q_vectors ; int base_vector ; u16 seid ; u16 id ; u16 uplink_seid ; u16 base_queue ; u16 alloc_queue_pairs ; u16 num_queue_pairs ; u16 num_desc ; enum i40e_vsi_type type ; u16 vf_id ; struct i40e_tc_configuration tc_config ; struct i40e_aqc_vsi_properties_data info ; u16 bw_limit ; u8 bw_max_quanta ; u8 bw_ets_share_credits[8U] ; u16 bw_ets_limit_credits[8U] ; u8 bw_ets_max_quanta[8U] ; struct i40e_pf *back ; u16 idx ; u16 veb_idx ; struct kobject *kobj ; irqreturn_t (*irq_handler)(int , void * ) ; }; struct i40e_netdev_priv { struct i40e_vsi *vsi ; }; struct i40e_q_vector { struct i40e_vsi *vsi ; u16 v_idx ; u16 reg_idx ; struct napi_struct napi ; struct i40e_ring_container rx ; struct i40e_ring_container tx ; u8 num_ringpairs ; cpumask_t affinity_mask ; struct callback_head rcu ; char name[25U] ; }; typedef int ldv_func_ret_type; typedef int ldv_func_ret_type___0; typedef int ldv_func_ret_type___1; typedef int ldv_func_ret_type___2; typedef int ldv_func_ret_type___3; typedef struct net_device *ldv_func_ret_type___4; typedef int ldv_func_ret_type___5; typedef int ldv_func_ret_type___6; typedef int ldv_func_ret_type___7; typedef int ldv_func_ret_type___8; typedef int ldv_func_ret_type___9; typedef __u16 __sum16; enum hrtimer_restart; struct tcphdr { __be16 source ; __be16 dest ; __be32 seq ; __be32 ack_seq ; __u16 res1 : 4 ; __u16 doff : 4 ; __u16 fin : 1 ; __u16 syn : 1 ; __u16 rst : 1 ; __u16 psh : 1 ; __u16 ack : 1 ; __u16 urg : 1 ; __u16 ece : 1 ; __u16 cwr : 1 ; __be16 window ; __sum16 check ; __be16 urg_ptr ; }; struct iphdr { __u8 ihl : 4 ; __u8 version : 4 ; __u8 tos ; __be16 tot_len ; __be16 id ; __be16 frag_off ; __u8 ttl ; __u8 protocol ; __sum16 check ; __be32 saddr ; __be32 daddr ; }; struct udphdr { __be16 source ; __be16 dest ; __be16 len ; __sum16 check ; }; enum i40e_aq_resource_access_type { I40E_RESOURCE_READ = 1, I40E_RESOURCE_WRITE = 2 } ; struct i40e_fdir_data { u16 q_index ; u8 flex_off ; u8 pctype ; u16 dest_vsi ; u8 dest_ctl ; u8 fd_status ; u16 cnt_index ; u32 fd_id ; u8 *raw_packet ; }; struct i40e_diag_reg_test_info { u32 offset ; u32 mask ; u32 elements ; u32 stride ; }; struct i40e_stats { char stat_string[32U] ; int sizeof_stat ; int stat_offset ; }; enum hrtimer_restart; enum i40e_aq_hmc_profile { I40E_HMC_PROFILE_DEFAULT = 1, I40E_HMC_PROFILE_FAVOR_VF = 2, I40E_HMC_PROFILE_EQUAL = 3 } ; enum i40e_debug_mask { I40E_DEBUG_INIT = 1, I40E_DEBUG_RELEASE = 2, I40E_DEBUG_LINK = 16, I40E_DEBUG_PHY = 32, I40E_DEBUG_HMC = 64, I40E_DEBUG_NVM = 128, I40E_DEBUG_LAN = 256, I40E_DEBUG_FLOW = 512, I40E_DEBUG_DCB = 1024, I40E_DEBUG_DIAG = 2048, I40E_DEBUG_AQ_MESSAGE = 16777216, I40E_DEBUG_AQ_DESCRIPTOR = 33554432, I40E_DEBUG_AQ_DESC_BUFFER = 67108864, I40E_DEBUG_AQ_COMMAND = 100663296, I40E_DEBUG_AQ = 251658240, I40E_DEBUG_USER = 4026531840U, I40E_DEBUG_ALL = 4294967295U } ; enum i40e_aq_resources_ids { I40E_NVM_RESOURCE_ID = 1 } ; enum hrtimer_restart; struct i40e_aqc_get_version { __le32 rom_ver ; __le32 fw_build ; __le16 fw_major ; __le16 fw_minor ; __le16 api_major ; __le16 api_minor ; }; struct i40e_aqc_driver_version { u8 driver_major_ver ; u8 driver_minor_ver ; u8 driver_build_ver ; u8 driver_subbuild_ver ; u8 reserved[4U] ; __le32 address_high ; __le32 address_low ; }; struct i40e_aqc_queue_shutdown { __le32 driver_unloading ; u8 reserved[12U] ; }; struct i40e_aqc_request_resource { __le16 resource_id ; __le16 access_type ; __le32 timeout ; __le32 resource_number ; u8 reserved[4U] ; }; struct i40e_aqc_list_capabilites { u8 command_flags ; u8 pf_index ; u8 reserved[2U] ; __le32 count ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_mac_address_read { __le16 command_flags ; u8 reserved[6U] ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_mac_address_read_data { u8 pf_lan_mac[6U] ; u8 pf_san_mac[6U] ; u8 port_mac[6U] ; u8 pf_wol_mac[6U] ; }; struct i40e_aqc_mac_address_write { __le16 command_flags ; __le16 mac_sah ; __le32 mac_sal ; u8 reserved[8U] ; }; struct i40e_aqc_switch_seid { __le16 seid ; u8 reserved[6U] ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_add_get_update_vsi { __le16 uplink_seid ; u8 connection_type ; u8 reserved1 ; u8 vf_id ; u8 reserved2 ; __le16 vsi_flags ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_add_get_update_vsi_completion { __le16 seid ; __le16 vsi_number ; __le16 vsi_used ; __le16 vsi_free ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_add_veb { __le16 uplink_seid ; __le16 downlink_seid ; __le16 veb_flags ; u8 enable_tcs ; u8 reserved[9U] ; }; struct i40e_aqc_add_veb_completion { u8 reserved[6U] ; __le16 switch_seid ; __le16 veb_seid ; __le16 statistic_index ; __le16 vebs_used ; __le16 vebs_free ; }; struct i40e_aqc_get_veb_parameters_completion { __le16 seid ; __le16 switch_id ; __le16 veb_flags ; __le16 statistic_index ; __le16 vebs_used ; __le16 vebs_free ; u8 reserved[4U] ; }; struct i40e_aqc_macvlan { __le16 num_addresses ; __le16 seid[3U] ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_set_vsi_promiscuous_modes { __le16 promiscuous_flags ; __le16 valid_flags ; __le16 seid ; __le16 vlan_tag ; u8 reserved[8U] ; }; struct i40e_aqc_add_remove_control_packet_filter { u8 mac[6U] ; __le16 etype ; __le16 flags ; __le16 seid ; __le16 queue ; u8 reserved[2U] ; }; struct i40e_aqc_add_remove_control_packet_filter_completion { __le16 mac_etype_used ; __le16 etype_used ; __le16 mac_etype_free ; __le16 etype_free ; u8 reserved[8U] ; }; struct i40e_aqc_tx_sched_ind { __le16 vsi_seid ; u8 reserved[6U] ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_configure_switching_comp_ets_data { u8 reserved[4U] ; u8 tc_valid_bits ; u8 reserved1 ; u8 tc_strict_priority_flags ; u8 reserved2[17U] ; u8 tc_bw_share_credits[8U] ; u8 reserved3[96U] ; }; struct i40e_aqc_query_port_ets_config_resp { u8 reserved[4U] ; u8 tc_valid_bits ; u8 reserved1 ; u8 tc_strict_priority_bits ; u8 reserved2 ; u8 tc_bw_share_credits[8U] ; __le16 tc_bw_limits[8U] ; __le16 tc_bw_max[2U] ; u8 reserved3[32U] ; }; struct i40e_aq_get_set_hmc_resource_profile { u8 pm_profile ; u8 pe_vf_enabled ; u8 reserved[14U] ; }; struct i40e_aqc_set_link_restart_an { u8 command ; u8 reserved[15U] ; }; struct i40e_aqc_nvm_update { u8 command_flags ; u8 module_pointer ; __le16 length ; __le32 offset ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_pf_vf_message { __le32 id ; u8 reserved[4U] ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_lldp_update_mib { u8 command ; u8 reserved[7U] ; __le32 addr_high ; __le32 addr_low ; }; struct i40e_aqc_lldp_stop { u8 command ; u8 reserved[15U] ; }; struct i40e_aqc_lldp_start { u8 command ; u8 reserved[15U] ; }; struct i40e_aqc_add_udp_tunnel { __le16 udp_port ; u8 reserved0[3U] ; u8 protocol_type ; u8 reserved1[10U] ; }; struct i40e_aqc_remove_udp_tunnel { u8 reserved[2U] ; u8 index ; u8 reserved2[13U] ; }; struct i40e_aqc_del_udp_tunnel_completion { __le16 udp_port ; u8 index ; u8 multiple_pfs ; u8 total_filters_used ; u8 reserved1[11U] ; }; struct i40e_control_filter_stats { u16 mac_etype_used ; u16 etype_used ; u16 mac_etype_free ; u16 etype_free ; }; enum hrtimer_restart; enum i40e_status_code; enum i40e_memory_type { i40e_mem_arq_buf = 0, i40e_mem_asq_buf = 1, i40e_mem_atq_buf = 2, i40e_mem_arq_ring = 3, i40e_mem_atq_ring = 4, i40e_mem_pd = 5, i40e_mem_bp = 6, i40e_mem_bp_jumbo = 7, i40e_mem_reserved = 8 } ; enum hrtimer_restart; enum i40e_status_code; enum i40e_hmc_lan_rsrc_type { I40E_HMC_LAN_FULL = 0, I40E_HMC_LAN_TX = 1, I40E_HMC_LAN_RX = 2, I40E_HMC_FCOE_CTX = 3, I40E_HMC_FCOE_FILT = 4, I40E_HMC_LAN_MAX = 5 } ; struct i40e_hmc_lan_create_obj_info { struct i40e_hmc_info *hmc_info ; u32 rsrc_type ; u32 start_idx ; u32 count ; enum i40e_sd_entry_type entry_type ; u64 direct_mode_sz ; }; struct i40e_hmc_lan_delete_obj_info { struct i40e_hmc_info *hmc_info ; u32 rsrc_type ; u32 start_idx ; u32 count ; }; struct i40e_context_ele { u16 offset ; u16 size_of ; u16 width ; u16 lsb ; }; enum hrtimer_restart; enum hrtimer_restart; struct __anonstruct_read_308 { __le64 pkt_addr ; __le64 hdr_addr ; __le64 rsvd1 ; __le64 rsvd2 ; }; union __anonunion_mirr_fcoe_312 { __le16 mirroring_status ; __le16 fcoe_ctx_id ; }; struct __anonstruct_lo_dword_311 { union __anonunion_mirr_fcoe_312 mirr_fcoe ; __le16 l2tag1 ; }; union __anonunion_hi_dword_313 { __le32 rss ; __le32 fcoe_param ; }; struct __anonstruct_qword0_310 { struct __anonstruct_lo_dword_311 lo_dword ; union __anonunion_hi_dword_313 hi_dword ; }; struct __anonstruct_qword1_314 { __le64 status_error_len ; }; struct __anonstruct_qword2_315 { __le16 ext_status ; __le16 rsvd ; __le16 l2tag2_1 ; __le16 l2tag2_2 ; }; union __anonunion_lo_dword_317 { __le32 flex_bytes_lo ; __le32 pe_status ; }; union __anonunion_hi_dword_318 { __le32 flex_bytes_hi ; __le32 fd_id ; }; struct __anonstruct_qword3_316 { union __anonunion_lo_dword_317 lo_dword ; union __anonunion_hi_dword_318 hi_dword ; }; struct __anonstruct_wb_309 { struct __anonstruct_qword0_310 qword0 ; struct __anonstruct_qword1_314 qword1 ; struct __anonstruct_qword2_315 qword2 ; struct __anonstruct_qword3_316 qword3 ; }; union i40e_32byte_rx_desc { struct __anonstruct_read_308 read ; struct __anonstruct_wb_309 wb ; }; enum hrtimer_restart; enum hrtimer_restart; struct skb_frag_struct; typedef struct skb_frag_struct skb_frag_t; struct __anonstruct_page_218 { struct page *p ; }; struct skb_frag_struct { struct __anonstruct_page_218 page ; __u32 page_offset ; __u32 size ; }; struct skb_shared_hwtstamps { ktime_t hwtstamp ; ktime_t syststamp ; }; struct skb_shared_info { unsigned char nr_frags ; __u8 tx_flags ; unsigned short gso_size ; unsigned short gso_segs ; unsigned short gso_type ; struct sk_buff *frag_list ; struct skb_shared_hwtstamps hwtstamps ; __be32 ip6_frag_id ; atomic_t dataref ; void *destructor_arg ; skb_frag_t frags[17U] ; }; enum 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; enum skb_free_reason { SKB_REASON_CONSUMED = 0, SKB_REASON_DROPPED = 1 } ; struct ipv6hdr { __u8 priority : 4 ; __u8 version : 4 ; __u8 flow_lbl[3U] ; __be16 payload_len ; __u8 nexthdr ; __u8 hop_limit ; struct in6_addr saddr ; struct in6_addr daddr ; }; 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 i40e_tx_context_desc { __le32 tunneling_params ; __le16 l2tag2 ; __le16 rsvd ; __le64 type_cmd_tso_mss ; }; struct i40e_filter_program_desc { __le32 qindex_flex_ptype_vsi ; __le32 rsvd ; __le32 dtype_cmd_cntindex ; __le32 fd_id ; }; union __anonunion_hdr_324 { unsigned char *network ; struct iphdr *ipv4 ; struct ipv6hdr *ipv6 ; }; enum hrtimer_restart; enum hrtimer_restart; enum i40e_hmc_obj_rx_hsplit_0 { I40E_HMC_OBJ_RX_HSPLIT_0_NO_SPLIT = 0, I40E_HMC_OBJ_RX_HSPLIT_0_SPLIT_L2 = 1, I40E_HMC_OBJ_RX_HSPLIT_0_SPLIT_IP = 2, I40E_HMC_OBJ_RX_HSPLIT_0_SPLIT_TCP_UDP = 4, I40E_HMC_OBJ_RX_HSPLIT_0_SPLIT_SCTP = 8 } ; enum i40e_queue_type { I40E_QUEUE_TYPE_RX = 0, I40E_QUEUE_TYPE_TX = 1, I40E_QUEUE_TYPE_PE_CEQ = 2, I40E_QUEUE_TYPE_UNKNOWN = 3 } ; enum i40e_virtchnl_ops { I40E_VIRTCHNL_OP_UNKNOWN = 0, I40E_VIRTCHNL_OP_VERSION = 1, I40E_VIRTCHNL_OP_RESET_VF = 2, I40E_VIRTCHNL_OP_GET_VF_RESOURCES = 3, I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE = 4, I40E_VIRTCHNL_OP_CONFIG_RX_QUEUE = 5, I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES = 6, I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP = 7, I40E_VIRTCHNL_OP_ENABLE_QUEUES = 8, I40E_VIRTCHNL_OP_DISABLE_QUEUES = 9, I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS = 10, I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS = 11, I40E_VIRTCHNL_OP_ADD_VLAN = 12, I40E_VIRTCHNL_OP_DEL_VLAN = 13, I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE = 14, I40E_VIRTCHNL_OP_GET_STATS = 15, I40E_VIRTCHNL_OP_FCOE = 16, I40E_VIRTCHNL_OP_EVENT = 17 } ; struct i40e_virtchnl_version_info { u32 major ; u32 minor ; }; struct i40e_virtchnl_vsi_resource { u16 vsi_id ; u16 num_queue_pairs ; enum i40e_vsi_type vsi_type ; u16 qset_handle ; u8 default_mac_addr[6U] ; }; struct i40e_virtchnl_vf_resource { u16 num_vsis ; u16 num_queue_pairs ; u16 max_vectors ; u16 max_mtu ; u32 vf_offload_flags ; u32 max_fcoe_contexts ; u32 max_fcoe_filters ; struct i40e_virtchnl_vsi_resource vsi_res[1U] ; }; struct i40e_virtchnl_txq_info { u16 vsi_id ; u16 queue_id ; u16 ring_len ; u16 headwb_enabled ; u64 dma_ring_addr ; u64 dma_headwb_addr ; }; struct i40e_virtchnl_rxq_info { u16 vsi_id ; u16 queue_id ; u32 ring_len ; u16 hdr_size ; u16 splithdr_enabled ; u32 databuffer_size ; u32 max_pkt_size ; u64 dma_ring_addr ; enum i40e_hmc_obj_rx_hsplit_0 rx_split_pos ; }; struct i40e_virtchnl_queue_pair_info { struct i40e_virtchnl_txq_info txq ; struct i40e_virtchnl_rxq_info rxq ; }; struct i40e_virtchnl_vsi_queue_config_info { u16 vsi_id ; u16 num_queue_pairs ; struct i40e_virtchnl_queue_pair_info qpair[1U] ; }; struct i40e_virtchnl_vector_map { u16 vsi_id ; u16 vector_id ; u16 rxq_map ; u16 txq_map ; u16 rxitr_idx ; u16 txitr_idx ; }; struct i40e_virtchnl_irq_map_info { u16 num_vectors ; struct i40e_virtchnl_vector_map vecmap[1U] ; }; struct i40e_virtchnl_queue_select { u16 vsi_id ; u16 pad ; u32 rx_queues ; u32 tx_queues ; }; struct i40e_virtchnl_ether_addr_list { u16 vsi_id ; u16 num_elements ; struct i40e_virtchnl_ether_addr list[1U] ; }; struct i40e_virtchnl_vlan_filter_list { u16 vsi_id ; u16 num_elements ; u16 vlan_id[1U] ; }; struct i40e_virtchnl_promisc_info { u16 vsi_id ; u16 flags ; }; enum i40e_virtchnl_event_codes { I40E_VIRTCHNL_EVENT_UNKNOWN = 0, I40E_VIRTCHNL_EVENT_LINK_CHANGE = 1, I40E_VIRTCHNL_EVENT_RESET_IMPENDING = 2, I40E_VIRTCHNL_EVENT_PF_DRIVER_CLOSE = 3 } ; struct __anonstruct_link_event_320 { enum i40e_aq_link_speed link_speed ; bool link_status ; }; union __anonunion_event_data_319 { struct __anonstruct_link_event_320 link_event ; }; struct i40e_virtchnl_pf_event { enum i40e_virtchnl_event_codes event ; union __anonunion_event_data_319 event_data ; int severity ; }; enum hrtimer_restart; enum i40e_status_code; struct i40e_lldp_org_tlv { __be16 typelength ; __be32 ouisubtype ; u8 tlvinfo[1U] ; }; enum hrtimer_restart; struct device_private { void *driver_data ; }; enum hrtimer_restart; struct kthread_work; struct kthread_worker { spinlock_t lock ; struct list_head work_list ; struct task_struct *task ; struct kthread_work *current_work ; }; struct kthread_work { struct list_head node ; void (*func)(struct kthread_work * ) ; wait_queue_head_t done ; struct kthread_worker *worker ; }; struct spi_master; struct spi_device { struct device dev ; struct spi_master *master ; u32 max_speed_hz ; u8 chip_select ; u8 bits_per_word ; u16 mode ; int irq ; void *controller_state ; void *controller_data ; char modalias[32U] ; int cs_gpio ; }; struct spi_message; struct spi_transfer; struct spi_master { struct device dev ; struct list_head list ; s16 bus_num ; u16 num_chipselect ; u16 dma_alignment ; u16 mode_bits ; u32 bits_per_word_mask ; u32 min_speed_hz ; u32 max_speed_hz ; u16 flags ; spinlock_t bus_lock_spinlock ; struct mutex bus_lock_mutex ; bool bus_lock_flag ; int (*setup)(struct spi_device * ) ; int (*transfer)(struct spi_device * , struct spi_message * ) ; void (*cleanup)(struct spi_device * ) ; bool queued ; struct kthread_worker kworker ; struct task_struct *kworker_task ; struct kthread_work pump_messages ; spinlock_t queue_lock ; struct list_head queue ; struct spi_message *cur_msg ; bool busy ; bool running ; bool rt ; bool auto_runtime_pm ; bool cur_msg_prepared ; struct completion xfer_completion ; int (*prepare_transfer_hardware)(struct spi_master * ) ; int (*transfer_one_message)(struct spi_master * , struct spi_message * ) ; int (*unprepare_transfer_hardware)(struct spi_master * ) ; int (*prepare_message)(struct spi_master * , struct spi_message * ) ; int (*unprepare_message)(struct spi_master * , struct spi_message * ) ; void (*set_cs)(struct spi_device * , bool ) ; int (*transfer_one)(struct spi_master * , struct spi_device * , struct spi_transfer * ) ; int *cs_gpios ; }; struct spi_transfer { void const *tx_buf ; void *rx_buf ; unsigned int len ; dma_addr_t tx_dma ; dma_addr_t rx_dma ; unsigned int cs_change : 1 ; unsigned int tx_nbits : 3 ; unsigned int rx_nbits : 3 ; u8 bits_per_word ; u16 delay_usecs ; u32 speed_hz ; struct list_head transfer_list ; }; struct spi_message { struct list_head transfers ; struct spi_device *spi ; unsigned int is_dma_mapped : 1 ; void (*complete)(void * ) ; void *context ; unsigned int frame_length ; unsigned int actual_length ; int status ; struct list_head queue ; void *state ; }; struct ldv_thread; struct ldv_thread_set { int number ; struct ldv_thread **threads ; }; struct ldv_thread { int identifier ; void (*function)(void * ) ; }; struct clk; long ldv__builtin_expect(long exp , long c ) ; void *ldv_dev_get_drvdata(struct device const *dev ) ; int ldv_dev_set_drvdata(struct device *dev , void *data ) ; void *ldv_kzalloc(size_t size , gfp_t flags ) ; extern void ldv_initialize(void) ; int ldv_post_init(int init_ret_val ) ; extern void ldv_pre_probe(void) ; int ldv_post_probe(int probe_ret_val ) ; int ldv_filter_err_code(int ret_val ) ; void ldv_check_final_state(void) ; extern void ldv_switch_to_interrupt_context(void) ; extern void ldv_switch_to_process_context(void) ; void ldv_assume(int expression ) ; void ldv_stop(void) ; int ldv_undef_int(void) ; void ldv_free(void *s ) ; void *ldv_xmalloc(size_t size ) ; extern void *external_allocated_data(void) ; __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; } } extern void list_del(struct list_head * ) ; __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } extern struct module __this_module ; extern struct pv_irq_ops pv_irq_ops ; __inline static void set_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void clear_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } __inline static int test_and_set_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile ("":); return (0); return (1); } } __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 fls64(__u64 x ) { int bitpos ; { bitpos = -1; __asm__ ("bsrq %1,%q0": "+r" (bitpos): "rm" (x)); return (bitpos + 1); } } extern unsigned long find_next_bit(unsigned long const * , unsigned long , unsigned long ) ; extern unsigned long find_first_bit(unsigned long const * , unsigned long ) ; __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } __inline static unsigned int fls_long(unsigned long l ) { int tmp___0 ; { { tmp___0 = fls64((__u64 )l); } return ((unsigned int )tmp___0); } } __inline static unsigned long __rounddown_pow_of_two(unsigned long n ) { unsigned int tmp ; { { tmp = fls_long(n); } return (1UL << (int )(tmp - 1U)); } } extern int printk(char const * , ...) ; extern void __might_sleep(char const * , int , int ) ; extern int snprintf(char * , size_t , char const * , ...) ; extern enum system_states system_state ; extern void __bad_percpu_size(void) ; extern void *memcpy(void * , void const * , size_t ) ; extern void *memset(void * , int , size_t ) ; extern int memcmp(void const * , void const * , size_t ) ; extern int __bitmap_weight(unsigned long const * , int ) ; __inline static int bitmap_weight(unsigned long const *src , int nbits ) { int tmp___0 ; { { tmp___0 = __bitmap_weight(src, nbits); } return (tmp___0); } } extern void warn_slowpath_null(char const * , int const ) ; extern int nr_cpu_ids ; extern struct cpumask const * const cpu_online_mask ; __inline static unsigned int cpumask_check(unsigned int cpu ) { bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { { __ret_warn_once = cpu >= (unsigned int )nr_cpu_ids; tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); } if (tmp___1 != 0L) { { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp != 0L) { { warn_slowpath_null("include/linux/cpumask.h", 108); } } else { } { tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp___0 != 0L) { __warned = 1; } else { } } else { } { ldv__builtin_expect(__ret_warn_once != 0, 0L); } return (cpu); } } __inline static void cpumask_set_cpu(unsigned int cpu , struct cpumask *dstp ) { unsigned int tmp ; { { tmp = cpumask_check(cpu); set_bit((long )tmp, (unsigned long volatile *)(& dstp->bits)); } return; } } __inline static unsigned int cpumask_weight(struct cpumask const *srcp ) { int tmp ; { { tmp = bitmap_weight((unsigned long const *)(& srcp->bits), nr_cpu_ids); } return ((unsigned int )tmp); } } __inline static unsigned long arch_local_save_flags(void) { unsigned long __ret ; unsigned long __edi ; unsigned long __esi ; unsigned long __edx ; unsigned long __ecx ; unsigned long __eax ; long tmp ; { { __edi = __edi; __esi = __esi; __edx = __edx; __ecx = __ecx; __eax = __eax; tmp = ldv__builtin_expect((unsigned long )pv_irq_ops.save_fl.func == (unsigned long )((void *)0), 0L); } if (tmp != 0L) { { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/debian/klever-work/native-scheduler-work-dir/scheduler/jobs/dfbfd2da522a1f5f4786ee57b863db44/klever-core-work-dir/e5e3e20/linux-drivers-clk1/lkbce/arch/x86/include/asm/paravirt.h"), "i" (804), "i" (12UL)); __builtin_unreachable(); } } else { } __asm__ volatile ("771:\n\tcall *%c2;\n772:\n.pushsection .parainstructions,\"a\"\n .balign 8 \n .quad 771b\n .byte %c1\n .byte 772b-771b\n .short %c3\n.popsection\n": "=a" (__eax): [paravirt_typenum] "i" (44UL), [paravirt_opptr] "i" (& pv_irq_ops.save_fl.func), [paravirt_clobber] "i" (1): "memory", "cc"); __ret = __eax; return (__ret); } } __inline static int arch_irqs_disabled_flags(unsigned long flags ) { { return ((flags & 512UL) == 0UL); } } 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 __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 int __preempt_count ; __inline static int preempt_count(void) { int pfo_ret__ ; { { if (4UL == 1UL) { goto case_1; } else { } if (4UL == 2UL) { goto case_2; } else { } if (4UL == 4UL) { goto case_4; } else { } if (4UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (__preempt_count)); goto ldv_6210; case_2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6210; case_4: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6210; case_8: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6210; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break: /* CIL Label */ ; } ldv_6210: ; return (pfo_ret__ & 2147483647); } } __inline static void __preempt_count_add(int val ) { int pao_ID__ ; { pao_ID__ = 0; { if (4UL == 1UL) { goto case_1; } else { } if (4UL == 2UL) { goto case_2; } else { } if (4UL == 4UL) { goto case_4; } else { } if (4UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (__preempt_count): "qi" (val)); } goto ldv_6267; case_2: /* CIL Label */ ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6267; case_4: /* CIL Label */ ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6267; case_8: /* CIL Label */ ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (__preempt_count): "re" (val)); } goto ldv_6267; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break: /* CIL Label */ ; } ldv_6267: ; return; } } __inline static void __preempt_count_sub(int val ) { int pao_ID__ ; { pao_ID__ = 0; { if (4UL == 1UL) { goto case_1; } else { } if (4UL == 2UL) { goto case_2; } else { } if (4UL == 4UL) { goto case_4; } else { } if (4UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (__preempt_count): "qi" (- val)); } goto ldv_6279; case_2: /* CIL Label */ ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6279; case_4: /* CIL Label */ ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6279; case_8: /* CIL Label */ ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (__preempt_count): "re" (- val)); } goto ldv_6279; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break: /* CIL Label */ ; } ldv_6279: ; return; } } extern void __local_bh_disable_ip(unsigned long , unsigned int ) ; __inline static void local_bh_disable(void) { { { __local_bh_disable_ip((unsigned long )((void *)0), 512U); } return; } } extern void __local_bh_enable_ip(unsigned long , unsigned int ) ; __inline static void local_bh_enable(void) { { { __local_bh_enable_ip((unsigned long )((void *)0), 512U); } return; } } extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; __inline static void spin_lock(spinlock_t *lock ) { { { _raw_spin_lock(& lock->__annonCompField19.rlock); } return; } } __inline static void spin_unlock(spinlock_t *lock ) { { { _raw_spin_unlock(& lock->__annonCompField19.rlock); } return; } } __inline static void __rcu_read_lock(void) { { { __preempt_count_add(1); __asm__ volatile ("": : : "memory"); } return; } } __inline static void __rcu_read_unlock(void) { { { __asm__ volatile ("": : : "memory"); __preempt_count_sub(1); } return; } } extern void kfree_call_rcu(struct callback_head * , void (*)(struct callback_head * ) ) ; extern bool rcu_is_watching(void) ; extern bool rcu_lockdep_current_cpu_online(void) ; __inline static void rcu_lock_acquire(struct lockdep_map *map ) { { { lock_acquire(map, 0U, 0, 2, 1, (struct lockdep_map *)0, (unsigned long )((void *)0)); } return; } } __inline static void rcu_lock_release(struct lockdep_map *map ) { { { lock_release(map, 1, (unsigned long )((void *)0)); } return; } } extern struct lockdep_map rcu_lock_map ; extern int debug_lockdep_rcu_enabled(void) ; __inline static int rcu_read_lock_held(void) { int tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; { { tmp = debug_lockdep_rcu_enabled(); } if (tmp == 0) { return (1); } else { } { tmp___0 = rcu_is_watching(); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else { } { tmp___2 = rcu_lockdep_current_cpu_online(); } if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return (0); } else { } { tmp___4 = lock_is_held(& rcu_lock_map); } return (tmp___4); } } __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", 812, "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", 833, "rcu_read_unlock() used illegally while idle"); } } else { } } else { } { rcu_lock_release(& rcu_lock_map); __rcu_read_unlock(); } return; } } extern unsigned long volatile jiffies ; 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 ) ; static int ldv_mod_timer_16(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; static int ldv_mod_timer_26(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; extern int del_timer_sync(struct timer_list * ) ; static int ldv_del_timer_sync_27(struct timer_list *ldv_func_arg1 ) ; static int ldv_del_timer_sync_28(struct timer_list *ldv_func_arg1 ) ; extern unsigned long round_jiffies(unsigned long ) ; extern void __init_work(struct work_struct * , int ) ; extern struct workqueue_struct *system_wq ; extern bool queue_work_on(int , struct workqueue_struct * , struct work_struct * ) ; extern bool cancel_work_sync(struct work_struct * ) ; __inline static bool queue_work(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { { tmp = queue_work_on(8192, wq, work); } return (tmp); } } __inline static bool schedule_work(struct work_struct *work ) { bool tmp ; { { tmp = queue_work(system_wq, work); } return (tmp); } } __inline static unsigned int readl(void const volatile *addr ) { unsigned int ret ; { __asm__ volatile ("movl %1,%0": "=r" (ret): "m" (*((unsigned int volatile *)addr)): "memory"); return (ret); } } __inline static void writel(unsigned int val , void volatile *addr ) { { __asm__ volatile ("movl %0,%1": : "r" (val), "m" (*((unsigned int volatile *)addr)): "memory"); return; } } __inline static unsigned long readq(void const volatile *addr ) { unsigned long ret ; { __asm__ volatile ("movq %1,%0": "=r" (ret): "m" (*((unsigned long volatile *)addr)): "memory"); return (ret); } } extern void *ioremap_nocache(resource_size_t , unsigned long ) ; __inline static void *ioremap(resource_size_t offset , unsigned long size ) { void *tmp ; { { tmp = ioremap_nocache(offset, size); } return (tmp); } } extern void iounmap(void volatile * ) ; extern int cpu_number ; extern void __bad_size_call_parameter(void) ; extern int device_set_wakeup_enable(struct device * , bool ) ; static void *ldv_dev_get_drvdata_8(struct device const *dev ) ; static int ldv_dev_set_drvdata_9(struct device *dev , void *data ) ; extern char const *dev_driver_string(struct device const * ) ; extern int dev_err(struct device const * , char const * , ...) ; extern int dev_warn(struct device const * , char const * , ...) ; extern int _dev_info(struct device const * , char const * , ...) ; extern void __const_udelay(unsigned long ) ; extern void msleep(unsigned int ) ; extern void usleep_range(unsigned long , unsigned long ) ; extern void get_random_bytes(void * , int ) ; extern void kfree(void const * ) ; extern void *__kmalloc(size_t , gfp_t ) ; __inline static void *kmalloc_array(size_t n , size_t size , gfp_t flags ) { void *tmp ; { if (size != 0UL && n > 0xffffffffffffffffUL / size) { 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 ) ; __inline static int valid_dma_direction(int dma_direction ) { { return ((unsigned int )dma_direction <= 2U); } } __inline static int is_device_dma_capable(struct device *dev ) { { return ((unsigned long )dev->dma_mask != (unsigned long )((u64 *)0ULL) && *(dev->dma_mask) != 0ULL); } } extern void debug_dma_unmap_page(struct device * , dma_addr_t , size_t , int , bool ) ; extern void debug_dma_alloc_coherent(struct device * , size_t , dma_addr_t , void * ) ; extern void debug_dma_free_coherent(struct device * , size_t , void * , dma_addr_t ) ; extern struct device x86_dma_fallback_dev ; 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_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)); __builtin_unreachable(); } } 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; } } extern int dma_supported(struct device * , u64 ) ; extern int dma_set_mask(struct device * , u64 ) ; __inline static unsigned long dma_alloc_coherent_mask(struct device *dev , gfp_t gfp ) { unsigned long dma_mask ; { dma_mask = 0UL; dma_mask = (unsigned long )dev->coherent_dma_mask; if (dma_mask == 0UL) { dma_mask = (int )gfp & 1 ? 16777215UL : 4294967295UL; } else { } return (dma_mask); } } __inline static gfp_t dma_alloc_coherent_gfp_flags(struct device *dev , gfp_t gfp ) { unsigned long dma_mask ; unsigned long tmp ; { { tmp = dma_alloc_coherent_mask(dev, gfp); dma_mask = tmp; } if ((unsigned long long )dma_mask <= 16777215ULL) { gfp = gfp | 1U; } else { } if ((unsigned long long )dma_mask <= 4294967295ULL && (gfp & 1U) == 0U) { gfp = gfp | 4U; } else { } return (gfp); } } __inline static void *dma_alloc_attrs(struct device *dev , size_t size , dma_addr_t *dma_handle , gfp_t gfp , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; void *memory ; int tmp___0 ; gfp_t tmp___1 ; { { tmp = get_dma_ops(dev); ops = tmp; gfp = gfp & 4294967288U; } if ((unsigned long )dev == (unsigned long )((struct device *)0)) { dev = & x86_dma_fallback_dev; } else { } { tmp___0 = is_device_dma_capable(dev); } if (tmp___0 == 0) { return ((void *)0); } else { } if ((unsigned long )ops->alloc == (unsigned long )((void *(*)(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ))0)) { return ((void *)0); } else { } { tmp___1 = dma_alloc_coherent_gfp_flags(dev, gfp); memory = (*(ops->alloc))(dev, size, dma_handle, tmp___1, attrs); debug_dma_alloc_coherent(dev, size, *dma_handle, memory); } return (memory); } } __inline static void dma_free_attrs(struct device *dev , size_t size , void *vaddr , dma_addr_t bus , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int __ret_warn_on ; unsigned long _flags ; int tmp___0 ; long tmp___1 ; { { tmp = get_dma_ops(dev); ops = tmp; _flags = arch_local_save_flags(); tmp___0 = arch_irqs_disabled_flags(_flags); __ret_warn_on = tmp___0 != 0; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp___1 != 0L) { { warn_slowpath_null("/home/debian/klever-work/native-scheduler-work-dir/scheduler/jobs/dfbfd2da522a1f5f4786ee57b863db44/klever-core-work-dir/e5e3e20/linux-drivers-clk1/lkbce/arch/x86/include/asm/dma-mapping.h", 166); } } else { } { ldv__builtin_expect(__ret_warn_on != 0, 0L); debug_dma_free_coherent(dev, size, vaddr, bus); } if ((unsigned long )ops->free != (unsigned long )((void (*)(struct device * , size_t , void * , dma_addr_t , struct dma_attrs * ))0)) { { (*(ops->free))(dev, size, vaddr, bus, attrs); } } else { } return; } } __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 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 unsigned int u64_stats_fetch_begin_bh(struct u64_stats_sync const *syncp ) { { return (0U); } } __inline static bool u64_stats_fetch_retry_bh(struct u64_stats_sync const *syncp , unsigned int start ) { { return (0); } } extern void synchronize_irq(unsigned int ) ; extern void __napi_schedule(struct napi_struct * ) ; __inline static bool napi_disable_pending(struct napi_struct *n ) { int tmp ; { { tmp = constant_test_bit(1L, (unsigned long const volatile *)(& n->state)); } return (tmp != 0); } } __inline static bool napi_schedule_prep(struct napi_struct *n ) { bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { { tmp = napi_disable_pending(n); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { { tmp___1 = test_and_set_bit(0L, (unsigned long volatile *)(& n->state)); } if (tmp___1 == 0) { tmp___2 = 1; } else { tmp___2 = 0; } } else { tmp___2 = 0; } return ((bool )tmp___2); } } __inline static void napi_schedule(struct napi_struct *n ) { bool tmp ; { { tmp = napi_schedule_prep(n); } if ((int )tmp) { { __napi_schedule(n); } } else { } return; } } __inline static void napi_disable(struct napi_struct *n ) { int tmp ; { { __might_sleep("include/linux/netdevice.h", 486, 0); set_bit(1L, (unsigned long volatile *)(& n->state)); } goto ldv_38002; ldv_38001: { msleep(1U); } ldv_38002: { tmp = test_and_set_bit(0L, (unsigned long volatile *)(& n->state)); } if (tmp != 0) { goto ldv_38001; } else { } { clear_bit(1L, (unsigned long volatile *)(& n->state)); } return; } } __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" (502), "i" (12UL)); __builtin_unreachable(); } } 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 )tc >= (int )dev->num_tc) { return (-22); } else { } dev->prio_tc_map[(int )prio & 15] = (unsigned int )tc & 15U; return (0); } } __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 int netdev_set_tc_queue(struct net_device *dev , u8 tc , u16 count , u16 offset ) { { if ((int )tc >= (int )dev->num_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); } } __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 + 3200U); } } extern void netif_napi_add(struct net_device * , struct napi_struct * , int (*)(struct napi_struct * , int ) , int ) ; extern void netif_napi_del(struct napi_struct * ) ; extern void free_netdev(struct net_device * ) ; static void ldv_free_netdev_20(struct net_device *ldv_func_arg1 ) ; static void ldv_free_netdev_22(struct net_device *ldv_func_arg1 ) ; static void ldv_free_netdev_25(struct net_device *ldv_func_arg1 ) ; extern int netpoll_trap(void) ; extern void __netif_schedule(struct Qdisc * ) ; __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_38901; ldv_38900: { tmp = netdev_get_tx_queue((struct net_device const *)dev, i); txq = tmp; netif_tx_start_queue(txq); i = i + 1U; } ldv_38901: ; if (i < dev->num_tx_queues) { goto ldv_38900; } else { } return; } } __inline static void netif_tx_wake_queue(struct netdev_queue *dev_queue ) { int tmp ; int tmp___0 ; { { tmp = netpoll_trap(); } if (tmp != 0) { { netif_tx_start_queue(dev_queue); } return; } else { } { tmp___0 = test_and_set_bit(0L, (unsigned long volatile *)(& dev_queue->state)); } if (tmp___0 != 0) { { __netif_schedule(dev_queue->qdisc); } } else { } return; } } __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_38915; ldv_38914: { tmp = netdev_get_tx_queue((struct net_device const *)dev, i); txq = tmp; netif_tx_wake_queue(txq); i = i + 1U; } ldv_38915: ; if (i < dev->num_tx_queues) { goto ldv_38914; } else { } return; } } __inline static void netif_tx_stop_queue(struct netdev_queue *dev_queue ) { int __ret_warn_on ; long tmp ; long tmp___0 ; { { __ret_warn_on = (unsigned long )dev_queue == (unsigned long )((struct netdev_queue *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp != 0L) { { warn_slowpath_null("include/linux/netdevice.h", 2128); } } else { } { tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp___0 != 0L) { { printk("\016netif_stop_queue() cannot be called before register_netdev()\n"); } return; } else { } { set_bit(0L, (unsigned long volatile *)(& dev_queue->state)); } return; } } __inline static void netif_tx_stop_all_queues(struct net_device *dev ) { unsigned int i ; struct netdev_queue *txq ; struct netdev_queue *tmp ; { i = 0U; goto ldv_38931; ldv_38930: { tmp = netdev_get_tx_queue((struct net_device const *)dev, i); txq = tmp; netif_tx_stop_queue(txq); i = i + 1U; } ldv_38931: ; if (i < dev->num_tx_queues) { goto ldv_38930; } else { } 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 int netif_set_xps_queue(struct net_device * , struct cpumask const * , u16 ) ; 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 ) ; __inline static bool netif_carrier_ok(struct net_device const *dev ) { int tmp ; { { tmp = constant_test_bit(2L, (unsigned long const volatile *)(& dev->state)); } return (tmp == 0); } } extern void netif_carrier_on(struct net_device * ) ; extern void netif_carrier_off(struct net_device * ) ; __inline static u32 netif_msg_init(int debug_value , int default_msg_enable_bits ) { { if ((unsigned int )debug_value > 31U) { return ((u32 )default_msg_enable_bits); } else { } if (debug_value == 0) { return (0U); } else { } return ((u32 )((1 << debug_value) + -1)); } } __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; } { if (4UL == 1UL) { goto case_1; } else { } if (4UL == 2UL) { goto case_2___0; } else { } if (4UL == 4UL) { goto case_4___1; } else { } if (4UL == 8UL) { goto case_8___2; } else { } goto switch_default___3; case_1: /* CIL Label */ ; { if (4UL == 1UL) { goto case_1___0; } else { } if (4UL == 2UL) { goto case_2; } else { } if (4UL == 4UL) { goto case_4; } else { } if (4UL == 8UL) { goto case_8; } else { } goto switch_default; case_1___0: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (cpu_number)); goto ldv_39460; case_2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_39460; case_4: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_39460; case_8: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (cpu_number)); goto ldv_39460; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break___0: /* CIL Label */ ; } ldv_39460: pscr_ret__ = pfo_ret__; goto ldv_39466; case_2___0: /* CIL Label */ ; { if (4UL == 1UL) { goto case_1___1; } else { } if (4UL == 2UL) { goto case_2___1; } else { } if (4UL == 4UL) { goto case_4___0; } else { } if (4UL == 8UL) { goto case_8___0; } else { } goto switch_default___0; case_1___1: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____0): "m" (cpu_number)); goto ldv_39470; case_2___1: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_39470; case_4___0: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_39470; case_8___0: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (cpu_number)); goto ldv_39470; switch_default___0: /* CIL Label */ { __bad_percpu_size(); } switch_break___1: /* CIL Label */ ; } ldv_39470: pscr_ret__ = pfo_ret_____0; goto ldv_39466; case_4___1: /* CIL Label */ ; { if (4UL == 1UL) { goto case_1___2; } else { } if (4UL == 2UL) { goto case_2___2; } else { } if (4UL == 4UL) { goto case_4___2; } else { } if (4UL == 8UL) { goto case_8___1; } else { } goto switch_default___1; case_1___2: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____1): "m" (cpu_number)); goto ldv_39479; case_2___2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_39479; case_4___2: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_39479; case_8___1: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (cpu_number)); goto ldv_39479; switch_default___1: /* CIL Label */ { __bad_percpu_size(); } switch_break___2: /* CIL Label */ ; } ldv_39479: pscr_ret__ = pfo_ret_____1; goto ldv_39466; case_8___2: /* CIL Label */ ; { if (4UL == 1UL) { goto case_1___3; } else { } if (4UL == 2UL) { goto case_2___3; } else { } if (4UL == 4UL) { goto case_4___3; } else { } if (4UL == 8UL) { goto case_8___3; } else { } goto switch_default___2; case_1___3: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____2): "m" (cpu_number)); goto ldv_39488; case_2___3: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_39488; case_4___3: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_39488; case_8___3: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (cpu_number)); goto ldv_39488; switch_default___2: /* CIL Label */ { __bad_percpu_size(); } switch_break___3: /* CIL Label */ ; } ldv_39488: pscr_ret__ = pfo_ret_____2; goto ldv_39466; switch_default___3: /* CIL Label */ { __bad_size_call_parameter(); } goto ldv_39466; switch_break: /* CIL Label */ ; } ldv_39466: cpu = pscr_ret__; i = 0U; goto ldv_39498; ldv_39497: { 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_39498: ; if (i < dev->num_tx_queues) { goto ldv_39497; } else { } { local_bh_enable(); } return; } } extern int register_netdev(struct net_device * ) ; static int ldv_register_netdev_23(struct net_device *ldv_func_arg1 ) ; extern void unregister_netdev(struct net_device * ) ; static void ldv_unregister_netdev_19(struct net_device *ldv_func_arg1 ) ; static void ldv_unregister_netdev_21(struct net_device *ldv_func_arg1 ) ; static void ldv_unregister_netdev_24(struct net_device *ldv_func_arg1 ) ; extern int netdev_err(struct net_device const * , char const * , ...) ; extern int netdev_warn(struct net_device const * , char const * , ...) ; extern int netdev_info(struct net_device const * , char const * , ...) ; 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 pcie_capability_read_word(struct pci_dev * , int , u16 * ) ; extern int pci_enable_device_mem(struct pci_dev * ) ; extern void pci_disable_device(struct pci_dev * ) ; extern void pci_set_master(struct pci_dev * ) ; extern int pci_select_bars(struct pci_dev * , unsigned long ) ; 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 int pci_request_selected_regions(struct pci_dev * , int , char const * ) ; extern void pci_release_selected_regions(struct pci_dev * , int ) ; extern int __pci_register_driver(struct pci_driver * , struct module * , char const * ) ; static int ldv___pci_register_driver_30(struct pci_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) ; extern void pci_unregister_driver(struct pci_driver * ) ; static void ldv_pci_unregister_driver_31(struct pci_driver *ldv_func_arg1 ) ; extern int pci_enable_msi_block(struct pci_dev * , int ) ; extern void pci_disable_msi(struct pci_dev * ) ; extern int pci_enable_msix(struct pci_dev * , struct msix_entry * , int ) ; extern void pci_disable_msix(struct pci_dev * ) ; __inline static void *pci_get_drvdata(struct pci_dev *pdev ) { void *tmp ; { { tmp = ldv_dev_get_drvdata_8((struct device const *)(& pdev->dev)); } return (tmp); } } __inline static void pci_set_drvdata(struct pci_dev *pdev , void *data ) { { { ldv_dev_set_drvdata_9(& pdev->dev, data); } return; } } extern void rtnl_lock(void) ; extern void rtnl_unlock(void) ; 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_10(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; __inline static int ldv_request_irq_12(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; __inline static int ldv_request_irq_13(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; __inline static int ldv_request_irq_17(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; extern void free_irq(unsigned int , void * ) ; static void ldv_free_irq_11(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; static void ldv_free_irq_14(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; static void ldv_free_irq_15(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; static void ldv_free_irq_29(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; extern int irq_set_affinity_hint(unsigned int , struct cpumask 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 int eth_validate_addr(struct net_device * ) ; extern struct net_device *alloc_etherdev_mqs(int , unsigned int , unsigned int ) ; static struct net_device *ldv_alloc_etherdev_mqs_18(int ldv_func_arg1 , unsigned int ldv_func_arg2 , unsigned int ldv_func_arg3 ) ; __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 ) { { return (((int )*addr & 1) != 0); } } __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 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); } } i40e_status i40e_init_lan_hmc(struct i40e_hw *hw , u32 txq_num , u32 rxq_num , u32 fcoe_cntx_num , u32 fcoe_filt_num ) ; i40e_status i40e_configure_lan_hmc(struct i40e_hw *hw , enum i40e_hmc_model model ) ; i40e_status i40e_shutdown_lan_hmc(struct i40e_hw *hw ) ; i40e_status i40e_clear_lan_tx_queue_context(struct i40e_hw *hw , u16 queue ) ; i40e_status i40e_set_lan_tx_queue_context(struct i40e_hw *hw , u16 queue , struct i40e_hmc_obj_txq *s ) ; i40e_status i40e_clear_lan_rx_queue_context(struct i40e_hw *hw , u16 queue ) ; i40e_status i40e_set_lan_rx_queue_context(struct i40e_hw *hw , u16 queue , struct i40e_hmc_obj_rxq *s ) ; i40e_status i40e_allocate_dma_mem_d(struct i40e_hw *hw , struct i40e_dma_mem *mem , u64 size , u32 alignment ) ; i40e_status i40e_free_dma_mem_d(struct i40e_hw *hw , struct i40e_dma_mem *mem ) ; i40e_status i40e_allocate_virt_mem_d(struct i40e_hw *hw , struct i40e_virt_mem *mem , u32 size ) ; i40e_status i40e_free_virt_mem_d(struct i40e_hw *hw , struct i40e_virt_mem *mem ) ; i40e_status i40e_init_adminq(struct i40e_hw *hw ) ; i40e_status i40e_shutdown_adminq(struct i40e_hw *hw ) ; i40e_status i40e_clean_arq_element(struct i40e_hw *hw , struct i40e_arq_event_info *e , u16 *pending ) ; bool i40e_check_asq_alive(struct i40e_hw *hw ) ; i40e_status i40e_aq_get_link_info(struct i40e_hw *hw , bool enable_lse , struct i40e_link_status *link , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw , struct i40e_driver_version *dv , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_add_vsi(struct i40e_hw *hw , struct i40e_vsi_context *vsi_ctx , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw , u16 seid , bool set_filter , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw , u16 seid , bool set , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw , u16 seid , bool set , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw , struct i40e_vsi_context *vsi_ctx , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw , struct i40e_vsi_context *vsi_ctx , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_add_veb(struct i40e_hw *hw , u16 uplink_seid , u16 downlink_seid , u8 enabled_tc , bool default_port , bool enable_l2_filtering , u16 *veb_seid , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_get_veb_parameters(struct i40e_hw *hw , u16 veb_seid , u16 *switch_id , bool *floating , u16 *statistic_index , u16 *vebs_used , u16 *vebs_free , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_add_macvlan(struct i40e_hw *hw , u16 seid , struct i40e_aqc_add_macvlan_element_data *mv_list , u16 count , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw , u16 seid , struct i40e_aqc_remove_macvlan_element_data *mv_list , u16 count , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw , struct i40e_aqc_get_switch_config_resp *buf , u16 buf_size , u16 *start_seid , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw , void *buff , u16 buff_size , u16 *data_size , enum i40e_admin_queue_opc list_type_opc , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw , u16 udp_port , u8 header_len , u8 protocol_index , u8 *filter_index , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_del_udp_tunnel(struct i40e_hw *hw , u8 index , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_delete_element(struct i40e_hw *hw , u16 seid , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_mac_address_write(struct i40e_hw *hw , u16 flags , u8 *mac_addr , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw , u16 seid , struct i40e_aqc_configure_vsi_tc_bw_data *bw_data , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_config_switch_comp_bw_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_configure_switching_comp_bw_config_data *bw_data , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_query_vsi_bw_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_vsi_bw_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_vsi_ets_sla_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_switching_comp_ets_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_init_shared_code(struct i40e_hw *hw ) ; i40e_status i40e_pf_reset(struct i40e_hw *hw ) ; void i40e_clear_pxe_mode(struct i40e_hw *hw ) ; i40e_status i40e_get_mac_addr(struct i40e_hw *hw , u8 *mac_addr ) ; void i40e_set_pci_config_data(struct i40e_hw *hw , u16 link_status ) ; i40e_status i40e_set_filter_control(struct i40e_hw *hw , struct i40e_filter_control_settings *settings ) ; void i40e_free_vfs(struct i40e_pf *pf ) ; int i40e_pci_sriov_configure(struct pci_dev *pdev , int num_vfs ) ; int i40e_vc_process_vf_msg(struct i40e_pf *pf , u16 vf_id , u32 v_opcode , u32 v_retval , u8 *msg , u16 msglen ) ; int i40e_vc_process_vflr_event(struct i40e_pf *pf ) ; void i40e_reset_vf(struct i40e_vf *vf , bool flr ) ; void i40e_vc_notify_vf_reset(struct i40e_vf *vf ) ; int i40e_ndo_set_vf_mac(struct net_device *netdev , int vf_id , u8 *mac ) ; int i40e_ndo_set_vf_port_vlan(struct net_device *netdev , int vf_id , u16 vlan_id , u8 qos ) ; int i40e_ndo_set_vf_bw(struct net_device *netdev , int vf_id , int tx_rate ) ; int i40e_ndo_get_vf_config(struct net_device *netdev , int vf_id , struct ifla_vf_info *ivi ) ; void i40e_vc_notify_link_state(struct i40e_pf *pf ) ; void i40e_vc_notify_reset(struct i40e_pf *pf ) ; void i40e_alloc_rx_buffers(struct i40e_ring *rx_ring , u16 cleaned_count ) ; netdev_tx_t i40e_lan_xmit_frame(struct sk_buff *skb , struct net_device *netdev ) ; void i40e_clean_tx_ring(struct i40e_ring *tx_ring ) ; void i40e_clean_rx_ring(struct i40e_ring *rx_ring ) ; int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring ) ; int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring ) ; void i40e_free_tx_resources(struct i40e_ring *tx_ring ) ; void i40e_free_rx_resources(struct i40e_ring *rx_ring ) ; int i40e_napi_poll(struct napi_struct *napi , int budget ) ; i40e_status i40e_lldp_to_dcb_config(u8 *lldpmib , struct i40e_dcbx_config *dcbcfg ) ; i40e_status i40e_aq_get_dcb_config(struct i40e_hw *hw , u8 mib_type , u8 bridgetype , struct i40e_dcbx_config *dcbcfg ) ; i40e_status i40e_init_dcb(struct i40e_hw *hw ) ; __inline static char *i40e_fw_version_str(struct i40e_hw *hw ) { char buf[32U] ; { { snprintf((char *)(& buf), 32UL, "f%d.%d a%d.%d n%02x.%02x e%08x", (int )hw->aq.fw_maj_ver, (int )hw->aq.fw_min_ver, (int )hw->aq.api_maj_ver, (int )hw->aq.api_min_ver, (int )hw->nvm.version >> 8, (int )hw->nvm.version & 255, hw->nvm.eetrack); } return ((char *)(& buf)); } } __inline static void i40e_vsi_setup_irqhandler(struct i40e_vsi *vsi , irqreturn_t (*irq_handler)(int , void * ) ) { { vsi->irq_handler = irq_handler; return; } } int i40e_up(struct i40e_vsi *vsi ) ; void i40e_down(struct i40e_vsi *vsi ) ; char const i40e_driver_name[5U] ; char const i40e_driver_version_str[9U] ; void i40e_do_reset_safe(struct i40e_pf *pf , u32 reset_flags ) ; void i40e_do_reset(struct i40e_pf *pf , u32 reset_flags ) ; void i40e_update_stats(struct i40e_vsi *vsi ) ; void i40e_update_eth_stats(struct i40e_vsi *vsi ) ; struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi ) ; int i40e_fetch_switch_configuration(struct i40e_pf *pf , bool printconfig ) ; void i40e_set_ethtool_ops(struct net_device *netdev ) ; struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi , u8 *macaddr , s16 vlan , bool is_vf , bool is_netdev ) ; void i40e_del_filter(struct i40e_vsi *vsi , u8 *macaddr , s16 vlan , bool is_vf , bool is_netdev ) ; int i40e_sync_vsi_filters(struct i40e_vsi *vsi ) ; struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf , u8 type , u16 uplink_seid , u32 param1 ) ; int i40e_vsi_release(struct i40e_vsi *vsi ) ; int i40e_vsi_control_rings(struct i40e_vsi *vsi , bool request ) ; int i40e_reconfig_rss_queues(struct i40e_pf *pf , int queue_count ) ; struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf , u16 flags , u16 uplink_seid , u16 vsi_seid , u8 enabled_tc ) ; void i40e_veb_release(struct i40e_veb *veb ) ; int i40e_veb_config_tc(struct i40e_veb *veb , u8 enabled_tc ) ; i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi , u16 vid ) ; void i40e_vsi_remove_pvid(struct i40e_vsi *vsi ) ; void i40e_vsi_reset_stats(struct i40e_vsi *vsi ) ; void i40e_pf_reset_stats(struct i40e_pf *pf ) ; void i40e_dbg_pf_init(struct i40e_pf *pf ) ; void i40e_dbg_pf_exit(struct i40e_pf *pf ) ; void i40e_dbg_init(void) ; void i40e_dbg_exit(void) ; void i40e_irq_dynamic_enable(struct i40e_vsi *vsi , int vector ) ; void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf ) ; void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf ) ; int i40e_ioctl(struct net_device *netdev , struct ifreq *ifr , int cmd ) ; void i40e_vlan_stripping_disable(struct i40e_vsi *vsi ) ; int i40e_vsi_add_vlan(struct i40e_vsi *vsi , s16 vid ) ; int i40e_vsi_kill_vlan(struct i40e_vsi *vsi , s16 vid ) ; struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi , u8 *macaddr , bool is_vf , bool is_netdev ) ; bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi ) ; struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi , u8 *macaddr , bool is_vf , bool is_netdev ) ; void i40e_vlan_stripping_enable(struct i40e_vsi *vsi ) ; void i40e_dcbnl_flush_apps(struct i40e_pf *pf , struct i40e_dcbx_config *new_cfg ) ; void i40e_dcbnl_set_all(struct i40e_vsi *vsi ) ; void i40e_dcbnl_setup(struct i40e_vsi *vsi ) ; bool i40e_dcb_need_reconfig(struct i40e_pf *pf , struct i40e_dcbx_config *old_cfg , struct i40e_dcbx_config *new_cfg ) ; void i40e_ptp_rx_hang(struct i40e_vsi *vsi ) ; void i40e_ptp_tx_hwtstamp(struct i40e_pf *pf ) ; void i40e_ptp_set_increment(struct i40e_pf *pf ) ; int i40e_ptp_set_ts_config(struct i40e_pf *pf , struct ifreq *ifr ) ; int i40e_ptp_get_ts_config(struct i40e_pf *pf , struct ifreq *ifr ) ; void i40e_ptp_init(struct i40e_pf *pf ) ; void i40e_ptp_stop(struct i40e_pf *pf ) ; extern void vxlan_get_rx_port(struct net_device * ) ; char const i40e_driver_name[5U] = { 'i', '4', '0', 'e', '\000'}; static char const i40e_driver_string[50U] = { 'I', 'n', 't', 'e', 'l', '(', 'R', ')', ' ', 'E', 't', 'h', 'e', 'r', 'n', 'e', 't', ' ', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', ' ', 'X', 'L', '7', '1', '0', ' ', 'N', 'e', 't', 'w', 'o', 'r', 'k', ' ', 'D', 'r', 'i', 'v', 'e', 'r', '\000'}; char const i40e_driver_version_str[9U] = { '0', '.', '3', '.', '3', '0', '-', 'k', '\000'}; static char const i40e_copyright[45U] = { 'C', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', ' ', '(', 'c', ')', ' ', '2', '0', '1', '3', ' ', '-', ' ', '2', '0', '1', '4', ' ', 'I', 'n', 't', 'e', 'l', ' ', 'C', 'o', 'r', 'p', 'o', 'r', 'a', 't', 'i', 'o', 'n', '.', '\000'}; static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi ) ; static void i40e_handle_reset_warning(struct i40e_pf *pf ) ; static int i40e_add_vsi(struct i40e_vsi *vsi ) ; static int i40e_add_veb(struct i40e_veb *veb , struct i40e_vsi *vsi ) ; static int i40e_setup_pf_switch(struct i40e_pf *pf , bool reinit ) ; static int i40e_setup_misc_vector(struct i40e_pf *pf ) ; static void i40e_determine_queue_usage(struct i40e_pf *pf ) ; static int i40e_setup_pf_filter_control(struct i40e_pf *pf ) ; static void i40e_fdir_sb_setup(struct i40e_pf *pf ) ; static int i40e_veb_get_bw_info(struct i40e_veb *veb ) ; static struct pci_device_id const i40e_pci_tbl[11U] = { {32902U, 5490U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5491U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5492U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5503U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5504U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5505U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5506U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5507U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5508U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {32902U, 5509U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {0U, 0U, 0U, 0U, 0U, 0U, 0UL}}; struct pci_device_id const __mod_pci_device_table ; static int debug = -1; i40e_status i40e_allocate_dma_mem_d(struct i40e_hw *hw , struct i40e_dma_mem *mem , u64 size , u32 alignment ) { struct i40e_pf *pf ; { { pf = (struct i40e_pf *)hw->back; mem->size = (((u32 )size + alignment) - 1U) & - alignment; mem->va = dma_zalloc_coherent(& (pf->pdev)->dev, (size_t )mem->size, & mem->pa, 208U); } if ((unsigned long )mem->va == (unsigned long )((void *)0)) { return (-12); } else { } return (0); } } i40e_status i40e_free_dma_mem_d(struct i40e_hw *hw , struct i40e_dma_mem *mem ) { struct i40e_pf *pf ; { { pf = (struct i40e_pf *)hw->back; dma_free_attrs(& (pf->pdev)->dev, (size_t )mem->size, mem->va, mem->pa, (struct dma_attrs *)0); mem->va = (void *)0; mem->pa = 0ULL; mem->size = 0U; } return (0); } } i40e_status i40e_allocate_virt_mem_d(struct i40e_hw *hw , struct i40e_virt_mem *mem , u32 size ) { { { mem->size = size; mem->va = kzalloc((size_t )size, 208U); } if ((unsigned long )mem->va == (unsigned long )((void *)0)) { return (-12); } else { } return (0); } } i40e_status i40e_free_virt_mem_d(struct i40e_hw *hw , struct i40e_virt_mem *mem ) { { { kfree((void const *)mem->va); mem->va = (void *)0; mem->size = 0U; } return (0); } } static int i40e_get_lump(struct i40e_pf *pf , struct i40e_lump_tracking *pile , u16 needed , u16 id ) { int ret ; int i ; int j ; { ret = -12; if (((unsigned long )pile == (unsigned long )((struct i40e_lump_tracking *)0) || (unsigned int )needed == 0U) || (int )((short )id) < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "param err: pile=%p needed=%d id=0x%04x\n", pile, (int )needed, (int )id); } return (-22); } else { } i = (int )pile->search_hint; goto ldv_57064; ldv_57072: ; if ((int )((short )pile->list[i]) < 0) { i = i + 1; goto ldv_57064; } else { } j = 0; goto ldv_57067; ldv_57066: ; if ((int )((short )pile->list[i + j]) < 0) { goto ldv_57065; } else { } j = j + 1; ldv_57067: ; if (j < (int )needed && i + j < (int )pile->num_entries) { goto ldv_57066; } else { } ldv_57065: ; if (j == (int )needed) { j = 0; goto ldv_57069; ldv_57068: pile->list[i + j] = (u16 )((unsigned int )id | 32768U); j = j + 1; ldv_57069: ; if (j < (int )needed) { goto ldv_57068; } else { } ret = i; pile->search_hint = (int )((u16 )i) + (int )((u16 )j); goto ldv_57071; } else { i = i + j; } ldv_57064: ; if (i < (int )pile->num_entries) { goto ldv_57072; } else { } ldv_57071: ; return (ret); } } static int i40e_put_lump(struct i40e_lump_tracking *pile , u16 index , u16 id ) { int valid_id ; int count ; int i ; { valid_id = (int )((unsigned int )id | 32768U); count = 0; if ((unsigned long )pile == (unsigned long )((struct i40e_lump_tracking *)0) || (int )index >= (int )pile->num_entries) { return (-22); } else { } i = (int )index; goto ldv_57082; ldv_57081: pile->list[i] = 0U; count = count + 1; i = i + 1; ldv_57082: ; if (i < (int )pile->num_entries && (int )pile->list[i] == valid_id) { goto ldv_57081; } else { } if (count != 0 && (int )index < (int )pile->search_hint) { pile->search_hint = index; } else { } return (count); } } static void i40e_service_event_schedule(struct i40e_pf *pf ) { int tmp ; int tmp___0 ; int tmp___1 ; { { tmp = constant_test_bit(3L, (unsigned long const volatile *)(& pf->state)); } if (tmp == 0) { { tmp___0 = constant_test_bit(9L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 == 0) { { tmp___1 = test_and_set_bit(5L, (unsigned long volatile *)(& pf->state)); } if (tmp___1 == 0) { { schedule_work(& pf->service_task); } } else { } } else { } } else { } return; } } static void i40e_tx_timeout(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; int tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; pf->tx_timeout_count = pf->tx_timeout_count + 1U; } if ((long )((pf->tx_timeout_last_recovery - (unsigned long )jiffies) + 5000UL) < 0L) { pf->tx_timeout_recovery_level = 0U; } else { } { pf->tx_timeout_last_recovery = jiffies; netdev_info((struct net_device const *)netdev, "tx_timeout recovery level %d\n", pf->tx_timeout_recovery_level); } { if (pf->tx_timeout_recovery_level == 0U) { goto case_0; } else { } if (pf->tx_timeout_recovery_level == 1U) { goto case_1; } else { } if (pf->tx_timeout_recovery_level == 2U) { goto case_2; } else { } if (pf->tx_timeout_recovery_level == 3U) { goto case_3; } else { } goto switch_default; case_0: /* CIL Label */ { tmp___0 = preempt_count(); } if (((unsigned long )tmp___0 & 2096896UL) != 0UL) { { set_bit(11L, (unsigned long volatile *)(& pf->state)); set_bit(11L, (unsigned long volatile *)(& vsi->state)); } } else { { i40e_vsi_reinit_locked(vsi); } } goto ldv_57100; case_1: /* CIL Label */ { set_bit(12L, (unsigned long volatile *)(& pf->state)); } goto ldv_57100; case_2: /* CIL Label */ { set_bit(13L, (unsigned long volatile *)(& pf->state)); } goto ldv_57100; case_3: /* CIL Label */ { set_bit(14L, (unsigned long volatile *)(& pf->state)); } goto ldv_57100; switch_default: /* CIL Label */ { netdev_err((struct net_device const *)netdev, "tx_timeout recovery unsuccessful\n"); i40e_down(vsi); } goto ldv_57100; switch_break: /* CIL Label */ ; } ldv_57100: { i40e_service_event_schedule(pf); pf->tx_timeout_recovery_level = pf->tx_timeout_recovery_level + 1U; } return; } } struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi ) { { return (& vsi->net_stats); } } static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(struct net_device *netdev , struct rtnl_link_stats64 *stats ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct rtnl_link_stats64 *vsi_stats ; struct rtnl_link_stats64 *tmp___0 ; int i ; int tmp___1 ; struct i40e_ring *tx_ring ; struct i40e_ring *rx_ring ; u64 bytes ; u64 packets ; unsigned int start ; bool tmp___2 ; bool tmp___3 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; tmp___0 = i40e_get_vsi_stats_struct(vsi); vsi_stats = tmp___0; tmp___1 = constant_test_bit(3L, (unsigned long const volatile *)(& vsi->state)); } if (tmp___1 != 0) { return (stats); } else { } if ((unsigned long )vsi->tx_rings == (unsigned long )((struct i40e_ring **)0)) { return (stats); } else { } { rcu_read_lock(); i = 0; } goto ldv_57131; ldv_57130: tx_ring = *((struct i40e_ring * volatile *)vsi->tx_rings + (unsigned long )i); if ((unsigned long )tx_ring == (unsigned long )((struct i40e_ring *)0)) { goto ldv_57125; } else { } ldv_57126: { start = u64_stats_fetch_begin_bh((struct u64_stats_sync const *)(& tx_ring->syncp)); packets = tx_ring->stats.packets; bytes = tx_ring->stats.bytes; tmp___2 = u64_stats_fetch_retry_bh((struct u64_stats_sync const *)(& tx_ring->syncp), start); } if ((int )tmp___2) { goto ldv_57126; } else { } stats->tx_packets = stats->tx_packets + packets; stats->tx_bytes = stats->tx_bytes + bytes; rx_ring = tx_ring + 1UL; ldv_57128: { start = u64_stats_fetch_begin_bh((struct u64_stats_sync const *)(& rx_ring->syncp)); packets = rx_ring->stats.packets; bytes = rx_ring->stats.bytes; tmp___3 = u64_stats_fetch_retry_bh((struct u64_stats_sync const *)(& rx_ring->syncp), start); } if ((int )tmp___3) { goto ldv_57128; } else { } stats->rx_packets = stats->rx_packets + packets; stats->rx_bytes = stats->rx_bytes + bytes; ldv_57125: i = i + 1; ldv_57131: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57130; } else { } { rcu_read_unlock(); stats->multicast = vsi_stats->multicast; stats->tx_errors = vsi_stats->tx_errors; stats->tx_dropped = vsi_stats->tx_dropped; stats->rx_errors = vsi_stats->rx_errors; stats->rx_crc_errors = vsi_stats->rx_crc_errors; stats->rx_length_errors = vsi_stats->rx_length_errors; } return (stats); } } void i40e_vsi_reset_stats(struct i40e_vsi *vsi ) { struct rtnl_link_stats64 *ns ; int i ; { if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { return; } else { } { ns = i40e_get_vsi_stats_struct(vsi); memset((void *)ns, 0, 184UL); memset((void *)(& vsi->net_stats_offsets), 0, 184UL); memset((void *)(& vsi->eth_stats), 0, 112UL); memset((void *)(& vsi->eth_stats_offsets), 0, 112UL); } if ((unsigned long )vsi->rx_rings != (unsigned long )((struct i40e_ring **)0) && (unsigned long )*(vsi->rx_rings) != (unsigned long )((struct i40e_ring *)0)) { i = 0; goto ldv_57139; ldv_57138: { memset((void *)(& (*(vsi->rx_rings + (unsigned long )i))->stats), 0, 16UL); memset((void *)(& (*(vsi->rx_rings + (unsigned long )i))->__annonCompField95.rx_stats), 0, 24UL); memset((void *)(& (*(vsi->tx_rings + (unsigned long )i))->stats), 0, 16UL); memset((void *)(& (*(vsi->tx_rings + (unsigned long )i))->__annonCompField95.tx_stats), 0, 24UL); i = i + 1; } ldv_57139: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57138; } else { } } else { } vsi->stat_offsets_loaded = 0; return; } } void i40e_pf_reset_stats(struct i40e_pf *pf ) { { { memset((void *)(& pf->stats), 0, 680UL); memset((void *)(& pf->stats_offsets), 0, 680UL); pf->stat_offsets_loaded = 0; } return; } } static void i40e_stat_update48(struct i40e_hw *hw , u32 hireg , u32 loreg , bool offset_loaded , u64 *offset , u64 *stat ) { u64 new_data ; unsigned int tmp ; unsigned int tmp___0 ; unsigned long tmp___1 ; long tmp___2 ; { if ((unsigned int )hw->device_id == 5492U) { { tmp = readl((void const volatile *)hw->hw_addr + (unsigned long )loreg); new_data = (u64 )tmp; tmp___0 = readl((void const volatile *)hw->hw_addr + (unsigned long )hireg); new_data = new_data | (((unsigned long long )tmp___0 & 65535ULL) << 32); } } else { { tmp___1 = readq((void const volatile *)hw->hw_addr + (unsigned long )loreg); new_data = (u64 )tmp___1; } } if (! offset_loaded) { *offset = new_data; } else { } { tmp___2 = ldv__builtin_expect(new_data >= *offset, 1L); } if (tmp___2 != 0L) { *stat = new_data - *offset; } else { *stat = (new_data - *offset) + 281474976710656ULL; } *stat = *stat & 281474976710655ULL; return; } } static void i40e_stat_update32(struct i40e_hw *hw , u32 reg , bool offset_loaded , u64 *offset , u64 *stat ) { u32 new_data ; long tmp ; { { new_data = readl((void const volatile *)hw->hw_addr + (unsigned long )reg); } if (! offset_loaded) { *offset = (u64 )new_data; } else { } { tmp = ldv__builtin_expect((u64 )new_data >= *offset, 1L); } if (tmp != 0L) { *stat = (u64 )(new_data - (unsigned int )*offset); } else { *stat = (u64 )(new_data - (unsigned int )*offset); } return; } } void i40e_update_eth_stats(struct i40e_vsi *vsi ) { int stat_idx ; struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_eth_stats *oes ; struct i40e_eth_stats *es ; { { stat_idx = (int )vsi->info.stat_counter_idx; pf = vsi->back; hw = & pf->hw; es = & vsi->eth_stats; oes = & vsi->eth_stats_offsets; i40e_stat_update32(hw, (u32 )((stat_idx + 428032) * 8), (int )vsi->stat_offsets_loaded, & oes->tx_errors, & es->tx_errors); i40e_stat_update32(hw, (u32 )((stat_idx + 401408) * 8), (int )vsi->stat_offsets_loaded, & oes->rx_discards, & es->rx_discards); i40e_stat_update48(hw, (u32 )(stat_idx * 8 + 3506180), (u32 )((stat_idx + 438272) * 8), (int )vsi->stat_offsets_loaded, & oes->rx_bytes, & es->rx_bytes); i40e_stat_update48(hw, (u32 )(stat_idx * 8 + 3588100), (u32 )((stat_idx + 448512) * 8), (int )vsi->stat_offsets_loaded, & oes->rx_unicast, & es->rx_unicast); i40e_stat_update48(hw, (u32 )(stat_idx * 8 + 3591172), (u32 )((stat_idx + 448896) * 8), (int )vsi->stat_offsets_loaded, & oes->rx_multicast, & es->rx_multicast); i40e_stat_update48(hw, (u32 )(stat_idx * 8 + 3594244), (u32 )((stat_idx + 449280) * 8), (int )vsi->stat_offsets_loaded, & oes->rx_broadcast, & es->rx_broadcast); i40e_stat_update48(hw, (u32 )(stat_idx * 8 + 3309572), (u32 )((stat_idx + 413696) * 8), (int )vsi->stat_offsets_loaded, & oes->tx_bytes, & es->tx_bytes); i40e_stat_update48(hw, (u32 )(stat_idx * 8 + 3391492), (u32 )((stat_idx + 423936) * 8), (int )vsi->stat_offsets_loaded, & oes->tx_unicast, & es->tx_unicast); i40e_stat_update48(hw, (u32 )(stat_idx * 8 + 3394564), (u32 )((stat_idx + 424320) * 8), (int )vsi->stat_offsets_loaded, & oes->tx_multicast, & es->tx_multicast); i40e_stat_update48(hw, (u32 )(stat_idx * 8 + 3397636), (u32 )((stat_idx + 424704) * 8), (int )vsi->stat_offsets_loaded, & oes->tx_broadcast, & es->tx_broadcast); vsi->stat_offsets_loaded = 1; } return; } } static void i40e_update_veb_stats(struct i40e_veb *veb ) { struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_eth_stats *oes ; struct i40e_eth_stats *es ; int idx ; { { pf = veb->pf; hw = & pf->hw; idx = 0; idx = (int )veb->stats_idx; es = & veb->stats; oes = & veb->stats_offsets; i40e_stat_update32(hw, (u32 )((idx + 430080) * 8), (int )veb->stat_offsets_loaded, & oes->tx_discards, & es->tx_discards); } if ((unsigned int )hw->revision_id != 0U) { { i40e_stat_update32(hw, (u32 )((idx + 450608) * 8), (int )veb->stat_offsets_loaded, & oes->rx_unknown_protocol, & es->rx_unknown_protocol); } } else { } { i40e_stat_update48(hw, (u32 )(idx * 8 + 3522564), (u32 )((idx + 440320) * 8), (int )veb->stat_offsets_loaded, & oes->rx_bytes, & es->rx_bytes); i40e_stat_update48(hw, (u32 )(idx * 8 + 3604484), (u32 )((idx + 450560) * 8), (int )veb->stat_offsets_loaded, & oes->rx_unicast, & es->rx_unicast); i40e_stat_update48(hw, (u32 )(idx * 8 + 3604612), (u32 )((idx + 450576) * 8), (int )veb->stat_offsets_loaded, & oes->rx_multicast, & es->rx_multicast); i40e_stat_update48(hw, (u32 )(idx * 8 + 3604740), (u32 )((idx + 450592) * 8), (int )veb->stat_offsets_loaded, & oes->rx_broadcast, & es->rx_broadcast); i40e_stat_update48(hw, (u32 )(idx * 8 + 3325956), (u32 )((idx + 415744) * 8), (int )veb->stat_offsets_loaded, & oes->tx_bytes, & es->tx_bytes); i40e_stat_update48(hw, (u32 )(idx * 8 + 3407876), (u32 )((idx + 425984) * 8), (int )veb->stat_offsets_loaded, & oes->tx_unicast, & es->tx_unicast); i40e_stat_update48(hw, (u32 )(idx * 8 + 3408004), (u32 )((idx + 426000) * 8), (int )veb->stat_offsets_loaded, & oes->tx_multicast, & es->tx_multicast); i40e_stat_update48(hw, (u32 )(idx * 8 + 3408132), (u32 )((idx + 426016) * 8), (int )veb->stat_offsets_loaded, & oes->tx_broadcast, & es->tx_broadcast); veb->stat_offsets_loaded = 1; } return; } } static void i40e_update_link_xoff_rx(struct i40e_pf *pf ) { struct i40e_hw_port_stats *osd ; struct i40e_hw_port_stats *nsd ; struct i40e_hw *hw ; u64 xoff ; u16 i ; u16 v ; struct i40e_vsi *vsi ; struct i40e_ring *ring ; { osd = & pf->stats_offsets; nsd = & pf->stats; hw = & pf->hw; xoff = 0ULL; if ((unsigned int )hw->fc.current_mode != 3U && (unsigned int )hw->fc.current_mode != 1U) { return; } else { } { xoff = nsd->link_xoff_rx; i40e_stat_update32(hw, (u32 )(((int )hw->port + 393260) * 8), (int )pf->stat_offsets_loaded, & osd->link_xoff_rx, & nsd->link_xoff_rx); } if (nsd->link_xoff_rx == xoff) { return; } else { } v = 0U; goto ldv_57193; ldv_57192: vsi = *(pf->vsi + (unsigned long )v); if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { goto ldv_57187; } else { } i = 0U; goto ldv_57190; ldv_57189: { ring = *(vsi->tx_rings + (unsigned long )i); clear_bit(3L, (unsigned long volatile *)(& ring->state)); i = (u16 )((int )i + 1); } ldv_57190: ; if ((int )i < (int )vsi->num_queue_pairs) { goto ldv_57189; } else { } ldv_57187: v = (u16 )((int )v + 1); ldv_57193: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_57192; } else { } return; } } static void i40e_update_prio_xoff_rx(struct i40e_pf *pf ) { struct i40e_hw_port_stats *osd ; struct i40e_hw_port_stats *nsd ; bool xoff[8U] ; unsigned int tmp ; struct i40e_dcbx_config *dcb_cfg ; struct i40e_hw *hw ; u16 i ; u16 v ; u8 tc ; u64 prio_xoff ; struct i40e_vsi *vsi ; struct i40e_ring *ring ; { osd = & pf->stats_offsets; nsd = & pf->stats; xoff[0] = 0; tmp = 1U; { while (1) { while_continue: /* CIL Label */ ; if (tmp >= 8U) { goto while_break; } else { } xoff[tmp] = (_Bool)0; tmp = tmp + 1U; } while_break: /* CIL Label */ ; } hw = & pf->hw; dcb_cfg = & hw->local_dcbx_config; if ((pf->flags & 1048576ULL) == 0ULL || (unsigned int )dcb_cfg->pfc.pfcenable == 0U) { { i40e_update_link_xoff_rx(pf); } return; } else { } i = 0U; goto ldv_57209; ldv_57208: { prio_xoff = nsd->priority_xoff_rx[(int )i]; i40e_stat_update32(hw, (u32 )((((int )hw->port + (int )i * 4) + 393296) * 8), (int )pf->stat_offsets_loaded, (u64 *)(& osd->priority_xoff_rx) + (unsigned long )i, (u64 *)(& nsd->priority_xoff_rx) + (unsigned long )i); } if (nsd->priority_xoff_rx[(int )i] == prio_xoff) { goto ldv_57207; } else { } tc = dcb_cfg->etscfg.prioritytable[(int )i]; xoff[(int )tc] = 1; ldv_57207: i = (u16 )((int )i + 1); ldv_57209: ; if ((unsigned int )i <= 7U) { goto ldv_57208; } else { } v = 0U; goto ldv_57218; ldv_57217: vsi = *(pf->vsi + (unsigned long )v); if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { goto ldv_57212; } else { } i = 0U; goto ldv_57215; ldv_57214: ring = *(vsi->tx_rings + (unsigned long )i); tc = ring->dcb_tc; if ((int )xoff[(int )tc]) { { clear_bit(3L, (unsigned long volatile *)(& ring->state)); } } else { } i = (u16 )((int )i + 1); ldv_57215: ; if ((int )i < (int )vsi->num_queue_pairs) { goto ldv_57214; } else { } ldv_57212: v = (u16 )((int )v + 1); ldv_57218: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_57217; } else { } return; } } void i40e_update_stats(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; struct i40e_hw *hw ; struct rtnl_link_stats64 *ons ; struct rtnl_link_stats64 *ns ; struct i40e_eth_stats *oes ; struct i40e_eth_stats *es ; u32 tx_restart ; u32 tx_busy ; u32 rx_page ; u32 rx_buf ; u64 rx_p ; u64 rx_b ; u64 tx_p ; u64 tx_b ; int i ; u16 q ; int tmp ; int tmp___0 ; struct i40e_ring *p ; u64 bytes ; u64 packets ; unsigned int start ; bool tmp___1 ; bool tmp___2 ; struct i40e_hw_port_stats *nsd ; struct i40e_hw_port_stats *osd ; { { pf = vsi->back; hw = & pf->hw; tmp = constant_test_bit(3L, (unsigned long const volatile *)(& vsi->state)); } if (tmp != 0) { return; } else { { tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 != 0) { return; } else { } } { ns = i40e_get_vsi_stats_struct(vsi); ons = & vsi->net_stats_offsets; es = & vsi->eth_stats; oes = & vsi->eth_stats_offsets; rx_p = 0ULL; rx_b = rx_p; tx_p = 0ULL; tx_b = tx_p; tx_busy = 0U; tx_restart = tx_busy; rx_page = 0U; rx_buf = 0U; rcu_read_lock(); q = 0U; } goto ldv_57248; ldv_57247: p = *((struct i40e_ring * volatile *)vsi->tx_rings + (unsigned long )q); ldv_57243: { start = u64_stats_fetch_begin_bh((struct u64_stats_sync const *)(& p->syncp)); packets = p->stats.packets; bytes = p->stats.bytes; tmp___1 = u64_stats_fetch_retry_bh((struct u64_stats_sync const *)(& p->syncp), start); } if ((int )tmp___1) { goto ldv_57243; } else { } tx_b = tx_b + bytes; tx_p = tx_p + packets; tx_restart = tx_restart + (u32 )p->__annonCompField95.tx_stats.restart_queue; tx_busy = tx_busy + (u32 )p->__annonCompField95.tx_stats.tx_busy; p = p + 1UL; ldv_57245: { start = u64_stats_fetch_begin_bh((struct u64_stats_sync const *)(& p->syncp)); packets = p->stats.packets; bytes = p->stats.bytes; tmp___2 = u64_stats_fetch_retry_bh((struct u64_stats_sync const *)(& p->syncp), start); } if ((int )tmp___2) { goto ldv_57245; } else { } rx_b = rx_b + bytes; rx_p = rx_p + packets; rx_buf = rx_buf + (u32 )p->__annonCompField95.rx_stats.alloc_buff_failed; rx_page = rx_page + (u32 )p->__annonCompField95.rx_stats.alloc_page_failed; q = (u16 )((int )q + 1); ldv_57248: ; if ((int )q < (int )vsi->num_queue_pairs) { goto ldv_57247; } else { } { rcu_read_unlock(); vsi->tx_restart = tx_restart; vsi->tx_busy = tx_busy; vsi->rx_page_failed = rx_page; vsi->rx_buf_failed = rx_buf; ns->rx_packets = rx_p; ns->rx_bytes = rx_b; ns->tx_packets = tx_p; ns->tx_bytes = tx_b; i40e_update_eth_stats(vsi); ons->rx_errors = oes->rx_errors; ns->rx_errors = es->rx_errors; ons->tx_errors = oes->tx_errors; ns->tx_errors = es->tx_errors; ons->multicast = oes->rx_multicast; ns->multicast = es->rx_multicast; ons->tx_dropped = oes->tx_discards; ns->tx_dropped = es->tx_discards; } if ((unsigned long )vsi == (unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi)) { { nsd = & pf->stats; osd = & pf->stats_offsets; i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3145732), (u32 )(((int )hw->port + 393216) * 8), (int )pf->stat_offsets_loaded, & osd->eth.rx_bytes, & nsd->eth.rx_bytes); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147396), (u32 )(((int )hw->port + 393424) * 8), (int )pf->stat_offsets_loaded, & osd->eth.tx_bytes, & nsd->eth.tx_bytes); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393408) * 8), (int )pf->stat_offsets_loaded, & osd->eth.rx_discards, & nsd->eth.rx_discards); i40e_stat_update32(hw, (u32 )(((int )hw->port + 453248) * 8), (int )pf->stat_offsets_loaded, & osd->eth.tx_discards, & nsd->eth.tx_discards); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147204), (u32 )(((int )hw->port + 393400) * 8), (int )pf->stat_offsets_loaded, & osd->eth.rx_multicast, & nsd->eth.rx_multicast); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393540) * 8), (int )pf->stat_offsets_loaded, & osd->tx_dropped_link_down, & nsd->tx_dropped_link_down); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393232) * 8), (int )pf->stat_offsets_loaded, & osd->crc_errors, & nsd->crc_errors); ns->rx_crc_errors = nsd->crc_errors; i40e_stat_update32(hw, (u32 )(((int )hw->port + 393244) * 8), (int )pf->stat_offsets_loaded, & osd->illegal_bytes, & nsd->illegal_bytes); ns->rx_errors = nsd->crc_errors + nsd->illegal_bytes; i40e_stat_update32(hw, (u32 )(((int )hw->port + 393220) * 8), (int )pf->stat_offsets_loaded, & osd->mac_local_faults, & nsd->mac_local_faults); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393224) * 8), (int )pf->stat_offsets_loaded, & osd->mac_remote_faults, & nsd->mac_remote_faults); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393236) * 8), (int )pf->stat_offsets_loaded, & osd->rx_length_errors, & nsd->rx_length_errors); ns->rx_length_errors = nsd->rx_length_errors; i40e_stat_update32(hw, (u32 )(((int )hw->port + 393256) * 8), (int )pf->stat_offsets_loaded, & osd->link_xon_rx, & nsd->link_xon_rx); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393520) * 8), (int )pf->stat_offsets_loaded, & osd->link_xon_tx, & nsd->link_xon_tx); i40e_update_prio_xoff_rx(pf); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393524) * 8), (int )pf->stat_offsets_loaded, & osd->link_xoff_tx, & nsd->link_xoff_tx); i = 0; } goto ldv_57253; ldv_57252: { i40e_stat_update32(hw, (u32 )((((int )hw->port + i * 4) + 393264) * 8), (int )pf->stat_offsets_loaded, (u64 *)(& osd->priority_xon_rx) + (unsigned long )i, (u64 *)(& nsd->priority_xon_rx) + (unsigned long )i); i40e_stat_update32(hw, (u32 )((((int )hw->port + i * 4) + 393456) * 8), (int )pf->stat_offsets_loaded, (u64 *)(& osd->priority_xon_tx) + (unsigned long )i, (u64 *)(& nsd->priority_xon_tx) + (unsigned long )i); i40e_stat_update32(hw, (u32 )((((int )hw->port + i * 4) + 393488) * 8), (int )pf->stat_offsets_loaded, (u64 *)(& osd->priority_xoff_tx) + (unsigned long )i, (u64 *)(& nsd->priority_xoff_tx) + (unsigned long )i); i40e_stat_update32(hw, (u32 )((((int )hw->port + i * 4) + 393328) * 8), (int )pf->stat_offsets_loaded, (u64 *)(& osd->priority_xon_2_xoff) + (unsigned long )i, (u64 *)(& nsd->priority_xon_2_xoff) + (unsigned long )i); i = i + 1; } ldv_57253: ; if (i <= 7) { goto ldv_57252; } else { } { i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3146884), (u32 )(((int )hw->port + 393360) * 8), (int )pf->stat_offsets_loaded, & osd->rx_size_64, & nsd->rx_size_64); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3146916), (u32 )(((int )hw->port + 393364) * 8), (int )pf->stat_offsets_loaded, & osd->rx_size_127, & nsd->rx_size_127); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3146948), (u32 )(((int )hw->port + 393368) * 8), (int )pf->stat_offsets_loaded, & osd->rx_size_255, & nsd->rx_size_255); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3146980), (u32 )(((int )hw->port + 393372) * 8), (int )pf->stat_offsets_loaded, & osd->rx_size_511, & nsd->rx_size_511); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147012), (u32 )(((int )hw->port + 393376) * 8), (int )pf->stat_offsets_loaded, & osd->rx_size_1023, & nsd->rx_size_1023); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147044), (u32 )(((int )hw->port + 393380) * 8), (int )pf->stat_offsets_loaded, & osd->rx_size_1522, & nsd->rx_size_1522); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147076), (u32 )(((int )hw->port + 393384) * 8), (int )pf->stat_offsets_loaded, & osd->rx_size_big, & nsd->rx_size_big); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147428), (u32 )(((int )hw->port + 393428) * 8), (int )pf->stat_offsets_loaded, & osd->tx_size_64, & nsd->tx_size_64); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147460), (u32 )(((int )hw->port + 393432) * 8), (int )pf->stat_offsets_loaded, & osd->tx_size_127, & nsd->tx_size_127); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147492), (u32 )(((int )hw->port + 393436) * 8), (int )pf->stat_offsets_loaded, & osd->tx_size_255, & nsd->tx_size_255); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147524), (u32 )(((int )hw->port + 393440) * 8), (int )pf->stat_offsets_loaded, & osd->tx_size_511, & nsd->tx_size_511); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147556), (u32 )(((int )hw->port + 393444) * 8), (int )pf->stat_offsets_loaded, & osd->tx_size_1023, & nsd->tx_size_1023); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147588), (u32 )(((int )hw->port + 393448) * 8), (int )pf->stat_offsets_loaded, & osd->tx_size_1522, & nsd->tx_size_1522); i40e_stat_update48(hw, (u32 )((int )hw->port * 8 + 3147620), (u32 )(((int )hw->port + 393452) * 8), (int )pf->stat_offsets_loaded, & osd->tx_size_big, & nsd->tx_size_big); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393248) * 8), (int )pf->stat_offsets_loaded, & osd->rx_undersize, & nsd->rx_undersize); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393388) * 8), (int )pf->stat_offsets_loaded, & osd->rx_fragments, & nsd->rx_fragments); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393252) * 8), (int )pf->stat_offsets_loaded, & osd->rx_oversize, & nsd->rx_oversize); i40e_stat_update32(hw, (u32 )(((int )hw->port + 393392) * 8), (int )pf->stat_offsets_loaded, & osd->rx_jabber, & nsd->rx_jabber); } } else { } pf->stat_offsets_loaded = 1; return; } } static struct i40e_mac_filter *i40e_find_filter(struct i40e_vsi *vsi , u8 *macaddr , s16 vlan , bool is_vf , bool is_netdev ) { struct i40e_mac_filter *f ; struct list_head const *__mptr ; bool tmp ; struct list_head const *__mptr___0 ; { if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0) || (unsigned long )macaddr == (unsigned long )((u8 *)0U)) { return ((struct i40e_mac_filter *)0); } else { } __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; goto ldv_57268; ldv_57267: { tmp = ether_addr_equal((u8 const *)macaddr, (u8 const *)(& f->macaddr)); } if ((((int )tmp && (int )vlan == (int )f->vlan) && (! is_vf || (int )f->is_vf)) && (! is_netdev || (int )f->is_netdev)) { return (f); } else { } __mptr___0 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___0; ldv_57268: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57267; } else { } return ((struct i40e_mac_filter *)0); } } struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi , u8 *macaddr , bool is_vf , bool is_netdev ) { struct i40e_mac_filter *f ; struct list_head const *__mptr ; bool tmp ; struct list_head const *__mptr___0 ; { if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0) || (unsigned long )macaddr == (unsigned long )((u8 *)0U)) { return ((struct i40e_mac_filter *)0); } else { } __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; goto ldv_57282; ldv_57281: { tmp = ether_addr_equal((u8 const *)macaddr, (u8 const *)(& f->macaddr)); } if (((int )tmp && (! is_vf || (int )f->is_vf)) && (! is_netdev || (int )f->is_netdev)) { return (f); } else { } __mptr___0 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___0; ldv_57282: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57281; } else { } return ((struct i40e_mac_filter *)0); } } bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi ) { struct i40e_mac_filter *f ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; goto ldv_57293; ldv_57292: ; if ((int )f->vlan >= 0) { return (1); } else { } __mptr___0 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___0; ldv_57293: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57292; } else { } return (0); } } struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi , u8 *macaddr , bool is_vf , bool is_netdev ) { struct i40e_mac_filter *f ; struct list_head const *__mptr ; struct i40e_mac_filter *tmp ; struct i40e_mac_filter *tmp___0 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct i40e_mac_filter *tmp___2 ; int tmp___3 ; { __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; goto ldv_57307; ldv_57306: { tmp___0 = i40e_find_filter(vsi, macaddr, (int )f->vlan, (int )is_vf, (int )is_netdev); } if ((unsigned long )tmp___0 == (unsigned long )((struct i40e_mac_filter *)0)) { { tmp = i40e_add_filter(vsi, macaddr, (int )f->vlan, (int )is_vf, (int )is_netdev); } if ((unsigned long )tmp == (unsigned long )((struct i40e_mac_filter *)0)) { return ((struct i40e_mac_filter *)0); } else { } } else { } __mptr___0 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___0; ldv_57307: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57306; } else { } { tmp___3 = list_empty((struct list_head const *)(& vsi->mac_filter_list)); } if (tmp___3 == 0) { __mptr___1 = (struct list_head const *)vsi->mac_filter_list.next; tmp___2 = (struct i40e_mac_filter *)__mptr___1; } else { tmp___2 = (struct i40e_mac_filter *)0; } return (tmp___2); } } struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi , u8 *macaddr , s16 vlan , bool is_vf , bool is_netdev ) { struct i40e_mac_filter *f ; void *tmp ; { if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0) || (unsigned long )macaddr == (unsigned long )((u8 *)0U)) { return ((struct i40e_mac_filter *)0); } else { } { f = i40e_find_filter(vsi, macaddr, (int )vlan, (int )is_vf, (int )is_netdev); } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { { tmp = kzalloc(32UL, 32U); f = (struct i40e_mac_filter *)tmp; } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { goto add_filter_out; } else { } { memcpy((void *)(& f->macaddr), (void const *)macaddr, 6UL); f->vlan = vlan; f->changed = 1; INIT_LIST_HEAD(& f->list); list_add(& f->list, & vsi->mac_filter_list); } } else { } if ((int )is_vf) { if (! f->is_vf) { f->is_vf = 1; f->counter = (u8 )((int )f->counter + 1); } else { } } else if ((int )is_netdev) { if (! f->is_netdev) { f->is_netdev = 1; f->counter = (u8 )((int )f->counter + 1); } else { } } else { f->counter = (u8 )((int )f->counter + 1); } if ((int )f->changed) { vsi->flags = vsi->flags | 1UL; (vsi->back)->flags = (vsi->back)->flags | 32768ULL; } else { } add_filter_out: ; return (f); } } void i40e_del_filter(struct i40e_vsi *vsi , u8 *macaddr , s16 vlan , bool is_vf , bool is_netdev ) { struct i40e_mac_filter *f ; int min_f ; { if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0) || (unsigned long )macaddr == (unsigned long )((u8 *)0U)) { return; } else { } { f = i40e_find_filter(vsi, macaddr, (int )vlan, (int )is_vf, (int )is_netdev); } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0) || (unsigned int )f->counter == 0U) { return; } else { } if ((int )is_vf) { if ((int )f->is_vf) { f->is_vf = 0; f->counter = (u8 )((int )f->counter - 1); } else { } } else if ((int )is_netdev) { if ((int )f->is_netdev) { f->is_netdev = 0; f->counter = (u8 )((int )f->counter - 1); } else { } } else { min_f = 0; min_f = min_f + (int )f->is_vf; min_f = min_f + (int )f->is_netdev; if ((int )f->counter > min_f) { f->counter = (u8 )((int )f->counter - 1); } else { } } if ((unsigned int )f->counter == 0U) { f->changed = 1; vsi->flags = vsi->flags | 1UL; (vsi->back)->flags = (vsi->back)->flags | 32768ULL; } else { } return; } } static int i40e_set_mac(struct net_device *netdev , void *p ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct sockaddr *addr ; struct i40e_mac_filter *f ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; i40e_status ret ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; addr = (struct sockaddr *)p; tmp___0 = is_valid_ether_addr((u8 const *)(& addr->sa_data)); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (-99); } else { } { netdev_info((struct net_device const *)netdev, "set mac address=%pM\n", (char *)(& addr->sa_data)); tmp___2 = ether_addr_equal((u8 const *)netdev->dev_addr, (u8 const *)(& addr->sa_data)); } if ((int )tmp___2) { return (0); } else { } { tmp___3 = constant_test_bit(3L, (unsigned long const volatile *)(& (vsi->back)->state)); } if (tmp___3 != 0) { return (-99); } else { { tmp___4 = constant_test_bit(9L, (unsigned long const volatile *)(& (vsi->back)->state)); } if (tmp___4 != 0) { return (-99); } else { } } if ((unsigned int )vsi->type == 0U) { { ret = i40e_aq_mac_address_write(& (vsi->back)->hw, 0, (u8 *)(& addr->sa_data), (struct i40e_asq_cmd_details *)0); } if ((int )ret != 0) { { netdev_info((struct net_device const *)netdev, "Addr change for Main VSI failed: %d\n", (int )ret); } return (-99); } else { } { memcpy((void *)(& (vsi->back)->hw.mac.addr), (void const *)(& addr->sa_data), (size_t )netdev->addr_len); } } else { } { f = i40e_add_filter(vsi, (u8 *)(& addr->sa_data), -1, 0, 0); } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { return (-12); } else { } { i40e_sync_vsi_filters(vsi); i40e_del_filter(vsi, netdev->dev_addr, -1, 0, 0); i40e_sync_vsi_filters(vsi); memcpy((void *)netdev->dev_addr, (void const *)(& addr->sa_data), (size_t )netdev->addr_len); } return (0); } } static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi , struct i40e_vsi_context *ctxt , u8 enabled_tc , bool is_add ) { struct i40e_pf *pf ; u16 sections ; u8 netdev_tc ; u16 numtc ; u16 qcount ; u8 offset ; u16 qmap ; int i ; u16 num_tc_qps ; unsigned long tmp___66 ; int __min1 ; int __min2 ; int pow ; int num_qps ; int __min1___0 ; int __min2___0 ; int __ret_warn_on ; long tmp___67 ; u8 tmp___68 ; { pf = vsi->back; sections = 0U; netdev_tc = 0U; numtc = 0U; num_tc_qps = 0U; sections = 64U; offset = 0U; if ((unsigned int )enabled_tc != 0U && ((vsi->back)->flags & 1048576ULL) != 0ULL) { i = 0; goto ldv_57354; ldv_57353: ; if (((int )enabled_tc >> i) & 1) { numtc = (u16 )((int )numtc + 1); } else { } i = i + 1; ldv_57354: ; if (i <= 7) { goto ldv_57353; } else { } if ((unsigned int )numtc == 0U) { { dev_warn((struct device const *)(& (pf->pdev)->dev), "DCB is enabled but no TC enabled, forcing TC0\n"); numtc = 1U; } } else { } } else { numtc = 1U; } { vsi->tc_config.numtc = (u8 )numtc; vsi->tc_config.enabled_tc = (unsigned int )enabled_tc != 0U ? enabled_tc : 1U; tmp___66 = __rounddown_pow_of_two((unsigned long )((int )vsi->alloc_queue_pairs / (int )numtc)); num_tc_qps = (u16 )tmp___66; __min1 = (int )num_tc_qps; __min2 = 64; num_tc_qps = (u16 )(__min1 < __min2 ? __min1 : __min2); i = 0; } goto ldv_57376; ldv_57375: ; if (((int )vsi->tc_config.enabled_tc >> i) & 1) { { if ((unsigned int )vsi->type == 0U) { goto case_0; } else { } if ((unsigned int )vsi->type == 7U) { goto case_7; } else { } if ((unsigned int )vsi->type == 6U) { goto case_6; } else { } if ((unsigned int )vsi->type == 2U) { goto case_2; } else { } goto switch_default; case_0: /* CIL Label */ __min1___0 = (int )pf->rss_size; __min2___0 = (int )num_tc_qps; qcount = (u16 )(__min1___0 < __min2___0 ? __min1___0 : __min2___0); goto ldv_57365; case_7: /* CIL Label */ ; case_6: /* CIL Label */ ; case_2: /* CIL Label */ ; switch_default: /* CIL Label */ { qcount = num_tc_qps; __ret_warn_on = i != 0; tmp___67 = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp___67 != 0L) { { warn_slowpath_null("drivers/net/ethernet/intel/i40e/i40e_main.c", 1317); } } else { } { ldv__builtin_expect(__ret_warn_on != 0, 0L); } goto ldv_57365; switch_break: /* CIL Label */ ; } ldv_57365: vsi->tc_config.tc_info[i].qoffset = (u16 )offset; vsi->tc_config.tc_info[i].qcount = qcount; num_qps = (int )qcount; pow = 0; goto ldv_57373; ldv_57372: pow = pow + 1; num_qps = num_qps >> 1; ldv_57373: ; if (num_qps != 0 && 1 << pow < (int )qcount) { goto ldv_57372; } else { } tmp___68 = netdev_tc; netdev_tc = (u8 )((int )netdev_tc + 1); vsi->tc_config.tc_info[i].netdev_tc = tmp___68; qmap = (u16 )((int )((short )offset) | (int )((short )(pow << 9))); offset = (int )offset + (int )((u8 )qcount); } else { vsi->tc_config.tc_info[i].qoffset = 0U; vsi->tc_config.tc_info[i].qcount = 1U; vsi->tc_config.tc_info[i].netdev_tc = 0U; qmap = 0U; } ctxt->info.tc_mapping[i] = qmap; i = i + 1; ldv_57376: ; if (i <= 7) { goto ldv_57375; } else { } vsi->num_queue_pairs = (u16 )offset; if ((int )is_add) { sections = (u16 )((unsigned int )sections | 512U); ctxt->info.up_enable_bits = enabled_tc; } else { } if ((unsigned int )vsi->type == 6U) { ctxt->info.mapping_flags = (__le16 )((unsigned int )ctxt->info.mapping_flags | 1U); i = 0; goto ldv_57379; ldv_57378: ctxt->info.queue_mapping[i] = (int )vsi->base_queue + (int )((unsigned short )i); i = i + 1; ldv_57379: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57378; } else { } } else { ctxt->info.mapping_flags = ctxt->info.mapping_flags; ctxt->info.queue_mapping[0] = vsi->base_queue; } ctxt->info.valid_sections = (__le16 )((int )ctxt->info.valid_sections | (int )sections); return; } } static void i40e_set_rx_mode(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_mac_filter *f ; struct i40e_mac_filter *ftmp ; struct i40e_vsi *vsi ; struct netdev_hw_addr *uca ; struct netdev_hw_addr *mca ; struct netdev_hw_addr *ha ; struct list_head const *__mptr ; bool tmp___0 ; struct i40e_mac_filter *tmp___1 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; bool tmp___2 ; struct i40e_mac_filter *tmp___3 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; struct list_head const *__mptr___4 ; bool found ; struct list_head const *__mptr___5 ; bool tmp___4 ; struct list_head const *__mptr___6 ; struct list_head const *__mptr___7 ; bool tmp___5 ; struct list_head const *__mptr___8 ; struct list_head *__ptr ; struct list_head const *__mptr___9 ; struct list_head *_________p1 ; bool __warned ; int tmp___6 ; bool tmp___7 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___10 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___8 ; bool tmp___9 ; struct list_head const *__mptr___11 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; __mptr = (struct list_head const *)netdev->uc.list.next; uca = (struct netdev_hw_addr *)__mptr; } goto ldv_57396; ldv_57395: { tmp___1 = i40e_find_mac(vsi, (u8 *)(& uca->addr), 0, 1); } if ((unsigned long )tmp___1 == (unsigned long )((struct i40e_mac_filter *)0)) { { tmp___0 = i40e_is_vsi_in_vlan(vsi); } if ((int )tmp___0) { { i40e_put_mac_in_vlan(vsi, (u8 *)(& uca->addr), 0, 1); } } else { { i40e_add_filter(vsi, (u8 *)(& uca->addr), -1, 0, 1); } } } else { } __mptr___0 = (struct list_head const *)uca->list.next; uca = (struct netdev_hw_addr *)__mptr___0; ldv_57396: ; if ((unsigned long )(& uca->list) != (unsigned long )(& netdev->uc.list)) { goto ldv_57395; } else { } __mptr___1 = (struct list_head const *)netdev->mc.list.next; mca = (struct netdev_hw_addr *)__mptr___1; goto ldv_57403; ldv_57402: { tmp___3 = i40e_find_mac(vsi, (u8 *)(& mca->addr), 0, 1); } if ((unsigned long )tmp___3 == (unsigned long )((struct i40e_mac_filter *)0)) { { tmp___2 = i40e_is_vsi_in_vlan(vsi); } if ((int )tmp___2) { { i40e_put_mac_in_vlan(vsi, (u8 *)(& mca->addr), 0, 1); } } else { { i40e_add_filter(vsi, (u8 *)(& mca->addr), -1, 0, 1); } } } else { } __mptr___2 = (struct list_head const *)mca->list.next; mca = (struct netdev_hw_addr *)__mptr___2; ldv_57403: ; if ((unsigned long )(& mca->list) != (unsigned long )(& netdev->mc.list)) { goto ldv_57402; } else { } __mptr___3 = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr___3; __mptr___4 = (struct list_head const *)f->list.next; ftmp = (struct i40e_mac_filter *)__mptr___4; goto ldv_57445; ldv_57444: found = 0; if (! f->is_netdev) { goto ldv_57412; } else { } { tmp___9 = is_multicast_ether_addr((u8 const *)(& f->macaddr)); } if ((int )tmp___9) { __mptr___5 = (struct list_head const *)netdev->mc.list.next; mca = (struct netdev_hw_addr *)__mptr___5; goto ldv_57419; ldv_57418: { tmp___4 = ether_addr_equal((u8 const *)(& mca->addr), (u8 const *)(& f->macaddr)); } if ((int )tmp___4) { found = 1; goto ldv_57417; } else { } __mptr___6 = (struct list_head const *)mca->list.next; mca = (struct netdev_hw_addr *)__mptr___6; ldv_57419: ; if ((unsigned long )(& mca->list) != (unsigned long )(& netdev->mc.list)) { goto ldv_57418; } else { } ldv_57417: ; } else { __mptr___7 = (struct list_head const *)netdev->uc.list.next; uca = (struct netdev_hw_addr *)__mptr___7; goto ldv_57426; ldv_57425: { tmp___5 = ether_addr_equal((u8 const *)(& uca->addr), (u8 const *)(& f->macaddr)); } if ((int )tmp___5) { found = 1; goto ldv_57424; } else { } __mptr___8 = (struct list_head const *)uca->list.next; uca = (struct netdev_hw_addr *)__mptr___8; ldv_57426: ; if ((unsigned long )(& uca->list) != (unsigned long )(& netdev->uc.list)) { goto ldv_57425; } else { } ldv_57424: { __ptr = netdev->dev_addrs.list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp___6 = debug_lockdep_rcu_enabled(); } if (tmp___6 != 0 && ! __warned) { { rcu_read_lock_held(); } } else { } __mptr___9 = (struct list_head const *)_________p1; ha = (struct netdev_hw_addr *)__mptr___9; goto ldv_57443; ldv_57442: { tmp___7 = ether_addr_equal((u8 const *)(& ha->addr), (u8 const *)(& f->macaddr)); } if ((int )tmp___7) { found = 1; goto ldv_57441; } else { } { __ptr___0 = ha->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___8 = debug_lockdep_rcu_enabled(); } if (tmp___8 != 0 && ! __warned___0) { { rcu_read_lock_held(); } } else { } __mptr___10 = (struct list_head const *)_________p1___0; ha = (struct netdev_hw_addr *)__mptr___10; ldv_57443: ; if ((unsigned long )(& ha->list) != (unsigned long )(& netdev->dev_addrs.list)) { goto ldv_57442; } else { } ldv_57441: ; } if (! found) { { i40e_del_filter(vsi, (u8 *)(& f->macaddr), -1, 0, 1); } } else { } ldv_57412: f = ftmp; __mptr___11 = (struct list_head const *)ftmp->list.next; ftmp = (struct i40e_mac_filter *)__mptr___11; ldv_57445: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57444; } else { } if (vsi->current_netdev_flags != (vsi->netdev)->flags) { vsi->flags = vsi->flags | 1UL; (vsi->back)->flags = (vsi->back)->flags | 32768ULL; } else { } return; } } int i40e_sync_vsi_filters(struct i40e_vsi *vsi ) { struct i40e_mac_filter *f ; struct i40e_mac_filter *ftmp ; bool promisc_forced_on ; bool add_happened ; int filter_list_len ; u32 changed_flags ; i40e_status aq_ret ; struct i40e_pf *pf ; int num_add ; int num_del ; u16 cmd_flags ; struct i40e_aqc_add_macvlan_element_data *add_list ; struct i40e_aqc_remove_macvlan_element_data *del_list ; int tmp ; void *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; void *tmp___1 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; struct list_head const *__mptr___4 ; int tmp___2 ; bool cur_multipromisc ; bool cur_promisc ; int tmp___3 ; int tmp___4 ; { promisc_forced_on = 0; add_happened = 0; filter_list_len = 0; changed_flags = 0U; aq_ret = 0; num_add = 0; num_del = 0; goto ldv_57464; ldv_57463: { usleep_range(1000UL, 2000UL); } ldv_57464: { tmp = test_and_set_bit(1L, (unsigned long volatile *)(& vsi->state)); } if (tmp != 0) { goto ldv_57463; } else { } pf = vsi->back; if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { changed_flags = vsi->current_netdev_flags ^ (vsi->netdev)->flags; vsi->current_netdev_flags = (vsi->netdev)->flags; } else { } if ((int )vsi->flags & 1) { { vsi->flags = vsi->flags & 0xfffffffffffffffeUL; filter_list_len = (int )((unsigned int )pf->hw.aq.asq_buf_size / 16U); tmp___0 = kcalloc((size_t )filter_list_len, 16UL, 208U); del_list = (struct i40e_aqc_remove_macvlan_element_data *)tmp___0; } if ((unsigned long )del_list == (unsigned long )((struct i40e_aqc_remove_macvlan_element_data *)0)) { return (-12); } else { } __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; __mptr___0 = (struct list_head const *)f->list.next; ftmp = (struct i40e_mac_filter *)__mptr___0; goto ldv_57474; ldv_57473: ; if (! f->changed) { goto ldv_57472; } else { } if ((unsigned int )f->counter != 0U) { goto ldv_57472; } else { } { f->changed = 0; cmd_flags = 0U; memcpy((void *)(& (del_list + (unsigned long )num_del)->mac_addr), (void const *)(& f->macaddr), 6UL); (del_list + (unsigned long )num_del)->vlan_tag = (int )f->vlan != -1 ? (unsigned short )f->vlan : 0U; cmd_flags = (u16 )((unsigned int )cmd_flags | 1U); (del_list + (unsigned long )num_del)->flags = (u8 )cmd_flags; num_del = num_del + 1; list_del(& f->list); kfree((void const *)f); } if (num_del == filter_list_len) { { aq_ret = i40e_aq_remove_macvlan(& pf->hw, (int )vsi->seid, del_list, (int )((u16 )num_del), (struct i40e_asq_cmd_details *)0); num_del = 0; memset((void *)del_list, 0, 16UL); } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "ignoring delete macvlan error, err %d, aq_err %d while flushing a full buffer\n", (int )aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } } else { } } else { } ldv_57472: f = ftmp; __mptr___1 = (struct list_head const *)ftmp->list.next; ftmp = (struct i40e_mac_filter *)__mptr___1; ldv_57474: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57473; } else { } if (num_del != 0) { { aq_ret = i40e_aq_remove_macvlan(& pf->hw, (int )vsi->seid, del_list, (int )((u16 )num_del), (struct i40e_asq_cmd_details *)0); num_del = 0; } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "ignoring delete macvlan error, err %d, aq_err %d\n", (int )aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } } else { } } else { } { kfree((void const *)del_list); del_list = (struct i40e_aqc_remove_macvlan_element_data *)0; filter_list_len = (int )((unsigned int )pf->hw.aq.asq_buf_size / 16U); tmp___1 = kcalloc((size_t )filter_list_len, 16UL, 208U); add_list = (struct i40e_aqc_add_macvlan_element_data *)tmp___1; } if ((unsigned long )add_list == (unsigned long )((struct i40e_aqc_add_macvlan_element_data *)0)) { return (-12); } else { } __mptr___2 = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr___2; __mptr___3 = (struct list_head const *)f->list.next; ftmp = (struct i40e_mac_filter *)__mptr___3; goto ldv_57485; ldv_57484: ; if (! f->changed) { goto ldv_57482; } else { } if ((unsigned int )f->counter == 0U) { goto ldv_57482; } else { } { f->changed = 0; add_happened = 1; cmd_flags = 0U; memcpy((void *)(& (add_list + (unsigned long )num_add)->mac_addr), (void const *)(& f->macaddr), 6UL); (add_list + (unsigned long )num_add)->vlan_tag = (int )f->vlan != -1 ? (unsigned short )f->vlan : 0U; (add_list + (unsigned long )num_add)->queue_number = 0U; cmd_flags = (u16 )((unsigned int )cmd_flags | 1U); (add_list + (unsigned long )num_add)->flags = cmd_flags; num_add = num_add + 1; } if (num_add == filter_list_len) { { aq_ret = i40e_aq_add_macvlan(& pf->hw, (int )vsi->seid, add_list, (int )((u16 )num_add), (struct i40e_asq_cmd_details *)0); num_add = 0; } if ((int )aq_ret != 0) { goto ldv_57483; } else { } { memset((void *)add_list, 0, 16UL); } } else { } ldv_57482: f = ftmp; __mptr___4 = (struct list_head const *)ftmp->list.next; ftmp = (struct i40e_mac_filter *)__mptr___4; ldv_57485: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57484; } else { } ldv_57483: ; if (num_add != 0) { { aq_ret = i40e_aq_add_macvlan(& pf->hw, (int )vsi->seid, add_list, (int )((u16 )num_add), (struct i40e_asq_cmd_details *)0); num_add = 0; } } else { } { kfree((void const *)add_list); add_list = (struct i40e_aqc_add_macvlan_element_data *)0; } if ((int )add_happened && (int )aq_ret == 0) { } else if ((int )add_happened && (int )aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add filter failed, err %d, aq_err %d\n", (int )aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } if ((unsigned int )pf->hw.aq.asq_last_status == 16U) { { tmp___2 = constant_test_bit(16L, (unsigned long const volatile *)(& vsi->state)); } if (tmp___2 == 0) { { promisc_forced_on = 1; set_bit(16L, (unsigned long volatile *)(& vsi->state)); _dev_info((struct device const *)(& (pf->pdev)->dev), "promiscuous mode forced on\n"); } } else { } } else { } } else { } } else { } if ((changed_flags & 512U) != 0U) { { cur_multipromisc = (vsi->current_netdev_flags & 512U) != 0U; aq_ret = i40e_aq_set_vsi_multicast_promiscuous(& (vsi->back)->hw, (int )vsi->seid, (int )cur_multipromisc, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "set multi promisc failed, err %d, aq_err %d\n", (int )aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } } else { } } else { } if ((changed_flags & 256U) != 0U || (int )promisc_forced_on) { if ((vsi->current_netdev_flags & 256U) != 0U) { tmp___4 = 1; } else { { tmp___3 = constant_test_bit(16L, (unsigned long const volatile *)(& vsi->state)); } if (tmp___3 != 0) { tmp___4 = 1; } else { tmp___4 = 0; } } { cur_promisc = (bool )tmp___4; aq_ret = i40e_aq_set_vsi_unicast_promiscuous(& (vsi->back)->hw, (int )vsi->seid, (int )cur_promisc, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "set uni promisc failed, err %d, aq_err %d\n", (int )aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } } else { } { aq_ret = i40e_aq_set_vsi_broadcast(& (vsi->back)->hw, (int )vsi->seid, (int )cur_promisc, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "set brdcast promisc failed, err %d, aq_err %d\n", (int )aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } } else { } } else { } { clear_bit(1L, (unsigned long volatile *)(& vsi->state)); } return (0); } } static void i40e_sync_filters_subtask(struct i40e_pf *pf ) { int v ; { if ((unsigned long )pf == (unsigned long )((struct i40e_pf *)0) || (pf->flags & 32768ULL) == 0ULL) { return; } else { } pf->flags = pf->flags & 0xffffffffffff7fffULL; v = 0; goto ldv_57493; ldv_57492: ; if ((unsigned long )*(pf->vsi + (unsigned long )v) != (unsigned long )((struct i40e_vsi *)0) && (int )(*(pf->vsi + (unsigned long )v))->flags & 1) { { i40e_sync_vsi_filters(*(pf->vsi + (unsigned long )v)); } } else { } v = v + 1; ldv_57493: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_57492; } else { } return; } } static int i40e_change_mtu(struct net_device *netdev , int new_mtu ) { struct i40e_netdev_priv *np ; void *tmp ; int max_frame ; struct i40e_vsi *vsi ; bool tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; max_frame = new_mtu + 18; vsi = np->vsi; } if (new_mtu <= 67 || max_frame > 9728) { return (-22); } else { } { netdev_info((struct net_device const *)netdev, "changing MTU from %d to %d\n", netdev->mtu, new_mtu); netdev->mtu = (unsigned int )new_mtu; tmp___0 = netif_running((struct net_device const *)netdev); } if ((int )tmp___0) { { i40e_vsi_reinit_locked(vsi); } } else { } return (0); } } int i40e_ioctl(struct net_device *netdev , struct ifreq *ifr , int cmd ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; int tmp___0 ; int tmp___1 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; } { if (cmd == 35249) { goto case_35249; } else { } if (cmd == 35248) { goto case_35248; } else { } goto switch_default; case_35249: /* CIL Label */ { tmp___0 = i40e_ptp_get_ts_config(pf, ifr); } return (tmp___0); case_35248: /* CIL Label */ { tmp___1 = i40e_ptp_set_ts_config(pf, ifr); } return (tmp___1); switch_default: /* CIL Label */ ; return (-95); switch_break: /* CIL Label */ ; } } } void i40e_vlan_stripping_enable(struct i40e_vsi *vsi ) { struct i40e_vsi_context ctxt ; i40e_status ret ; { if (((int )vsi->info.valid_sections & 4) != 0 && ((int )vsi->info.port_vlan_flags & 3) == 0) { return; } else { } { vsi->info.valid_sections = 4U; vsi->info.port_vlan_flags = 3U; ctxt.seid = vsi->seid; memcpy((void *)(& ctxt.info), (void const *)(& vsi->info), 128UL); ret = i40e_aq_update_vsi_params(& (vsi->back)->hw, & ctxt, (struct i40e_asq_cmd_details *)0); } if ((int )ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "%s: update vsi failed, aq_err=%d\n", "i40e_vlan_stripping_enable", (unsigned int )(vsi->back)->hw.aq.asq_last_status); } } else { } return; } } void i40e_vlan_stripping_disable(struct i40e_vsi *vsi ) { struct i40e_vsi_context ctxt ; i40e_status ret ; { if (((int )vsi->info.valid_sections & 4) != 0 && ((int )vsi->info.port_vlan_flags & 24) == 24) { return; } else { } { vsi->info.valid_sections = 4U; vsi->info.port_vlan_flags = 27U; ctxt.seid = vsi->seid; memcpy((void *)(& ctxt.info), (void const *)(& vsi->info), 128UL); ret = i40e_aq_update_vsi_params(& (vsi->back)->hw, & ctxt, (struct i40e_asq_cmd_details *)0); } if ((int )ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "%s: update vsi failed, aq_err=%d\n", "i40e_vlan_stripping_disable", (unsigned int )(vsi->back)->hw.aq.asq_last_status); } } else { } return; } } static void i40e_vlan_rx_register(struct net_device *netdev , u32 features ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; } if (((unsigned long long )features & 256ULL) != 0ULL) { { i40e_vlan_stripping_enable(vsi); } } else { { i40e_vlan_stripping_disable(vsi); } } return; } } int i40e_vsi_add_vlan(struct i40e_vsi *vsi , s16 vid ) { struct i40e_mac_filter *f ; struct i40e_mac_filter *add_f ; bool is_netdev ; bool is_vf ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct i40e_mac_filter *tmp ; struct list_head const *__mptr___1 ; struct i40e_mac_filter *tmp___0 ; struct list_head const *__mptr___2 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { is_vf = (unsigned int )vsi->type == 6U; is_netdev = (unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0); if ((int )is_netdev) { { add_f = i40e_add_filter(vsi, (vsi->netdev)->dev_addr, (int )vid, (int )is_vf, (int )is_netdev); } if ((unsigned long )add_f == (unsigned long )((struct i40e_mac_filter *)0)) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Could not add vlan filter %d for %pM\n", (int )vid, (vsi->netdev)->dev_addr); } return (-12); } else { } } else { } __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; goto ldv_57543; ldv_57542: { add_f = i40e_add_filter(vsi, (u8 *)(& f->macaddr), (int )vid, (int )is_vf, (int )is_netdev); } if ((unsigned long )add_f == (unsigned long )((struct i40e_mac_filter *)0)) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Could not add vlan filter %d for %pM\n", (int )vid, (u8 *)(& f->macaddr)); } return (-12); } else { } __mptr___0 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___0; ldv_57543: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57542; } else { } if ((int )vid > 0) { if ((int )is_netdev) { { tmp = i40e_find_filter(vsi, (vsi->netdev)->dev_addr, -1, (int )is_vf, (int )is_netdev); } if ((unsigned long )tmp != (unsigned long )((struct i40e_mac_filter *)0)) { { i40e_del_filter(vsi, (vsi->netdev)->dev_addr, -1, (int )is_vf, (int )is_netdev); add_f = i40e_add_filter(vsi, (vsi->netdev)->dev_addr, 0, (int )is_vf, (int )is_netdev); } if ((unsigned long )add_f == (unsigned long )((struct i40e_mac_filter *)0)) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Could not add filter 0 for %pM\n", (vsi->netdev)->dev_addr); } return (-12); } else { } } else { } } else { } } else { } if ((int )vid > 0 && (unsigned int )vsi->info.pvid == 0U) { __mptr___1 = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr___1; goto ldv_57550; ldv_57549: { tmp___0 = i40e_find_filter(vsi, (u8 *)(& f->macaddr), -1, (int )is_vf, (int )is_netdev); } if ((unsigned long )tmp___0 != (unsigned long )((struct i40e_mac_filter *)0)) { { i40e_del_filter(vsi, (u8 *)(& f->macaddr), -1, (int )is_vf, (int )is_netdev); add_f = i40e_add_filter(vsi, (u8 *)(& f->macaddr), 0, (int )is_vf, (int )is_netdev); } if ((unsigned long )add_f == (unsigned long )((struct i40e_mac_filter *)0)) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Could not add filter 0 for %pM\n", (u8 *)(& f->macaddr)); } return (-12); } else { } } else { } __mptr___2 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___2; ldv_57550: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57549; } else { } } else { } { tmp___1 = constant_test_bit(3L, (unsigned long const volatile *)(& (vsi->back)->state)); } if (tmp___1 != 0) { return (0); } else { { tmp___2 = constant_test_bit(9L, (unsigned long const volatile *)(& (vsi->back)->state)); } if (tmp___2 != 0) { return (0); } else { } } { tmp___3 = i40e_sync_vsi_filters(vsi); } return (tmp___3); } } int i40e_vsi_kill_vlan(struct i40e_vsi *vsi , s16 vid ) { struct net_device *netdev ; struct i40e_mac_filter *f ; struct i40e_mac_filter *add_f ; bool is_vf ; bool is_netdev ; int filter_count ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; bool tmp ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; struct list_head const *__mptr___4 ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { netdev = vsi->netdev; filter_count = 0; is_vf = (unsigned int )vsi->type == 6U; is_netdev = (unsigned long )netdev != (unsigned long )((struct net_device *)0); if ((int )is_netdev) { { i40e_del_filter(vsi, netdev->dev_addr, (int )vid, (int )is_vf, (int )is_netdev); } } else { } __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; goto ldv_57567; ldv_57566: { i40e_del_filter(vsi, (u8 *)(& f->macaddr), (int )vid, (int )is_vf, (int )is_netdev); __mptr___0 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___0; } ldv_57567: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57566; } else { } __mptr___1 = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr___1; goto ldv_57574; ldv_57573: ; if ((int )is_netdev) { if ((int )f->vlan != 0) { { tmp = ether_addr_equal((u8 const *)netdev->dev_addr, (u8 const *)(& f->macaddr)); } if ((int )tmp) { filter_count = filter_count + 1; } else { } } else { } } else { } if ((int )f->vlan != 0) { filter_count = filter_count + 1; } else { } __mptr___2 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___2; ldv_57574: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57573; } else { } if (filter_count == 0 && (int )is_netdev) { { i40e_del_filter(vsi, netdev->dev_addr, 0, (int )is_vf, (int )is_netdev); f = i40e_add_filter(vsi, netdev->dev_addr, -1, (int )is_vf, (int )is_netdev); } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Could not add filter %d for %pM\n", -1, netdev->dev_addr); } return (-12); } else { } } else { } if (filter_count == 0) { __mptr___3 = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr___3; goto ldv_57581; ldv_57580: { i40e_del_filter(vsi, (u8 *)(& f->macaddr), 0, (int )is_vf, (int )is_netdev); add_f = i40e_add_filter(vsi, (u8 *)(& f->macaddr), -1, (int )is_vf, (int )is_netdev); } if ((unsigned long )add_f == (unsigned long )((struct i40e_mac_filter *)0)) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Could not add filter %d for %pM\n", -1, (u8 *)(& f->macaddr)); } return (-12); } else { } __mptr___4 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___4; ldv_57581: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_57580; } else { } } else { } { tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)(& (vsi->back)->state)); } if (tmp___0 != 0) { return (0); } else { { tmp___1 = constant_test_bit(9L, (unsigned long const volatile *)(& (vsi->back)->state)); } if (tmp___1 != 0) { return (0); } else { } } { tmp___2 = i40e_sync_vsi_filters(vsi); } return (tmp___2); } } static int i40e_vlan_rx_add_vid(struct net_device *netdev , __be16 proto , u16 vid ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; int ret ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; ret = 0; } if ((unsigned int )vid > 4095U) { return (-22); } else { } { netdev_info((struct net_device const *)netdev, "adding %pM vid=%d\n", netdev->dev_addr, (int )vid); ret = i40e_vsi_add_vlan(vsi, (unsigned int )vid != 0U ? (int )((s16 )vid) : -1); } if (ret == 0 && (unsigned int )vid <= 4095U) { { set_bit((long )vid, (unsigned long volatile *)(& vsi->active_vlans)); } } else { } return (ret); } } static int i40e_vlan_rx_kill_vid(struct net_device *netdev , __be16 proto , u16 vid ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; netdev_info((struct net_device const *)netdev, "removing %pM vid=%d\n", netdev->dev_addr, (int )vid); i40e_vsi_kill_vlan(vsi, (int )((s16 )vid)); clear_bit((long )vid, (unsigned long volatile *)(& vsi->active_vlans)); } return (0); } } static void i40e_restore_vlan(struct i40e_vsi *vsi ) { u16 vid ; unsigned long tmp ; unsigned long tmp___0 ; { if ((unsigned long )vsi->netdev == (unsigned long )((struct net_device *)0)) { return; } else { } { i40e_vlan_rx_register(vsi->netdev, (u32 )(vsi->netdev)->features); tmp = find_first_bit((unsigned long const *)(& vsi->active_vlans), 4096UL); vid = (u16 )tmp; } goto ldv_57603; ldv_57602: { i40e_vlan_rx_add_vid(vsi->netdev, 129, (int )vid); tmp___0 = find_next_bit((unsigned long const *)(& vsi->active_vlans), 4096UL, (unsigned long )((int )vid + 1)); vid = (u16 )tmp___0; } ldv_57603: ; if ((unsigned int )vid <= 4095U) { goto ldv_57602; } else { } return; } } i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi , u16 vid ) { struct i40e_vsi_context ctxt ; i40e_status aq_ret ; { { vsi->info.valid_sections = 4U; vsi->info.pvid = vid; vsi->info.port_vlan_flags = 21U; ctxt.seid = vsi->seid; memcpy((void *)(& ctxt.info), (void const *)(& vsi->info), 128UL); aq_ret = i40e_aq_update_vsi_params(& (vsi->back)->hw, & ctxt, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "%s: update vsi failed, aq_err=%d\n", "i40e_vsi_add_pvid", (unsigned int )(vsi->back)->hw.aq.asq_last_status); } return (-2); } else { } return (0); } } void i40e_vsi_remove_pvid(struct i40e_vsi *vsi ) { { { i40e_vlan_stripping_disable(vsi); vsi->info.pvid = 0U; } return; } } static int i40e_vsi_setup_tx_resources(struct i40e_vsi *vsi ) { int i ; int err ; { err = 0; i = 0; goto ldv_57621; ldv_57620: { err = i40e_setup_tx_descriptors(*(vsi->tx_rings + (unsigned long )i)); i = i + 1; } ldv_57621: ; if (i < (int )vsi->num_queue_pairs && err == 0) { goto ldv_57620; } else { } return (err); } } static void i40e_vsi_free_tx_resources(struct i40e_vsi *vsi ) { int i ; { if ((unsigned long )vsi->tx_rings == (unsigned long )((struct i40e_ring **)0)) { return; } else { } i = 0; goto ldv_57628; ldv_57627: ; if ((unsigned long )*(vsi->tx_rings + (unsigned long )i) != (unsigned long )((struct i40e_ring *)0) && (unsigned long )(*(vsi->tx_rings + (unsigned long )i))->desc != (unsigned long )((void *)0)) { { i40e_free_tx_resources(*(vsi->tx_rings + (unsigned long )i)); } } else { } i = i + 1; ldv_57628: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57627; } else { } return; } } static int i40e_vsi_setup_rx_resources(struct i40e_vsi *vsi ) { int i ; int err ; { err = 0; i = 0; goto ldv_57636; ldv_57635: { err = i40e_setup_rx_descriptors(*(vsi->rx_rings + (unsigned long )i)); i = i + 1; } ldv_57636: ; if (i < (int )vsi->num_queue_pairs && err == 0) { goto ldv_57635; } else { } return (err); } } static void i40e_vsi_free_rx_resources(struct i40e_vsi *vsi ) { int i ; { if ((unsigned long )vsi->rx_rings == (unsigned long )((struct i40e_ring **)0)) { return; } else { } i = 0; goto ldv_57643; ldv_57642: ; if ((unsigned long )*(vsi->rx_rings + (unsigned long )i) != (unsigned long )((struct i40e_ring *)0) && (unsigned long )(*(vsi->rx_rings + (unsigned long )i))->desc != (unsigned long )((void *)0)) { { i40e_free_rx_resources(*(vsi->rx_rings + (unsigned long )i)); } } else { } i = i + 1; ldv_57643: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57642; } else { } return; } } static int i40e_configure_tx_ring(struct i40e_ring *ring ) { struct i40e_vsi *vsi ; u16 pf_q ; struct i40e_hw *hw ; struct i40e_hmc_obj_txq tx_ctx ; i40e_status err ; u32 qtx_ctl ; int tmp ; { vsi = ring->vsi; pf_q = (int )vsi->base_queue + (int )ring->queue_index; hw = & (vsi->back)->hw; err = 0; qtx_ctl = 0U; if (((vsi->back)->flags & 4194304ULL) != 0ULL) { ring->atr_sample_rate = (vsi->back)->atr_sample_rate; ring->atr_count = 0U; } else { ring->atr_sample_rate = 0U; } if (((unsigned long )ring->q_vector != (unsigned long )((struct i40e_q_vector *)0) && (unsigned long )ring->netdev != (unsigned long )((struct net_device *)0)) && (unsigned int )vsi->tc_config.numtc <= 1U) { { tmp = test_and_set_bit(1L, (unsigned long volatile *)(& ring->state)); } if (tmp == 0) { { netif_set_xps_queue(ring->netdev, (struct cpumask const *)(& (ring->q_vector)->affinity_mask), (int )ring->queue_index); } } else { } } else { } { memset((void *)(& tx_ctx), 0, 48UL); tx_ctx.new_context = 1U; tx_ctx.base = ring->dma / 128ULL; tx_ctx.qlen = ring->count; tx_ctx.fd_ena = ((vsi->back)->flags & 6291456ULL) != 0ULL; tx_ctx.timesync_ena = ((vsi->back)->flags & 33554432ULL) != 0ULL; tx_ctx.rdylist = vsi->info.qs_handle[(int )ring->dcb_tc]; tx_ctx.rdylist_act = 0U; err = i40e_clear_lan_tx_queue_context(hw, (int )pf_q); } if ((int )err != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Failed to clear LAN Tx queue context on Tx ring %d (pf_q %d), error: %d\n", (int )ring->queue_index, (int )pf_q, (int )err); } return (-12); } else { } { err = i40e_set_lan_tx_queue_context(hw, (int )pf_q, & tx_ctx); } if ((int )err != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Failed to set LAN Tx queue context on Tx ring %d (pf_q %d, error: %d\n", (int )ring->queue_index, (int )pf_q, (int )err); } return (-12); } else { } if ((unsigned int )vsi->type == 2U) { qtx_ctl = 1U; } else { qtx_ctl = 2U; } { qtx_ctl = qtx_ctl | ((u32 )((int )hw->pf_id << 2) & 60U); writel(qtx_ctl, (void volatile *)hw->hw_addr + (unsigned long )(((int )pf_q + 266240) * 4)); readl((void const volatile *)hw->hw_addr + 745772U); clear_bit(3L, (unsigned long volatile *)(& ring->state)); ring->tail = hw->hw_addr + (unsigned long )(((int )pf_q + 270336) * 4); } return (0); } } static int i40e_configure_rx_ring(struct i40e_ring *ring ) { struct i40e_vsi *vsi ; u32 chain_len ; u16 pf_q ; struct i40e_hw *hw ; struct i40e_hmc_obj_rxq rx_ctx ; i40e_status err ; u16 __min1 ; u16 __min2 ; { { vsi = ring->vsi; chain_len = (u32 )(vsi->back)->hw.func_caps.rx_buf_chain_len; pf_q = (int )vsi->base_queue + (int )ring->queue_index; hw = & (vsi->back)->hw; err = 0; ring->state = 0UL; memset((void *)(& rx_ctx), 0, 40UL); ring->rx_buf_len = vsi->rx_buf_len; ring->rx_hdr_len = vsi->rx_hdr_len; rx_ctx.dbuff = (u8 )((int )ring->rx_buf_len >> 7); rx_ctx.hbuff = (u8 )((int )ring->rx_hdr_len >> 6); rx_ctx.base = ring->dma / 128ULL; rx_ctx.qlen = ring->count; } if (((vsi->back)->flags & 8192ULL) != 0ULL) { { set_bit(6L, (unsigned long volatile *)(& ring->state)); rx_ctx.dsize = 0U; } } else { rx_ctx.dsize = 1U; } rx_ctx.dtype = vsi->dtype; if ((unsigned int )vsi->dtype != 0U) { { set_bit(4L, (unsigned long volatile *)(& ring->state)); rx_ctx.hsplit_0 = 15U; } } else { rx_ctx.hsplit_0 = 0U; } __min1 = vsi->max_frame; __min2 = (int )((u16 )chain_len) * (int )ring->rx_buf_len; rx_ctx.rxmax = (u16 )((int )__min1 < (int )__min2 ? __min1 : __min2); rx_ctx.tphrdesc_ena = 1U; rx_ctx.tphwdesc_ena = 1U; rx_ctx.tphdata_ena = 1U; rx_ctx.tphhead_ena = 1U; if ((unsigned int )hw->revision_id == 0U) { rx_ctx.lrxqthresh = 0U; } else { rx_ctx.lrxqthresh = 2U; } { rx_ctx.crcstrip = 1U; rx_ctx.l2tsel = 1U; rx_ctx.showiv = 1U; err = i40e_clear_lan_rx_queue_context(hw, (int )pf_q); } if ((int )err != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Failed to clear LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n", (int )ring->queue_index, (int )pf_q, (int )err); } return (-12); } else { } { err = i40e_set_lan_rx_queue_context(hw, (int )pf_q, & rx_ctx); } if ((int )err != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Failed to set LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n", (int )ring->queue_index, (int )pf_q, (int )err); } return (-12); } else { } { ring->tail = hw->hw_addr + (unsigned long )(((int )pf_q + 303104) * 4); writel(0U, (void volatile *)ring->tail); i40e_alloc_rx_buffers(ring, (int )(((((int )ring->next_to_clean <= (int )ring->next_to_use ? ring->count : 0U) + (unsigned int )ring->next_to_clean) - (unsigned int )ring->next_to_use) + 65535U)); } return (0); } } static int i40e_vsi_configure_tx(struct i40e_vsi *vsi ) { int err ; u16 i ; { err = 0; i = 0U; goto ldv_57672; ldv_57671: { err = i40e_configure_tx_ring(*(vsi->tx_rings + (unsigned long )i)); i = (u16 )((int )i + 1); } ldv_57672: ; if ((int )i < (int )vsi->num_queue_pairs && err == 0) { goto ldv_57671; } else { } return (err); } } static int i40e_vsi_configure_rx(struct i40e_vsi *vsi ) { int err ; u16 i ; { err = 0; if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0) && (vsi->netdev)->mtu > 1500U) { vsi->max_frame = (unsigned int )((u16 )(vsi->netdev)->mtu) + 22U; } else { vsi->max_frame = 2048U; } { if (((vsi->back)->flags & 48ULL) == 16ULL) { goto case_16; } else { } if (((vsi->back)->flags & 48ULL) == 32ULL) { goto case_32; } else { } goto switch_default; case_16: /* CIL Label */ vsi->rx_hdr_len = 0U; vsi->rx_buf_len = vsi->max_frame; vsi->dtype = 0U; goto ldv_57680; case_32: /* CIL Label */ vsi->rx_hdr_len = 512U; vsi->rx_buf_len = 2048U; vsi->dtype = 2U; goto ldv_57680; switch_default: /* CIL Label */ vsi->rx_hdr_len = 512U; vsi->rx_buf_len = 2048U; vsi->dtype = 1U; goto ldv_57680; switch_break: /* CIL Label */ ; } ldv_57680: vsi->rx_hdr_len = (unsigned int )((u16 )((unsigned int )vsi->rx_hdr_len + 63U)) & 65472U; vsi->rx_buf_len = (unsigned int )((u16 )((unsigned int )vsi->rx_buf_len + 127U)) & 65408U; i = 0U; goto ldv_57684; ldv_57683: { err = i40e_configure_rx_ring(*(vsi->rx_rings + (unsigned long )i)); i = (u16 )((int )i + 1); } ldv_57684: ; if ((int )i < (int )vsi->num_queue_pairs && err == 0) { goto ldv_57683; } else { } return (err); } } static void i40e_vsi_config_dcb_rings(struct i40e_vsi *vsi ) { u16 qoffset ; u16 qcount ; int i ; int n ; struct i40e_ring *rx_ring ; struct i40e_ring *tx_ring ; { if (((vsi->back)->flags & 1048576ULL) == 0ULL) { return; } else { } n = 0; goto ldv_57700; ldv_57699: ; if ((((int )vsi->tc_config.enabled_tc >> n) & 1) == 0) { goto ldv_57693; } else { } qoffset = vsi->tc_config.tc_info[n].qoffset; qcount = vsi->tc_config.tc_info[n].qcount; i = (int )qoffset; goto ldv_57697; ldv_57696: rx_ring = *(vsi->rx_rings + (unsigned long )i); tx_ring = *(vsi->tx_rings + (unsigned long )i); rx_ring->dcb_tc = (u8 )n; tx_ring->dcb_tc = (u8 )n; i = i + 1; ldv_57697: ; if (i < (int )qoffset + (int )qcount) { goto ldv_57696; } else { } ldv_57693: n = n + 1; ldv_57700: ; if (n <= 7) { goto ldv_57699; } else { } return; } } static void i40e_set_vsi_rx_mode(struct i40e_vsi *vsi ) { { if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { i40e_set_rx_mode(vsi->netdev); } } else { } return; } } static int i40e_vsi_configure(struct i40e_vsi *vsi ) { int err ; { { i40e_set_vsi_rx_mode(vsi); i40e_restore_vlan(vsi); i40e_vsi_config_dcb_rings(vsi); err = i40e_vsi_configure_tx(vsi); } if (err == 0) { { err = i40e_vsi_configure_rx(vsi); } } else { } return (err); } } static void i40e_vsi_configure_msix(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; struct i40e_q_vector *q_vector ; struct i40e_hw *hw ; u16 vector ; int i ; int q ; u32 val ; u32 qp ; { pf = vsi->back; hw = & pf->hw; qp = (u32 )vsi->base_queue; vector = (u16 )vsi->base_vector; i = 0; goto ldv_57724; ldv_57723: { q_vector = *(vsi->q_vectors + (unsigned long )i); q_vector->rx.itr = (u16 )(((int )vsi->rx_itr_setting & -32769) >> 1); q_vector->rx.latency_range = 1; writel((unsigned int )q_vector->rx.itr, (void volatile *)hw->hw_addr + (unsigned long )(((int )vector + 49151) * 4)); q_vector->tx.itr = (u16 )(((int )vsi->tx_itr_setting & -32769) >> 1); q_vector->tx.latency_range = 1; writel((unsigned int )q_vector->tx.itr, (void volatile *)hw->hw_addr + (unsigned long )(((int )vector + 49663) * 4)); writel(qp, (void volatile *)hw->hw_addr + (unsigned long )(((int )vector + 54271) * 4)); q = 0; } goto ldv_57721; ldv_57720: { val = ((u32 )vector | (qp << 16)) | 1207959552U; writel(val, (void volatile *)hw->hw_addr + (unsigned long )((qp + 59392U) * 4U)); val = ((u32 )vector | ((qp + 1U) << 16)) | 1073743872U; } if (q == (int )q_vector->num_ringpairs + -1) { val = val | 134152192U; } else { } { writel(val, (void volatile *)hw->hw_addr + (unsigned long )((qp + 61440U) * 4U)); qp = qp + 1U; q = q + 1; } ldv_57721: ; if (q < (int )q_vector->num_ringpairs) { goto ldv_57720; } else { } i = i + 1; vector = (u16 )((int )vector + 1); ldv_57724: ; if (i < vsi->num_q_vectors) { goto ldv_57723; } else { } { readl((void const volatile *)hw->hw_addr + 745772U); } return; } } static void i40e_enable_misc_int_causes(struct i40e_hw *hw ) { u32 val ; { { writel(0U, (void volatile *)hw->hw_addr + 231424U); readl((void const volatile *)hw->hw_addr + 231296U); val = 1710817280U; writel(val, (void volatile *)hw->hw_addr + 231424U); writel(2248146944U, (void volatile *)hw->hw_addr + 230528U); writel(0U, (void volatile *)hw->hw_addr + 230400U); } return; } } static void i40e_configure_msi_and_legacy(struct i40e_vsi *vsi ) { struct i40e_q_vector *q_vector ; struct i40e_pf *pf ; struct i40e_hw *hw ; u32 val ; { { q_vector = *(vsi->q_vectors); pf = vsi->back; hw = & pf->hw; q_vector->rx.itr = (u16 )(((int )vsi->rx_itr_setting & -32769) >> 1); q_vector->rx.latency_range = 1; writel((unsigned int )q_vector->rx.itr, (void volatile *)hw->hw_addr + 229376U); q_vector->tx.itr = (u16 )(((int )vsi->tx_itr_setting & -32769) >> 1); q_vector->tx.latency_range = 1; writel((unsigned int )q_vector->tx.itr, (void volatile *)hw->hw_addr + 229504U); i40e_enable_misc_int_causes(hw); writel(0U, (void volatile *)hw->hw_addr + 230656U); val = 1207959552U; writel(val, (void volatile *)hw->hw_addr + 237568U); val = 1207896064U; writel(val, (void volatile *)hw->hw_addr + 245760U); readl((void const volatile *)hw->hw_addr + 745772U); } return; } } void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf ) { struct i40e_hw *hw ; { { hw = & pf->hw; writel(24U, (void volatile *)hw->hw_addr + 230528U); readl((void const volatile *)hw->hw_addr + 745772U); } return; } } void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf ) { struct i40e_hw *hw ; u32 val ; { { hw = & pf->hw; val = 27U; writel(val, (void volatile *)hw->hw_addr + 230528U); readl((void const volatile *)hw->hw_addr + 745772U); } return; } } void i40e_irq_dynamic_enable(struct i40e_vsi *vsi , int vector ) { struct i40e_pf *pf ; struct i40e_hw *hw ; u32 val ; { { pf = vsi->back; hw = & pf->hw; val = 27U; writel(val, (void volatile *)hw->hw_addr + (unsigned long )((vector + 53759) * 4)); } return; } } static irqreturn_t i40e_msix_clean_rings(int irq , void *data ) { struct i40e_q_vector *q_vector ; { q_vector = (struct i40e_q_vector *)data; if ((unsigned long )q_vector->tx.ring == (unsigned long )((struct i40e_ring *)0) && (unsigned long )q_vector->rx.ring == (unsigned long )((struct i40e_ring *)0)) { return (1); } else { } { napi_schedule(& q_vector->napi); } return (1); } } static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi , char *basename ) { int q_vectors ; struct i40e_pf *pf ; int base ; int rx_int_idx ; int tx_int_idx ; int vector ; int err ; struct i40e_q_vector *q_vector ; int tmp ; int tmp___0 ; int tmp___1 ; { q_vectors = vsi->num_q_vectors; pf = vsi->back; base = vsi->base_vector; rx_int_idx = 0; tx_int_idx = 0; vector = 0; goto ldv_57774; ldv_57773: q_vector = *(vsi->q_vectors + (unsigned long )vector); if ((unsigned long )q_vector->tx.ring != (unsigned long )((struct i40e_ring *)0) && (unsigned long )q_vector->rx.ring != (unsigned long )((struct i40e_ring *)0)) { { tmp = rx_int_idx; rx_int_idx = rx_int_idx + 1; snprintf((char *)(& q_vector->name), 24UL, "%s-%s-%d", basename, (char *)"TxRx", tmp); tx_int_idx = tx_int_idx + 1; } } else if ((unsigned long )q_vector->rx.ring != (unsigned long )((struct i40e_ring *)0)) { { tmp___0 = rx_int_idx; rx_int_idx = rx_int_idx + 1; snprintf((char *)(& q_vector->name), 24UL, "%s-%s-%d", basename, (char *)"rx", tmp___0); } } else if ((unsigned long )q_vector->tx.ring != (unsigned long )((struct i40e_ring *)0)) { { tmp___1 = tx_int_idx; tx_int_idx = tx_int_idx + 1; snprintf((char *)(& q_vector->name), 24UL, "%s-%s-%d", basename, (char *)"tx", tmp___1); } } else { goto ldv_57770; } { err = ldv_request_irq_10((pf->msix_entries + (unsigned long )(base + vector))->vector, vsi->irq_handler, 0UL, (char const *)(& q_vector->name), (void *)q_vector); } if (err != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: request_irq failed, error: %d\n", "i40e_vsi_request_irq_msix", err); } goto free_queue_irqs; } else { } { irq_set_affinity_hint((pf->msix_entries + (unsigned long )(base + vector))->vector, (struct cpumask const *)(& q_vector->affinity_mask)); } ldv_57770: vector = vector + 1; ldv_57774: ; if (vector < q_vectors) { goto ldv_57773; } else { } return (0); free_queue_irqs: ; goto ldv_57777; ldv_57776: { vector = vector - 1; irq_set_affinity_hint((pf->msix_entries + (unsigned long )(base + vector))->vector, (struct cpumask const *)0); ldv_free_irq_11((pf->msix_entries + (unsigned long )(base + vector))->vector, (void *)vsi->q_vectors + (unsigned long )vector); } ldv_57777: ; if (vector != 0) { goto ldv_57776; } else { } return (err); } } static void i40e_vsi_disable_irq(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; struct i40e_hw *hw ; int base ; int i ; { pf = vsi->back; hw = & pf->hw; base = vsi->base_vector; i = 0; goto ldv_57787; ldv_57786: { writel(0U, (void volatile *)hw->hw_addr + (unsigned long )(((int )(*(vsi->tx_rings + (unsigned long )i))->reg_idx + 61440) * 4)); writel(0U, (void volatile *)hw->hw_addr + (unsigned long )(((int )(*(vsi->rx_rings + (unsigned long )i))->reg_idx + 59392) * 4)); i = i + 1; } ldv_57787: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57786; } else { } if ((pf->flags & 8ULL) != 0ULL) { i = vsi->base_vector; goto ldv_57790; ldv_57789: { writel(0U, (void volatile *)hw->hw_addr + (unsigned long )((i + 53759) * 4)); i = i + 1; } ldv_57790: ; if (i < vsi->num_q_vectors + vsi->base_vector) { goto ldv_57789; } else { } { readl((void const volatile *)hw->hw_addr + 745772U); i = 0; } goto ldv_57793; ldv_57792: { synchronize_irq((pf->msix_entries + (unsigned long )(i + base))->vector); i = i + 1; } ldv_57793: ; if (i < vsi->num_q_vectors) { goto ldv_57792; } else { } } else { { writel(0U, (void volatile *)hw->hw_addr + 231424U); writel(0U, (void volatile *)hw->hw_addr + 230528U); readl((void const volatile *)hw->hw_addr + 745772U); synchronize_irq((pf->pdev)->irq); } } return; } } static int i40e_vsi_enable_irq(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; int i ; { pf = vsi->back; if ((pf->flags & 8ULL) != 0ULL) { i = vsi->base_vector; goto ldv_57801; ldv_57800: { i40e_irq_dynamic_enable(vsi, i); i = i + 1; } ldv_57801: ; if (i < vsi->num_q_vectors + vsi->base_vector) { goto ldv_57800; } else { } } else { { i40e_irq_dynamic_enable_icr0(pf); } } { readl((void const volatile *)pf->hw.hw_addr + 745772U); } return (0); } } static void i40e_stop_misc_vector(struct i40e_pf *pf ) { { { writel(0U, (void volatile *)pf->hw.hw_addr + 231424U); readl((void const volatile *)pf->hw.hw_addr + 745772U); } return; } } static irqreturn_t i40e_intr(int irq , void *data ) { struct i40e_pf *pf ; struct i40e_hw *hw ; irqreturn_t ret ; u32 icr0 ; u32 icr0_remaining ; u32 val ; u32 ena_mask ; u32 qval ; unsigned int tmp ; int tmp___0 ; int tmp___1 ; u32 prttsyn_stat ; unsigned int tmp___2 ; int tmp___3 ; { { pf = (struct i40e_pf *)data; hw = & pf->hw; ret = 0; icr0 = readl((void const volatile *)hw->hw_addr + 231296U); ena_mask = readl((void const volatile *)hw->hw_addr + 231424U); } if ((icr0 & 1U) == 0U) { goto enable_intr; } else { } if ((icr0 & 4294967294U) == 0U || (int )icr0 < 0) { pf->sw_int_count = (u16 )((int )pf->sw_int_count + 1); } else { } if ((icr0 & 2U) != 0U) { { tmp = readl((void const volatile *)hw->hw_addr + 237568U); qval = tmp; qval = qval & 3221225471U; writel(qval, (void volatile *)hw->hw_addr + 237568U); qval = readl((void const volatile *)hw->hw_addr + 245760U); qval = qval & 3221225471U; writel(qval, (void volatile *)hw->hw_addr + 245760U); tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 == 0) { { napi_schedule(& (*((*(pf->vsi + (unsigned long )pf->lan_vsi))->q_vectors))->napi); } } else { } } else { } if ((icr0 & 1073741824U) != 0U) { { ena_mask = ena_mask & 3221225471U; set_bit(6L, (unsigned long volatile *)(& pf->state)); } } else { } if ((icr0 & 524288U) != 0U) { { ena_mask = ena_mask & 4294443007U; set_bit(7L, (unsigned long volatile *)(& pf->state)); } } else { } if ((icr0 & 536870912U) != 0U) { { ena_mask = ena_mask & 3758096383U; set_bit(8L, (unsigned long volatile *)(& pf->state)); } } else { } if ((icr0 & 1048576U) != 0U) { { tmp___1 = constant_test_bit(9L, (unsigned long const volatile *)(& pf->state)); } if (tmp___1 == 0) { { set_bit(10L, (unsigned long volatile *)(& pf->state)); } } else { } { ena_mask = ena_mask & 4293918719U; val = readl((void const volatile *)hw->hw_addr + 754056U); val = (val & 12U) >> 2; } if (val == 1U) { pf->corer_count = (u16 )((int )pf->corer_count + 1); } else if (val == 2U) { pf->globr_count = (u16 )((int )pf->globr_count + 1); } else if (val == 3U) { pf->empr_count = (u16 )((int )pf->empr_count + 1); } else { } } else { } if ((icr0 & 67108864U) != 0U) { { icr0 = icr0 & 4227858431U; _dev_info((struct device const *)(& (pf->pdev)->dev), "HMC error interrupt\n"); } } else { } if ((icr0 & 8388608U) != 0U) { { tmp___2 = readl((void const volatile *)hw->hw_addr + 1983008U); prttsyn_stat = tmp___2; } if ((prttsyn_stat & 16U) != 0U) { { ena_mask = ena_mask & 4286578687U; i40e_ptp_tx_hwtstamp(pf); prttsyn_stat = prttsyn_stat & 4294967279U; } } else { } { writel(prttsyn_stat, (void volatile *)hw->hw_addr + 1983008U); } } else { } icr0_remaining = icr0 & ena_mask; if (icr0_remaining != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "unhandled interrupt icr0=0x%08x\n", icr0_remaining); } if ((icr0_remaining & 271122432U) != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "device will be reset\n"); set_bit(12L, (unsigned long volatile *)(& pf->state)); i40e_service_event_schedule(pf); } } else { } ena_mask = ena_mask & ~ icr0_remaining; } else { } ret = 1; enable_intr: { writel(ena_mask, (void volatile *)hw->hw_addr + 231424U); tmp___3 = constant_test_bit(3L, (unsigned long const volatile *)(& pf->state)); } if (tmp___3 == 0) { { i40e_service_event_schedule(pf); i40e_irq_dynamic_enable_icr0(pf); } } else { } return (ret); } } static bool i40e_clean_fdir_tx_irq(struct i40e_ring *tx_ring , int budget ) { struct i40e_vsi *vsi ; u16 i ; struct i40e_tx_buffer *tx_buf ; struct i40e_tx_desc *tx_desc ; struct i40e_tx_desc *eop_desc ; long tmp ; long tmp___0 ; { vsi = tx_ring->vsi; i = tx_ring->next_to_clean; tx_buf = tx_ring->__annonCompField94.tx_bi + (unsigned long )i; tx_desc = (struct i40e_tx_desc *)tx_ring->desc + (unsigned long )i; i = (int )i - (int )tx_ring->count; ldv_57830: eop_desc = tx_buf->next_to_watch; if ((unsigned long )eop_desc == (unsigned long )((struct i40e_tx_desc *)0)) { goto ldv_57829; } else { } if ((eop_desc->cmd_type_offset_bsz & 15ULL) == 0ULL) { goto ldv_57829; } else { } { tx_buf->next_to_watch = (struct i40e_tx_desc *)0; dma_unmap_single_attrs(tx_ring->dev, tx_buf->dma, (size_t )tx_buf->len, 1, (struct dma_attrs *)0); tx_buf->len = 0U; tx_buf = tx_buf + 1; tx_desc = tx_desc + 1; i = (u16 )((int )i + 1); tmp = ldv__builtin_expect((unsigned int )i == 0U, 0L); } if (tmp != 0L) { i = (int )i - (int )tx_ring->count; tx_buf = tx_ring->__annonCompField94.tx_bi; tx_desc = (struct i40e_tx_desc *)tx_ring->desc; } else { } { budget = budget - 1; tmp___0 = ldv__builtin_expect(budget != 0, 1L); } if (tmp___0 != 0L) { goto ldv_57830; } else { } ldv_57829: i = (int )i + (int )tx_ring->count; tx_ring->next_to_clean = i; if (((vsi->back)->flags & 8ULL) != 0ULL) { { i40e_irq_dynamic_enable(vsi, (int )(tx_ring->q_vector)->v_idx + vsi->base_vector); } } else { } return (budget > 0); } } static irqreturn_t i40e_fdir_clean_ring(int irq , void *data ) { struct i40e_q_vector *q_vector ; struct i40e_vsi *vsi ; { q_vector = (struct i40e_q_vector *)data; if ((unsigned long )q_vector->tx.ring == (unsigned long )((struct i40e_ring *)0)) { return (1); } else { } { vsi = (q_vector->tx.ring)->vsi; i40e_clean_fdir_tx_irq(q_vector->tx.ring, (int )vsi->work_limit); } return (1); } } static void map_vector_to_qp(struct i40e_vsi *vsi , int v_idx , int qp_idx ) { struct i40e_q_vector *q_vector ; struct i40e_ring *tx_ring ; struct i40e_ring *rx_ring ; { q_vector = *(vsi->q_vectors + (unsigned long )v_idx); tx_ring = *(vsi->tx_rings + (unsigned long )qp_idx); rx_ring = *(vsi->rx_rings + (unsigned long )qp_idx); tx_ring->q_vector = q_vector; tx_ring->next = q_vector->tx.ring; q_vector->tx.ring = tx_ring; q_vector->tx.count = (u16 )((int )q_vector->tx.count + 1); rx_ring->q_vector = q_vector; rx_ring->next = q_vector->rx.ring; q_vector->rx.ring = rx_ring; q_vector->rx.count = (u16 )((int )q_vector->rx.count + 1); return; } } static void i40e_vsi_map_rings_to_vectors(struct i40e_vsi *vsi ) { int qp_remaining ; int q_vectors ; int num_ringpairs ; int v_start ; int qp_idx ; struct i40e_q_vector *q_vector ; int tmp ; { qp_remaining = (int )vsi->num_queue_pairs; q_vectors = vsi->num_q_vectors; v_start = 0; qp_idx = 0; goto ldv_57858; ldv_57857: q_vector = *(vsi->q_vectors + (unsigned long )v_start); num_ringpairs = ((qp_remaining + (q_vectors - v_start)) + -1) / (q_vectors - v_start); q_vector->num_ringpairs = (u8 )num_ringpairs; q_vector->rx.count = 0U; q_vector->tx.count = 0U; q_vector->rx.ring = (struct i40e_ring *)0; q_vector->tx.ring = (struct i40e_ring *)0; goto ldv_57855; ldv_57854: { map_vector_to_qp(vsi, v_start, qp_idx); qp_idx = qp_idx + 1; qp_remaining = qp_remaining - 1; } ldv_57855: tmp = num_ringpairs; num_ringpairs = num_ringpairs - 1; if (tmp != 0) { goto ldv_57854; } else { } v_start = v_start + 1; ldv_57858: ; if (v_start < q_vectors && qp_remaining != 0) { goto ldv_57857; } else { } return; } } static int i40e_vsi_request_irq(struct i40e_vsi *vsi , char *basename ) { struct i40e_pf *pf ; int err ; { pf = vsi->back; if ((pf->flags & 8ULL) != 0ULL) { { err = i40e_vsi_request_irq_msix(vsi, basename); } } else if ((pf->flags & 4ULL) != 0ULL) { { err = ldv_request_irq_12((pf->pdev)->irq, & i40e_intr, 0UL, (char const *)(& pf->misc_int_name), (void *)pf); } } else { { err = ldv_request_irq_13((pf->pdev)->irq, & i40e_intr, 128UL, (char const *)(& pf->misc_int_name), (void *)pf); } } if (err != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "request_irq failed, Error %d\n", err); } } else { } return (err); } } static void i40e_netpoll(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; int i ; int tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)(& vsi->state)); } if (tmp___0 != 0) { return; } else { } pf->flags = pf->flags | 4096ULL; if ((pf->flags & 8ULL) != 0ULL) { i = 0; goto ldv_57874; ldv_57873: { i40e_msix_clean_rings(0, (void *)*(vsi->q_vectors + (unsigned long )i)); i = i + 1; } ldv_57874: ; if (i < vsi->num_q_vectors) { goto ldv_57873; } else { } } else { { i40e_intr((int )(pf->pdev)->irq, (void *)netdev); } } pf->flags = pf->flags & 0xffffffffffffefffULL; return; } } static int i40e_vsi_control_tx(struct i40e_vsi *vsi , bool enable ) { struct i40e_pf *pf ; struct i40e_hw *hw ; int i ; int j ; int pf_q ; u32 tx_reg ; int tmp ; unsigned long __ms ; unsigned long tmp___0 ; { pf = vsi->back; hw = & pf->hw; pf_q = (int )vsi->base_queue; i = 0; goto ldv_57893; ldv_57892: j = 1000; ldv_57886: { usleep_range(1000UL, 2000UL); tx_reg = readl((void const volatile *)hw->hw_addr + (unsigned long )((pf_q + 262144) * 4)); tmp = j; j = j - 1; } if (tmp != 0 && (int )(tx_reg ^ (tx_reg >> 2)) & 1) { goto ldv_57886; } else { } if ((int )enable && (tx_reg & 4U) != 0U) { goto ldv_57888; } else { } if (! enable && (tx_reg & 4U) == 0U) { goto ldv_57888; } else { } if ((int )enable) { { writel(0U, (void volatile *)hw->hw_addr + (unsigned long )((pf_q + 233472) * 4)); tx_reg = tx_reg | 5U; } } else { tx_reg = tx_reg & 4294967294U; } { writel(tx_reg, (void volatile *)hw->hw_addr + (unsigned long )((pf_q + 262144) * 4)); j = 0; } goto ldv_57891; ldv_57890: { tx_reg = readl((void const volatile *)hw->hw_addr + (unsigned long )((pf_q + 262144) * 4)); } if ((int )enable) { if ((tx_reg & 4U) != 0U) { goto ldv_57889; } else { } } else if ((tx_reg & 4U) == 0U) { goto ldv_57889; } else { } { __const_udelay(42950UL); j = j + 1; } ldv_57891: ; if (j <= 9) { goto ldv_57890; } else { } ldv_57889: ; if (j > 9) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Tx ring %d %sable timeout\n", pf_q, (int )enable ? (char *)"en" : (char *)"dis"); } return (-110); } else { } ldv_57888: i = i + 1; pf_q = pf_q + 1; ldv_57893: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57892; } else { } if ((unsigned int )hw->revision_id == 0U) { __ms = 50UL; goto ldv_57897; ldv_57896: { __const_udelay(4295000UL); } ldv_57897: tmp___0 = __ms; __ms = __ms - 1UL; if (tmp___0 != 0UL) { goto ldv_57896; } else { } } else { } return (0); } } static int i40e_vsi_control_rx(struct i40e_vsi *vsi , bool enable ) { struct i40e_pf *pf ; struct i40e_hw *hw ; int i ; int j ; int pf_q ; u32 rx_reg ; int tmp ; { pf = vsi->back; hw = & pf->hw; pf_q = (int )vsi->base_queue; i = 0; goto ldv_57916; ldv_57915: j = 1000; ldv_57909: { usleep_range(1000UL, 2000UL); rx_reg = readl((void const volatile *)hw->hw_addr + (unsigned long )((pf_q + 294912) * 4)); tmp = j; j = j - 1; } if (tmp != 0 && (int )(rx_reg ^ (rx_reg >> 2)) & 1) { goto ldv_57909; } else { } if ((int )enable) { if ((rx_reg & 4U) != 0U) { goto ldv_57911; } else { } } else if ((rx_reg & 4U) == 0U) { goto ldv_57911; } else { } if ((int )enable) { rx_reg = rx_reg | 5U; } else { rx_reg = rx_reg & 4294967290U; } { writel(rx_reg, (void volatile *)hw->hw_addr + (unsigned long )((pf_q + 294912) * 4)); j = 0; } goto ldv_57914; ldv_57913: { rx_reg = readl((void const volatile *)hw->hw_addr + (unsigned long )((pf_q + 294912) * 4)); } if ((int )enable) { if ((rx_reg & 4U) != 0U) { goto ldv_57912; } else { } } else if ((rx_reg & 4U) == 0U) { goto ldv_57912; } else { } { __const_udelay(42950UL); j = j + 1; } ldv_57914: ; if (j <= 9) { goto ldv_57913; } else { } ldv_57912: ; if (j > 9) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Rx ring %d %sable timeout\n", pf_q, (int )enable ? (char *)"en" : (char *)"dis"); } return (-110); } else { } ldv_57911: i = i + 1; pf_q = pf_q + 1; ldv_57916: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57915; } else { } return (0); } } int i40e_vsi_control_rings(struct i40e_vsi *vsi , bool request ) { int ret ; { ret = 0; if ((int )request) { { ret = i40e_vsi_control_rx(vsi, (int )request); } if (ret != 0) { return (ret); } else { } { ret = i40e_vsi_control_tx(vsi, (int )request); } } else { { i40e_vsi_control_tx(vsi, (int )request); i40e_vsi_control_rx(vsi, (int )request); } } return (ret); } } static void i40e_vsi_free_irq(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; struct i40e_hw *hw ; int base ; u32 val ; u32 qp ; int i ; u16 vector ; u32 next ; { pf = vsi->back; hw = & pf->hw; base = vsi->base_vector; if ((pf->flags & 8ULL) != 0ULL) { if ((unsigned long )vsi->q_vectors == (unsigned long )((struct i40e_q_vector **)0)) { return; } else { } i = 0; goto ldv_57939; ldv_57938: vector = (int )((u16 )i) + (int )((u16 )base); if ((unsigned long )*(vsi->q_vectors + (unsigned long )i) == (unsigned long )((struct i40e_q_vector *)0) || (unsigned int )(*(vsi->q_vectors + (unsigned long )i))->num_ringpairs == 0U) { goto ldv_57933; } else { } { irq_set_affinity_hint((pf->msix_entries + (unsigned long )vector)->vector, (struct cpumask const *)0); ldv_free_irq_14((pf->msix_entries + (unsigned long )vector)->vector, (void *)*(vsi->q_vectors + (unsigned long )i)); val = readl((void const volatile *)hw->hw_addr + (unsigned long )(((int )vector + 54271) * 4)); qp = val & 2047U; val = val | 2047U; writel(val, (void volatile *)hw->hw_addr + (unsigned long )(((int )vector + 54271) * 4)); } goto ldv_57936; ldv_57935: { val = readl((void const volatile *)hw->hw_addr + (unsigned long )((qp + 59392U) * 4U)); val = val & 1073684224U; val = val | 134158336U; writel(val, (void volatile *)hw->hw_addr + (unsigned long )((qp + 59392U) * 4U)); val = readl((void const volatile *)hw->hw_addr + (unsigned long )((qp + 61440U) * 4U)); next = (val & 134152192U) >> 16; val = val & 1073684224U; val = val | 134158336U; writel(val, (void volatile *)hw->hw_addr + (unsigned long )((qp + 61440U) * 4U)); qp = next; } ldv_57936: ; if (qp != 2047U) { goto ldv_57935; } else { } ldv_57933: i = i + 1; ldv_57939: ; if (i < vsi->num_q_vectors) { goto ldv_57938; } else { } } else { { ldv_free_irq_15((pf->pdev)->irq, (void *)pf); val = readl((void const volatile *)hw->hw_addr + 230656U); qp = val & 2047U; val = val | 2047U; writel(val, (void volatile *)hw->hw_addr + 230656U); val = readl((void const volatile *)hw->hw_addr + (unsigned long )((qp + 59392U) * 4U)); val = val & 1073684224U; val = val | 134158336U; writel(val, (void volatile *)hw->hw_addr + (unsigned long )((qp + 59392U) * 4U)); val = readl((void const volatile *)hw->hw_addr + (unsigned long )((qp + 61440U) * 4U)); val = val & 1073684224U; val = val | 134158336U; writel(val, (void volatile *)hw->hw_addr + (unsigned long )((qp + 61440U) * 4U)); } } return; } } extern void __compiletime_assert_3389(void) ; static void i40e_free_q_vector(struct i40e_vsi *vsi , int v_idx ) { struct i40e_q_vector *q_vector ; struct i40e_ring *ring ; bool __cond ; { q_vector = *(vsi->q_vectors + (unsigned long )v_idx); if ((unsigned long )q_vector == (unsigned long )((struct i40e_q_vector *)0)) { return; } else { } ring = q_vector->tx.ring; goto ldv_57948; ldv_57947: ring->q_vector = (struct i40e_q_vector *)0; ring = ring->next; ldv_57948: ; if ((unsigned long )ring != (unsigned long )((struct i40e_ring *)0)) { goto ldv_57947; } else { } ring = q_vector->rx.ring; goto ldv_57951; ldv_57950: ring->q_vector = (struct i40e_q_vector *)0; ring = ring->next; ldv_57951: ; if ((unsigned long )ring != (unsigned long )((struct i40e_ring *)0)) { goto ldv_57950; } else { } if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { netif_napi_del(& q_vector->napi); } } else { } *(vsi->q_vectors + (unsigned long )v_idx) = (struct i40e_q_vector *)0; __cond = 0; if ((int )__cond) { { __compiletime_assert_3389(); } } else { } { kfree_call_rcu(& q_vector->rcu, (void (*)(struct callback_head * ))1296); } return; } } static void i40e_vsi_free_q_vectors(struct i40e_vsi *vsi ) { int v_idx ; { v_idx = 0; goto ldv_57963; ldv_57962: { i40e_free_q_vector(vsi, v_idx); v_idx = v_idx + 1; } ldv_57963: ; if (v_idx < vsi->num_q_vectors) { goto ldv_57962; } else { } return; } } static void i40e_reset_interrupt_capability(struct i40e_pf *pf ) { { if ((pf->flags & 8ULL) != 0ULL) { { pci_disable_msix(pf->pdev); kfree((void const *)pf->msix_entries); pf->msix_entries = (struct msix_entry *)0; } } else if ((pf->flags & 4ULL) != 0ULL) { { pci_disable_msi(pf->pdev); } } else { } pf->flags = pf->flags & 0xfffffffffffffff3ULL; return; } } static void i40e_clear_interrupt_scheme(struct i40e_pf *pf ) { int i ; { { i40e_put_lump(pf->irq_pile, 0, 32767); i = 0; } goto ldv_57973; ldv_57972: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0)) { { i40e_vsi_free_q_vectors(*(pf->vsi + (unsigned long )i)); } } else { } i = i + 1; ldv_57973: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_57972; } else { } { i40e_reset_interrupt_capability(pf); } return; } } static void i40e_napi_enable_all(struct i40e_vsi *vsi ) { int q_idx ; { if ((unsigned long )vsi->netdev == (unsigned long )((struct net_device *)0)) { return; } else { } q_idx = 0; goto ldv_57980; ldv_57979: { napi_enable(& (*(vsi->q_vectors + (unsigned long )q_idx))->napi); q_idx = q_idx + 1; } ldv_57980: ; if (q_idx < vsi->num_q_vectors) { goto ldv_57979; } else { } return; } } static void i40e_napi_disable_all(struct i40e_vsi *vsi ) { int q_idx ; { if ((unsigned long )vsi->netdev == (unsigned long )((struct net_device *)0)) { return; } else { } q_idx = 0; goto ldv_57987; ldv_57986: { napi_disable(& (*(vsi->q_vectors + (unsigned long )q_idx))->napi); q_idx = q_idx + 1; } ldv_57987: ; if (q_idx < vsi->num_q_vectors) { goto ldv_57986; } else { } return; } } static void i40e_quiesce_vsi(struct i40e_vsi *vsi ) { int tmp ; bool tmp___0 ; { { tmp = constant_test_bit(3L, (unsigned long const volatile *)(& vsi->state)); } if (tmp != 0) { return; } else { } { set_bit(4L, (unsigned long volatile *)(& vsi->state)); } if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { tmp___0 = netif_running((struct net_device const *)vsi->netdev); } if ((int )tmp___0) { { (*(((vsi->netdev)->netdev_ops)->ndo_stop))(vsi->netdev); } } else { { set_bit(3L, (unsigned long volatile *)(& vsi->state)); i40e_down(vsi); } } } else { { set_bit(3L, (unsigned long volatile *)(& vsi->state)); i40e_down(vsi); } } return; } } static void i40e_unquiesce_vsi(struct i40e_vsi *vsi ) { int tmp ; bool tmp___0 ; { { tmp = constant_test_bit(4L, (unsigned long const volatile *)(& vsi->state)); } if (tmp == 0) { return; } else { } { clear_bit(4L, (unsigned long volatile *)(& vsi->state)); } if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { tmp___0 = netif_running((struct net_device const *)vsi->netdev); } if ((int )tmp___0) { { (*(((vsi->netdev)->netdev_ops)->ndo_open))(vsi->netdev); } } else { { i40e_up(vsi); } } } else { { i40e_up(vsi); } } return; } } static void i40e_pf_quiesce_all_vsi(struct i40e_pf *pf ) { int v ; { v = 0; goto ldv_58000; ldv_57999: ; if ((unsigned long )*(pf->vsi + (unsigned long )v) != (unsigned long )((struct i40e_vsi *)0)) { { i40e_quiesce_vsi(*(pf->vsi + (unsigned long )v)); } } else { } v = v + 1; ldv_58000: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_57999; } else { } return; } } static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf ) { int v ; { v = 0; goto ldv_58007; ldv_58006: ; if ((unsigned long )*(pf->vsi + (unsigned long )v) != (unsigned long )((struct i40e_vsi *)0)) { { i40e_unquiesce_vsi(*(pf->vsi + (unsigned long )v)); } } else { } v = v + 1; ldv_58007: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_58006; } else { } return; } } static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg ) { u8 num_tc ; int i ; { num_tc = 0U; i = 0; goto ldv_58015; ldv_58014: ; if ((int )dcbcfg->etscfg.prioritytable[i] > (int )num_tc) { num_tc = dcbcfg->etscfg.prioritytable[i]; } else { } i = i + 1; ldv_58015: ; if (i <= 7) { goto ldv_58014; } else { } return ((unsigned int )num_tc + 1U); } } static u8 i40e_dcb_get_enabled_tc(struct i40e_dcbx_config *dcbcfg ) { u8 num_tc ; u8 tmp ; u8 enabled_tc ; u8 i ; { { tmp = i40e_dcb_get_num_tc(dcbcfg); num_tc = tmp; enabled_tc = 1U; i = 0U; } goto ldv_58024; ldv_58023: enabled_tc = (u8 )((int )((signed char )enabled_tc) | (int )((signed char )(1 << (int )i))); i = (u8 )((int )i + 1); ldv_58024: ; if ((int )i < (int )num_tc) { goto ldv_58023; } else { } return (enabled_tc); } } static u8 i40e_pf_get_num_tc(struct i40e_pf *pf ) { struct i40e_hw *hw ; u8 i ; u8 enabled_tc ; u8 num_tc ; struct i40e_dcbx_config *dcbcfg ; u8 tmp ; { hw = & pf->hw; num_tc = 0U; dcbcfg = & hw->local_dcbx_config; if ((pf->flags & 1048576ULL) == 0ULL) { return (1U); } else { } if ((pf->flags & 67108864ULL) != 0ULL) { enabled_tc = (u8 )pf->hw.func_caps.enabled_tcmap; i = 0U; goto ldv_58035; ldv_58034: ; if (((int )enabled_tc >> (int )i) & 1) { num_tc = (u8 )((int )num_tc + 1); } else { } i = (u8 )((int )i + 1); ldv_58035: ; if ((unsigned int )i <= 7U) { goto ldv_58034; } else { } return (num_tc); } else { } { tmp = i40e_dcb_get_num_tc(dcbcfg); } return (tmp); } } static u8 i40e_pf_get_default_tc(struct i40e_pf *pf ) { u8 enabled_tc ; u8 i ; { enabled_tc = (u8 )pf->hw.func_caps.enabled_tcmap; i = 0U; if ((unsigned int )enabled_tc == 0U) { return (1U); } else { } i = 0U; goto ldv_58044; ldv_58043: ; if (((int )enabled_tc >> (int )i) & 1) { goto ldv_58042; } else { } i = (u8 )((int )i + 1); ldv_58044: ; if ((unsigned int )i <= 7U) { goto ldv_58043; } else { } ldv_58042: ; return ((u8 )(1 << (int )i)); } } static u8 i40e_pf_get_tc_map(struct i40e_pf *pf ) { u8 tmp ; u8 tmp___0 ; { if ((pf->flags & 1048576ULL) == 0ULL) { { tmp = i40e_pf_get_default_tc(pf); } return (tmp); } else { } if ((pf->flags & 67108864ULL) != 0ULL) { return ((u8 )pf->hw.func_caps.enabled_tcmap); } else { } { tmp___0 = i40e_dcb_get_enabled_tc(& pf->hw.local_dcbx_config); } return (tmp___0); } } static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi ) { struct i40e_aqc_query_vsi_ets_sla_config_resp bw_ets_config ; struct i40e_aqc_query_vsi_bw_config_resp bw_config ; struct i40e_pf *pf ; struct i40e_hw *hw ; i40e_status aq_ret ; u32 tc_bw_max ; int i ; { { bw_ets_config.tc_valid_bits = 0U; bw_ets_config.reserved[0] = (unsigned char)0; bw_ets_config.reserved[1] = (unsigned char)0; bw_ets_config.reserved[2] = (unsigned char)0; bw_ets_config.share_credits[0] = (unsigned char)0; bw_ets_config.share_credits[1] = (unsigned char)0; bw_ets_config.share_credits[2] = (unsigned char)0; bw_ets_config.share_credits[3] = (unsigned char)0; bw_ets_config.share_credits[4] = (unsigned char)0; bw_ets_config.share_credits[5] = (unsigned char)0; bw_ets_config.share_credits[6] = (unsigned char)0; bw_ets_config.share_credits[7] = (unsigned char)0; bw_ets_config.credits[0] = (unsigned short)0; bw_ets_config.credits[1] = (unsigned short)0; bw_ets_config.credits[2] = (unsigned short)0; bw_ets_config.credits[3] = (unsigned short)0; bw_ets_config.credits[4] = (unsigned short)0; bw_ets_config.credits[5] = (unsigned short)0; bw_ets_config.credits[6] = (unsigned short)0; bw_ets_config.credits[7] = (unsigned short)0; bw_ets_config.tc_bw_max[0] = (unsigned short)0; bw_ets_config.tc_bw_max[1] = (unsigned short)0; bw_config.tc_valid_bits = 0U; bw_config.tc_suspended_bits = (unsigned char)0; bw_config.reserved[0] = (unsigned char)0; bw_config.reserved[1] = (unsigned char)0; bw_config.reserved[2] = (unsigned char)0; bw_config.reserved[3] = (unsigned char)0; bw_config.reserved[4] = (unsigned char)0; bw_config.reserved[5] = (unsigned char)0; bw_config.reserved[6] = (unsigned char)0; bw_config.reserved[7] = (unsigned char)0; bw_config.reserved[8] = (unsigned char)0; bw_config.reserved[9] = (unsigned char)0; bw_config.reserved[10] = (unsigned char)0; bw_config.reserved[11] = (unsigned char)0; bw_config.reserved[12] = (unsigned char)0; bw_config.reserved[13] = (unsigned char)0; bw_config.qs_handles[0] = (unsigned short)0; bw_config.qs_handles[1] = (unsigned short)0; bw_config.qs_handles[2] = (unsigned short)0; bw_config.qs_handles[3] = (unsigned short)0; bw_config.qs_handles[4] = (unsigned short)0; bw_config.qs_handles[5] = (unsigned short)0; bw_config.qs_handles[6] = (unsigned short)0; bw_config.qs_handles[7] = (unsigned short)0; bw_config.reserved1[0] = (unsigned char)0; bw_config.reserved1[1] = (unsigned char)0; bw_config.reserved1[2] = (unsigned char)0; bw_config.reserved1[3] = (unsigned char)0; bw_config.port_bw_limit = (unsigned short)0; bw_config.reserved2[0] = (unsigned char)0; bw_config.reserved2[1] = (unsigned char)0; bw_config.max_bw = (unsigned char)0; bw_config.reserved3[0] = (unsigned char)0; bw_config.reserved3[1] = (unsigned char)0; bw_config.reserved3[2] = (unsigned char)0; bw_config.reserved3[3] = (unsigned char)0; bw_config.reserved3[4] = (unsigned char)0; bw_config.reserved3[5] = (unsigned char)0; bw_config.reserved3[6] = (unsigned char)0; bw_config.reserved3[7] = (unsigned char)0; bw_config.reserved3[8] = (unsigned char)0; bw_config.reserved3[9] = (unsigned char)0; bw_config.reserved3[10] = (unsigned char)0; bw_config.reserved3[11] = (unsigned char)0; bw_config.reserved3[12] = (unsigned char)0; bw_config.reserved3[13] = (unsigned char)0; bw_config.reserved3[14] = (unsigned char)0; bw_config.reserved3[15] = (unsigned char)0; bw_config.reserved3[16] = (unsigned char)0; bw_config.reserved3[17] = (unsigned char)0; bw_config.reserved3[18] = (unsigned char)0; bw_config.reserved3[19] = (unsigned char)0; bw_config.reserved3[20] = (unsigned char)0; bw_config.reserved3[21] = (unsigned char)0; bw_config.reserved3[22] = (unsigned char)0; pf = vsi->back; hw = & pf->hw; aq_ret = i40e_aq_query_vsi_bw_config(hw, (int )vsi->seid, & bw_config, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "couldn\'t get pf vsi bw config, err %d, aq_err %d\n", (int )aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } return (-22); } else { } { aq_ret = i40e_aq_query_vsi_ets_sla_config(hw, (int )vsi->seid, & bw_ets_config, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "couldn\'t get pf vsi ets bw config, err %d, aq_err %d\n", (int )aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } return (-22); } else { } if ((int )bw_config.tc_valid_bits != (int )bw_ets_config.tc_valid_bits) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Enabled TCs mismatch from querying VSI BW info 0x%08x 0x%08x\n", (int )bw_config.tc_valid_bits, (int )bw_ets_config.tc_valid_bits); } } else { } vsi->bw_limit = bw_config.port_bw_limit; vsi->bw_max_quanta = bw_config.max_bw; tc_bw_max = (u32 )((int )bw_ets_config.tc_bw_max[0] | ((int )bw_ets_config.tc_bw_max[1] << 16)); i = 0; goto ldv_58059; ldv_58058: vsi->bw_ets_share_credits[i] = bw_ets_config.share_credits[i]; vsi->bw_ets_limit_credits[i] = bw_ets_config.credits[i]; vsi->bw_ets_max_quanta[i] = (unsigned int )((unsigned char )(tc_bw_max >> i * 4)) & 7U; i = i + 1; ldv_58059: ; if (i <= 7) { goto ldv_58058; } else { } return (0); } } static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi , u8 enabled_tc , u8 *bw_share ) { struct i40e_aqc_configure_vsi_tc_bw_data bw_data ; i40e_status aq_ret ; int i ; { bw_data.tc_valid_bits = enabled_tc; i = 0; goto ldv_58070; ldv_58069: bw_data.tc_bw_credits[i] = *(bw_share + (unsigned long )i); i = i + 1; ldv_58070: ; if (i <= 7) { goto ldv_58069; } else { } { aq_ret = i40e_aq_config_vsi_tc_bw(& (vsi->back)->hw, (int )vsi->seid, & bw_data, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "%s: AQ command Config VSI BW allocation per TC failed = %d\n", "i40e_vsi_configure_bw_alloc", (unsigned int )(vsi->back)->hw.aq.asq_last_status); } return (-22); } else { } i = 0; goto ldv_58074; ldv_58073: vsi->info.qs_handle[i] = bw_data.qs_handles[i]; i = i + 1; ldv_58074: ; if (i <= 7) { goto ldv_58073; } else { } return (0); } } static void i40e_vsi_config_netdev_tc(struct i40e_vsi *vsi , u8 enabled_tc ) { struct net_device *netdev ; struct i40e_pf *pf ; struct i40e_hw *hw ; u8 netdev_tc ; int i ; struct i40e_dcbx_config *dcbcfg ; int tmp ; u8 ets_tc ; { netdev = vsi->netdev; pf = vsi->back; hw = & pf->hw; netdev_tc = 0U; dcbcfg = & hw->local_dcbx_config; if ((unsigned long )netdev == (unsigned long )((struct net_device *)0)) { return; } else { } if ((unsigned int )enabled_tc == 0U) { { netdev_reset_tc(netdev); } return; } else { } { tmp = netdev_set_num_tc(netdev, (int )vsi->tc_config.numtc); } if (tmp != 0) { return; } else { } i = 0; goto ldv_58087; ldv_58086: ; if (((int )vsi->tc_config.enabled_tc >> i) & 1) { { netdev_set_tc_queue(netdev, (int )vsi->tc_config.tc_info[i].netdev_tc, (int )vsi->tc_config.tc_info[i].qcount, (int )vsi->tc_config.tc_info[i].qoffset); } } else { } i = i + 1; ldv_58087: ; if (i <= 7) { goto ldv_58086; } else { } i = 0; goto ldv_58091; ldv_58090: { ets_tc = dcbcfg->etscfg.prioritytable[i]; netdev_tc = vsi->tc_config.tc_info[(int )ets_tc].netdev_tc; netdev_set_prio_tc_map(netdev, (int )((u8 )i), (int )netdev_tc); i = i + 1; } ldv_58091: ; if (i <= 7) { goto ldv_58090; } else { } return; } } static void i40e_vsi_update_queue_map(struct i40e_vsi *vsi , struct i40e_vsi_context *ctxt ) { { { vsi->info.mapping_flags = ctxt->info.mapping_flags; memcpy((void *)(& vsi->info.queue_mapping), (void const *)(& ctxt->info.queue_mapping), 32UL); memcpy((void *)(& vsi->info.tc_mapping), (void const *)(& ctxt->info.tc_mapping), 16UL); } return; } } static int i40e_vsi_config_tc(struct i40e_vsi *vsi , u8 enabled_tc ) { u8 bw_share[8U] ; unsigned int tmp ; struct i40e_vsi_context ctxt ; int ret ; int i ; i40e_status tmp___0 ; { bw_share[0] = 0U; tmp = 1U; { while (1) { while_continue: /* CIL Label */ ; if (tmp >= 8U) { goto while_break; } else { } bw_share[tmp] = (unsigned char)0; tmp = tmp + 1U; } while_break: /* CIL Label */ ; } ret = 0; if ((int )vsi->tc_config.enabled_tc == (int )enabled_tc) { return (ret); } else { } i = 0; goto ldv_58106; ldv_58105: ; if (((int )enabled_tc >> i) & 1) { bw_share[i] = 1U; } else { } i = i + 1; ldv_58106: ; if (i <= 7) { goto ldv_58105; } else { } { ret = i40e_vsi_configure_bw_alloc(vsi, (int )enabled_tc, (u8 *)(& bw_share)); } if (ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Failed configuring TC map %d for VSI %d\n", (int )enabled_tc, (int )vsi->seid); } goto out; } else { } { ctxt.seid = vsi->seid; ctxt.pf_num = (vsi->back)->hw.pf_id; ctxt.vf_num = 0U; ctxt.uplink_seid = vsi->uplink_seid; memcpy((void *)(& ctxt.info), (void const *)(& vsi->info), 128UL); i40e_vsi_setup_queue_map(vsi, & ctxt, (int )enabled_tc, 0); tmp___0 = i40e_aq_update_vsi_params(& (vsi->back)->hw, & ctxt, (struct i40e_asq_cmd_details *)0); ret = (int )tmp___0; } if (ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "update vsi failed, aq_err=%d\n", (unsigned int )(vsi->back)->hw.aq.asq_last_status); } goto out; } else { } { i40e_vsi_update_queue_map(vsi, & ctxt); vsi->info.valid_sections = 0U; ret = i40e_vsi_get_bw_info(vsi); } if (ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "Failed updating vsi bw info, aq_err=%d\n", (unsigned int )(vsi->back)->hw.aq.asq_last_status); } goto out; } else { } { i40e_vsi_config_netdev_tc(vsi, (int )enabled_tc); } out: ; return (ret); } } int i40e_veb_config_tc(struct i40e_veb *veb , u8 enabled_tc ) { struct i40e_aqc_configure_switching_comp_bw_config_data bw_data ; struct i40e_pf *pf ; int ret ; int i ; i40e_status tmp ; { bw_data.tc_valid_bits = 0U; bw_data.reserved[0] = (unsigned char)0; bw_data.reserved[1] = (unsigned char)0; bw_data.absolute_credits = (unsigned char)0; bw_data.tc_bw_share_credits[0] = (unsigned char)0; bw_data.tc_bw_share_credits[1] = (unsigned char)0; bw_data.tc_bw_share_credits[2] = (unsigned char)0; bw_data.tc_bw_share_credits[3] = (unsigned char)0; bw_data.tc_bw_share_credits[4] = (unsigned char)0; bw_data.tc_bw_share_credits[5] = (unsigned char)0; bw_data.tc_bw_share_credits[6] = (unsigned char)0; bw_data.tc_bw_share_credits[7] = (unsigned char)0; bw_data.reserved1[0] = (unsigned char)0; bw_data.reserved1[1] = (unsigned char)0; bw_data.reserved1[2] = (unsigned char)0; bw_data.reserved1[3] = (unsigned char)0; bw_data.reserved1[4] = (unsigned char)0; bw_data.reserved1[5] = (unsigned char)0; bw_data.reserved1[6] = (unsigned char)0; bw_data.reserved1[7] = (unsigned char)0; bw_data.reserved1[8] = (unsigned char)0; bw_data.reserved1[9] = (unsigned char)0; bw_data.reserved1[10] = (unsigned char)0; bw_data.reserved1[11] = (unsigned char)0; bw_data.reserved1[12] = (unsigned char)0; bw_data.reserved1[13] = (unsigned char)0; bw_data.reserved1[14] = (unsigned char)0; bw_data.reserved1[15] = (unsigned char)0; bw_data.reserved1[16] = (unsigned char)0; bw_data.reserved1[17] = (unsigned char)0; bw_data.reserved1[18] = (unsigned char)0; bw_data.reserved1[19] = (unsigned char)0; pf = veb->pf; ret = 0; if ((unsigned int )enabled_tc == 0U || (int )veb->enabled_tc == (int )enabled_tc) { return (ret); } else { } bw_data.tc_valid_bits = enabled_tc; i = 0; goto ldv_58118; ldv_58117: ; if (((int )enabled_tc >> i) & 1) { bw_data.tc_bw_share_credits[i] = 1U; } else { } i = i + 1; ldv_58118: ; if (i <= 7) { goto ldv_58117; } else { } { tmp = i40e_aq_config_switch_comp_bw_config(& pf->hw, (int )veb->seid, & bw_data, (struct i40e_asq_cmd_details *)0); ret = (int )tmp; } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "veb bw config failed, aq_err=%d\n", (unsigned int )pf->hw.aq.asq_last_status); } goto out; } else { } { ret = i40e_veb_get_bw_info(veb); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Failed getting veb bw config, aq_err=%d\n", (unsigned int )pf->hw.aq.asq_last_status); } } else { } out: ; return (ret); } } static void i40e_dcb_reconfigure(struct i40e_pf *pf ) { u8 tc_map ; int ret ; u8 v ; { { tc_map = 0U; tc_map = i40e_pf_get_tc_map(pf); v = 0U; } goto ldv_58129; ldv_58128: ; if ((unsigned long )pf->veb[(int )v] == (unsigned long )((struct i40e_veb *)0)) { goto ldv_58127; } else { } { ret = i40e_veb_config_tc(pf->veb[(int )v], (int )tc_map); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Failed configuring TC for VEB seid=%d\n", (int )(pf->veb[(int )v])->seid); } } else { } ldv_58127: v = (u8 )((int )v + 1); ldv_58129: ; if ((unsigned int )v <= 15U) { goto ldv_58128; } else { } v = 0U; goto ldv_58133; ldv_58132: ; if ((unsigned long )*(pf->vsi + (unsigned long )v) == (unsigned long )((struct i40e_vsi *)0)) { goto ldv_58131; } else { } if ((int )((unsigned short )v) == (int )pf->lan_vsi) { { tc_map = i40e_pf_get_tc_map(pf); } } else { { tc_map = i40e_pf_get_default_tc(pf); } } { ret = i40e_vsi_config_tc(*(pf->vsi + (unsigned long )v), (int )tc_map); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Failed configuring TC for VSI seid=%d\n", (int )(*(pf->vsi + (unsigned long )v))->seid); } } else if ((unsigned long )(*(pf->vsi + (unsigned long )v))->netdev != (unsigned long )((struct net_device *)0)) { { i40e_dcbnl_set_all(*(pf->vsi + (unsigned long )v)); } } else { } ldv_58131: v = (u8 )((int )v + 1); ldv_58133: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_58132; } else { } return; } } static int i40e_init_pf_dcb(struct i40e_pf *pf ) { struct i40e_hw *hw ; int err ; i40e_status tmp ; { hw = & pf->hw; err = 0; if (pf->hw.func_caps.npar_enable != 0U) { goto out; } else { } { tmp = i40e_init_dcb(hw); err = (int )tmp; } if (err == 0) { if (! hw->func_caps.dcb || (unsigned int )hw->dcbx_status == 7U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "DCBX offload is not supported or is disabled for this PF.\n"); } if ((pf->flags & 67108864ULL) != 0ULL) { goto out; } else { } } else { pf->dcbx_cap = 10U; pf->flags = pf->flags | 1048576ULL; } } else { } out: ; return (err); } } static int i40e_up_complete(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; int err ; { pf = vsi->back; if ((pf->flags & 8ULL) != 0ULL) { { i40e_vsi_configure_msix(vsi); } } else { { i40e_configure_msi_and_legacy(vsi); } } { err = i40e_vsi_control_rings(vsi, 1); } if (err != 0) { return (err); } else { } { clear_bit(3L, (unsigned long volatile *)(& vsi->state)); i40e_napi_enable_all(vsi); i40e_vsi_enable_irq(vsi); } if ((int )pf->hw.phy.link_info.link_info & 1 && (unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { netdev_info((struct net_device const *)vsi->netdev, "NIC Link is Up\n"); netif_tx_start_all_queues(vsi->netdev); netif_carrier_on(vsi->netdev); } } else if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { netdev_info((struct net_device const *)vsi->netdev, "NIC Link is Down\n"); } } else { } { i40e_service_event_schedule(pf); } return (0); } } static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; int __ret_warn_on ; int tmp ; long tmp___0 ; int tmp___1 ; { { pf = vsi->back; tmp = preempt_count(); __ret_warn_on = ((unsigned long )tmp & 2096896UL) != 0UL; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp___0 != 0L) { { warn_slowpath_null("drivers/net/ethernet/intel/i40e/i40e_main.c", 4081); } } else { } { ldv__builtin_expect(__ret_warn_on != 0, 0L); } goto ldv_58153; ldv_58152: { usleep_range(1000UL, 2000UL); } ldv_58153: { tmp___1 = test_and_set_bit(1L, (unsigned long volatile *)(& pf->state)); } if (tmp___1 != 0) { goto ldv_58152; } else { } { i40e_down(vsi); } if ((unsigned int )vsi->type == 6U) { { msleep(2000U); } } else { } { i40e_up(vsi); clear_bit(1L, (unsigned long volatile *)(& pf->state)); } return; } } int i40e_up(struct i40e_vsi *vsi ) { int err ; { { err = i40e_vsi_configure(vsi); } if (err == 0) { { err = i40e_up_complete(vsi); } } else { } return (err); } } void i40e_down(struct i40e_vsi *vsi ) { int i ; { if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { netif_carrier_off(vsi->netdev); netif_tx_disable(vsi->netdev); } } else { } { i40e_vsi_disable_irq(vsi); i40e_vsi_control_rings(vsi, 0); i40e_napi_disable_all(vsi); i = 0; } goto ldv_58164; ldv_58163: { i40e_clean_tx_ring(*(vsi->tx_rings + (unsigned long )i)); i40e_clean_rx_ring(*(vsi->rx_rings + (unsigned long )i)); i = i + 1; } ldv_58164: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_58163; } else { } return; } } static int i40e_setup_tc(struct net_device *netdev , u8 tc ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; u8 enabled_tc ; int ret ; int i ; u8 tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; enabled_tc = 0U; ret = -22; } if ((pf->flags & 1048576ULL) == 0ULL) { { netdev_info((struct net_device const *)netdev, "DCB is not enabled for adapter\n"); } goto exit; } else { } if ((pf->flags & 67108864ULL) != 0ULL) { { netdev_info((struct net_device const *)netdev, "Configuring TC not supported in MFP mode\n"); } goto exit; } else { } { tmp___0 = i40e_pf_get_num_tc(pf); } if ((int )tc > (int )tmp___0) { { netdev_info((struct net_device const *)netdev, "TC count greater than enabled on link for adapter\n"); } goto exit; } else { } i = 0; goto ldv_58178; ldv_58177: enabled_tc = (u8 )((int )((signed char )enabled_tc) | (int )((signed char )(1 << i))); i = i + 1; ldv_58178: ; if (i < (int )tc) { goto ldv_58177; } else { } if ((int )enabled_tc == (int )vsi->tc_config.enabled_tc) { return (0); } else { } { i40e_quiesce_vsi(vsi); ret = i40e_vsi_config_tc(vsi, (int )enabled_tc); } if (ret != 0) { { netdev_info((struct net_device const *)netdev, "Failed configuring TC for VSI seid=%d\n", (int )vsi->seid); } goto exit; } else { } { i40e_unquiesce_vsi(vsi); } exit: ; return (ret); } } static int i40e_open(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; char int_name[16U] ; int err ; int tmp___0 ; char const *tmp___1 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 != 0) { return (-16); } else { } { netif_carrier_off(netdev); err = i40e_vsi_setup_tx_resources(vsi); } if (err != 0) { goto err_setup_tx; } else { } { err = i40e_vsi_setup_rx_resources(vsi); } if (err != 0) { goto err_setup_rx; } else { } { err = i40e_vsi_configure(vsi); } if (err != 0) { goto err_setup_rx; } else { } { tmp___1 = dev_driver_string((struct device const *)(& (pf->pdev)->dev)); snprintf((char *)(& int_name), 15UL, "%s-%s", tmp___1, (char *)(& netdev->name)); err = i40e_vsi_request_irq(vsi, (char *)(& int_name)); } if (err != 0) { goto err_setup_rx; } else { } { err = netif_set_real_num_tx_queues(netdev, (unsigned int )vsi->num_queue_pairs); } if (err != 0) { goto err_set_queues; } else { } { err = netif_set_real_num_rx_queues(netdev, (unsigned int )vsi->num_queue_pairs); } if (err != 0) { goto err_set_queues; } else { } { err = i40e_up_complete(vsi); } if (err != 0) { goto err_up_complete; } else { } { vxlan_get_rx_port(netdev); } return (0); err_up_complete: { i40e_down(vsi); } err_set_queues: { i40e_vsi_free_irq(vsi); } err_setup_rx: { i40e_vsi_free_rx_resources(vsi); } err_setup_tx: { i40e_vsi_free_tx_resources(vsi); } if ((unsigned long )vsi == (unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi)) { { i40e_do_reset(pf, 4096U); } } else { } return (err); } } static int i40e_close(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; int tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; tmp___0 = test_and_set_bit(3L, (unsigned long volatile *)(& vsi->state)); } if (tmp___0 != 0) { return (0); } else { } { i40e_down(vsi); i40e_vsi_free_irq(vsi); i40e_vsi_free_tx_resources(vsi); i40e_vsi_free_rx_resources(vsi); } return (0); } } void i40e_do_reset(struct i40e_pf *pf , u32 reset_flags ) { u32 val ; int __ret_warn_on ; int tmp ; long tmp___0 ; int v ; struct i40e_vsi *vsi ; int tmp___1 ; { { tmp = preempt_count(); __ret_warn_on = ((unsigned long )tmp & 2096896UL) != 0UL; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp___0 != 0L) { { warn_slowpath_null("drivers/net/ethernet/intel/i40e/i40e_main.c", 4311); } } else { } { ldv__builtin_expect(__ret_warn_on != 0, 0L); } if ((reset_flags & 16384U) != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "GlobalR requested\n"); val = readl((void const volatile *)pf->hw.hw_addr + 754064U); val = val | 2U; writel(val, (void volatile *)pf->hw.hw_addr + 754064U); } } else if ((reset_flags & 8192U) != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "CoreR requested\n"); val = readl((void const volatile *)pf->hw.hw_addr + 754064U); val = val | 1U; writel(val, (void volatile *)pf->hw.hw_addr + 754064U); readl((void const volatile *)pf->hw.hw_addr + 745772U); } } else if ((reset_flags & 32768U) != 0U) { { val = readl((void const volatile *)pf->hw.hw_addr + 754060U); val = val | 1U; writel(val, (void volatile *)pf->hw.hw_addr + 754060U); val = readl((void const volatile *)pf->hw.hw_addr + 754064U); val = val | 4U; writel(val, (void volatile *)pf->hw.hw_addr + 754064U); readl((void const volatile *)pf->hw.hw_addr + 745772U); } } else if ((reset_flags & 4096U) != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "PFR requested\n"); i40e_handle_reset_warning(pf); } } else if ((reset_flags & 2048U) != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "VSI reinit requested\n"); v = 0; } goto ldv_58207; ldv_58206: vsi = *(pf->vsi + (unsigned long )v); if ((unsigned long )vsi != (unsigned long )((struct i40e_vsi *)0)) { { tmp___1 = constant_test_bit(11L, (unsigned long const volatile *)(& vsi->state)); } if (tmp___1 != 0) { { i40e_vsi_reinit_locked(*(pf->vsi + (unsigned long )v)); clear_bit(11L, (unsigned long volatile *)(& vsi->state)); } } else { } } else { } v = v + 1; ldv_58207: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_58206; } else { } return; } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "bad reset request 0x%08x\n", reset_flags); } return; } return; } } bool i40e_dcb_need_reconfig(struct i40e_pf *pf , struct i40e_dcbx_config *old_cfg , struct i40e_dcbx_config *new_cfg ) { bool need_reconfig ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { { need_reconfig = 0; tmp___2 = memcmp((void const *)(& new_cfg->etscfg), (void const *)(& old_cfg->etscfg), 27UL); } if (tmp___2 != 0) { { tmp = memcmp((void const *)(& new_cfg->etscfg.prioritytable), (void const *)(& old_cfg->etscfg.prioritytable), 8UL); } if (tmp != 0) { { need_reconfig = 1; _dev_info((struct device const *)(& (pf->pdev)->dev), "ETS UP2TC changed.\n"); } } else { } { tmp___0 = memcmp((void const *)(& new_cfg->etscfg.tcbwtable), (void const *)(& old_cfg->etscfg.tcbwtable), 8UL); } if (tmp___0 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "ETS TC BW Table changed.\n"); } } else { } { tmp___1 = memcmp((void const *)(& new_cfg->etscfg.tsatable), (void const *)(& old_cfg->etscfg.tsatable), 8UL); } if (tmp___1 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "ETS TSA Table changed.\n"); } } else { } } else { } { tmp___3 = memcmp((void const *)(& new_cfg->pfc), (void const *)(& old_cfg->pfc), 4UL); } if (tmp___3 != 0) { { need_reconfig = 1; _dev_info((struct device const *)(& (pf->pdev)->dev), "PFC config change detected.\n"); } } else { } { tmp___4 = memcmp((void const *)(& new_cfg->app), (void const *)(& old_cfg->app), 128UL); } if (tmp___4 != 0) { { need_reconfig = 1; _dev_info((struct device const *)(& (pf->pdev)->dev), "APP Table change detected.\n"); } } else { } return (need_reconfig); } } static int i40e_handle_lldp_event(struct i40e_pf *pf , struct i40e_arq_event_info *e ) { struct i40e_aqc_lldp_get_mib *mib ; struct i40e_hw *hw ; struct i40e_dcbx_config *dcbx_cfg ; struct i40e_dcbx_config tmp_dcbx_cfg ; bool need_reconfig ; int ret ; u8 type ; i40e_status tmp ; i40e_status tmp___0 ; int tmp___1 ; { mib = (struct i40e_aqc_lldp_get_mib *)(& e->desc.params.raw); hw = & pf->hw; dcbx_cfg = & hw->local_dcbx_config; need_reconfig = 0; ret = 0; type = (unsigned int )((u8 )((int )mib->type >> 2)) & 12U; if ((unsigned int )type != 0U) { return (ret); } else { } type = (unsigned int )mib->type & 3U; if ((unsigned int )type == 1U) { { tmp = i40e_aq_get_dcb_config(hw, 1, 0, & hw->remote_dcbx_config); ret = (int )tmp; } goto exit; } else { } { memset((void *)(& tmp_dcbx_cfg), 0, 188UL); tmp___0 = i40e_lldp_to_dcb_config(e->msg_buf, & tmp_dcbx_cfg); ret = (int )tmp___0; } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Failed parsing LLDPDU from event buffer\n"); } goto exit; } else { } { tmp___1 = memcmp((void const *)(& tmp_dcbx_cfg), (void const *)dcbx_cfg, 188UL); } if (tmp___1 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "No change detected in DCBX configuration.\n"); } goto exit; } else { } { need_reconfig = i40e_dcb_need_reconfig(pf, dcbx_cfg, & tmp_dcbx_cfg); i40e_dcbnl_flush_apps(pf, & tmp_dcbx_cfg); *dcbx_cfg = tmp_dcbx_cfg; } if (! need_reconfig) { goto exit; } else { } { i40e_pf_quiesce_all_vsi(pf); i40e_dcb_reconfigure(pf); i40e_pf_unquiesce_all_vsi(pf); } exit: ; return (ret); } } void i40e_do_reset_safe(struct i40e_pf *pf , u32 reset_flags ) { { { rtnl_lock(); i40e_do_reset(pf, reset_flags); rtnl_unlock(); } return; } } static void i40e_handle_lan_overflow_event(struct i40e_pf *pf , struct i40e_arq_event_info *e ) { struct i40e_aqc_lan_overflow *data ; u32 queue ; u32 qtx_ctl ; struct i40e_hw *hw ; struct i40e_vf *vf ; u16 vf_id ; { { data = (struct i40e_aqc_lan_overflow *)(& e->desc.params.raw); queue = data->prtdcb_rupto; qtx_ctl = data->otx_ctl; hw = & pf->hw; _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: Rx Queue Number = %d QTX_CTL=0x%08x\n", "i40e_handle_lan_overflow_event", queue, qtx_ctl); } if ((qtx_ctl & 3U) == 0U) { { vf_id = (unsigned short )((qtx_ctl & 65408U) >> 7); vf_id = (int )vf_id - (int )((u16 )hw->func_caps.vf_base_id); vf = pf->vf + (unsigned long )vf_id; i40e_vc_notify_vf_reset(vf); msleep(20U); i40e_reset_vf(vf, 0); } } else { } return; } } static void i40e_service_event_complete(struct i40e_pf *pf ) { int tmp ; long tmp___0 ; { { tmp = constant_test_bit(5L, (unsigned long const volatile *)(& pf->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 *)"drivers/net/ethernet/intel/i40e/i40e_main.c"), "i" (4576), "i" (12UL)); __builtin_unreachable(); } } else { } { __asm__ volatile ("": : : "memory"); clear_bit(5L, (unsigned long volatile *)(& pf->state)); } return; } } static void i40e_fdir_reinit_subtask(struct i40e_pf *pf ) { int tmp ; { if ((pf->flags & 256ULL) == 0ULL) { return; } else { } { pf->flags = pf->flags & 0xfffffffffffffeffULL; tmp = constant_test_bit(3L, (unsigned long const volatile *)(& pf->state)); } if (tmp != 0) { return; } else { } return; } } static void i40e_vsi_link_event(struct i40e_vsi *vsi , bool link_up ) { { if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { return; } else { } { if ((unsigned int )vsi->type == 0U) { goto case_0; } else { } if ((unsigned int )vsi->type == 6U) { goto case_6; } else { } if ((unsigned int )vsi->type == 2U) { goto case_2; } else { } if ((unsigned int )vsi->type == 3U) { goto case_3; } else { } if ((unsigned int )vsi->type == 5U) { goto case_5; } else { } goto switch_default; case_0: /* CIL Label */ ; if ((unsigned long )vsi->netdev == (unsigned long )((struct net_device *)0) || ! vsi->netdev_registered) { goto ldv_58253; } else { } if ((int )link_up) { { netif_carrier_on(vsi->netdev); netif_tx_wake_all_queues(vsi->netdev); } } else { { netif_carrier_off(vsi->netdev); netif_tx_stop_all_queues(vsi->netdev); } } goto ldv_58253; case_6: /* CIL Label */ ; goto ldv_58253; case_2: /* CIL Label */ ; case_3: /* CIL Label */ ; case_5: /* CIL Label */ ; switch_default: /* CIL Label */ ; goto ldv_58253; switch_break: /* CIL Label */ ; } ldv_58253: ; return; } } static void i40e_veb_link_event(struct i40e_veb *veb , bool link_up ) { struct i40e_pf *pf ; int i ; { if ((unsigned long )veb == (unsigned long )((struct i40e_veb *)0) || (unsigned long )veb->pf == (unsigned long )((struct i40e_pf *)0)) { return; } else { } pf = veb->pf; i = 0; goto ldv_58266; ldv_58265: ; if ((unsigned long )pf->veb[i] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[i])->uplink_seid == (int )veb->seid) { { i40e_veb_link_event(pf->veb[i], (int )link_up); } } else { } i = i + 1; ldv_58266: ; if (i <= 15) { goto ldv_58265; } else { } i = 0; goto ldv_58269; ldv_58268: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (int )(*(pf->vsi + (unsigned long )i))->uplink_seid == (int )veb->seid) { { i40e_vsi_link_event(*(pf->vsi + (unsigned long )i), (int )link_up); } } else { } i = i + 1; ldv_58269: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58268; } else { } return; } } static void i40e_link_event(struct i40e_pf *pf ) { bool new_link ; bool old_link ; int tmp ; { new_link = ((int )pf->hw.phy.link_info.link_info & 1) != 0; old_link = ((int )pf->hw.phy.link_info_old.link_info & 1) != 0; if ((int )new_link == (int )old_link) { return; } else { } { tmp = constant_test_bit(3L, (unsigned long const volatile *)(& (*(pf->vsi + (unsigned long )pf->lan_vsi))->state)); } if (tmp == 0) { { netdev_info((struct net_device const *)(*(pf->vsi + (unsigned long )pf->lan_vsi))->netdev, "NIC Link is %s\n", (int )new_link ? (char *)"Up" : (char *)"Down"); } } else { } if ((unsigned int )pf->lan_veb != 65535U && (unsigned long )pf->veb[(int )pf->lan_veb] != (unsigned long )((struct i40e_veb *)0)) { { i40e_veb_link_event(pf->veb[(int )pf->lan_veb], (int )new_link); } } else { { i40e_vsi_link_event(*(pf->vsi + (unsigned long )pf->lan_vsi), (int )new_link); } } if ((unsigned long )pf->vf != (unsigned long )((struct i40e_vf *)0)) { { i40e_vc_notify_link_state(pf); } } else { } if ((pf->flags & 33554432ULL) != 0ULL) { { i40e_ptp_set_increment(pf); } } else { } return; } } static void i40e_check_hang_subtask(struct i40e_pf *pf ) { int i ; int v ; int tmp ; struct i40e_vsi *vsi ; int armed ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; u16 vec ; u32 val ; { { tmp = constant_test_bit(1L, (unsigned long const volatile *)(& pf->state)); } if (tmp != 0) { return; } else { } v = 0; goto ldv_58293; ldv_58292: vsi = *(pf->vsi + (unsigned long )v); armed = 0; if ((unsigned long )*(pf->vsi + (unsigned long )v) == (unsigned long )((struct i40e_vsi *)0)) { goto ldv_58283; } else { { tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)(& vsi->state)); } if (tmp___0 != 0) { goto ldv_58283; } else if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { tmp___1 = netif_carrier_ok((struct net_device const *)vsi->netdev); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_58283; } else { } } else { } } i = 0; goto ldv_58285; ldv_58284: { set_bit(2L, (unsigned long volatile *)(& (*(vsi->tx_rings + (unsigned long )i))->state)); tmp___3 = constant_test_bit(3L, (unsigned long const volatile *)(& (*(vsi->tx_rings + (unsigned long )i))->state)); } if (tmp___3 != 0) { armed = armed + 1; } else { } i = i + 1; ldv_58285: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_58284; } else { } if (armed != 0) { if ((pf->flags & 8ULL) == 0ULL) { { writel(5U, (void volatile *)(vsi->back)->hw.hw_addr + 230528U); } } else { vec = (unsigned int )((u16 )vsi->base_vector) + 65535U; val = 5U; i = 0; goto ldv_58290; ldv_58289: { writel(val, (void volatile *)(vsi->back)->hw.hw_addr + (unsigned long )(((int )vec + 53760) * 4)); i = i + 1; vec = (u16 )((int )vec + 1); } ldv_58290: ; if (i < vsi->num_q_vectors) { goto ldv_58289; } else { } } { readl((void const volatile *)(vsi->back)->hw.hw_addr + 745772U); } } else { } ldv_58283: v = v + 1; ldv_58293: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_58292; } else { } return; } } static void i40e_watchdog_subtask(struct i40e_pf *pf ) { int i ; int tmp ; int tmp___0 ; { { tmp = constant_test_bit(3L, (unsigned long const volatile *)(& pf->state)); } if (tmp != 0) { return; } else { { tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 != 0) { return; } else { } } i = 0; goto ldv_58300; ldv_58299: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (unsigned long )(*(pf->vsi + (unsigned long )i))->netdev != (unsigned long )((struct net_device *)0)) { { i40e_update_stats(*(pf->vsi + (unsigned long )i)); } } else { } i = i + 1; ldv_58300: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58299; } else { } i = 0; goto ldv_58303; ldv_58302: ; if ((unsigned long )pf->veb[i] != (unsigned long )((struct i40e_veb *)0)) { { i40e_update_veb_stats(pf->veb[i]); } } else { } i = i + 1; ldv_58303: ; if (i <= 15) { goto ldv_58302; } else { } { i40e_ptp_rx_hang(*(pf->vsi + (unsigned long )pf->lan_vsi)); } return; } } static void i40e_reset_subtask(struct i40e_pf *pf ) { u32 reset_flags ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { { reset_flags = 0U; rtnl_lock(); tmp = constant_test_bit(11L, (unsigned long const volatile *)(& pf->state)); } if (tmp != 0) { { reset_flags = reset_flags | 2048U; clear_bit(11L, (unsigned long volatile *)(& pf->state)); } } else { } { tmp___0 = constant_test_bit(12L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 != 0) { { reset_flags = reset_flags | 4096U; clear_bit(12L, (unsigned long volatile *)(& pf->state)); } } else { } { tmp___1 = constant_test_bit(13L, (unsigned long const volatile *)(& pf->state)); } if (tmp___1 != 0) { { reset_flags = reset_flags | 8192U; clear_bit(13L, (unsigned long volatile *)(& pf->state)); } } else { } { tmp___2 = constant_test_bit(14L, (unsigned long const volatile *)(& pf->state)); } if (tmp___2 != 0) { { reset_flags = reset_flags | 16384U; clear_bit(14L, (unsigned long volatile *)(& pf->state)); } } else { } { tmp___3 = constant_test_bit(10L, (unsigned long const volatile *)(& pf->state)); } if (tmp___3 != 0) { { i40e_handle_reset_warning(pf); } goto unlock; } else { } if (reset_flags != 0U) { { tmp___4 = constant_test_bit(3L, (unsigned long const volatile *)(& pf->state)); } if (tmp___4 == 0) { { tmp___5 = constant_test_bit(1L, (unsigned long const volatile *)(& pf->state)); } if (tmp___5 == 0) { { i40e_do_reset(pf, reset_flags); } } else { } } else { } } else { } unlock: { rtnl_unlock(); } return; } } static void i40e_handle_link_event(struct i40e_pf *pf , struct i40e_arq_event_info *e ) { struct i40e_hw *hw ; struct i40e_aqc_get_link_status *status ; struct i40e_link_status *hw_link_info ; { { hw = & pf->hw; status = (struct i40e_aqc_get_link_status *)(& e->desc.params.raw); hw_link_info = & hw->phy.link_info; memcpy((void *)(& pf->hw.phy.link_info_old), (void const *)hw_link_info, 16UL); hw_link_info->phy_type = (enum i40e_aq_phy_type )status->phy_type; hw_link_info->link_speed = (enum i40e_aq_link_speed )status->link_speed; hw_link_info->link_info = status->link_info; hw_link_info->an_info = status->an_info; hw_link_info->ext_info = status->ext_info; hw_link_info->lse_enable = ((int )status->command_flags & 3) != 0; i40e_link_event(pf); i40e_aq_get_link_info(& pf->hw, 1, (struct i40e_link_status *)0, (struct i40e_asq_cmd_details *)0); i40e_link_event(pf); } return; } } static void i40e_clean_adminq_subtask(struct i40e_pf *pf ) { struct i40e_arq_event_info event ; struct i40e_hw *hw ; u16 pending ; u16 i ; i40e_status ret ; u16 opcode ; u32 val ; int tmp ; void *tmp___0 ; int tmp___1 ; int tmp___2 ; u16 tmp___3 ; { { hw = & pf->hw; i = 0U; tmp = constant_test_bit(6L, (unsigned long const volatile *)(& pf->state)); } if (tmp == 0) { return; } else { } { event.msg_size = 4096U; tmp___0 = kzalloc((size_t )event.msg_size, 208U); event.msg_buf = (u8 *)tmp___0; } if ((unsigned long )event.msg_buf == (unsigned long )((u8 *)0U)) { return; } else { } ldv_58335: { event.msg_size = 4096U; ret = i40e_clean_arq_element(hw, & event, & pending); } if ((int )ret == -57) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "No ARQ event found\n"); } goto ldv_58327; } else if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "ARQ event error %d\n", (int )ret); } goto ldv_58327; } else { } opcode = event.desc.opcode; { if ((int )opcode == 1543) { goto case_1543; } else { } if ((int )opcode == 2049) { goto case_2049; } else { } if ((int )opcode == 2561) { goto case_2561; } else { } if ((int )opcode == 4097) { goto case_4097; } else { } if ((int )opcode == 2051) { goto case_2051; } else { } goto switch_default; case_1543: /* CIL Label */ { i40e_handle_link_event(pf, & event); } goto ldv_58329; case_2049: /* CIL Label */ { tmp___1 = i40e_vc_process_vf_msg(pf, (int )event.desc.retval, event.desc.cookie_high, event.desc.cookie_low, event.msg_buf, (int )event.msg_size); ret = (i40e_status )tmp___1; } goto ldv_58329; case_2561: /* CIL Label */ { _dev_info((struct device const *)(& (pf->pdev)->dev), "ARQ: Update LLDP MIB event received\n"); rtnl_lock(); tmp___2 = i40e_handle_lldp_event(pf, & event); ret = (i40e_status )tmp___2; rtnl_unlock(); } goto ldv_58329; case_4097: /* CIL Label */ { _dev_info((struct device const *)(& (pf->pdev)->dev), "ARQ LAN queue overflow event received\n"); i40e_handle_lan_overflow_event(pf, & event); } goto ldv_58329; case_2051: /* CIL Label */ { _dev_info((struct device const *)(& (pf->pdev)->dev), "ARQ: Msg from other pf\n"); } goto ldv_58329; switch_default: /* CIL Label */ { _dev_info((struct device const *)(& (pf->pdev)->dev), "ARQ Error: Unknown event 0x%04x received\n", (int )opcode); } goto ldv_58329; switch_break: /* CIL Label */ ; } ldv_58329: ; if ((unsigned int )pending != 0U) { tmp___3 = i; i = (u16 )((int )i + 1); if ((int )tmp___3 < (int )pf->adminq_work_limit) { goto ldv_58335; } else { goto ldv_58327; } } else { } ldv_58327: { clear_bit(6L, (unsigned long volatile *)(& pf->state)); val = readl((void const volatile *)hw->hw_addr + 231424U); val = val | 1073741824U; writel(val, (void volatile *)hw->hw_addr + 231424U); readl((void const volatile *)hw->hw_addr + 745772U); kfree((void const *)event.msg_buf); } return; } } static int i40e_reconstitute_veb(struct i40e_veb *veb ) { struct i40e_vsi *ctl_vsi ; struct i40e_pf *pf ; int v ; int veb_idx ; int ret ; struct i40e_vsi *vsi ; { ctl_vsi = (struct i40e_vsi *)0; pf = veb->pf; v = 0; goto ldv_58346; ldv_58345: ; if (((unsigned long )*(pf->vsi + (unsigned long )v) != (unsigned long )((struct i40e_vsi *)0) && (int )(*(pf->vsi + (unsigned long )v))->veb_idx == (int )veb->idx) && ((*(pf->vsi + (unsigned long )v))->flags & 2UL) != 0UL) { ctl_vsi = *(pf->vsi + (unsigned long )v); goto ldv_58344; } else { } v = v + 1; ldv_58346: ; if ((u32 )v < pf->hw.func_caps.num_vsis && (unsigned long )ctl_vsi == (unsigned long )((struct i40e_vsi *)0)) { goto ldv_58345; } else { } ldv_58344: ; if ((unsigned long )ctl_vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "missing owner VSI for veb_idx %d\n", (int )veb->idx); ret = -2; } goto end_reconstitute; } else { } if ((unsigned long )ctl_vsi != (unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi)) { ctl_vsi->uplink_seid = (*(pf->vsi + (unsigned long )pf->lan_vsi))->uplink_seid; } else { } { ret = i40e_add_vsi(ctl_vsi); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "rebuild of owner VSI failed: %d\n", ret); } goto end_reconstitute; } else { } { i40e_vsi_reset_stats(ctl_vsi); ret = i40e_add_veb(veb, ctl_vsi); } if (ret != 0) { goto end_reconstitute; } else { } v = 0; goto ldv_58351; ldv_58350: ; if ((unsigned long )*(pf->vsi + (unsigned long )v) == (unsigned long )((struct i40e_vsi *)0) || (unsigned long )*(pf->vsi + (unsigned long )v) == (unsigned long )ctl_vsi) { goto ldv_58348; } else { } if ((int )(*(pf->vsi + (unsigned long )v))->veb_idx == (int )veb->idx) { { vsi = *(pf->vsi + (unsigned long )v); vsi->uplink_seid = veb->seid; ret = i40e_add_vsi(vsi); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "rebuild of vsi_idx %d failed: %d\n", v, ret); } goto end_reconstitute; } else { } { i40e_vsi_reset_stats(vsi); } } else { } ldv_58348: v = v + 1; ldv_58351: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_58350; } else { } veb_idx = 0; goto ldv_58355; ldv_58354: ; if ((unsigned long )pf->veb[veb_idx] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[veb_idx])->veb_idx == (int )veb->idx) { { (pf->veb[veb_idx])->uplink_seid = veb->seid; ret = i40e_reconstitute_veb(pf->veb[veb_idx]); } if (ret != 0) { goto ldv_58353; } else { } } else { } veb_idx = veb_idx + 1; ldv_58355: ; if (veb_idx <= 15) { goto ldv_58354; } else { } ldv_58353: ; end_reconstitute: ; return (ret); } } static int i40e_get_capabilities(struct i40e_pf *pf ) { struct i40e_aqc_list_capabilities_element_resp *cap_buf ; u16 data_size ; int buf_len ; int err ; void *tmp ; i40e_status tmp___0 ; { buf_len = 1280; ldv_58363: { tmp = kzalloc((size_t )buf_len, 208U); cap_buf = (struct i40e_aqc_list_capabilities_element_resp *)tmp; } if ((unsigned long )cap_buf == (unsigned long )((struct i40e_aqc_list_capabilities_element_resp *)0)) { return (-12); } else { } { tmp___0 = i40e_aq_discover_capabilities(& pf->hw, (void *)cap_buf, (int )((u16 )buf_len), & data_size, 10, (struct i40e_asq_cmd_details *)0); err = (int )tmp___0; kfree((void const *)cap_buf); } if ((unsigned int )pf->hw.aq.asq_last_status == 9U) { buf_len = (int )data_size; } else if ((unsigned int )pf->hw.aq.asq_last_status != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "capability discovery failed: aq=%d\n", (unsigned int )pf->hw.aq.asq_last_status); } return (-19); } else { } if (err != 0) { goto ldv_58363; } else { } pf->hw.func_caps.num_msix_vectors = pf->hw.func_caps.num_msix_vectors + 1U; if ((pf->hw.debug_mask & 4026531840U) != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "pf=%d, num_vfs=%d, msix_pf=%d, msix_vf=%d, fd_g=%d, fd_b=%d, pf_max_q=%d num_vsi=%d\n", (int )pf->hw.pf_id, pf->hw.func_caps.num_vfs, pf->hw.func_caps.num_msix_vectors, pf->hw.func_caps.num_msix_vectors_vf, pf->hw.func_caps.fd_filters_guaranteed, pf->hw.func_caps.fd_filters_best_effort, pf->hw.func_caps.num_tx_qp, pf->hw.func_caps.num_vsis); } } else { } if ((unsigned int )pf->hw.revision_id == 0U && ((u32 )pf->hw.func_caps.fcoe + pf->hw.func_caps.num_vfs) + 1U > pf->hw.func_caps.num_vsis) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "got num_vsis %d, setting num_vsis to %d\n", pf->hw.func_caps.num_vsis, ((u32 )pf->hw.func_caps.fcoe + pf->hw.func_caps.num_vfs) + 1U); pf->hw.func_caps.num_vsis = ((u32 )pf->hw.func_caps.fcoe + pf->hw.func_caps.num_vfs) + 1U; } } else { } return (0); } } static int i40e_vsi_clear(struct i40e_vsi *vsi ) ; static void i40e_fdir_sb_setup(struct i40e_pf *pf ) { struct i40e_vsi *vsi ; bool new_vsi ; int err ; int i ; char int_name[25U] ; char const *tmp ; { new_vsi = 0; if ((pf->flags & 2097152ULL) == 0ULL) { return; } else { } vsi = (struct i40e_vsi *)0; i = 0; goto ldv_58376; ldv_58375: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (unsigned int )(*(pf->vsi + (unsigned long )i))->type == 7U) { vsi = *(pf->vsi + (unsigned long )i); goto ldv_58374; } else { } i = i + 1; ldv_58376: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58375; } else { } ldv_58374: ; if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { vsi = i40e_vsi_setup(pf, 7, (int )(*(pf->vsi + (unsigned long )pf->lan_vsi))->seid, 0U); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Couldn\'t create FDir VSI\n"); } goto err_vsi; } else { } new_vsi = 1; } else { } { i40e_vsi_setup_irqhandler(vsi, & i40e_fdir_clean_ring); err = i40e_vsi_setup_tx_resources(vsi); } if (err != 0) { goto err_setup_tx; } else { } { err = i40e_vsi_setup_rx_resources(vsi); } if (err != 0) { goto err_setup_rx; } else { } if ((int )new_vsi) { { err = i40e_vsi_configure(vsi); } if (err != 0) { goto err_setup_rx; } else { } { tmp = dev_driver_string((struct device const *)(& (pf->pdev)->dev)); snprintf((char *)(& int_name), 24UL, "%s-fdir", tmp); err = i40e_vsi_request_irq(vsi, (char *)(& int_name)); } if (err != 0) { goto err_setup_rx; } else { } { err = i40e_up_complete(vsi); } if (err != 0) { goto err_up_complete; } else { } } else { } { clear_bit(4L, (unsigned long volatile *)(& vsi->state)); } return; err_up_complete: { i40e_down(vsi); i40e_vsi_free_irq(vsi); } err_setup_rx: { i40e_vsi_free_rx_resources(vsi); } err_setup_tx: { i40e_vsi_free_tx_resources(vsi); } err_vsi: { pf->flags = pf->flags & 0xffffffffffdfffffULL; i40e_vsi_clear(vsi); } return; } } static void i40e_fdir_teardown(struct i40e_pf *pf ) { int i ; { i = 0; goto ldv_58388; ldv_58387: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (unsigned int )(*(pf->vsi + (unsigned long )i))->type == 7U) { { i40e_vsi_release(*(pf->vsi + (unsigned long )i)); } goto ldv_58386; } else { } i = i + 1; ldv_58388: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58387; } else { } ldv_58386: ; return; } } static int i40e_prep_for_reset(struct i40e_pf *pf ) { struct i40e_hw *hw ; i40e_status ret ; u32 v ; int tmp ; bool tmp___0 ; { { hw = & pf->hw; clear_bit(10L, (unsigned long volatile *)(& pf->state)); tmp = test_and_set_bit(9L, (unsigned long volatile *)(& pf->state)); } if (tmp != 0) { return (0); } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "Tearing down internal switch for reset\n"); tmp___0 = i40e_check_asq_alive(hw); } if ((int )tmp___0) { { i40e_vc_notify_reset(pf); } } else { } { i40e_pf_quiesce_all_vsi(pf); v = 0U; } goto ldv_58396; ldv_58395: ; if ((unsigned long )*(pf->vsi + (unsigned long )v) != (unsigned long )((struct i40e_vsi *)0)) { (*(pf->vsi + (unsigned long )v))->seid = 0U; } else { } v = v + 1U; ldv_58396: ; if (v < pf->hw.func_caps.num_vsis) { goto ldv_58395; } else { } { i40e_shutdown_adminq(& pf->hw); ret = i40e_shutdown_lan_hmc(hw); } if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "shutdown_lan_hmc failed: %d\n", (int )ret); clear_bit(9L, (unsigned long volatile *)(& pf->state)); } } else { } return ((int )ret); } } static void i40e_reset_and_rebuild(struct i40e_pf *pf , bool reinit ) { struct i40e_driver_version dv ; struct i40e_hw *hw ; i40e_status ret ; u32 v ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { { hw = & pf->hw; ret = i40e_pf_reset(hw); } if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "PF reset failed, %d\n", (int )ret); } } else { } { pf->pfr_count = (u16 )((int )pf->pfr_count + 1); tmp = constant_test_bit(3L, (unsigned long const volatile *)(& pf->state)); } if (tmp != 0) { goto end_core_reset; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "Rebuilding internal switch\n"); ret = i40e_init_adminq(& pf->hw); } if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Rebuild AdminQ failed, %d\n", (int )ret); } goto end_core_reset; } else { } { tmp___0 = i40e_get_capabilities(pf); ret = (i40e_status )tmp___0; } if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "i40e_get_capabilities failed, %d\n", (int )ret); } goto end_core_reset; } else { } { ret = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, hw->func_caps.num_rx_qp, pf->fcoe_hmc_cntx_num, pf->fcoe_hmc_filt_num); } if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "init_lan_hmc failed: %d\n", (int )ret); } goto end_core_reset; } else { } { ret = i40e_configure_lan_hmc(hw, 1); } if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "configure_lan_hmc failed: %d\n", (int )ret); } goto end_core_reset; } else { } { tmp___1 = i40e_init_pf_dcb(pf); ret = (i40e_status )tmp___1; } if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "init_pf_dcb failed: %d\n", (int )ret); } goto end_core_reset; } else { } { tmp___2 = i40e_setup_pf_switch(pf, (int )reinit); ret = (i40e_status )tmp___2; } if ((int )ret != 0) { goto end_core_reset; } else { } if ((int )(*(pf->vsi + (unsigned long )pf->lan_vsi))->uplink_seid != (int )pf->mac_seid) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "attempting to rebuild switch\n"); v = 0U; } goto ldv_58410; ldv_58409: ; if ((unsigned long )pf->veb[v] == (unsigned long )((struct i40e_veb *)0)) { goto ldv_58407; } else { } if ((int )(pf->veb[v])->uplink_seid == (int )pf->mac_seid || (unsigned int )(pf->veb[v])->uplink_seid == 0U) { { tmp___3 = i40e_reconstitute_veb(pf->veb[v]); ret = (i40e_status )tmp___3; } if ((int )ret == 0) { goto ldv_58407; } else { } if ((int )(pf->veb[v])->uplink_seid == (int )pf->mac_seid) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "rebuild of switch failed: %d, will try to set up simple PF connection\n", (int )ret); (*(pf->vsi + (unsigned long )pf->lan_vsi))->uplink_seid = pf->mac_seid; } goto ldv_58408; } else if ((unsigned int )(pf->veb[v])->uplink_seid == 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "rebuild of orphan VEB failed: %d\n", (int )ret); } } else { } } else { } ldv_58407: v = v + 1U; ldv_58410: ; if (v <= 15U) { goto ldv_58409; } else { } ldv_58408: ; } else { } if ((int )(*(pf->vsi + (unsigned long )pf->lan_vsi))->uplink_seid == (int )pf->mac_seid) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "attempting to rebuild PF VSI\n"); tmp___4 = i40e_add_vsi(*(pf->vsi + (unsigned long )pf->lan_vsi)); ret = (i40e_status )tmp___4; } if ((int )ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "rebuild of Main VSI failed: %d\n", (int )ret); } goto end_core_reset; } else { } } else { } if ((pf->flags & 8ULL) != 0ULL) { { tmp___5 = i40e_setup_misc_vector(pf); ret = (i40e_status )tmp___5; } } else { } { i40e_pf_unquiesce_all_vsi(pf); dv.major_version = 0U; dv.minor_version = 3U; dv.build_version = 30U; dv.subbuild_version = 0U; i40e_aq_send_driver_version(& pf->hw, & dv, (struct i40e_asq_cmd_details *)0); _dev_info((struct device const *)(& (pf->pdev)->dev), "PF reset done\n"); } end_core_reset: { clear_bit(9L, (unsigned long volatile *)(& pf->state)); } return; } } static void i40e_handle_reset_warning(struct i40e_pf *pf ) { i40e_status ret ; int tmp ; { { tmp = i40e_prep_for_reset(pf); ret = (i40e_status )tmp; } if ((int )ret == 0) { { i40e_reset_and_rebuild(pf, 0); } } else { } return; } } static void i40e_handle_mdd_event(struct i40e_pf *pf ) { struct i40e_hw *hw ; bool mdd_detected ; struct i40e_vf *vf ; u32 reg ; int i ; int tmp ; u8 func ; u8 event ; u8 queue ; u8 func___0 ; u8 event___0 ; u8 queue___0 ; { { hw = & pf->hw; mdd_detected = 0; tmp = constant_test_bit(7L, (unsigned long const volatile *)(& pf->state)); } if (tmp == 0) { return; } else { } { reg = readl((void const volatile *)hw->hw_addr + 943232U); } if ((int )reg < 0) { { func = (u8 )reg; event = 0U; queue = (u8 )((reg & 2147352576U) >> 17); _dev_info((struct device const *)(& (pf->pdev)->dev), "Malicious Driver Detection TX event 0x%02x on q %d of function 0x%02x\n", (int )event, (int )queue, (int )func); writel(4294967295U, (void volatile *)hw->hw_addr + 943232U); mdd_detected = 1; } } else { } { reg = readl((void const volatile *)hw->hw_addr + 1221904U); } if ((int )reg < 0) { { func___0 = (u8 )reg; event___0 = 0U; queue___0 = (u8 )((reg & 2147352576U) >> 17); _dev_info((struct device const *)(& (pf->pdev)->dev), "Malicious Driver Detection RX event 0x%02x on q %d of function 0x%02x\n", (int )event___0, (int )queue___0, (int )func___0); writel(4294967295U, (void volatile *)hw->hw_addr + 1221904U); mdd_detected = 1; } } else { } i = 0; goto ldv_58430; ldv_58429: { vf = pf->vf + (unsigned long )i; reg = readl((void const volatile *)hw->hw_addr + (unsigned long )((i + 235520) * 4)); } if ((int )reg & 1) { { writel(65535U, (void volatile *)hw->hw_addr + (unsigned long )((i + 235520) * 4)); vf->num_mdd_events = vf->num_mdd_events + 1ULL; _dev_info((struct device const *)(& (pf->pdev)->dev), "MDD TX event on VF %d\n", i); } } else { } { reg = readl((void const volatile *)hw->hw_addr + (unsigned long )((i + 305152) * 4)); } if ((int )reg & 1) { { writel(65535U, (void volatile *)hw->hw_addr + (unsigned long )((i + 305152) * 4)); vf->num_mdd_events = vf->num_mdd_events + 1ULL; _dev_info((struct device const *)(& (pf->pdev)->dev), "MDD RX event on VF %d\n", i); } } else { } if (vf->num_mdd_events > 3ULL) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Too many MDD events on VF %d, disabled\n", i); _dev_info((struct device const *)(& (pf->pdev)->dev), "Use PF Control I/F to re-enable the VF\n"); set_bit(3L, (unsigned long volatile *)(& vf->vf_states)); } } else { } i = i + 1; ldv_58430: ; if (i < pf->num_alloc_vfs && (int )mdd_detected) { goto ldv_58429; } else { } { clear_bit(7L, (unsigned long volatile *)(& pf->state)); reg = readl((void const volatile *)hw->hw_addr + 231424U); reg = reg | 524288U; writel(reg, (void volatile *)hw->hw_addr + 231424U); readl((void const volatile *)hw->hw_addr + 745772U); } return; } } static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf ) { int vxlan_hdr_qwords ; struct i40e_hw *hw ; i40e_status ret ; u8 filter_index ; __be16 port ; int i ; __u16 tmp ; i40e_status tmp___0 ; i40e_status tmp___1 ; __u16 tmp___2 ; __u16 tmp___3 ; { vxlan_hdr_qwords = 4; hw = & pf->hw; if ((pf->flags & 134217728ULL) == 0ULL) { return; } else { } pf->flags = pf->flags & 0xfffffffff7ffffffULL; i = 0; goto ldv_58442; ldv_58441: ; if (((int )pf->pending_vxlan_bitmap >> i) & 1) { pf->pending_vxlan_bitmap = (u16 )((int )((short )pf->pending_vxlan_bitmap) & ~ ((int )((short )(1 << i)))); port = pf->vxlan_ports[i]; if ((unsigned int )port != 0U) { { tmp = __fswab16((int )port); tmp___0 = i40e_aq_add_udp_tunnel(hw, (int )tmp, (int )((u8 )vxlan_hdr_qwords), 0, & filter_index, (struct i40e_asq_cmd_details *)0); ret = tmp___0; } } else { { tmp___1 = i40e_aq_del_udp_tunnel(hw, (int )((u8 )i), (struct i40e_asq_cmd_details *)0); ret = tmp___1; } } if ((int )ret != 0) { { tmp___2 = __fswab16((int )port); _dev_info((struct device const *)(& (pf->pdev)->dev), "Failed to execute AQ command for %s port %d with index %d\n", (unsigned int )port != 0U ? (char *)"adding" : (char *)"deleting", (int )tmp___2, i); pf->vxlan_ports[i] = 0U; } } else { { tmp___3 = __fswab16((int )port); _dev_info((struct device const *)(& (pf->pdev)->dev), "%s port %d with AQ command with index %d\n", (unsigned int )port != 0U ? (char *)"Added" : (char *)"Deleted", (int )tmp___3, (unsigned int )port != 0U ? i : (int )filter_index); } } } else { } i = i + 1; ldv_58442: ; if (i <= 15) { goto ldv_58441; } else { } return; } } static void i40e_service_task(struct work_struct *work ) { struct i40e_pf *pf ; struct work_struct const *__mptr ; unsigned long start_time ; int tmp ; int tmp___0 ; int tmp___1 ; { { __mptr = (struct work_struct const *)work; pf = (struct i40e_pf *)__mptr + 0xfffffffffffff910UL; start_time = jiffies; i40e_reset_subtask(pf); i40e_handle_mdd_event(pf); i40e_vc_process_vflr_event(pf); i40e_watchdog_subtask(pf); i40e_fdir_reinit_subtask(pf); i40e_check_hang_subtask(pf); i40e_sync_filters_subtask(pf); i40e_sync_vxlan_filters_subtask(pf); i40e_clean_adminq_subtask(pf); i40e_service_event_complete(pf); } if ((long )((start_time + (unsigned long )pf->service_timer_period) - (unsigned long )jiffies) < 0L) { { i40e_service_event_schedule(pf); } } else { { tmp = constant_test_bit(6L, (unsigned long const volatile *)(& pf->state)); } if (tmp != 0) { { i40e_service_event_schedule(pf); } } else { { tmp___0 = constant_test_bit(7L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 != 0) { { i40e_service_event_schedule(pf); } } else { { tmp___1 = constant_test_bit(8L, (unsigned long const volatile *)(& pf->state)); } if (tmp___1 != 0) { { i40e_service_event_schedule(pf); } } else { } } } } return; } } static void i40e_service_timer(unsigned long data ) { struct i40e_pf *pf ; unsigned long tmp ; { { pf = (struct i40e_pf *)data; tmp = round_jiffies((unsigned long )jiffies + (unsigned long )pf->service_timer_period); ldv_mod_timer_16(& pf->service_timer, tmp); i40e_service_event_schedule(pf); } return; } } static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; int __ret_warn_on ; long tmp ; { pf = vsi->back; { if ((unsigned int )vsi->type == 0U) { goto case_0; } else { } if ((unsigned int )vsi->type == 7U) { goto case_7; } else { } if ((unsigned int )vsi->type == 2U) { goto case_2; } else { } if ((unsigned int )vsi->type == 6U) { goto case_6; } else { } goto switch_default; case_0: /* CIL Label */ vsi->alloc_queue_pairs = pf->num_lan_qps; vsi->num_desc = 512U; if ((pf->flags & 8ULL) != 0ULL) { vsi->num_q_vectors = (int )pf->num_lan_msix; } else { vsi->num_q_vectors = 1; } goto ldv_58466; case_7: /* CIL Label */ vsi->alloc_queue_pairs = 1U; vsi->num_desc = 32U; vsi->num_q_vectors = 1; goto ldv_58466; case_2: /* CIL Label */ vsi->alloc_queue_pairs = pf->num_vmdq_qps; vsi->num_desc = 512U; vsi->num_q_vectors = (int )pf->num_vmdq_msix; goto ldv_58466; case_6: /* CIL Label */ vsi->alloc_queue_pairs = pf->num_vf_qps; vsi->num_desc = 512U; goto ldv_58466; switch_default: /* CIL Label */ { __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp != 0L) { { warn_slowpath_null("drivers/net/ethernet/intel/i40e/i40e_main.c", 5580); } } else { } { ldv__builtin_expect(__ret_warn_on != 0, 0L); } return (-61); switch_break: /* CIL Label */ ; } ldv_58466: ; return (0); } } static int i40e_vsi_alloc_arrays(struct i40e_vsi *vsi , bool alloc_qvectors ) { int size ; int ret ; void *tmp ; void *tmp___0 ; { { ret = 0; size = (int )((unsigned int )vsi->alloc_queue_pairs * 16U); tmp = kzalloc((size_t )size, 208U); vsi->tx_rings = (struct i40e_ring **)tmp; } if ((unsigned long )vsi->tx_rings == (unsigned long )((struct i40e_ring **)0)) { return (-12); } else { } vsi->rx_rings = vsi->tx_rings + (unsigned long )vsi->alloc_queue_pairs; if ((int )alloc_qvectors) { { size = (int )((unsigned int )vsi->num_q_vectors * 8U); tmp___0 = kzalloc((size_t )size, 208U); vsi->q_vectors = (struct i40e_q_vector **)tmp___0; } if ((unsigned long )vsi->q_vectors == (unsigned long )((struct i40e_q_vector **)0)) { ret = -12; goto err_vectors; } else { } } else { } return (ret); err_vectors: { kfree((void const *)vsi->tx_rings); } return (ret); } } static int i40e_vsi_mem_alloc(struct i40e_pf *pf , enum i40e_vsi_type type ) { int ret ; struct i40e_vsi *vsi ; int vsi_idx ; int i ; void *tmp ; { { ret = -19; mutex_lock_nested(& pf->switch_mutex, 0U); i = (int )pf->next_vsi; } goto ldv_58490; ldv_58489: i = i + 1; ldv_58490: ; if ((u32 )i < pf->hw.func_caps.num_vsis && (unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0)) { goto ldv_58489; } else { } if ((u32 )i >= pf->hw.func_caps.num_vsis) { i = 0; goto ldv_58493; ldv_58492: i = i + 1; ldv_58493: ; if (i < (int )pf->next_vsi && (unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0)) { goto ldv_58492; } else { } } else { } if ((u32 )i < pf->hw.func_caps.num_vsis && (unsigned long )*(pf->vsi + (unsigned long )i) == (unsigned long )((struct i40e_vsi *)0)) { vsi_idx = i; } else { ret = -19; goto unlock_pf; } { i = i + 1; pf->next_vsi = (u16 )i; tmp = kzalloc(4096UL, 208U); vsi = (struct i40e_vsi *)tmp; } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { ret = -12; goto unlock_pf; } else { } { vsi->type = type; vsi->back = pf; set_bit(3L, (unsigned long volatile *)(& vsi->state)); vsi->flags = 0UL; vsi->idx = (u16 )vsi_idx; vsi->rx_itr_setting = pf->rx_itr_default; vsi->tx_itr_setting = pf->tx_itr_default; vsi->netdev_registered = 0; vsi->work_limit = 256U; INIT_LIST_HEAD(& vsi->mac_filter_list); ret = i40e_set_num_rings_in_vsi(vsi); } if (ret != 0) { goto err_rings; } else { } { ret = i40e_vsi_alloc_arrays(vsi, 1); } if (ret != 0) { goto err_rings; } else { } { i40e_vsi_setup_irqhandler(vsi, & i40e_msix_clean_rings); *(pf->vsi + (unsigned long )vsi_idx) = vsi; ret = vsi_idx; } goto unlock_pf; err_rings: { pf->next_vsi = (unsigned int )((u16 )i) + 65535U; kfree((void const *)vsi); } unlock_pf: { mutex_unlock(& pf->switch_mutex); } return (ret); } } static void i40e_vsi_free_arrays(struct i40e_vsi *vsi , bool free_qvectors ) { { if ((int )free_qvectors) { { kfree((void const *)vsi->q_vectors); vsi->q_vectors = (struct i40e_q_vector **)0; } } else { } { kfree((void const *)vsi->tx_rings); vsi->tx_rings = (struct i40e_ring **)0; vsi->rx_rings = (struct i40e_ring **)0; } return; } } static int i40e_vsi_clear(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; { if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { return (0); } else { } if ((unsigned long )vsi->back == (unsigned long )((struct i40e_pf *)0)) { goto free_vsi; } else { } { pf = vsi->back; mutex_lock_nested(& pf->switch_mutex, 0U); } if ((unsigned long )*(pf->vsi + (unsigned long )vsi->idx) == (unsigned long )((struct i40e_vsi *)0)) { { dev_err((struct device const *)(& (pf->pdev)->dev), "pf->vsi[%d] is NULL, just free vsi[%d](%p,type %d)\n", (int )vsi->idx, (int )vsi->idx, vsi, (unsigned int )vsi->type); } goto unlock_vsi; } else { } if ((unsigned long )*(pf->vsi + (unsigned long )vsi->idx) != (unsigned long )vsi) { { dev_err((struct device const *)(& (pf->pdev)->dev), "pf->vsi[%d](%p, type %d) != vsi[%d](%p,type %d): no free!\n", (int )(*(pf->vsi + (unsigned long )vsi->idx))->idx, *(pf->vsi + (unsigned long )vsi->idx), (unsigned int )(*(pf->vsi + (unsigned long )vsi->idx))->type, (int )vsi->idx, vsi, (unsigned int )vsi->type); } goto unlock_vsi; } else { } { i40e_put_lump(pf->qp_pile, (int )vsi->base_queue, (int )vsi->idx); i40e_put_lump(pf->irq_pile, (int )((u16 )vsi->base_vector), (int )vsi->idx); i40e_vsi_free_arrays(vsi, 1); *(pf->vsi + (unsigned long )vsi->idx) = (struct i40e_vsi *)0; } if ((int )vsi->idx < (int )pf->next_vsi) { pf->next_vsi = vsi->idx; } else { } unlock_vsi: { mutex_unlock(& pf->switch_mutex); } free_vsi: { kfree((void const *)vsi); } return (0); } } extern void __compiletime_assert_5783(void) ; static void i40e_vsi_clear_rings(struct i40e_vsi *vsi ) { int i ; bool __cond ; { if ((unsigned long )vsi->tx_rings != (unsigned long )((struct i40e_ring **)0) && (unsigned long )*(vsi->tx_rings) != (unsigned long )((struct i40e_ring *)0)) { i = 0; goto ldv_58517; ldv_58516: __cond = 0; if ((int )__cond) { { __compiletime_assert_5783(); } } else { } { kfree_call_rcu(& (*(vsi->tx_rings + (unsigned long )i))->rcu, (void (*)(struct callback_head * ))168); *(vsi->tx_rings + (unsigned long )i) = (struct i40e_ring *)0; *(vsi->rx_rings + (unsigned long )i) = (struct i40e_ring *)0; i = i + 1; } ldv_58517: ; if (i < (int )vsi->alloc_queue_pairs) { goto ldv_58516; } else { } } else { } return; } } static int i40e_alloc_rings(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; int i ; struct i40e_ring *tx_ring ; struct i40e_ring *rx_ring ; void *tmp ; { pf = vsi->back; i = 0; goto ldv_58528; ldv_58527: { tmp = kzalloc(8192UL, 208U); tx_ring = (struct i40e_ring *)tmp; } if ((unsigned long )tx_ring == (unsigned long )((struct i40e_ring *)0)) { goto err_out; } else { } tx_ring->queue_index = (u16 )i; tx_ring->reg_idx = (int )vsi->base_queue + (int )((u16 )i); tx_ring->ring_active = 0; tx_ring->vsi = vsi; tx_ring->netdev = vsi->netdev; tx_ring->dev = & (pf->pdev)->dev; tx_ring->count = vsi->num_desc; tx_ring->size = 0U; tx_ring->dcb_tc = 0U; *(vsi->tx_rings + (unsigned long )i) = tx_ring; rx_ring = tx_ring + 1UL; rx_ring->queue_index = (u16 )i; rx_ring->reg_idx = (int )vsi->base_queue + (int )((u16 )i); rx_ring->ring_active = 0; rx_ring->vsi = vsi; rx_ring->netdev = vsi->netdev; rx_ring->dev = & (pf->pdev)->dev; rx_ring->count = vsi->num_desc; rx_ring->size = 0U; rx_ring->dcb_tc = 0U; if ((pf->flags & 8192ULL) != 0ULL) { { set_bit(6L, (unsigned long volatile *)(& rx_ring->state)); } } else { { clear_bit(6L, (unsigned long volatile *)(& rx_ring->state)); } } *(vsi->rx_rings + (unsigned long )i) = rx_ring; i = i + 1; ldv_58528: ; if (i < (int )vsi->alloc_queue_pairs) { goto ldv_58527; } else { } return (0); err_out: { i40e_vsi_clear_rings(vsi); } return (-12); } } static int i40e_reserve_msix_vectors(struct i40e_pf *pf , int vectors ) { int err ; { err = 0; pf->num_msix_entries = 0U; goto ldv_58537; ldv_58536: { err = pci_enable_msix(pf->pdev, pf->msix_entries, vectors); } if (err == 0) { pf->num_msix_entries = (u16 )vectors; goto ldv_58535; } else if (err < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "MSI-X vector reservation failed: %d\n", err); vectors = 0; } goto ldv_58535; } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "MSI-X vectors wanted %d, retrying with %d\n", vectors, err); vectors = err; } } ldv_58537: ; if (vectors > 1) { goto ldv_58536; } else { } ldv_58535: ; if (vectors == 1) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Couldn\'t get enough vectors, only %d available\n", vectors); vectors = 0; } } else { } return (vectors); } } static int i40e_init_msix(struct i40e_pf *pf ) { i40e_status err ; struct i40e_hw *hw ; int v_budget ; int i ; int vec ; int __min1 ; int __min2 ; void *tmp ; int __min1___0 ; int __min2___0 ; int __min1___1 ; int __min2___1 ; { err = 0; hw = & pf->hw; if ((pf->flags & 8ULL) == 0ULL) { return (-19); } else { } pf->num_lan_msix = (int )pf->num_lan_qps + ((int )pf->rss_size - (int )pf->rss_size_max); pf->num_vmdq_msix = pf->num_vmdq_qps; v_budget = (int )pf->num_lan_msix + 1; v_budget = v_budget + (int )pf->num_vmdq_vsis * (int )pf->num_vmdq_msix; if ((pf->flags & 2097152ULL) != 0ULL) { v_budget = v_budget + 1; } else { } { __min1 = v_budget; __min2 = (int )hw->func_caps.num_msix_vectors; v_budget = __min1 < __min2 ? __min1 : __min2; tmp = kcalloc((size_t )v_budget, 8UL, 208U); pf->msix_entries = (struct msix_entry *)tmp; } if ((unsigned long )pf->msix_entries == (unsigned long )((struct msix_entry *)0)) { return (-12); } else { } i = 0; goto ldv_58550; ldv_58549: (pf->msix_entries + (unsigned long )i)->entry = (u16 )i; i = i + 1; ldv_58550: ; if (i < v_budget) { goto ldv_58549; } else { } { vec = i40e_reserve_msix_vectors(pf, v_budget); } if (vec <= 1) { { pf->flags = pf->flags & 0xfffffffffffffff7ULL; kfree((void const *)pf->msix_entries); pf->msix_entries = (struct msix_entry *)0; } return (-19); } else if (vec == 2) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Features disabled, not enough MSIX vectors\n"); pf->flags = pf->flags & 0xffffffffffffff7fULL; pf->num_vmdq_vsis = 0U; pf->num_vmdq_qps = 0U; pf->num_vmdq_msix = 0U; pf->num_lan_qps = 1U; pf->num_lan_msix = 1U; } } else if (vec != v_budget) { pf->num_vmdq_msix = 1U; vec = vec - 1; { if (vec == 2) { goto case_2; } else { } if (vec == 3) { goto case_3; } else { } goto switch_default; case_2: /* CIL Label */ pf->num_vmdq_vsis = 1U; pf->num_lan_msix = 1U; goto ldv_58553; case_3: /* CIL Label */ pf->num_vmdq_vsis = 1U; pf->num_lan_msix = 2U; goto ldv_58553; switch_default: /* CIL Label */ __min1___0 = vec / 2; __min2___0 = (int )pf->num_lan_qps; pf->num_lan_msix = (u16 )(__min1___0 < __min2___0 ? __min1___0 : __min2___0); __min1___1 = vec - (int )pf->num_lan_msix; __min2___1 = 8; pf->num_vmdq_vsis = (u16 )(__min1___1 < __min2___1 ? __min1___1 : __min2___1); goto ldv_58553; switch_break: /* CIL Label */ ; } ldv_58553: ; } else { } return ((int )err); } } static int i40e_alloc_q_vector(struct i40e_vsi *vsi , int v_idx ) { struct i40e_q_vector *q_vector ; void *tmp ; { { tmp = kzalloc(4096UL, 208U); q_vector = (struct i40e_q_vector *)tmp; } if ((unsigned long )q_vector == (unsigned long )((struct i40e_q_vector *)0)) { return (-12); } else { } { q_vector->vsi = vsi; q_vector->v_idx = (u16 )v_idx; cpumask_set_cpu((unsigned int )v_idx, & q_vector->affinity_mask); } if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { netif_napi_add(vsi->netdev, & q_vector->napi, & i40e_napi_poll, (int )vsi->work_limit); } } else { } q_vector->rx.latency_range = 1; q_vector->tx.latency_range = 1; *(vsi->q_vectors + (unsigned long )v_idx) = q_vector; return (0); } } static int i40e_alloc_q_vectors(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; int v_idx ; int num_q_vectors ; int err ; int tmp ; { pf = vsi->back; if ((pf->flags & 8ULL) != 0ULL) { num_q_vectors = vsi->num_q_vectors; } else if ((unsigned long )vsi == (unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi)) { num_q_vectors = 1; } else { return (-22); } v_idx = 0; goto ldv_58576; ldv_58575: { err = i40e_alloc_q_vector(vsi, v_idx); } if (err != 0) { goto err_out; } else { } v_idx = v_idx + 1; ldv_58576: ; if (v_idx < num_q_vectors) { goto ldv_58575; } else { } return (0); err_out: ; goto ldv_58579; ldv_58578: { i40e_free_q_vector(vsi, v_idx); } ldv_58579: tmp = v_idx; v_idx = v_idx - 1; if (tmp != 0) { goto ldv_58578; } else { } return (err); } } static void i40e_init_interrupt_scheme(struct i40e_pf *pf ) { int err ; { err = 0; if ((pf->flags & 8ULL) != 0ULL) { { err = i40e_init_msix(pf); } if (err != 0) { { pf->flags = pf->flags & 0xffffffffff87ff37ULL; i40e_determine_queue_usage(pf); } } else { } } else { } if (*((unsigned long *)pf + 232UL) == 4UL) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "MSIX not available, trying MSI\n"); err = pci_enable_msi_block(pf->pdev, 1); } if (err != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "MSI init failed - %d\n", err); pf->flags = pf->flags & 0xfffffffffffffffbULL; } } else { } } else { } if ((pf->flags & 12ULL) == 0ULL) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "MSIX and MSI not available, falling back to Legacy IRQ\n"); } } else { } { err = i40e_get_lump(pf, pf->irq_pile, 1, 32767); } return; } } static int i40e_setup_misc_vector(struct i40e_pf *pf ) { struct i40e_hw *hw ; int err ; int tmp ; { { hw = & pf->hw; err = 0; tmp = constant_test_bit(9L, (unsigned long const volatile *)(& pf->state)); } if (tmp == 0) { { err = ldv_request_irq_17((pf->msix_entries)->vector, & i40e_intr, 0UL, (char const *)(& pf->misc_int_name), (void *)pf); } if (err != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "request_irq for msix_misc failed: %d\n", err); } return (-14); } else { } } else { } { i40e_enable_misc_int_causes(hw); writel(2047U, (void volatile *)hw->hw_addr + 230656U); writel(62U, (void volatile *)hw->hw_addr + 229376U); readl((void const volatile *)hw->hw_addr + 745772U); i40e_irq_dynamic_enable_icr0(pf); } return (err); } } static int i40e_config_rss(struct i40e_pf *pf ) { u32 seed[13U] ; struct i40e_hw *hw ; u32 lut ; int i ; int j ; u64 hena ; unsigned int tmp ; unsigned int tmp___0 ; { seed[0] = 1102059143U; seed[1] = 406650252U; seed[2] = 3465020480U; seed[3] = 1477229628U; seed[4] = 898200439U; seed[5] = 847980001U; seed[6] = 1336510754U; seed[7] = 3084454932U; seed[8] = 3585791757U; seed[9] = 3440747201U; seed[10] = 3898081829U; seed[11] = 1243520273U; seed[12] = 4267127230U; hw = & pf->hw; lut = 0U; i = 0; goto ldv_58600; ldv_58599: { writel(seed[i], (void volatile *)hw->hw_addr + (unsigned long )((i + 18576) * 128)); i = i + 1; } ldv_58600: ; if (i <= 12) { goto ldv_58599; } else { } { tmp = readl((void const volatile *)hw->hw_addr + 2382080U); tmp___0 = readl((void const volatile *)hw->hw_addr + 2382208U); hena = (unsigned long long )tmp | ((unsigned long long )tmp___0 << 32); hena = hena | 0x80007f9fe0000000ULL; writel((unsigned int )hena, (void volatile *)hw->hw_addr + 2382080U); writel((unsigned int )(hena >> 32), (void volatile *)hw->hw_addr + 2382208U); i = 0; j = 0; } goto ldv_58603; ldv_58602: ; if (j == (int )pf->rss_size) { j = 0; } else { } lut = (lut << 8) | (u32 )(j & ((1 << (int )pf->hw.func_caps.rss_table_entry_width) + -1)); if ((i & 3) == 3) { { writel(lut, (void volatile *)hw->hw_addr + (unsigned long )(((i >> 2) + 18432) * 128)); } } else { } i = i + 1; j = j + 1; ldv_58603: ; if ((u32 )i < pf->hw.func_caps.rss_table_size) { goto ldv_58602; } else { } { readl((void const volatile *)hw->hw_addr + 745772U); } return (0); } } int i40e_reconfig_rss_queues(struct i40e_pf *pf , int queue_count ) { int __min1 ; int __min2 ; unsigned long tmp___67 ; { if ((pf->flags & 64ULL) == 0ULL) { return (0); } else { } { __min1 = queue_count; __min2 = (int )pf->rss_size_max; queue_count = __min1 < __min2 ? __min1 : __min2; tmp___67 = __rounddown_pow_of_two((unsigned long )queue_count); queue_count = (int )tmp___67; } if (queue_count != (int )pf->rss_size) { { i40e_prep_for_reset(pf); pf->rss_size = (u16 )queue_count; i40e_reset_and_rebuild(pf, 1); i40e_config_rss(pf); } } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "RSS count: %d\n", (int )pf->rss_size); } return ((int )pf->rss_size); } } static int i40e_sw_init(struct i40e_pf *pf ) { int err ; int size ; u32 tmp ; u32 tmp___0 ; int __min1 ; int __min2 ; int __min1___0 ; int __min2___0 ; unsigned int tmp___1 ; unsigned long tmp___69 ; int __min1___1 ; int __min2___1 ; void *tmp___70 ; void *tmp___71 ; struct lock_class_key __key ; { { err = 0; tmp = netif_msg_init(4, 7); pf->msg_enable = (u16 )tmp; pf->hw.debug_mask = (unsigned int )pf->msg_enable | 2048U; } if (debug != -1 && debug != 4) { if (((unsigned int )debug & 4026531840U) != 0U) { pf->hw.debug_mask = (u32 )debug; } else { } { tmp___0 = netif_msg_init(debug & 268435455, 4); pf->msg_enable = (u16 )tmp___0; } } else { } pf->flags = 30ULL; pf->rss_size_max = (u16 )(1 << (int )pf->hw.func_caps.rss_table_entry_width); __min1 = (int )pf->rss_size_max; __min2 = (int )pf->hw.func_caps.num_tx_qp; pf->rss_size_max = (u16 )(__min1 < __min2 ? __min1 : __min2); if ((int )pf->hw.func_caps.rss) { { pf->flags = pf->flags | 64ULL; __min1___0 = (int )pf->rss_size_max; tmp___1 = cpumask_weight(cpu_online_mask); __min2___0 = (int )tmp___1; pf->rss_size = (u16 )(__min1___0 < __min2___0 ? __min1___0 : __min2___0); tmp___69 = __rounddown_pow_of_two((unsigned long )pf->rss_size); pf->rss_size = (u16 )tmp___69; } } else { pf->rss_size = 1U; } if (pf->hw.func_caps.npar_enable != 0U || (int )pf->hw.func_caps.mfp_mode_1) { { pf->flags = pf->flags | 67108864ULL; _dev_info((struct device const *)(& (pf->pdev)->dev), "MFP mode Enabled\n"); } } else { } if (*((unsigned long *)pf + 48UL) != 0UL) { { pf->flags = pf->flags | 4194304ULL; pf->atr_sample_rate = 20U; _dev_info((struct device const *)(& (pf->pdev)->dev), "Flow Director ATR mode Enabled\n"); } if ((pf->flags & 67108864ULL) == 0ULL) { { pf->flags = pf->flags | 2097152ULL; _dev_info((struct device const *)(& (pf->pdev)->dev), "Flow Director Side Band mode Enabled\n"); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Flow Director Side Band mode Disabled in MFP mode\n"); } } pf->fdir_pf_filter_count = (u16 )pf->hw.func_caps.fd_filters_guaranteed; pf->hw.fdir_shared_filter_count = (u16 )pf->hw.func_caps.fd_filters_best_effort; } else { } if ((int )pf->hw.func_caps.vmdq) { pf->flags = pf->flags | 128ULL; pf->num_vmdq_vsis = 8U; pf->num_vmdq_qps = 2U; } else { } if (pf->hw.func_caps.num_vfs != 0U) { { pf->num_vf_qps = 4U; pf->flags = pf->flags | 524288ULL; __min1___1 = (int )pf->hw.func_caps.num_vfs; __min2___1 = 128; pf->num_req_vfs = (u16 )(__min1___1 < __min2___1 ? __min1___1 : __min2___1); _dev_info((struct device const *)(& (pf->pdev)->dev), "Number of VFs being requested for PF[%d] = %d\n", (int )pf->hw.pf_id, (int )pf->num_req_vfs); } } else { } { pf->eeprom_version = 57005U; pf->lan_veb = 65535U; pf->lan_vsi = 65535U; size = (int )((unsigned int )((unsigned long )pf->hw.func_caps.num_tx_qp + 2UL) * 2U); tmp___70 = kzalloc((size_t )size, 208U); pf->qp_pile = (struct i40e_lump_tracking *)tmp___70; } if ((unsigned long )pf->qp_pile == (unsigned long )((struct i40e_lump_tracking *)0)) { err = -12; goto sw_init_done; } else { } { (pf->qp_pile)->num_entries = (u16 )pf->hw.func_caps.num_tx_qp; (pf->qp_pile)->search_hint = 0U; size = (int )((unsigned int )((unsigned long )pf->hw.func_caps.num_msix_vectors + 2UL) * 2U); tmp___71 = kzalloc((size_t )size, 208U); pf->irq_pile = (struct i40e_lump_tracking *)tmp___71; } if ((unsigned long )pf->irq_pile == (unsigned long )((struct i40e_lump_tracking *)0)) { { kfree((void const *)pf->qp_pile); err = -12; } goto sw_init_done; } else { } { (pf->irq_pile)->num_entries = (u16 )pf->hw.func_caps.num_msix_vectors; (pf->irq_pile)->search_hint = 0U; __mutex_init(& pf->switch_mutex, "&pf->switch_mutex", & __key); } sw_init_done: ; return (err); } } static int i40e_set_features(struct net_device *netdev , netdev_features_t features ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; } if ((features & 256ULL) != 0ULL) { { i40e_vlan_stripping_enable(vsi); } } else { { i40e_vlan_stripping_disable(vsi); } } return (0); } } static u8 i40e_get_vxlan_port_idx(struct i40e_pf *pf , __be16 port ) { u8 i ; { i = 0U; goto ldv_58640; ldv_58639: ; if ((int )pf->vxlan_ports[(int )i] == (int )port) { return (i); } else { } i = (u8 )((int )i + 1); ldv_58640: ; if ((unsigned int )i <= 15U) { goto ldv_58639; } else { } return (i); } } static void i40e_add_vxlan_port(struct net_device *netdev , sa_family_t sa_family , __be16 port ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; u8 next_idx ; u8 idx ; __u16 tmp___0 ; __u16 tmp___1 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; } if ((unsigned int )sa_family == 10U) { return; } else { } { idx = i40e_get_vxlan_port_idx(pf, (int )port); } if ((unsigned int )idx <= 15U) { { tmp___0 = __fswab16((int )port); netdev_info((struct net_device const *)netdev, "Port %d already offloaded\n", (int )tmp___0); } return; } else { } { next_idx = i40e_get_vxlan_port_idx(pf, 0); } if ((unsigned int )next_idx == 16U) { { tmp___1 = __fswab16((int )port); netdev_info((struct net_device const *)netdev, "Maximum number of UDP ports reached, not adding port %d\n", (int )tmp___1); } return; } else { } pf->vxlan_ports[(int )next_idx] = port; pf->pending_vxlan_bitmap = (u16 )((int )((short )pf->pending_vxlan_bitmap) | (int )((short )(1 << (int )next_idx))); pf->flags = pf->flags | 134217728ULL; return; } } static void i40e_del_vxlan_port(struct net_device *netdev , sa_family_t sa_family , __be16 port ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; u8 idx ; __u16 tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; } if ((unsigned int )sa_family == 10U) { return; } else { } { idx = i40e_get_vxlan_port_idx(pf, (int )port); } if ((unsigned int )idx <= 15U) { pf->vxlan_ports[(int )idx] = 0U; pf->pending_vxlan_bitmap = (u16 )((int )((short )pf->pending_vxlan_bitmap) | (int )((short )(1 << (int )idx))); pf->flags = pf->flags | 134217728ULL; } else { { tmp___0 = __fswab16((int )port); netdev_warn((struct net_device const *)netdev, "Port %d was not found, not deleting\n", (int )tmp___0); } } return; } } static struct net_device_ops const i40e_netdev_ops = {0, 0, & i40e_open, & i40e_close, & i40e_lan_xmit_frame, 0, 0, & i40e_set_rx_mode, & i40e_set_mac, & eth_validate_addr, & i40e_ioctl, 0, & i40e_change_mtu, 0, & i40e_tx_timeout, & i40e_get_netdev_stats_struct, 0, & i40e_vlan_rx_add_vid, & i40e_vlan_rx_kill_vid, & i40e_netpoll, 0, 0, 0, & i40e_ndo_set_vf_mac, & i40e_ndo_set_vf_port_vlan, & i40e_ndo_set_vf_bw, 0, & i40e_ndo_get_vf_config, 0, 0, 0, & i40e_setup_tc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & i40e_set_features, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & i40e_add_vxlan_port, & i40e_del_vxlan_port, 0, 0, 0}; static int i40e_config_netdev(struct i40e_vsi *vsi ) { u8 brdcast[6U] ; struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_netdev_priv *np ; struct net_device *netdev ; u8 mac_addr[6U] ; int etherdev_size ; void *tmp ; { { brdcast[0] = 255U; brdcast[1] = 255U; brdcast[2] = 255U; brdcast[3] = 255U; brdcast[4] = 255U; brdcast[5] = 255U; pf = vsi->back; hw = & pf->hw; etherdev_size = 8; netdev = ldv_alloc_etherdev_mqs_18(etherdev_size, (unsigned int )vsi->alloc_queue_pairs, (unsigned int )vsi->alloc_queue_pairs); } if ((unsigned long )netdev == (unsigned long )((struct net_device *)0)) { return (-12); } else { } { vsi->netdev = netdev; tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; np->vsi = vsi; netdev->hw_enc_features = 33619971ULL; netdev->features = 6745555891ULL; netdev->hw_features = netdev->hw_features | netdev->features; } if ((unsigned int )vsi->type == 0U) { { netdev->dev.parent = & (pf->pdev)->dev; memcpy((void *)(& mac_addr), (void const *)(& hw->mac.perm_addr), 6UL); } } else { { snprintf((char *)(& netdev->name), 16UL, "%sv%%d", (char *)(& ((*(pf->vsi + (unsigned long )pf->lan_vsi))->netdev)->name)); eth_random_addr((u8 *)(& mac_addr)); i40e_add_filter(vsi, (u8 *)(& mac_addr), -1, 0, 0); } } { i40e_add_filter(vsi, (u8 *)(& brdcast), -1, 0, 0); memcpy((void *)netdev->dev_addr, (void const *)(& mac_addr), 6UL); memcpy((void *)(& netdev->perm_addr), (void const *)(& mac_addr), 6UL); netdev->vlan_features = netdev->features & 0xfffffffffffffc7fULL; netdev->priv_flags = netdev->priv_flags | 131072U; netdev->priv_flags = netdev->priv_flags | 524288U; i40e_vsi_config_netdev_tc(vsi, (int )vsi->tc_config.enabled_tc); netdev->netdev_ops = & i40e_netdev_ops; netdev->watchdog_timeo = 1250; i40e_set_ethtool_ops(netdev); } return (0); } } static void i40e_vsi_delete(struct i40e_vsi *vsi ) { { if ((unsigned long )vsi == (unsigned long )*((vsi->back)->vsi + (unsigned long )(vsi->back)->lan_vsi)) { return; } else { } { i40e_aq_delete_element(& (vsi->back)->hw, (int )vsi->seid, (struct i40e_asq_cmd_details *)0); } return; } } static int i40e_add_vsi(struct i40e_vsi *vsi ) { int ret ; struct i40e_mac_filter *f ; struct i40e_mac_filter *ftmp ; struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_vsi_context ctxt ; u8 enabled_tc ; int f_count ; i40e_status tmp ; i40e_status tmp___0 ; i40e_status tmp___1 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { { ret = -19; pf = vsi->back; hw = & pf->hw; enabled_tc = 1U; f_count = 0; memset((void *)(& ctxt), 0, 144UL); } { if ((unsigned int )vsi->type == 0U) { goto case_0; } else { } if ((unsigned int )vsi->type == 7U) { goto case_7; } else { } if ((unsigned int )vsi->type == 2U) { goto case_2; } else { } if ((unsigned int )vsi->type == 6U) { goto case_6; } else { } goto switch_default; case_0: /* CIL Label */ { ctxt.seid = pf->main_vsi_seid; ctxt.pf_num = pf->hw.pf_id; ctxt.vf_num = 0U; tmp = i40e_aq_get_vsi_params(& pf->hw, & ctxt, (struct i40e_asq_cmd_details *)0); ret = (int )tmp; ctxt.flags = 2U; } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "couldn\'t get pf vsi config, err %d, aq_err %d\n", ret, (unsigned int )pf->hw.aq.asq_last_status); } return (-2); } else { } { memcpy((void *)(& vsi->info), (void const *)(& ctxt.info), 128UL); vsi->info.valid_sections = 0U; vsi->seid = ctxt.seid; vsi->id = ctxt.vsi_number; enabled_tc = i40e_pf_get_tc_map(pf); } if ((pf->flags & 67108864ULL) != 0ULL) { { memset((void *)(& ctxt), 0, 144UL); ctxt.seid = pf->main_vsi_seid; ctxt.pf_num = pf->hw.pf_id; ctxt.vf_num = 0U; i40e_vsi_setup_queue_map(vsi, & ctxt, (int )enabled_tc, 0); tmp___0 = i40e_aq_update_vsi_params(hw, & ctxt, (struct i40e_asq_cmd_details *)0); ret = (int )tmp___0; } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "update vsi failed, aq_err=%d\n", (unsigned int )pf->hw.aq.asq_last_status); ret = -2; } goto err; } else { } { i40e_vsi_update_queue_map(vsi, & ctxt); vsi->info.valid_sections = 0U; } } else { { ret = i40e_vsi_config_tc(vsi, (int )enabled_tc); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "failed to configure TCs for main VSI tc_map 0x%08x, err %d, aq_err %d\n", (int )enabled_tc, ret, (unsigned int )pf->hw.aq.asq_last_status); ret = -2; } } else { } } goto ldv_58688; case_7: /* CIL Label */ { ctxt.pf_num = hw->pf_id; ctxt.vf_num = 0U; ctxt.uplink_seid = vsi->uplink_seid; ctxt.connection_type = 1U; ctxt.flags = 2U; i40e_vsi_setup_queue_map(vsi, & ctxt, (int )enabled_tc, 1); } goto ldv_58688; case_2: /* CIL Label */ { ctxt.pf_num = hw->pf_id; ctxt.vf_num = 0U; ctxt.uplink_seid = vsi->uplink_seid; ctxt.connection_type = 1U; ctxt.flags = 1U; ctxt.info.valid_sections = (__le16 )((unsigned int )ctxt.info.valid_sections | 1U); ctxt.info.switch_id = 0U; ctxt.info.switch_id = (__le16 )((unsigned int )ctxt.info.switch_id | 16384U); ctxt.info.switch_id = (__le16 )((unsigned int )ctxt.info.switch_id | 8192U); i40e_vsi_setup_queue_map(vsi, & ctxt, (int )enabled_tc, 1); } goto ldv_58688; case_6: /* CIL Label */ { ctxt.pf_num = hw->pf_id; ctxt.vf_num = (int )((u8 )vsi->vf_id) + (int )((u8 )hw->func_caps.vf_base_id); ctxt.uplink_seid = vsi->uplink_seid; ctxt.connection_type = 1U; ctxt.flags = 0U; ctxt.info.valid_sections = (__le16 )((unsigned int )ctxt.info.valid_sections | 1U); ctxt.info.switch_id = 8192U; ctxt.info.valid_sections = (__le16 )((unsigned int )ctxt.info.valid_sections | 4U); ctxt.info.port_vlan_flags = (u8 )((unsigned int )ctxt.info.port_vlan_flags | 3U); i40e_vsi_setup_queue_map(vsi, & ctxt, (int )enabled_tc, 1); } goto ldv_58688; switch_default: /* CIL Label */ ; return (-19); switch_break: /* CIL Label */ ; } ldv_58688: ; if ((unsigned int )vsi->type != 0U) { { tmp___1 = i40e_aq_add_vsi(hw, & ctxt, (struct i40e_asq_cmd_details *)0); ret = (int )tmp___1; } if (ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "add vsi failed, aq_err=%d\n", (unsigned int )(vsi->back)->hw.aq.asq_last_status); ret = -2; } goto err; } else { } { memcpy((void *)(& vsi->info), (void const *)(& ctxt.info), 128UL); vsi->info.valid_sections = 0U; vsi->seid = ctxt.seid; vsi->id = ctxt.vsi_number; } } else { } __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; __mptr___0 = (struct list_head const *)f->list.next; ftmp = (struct i40e_mac_filter *)__mptr___0; goto ldv_58700; ldv_58699: f->changed = 1; f_count = f_count + 1; f = ftmp; __mptr___1 = (struct list_head const *)ftmp->list.next; ftmp = (struct i40e_mac_filter *)__mptr___1; ldv_58700: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_58699; } else { } if (f_count != 0) { vsi->flags = vsi->flags | 1UL; pf->flags = pf->flags | 32768ULL; } else { } { ret = i40e_vsi_get_bw_info(vsi); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "couldn\'t get vsi bw info, err %d, aq_err %d\n", ret, (unsigned int )pf->hw.aq.asq_last_status); ret = 0; } } else { } err: ; return (ret); } } int i40e_vsi_release(struct i40e_vsi *vsi ) { struct i40e_mac_filter *f ; struct i40e_mac_filter *ftmp ; struct i40e_veb *veb ; struct i40e_pf *pf ; u16 uplink_seid ; int i ; int n ; int tmp ; int tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { veb = (struct i40e_veb *)0; pf = vsi->back; if ((vsi->flags & 2UL) != 0UL) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "VSI %d has existing VEB %d\n", (int )vsi->seid, (int )vsi->uplink_seid); } return (-19); } else { } if ((unsigned long )vsi == (unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi)) { { tmp = constant_test_bit(3L, (unsigned long const volatile *)(& pf->state)); } if (tmp == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Can\'t remove PF VSI\n"); } return (-19); } else { } } else { } uplink_seid = vsi->uplink_seid; if ((unsigned int )vsi->type != 6U) { if ((int )vsi->netdev_registered) { vsi->netdev_registered = 0; if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { ldv_unregister_netdev_19(vsi->netdev); ldv_free_netdev_20(vsi->netdev); vsi->netdev = (struct net_device *)0; } } else { } } else { { tmp___0 = test_and_set_bit(3L, (unsigned long volatile *)(& vsi->state)); } if (tmp___0 == 0) { { i40e_down(vsi); } } else { } { i40e_vsi_free_irq(vsi); i40e_vsi_free_tx_resources(vsi); i40e_vsi_free_rx_resources(vsi); } } { i40e_vsi_disable_irq(vsi); } } else { } __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; __mptr___0 = (struct list_head const *)f->list.next; ftmp = (struct i40e_mac_filter *)__mptr___0; goto ldv_58719; ldv_58718: { i40e_del_filter(vsi, (u8 *)(& f->macaddr), (int )f->vlan, (int )f->is_vf, (int )f->is_netdev); f = ftmp; __mptr___1 = (struct list_head const *)ftmp->list.next; ftmp = (struct i40e_mac_filter *)__mptr___1; } ldv_58719: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_58718; } else { } { i40e_sync_vsi_filters(vsi); i40e_vsi_delete(vsi); i40e_vsi_free_q_vectors(vsi); i40e_vsi_clear_rings(vsi); i40e_vsi_clear(vsi); n = 0; i = 0; } goto ldv_58722; ldv_58721: ; if (((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (int )(*(pf->vsi + (unsigned long )i))->uplink_seid == (int )uplink_seid) && ((*(pf->vsi + (unsigned long )i))->flags & 2UL) == 0UL) { n = n + 1; } else { } i = i + 1; ldv_58722: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58721; } else { } i = 0; goto ldv_58726; ldv_58725: ; if ((unsigned long )pf->veb[i] == (unsigned long )((struct i40e_veb *)0)) { goto ldv_58724; } else { } if ((int )(pf->veb[i])->uplink_seid == (int )uplink_seid) { n = n + 1; } else { } if ((int )(pf->veb[i])->seid == (int )uplink_seid) { veb = pf->veb[i]; } else { } ldv_58724: i = i + 1; ldv_58726: ; if (i <= 15) { goto ldv_58725; } else { } if ((n == 0 && (unsigned long )veb != (unsigned long )((struct i40e_veb *)0)) && (unsigned int )veb->uplink_seid != 0U) { { i40e_veb_release(veb); } } else { } return (0); } } static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi ) { int ret ; struct i40e_pf *pf ; { ret = -2; pf = vsi->back; if ((unsigned long )*(vsi->q_vectors) != (unsigned long )((struct i40e_q_vector *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "VSI %d has existing q_vectors\n", (int )vsi->seid); } return (-17); } else { } if (vsi->base_vector != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "VSI %d has non-zero base vector %d\n", (int )vsi->seid, vsi->base_vector); } return (-17); } else { } { ret = i40e_alloc_q_vectors(vsi); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "failed to allocate %d q_vector for VSI %d, ret=%d\n", vsi->num_q_vectors, (int )vsi->seid, ret); vsi->num_q_vectors = 0; } goto vector_setup_out; } else { } if (vsi->num_q_vectors != 0) { { vsi->base_vector = i40e_get_lump(pf, pf->irq_pile, (int )((u16 )vsi->num_q_vectors), (int )vsi->idx); } } else { } if (vsi->base_vector < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "failed to get q tracking for VSI %d, err=%d\n", (int )vsi->seid, vsi->base_vector); i40e_vsi_free_q_vectors(vsi); ret = -2; } goto vector_setup_out; } else { } vector_setup_out: ; return (ret); } } static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; u8 enabled_tc ; int ret ; { { pf = vsi->back; i40e_put_lump(pf->qp_pile, (int )vsi->base_queue, (int )vsi->idx); i40e_vsi_clear_rings(vsi); i40e_vsi_free_arrays(vsi, 0); i40e_set_num_rings_in_vsi(vsi); ret = i40e_vsi_alloc_arrays(vsi, 0); } if (ret != 0) { goto err_vsi; } else { } { ret = i40e_get_lump(pf, pf->qp_pile, (int )vsi->alloc_queue_pairs, (int )vsi->idx); } if (ret < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "VSI %d get_lump failed %d\n", (int )vsi->seid, ret); } goto err_vsi; } else { } { vsi->base_queue = (u16 )ret; enabled_tc = (*(pf->vsi + (unsigned long )pf->lan_vsi))->tc_config.enabled_tc; (*(pf->vsi + (unsigned long )pf->lan_vsi))->tc_config.enabled_tc = 0U; (*(pf->vsi + (unsigned long )pf->lan_vsi))->seid = pf->main_vsi_seid; i40e_vsi_config_tc(*(pf->vsi + (unsigned long )pf->lan_vsi), (int )enabled_tc); ret = i40e_alloc_rings(vsi); } if (ret != 0) { goto err_rings; } else { } { i40e_vsi_map_rings_to_vectors(vsi); } return (vsi); err_rings: { i40e_vsi_free_q_vectors(vsi); } if ((int )vsi->netdev_registered) { { vsi->netdev_registered = 0; ldv_unregister_netdev_21(vsi->netdev); ldv_free_netdev_22(vsi->netdev); vsi->netdev = (struct net_device *)0; } } else { } { i40e_aq_delete_element(& pf->hw, (int )vsi->seid, (struct i40e_asq_cmd_details *)0); } err_vsi: { i40e_vsi_clear(vsi); } return ((struct i40e_vsi *)0); } } struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf , u8 type , u16 uplink_seid , u32 param1 ) { struct i40e_vsi *vsi ; struct i40e_veb *veb ; int ret ; int i ; int v_idx ; { vsi = (struct i40e_vsi *)0; veb = (struct i40e_veb *)0; i = 0; goto ldv_58755; ldv_58754: ; if ((unsigned long )pf->veb[i] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[i])->seid == (int )uplink_seid) { veb = pf->veb[i]; goto ldv_58753; } else { } i = i + 1; ldv_58755: ; if (i <= 15) { goto ldv_58754; } else { } ldv_58753: ; if ((unsigned long )veb == (unsigned long )((struct i40e_veb *)0) && (int )uplink_seid != (int )pf->mac_seid) { i = 0; goto ldv_58758; ldv_58757: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (int )(*(pf->vsi + (unsigned long )i))->seid == (int )uplink_seid) { vsi = *(pf->vsi + (unsigned long )i); goto ldv_58756; } else { } i = i + 1; ldv_58758: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58757; } else { } ldv_58756: ; if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "no such uplink_seid %d\n", (int )uplink_seid); } return ((struct i40e_vsi *)0); } else { } if ((int )vsi->uplink_seid == (int )pf->mac_seid) { { veb = i40e_veb_setup(pf, 0, (int )pf->mac_seid, (int )vsi->seid, (int )vsi->tc_config.enabled_tc); } } else if ((vsi->flags & 2UL) == 0UL) { { veb = i40e_veb_setup(pf, 0, (int )vsi->uplink_seid, (int )vsi->seid, (int )vsi->tc_config.enabled_tc); } } else { } i = 0; goto ldv_58760; ldv_58759: ; if ((unsigned long )pf->veb[i] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[i])->seid == (int )vsi->uplink_seid) { veb = pf->veb[i]; } else { } i = i + 1; ldv_58760: ; if (i <= 15 && (unsigned long )veb == (unsigned long )((struct i40e_veb *)0)) { goto ldv_58759; } else { } if ((unsigned long )veb == (unsigned long )((struct i40e_veb *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "couldn\'t add VEB\n"); } return ((struct i40e_vsi *)0); } else { } vsi->flags = vsi->flags | 2UL; uplink_seid = veb->seid; } else { } { v_idx = i40e_vsi_mem_alloc(pf, (enum i40e_vsi_type )type); } if (v_idx < 0) { goto err_alloc; } else { } vsi = *(pf->vsi + (unsigned long )v_idx); if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { goto err_alloc; } else { } vsi->type = (enum i40e_vsi_type )type; vsi->veb_idx = (unsigned long )veb != (unsigned long )((struct i40e_veb *)0) ? veb->idx : 65535U; if ((unsigned int )type == 0U) { pf->lan_vsi = (u16 )v_idx; } else if ((unsigned int )type == 6U) { vsi->vf_id = (u16 )param1; } else { } { ret = i40e_get_lump(pf, pf->qp_pile, (int )vsi->alloc_queue_pairs, (int )vsi->idx); } if (ret < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "VSI %d get_lump failed %d\n", (int )vsi->seid, ret); } goto err_vsi; } else { } { vsi->base_queue = (u16 )ret; vsi->uplink_seid = uplink_seid; ret = i40e_add_vsi(vsi); } if (ret != 0) { goto err_vsi; } else { } { if ((unsigned int )vsi->type == 0U) { goto case_0; } else { } if ((unsigned int )vsi->type == 2U) { goto case_2; } else { } if ((unsigned int )vsi->type == 7U) { goto case_7; } else { } goto switch_default; case_0: /* CIL Label */ ; case_2: /* CIL Label */ { ret = i40e_config_netdev(vsi); } if (ret != 0) { goto err_netdev; } else { } { ret = ldv_register_netdev_23(vsi->netdev); } if (ret != 0) { goto err_netdev; } else { } { vsi->netdev_registered = 1; netif_carrier_off(vsi->netdev); i40e_dcbnl_setup(vsi); } case_7: /* CIL Label */ { ret = i40e_vsi_setup_vectors(vsi); } if (ret != 0) { goto err_msix; } else { } { ret = i40e_alloc_rings(vsi); } if (ret != 0) { goto err_rings; } else { } { i40e_vsi_map_rings_to_vectors(vsi); i40e_vsi_reset_stats(vsi); } goto ldv_58770; switch_default: /* CIL Label */ ; goto ldv_58770; switch_break: /* CIL Label */ ; } ldv_58770: ; return (vsi); err_rings: { i40e_vsi_free_q_vectors(vsi); } err_msix: ; if ((int )vsi->netdev_registered) { { vsi->netdev_registered = 0; ldv_unregister_netdev_24(vsi->netdev); ldv_free_netdev_25(vsi->netdev); vsi->netdev = (struct net_device *)0; } } else { } err_netdev: { i40e_aq_delete_element(& pf->hw, (int )vsi->seid, (struct i40e_asq_cmd_details *)0); } err_vsi: { i40e_vsi_clear(vsi); } err_alloc: ; return ((struct i40e_vsi *)0); } } static int i40e_veb_get_bw_info(struct i40e_veb *veb ) { struct i40e_aqc_query_switching_comp_ets_config_resp ets_data ; struct i40e_aqc_query_switching_comp_bw_config_resp bw_data ; struct i40e_pf *pf ; struct i40e_hw *hw ; u32 tc_bw_max ; int ret ; int i ; i40e_status tmp ; i40e_status tmp___0 ; { { pf = veb->pf; hw = & pf->hw; ret = 0; tmp = i40e_aq_query_switch_comp_bw_config(hw, (int )veb->seid, & bw_data, (struct i40e_asq_cmd_details *)0); ret = (int )tmp; } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "query veb bw config failed, aq_err=%d\n", (unsigned int )hw->aq.asq_last_status); } goto out; } else { } { tmp___0 = i40e_aq_query_switch_comp_ets_config(hw, (int )veb->seid, & ets_data, (struct i40e_asq_cmd_details *)0); ret = (int )tmp___0; } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "query veb bw ets config failed, aq_err=%d\n", (unsigned int )hw->aq.asq_last_status); } goto out; } else { } veb->bw_limit = ets_data.port_bw_limit; veb->bw_max_quanta = ets_data.tc_bw_max; veb->is_abs_credits = (unsigned int )bw_data.absolute_credits_enable != 0U; tc_bw_max = (u32 )((int )bw_data.tc_bw_max[0] | ((int )bw_data.tc_bw_max[1] << 16)); i = 0; goto ldv_58784; ldv_58783: veb->bw_tc_share_credits[i] = bw_data.tc_bw_share_credits[i]; veb->bw_tc_limit_credits[i] = bw_data.tc_bw_limits[i]; veb->bw_tc_max_quanta[i] = (unsigned int )((u8 )(tc_bw_max >> i * 4)) & 7U; i = i + 1; ldv_58784: ; if (i <= 7) { goto ldv_58783; } else { } out: ; return (ret); } } static int i40e_veb_mem_alloc(struct i40e_pf *pf ) { int ret ; struct i40e_veb *veb ; int i ; void *tmp ; { { ret = -2; mutex_lock_nested(& pf->switch_mutex, 0U); i = 0; } goto ldv_58793; ldv_58792: i = i + 1; ldv_58793: ; if (i <= 15 && (unsigned long )pf->veb[i] != (unsigned long )((struct i40e_veb *)0)) { goto ldv_58792; } else { } if (i > 15) { ret = -12; goto err_alloc_veb; } else { } { tmp = kzalloc(304UL, 208U); veb = (struct i40e_veb *)tmp; } if ((unsigned long )veb == (unsigned long )((struct i40e_veb *)0)) { ret = -12; goto err_alloc_veb; } else { } veb->pf = pf; veb->idx = (u16 )i; veb->enabled_tc = 1U; pf->veb[i] = veb; ret = i; err_alloc_veb: { mutex_unlock(& pf->switch_mutex); } return (ret); } } static void i40e_switch_branch_release(struct i40e_veb *branch ) { struct i40e_pf *pf ; u16 branch_seid ; u16 veb_idx ; int i ; { pf = branch->pf; branch_seid = branch->seid; veb_idx = branch->idx; i = 0; goto ldv_58805; ldv_58804: ; if ((unsigned long )pf->veb[i] == (unsigned long )((struct i40e_veb *)0)) { goto ldv_58803; } else { } if ((int )(pf->veb[i])->uplink_seid == (int )branch->seid) { { i40e_switch_branch_release(pf->veb[i]); } } else { } ldv_58803: i = i + 1; ldv_58805: ; if (i <= 15) { goto ldv_58804; } else { } i = 0; goto ldv_58809; ldv_58808: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) == (unsigned long )((struct i40e_vsi *)0)) { goto ldv_58807; } else { } if ((int )(*(pf->vsi + (unsigned long )i))->uplink_seid == (int )branch_seid && ((*(pf->vsi + (unsigned long )i))->flags & 2UL) == 0UL) { { i40e_vsi_release(*(pf->vsi + (unsigned long )i)); } } else { } ldv_58807: i = i + 1; ldv_58809: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58808; } else { } if ((unsigned long )pf->veb[(int )veb_idx] != (unsigned long )((struct i40e_veb *)0)) { { i40e_veb_release(pf->veb[(int )veb_idx]); } } else { } return; } } static void i40e_veb_clear(struct i40e_veb *veb ) { struct i40e_pf *pf ; { if ((unsigned long )veb == (unsigned long )((struct i40e_veb *)0)) { return; } else { } if ((unsigned long )veb->pf != (unsigned long )((struct i40e_pf *)0)) { { pf = veb->pf; mutex_lock_nested(& pf->switch_mutex, 0U); } if ((unsigned long )pf->veb[(int )veb->idx] == (unsigned long )veb) { pf->veb[(int )veb->idx] = (struct i40e_veb *)0; } else { } { mutex_unlock(& pf->switch_mutex); } } else { } { kfree((void const *)veb); } return; } } void i40e_veb_release(struct i40e_veb *veb ) { struct i40e_vsi *vsi ; struct i40e_pf *pf ; int i ; int n ; { vsi = (struct i40e_vsi *)0; n = 0; pf = veb->pf; i = 0; goto ldv_58823; ldv_58822: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (int )(*(pf->vsi + (unsigned long )i))->uplink_seid == (int )veb->seid) { n = n + 1; vsi = *(pf->vsi + (unsigned long )i); } else { } i = i + 1; ldv_58823: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58822; } else { } if (n != 1) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "can\'t remove VEB %d with %d VSIs left\n", (int )veb->seid, n); } return; } else { } vsi->flags = vsi->flags & 0xfffffffffffffffdUL; if ((unsigned int )veb->uplink_seid != 0U) { vsi->uplink_seid = veb->uplink_seid; if ((int )veb->uplink_seid == (int )pf->mac_seid) { vsi->veb_idx = 65535U; } else { vsi->veb_idx = veb->veb_idx; } } else { vsi->uplink_seid = (*(pf->vsi + (unsigned long )pf->lan_vsi))->uplink_seid; vsi->veb_idx = (*(pf->vsi + (unsigned long )pf->lan_vsi))->veb_idx; } { i40e_aq_delete_element(& pf->hw, (int )veb->seid, (struct i40e_asq_cmd_details *)0); i40e_veb_clear(veb); } return; } } static int i40e_add_veb(struct i40e_veb *veb , struct i40e_vsi *vsi ) { bool is_default ; bool is_cloud ; int ret ; i40e_status tmp ; i40e_status tmp___0 ; { { is_default = 0; is_cloud = 0; tmp = i40e_aq_add_veb(& (veb->pf)->hw, (int )veb->uplink_seid, (int )vsi->seid, (int )veb->enabled_tc, (int )is_default, (int )is_cloud, & veb->seid, (struct i40e_asq_cmd_details *)0); ret = (int )tmp; } if (ret != 0) { { _dev_info((struct device const *)(& ((veb->pf)->pdev)->dev), "couldn\'t add VEB, err %d, aq_err %d\n", ret, (unsigned int )(veb->pf)->hw.aq.asq_last_status); } return (-1); } else { } { tmp___0 = i40e_aq_get_veb_parameters(& (veb->pf)->hw, (int )veb->seid, (u16 *)0U, (bool *)0, & veb->stats_idx, (u16 *)0U, (u16 *)0U, (struct i40e_asq_cmd_details *)0); ret = (int )tmp___0; } if (ret != 0) { { _dev_info((struct device const *)(& ((veb->pf)->pdev)->dev), "couldn\'t get VEB statistics idx, err %d, aq_err %d\n", ret, (unsigned int )(veb->pf)->hw.aq.asq_last_status); } return (-1); } else { } { ret = i40e_veb_get_bw_info(veb); } if (ret != 0) { { _dev_info((struct device const *)(& ((veb->pf)->pdev)->dev), "couldn\'t get VEB bw info, err %d, aq_err %d\n", ret, (unsigned int )(veb->pf)->hw.aq.asq_last_status); i40e_aq_delete_element(& (veb->pf)->hw, (int )veb->seid, (struct i40e_asq_cmd_details *)0); } return (-2); } else { } vsi->uplink_seid = veb->seid; vsi->veb_idx = veb->idx; vsi->flags = vsi->flags | 2UL; return (0); } } struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf , u16 flags , u16 uplink_seid , u16 vsi_seid , u8 enabled_tc ) { struct i40e_veb *veb ; struct i40e_veb *uplink_veb ; int vsi_idx ; int veb_idx ; int ret ; { uplink_veb = (struct i40e_veb *)0; if (((unsigned int )uplink_seid == 0U || (unsigned int )vsi_seid == 0U) && (int )uplink_seid + (int )vsi_seid != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "one, not both seid\'s are 0: uplink=%d vsi=%d\n", (int )uplink_seid, (int )vsi_seid); } return ((struct i40e_veb *)0); } else { } vsi_idx = 0; goto ldv_58846; ldv_58845: ; if ((unsigned long )*(pf->vsi + (unsigned long )vsi_idx) != (unsigned long )((struct i40e_vsi *)0) && (int )(*(pf->vsi + (unsigned long )vsi_idx))->seid == (int )vsi_seid) { goto ldv_58844; } else { } vsi_idx = vsi_idx + 1; ldv_58846: ; if ((u32 )vsi_idx < pf->hw.func_caps.num_vsis) { goto ldv_58845; } else { } ldv_58844: ; if ((u32 )vsi_idx >= pf->hw.func_caps.num_vsis && (unsigned int )vsi_seid != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "vsi seid %d not found\n", (int )vsi_seid); } return ((struct i40e_veb *)0); } else { } if ((unsigned int )uplink_seid != 0U && (int )uplink_seid != (int )pf->mac_seid) { veb_idx = 0; goto ldv_58849; ldv_58848: ; if ((unsigned long )pf->veb[veb_idx] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[veb_idx])->seid == (int )uplink_seid) { uplink_veb = pf->veb[veb_idx]; goto ldv_58847; } else { } veb_idx = veb_idx + 1; ldv_58849: ; if (veb_idx <= 15) { goto ldv_58848; } else { } ldv_58847: ; if ((unsigned long )uplink_veb == (unsigned long )((struct i40e_veb *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "uplink seid %d not found\n", (int )uplink_seid); } return ((struct i40e_veb *)0); } else { } } else { } { veb_idx = i40e_veb_mem_alloc(pf); } if (veb_idx < 0) { goto err_alloc; } else { } { veb = pf->veb[veb_idx]; veb->flags = flags; veb->uplink_seid = uplink_seid; veb->veb_idx = (unsigned long )uplink_veb != (unsigned long )((struct i40e_veb *)0) ? uplink_veb->idx : 65535U; veb->enabled_tc = (unsigned int )enabled_tc != 0U ? enabled_tc : 1U; ret = i40e_add_veb(veb, *(pf->vsi + (unsigned long )vsi_idx)); } if (ret != 0) { goto err_veb; } else { } return (veb); err_veb: { i40e_veb_clear(veb); } err_alloc: ; return ((struct i40e_veb *)0); } } static void i40e_setup_pf_switch_element(struct i40e_pf *pf , struct i40e_aqc_switch_config_element_resp *ele , u16 num_reported , bool printconfig ) { u16 downlink_seid ; u16 uplink_seid ; u8 element_type ; u16 seid ; int v ; { downlink_seid = ele->downlink_seid; uplink_seid = ele->uplink_seid; element_type = ele->element_type; seid = ele->seid; if ((int )printconfig) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "type=%d seid=%d uplink=%d downlink=%d\n", (int )element_type, (int )seid, (int )uplink_seid, (int )downlink_seid); } } else { } { if ((int )element_type == 1) { goto case_1; } else { } if ((int )element_type == 17) { goto case_17; } else { } if ((int )element_type == 19) { goto case_19; } else { } if ((int )element_type == 2) { goto case_2; } else { } if ((int )element_type == 3) { goto case_3; } else { } if ((int )element_type == 4) { goto case_4; } else { } if ((int )element_type == 6) { goto case_6; } else { } if ((int )element_type == 16) { goto case_16; } else { } if ((int )element_type == 18) { goto case_18; } else { } goto switch_default; case_1: /* CIL Label */ pf->mac_seid = seid; goto ldv_58863; case_17: /* CIL Label */ ; if ((int )uplink_seid != (int )pf->mac_seid) { goto ldv_58863; } else { } if ((unsigned int )pf->lan_veb == 65535U) { v = 0; goto ldv_58868; ldv_58867: ; if ((unsigned long )pf->veb[v] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[v])->seid == (int )seid) { pf->lan_veb = (u16 )v; goto ldv_58866; } else { } v = v + 1; ldv_58868: ; if (v <= 15) { goto ldv_58867; } else { } ldv_58866: ; if ((unsigned int )pf->lan_veb == 65535U) { { v = i40e_veb_mem_alloc(pf); } if (v < 0) { goto ldv_58863; } else { } pf->lan_veb = (u16 )v; } else { } } else { } (pf->veb[(int )pf->lan_veb])->seid = seid; (pf->veb[(int )pf->lan_veb])->uplink_seid = pf->mac_seid; (pf->veb[(int )pf->lan_veb])->pf = pf; (pf->veb[(int )pf->lan_veb])->veb_idx = 65535U; goto ldv_58863; case_19: /* CIL Label */ ; if ((unsigned int )num_reported != 1U) { goto ldv_58863; } else { } pf->mac_seid = uplink_seid; pf->pf_seid = downlink_seid; pf->main_vsi_seid = seid; if ((int )printconfig) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "pf_seid=%d main_vsi_seid=%d\n", (int )pf->pf_seid, (int )pf->main_vsi_seid); } } else { } goto ldv_58863; case_2: /* CIL Label */ ; case_3: /* CIL Label */ ; case_4: /* CIL Label */ ; case_6: /* CIL Label */ ; case_16: /* CIL Label */ ; case_18: /* CIL Label */ ; goto ldv_58863; switch_default: /* CIL Label */ { _dev_info((struct device const *)(& (pf->pdev)->dev), "unknown element type=%d seid=%d\n", (int )element_type, (int )seid); } goto ldv_58863; switch_break: /* CIL Label */ ; } ldv_58863: ; return; } } int i40e_fetch_switch_configuration(struct i40e_pf *pf , bool printconfig ) { struct i40e_aqc_get_switch_config_resp *sw_config ; u16 next_seid ; int ret ; u8 *aq_buf ; int i ; void *tmp ; u16 num_reported ; u16 num_total ; i40e_status tmp___0 ; int sz ; void *tmp___1 ; struct i40e_aqc_switch_config_element_resp *ele ; { { next_seid = 0U; ret = 0; tmp = kzalloc(512UL, 208U); aq_buf = (u8 *)tmp; } if ((unsigned long )aq_buf == (unsigned long )((u8 *)0U)) { return (-12); } else { } sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; ldv_58893: { tmp___0 = i40e_aq_get_switch_config(& pf->hw, sw_config, 512, & next_seid, (struct i40e_asq_cmd_details *)0); ret = (int )tmp___0; } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "get switch config failed %d aq_err=%x\n", ret, (unsigned int )pf->hw.aq.asq_last_status); kfree((void const *)aq_buf); } return (-2); } else { } num_reported = sw_config->header.num_reported; num_total = sw_config->header.num_total; if ((int )printconfig) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "header: %d reported %d total\n", (int )num_reported, (int )num_total); } } else { } if ((unsigned int )num_reported != 0U) { { sz = (int )((unsigned int )num_reported * 32U); kfree((void const *)pf->sw_config); tmp___1 = kzalloc((size_t )sz, 208U); pf->sw_config = (struct i40e_aqc_get_switch_config_data *)tmp___1; } if ((unsigned long )pf->sw_config != (unsigned long )((struct i40e_aqc_get_switch_config_data *)0)) { { memcpy((void *)pf->sw_config, (void const *)sw_config, (size_t )sz); } } else { } } else { } i = 0; goto ldv_58891; ldv_58890: { ele = (struct i40e_aqc_switch_config_element_resp *)(& sw_config->element) + (unsigned long )i; i40e_setup_pf_switch_element(pf, ele, (int )num_reported, (int )printconfig); i = i + 1; } ldv_58891: ; if (i < (int )num_reported) { goto ldv_58890; } else { } if ((unsigned int )next_seid != 0U) { goto ldv_58893; } else { } { kfree((void const *)aq_buf); } return (ret); } } static int i40e_setup_pf_switch(struct i40e_pf *pf , bool reinit ) { u32 rxfc ; u32 txfc ; u32 rxfc_reg ; int ret ; struct i40e_vsi *vsi ; u16 uplink_seid ; u8 enabled_tc ; unsigned int tmp ; unsigned int tmp___0 ; { { rxfc = 0U; txfc = 0U; ret = i40e_fetch_switch_configuration(pf, 0); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "couldn\'t fetch switch config, err %d, aq_err %d\n", ret, (unsigned int )pf->hw.aq.asq_last_status); } return (ret); } else { } { i40e_pf_reset_stats(pf); } if ((unsigned int )pf->lan_vsi == 65535U || (int )reinit) { vsi = (struct i40e_vsi *)0; if ((unsigned int )pf->lan_veb != 65535U && (unsigned long )pf->veb[(int )pf->lan_veb] != (unsigned long )((struct i40e_veb *)0)) { uplink_seid = (pf->veb[(int )pf->lan_veb])->seid; } else { uplink_seid = pf->mac_seid; } if ((unsigned int )pf->lan_vsi == 65535U) { { vsi = i40e_vsi_setup(pf, 0, (int )uplink_seid, 0U); } } else if ((int )reinit) { { vsi = i40e_vsi_reinit_setup(*(pf->vsi + (unsigned long )pf->lan_vsi)); } } else { } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "setup of MAIN VSI failed\n"); i40e_fdir_teardown(pf); } return (-11); } else { } } else { { enabled_tc = (*(pf->vsi + (unsigned long )pf->lan_vsi))->tc_config.enabled_tc; (*(pf->vsi + (unsigned long )pf->lan_vsi))->tc_config.enabled_tc = 0U; (*(pf->vsi + (unsigned long )pf->lan_vsi))->seid = pf->main_vsi_seid; i40e_vsi_config_tc(*(pf->vsi + (unsigned long )pf->lan_vsi), (int )enabled_tc); } } { i40e_vlan_stripping_disable(*(pf->vsi + (unsigned long )pf->lan_vsi)); i40e_fdir_sb_setup(pf); ret = i40e_setup_pf_filter_control(pf); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "setup_pf_filter_control failed: %d\n", ret); } } else { } if ((pf->flags & 64ULL) != 0ULL) { { i40e_config_rss(pf); } } else { } { i40e_aq_get_link_info(& pf->hw, 1, (struct i40e_link_status *)0, (struct i40e_asq_cmd_details *)0); i40e_link_event(pf); pf->fc_autoneg_status = ((int )pf->hw.phy.link_info.an_info & 1) != 0; } if (! pf->fc_autoneg_status) { goto no_autoneg; } else { } if (((unsigned int )pf->hw.phy.link_info.an_info & 96U) == 96U) { pf->hw.fc.current_mode = 3; } else if (((int )pf->hw.phy.link_info.an_info & 32) != 0) { pf->hw.fc.current_mode = 2; } else if (((int )pf->hw.phy.link_info.an_info & 64) != 0) { pf->hw.fc.current_mode = 1; } else { pf->hw.fc.current_mode = 0; } { if ((unsigned int )pf->hw.fc.current_mode == 3U) { goto case_3; } else { } if ((unsigned int )pf->hw.fc.current_mode == 2U) { goto case_2; } else { } if ((unsigned int )pf->hw.fc.current_mode == 1U) { goto case_1; } else { } if ((unsigned int )pf->hw.fc.current_mode == 0U) { goto case_0; } else { } if ((unsigned int )pf->hw.fc.current_mode == 5U) { goto case_5; } else { } if ((unsigned int )pf->hw.fc.current_mode == 4U) { goto case_4; } else { } goto switch_break; case_3: /* CIL Label */ txfc = 1U; rxfc = 1U; goto ldv_58908; case_2: /* CIL Label */ txfc = 1U; rxfc = 0U; goto ldv_58908; case_1: /* CIL Label */ txfc = 0U; rxfc = 1U; goto ldv_58908; case_0: /* CIL Label */ ; case_5: /* CIL Label */ txfc = 0U; rxfc = 0U; goto ldv_58908; case_4: /* CIL Label */ ; goto ldv_58908; switch_break: /* CIL Label */ ; } ldv_58908: { writel(txfc << 3, (void volatile *)pf->hw.hw_addr + 1984064U); tmp = readl((void const volatile *)pf->hw.hw_addr + 1975296U); rxfc_reg = tmp & 4294967287U; rxfc_reg = rxfc_reg | (rxfc << 3); writel(rxfc_reg, (void volatile *)pf->hw.hw_addr + 1975296U); } goto fc_complete; no_autoneg: { writel(0U, (void volatile *)pf->hw.hw_addr + 1984064U); tmp___0 = readl((void const volatile *)pf->hw.hw_addr + 1975296U); writel(tmp___0 & 4294967287U, (void volatile *)pf->hw.hw_addr + 1975296U); } fc_complete: { i40e_ptp_init(pf); } return (ret); } } static void i40e_determine_queue_usage(struct i40e_pf *pf ) { int queues_left ; u16 tmp ; int __min1 ; int __min2 ; int __min1___0 ; int __min2___0 ; { pf->num_lan_qps = 0U; queues_left = (int )pf->hw.func_caps.num_tx_qp; if ((queues_left == 1 || (pf->flags & 8ULL) == 0ULL) || (pf->flags & 3145792ULL) == 0ULL) { queues_left = 0; tmp = 1U; pf->num_lan_qps = tmp; pf->rss_size = tmp; pf->flags = pf->flags & 0xffffffffff87ff3fULL; } else { if ((pf->flags & 1048576ULL) != 0ULL && queues_left <= 7) { { pf->flags = pf->flags & 0xffffffffffefffffULL; _dev_info((struct device const *)(& (pf->pdev)->dev), "not enough queues for DCB. DCB is disabled.\n"); } } else { } pf->num_lan_qps = pf->rss_size_max; queues_left = queues_left - (int )pf->num_lan_qps; } if ((pf->flags & 2097152ULL) != 0ULL) { if (queues_left > 1) { queues_left = queues_left + -1; } else { { pf->flags = pf->flags & 0xffffffffffdfffffULL; _dev_info((struct device const *)(& (pf->pdev)->dev), "not enough queues for Flow Director. Flow Director feature is disabled\n"); } } } else { } if (((pf->flags & 524288ULL) != 0ULL && (unsigned int )pf->num_vf_qps != 0U) && ((unsigned int )pf->num_req_vfs != 0U && queues_left != 0)) { __min1 = (int )pf->num_req_vfs; __min2 = queues_left / (int )pf->num_vf_qps; pf->num_req_vfs = (u16 )(__min1 < __min2 ? __min1 : __min2); queues_left = queues_left - (int )pf->num_req_vfs * (int )pf->num_vf_qps; } else { } if (((pf->flags & 128ULL) != 0ULL && (unsigned int )pf->num_vmdq_vsis != 0U) && ((unsigned int )pf->num_vmdq_qps != 0U && queues_left != 0)) { __min1___0 = (int )pf->num_vmdq_vsis; __min2___0 = queues_left / (int )pf->num_vmdq_qps; pf->num_vmdq_vsis = (u16 )(__min1___0 < __min2___0 ? __min1___0 : __min2___0); queues_left = queues_left - (int )pf->num_vmdq_vsis * (int )pf->num_vmdq_qps; } else { } pf->queues_left = queues_left; return; } } static int i40e_setup_pf_filter_control(struct i40e_pf *pf ) { struct i40e_filter_control_settings *settings ; i40e_status tmp ; { settings = & pf->filter_settings; settings->hash_lut_size = 0; if ((pf->flags & 6291456ULL) != 0ULL) { settings->enable_fdir = 1; } else { } { settings->enable_ethtype = 1; settings->enable_macvlan = 1; tmp = i40e_set_filter_control(& pf->hw, settings); } if ((int )tmp != 0) { return (-2); } else { } return (0); } } static int i40e_probe(struct pci_dev *pdev , struct pci_device_id const *ent ) { struct i40e_driver_version dv ; struct i40e_pf *pf ; struct i40e_hw *hw ; u16 pfs_found ; u16 link_status ; int err ; u32 len ; int tmp ; int tmp___0 ; int tmp___1 ; void *tmp___2 ; void *tmp___3 ; unsigned int tmp___4 ; i40e_status tmp___5 ; char const *tmp___6 ; i40e_status tmp___7 ; i40e_status tmp___8 ; char *tmp___9 ; i40e_status tmp___10 ; i40e_status tmp___11 ; bool tmp___12 ; int tmp___13 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; atomic_long_t __constr_expr_0 ; void *tmp___14 ; u32 val ; unsigned long tmp___15 ; int tmp___16 ; { { err = 0; err = pci_enable_device_mem(pdev); } if (err != 0) { return (err); } else { } { tmp___0 = dma_set_mask(& pdev->dev, 0xffffffffffffffffULL); } if (tmp___0 == 0) { { dma_set_coherent_mask(& pdev->dev, 0xffffffffffffffffULL); } } else { { tmp = dma_set_mask(& pdev->dev, 4294967295ULL); } if (tmp == 0) { { dma_set_coherent_mask(& pdev->dev, 4294967295ULL); } } else { { dev_err((struct device const *)(& pdev->dev), "DMA configuration failed: %d\n", err); err = -5; } goto err_dma; } } { tmp___1 = pci_select_bars(pdev, 512UL); err = pci_request_selected_regions(pdev, tmp___1, (char const *)(& i40e_driver_name)); } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "pci_request_selected_regions failed %d\n", err); } goto err_pci_reg; } else { } { pci_enable_pcie_error_reporting(pdev); pci_set_master(pdev); tmp___2 = kzalloc(4008UL, 208U); pf = (struct i40e_pf *)tmp___2; } if ((unsigned long )pf == (unsigned long )((struct i40e_pf *)0)) { err = -12; goto err_pf_alloc; } else { } { pf->next_vsi = 0U; pf->pdev = pdev; set_bit(3L, (unsigned long volatile *)(& pf->state)); hw = & pf->hw; hw->back = (void *)pf; tmp___3 = ioremap(pdev->resource[0].start, pdev->resource[0].start != 0ULL || pdev->resource[0].end != pdev->resource[0].start ? (unsigned long )((pdev->resource[0].end - pdev->resource[0].start) + 1ULL) : 0UL); hw->hw_addr = (u8 *)tmp___3; } if ((unsigned long )hw->hw_addr == (unsigned long )((u8 *)0U)) { { err = -5; _dev_info((struct device const *)(& pdev->dev), "ioremap(0x%04x, 0x%04x) failed: 0x%x\n", (unsigned int )pdev->resource[0].start, pdev->resource[0].start != 0ULL || pdev->resource[0].end != pdev->resource[0].start ? (unsigned int )((pdev->resource[0].end - pdev->resource[0].start) + 1ULL) : 0U, err); } goto err_ioremap; } else { } { hw->vendor_id = pdev->vendor; hw->device_id = pdev->device; pci_read_config_byte((struct pci_dev const *)pdev, 8, & hw->revision_id); hw->subsystem_vendor_id = pdev->subsystem_vendor; hw->subsystem_device_id = pdev->subsystem_device; hw->bus.device = (unsigned int )((u16 )(pdev->devfn >> 3)) & 31U; hw->bus.func = (unsigned int )((u16 )pdev->devfn) & 7U; pf->instance = pfs_found; } if ((unsigned int )hw->revision_id == 0U) { { tmp___4 = readl((void const volatile *)hw->hw_addr + 1221888U); } if ((int )tmp___4 & 1) { { writel(1U, (void volatile *)hw->hw_addr + 754064U); readl((void const volatile *)hw->hw_addr + 745772U); msleep(200U); pf->corer_count = (u16 )((int )pf->corer_count + 1); i40e_clear_pxe_mode(hw); } } else { } } else { } { tmp___5 = i40e_pf_reset(hw); err = (int )tmp___5; } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "Initial pf_reset failed: %d\n", err); } goto err_pf_reset; } else { } { pf->pfr_count = (u16 )((int )pf->pfr_count + 1); hw->aq.num_arq_entries = 32U; hw->aq.num_asq_entries = 32U; hw->aq.arq_buf_size = 4096U; hw->aq.asq_buf_size = 4096U; pf->adminq_work_limit = 16U; tmp___6 = dev_driver_string((struct device const *)(& (pf->pdev)->dev)); snprintf((char *)(& pf->misc_int_name), 24UL, "%s-pf%d:misc", tmp___6, (int )pf->hw.pf_id); tmp___7 = i40e_init_shared_code(hw); err = (int )tmp___7; } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "init_shared_code failed: %d\n", err); } goto err_pf_reset; } else { } { pf->hw.fc.requested_mode = 0; tmp___8 = i40e_init_adminq(hw); err = (int )tmp___8; tmp___9 = i40e_fw_version_str(hw); _dev_info((struct device const *)(& pdev->dev), "%s\n", tmp___9); } if ((unsigned int )((int )hw->nvm.version >> 8) != 2U) { { _dev_info((struct device const *)(& pdev->dev), "warning: NVM version not supported, supported version: %02x.%02x\n", 2, 48); } } else { } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "init_adminq failed: %d expecting API %02x.%02x\n", err, 1, 1); } goto err_pf_reset; } else { } { i40e_clear_pxe_mode(hw); err = i40e_get_capabilities(pf); } if (err != 0) { goto err_adminq_setup; } else { } { err = i40e_sw_init(pf); } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "sw_init failed: %d\n", err); } goto err_sw_init; } else { } { tmp___10 = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, hw->func_caps.num_rx_qp, pf->fcoe_hmc_cntx_num, pf->fcoe_hmc_filt_num); err = (int )tmp___10; } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "init_lan_hmc failed: %d\n", err); } goto err_init_lan_hmc; } else { } { tmp___11 = i40e_configure_lan_hmc(hw, 1); err = (int )tmp___11; } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "configure_lan_hmc failed: %d\n", err); err = -2; } goto err_configure_lan_hmc; } else { } { i40e_get_mac_addr(hw, (u8 *)(& hw->mac.addr)); tmp___12 = is_valid_ether_addr((u8 const *)(& hw->mac.addr)); } if (tmp___12) { tmp___13 = 0; } else { tmp___13 = 1; } if (tmp___13) { { _dev_info((struct device const *)(& pdev->dev), "invalid MAC address %pM\n", (u8 *)(& hw->mac.addr)); err = -5; } goto err_mac_addr; } else { } { _dev_info((struct device const *)(& pdev->dev), "MAC address: %pM\n", (u8 *)(& hw->mac.addr)); memcpy((void *)(& hw->mac.perm_addr), (void const *)(& hw->mac.addr), 6UL); pci_set_drvdata(pdev, (void *)pf); pci_save_state(pdev); err = i40e_init_pf_dcb(pf); } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "init_pf_dcb failed: %d\n", err); pf->flags = pf->flags & 0xffffffffffefffffULL; } goto err_init_dcb; } else { } { init_timer_key(& pf->service_timer, 0U, "((&pf->service_timer))", & __key); pf->service_timer.function = & i40e_service_timer; pf->service_timer.data = (unsigned long )pf; pf->service_timer_period = 250; __init_work(& pf->service_task, 0); __constr_expr_0.counter = 137438953408L; pf->service_task.data = __constr_expr_0; lockdep_init_map(& pf->service_task.lockdep_map, "(&pf->service_task)", & __key___0, 0); INIT_LIST_HEAD(& pf->service_task.entry); pf->service_task.func = & i40e_service_task; clear_bit(5L, (unsigned long volatile *)(& pf->state)); pf->flags = pf->flags | 512ULL; pf->link_check_timeout = jiffies; pf->wol_en = 0; device_set_wakeup_enable(& (pf->pdev)->dev, (int )pf->wol_en); i40e_determine_queue_usage(pf); i40e_init_interrupt_scheme(pf); len = pf->hw.func_caps.num_vsis * 8U; tmp___14 = kzalloc((size_t )len, 208U); pf->vsi = (struct i40e_vsi **)tmp___14; } if ((unsigned long )pf->vsi == (unsigned long )((struct i40e_vsi **)0)) { err = -12; goto err_switch_setup; } else { } { err = i40e_setup_pf_switch(pf, 0); } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "setup_pf_switch failed: %d\n", err); } goto err_vsis; } else { } { clear_bit(3L, (unsigned long volatile *)(& pf->state)); } if ((pf->flags & 8ULL) != 0ULL) { { err = i40e_setup_misc_vector(pf); } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "setup of misc vector failed: %d\n", err); } goto err_vsis; } else { } } else { } if (*((unsigned long *)pf + 232UL) == 524296UL) { { val = readl((void const volatile *)hw->hw_addr + 258304U); val = val & 4294967279U; writel(val, (void volatile *)hw->hw_addr + 258304U); readl((void const volatile *)hw->hw_addr + 745772U); } } else { } { pfs_found = (u16 )((int )pfs_found + 1); i40e_dbg_pf_init(pf); dv.major_version = 0U; dv.minor_version = 3U; dv.build_version = 30U; dv.subbuild_version = 0U; i40e_aq_send_driver_version(& pf->hw, & dv, (struct i40e_asq_cmd_details *)0); tmp___15 = round_jiffies((unsigned long )jiffies + (unsigned long )pf->service_timer_period); ldv_mod_timer_26(& pf->service_timer, tmp___15); pcie_capability_read_word(pf->pdev, 18, & link_status); i40e_set_pci_config_data(hw, (int )link_status); _dev_info((struct device const *)(& pdev->dev), "PCI Express: %s %s\n", (unsigned int )hw->bus.speed != 8000U ? ((unsigned int )hw->bus.speed != 5000U ? ((unsigned int )hw->bus.speed == 2500U ? (char *)"Speed 2.5GT/s" : (char *)"Unknown") : (char *)"Speed 5.0GT/s") : (char *)"Speed 8.0GT/s", (unsigned int )hw->bus.width != 8U ? ((unsigned int )hw->bus.width != 4U ? ((unsigned int )hw->bus.width != 2U ? ((unsigned int )hw->bus.width == 1U ? (char *)"Width x1" : (char *)"Unknown") : (char *)"Width x2") : (char *)"Width x4") : (char *)"Width x8"); } if ((unsigned int )hw->bus.width <= 7U || (unsigned int )hw->bus.speed <= 7999U) { { dev_warn((struct device const *)(& pdev->dev), "PCI-Express bandwidth available for this device may be insufficient for optimal performance.\n"); dev_warn((struct device const *)(& pdev->dev), "Please move the device to a different PCI-e link with more lanes and/or higher transfer rate.\n"); } } else { } return (0); err_vsis: { set_bit(3L, (unsigned long volatile *)(& pf->state)); i40e_clear_interrupt_scheme(pf); kfree((void const *)pf->vsi); } err_switch_setup: { i40e_reset_interrupt_capability(pf); ldv_del_timer_sync_27(& pf->service_timer); } err_init_dcb: ; err_mac_addr: ; err_configure_lan_hmc: { i40e_shutdown_lan_hmc(hw); } err_init_lan_hmc: { kfree((void const *)pf->qp_pile); kfree((void const *)pf->irq_pile); } err_sw_init: ; err_adminq_setup: { i40e_shutdown_adminq(hw); } err_pf_reset: { iounmap((void volatile *)hw->hw_addr); } err_ioremap: { kfree((void const *)pf); } err_pf_alloc: { pci_disable_pcie_error_reporting(pdev); tmp___16 = pci_select_bars(pdev, 512UL); pci_release_selected_regions(pdev, tmp___16); } err_pci_reg: ; err_dma: { pci_disable_device(pdev); } return (err); } } static void i40e_remove(struct pci_dev *pdev ) { struct i40e_pf *pf ; void *tmp ; i40e_status ret_code ; u32 reg ; int i ; int tmp___0 ; { { tmp = pci_get_drvdata(pdev); pf = (struct i40e_pf *)tmp; i40e_dbg_pf_exit(pf); i40e_ptp_stop(pf); } if ((pf->flags & 524288ULL) != 0ULL) { { i40e_free_vfs(pf); pf->flags = pf->flags & 0xfffffffffff7ffffULL; } } else { } { set_bit(3L, (unsigned long volatile *)(& pf->state)); ldv_del_timer_sync_28(& pf->service_timer); cancel_work_sync(& pf->service_task); i40e_fdir_teardown(pf); i = 0; } goto ldv_58966; ldv_58965: ; if ((unsigned long )pf->veb[i] == (unsigned long )((struct i40e_veb *)0)) { goto ldv_58964; } else { } if ((int )(pf->veb[i])->uplink_seid == (int )pf->mac_seid || (unsigned int )(pf->veb[i])->uplink_seid == 0U) { { i40e_switch_branch_release(pf->veb[i]); } } else { } ldv_58964: i = i + 1; ldv_58966: ; if (i <= 15) { goto ldv_58965; } else { } if ((unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi) != (unsigned long )((struct i40e_vsi *)0)) { { i40e_vsi_release(*(pf->vsi + (unsigned long )pf->lan_vsi)); } } else { } { i40e_stop_misc_vector(pf); } if ((pf->flags & 8ULL) != 0ULL) { { synchronize_irq((pf->msix_entries)->vector); ldv_free_irq_29((pf->msix_entries)->vector, (void *)pf); } } else { } { ret_code = i40e_shutdown_lan_hmc(& pf->hw); } if ((int )ret_code != 0) { { dev_warn((struct device const *)(& pdev->dev), "Failed to destroy the HMC resources: %d\n", (int )ret_code); } } else { } { ret_code = i40e_shutdown_adminq(& pf->hw); } if ((int )ret_code != 0) { { dev_warn((struct device const *)(& pdev->dev), "Failed to destroy the Admin Queue resources: %d\n", (int )ret_code); } } else { } { i40e_clear_interrupt_scheme(pf); i = 0; } goto ldv_58969; ldv_58968: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0)) { { i40e_vsi_clear_rings(*(pf->vsi + (unsigned long )i)); i40e_vsi_clear(*(pf->vsi + (unsigned long )i)); *(pf->vsi + (unsigned long )i) = (struct i40e_vsi *)0; } } else { } i = i + 1; ldv_58969: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_58968; } else { } i = 0; goto ldv_58972; ldv_58971: { kfree((void const *)pf->veb[i]); pf->veb[i] = (struct i40e_veb *)0; i = i + 1; } ldv_58972: ; if (i <= 15) { goto ldv_58971; } else { } { kfree((void const *)pf->qp_pile); kfree((void const *)pf->irq_pile); kfree((void const *)pf->sw_config); kfree((void const *)pf->vsi); reg = readl((void const volatile *)pf->hw.hw_addr + 599040U); writel(reg | 1U, (void volatile *)pf->hw.hw_addr + 599040U); readl((void const volatile *)pf->hw.hw_addr + 745772U); iounmap((void volatile *)pf->hw.hw_addr); kfree((void const *)pf); tmp___0 = pci_select_bars(pdev, 512UL); pci_release_selected_regions(pdev, tmp___0); pci_disable_pcie_error_reporting(pdev); pci_disable_device(pdev); } return; } } static pci_ers_result_t i40e_pci_error_detected(struct pci_dev *pdev , enum pci_channel_state error ) { struct i40e_pf *pf ; void *tmp ; int tmp___0 ; { { tmp = pci_get_drvdata(pdev); pf = (struct i40e_pf *)tmp; _dev_info((struct device const *)(& pdev->dev), "%s: error %d\n", "i40e_pci_error_detected", (unsigned int )error); tmp___0 = constant_test_bit(17L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 == 0) { { rtnl_lock(); i40e_prep_for_reset(pf); rtnl_unlock(); } } else { } return (3U); } } static pci_ers_result_t i40e_pci_error_slot_reset(struct pci_dev *pdev ) { struct i40e_pf *pf ; void *tmp ; pci_ers_result_t result ; int err ; u32 reg ; int tmp___0 ; { { tmp = pci_get_drvdata(pdev); pf = (struct i40e_pf *)tmp; _dev_info((struct device const *)(& pdev->dev), "%s\n", "i40e_pci_error_slot_reset"); tmp___0 = pci_enable_device_mem(pdev); } if (tmp___0 != 0) { { _dev_info((struct device const *)(& pdev->dev), "Cannot re-enable PCI device after reset.\n"); result = 4U; } } else { { pci_set_master(pdev); pci_restore_state(pdev); pci_save_state(pdev); pci_wake_from_d3(pdev, 0); reg = readl((void const volatile *)pf->hw.hw_addr + 754064U); } if (reg == 0U) { result = 5U; } else { result = 4U; } } { err = pci_cleanup_aer_uncorrect_error_status(pdev); } if (err != 0) { { _dev_info((struct device const *)(& pdev->dev), "pci_cleanup_aer_uncorrect_error_status failed 0x%0x\n", err); } } else { } return (result); } } static void i40e_pci_error_resume(struct pci_dev *pdev ) { struct i40e_pf *pf ; void *tmp ; int tmp___0 ; { { tmp = pci_get_drvdata(pdev); pf = (struct i40e_pf *)tmp; _dev_info((struct device const *)(& pdev->dev), "%s\n", "i40e_pci_error_resume"); tmp___0 = constant_test_bit(17L, (unsigned long const volatile *)(& pf->state)); } if (tmp___0 != 0) { return; } else { } { rtnl_lock(); i40e_handle_reset_warning(pf); rtnl_lock(); } return; } } static void i40e_shutdown(struct pci_dev *pdev ) { struct i40e_pf *pf ; void *tmp ; struct i40e_hw *hw ; { { tmp = pci_get_drvdata(pdev); pf = (struct i40e_pf *)tmp; hw = & pf->hw; set_bit(17L, (unsigned long volatile *)(& pf->state)); set_bit(3L, (unsigned long volatile *)(& pf->state)); rtnl_lock(); i40e_prep_for_reset(pf); rtnl_unlock(); writel((unsigned int )pf->wol_en, (void volatile *)hw->hw_addr + 753792U); writel((int )pf->wol_en ? 2U : 0U, (void volatile *)hw->hw_addr + 439296U); } if ((unsigned int )system_state == 3U) { { pci_wake_from_d3(pdev, (int )pf->wol_en); pci_set_power_state(pdev, 3); } } else { } return; } } static int i40e_suspend(struct pci_dev *pdev , pm_message_t state ) { struct i40e_pf *pf ; void *tmp ; struct i40e_hw *hw ; { { tmp = pci_get_drvdata(pdev); pf = (struct i40e_pf *)tmp; hw = & pf->hw; set_bit(17L, (unsigned long volatile *)(& pf->state)); set_bit(3L, (unsigned long volatile *)(& pf->state)); rtnl_lock(); i40e_prep_for_reset(pf); rtnl_unlock(); writel((unsigned int )pf->wol_en, (void volatile *)hw->hw_addr + 753792U); writel((int )pf->wol_en ? 2U : 0U, (void volatile *)hw->hw_addr + 439296U); pci_wake_from_d3(pdev, (int )pf->wol_en); pci_set_power_state(pdev, 3); } return (0); } } static int i40e_resume(struct pci_dev *pdev ) { struct i40e_pf *pf ; void *tmp ; u32 err ; int tmp___0 ; int tmp___1 ; { { tmp = pci_get_drvdata(pdev); pf = (struct i40e_pf *)tmp; pci_set_power_state(pdev, 0); pci_restore_state(pdev); pci_save_state(pdev); tmp___0 = pci_enable_device_mem(pdev); err = (u32 )tmp___0; } if (err != 0U) { { dev_err((struct device const *)(& pdev->dev), "%s: Cannot enable PCI device from suspend\n", "i40e_resume"); } return ((int )err); } else { } { pci_set_master(pdev); pci_wake_from_d3(pdev, 0); tmp___1 = test_and_set_bit(17L, (unsigned long volatile *)(& pf->state)); } if (tmp___1 != 0) { { clear_bit(3L, (unsigned long volatile *)(& pf->state)); rtnl_lock(); i40e_reset_and_rebuild(pf, 0); rtnl_unlock(); } } else { } return (0); } } static struct pci_error_handlers const i40e_err_handler = {& i40e_pci_error_detected, 0, 0, & i40e_pci_error_slot_reset, & i40e_pci_error_resume}; static struct pci_driver i40e_driver = {{0, 0}, (char const *)(& i40e_driver_name), (struct pci_device_id const *)(& i40e_pci_tbl), & i40e_probe, & i40e_remove, & i40e_suspend, 0, 0, & i40e_resume, & i40e_shutdown, & i40e_pci_sriov_configure, & i40e_err_handler, {0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {{{{{{0U}}, 0U, 0U, 0, {0, {0, 0}, 0, 0, 0UL}}}}, {0, 0}}}; static int i40e_init_module(void) { int tmp ; { { printk("\016%s: %s - version %s\n", (char const *)(& i40e_driver_name), (char const *)(& i40e_driver_string), (char const *)(& i40e_driver_version_str)); printk("\016%s: %s\n", (char const *)(& i40e_driver_name), (char const *)(& i40e_copyright)); i40e_dbg_init(); tmp = ldv___pci_register_driver_30(& i40e_driver, & __this_module, "i40e"); } return (tmp); } } static void i40e_exit_module(void) { { { ldv_pci_unregister_driver_31(& i40e_driver); i40e_dbg_exit(); } return; } } void ldv_EMGentry_exit_i40e_exit_module_24_2(void (*arg0)(void) ) ; int ldv_EMGentry_init_i40e_init_module_24_11(int (*arg0)(void) ) ; int ldv___pci_register_driver(int arg0 , struct pci_driver *arg1 , struct module *arg2 , char *arg3 ) ; struct net_device *ldv_alloc_etherdev_mqs(struct net_device *arg0 , int arg1 , unsigned int arg2 , unsigned int arg3 ) ; void ldv_allocate_external_0(void) ; int ldv_del_timer_sync(int arg0 , struct timer_list *arg1 ) ; void ldv_dispatch_deregister_22_1(struct pci_driver *arg0 ) ; void ldv_dispatch_deregister_dummy_resourceless_instance_16_24_4(void) ; void ldv_dispatch_deregister_file_operations_instance_9_24_5(void) ; void ldv_dispatch_instance_deregister_13_1(struct timer_list *arg0 ) ; void ldv_dispatch_instance_register_16_2(struct timer_list *arg0 ) ; void ldv_dispatch_irq_deregister_14_1(int arg0 ) ; void ldv_dispatch_irq_register_18_2(int arg0 , enum irqreturn (*arg1)(int , void * ) , enum irqreturn (*arg2)(int , void * ) , void *arg3 ) ; void ldv_dispatch_irq_register_19_2(int arg0 , enum irqreturn (*arg1)(int , void * ) , enum irqreturn (*arg2)(int , void * ) , void *arg3 ) ; void ldv_dispatch_irq_register_20_2(int arg0 , enum irqreturn (*arg1)(int , void * ) , enum irqreturn (*arg2)(int , void * ) , void *arg3 ) ; void ldv_dispatch_register_23_2(struct pci_driver *arg0 ) ; void ldv_dispatch_register_dummy_resourceless_instance_16_24_6(void) ; void ldv_dispatch_register_file_operations_instance_9_24_7(void) ; void ldv_dummy_resourceless_instance_callback_10_10(int (*arg0)(struct net_device * , struct ieee_ets * ) , struct net_device *arg1 , struct ieee_ets *arg2 ) ; void ldv_dummy_resourceless_instance_callback_10_11(int (*arg0)(struct net_device * , struct ieee_pfc * ) , struct net_device *arg1 , struct ieee_pfc *arg2 ) ; void ldv_dummy_resourceless_instance_callback_10_3(unsigned char (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_10_7(void (*arg0)(struct net_device * , unsigned char * ) , struct net_device *arg1 , unsigned char *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_3(void (*arg0)(struct net_device * , struct ethtool_channels * ) , struct net_device *arg1 , struct ethtool_channels *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_34(void (*arg0)(struct net_device * , unsigned short , unsigned short ) , struct net_device *arg1 , unsigned short arg2 , unsigned short arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_37(int (*arg0)(struct net_device * , int ) , struct net_device *arg1 , int arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_40(void (*arg0)(struct net_device * , unsigned short , unsigned short ) , struct net_device *arg1 , unsigned short arg2 , unsigned short arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_43(int (*arg0)(struct net_device * , struct ifreq * , int ) , struct net_device *arg1 , struct ifreq *arg2 , int arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_46(struct rtnl_link_stats64 *(*arg0)(struct net_device * , struct rtnl_link_stats64 * ) , struct net_device *arg1 , struct rtnl_link_stats64 *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_47(int (*arg0)(struct net_device * , int , struct ifla_vf_info * ) , struct net_device *arg1 , int arg2 , struct ifla_vf_info *arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_50(void (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_51(int (*arg0)(struct net_device * , unsigned long long ) , struct net_device *arg1 , unsigned long long arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_54(int (*arg0)(struct net_device * , void * ) , struct net_device *arg1 , void *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_55(void (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_56(int (*arg0)(struct net_device * , int , unsigned char * ) , struct net_device *arg1 , int arg2 , unsigned char *arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_59(int (*arg0)(struct net_device * , int , int ) , struct net_device *arg1 , int arg2 , int arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_62(int (*arg0)(struct net_device * , int , unsigned short , unsigned char ) , struct net_device *arg1 , int arg2 , unsigned short arg3 , unsigned char arg4 ) ; void ldv_dummy_resourceless_instance_callback_8_65(int (*arg0)(struct net_device * , unsigned char ) , struct net_device *arg1 , unsigned char arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_68(enum netdev_tx (*arg0)(struct sk_buff * , struct net_device * ) , struct sk_buff *arg1 , struct net_device *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_69(void (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_70(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_71(int (*arg0)(struct net_device * , unsigned short , unsigned short ) , struct net_device *arg1 , unsigned short arg2 , unsigned short arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_74(int (*arg0)(struct net_device * , unsigned short , unsigned short ) , struct net_device *arg1 , unsigned short arg2 , unsigned short arg3 ) ; void ldv_entry_EMGentry_24(void *arg0 ) ; int main(void) ; void ldv_file_operations_file_operations_instance_0(void *arg0 ) ; void ldv_file_operations_file_operations_instance_1(void *arg0 ) ; void ldv_file_operations_file_operations_instance_2(void *arg0 ) ; void ldv_free_irq(void *arg0 , int arg1 , void *arg2 ) ; extern void ldv_free_netdev(void * , struct net_device * ) ; void ldv_iio_triggered_buffer_iio_triggered_buffer_instance_3(void *arg0 ) ; void ldv_iio_triggered_buffer_iio_triggered_buffer_instance_4(void *arg0 ) ; enum irqreturn ldv_iio_triggered_buffer_instance_handler_3_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; enum irqreturn ldv_iio_triggered_buffer_instance_handler_4_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; void ldv_iio_triggered_buffer_instance_thread_3_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; void ldv_iio_triggered_buffer_instance_thread_4_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; void ldv_initialize_external_data(void) ; enum irqreturn ldv_interrupt_instance_handler_5_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; enum irqreturn ldv_interrupt_instance_handler_6_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; enum irqreturn ldv_interrupt_instance_handler_7_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; void ldv_interrupt_instance_thread_5_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; void ldv_interrupt_instance_thread_6_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; void ldv_interrupt_instance_thread_7_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) ; void ldv_interrupt_interrupt_instance_5(void *arg0 ) ; void ldv_interrupt_interrupt_instance_6(void *arg0 ) ; void ldv_interrupt_interrupt_instance_7(void *arg0 ) ; int ldv_mod_timer(int arg0 , struct timer_list *arg1 , unsigned long arg2 ) ; void ldv_net_dummy_resourceless_instance_8(void *arg0 ) ; void ldv_pci_instance_callback_9_10(unsigned int (*arg0)(struct pci_dev * , enum pci_channel_state ) , struct pci_dev *arg1 , enum pci_channel_state arg2 ) ; void ldv_pci_instance_callback_9_23(void (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) ; void ldv_pci_instance_callback_9_24(unsigned int (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) ; void ldv_pci_instance_callback_9_25(int (*arg0)(struct pci_dev * , int ) , struct pci_dev *arg1 , int arg2 ) ; int ldv_pci_instance_probe_9_17(int (*arg0)(struct pci_dev * , struct pci_device_id * ) , struct pci_dev *arg1 , struct pci_device_id *arg2 ) ; void ldv_pci_instance_release_9_2(void (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) ; void ldv_pci_instance_resume_9_5(int (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) ; void ldv_pci_instance_resume_early_9_6(int (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) ; void ldv_pci_instance_shutdown_9_3(void (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) ; int ldv_pci_instance_suspend_9_8(int (*arg0)(struct pci_dev * , struct pm_message ) , struct pci_dev *arg1 , struct pm_message arg2 ) ; int ldv_pci_instance_suspend_late_9_7(int (*arg0)(struct pci_dev * , struct pm_message ) , struct pci_dev *arg1 , struct pm_message arg2 ) ; void ldv_pci_pci_instance_9(void *arg0 ) ; void ldv_pci_unregister_driver(void *arg0 , struct pci_driver *arg1 ) ; extern int ldv_register_netdev(int , struct net_device * ) ; int ldv_register_netdev_open_17_6(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; int ldv_request_irq(int arg0 , unsigned int arg1 , enum irqreturn (*arg2)(int , void * ) , unsigned long arg3 , char *arg4 , void *arg5 ) ; void ldv_struct_dcbnl_rtnl_ops_dummy_resourceless_instance_10(void *arg0 ) ; int ldv_switch_0(void) ; int ldv_switch_1(void) ; int ldv_switch_2(void) ; int ldv_switch_3(void) ; void ldv_switch_automaton_state_0_15(void) ; void ldv_switch_automaton_state_0_6(void) ; void ldv_switch_automaton_state_10_1(void) ; void ldv_switch_automaton_state_10_5(void) ; void ldv_switch_automaton_state_11_1(void) ; void ldv_switch_automaton_state_11_3(void) ; void ldv_switch_automaton_state_1_15(void) ; void ldv_switch_automaton_state_1_6(void) ; void ldv_switch_automaton_state_2_15(void) ; void ldv_switch_automaton_state_2_6(void) ; void ldv_switch_automaton_state_5_1(void) ; void ldv_switch_automaton_state_5_6(void) ; void ldv_switch_automaton_state_6_1(void) ; void ldv_switch_automaton_state_6_6(void) ; void ldv_switch_automaton_state_7_1(void) ; void ldv_switch_automaton_state_7_6(void) ; void ldv_switch_automaton_state_8_1(void) ; void ldv_switch_automaton_state_8_5(void) ; void ldv_switch_automaton_state_9_11(void) ; void ldv_switch_automaton_state_9_20(void) ; void ldv_timer_instance_callback_11_2(void (*arg0)(unsigned long ) , unsigned long arg1 ) ; void ldv_timer_timer_instance_11(void *arg0 ) ; extern void ldv_unregister_netdev(void * , struct net_device * ) ; void ldv_unregister_netdev_stop_21_2(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; char *ldv_0_ldv_param_4_1_default ; long long *ldv_0_ldv_param_4_3_default ; char *ldv_0_ldv_param_5_1_default ; long long *ldv_0_ldv_param_5_3_default ; struct file *ldv_0_resource_file ; struct inode *ldv_0_resource_inode ; int ldv_0_ret_default ; unsigned long ldv_0_size_cnt_write_size ; unsigned char (*ldv_10_callback_getdcbx)(struct net_device * ) ; void (*ldv_10_callback_getpermhwaddr)(struct net_device * , unsigned char * ) ; int (*ldv_10_callback_ieee_getets)(struct net_device * , struct ieee_ets * ) ; int (*ldv_10_callback_ieee_getpfc)(struct net_device * , struct ieee_pfc * ) ; struct ieee_ets *ldv_10_container_struct_ieee_ets_ptr ; struct ieee_pfc *ldv_10_container_struct_ieee_pfc_ptr ; struct net_device *ldv_10_container_struct_net_device_ptr ; unsigned char *ldv_10_ldv_param_7_1_default ; struct timer_list *ldv_11_container_timer_list ; char *ldv_1_ldv_param_4_1_default ; long long *ldv_1_ldv_param_4_3_default ; char *ldv_1_ldv_param_5_1_default ; long long *ldv_1_ldv_param_5_3_default ; struct file *ldv_1_resource_file ; struct inode *ldv_1_resource_inode ; int ldv_1_ret_default ; unsigned long ldv_1_size_cnt_write_size ; void (*ldv_24_exit_i40e_exit_module_default)(void) ; int (*ldv_24_init_i40e_init_module_default)(void) ; int ldv_24_ret_default ; char *ldv_2_ldv_param_4_1_default ; long long *ldv_2_ldv_param_4_3_default ; char *ldv_2_ldv_param_5_1_default ; long long *ldv_2_ldv_param_5_3_default ; struct file *ldv_2_resource_file ; struct inode *ldv_2_resource_inode ; int ldv_2_ret_default ; unsigned long ldv_2_size_cnt_write_size ; enum irqreturn (*ldv_3_callback_handler)(int , void * ) ; void *ldv_3_data_data ; struct iio_dev *ldv_3_dev_dev ; int ldv_3_line_line ; enum irqreturn ldv_3_ret_val_default ; enum irqreturn (*ldv_3_thread_thread)(int , void * ) ; enum irqreturn (*ldv_4_callback_handler)(int , void * ) ; void *ldv_4_data_data ; struct iio_dev *ldv_4_dev_dev ; int ldv_4_line_line ; enum irqreturn ldv_4_ret_val_default ; enum irqreturn (*ldv_4_thread_thread)(int , void * ) ; enum irqreturn (*ldv_5_callback_handler)(int , void * ) ; void *ldv_5_data_data ; int ldv_5_line_line ; enum irqreturn ldv_5_ret_val_default ; enum irqreturn (*ldv_5_thread_thread)(int , void * ) ; enum irqreturn (*ldv_6_callback_handler)(int , void * ) ; void *ldv_6_data_data ; int ldv_6_line_line ; enum irqreturn ldv_6_ret_val_default ; enum irqreturn (*ldv_6_thread_thread)(int , void * ) ; enum irqreturn (*ldv_7_callback_handler)(int , void * ) ; void *ldv_7_data_data ; int ldv_7_line_line ; enum irqreturn ldv_7_ret_val_default ; enum irqreturn (*ldv_7_thread_thread)(int , void * ) ; void (*ldv_8_callback_get_channels)(struct net_device * , struct ethtool_channels * ) ; void (*ldv_8_callback_ndo_add_vxlan_port)(struct net_device * , unsigned short , unsigned short ) ; int (*ldv_8_callback_ndo_change_mtu)(struct net_device * , int ) ; void (*ldv_8_callback_ndo_del_vxlan_port)(struct net_device * , unsigned short , unsigned short ) ; int (*ldv_8_callback_ndo_do_ioctl)(struct net_device * , struct ifreq * , int ) ; struct rtnl_link_stats64 *(*ldv_8_callback_ndo_get_stats64)(struct net_device * , struct rtnl_link_stats64 * ) ; int (*ldv_8_callback_ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) ; void (*ldv_8_callback_ndo_poll_controller)(struct net_device * ) ; int (*ldv_8_callback_ndo_set_features)(struct net_device * , unsigned long long ) ; int (*ldv_8_callback_ndo_set_mac_address)(struct net_device * , void * ) ; void (*ldv_8_callback_ndo_set_rx_mode)(struct net_device * ) ; int (*ldv_8_callback_ndo_set_vf_mac)(struct net_device * , int , unsigned char * ) ; int (*ldv_8_callback_ndo_set_vf_tx_rate)(struct net_device * , int , int ) ; int (*ldv_8_callback_ndo_set_vf_vlan)(struct net_device * , int , unsigned short , unsigned char ) ; int (*ldv_8_callback_ndo_setup_tc)(struct net_device * , unsigned char ) ; enum netdev_tx (*ldv_8_callback_ndo_start_xmit)(struct sk_buff * , struct net_device * ) ; void (*ldv_8_callback_ndo_tx_timeout)(struct net_device * ) ; int (*ldv_8_callback_ndo_validate_addr)(struct net_device * ) ; int (*ldv_8_callback_ndo_vlan_rx_add_vid)(struct net_device * , unsigned short , unsigned short ) ; int (*ldv_8_callback_ndo_vlan_rx_kill_vid)(struct net_device * , unsigned short , unsigned short ) ; enum ethtool_phys_id_state ldv_8_container_enum_ethtool_phys_id_state ; struct net_device *ldv_8_container_net_device ; struct ethtool_channels *ldv_8_container_struct_ethtool_channels_ptr ; struct ethtool_cmd *ldv_8_container_struct_ethtool_cmd_ptr ; struct ethtool_coalesce *ldv_8_container_struct_ethtool_coalesce_ptr ; struct ethtool_drvinfo *ldv_8_container_struct_ethtool_drvinfo_ptr ; struct ethtool_eeprom *ldv_8_container_struct_ethtool_eeprom_ptr ; struct ethtool_pauseparam *ldv_8_container_struct_ethtool_pauseparam_ptr ; struct ethtool_regs *ldv_8_container_struct_ethtool_regs_ptr ; struct ethtool_ringparam *ldv_8_container_struct_ethtool_ringparam_ptr ; struct ethtool_rxnfc *ldv_8_container_struct_ethtool_rxnfc_ptr ; struct ethtool_stats *ldv_8_container_struct_ethtool_stats_ptr ; struct ethtool_test *ldv_8_container_struct_ethtool_test_ptr ; struct ethtool_ts_info *ldv_8_container_struct_ethtool_ts_info_ptr ; struct ethtool_wolinfo *ldv_8_container_struct_ethtool_wolinfo_ptr ; struct ifla_vf_info *ldv_8_container_struct_ifla_vf_info_ptr ; struct ifreq *ldv_8_container_struct_ifreq_ptr ; struct rtnl_link_stats64 *ldv_8_container_struct_rtnl_link_stats64_ptr ; struct sk_buff *ldv_8_container_struct_sk_buff_ptr ; unsigned long long *ldv_8_ldv_param_13_2_default ; unsigned int *ldv_8_ldv_param_22_2_default ; int ldv_8_ldv_param_26_1_default ; unsigned int ldv_8_ldv_param_29_1_default ; unsigned char *ldv_8_ldv_param_29_2_default ; unsigned short ldv_8_ldv_param_34_1_default ; unsigned short ldv_8_ldv_param_34_2_default ; int ldv_8_ldv_param_37_1_default ; unsigned short ldv_8_ldv_param_40_1_default ; unsigned short ldv_8_ldv_param_40_2_default ; int ldv_8_ldv_param_43_2_default ; int ldv_8_ldv_param_47_1_default ; unsigned long long ldv_8_ldv_param_51_1_default ; int ldv_8_ldv_param_56_1_default ; unsigned char *ldv_8_ldv_param_56_2_default ; int ldv_8_ldv_param_59_1_default ; int ldv_8_ldv_param_59_2_default ; int ldv_8_ldv_param_62_1_default ; unsigned short ldv_8_ldv_param_62_2_default ; unsigned char ldv_8_ldv_param_62_3_default ; unsigned char ldv_8_ldv_param_65_1_default ; unsigned short ldv_8_ldv_param_71_1_default ; unsigned short ldv_8_ldv_param_71_2_default ; unsigned short ldv_8_ldv_param_74_1_default ; unsigned short ldv_8_ldv_param_74_2_default ; unsigned long long *ldv_8_ldv_param_78_2_default ; unsigned int ldv_8_ldv_param_83_1_default ; unsigned char *ldv_8_ldv_param_9_2_default ; unsigned int (*ldv_9_callback_error_detected)(struct pci_dev * , enum pci_channel_state ) ; void (*ldv_9_callback_func_1_ptr)(struct pci_dev * ) ; unsigned int (*ldv_9_callback_slot_reset)(struct pci_dev * ) ; int (*ldv_9_callback_sriov_configure)(struct pci_dev * , int ) ; struct pci_driver *ldv_9_container_pci_driver ; int ldv_9_ldv_param_25_1_default ; struct pci_dev *ldv_9_resource_dev ; enum pci_channel_state ldv_9_resource_enum_pci_channel_state ; struct pm_message ldv_9_resource_pm_message ; struct pci_device_id *ldv_9_resource_struct_pci_device_id_ptr ; int ldv_9_ret_default ; int ldv_statevar_0 ; int ldv_statevar_1 ; int ldv_statevar_10 ; int ldv_statevar_11 ; int ldv_statevar_2 ; int ldv_statevar_24 ; int ldv_statevar_3 ; int ldv_statevar_4 ; int ldv_statevar_5 ; int ldv_statevar_6 ; int ldv_statevar_7 ; int ldv_statevar_8 ; int ldv_statevar_9 ; void (*ldv_24_exit_i40e_exit_module_default)(void) = & i40e_exit_module; int (*ldv_24_init_i40e_init_module_default)(void) = & i40e_init_module; enum irqreturn (*ldv_3_callback_handler)(int , void * ) = & i40e_fdir_clean_ring; enum irqreturn (*ldv_3_thread_thread)(int , void * ) = & i40e_msix_clean_rings; enum irqreturn (*ldv_4_callback_handler)(int , void * ) = & i40e_msix_clean_rings; enum irqreturn (*ldv_4_thread_thread)(int , void * ) = & i40e_msix_clean_rings; enum irqreturn (*ldv_5_callback_handler)(int , void * ) = & i40e_fdir_clean_ring; enum irqreturn (*ldv_5_thread_thread)(int , void * ) = & i40e_msix_clean_rings; enum irqreturn (*ldv_6_callback_handler)(int , void * ) = & i40e_intr; enum irqreturn (*ldv_6_thread_thread)(int , void * ) = & i40e_msix_clean_rings; enum irqreturn (*ldv_7_callback_handler)(int , void * ) = & i40e_msix_clean_rings; enum irqreturn (*ldv_7_thread_thread)(int , void * ) = & i40e_msix_clean_rings; void (*ldv_8_callback_ndo_add_vxlan_port)(struct net_device * , unsigned short , unsigned short ) = & i40e_add_vxlan_port; int (*ldv_8_callback_ndo_change_mtu)(struct net_device * , int ) = & i40e_change_mtu; void (*ldv_8_callback_ndo_del_vxlan_port)(struct net_device * , unsigned short , unsigned short ) = & i40e_del_vxlan_port; int (*ldv_8_callback_ndo_do_ioctl)(struct net_device * , struct ifreq * , int ) = & i40e_ioctl; struct rtnl_link_stats64 *(*ldv_8_callback_ndo_get_stats64)(struct net_device * , struct rtnl_link_stats64 * ) = & i40e_get_netdev_stats_struct; int (*ldv_8_callback_ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) = & i40e_ndo_get_vf_config; void (*ldv_8_callback_ndo_poll_controller)(struct net_device * ) = & i40e_netpoll; int (*ldv_8_callback_ndo_set_features)(struct net_device * , unsigned long long ) = & i40e_set_features; int (*ldv_8_callback_ndo_set_mac_address)(struct net_device * , void * ) = & i40e_set_mac; void (*ldv_8_callback_ndo_set_rx_mode)(struct net_device * ) = & i40e_set_rx_mode; int (*ldv_8_callback_ndo_set_vf_mac)(struct net_device * , int , unsigned char * ) = & i40e_ndo_set_vf_mac; int (*ldv_8_callback_ndo_set_vf_tx_rate)(struct net_device * , int , int ) = & i40e_ndo_set_vf_bw; int (*ldv_8_callback_ndo_set_vf_vlan)(struct net_device * , int , unsigned short , unsigned char ) = & i40e_ndo_set_vf_port_vlan; int (*ldv_8_callback_ndo_setup_tc)(struct net_device * , unsigned char ) = & i40e_setup_tc; enum netdev_tx (*ldv_8_callback_ndo_start_xmit)(struct sk_buff * , struct net_device * ) = & i40e_lan_xmit_frame; void (*ldv_8_callback_ndo_tx_timeout)(struct net_device * ) = & i40e_tx_timeout; int (*ldv_8_callback_ndo_validate_addr)(struct net_device * ) = & eth_validate_addr; int (*ldv_8_callback_ndo_vlan_rx_add_vid)(struct net_device * , unsigned short , unsigned short ) = & i40e_vlan_rx_add_vid; int (*ldv_8_callback_ndo_vlan_rx_kill_vid)(struct net_device * , unsigned short , unsigned short ) = & i40e_vlan_rx_kill_vid; unsigned int (*ldv_9_callback_error_detected)(struct pci_dev * , enum pci_channel_state ) = & i40e_pci_error_detected; void (*ldv_9_callback_func_1_ptr)(struct pci_dev * ) = & i40e_pci_error_resume; unsigned int (*ldv_9_callback_slot_reset)(struct pci_dev * ) = & i40e_pci_error_slot_reset; int (*ldv_9_callback_sriov_configure)(struct pci_dev * , int ) = & i40e_pci_sriov_configure; void ldv_EMGentry_exit_i40e_exit_module_24_2(void (*arg0)(void) ) { { { i40e_exit_module(); } return; } } int ldv_EMGentry_init_i40e_init_module_24_11(int (*arg0)(void) ) { int tmp ; { { tmp = i40e_init_module(); } return (tmp); } } int ldv___pci_register_driver(int arg0 , struct pci_driver *arg1 , struct module *arg2 , char *arg3 ) { struct pci_driver *ldv_23_pci_driver_pci_driver ; int tmp ; { { tmp = ldv_undef_int(); } if (tmp != 0) { { ldv_assume(arg0 == 0); ldv_23_pci_driver_pci_driver = arg1; ldv_assume(ldv_statevar_9 == 20); ldv_dispatch_register_23_2(ldv_23_pci_driver_pci_driver); } return (arg0); } else { { ldv_assume(arg0 != 0); } return (arg0); } return (arg0); } } struct net_device *ldv_alloc_etherdev_mqs(struct net_device *arg0 , int arg1 , unsigned int arg2 , unsigned int arg3 ) { struct net_device *ldv_12_netdev_net_device ; void *tmp ; int tmp___0 ; { { tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { { tmp = ldv_xmalloc(3200UL); ldv_12_netdev_net_device = (struct net_device *)tmp; } return (ldv_12_netdev_net_device); return (arg0); } else { return ((struct net_device *)0); return (arg0); } return (arg0); } } void ldv_allocate_external_0(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 ; void *tmp___10 ; void *tmp___11 ; void *tmp___12 ; void *tmp___13 ; void *tmp___14 ; void *tmp___15 ; void *tmp___16 ; void *tmp___17 ; void *tmp___18 ; void *tmp___19 ; void *tmp___20 ; void *tmp___21 ; void *tmp___22 ; void *tmp___23 ; void *tmp___24 ; void *tmp___25 ; void *tmp___26 ; void *tmp___27 ; void *tmp___28 ; void *tmp___29 ; void *tmp___30 ; void *tmp___31 ; void *tmp___32 ; void *tmp___33 ; void *tmp___34 ; void *tmp___35 ; void *tmp___36 ; void *tmp___37 ; void *tmp___38 ; void *tmp___39 ; void *tmp___40 ; void *tmp___41 ; void *tmp___42 ; void *tmp___43 ; void *tmp___44 ; void *tmp___45 ; void *tmp___46 ; void *tmp___47 ; void *tmp___48 ; { { tmp = external_allocated_data(); ldv_0_ldv_param_4_1_default = (char *)tmp; tmp___0 = external_allocated_data(); ldv_0_ldv_param_4_3_default = (long long *)tmp___0; tmp___1 = external_allocated_data(); ldv_0_ldv_param_5_1_default = (char *)tmp___1; tmp___2 = external_allocated_data(); ldv_0_ldv_param_5_3_default = (long long *)tmp___2; tmp___3 = external_allocated_data(); ldv_0_resource_file = (struct file *)tmp___3; tmp___4 = external_allocated_data(); ldv_0_resource_inode = (struct inode *)tmp___4; tmp___5 = external_allocated_data(); ldv_1_ldv_param_4_1_default = (char *)tmp___5; tmp___6 = external_allocated_data(); ldv_1_ldv_param_4_3_default = (long long *)tmp___6; tmp___7 = external_allocated_data(); ldv_1_ldv_param_5_1_default = (char *)tmp___7; tmp___8 = external_allocated_data(); ldv_1_ldv_param_5_3_default = (long long *)tmp___8; tmp___9 = external_allocated_data(); ldv_1_resource_file = (struct file *)tmp___9; tmp___10 = external_allocated_data(); ldv_1_resource_inode = (struct inode *)tmp___10; tmp___11 = external_allocated_data(); ldv_2_ldv_param_4_1_default = (char *)tmp___11; tmp___12 = external_allocated_data(); ldv_2_ldv_param_4_3_default = (long long *)tmp___12; tmp___13 = external_allocated_data(); ldv_2_ldv_param_5_1_default = (char *)tmp___13; tmp___14 = external_allocated_data(); ldv_2_ldv_param_5_3_default = (long long *)tmp___14; tmp___15 = external_allocated_data(); ldv_2_resource_file = (struct file *)tmp___15; tmp___16 = external_allocated_data(); ldv_2_resource_inode = (struct inode *)tmp___16; ldv_3_data_data = external_allocated_data(); tmp___17 = external_allocated_data(); ldv_3_dev_dev = (struct iio_dev *)tmp___17; ldv_4_data_data = external_allocated_data(); tmp___18 = external_allocated_data(); ldv_4_dev_dev = (struct iio_dev *)tmp___18; ldv_5_data_data = external_allocated_data(); ldv_6_data_data = external_allocated_data(); ldv_7_data_data = external_allocated_data(); tmp___19 = external_allocated_data(); ldv_8_container_net_device = (struct net_device *)tmp___19; tmp___20 = external_allocated_data(); ldv_8_container_struct_ethtool_channels_ptr = (struct ethtool_channels *)tmp___20; tmp___21 = external_allocated_data(); ldv_8_container_struct_ethtool_cmd_ptr = (struct ethtool_cmd *)tmp___21; tmp___22 = external_allocated_data(); ldv_8_container_struct_ethtool_coalesce_ptr = (struct ethtool_coalesce *)tmp___22; tmp___23 = external_allocated_data(); ldv_8_container_struct_ethtool_drvinfo_ptr = (struct ethtool_drvinfo *)tmp___23; tmp___24 = external_allocated_data(); ldv_8_container_struct_ethtool_eeprom_ptr = (struct ethtool_eeprom *)tmp___24; tmp___25 = external_allocated_data(); ldv_8_container_struct_ethtool_pauseparam_ptr = (struct ethtool_pauseparam *)tmp___25; tmp___26 = external_allocated_data(); ldv_8_container_struct_ethtool_regs_ptr = (struct ethtool_regs *)tmp___26; tmp___27 = external_allocated_data(); ldv_8_container_struct_ethtool_ringparam_ptr = (struct ethtool_ringparam *)tmp___27; tmp___28 = external_allocated_data(); ldv_8_container_struct_ethtool_rxnfc_ptr = (struct ethtool_rxnfc *)tmp___28; tmp___29 = external_allocated_data(); ldv_8_container_struct_ethtool_stats_ptr = (struct ethtool_stats *)tmp___29; tmp___30 = external_allocated_data(); ldv_8_container_struct_ethtool_test_ptr = (struct ethtool_test *)tmp___30; tmp___31 = external_allocated_data(); ldv_8_container_struct_ethtool_ts_info_ptr = (struct ethtool_ts_info *)tmp___31; tmp___32 = external_allocated_data(); ldv_8_container_struct_ethtool_wolinfo_ptr = (struct ethtool_wolinfo *)tmp___32; tmp___33 = external_allocated_data(); ldv_8_container_struct_ifla_vf_info_ptr = (struct ifla_vf_info *)tmp___33; tmp___34 = external_allocated_data(); ldv_8_container_struct_ifreq_ptr = (struct ifreq *)tmp___34; tmp___35 = external_allocated_data(); ldv_8_container_struct_rtnl_link_stats64_ptr = (struct rtnl_link_stats64 *)tmp___35; tmp___36 = external_allocated_data(); ldv_8_container_struct_sk_buff_ptr = (struct sk_buff *)tmp___36; tmp___37 = external_allocated_data(); ldv_8_ldv_param_13_2_default = (unsigned long long *)tmp___37; tmp___38 = external_allocated_data(); ldv_8_ldv_param_22_2_default = (unsigned int *)tmp___38; tmp___39 = external_allocated_data(); ldv_8_ldv_param_29_2_default = (unsigned char *)tmp___39; tmp___40 = external_allocated_data(); ldv_8_ldv_param_56_2_default = (unsigned char *)tmp___40; tmp___41 = external_allocated_data(); ldv_8_ldv_param_78_2_default = (unsigned long long *)tmp___41; tmp___42 = external_allocated_data(); ldv_8_ldv_param_9_2_default = (unsigned char *)tmp___42; tmp___43 = external_allocated_data(); ldv_9_resource_dev = (struct pci_dev *)tmp___43; tmp___44 = external_allocated_data(); ldv_10_container_struct_ieee_ets_ptr = (struct ieee_ets *)tmp___44; tmp___45 = external_allocated_data(); ldv_10_container_struct_ieee_pfc_ptr = (struct ieee_pfc *)tmp___45; tmp___46 = external_allocated_data(); ldv_10_container_struct_net_device_ptr = (struct net_device *)tmp___46; tmp___47 = external_allocated_data(); ldv_10_ldv_param_7_1_default = (unsigned char *)tmp___47; tmp___48 = external_allocated_data(); ldv_11_container_timer_list = (struct timer_list *)tmp___48; } return; } } int ldv_del_timer_sync(int arg0 , struct timer_list *arg1 ) { struct timer_list *ldv_13_timer_list_timer_list ; { { ldv_13_timer_list_timer_list = arg1; ldv_assume(ldv_statevar_11 == 2); ldv_dispatch_instance_deregister_13_1(ldv_13_timer_list_timer_list); } return (arg0); return (arg0); } } void ldv_dispatch_deregister_22_1(struct pci_driver *arg0 ) { { { ldv_9_container_pci_driver = arg0; ldv_switch_automaton_state_9_11(); } return; } } void ldv_dispatch_deregister_dummy_resourceless_instance_16_24_4(void) { { { ldv_switch_automaton_state_10_1(); } return; } } void ldv_dispatch_deregister_file_operations_instance_9_24_5(void) { { { ldv_switch_automaton_state_0_6(); ldv_switch_automaton_state_1_6(); ldv_switch_automaton_state_2_6(); } return; } } void ldv_dispatch_instance_deregister_13_1(struct timer_list *arg0 ) { { { ldv_11_container_timer_list = arg0; ldv_switch_automaton_state_11_1(); } return; } } void ldv_dispatch_instance_register_16_2(struct timer_list *arg0 ) { { { ldv_11_container_timer_list = arg0; ldv_switch_automaton_state_11_3(); } return; } } void ldv_dispatch_irq_deregister_14_1(int arg0 ) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } goto switch_default; case_0: /* CIL Label */ { ldv_5_line_line = arg0; ldv_switch_automaton_state_5_1(); } goto ldv_60134; case_1: /* CIL Label */ { ldv_6_line_line = arg0; ldv_switch_automaton_state_6_1(); } goto ldv_60134; case_2: /* CIL Label */ { ldv_7_line_line = arg0; ldv_switch_automaton_state_7_1(); } goto ldv_60134; switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_60134: ; return; } } void ldv_dispatch_irq_register_18_2(int arg0 , enum irqreturn (*arg1)(int , void * ) , enum irqreturn (*arg2)(int , void * ) , void *arg3 ) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } goto switch_default; case_0: /* CIL Label */ { ldv_5_line_line = arg0; ldv_5_callback_handler = arg1; ldv_5_thread_thread = arg2; ldv_5_data_data = arg3; ldv_switch_automaton_state_5_6(); } goto ldv_60150; case_1: /* CIL Label */ { ldv_6_line_line = arg0; ldv_6_callback_handler = arg1; ldv_6_thread_thread = arg2; ldv_6_data_data = arg3; ldv_switch_automaton_state_6_6(); } goto ldv_60150; case_2: /* CIL Label */ { ldv_7_line_line = arg0; ldv_7_callback_handler = arg1; ldv_7_thread_thread = arg2; ldv_7_data_data = arg3; ldv_switch_automaton_state_7_6(); } goto ldv_60150; switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_60150: ; return; } } void ldv_dispatch_irq_register_19_2(int arg0 , enum irqreturn (*arg1)(int , void * ) , enum irqreturn (*arg2)(int , void * ) , void *arg3 ) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } goto switch_default; case_0: /* CIL Label */ { ldv_5_line_line = arg0; ldv_5_callback_handler = arg1; ldv_5_thread_thread = arg2; ldv_5_data_data = arg3; ldv_switch_automaton_state_5_6(); } goto ldv_60166; case_1: /* CIL Label */ { ldv_6_line_line = arg0; ldv_6_callback_handler = arg1; ldv_6_thread_thread = arg2; ldv_6_data_data = arg3; ldv_switch_automaton_state_6_6(); } goto ldv_60166; case_2: /* CIL Label */ { ldv_7_line_line = arg0; ldv_7_callback_handler = arg1; ldv_7_thread_thread = arg2; ldv_7_data_data = arg3; ldv_switch_automaton_state_7_6(); } goto ldv_60166; switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_60166: ; return; } } void ldv_dispatch_irq_register_20_2(int arg0 , enum irqreturn (*arg1)(int , void * ) , enum irqreturn (*arg2)(int , void * ) , void *arg3 ) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } goto switch_default; case_0: /* CIL Label */ { ldv_5_line_line = arg0; ldv_5_callback_handler = arg1; ldv_5_thread_thread = arg2; ldv_5_data_data = arg3; ldv_switch_automaton_state_5_6(); } goto ldv_60182; case_1: /* CIL Label */ { ldv_6_line_line = arg0; ldv_6_callback_handler = arg1; ldv_6_thread_thread = arg2; ldv_6_data_data = arg3; ldv_switch_automaton_state_6_6(); } goto ldv_60182; case_2: /* CIL Label */ { ldv_7_line_line = arg0; ldv_7_callback_handler = arg1; ldv_7_thread_thread = arg2; ldv_7_data_data = arg3; ldv_switch_automaton_state_7_6(); } goto ldv_60182; switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_60182: ; return; } } void ldv_dispatch_register_23_2(struct pci_driver *arg0 ) { { { ldv_9_container_pci_driver = arg0; ldv_switch_automaton_state_9_20(); } return; } } void ldv_dispatch_register_dummy_resourceless_instance_16_24_6(void) { { { ldv_switch_automaton_state_10_5(); } return; } } void ldv_dispatch_register_file_operations_instance_9_24_7(void) { { { ldv_switch_automaton_state_0_15(); ldv_switch_automaton_state_1_15(); ldv_switch_automaton_state_2_15(); } return; } } void ldv_dummy_resourceless_instance_callback_8_34(void (*arg0)(struct net_device * , unsigned short , unsigned short ) , struct net_device *arg1 , unsigned short arg2 , unsigned short arg3 ) { { { i40e_add_vxlan_port(arg1, (int )arg2, (int )arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_37(int (*arg0)(struct net_device * , int ) , struct net_device *arg1 , int arg2 ) { { { i40e_change_mtu(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_40(void (*arg0)(struct net_device * , unsigned short , unsigned short ) , struct net_device *arg1 , unsigned short arg2 , unsigned short arg3 ) { { { i40e_del_vxlan_port(arg1, (int )arg2, (int )arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_43(int (*arg0)(struct net_device * , struct ifreq * , int ) , struct net_device *arg1 , struct ifreq *arg2 , int arg3 ) { { { i40e_ioctl(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_46(struct rtnl_link_stats64 *(*arg0)(struct net_device * , struct rtnl_link_stats64 * ) , struct net_device *arg1 , struct rtnl_link_stats64 *arg2 ) { { { i40e_get_netdev_stats_struct(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_47(int (*arg0)(struct net_device * , int , struct ifla_vf_info * ) , struct net_device *arg1 , int arg2 , struct ifla_vf_info *arg3 ) { { { i40e_ndo_get_vf_config(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_50(void (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_netpoll(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_51(int (*arg0)(struct net_device * , unsigned long long ) , struct net_device *arg1 , unsigned long long arg2 ) { { { i40e_set_features(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_54(int (*arg0)(struct net_device * , void * ) , struct net_device *arg1 , void *arg2 ) { { { i40e_set_mac(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_55(void (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_set_rx_mode(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_56(int (*arg0)(struct net_device * , int , unsigned char * ) , struct net_device *arg1 , int arg2 , unsigned char *arg3 ) { { { i40e_ndo_set_vf_mac(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_59(int (*arg0)(struct net_device * , int , int ) , struct net_device *arg1 , int arg2 , int arg3 ) { { { i40e_ndo_set_vf_bw(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_62(int (*arg0)(struct net_device * , int , unsigned short , unsigned char ) , struct net_device *arg1 , int arg2 , unsigned short arg3 , unsigned char arg4 ) { { { i40e_ndo_set_vf_port_vlan(arg1, arg2, (int )arg3, (int )arg4); } return; } } void ldv_dummy_resourceless_instance_callback_8_65(int (*arg0)(struct net_device * , unsigned char ) , struct net_device *arg1 , unsigned char arg2 ) { { { i40e_setup_tc(arg1, (int )arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_68(enum netdev_tx (*arg0)(struct sk_buff * , struct net_device * ) , struct sk_buff *arg1 , struct net_device *arg2 ) { { { i40e_lan_xmit_frame(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_69(void (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_tx_timeout(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_70(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { eth_validate_addr(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_71(int (*arg0)(struct net_device * , unsigned short , unsigned short ) , struct net_device *arg1 , unsigned short arg2 , unsigned short arg3 ) { { { i40e_vlan_rx_add_vid(arg1, (int )arg2, (int )arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_74(int (*arg0)(struct net_device * , unsigned short , unsigned short ) , struct net_device *arg1 , unsigned short arg2 , unsigned short arg3 ) { { { i40e_vlan_rx_kill_vid(arg1, (int )arg2, (int )arg3); } return; } } void ldv_entry_EMGentry_24(void *arg0 ) { int tmp ; int tmp___0 ; { { if (ldv_statevar_24 == 2) { goto case_2; } else { } if (ldv_statevar_24 == 3) { goto case_3; } else { } if (ldv_statevar_24 == 4) { goto case_4; } else { } if (ldv_statevar_24 == 5) { goto case_5; } else { } if (ldv_statevar_24 == 6) { goto case_6; } else { } if (ldv_statevar_24 == 7) { goto case_7; } else { } if (ldv_statevar_24 == 8) { goto case_8; } else { } if (ldv_statevar_24 == 10) { goto case_10; } else { } if (ldv_statevar_24 == 11) { goto case_11; } else { } goto switch_default; case_2: /* CIL Label */ { ldv_assume(ldv_statevar_9 == 12); ldv_EMGentry_exit_i40e_exit_module_24_2(ldv_24_exit_i40e_exit_module_default); ldv_check_final_state(); ldv_stop(); ldv_statevar_24 = 11; } goto ldv_60345; case_3: /* CIL Label */ { ldv_assume(ldv_statevar_9 == 12); ldv_EMGentry_exit_i40e_exit_module_24_2(ldv_24_exit_i40e_exit_module_default); ldv_check_final_state(); ldv_stop(); ldv_statevar_24 = 11; } goto ldv_60345; case_4: /* CIL Label */ { ldv_assume(ldv_statevar_10 == 1); ldv_dispatch_deregister_dummy_resourceless_instance_16_24_4(); ldv_statevar_24 = 2; } goto ldv_60345; case_5: /* CIL Label */ { ldv_assume((ldv_statevar_0 == 7 || ldv_statevar_1 == 7) || ldv_statevar_2 == 7); ldv_dispatch_deregister_file_operations_instance_9_24_5(); ldv_statevar_24 = 4; } goto ldv_60345; case_6: /* CIL Label */ { ldv_assume(ldv_statevar_10 == 5); ldv_dispatch_register_dummy_resourceless_instance_16_24_6(); ldv_statevar_24 = 5; } goto ldv_60345; case_7: /* CIL Label */ { ldv_assume((ldv_statevar_0 == 15 || ldv_statevar_1 == 15) || ldv_statevar_2 == 15); ldv_dispatch_register_file_operations_instance_9_24_7(); ldv_statevar_24 = 6; } goto ldv_60345; case_8: /* CIL Label */ { ldv_assume(ldv_24_ret_default == 0); tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_24 = 3; } else { ldv_statevar_24 = 7; } goto ldv_60345; case_10: /* CIL Label */ { ldv_assume(ldv_24_ret_default != 0); ldv_check_final_state(); ldv_stop(); ldv_statevar_24 = 11; } goto ldv_60345; case_11: /* CIL Label */ { ldv_assume(ldv_statevar_9 == 20); ldv_24_ret_default = ldv_EMGentry_init_i40e_init_module_24_11(ldv_24_init_i40e_init_module_default); ldv_24_ret_default = ldv_post_init(ldv_24_ret_default); tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { ldv_statevar_24 = 8; } else { ldv_statevar_24 = 10; } goto ldv_60345; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60345: ; return; } } int main(void) { int tmp ; { { ldv_initialize(); ldv_initialize_external_data(); ldv_statevar_24 = 11; ldv_0_ret_default = 1; ldv_statevar_0 = 15; ldv_1_ret_default = 1; ldv_statevar_1 = 15; ldv_2_ret_default = 1; ldv_statevar_2 = 15; ldv_statevar_3 = 6; ldv_statevar_4 = 6; ldv_statevar_5 = 6; ldv_statevar_6 = 6; ldv_statevar_7 = 6; ldv_statevar_8 = 5; ldv_9_ret_default = 1; ldv_statevar_9 = 20; ldv_statevar_10 = 5; ldv_statevar_11 = 3; } ldv_60372: { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } if (tmp == 3) { goto case_3; } else { } if (tmp == 4) { goto case_4; } else { } if (tmp == 5) { goto case_5; } else { } if (tmp == 6) { goto case_6; } else { } if (tmp == 7) { goto case_7; } else { } if (tmp == 8) { goto case_8; } else { } if (tmp == 9) { goto case_9; } else { } if (tmp == 10) { goto case_10; } else { } if (tmp == 11) { goto case_11; } else { } if (tmp == 12) { goto case_12; } else { } goto switch_default; case_0: /* CIL Label */ { ldv_entry_EMGentry_24((void *)0); } goto ldv_60358; case_1: /* CIL Label */ { ldv_file_operations_file_operations_instance_0((void *)0); } goto ldv_60358; case_2: /* CIL Label */ { ldv_file_operations_file_operations_instance_1((void *)0); } goto ldv_60358; case_3: /* CIL Label */ { ldv_file_operations_file_operations_instance_2((void *)0); } goto ldv_60358; case_4: /* CIL Label */ { ldv_iio_triggered_buffer_iio_triggered_buffer_instance_3((void *)0); } goto ldv_60358; case_5: /* CIL Label */ { ldv_iio_triggered_buffer_iio_triggered_buffer_instance_4((void *)0); } goto ldv_60358; case_6: /* CIL Label */ { ldv_interrupt_interrupt_instance_5((void *)0); } goto ldv_60358; case_7: /* CIL Label */ { ldv_interrupt_interrupt_instance_6((void *)0); } goto ldv_60358; case_8: /* CIL Label */ { ldv_interrupt_interrupt_instance_7((void *)0); } goto ldv_60358; case_9: /* CIL Label */ { ldv_net_dummy_resourceless_instance_8((void *)0); } goto ldv_60358; case_10: /* CIL Label */ { ldv_pci_pci_instance_9((void *)0); } goto ldv_60358; case_11: /* CIL Label */ { ldv_struct_dcbnl_rtnl_ops_dummy_resourceless_instance_10((void *)0); } goto ldv_60358; case_12: /* CIL Label */ { ldv_timer_timer_instance_11((void *)0); } goto ldv_60358; switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_60358: ; goto ldv_60372; } } void ldv_free_irq(void *arg0 , int arg1 , void *arg2 ) { int ldv_14_line_line ; { { ldv_14_line_line = arg1; ldv_assume((ldv_statevar_5 == 2 || ldv_statevar_6 == 2) || ldv_statevar_7 == 2); ldv_dispatch_irq_deregister_14_1(ldv_14_line_line); } return; return; } } void ldv_iio_triggered_buffer_iio_triggered_buffer_instance_3(void *arg0 ) { int tmp ; { { if (ldv_statevar_3 == 2) { goto case_2; } else { } if (ldv_statevar_3 == 4) { goto case_4; } else { } if (ldv_statevar_3 == 5) { goto case_5; } else { } if (ldv_statevar_3 == 6) { goto case_6; } else { } goto switch_default; case_2: /* CIL Label */ { ldv_assume((unsigned int )ldv_3_ret_val_default != 2U); ldv_statevar_3 = 6; } goto ldv_60383; case_4: /* CIL Label */ { ldv_assume((unsigned int )ldv_3_ret_val_default == 2U); ldv_iio_triggered_buffer_instance_thread_3_3(ldv_3_thread_thread, ldv_3_line_line, ldv_3_data_data); ldv_statevar_3 = 6; } goto ldv_60383; case_5: /* CIL Label */ { ldv_switch_to_interrupt_context(); ldv_3_ret_val_default = ldv_iio_triggered_buffer_instance_handler_3_5(ldv_3_callback_handler, ldv_3_line_line, ldv_3_data_data); ldv_switch_to_process_context(); tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_3 = 2; } else { ldv_statevar_3 = 4; } goto ldv_60383; case_6: /* CIL Label */ ; goto ldv_60383; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60383: ; return; } } void ldv_iio_triggered_buffer_iio_triggered_buffer_instance_4(void *arg0 ) { int tmp ; { { if (ldv_statevar_4 == 2) { goto case_2; } else { } if (ldv_statevar_4 == 4) { goto case_4; } else { } if (ldv_statevar_4 == 5) { goto case_5; } else { } if (ldv_statevar_4 == 6) { goto case_6; } else { } goto switch_default; case_2: /* CIL Label */ { ldv_assume((unsigned int )ldv_4_ret_val_default != 2U); ldv_statevar_4 = 6; } goto ldv_60392; case_4: /* CIL Label */ { ldv_assume((unsigned int )ldv_4_ret_val_default == 2U); ldv_iio_triggered_buffer_instance_thread_4_3(ldv_4_thread_thread, ldv_4_line_line, ldv_4_data_data); ldv_statevar_4 = 6; } goto ldv_60392; case_5: /* CIL Label */ { ldv_switch_to_interrupt_context(); ldv_4_ret_val_default = ldv_iio_triggered_buffer_instance_handler_4_5(ldv_4_callback_handler, ldv_4_line_line, ldv_4_data_data); ldv_switch_to_process_context(); tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_4 = 2; } else { ldv_statevar_4 = 4; } goto ldv_60392; case_6: /* CIL Label */ ; goto ldv_60392; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60392: ; return; } } enum irqreturn ldv_iio_triggered_buffer_instance_handler_3_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { irqreturn_t tmp ; { { tmp = i40e_fdir_clean_ring(arg1, arg2); } return (tmp); } } enum irqreturn ldv_iio_triggered_buffer_instance_handler_4_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { irqreturn_t tmp ; { { tmp = i40e_msix_clean_rings(arg1, arg2); } return (tmp); } } void ldv_iio_triggered_buffer_instance_thread_3_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { { { i40e_msix_clean_rings(arg1, arg2); } return; } } void ldv_iio_triggered_buffer_instance_thread_4_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { { { i40e_msix_clean_rings(arg1, arg2); } return; } } void ldv_initialize_external_data(void) { { { ldv_allocate_external_0(); } return; } } enum irqreturn ldv_interrupt_instance_handler_5_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { irqreturn_t tmp ; { { tmp = i40e_fdir_clean_ring(arg1, arg2); } return (tmp); } } enum irqreturn ldv_interrupt_instance_handler_6_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { irqreturn_t tmp ; { { tmp = i40e_intr(arg1, arg2); } return (tmp); } } enum irqreturn ldv_interrupt_instance_handler_7_5(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { irqreturn_t tmp ; { { tmp = i40e_msix_clean_rings(arg1, arg2); } return (tmp); } } void ldv_interrupt_instance_thread_5_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { { { i40e_msix_clean_rings(arg1, arg2); } return; } } void ldv_interrupt_instance_thread_6_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { { { i40e_msix_clean_rings(arg1, arg2); } return; } } void ldv_interrupt_instance_thread_7_3(enum irqreturn (*arg0)(int , void * ) , int arg1 , void *arg2 ) { { { i40e_msix_clean_rings(arg1, arg2); } return; } } void ldv_interrupt_interrupt_instance_5(void *arg0 ) { int tmp ; { { if (ldv_statevar_5 == 2) { goto case_2; } else { } if (ldv_statevar_5 == 4) { goto case_4; } else { } if (ldv_statevar_5 == 5) { goto case_5; } else { } if (ldv_statevar_5 == 6) { goto case_6; } else { } goto switch_default; case_2: /* CIL Label */ { ldv_assume((unsigned int )ldv_5_ret_val_default != 2U); ldv_statevar_5 = 6; } goto ldv_60473; case_4: /* CIL Label */ { ldv_assume((unsigned int )ldv_5_ret_val_default == 2U); ldv_interrupt_instance_thread_5_3(ldv_5_thread_thread, ldv_5_line_line, ldv_5_data_data); ldv_statevar_5 = 6; } goto ldv_60473; case_5: /* CIL Label */ { ldv_switch_to_interrupt_context(); ldv_5_ret_val_default = ldv_interrupt_instance_handler_5_5(ldv_5_callback_handler, ldv_5_line_line, ldv_5_data_data); ldv_switch_to_process_context(); tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_5 = 2; } else { ldv_statevar_5 = 4; } goto ldv_60473; case_6: /* CIL Label */ ; goto ldv_60473; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60473: ; return; } } void ldv_interrupt_interrupt_instance_6(void *arg0 ) { int tmp ; { { if (ldv_statevar_6 == 2) { goto case_2; } else { } if (ldv_statevar_6 == 4) { goto case_4; } else { } if (ldv_statevar_6 == 5) { goto case_5; } else { } if (ldv_statevar_6 == 6) { goto case_6; } else { } goto switch_default; case_2: /* CIL Label */ { ldv_assume((unsigned int )ldv_6_ret_val_default != 2U); ldv_statevar_6 = 6; } goto ldv_60482; case_4: /* CIL Label */ { ldv_assume((unsigned int )ldv_6_ret_val_default == 2U); ldv_interrupt_instance_thread_6_3(ldv_6_thread_thread, ldv_6_line_line, ldv_6_data_data); ldv_statevar_6 = 6; } goto ldv_60482; case_5: /* CIL Label */ { ldv_switch_to_interrupt_context(); ldv_6_ret_val_default = ldv_interrupt_instance_handler_6_5(ldv_6_callback_handler, ldv_6_line_line, ldv_6_data_data); ldv_switch_to_process_context(); tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_6 = 2; } else { ldv_statevar_6 = 4; } goto ldv_60482; case_6: /* CIL Label */ ; goto ldv_60482; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60482: ; return; } } void ldv_interrupt_interrupt_instance_7(void *arg0 ) { int tmp ; { { if (ldv_statevar_7 == 2) { goto case_2; } else { } if (ldv_statevar_7 == 4) { goto case_4; } else { } if (ldv_statevar_7 == 5) { goto case_5; } else { } if (ldv_statevar_7 == 6) { goto case_6; } else { } goto switch_default; case_2: /* CIL Label */ { ldv_assume((unsigned int )ldv_7_ret_val_default != 2U); ldv_statevar_7 = 6; } goto ldv_60491; case_4: /* CIL Label */ { ldv_assume((unsigned int )ldv_7_ret_val_default == 2U); ldv_interrupt_instance_thread_7_3(ldv_7_thread_thread, ldv_7_line_line, ldv_7_data_data); ldv_statevar_7 = 6; } goto ldv_60491; case_5: /* CIL Label */ { ldv_switch_to_interrupt_context(); ldv_7_ret_val_default = ldv_interrupt_instance_handler_7_5(ldv_7_callback_handler, ldv_7_line_line, ldv_7_data_data); ldv_switch_to_process_context(); tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_7 = 2; } else { ldv_statevar_7 = 4; } goto ldv_60491; case_6: /* CIL Label */ ; goto ldv_60491; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60491: ; return; } } int ldv_mod_timer(int arg0 , struct timer_list *arg1 , unsigned long arg2 ) { struct timer_list *ldv_16_timer_list_timer_list ; int tmp ; { { tmp = ldv_undef_int(); } if (tmp != 0) { { ldv_assume(arg0 == 0); ldv_16_timer_list_timer_list = arg1; ldv_assume(ldv_statevar_11 == 3); ldv_dispatch_instance_register_16_2(ldv_16_timer_list_timer_list); } return (arg0); } else { { ldv_assume(arg0 != 0); } return (arg0); } return (arg0); } } void ldv_net_dummy_resourceless_instance_8(void *arg0 ) { { { if (ldv_statevar_8 == 1) { goto case_1; } else { } if (ldv_statevar_8 == 2) { goto case_2; } else { } if (ldv_statevar_8 == 3) { goto case_3; } else { } if (ldv_statevar_8 == 4) { goto case_4; } else { } if (ldv_statevar_8 == 5) { goto case_5; } else { } goto switch_default; case_1: /* CIL Label */ ; goto ldv_60506; case_2: /* CIL Label */ { ldv_statevar_8 = ldv_switch_1(); } goto ldv_60506; case_3: /* CIL Label */ { ldv_dummy_resourceless_instance_callback_8_3(ldv_8_callback_get_channels, ldv_8_container_net_device, ldv_8_container_struct_ethtool_channels_ptr); ldv_statevar_8 = 2; } goto ldv_60506; case_4: /* CIL Label */ { ldv_statevar_8 = ldv_switch_1(); } goto ldv_60506; case_5: /* CIL Label */ ; goto ldv_60506; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60506: ; return; } } void ldv_pci_instance_callback_9_10(unsigned int (*arg0)(struct pci_dev * , enum pci_channel_state ) , struct pci_dev *arg1 , enum pci_channel_state arg2 ) { { { i40e_pci_error_detected(arg1, arg2); } return; } } void ldv_pci_instance_callback_9_23(void (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) { { { i40e_pci_error_resume(arg1); } return; } } void ldv_pci_instance_callback_9_24(unsigned int (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) { { { i40e_pci_error_slot_reset(arg1); } return; } } void ldv_pci_instance_callback_9_25(int (*arg0)(struct pci_dev * , int ) , struct pci_dev *arg1 , int arg2 ) { { { i40e_pci_sriov_configure(arg1, arg2); } return; } } int ldv_pci_instance_probe_9_17(int (*arg0)(struct pci_dev * , struct pci_device_id * ) , struct pci_dev *arg1 , struct pci_device_id *arg2 ) { int tmp ; { { tmp = i40e_probe(arg1, (struct pci_device_id const *)arg2); } return (tmp); } } void ldv_pci_instance_release_9_2(void (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) { { { i40e_remove(arg1); } return; } } void ldv_pci_instance_resume_9_5(int (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) { { { i40e_resume(arg1); } return; } } void ldv_pci_instance_resume_early_9_6(int (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) { { { (*arg0)(arg1); } return; } } void ldv_pci_instance_shutdown_9_3(void (*arg0)(struct pci_dev * ) , struct pci_dev *arg1 ) { { { i40e_shutdown(arg1); } return; } } int ldv_pci_instance_suspend_9_8(int (*arg0)(struct pci_dev * , struct pm_message ) , struct pci_dev *arg1 , struct pm_message arg2 ) { int tmp ; { { tmp = i40e_suspend(arg1, arg2); } return (tmp); } } int ldv_pci_instance_suspend_late_9_7(int (*arg0)(struct pci_dev * , struct pm_message ) , struct pci_dev *arg1 , struct pm_message arg2 ) { int tmp ; { { tmp = (*arg0)(arg1, arg2); } return (tmp); } } void ldv_pci_pci_instance_9(void *arg0 ) { int tmp ; int tmp___0 ; int tmp___1 ; void *tmp___2 ; void *tmp___3 ; int tmp___4 ; { { if (ldv_statevar_9 == 1) { goto case_1; } else { } if (ldv_statevar_9 == 2) { goto case_2; } else { } if (ldv_statevar_9 == 3) { goto case_3; } else { } if (ldv_statevar_9 == 4) { goto case_4; } else { } if (ldv_statevar_9 == 5) { goto case_5; } else { } if (ldv_statevar_9 == 6) { goto case_6; } else { } if (ldv_statevar_9 == 7) { goto case_7; } else { } if (ldv_statevar_9 == 8) { goto case_8; } else { } if (ldv_statevar_9 == 9) { goto case_9; } else { } if (ldv_statevar_9 == 10) { goto case_10; } else { } if (ldv_statevar_9 == 12) { goto case_12; } else { } if (ldv_statevar_9 == 14) { goto case_14; } else { } if (ldv_statevar_9 == 16) { goto case_16; } else { } if (ldv_statevar_9 == 17) { goto case_17; } else { } if (ldv_statevar_9 == 19) { goto case_19; } else { } if (ldv_statevar_9 == 20) { goto case_20; } else { } if (ldv_statevar_9 == 23) { goto case_23; } else { } if (ldv_statevar_9 == 24) { goto case_24; } else { } if (ldv_statevar_9 == 26) { goto case_26; } else { } goto switch_default; case_1: /* CIL Label */ { tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_9 = 12; } else { ldv_statevar_9 = 17; } goto ldv_60581; case_2: /* CIL Label */ { ldv_assume((((ldv_statevar_5 == 2 || ldv_statevar_6 == 2) || ldv_statevar_7 == 2) || ldv_statevar_8 == 1) || ldv_statevar_11 == 2); ldv_pci_instance_release_9_2(ldv_9_container_pci_driver->remove, ldv_9_resource_dev); ldv_statevar_9 = 1; } goto ldv_60581; case_3: /* CIL Label */ { ldv_pci_instance_shutdown_9_3(ldv_9_container_pci_driver->shutdown, ldv_9_resource_dev); ldv_statevar_9 = 2; } goto ldv_60581; case_4: /* CIL Label */ { ldv_statevar_9 = ldv_switch_2(); } goto ldv_60581; case_5: /* CIL Label */ { ldv_assume((ldv_statevar_5 == 6 || ldv_statevar_6 == 6) || ldv_statevar_7 == 6); ldv_pci_instance_resume_9_5(ldv_9_container_pci_driver->resume, ldv_9_resource_dev); ldv_statevar_9 = 4; } goto ldv_60581; case_6: /* CIL Label */ ; if ((unsigned long )ldv_9_container_pci_driver->resume_early != (unsigned long )((int (*)(struct pci_dev * ))0)) { { ldv_pci_instance_resume_early_9_6(ldv_9_container_pci_driver->resume_early, ldv_9_resource_dev); } } else { } ldv_statevar_9 = 5; goto ldv_60581; case_7: /* CIL Label */ ; if ((unsigned long )ldv_9_container_pci_driver->suspend_late != (unsigned long )((int (*)(struct pci_dev * , pm_message_t ))0)) { { ldv_9_ret_default = ldv_pci_instance_suspend_late_9_7(ldv_9_container_pci_driver->suspend_late, ldv_9_resource_dev, ldv_9_resource_pm_message); } } else { } { ldv_9_ret_default = ldv_filter_err_code(ldv_9_ret_default); ldv_statevar_9 = 6; } goto ldv_60581; case_8: /* CIL Label */ { ldv_9_ret_default = ldv_pci_instance_suspend_9_8(ldv_9_container_pci_driver->suspend, ldv_9_resource_dev, ldv_9_resource_pm_message); ldv_9_ret_default = ldv_filter_err_code(ldv_9_ret_default); ldv_statevar_9 = 7; } goto ldv_60581; case_9: /* CIL Label */ { ldv_statevar_9 = ldv_switch_2(); } goto ldv_60581; case_10: /* CIL Label */ { ldv_pci_instance_callback_9_10(ldv_9_callback_error_detected, ldv_9_resource_dev, ldv_9_resource_enum_pci_channel_state); ldv_statevar_9 = 9; } goto ldv_60581; case_12: /* CIL Label */ { ldv_free((void *)ldv_9_resource_dev); ldv_free((void *)ldv_9_resource_struct_pci_device_id_ptr); ldv_9_ret_default = 1; ldv_statevar_9 = 20; } goto ldv_60581; case_14: /* CIL Label */ { ldv_assume(ldv_9_ret_default != 0); tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { ldv_statevar_9 = 12; } else { ldv_statevar_9 = 17; } goto ldv_60581; case_16: /* CIL Label */ { ldv_assume(ldv_9_ret_default == 0); ldv_statevar_9 = ldv_switch_2(); } goto ldv_60581; case_17: /* CIL Label */ { ldv_assume((((((ldv_statevar_5 == 6 || ldv_statevar_6 == 6) || ldv_statevar_7 == 6) || ldv_statevar_8 == 5) || ldv_statevar_8 == 1) || ldv_statevar_11 == 2) || ldv_statevar_11 == 3); ldv_pre_probe(); ldv_9_ret_default = ldv_pci_instance_probe_9_17((int (*)(struct pci_dev * , struct pci_device_id * ))ldv_9_container_pci_driver->probe, ldv_9_resource_dev, ldv_9_resource_struct_pci_device_id_ptr); ldv_9_ret_default = ldv_post_probe(ldv_9_ret_default); tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { ldv_statevar_9 = 14; } else { ldv_statevar_9 = 16; } goto ldv_60581; case_19: /* CIL Label */ { tmp___2 = ldv_xmalloc(2936UL); ldv_9_resource_dev = (struct pci_dev *)tmp___2; tmp___3 = ldv_xmalloc(32UL); ldv_9_resource_struct_pci_device_id_ptr = (struct pci_device_id *)tmp___3; tmp___4 = ldv_undef_int(); } if (tmp___4 != 0) { ldv_statevar_9 = 12; } else { ldv_statevar_9 = 17; } goto ldv_60581; case_20: /* CIL Label */ ; goto ldv_60581; case_23: /* CIL Label */ { ldv_pci_instance_callback_9_23(ldv_9_callback_func_1_ptr, ldv_9_resource_dev); ldv_statevar_9 = 9; } goto ldv_60581; case_24: /* CIL Label */ { ldv_pci_instance_callback_9_24(ldv_9_callback_slot_reset, ldv_9_resource_dev); ldv_statevar_9 = 9; } goto ldv_60581; case_26: /* CIL Label */ { ldv_pci_instance_callback_9_25(ldv_9_callback_sriov_configure, ldv_9_resource_dev, ldv_9_ldv_param_25_1_default); ldv_statevar_9 = 9; } goto ldv_60581; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60581: ; return; } } void ldv_pci_unregister_driver(void *arg0 , struct pci_driver *arg1 ) { struct pci_driver *ldv_22_pci_driver_pci_driver ; { { ldv_22_pci_driver_pci_driver = arg1; ldv_assume(ldv_statevar_9 == 12); ldv_dispatch_deregister_22_1(ldv_22_pci_driver_pci_driver); } return; return; } } int ldv_register_netdev_open_17_6(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) { int tmp ; { { tmp = i40e_open(arg1); } return (tmp); } } int ldv_request_irq(int arg0 , unsigned int arg1 , enum irqreturn (*arg2)(int , void * ) , unsigned long arg3 , char *arg4 , void *arg5 ) { enum irqreturn (*ldv_20_callback_handler)(int , void * ) ; void *ldv_20_data_data ; int ldv_20_line_line ; enum irqreturn (*ldv_20_thread_thread)(int , void * ) ; int tmp ; { { tmp = ldv_undef_int(); } if (tmp != 0) { { ldv_assume(arg0 == 0); ldv_20_line_line = (int )arg1; ldv_20_callback_handler = arg2; ldv_20_thread_thread = (enum irqreturn (*)(int , void * ))0; ldv_20_data_data = arg5; ldv_assume((ldv_statevar_5 == 6 || ldv_statevar_6 == 6) || ldv_statevar_7 == 6); ldv_dispatch_irq_register_20_2(ldv_20_line_line, ldv_20_callback_handler, ldv_20_thread_thread, ldv_20_data_data); } return (arg0); } else { { ldv_assume(arg0 != 0); } return (arg0); } return (arg0); } } void ldv_struct_dcbnl_rtnl_ops_dummy_resourceless_instance_10(void *arg0 ) { void *tmp ; { { if (ldv_statevar_10 == 1) { goto case_1; } else { } if (ldv_statevar_10 == 2) { goto case_2; } else { } if (ldv_statevar_10 == 3) { goto case_3; } else { } if (ldv_statevar_10 == 4) { goto case_4; } else { } if (ldv_statevar_10 == 5) { goto case_5; } else { } if (ldv_statevar_10 == 8) { goto case_8; } else { } if (ldv_statevar_10 == 10) { goto case_10; } else { } if (ldv_statevar_10 == 11) { goto case_11; } else { } goto switch_default; case_1: /* CIL Label */ ; goto ldv_60633; case_2: /* CIL Label */ { ldv_statevar_10 = ldv_switch_3(); } goto ldv_60633; case_3: /* CIL Label */ { ldv_dummy_resourceless_instance_callback_10_3(ldv_10_callback_getdcbx, ldv_10_container_struct_net_device_ptr); ldv_statevar_10 = 2; } goto ldv_60633; case_4: /* CIL Label */ { ldv_statevar_10 = ldv_switch_3(); } goto ldv_60633; case_5: /* CIL Label */ ; goto ldv_60633; case_8: /* CIL Label */ { tmp = ldv_xmalloc(1UL); ldv_10_ldv_param_7_1_default = (unsigned char *)tmp; ldv_dummy_resourceless_instance_callback_10_7(ldv_10_callback_getpermhwaddr, ldv_10_container_struct_net_device_ptr, ldv_10_ldv_param_7_1_default); ldv_free((void *)ldv_10_ldv_param_7_1_default); ldv_statevar_10 = 2; } goto ldv_60633; case_10: /* CIL Label */ { ldv_dummy_resourceless_instance_callback_10_10(ldv_10_callback_ieee_getets, ldv_10_container_struct_net_device_ptr, ldv_10_container_struct_ieee_ets_ptr); ldv_statevar_10 = 2; } goto ldv_60633; case_11: /* CIL Label */ { ldv_dummy_resourceless_instance_callback_10_11(ldv_10_callback_ieee_getpfc, ldv_10_container_struct_net_device_ptr, ldv_10_container_struct_ieee_pfc_ptr); ldv_statevar_10 = 2; } goto ldv_60633; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60633: ; return; } } int ldv_switch_0(void) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } goto switch_default; case_0: /* CIL Label */ ; return (2); case_1: /* CIL Label */ ; return (18); case_2: /* CIL Label */ ; return (20); switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } return (0); } } int ldv_switch_1(void) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } if (tmp == 3) { goto case_3; } else { } if (tmp == 4) { goto case_4; } else { } if (tmp == 5) { goto case_5; } else { } if (tmp == 6) { goto case_6; } else { } if (tmp == 7) { goto case_7; } else { } if (tmp == 8) { goto case_8; } else { } if (tmp == 9) { goto case_9; } else { } if (tmp == 10) { goto case_10; } else { } if (tmp == 11) { goto case_11; } else { } if (tmp == 12) { goto case_12; } else { } if (tmp == 13) { goto case_13; } else { } if (tmp == 14) { goto case_14; } else { } if (tmp == 15) { goto case_15; } else { } if (tmp == 16) { goto case_16; } else { } if (tmp == 17) { goto case_17; } else { } if (tmp == 18) { goto case_18; } else { } if (tmp == 19) { goto case_19; } else { } if (tmp == 20) { goto case_20; } else { } if (tmp == 21) { goto case_21; } else { } if (tmp == 22) { goto case_22; } else { } if (tmp == 23) { goto case_23; } else { } if (tmp == 24) { goto case_24; } else { } if (tmp == 25) { goto case_25; } else { } if (tmp == 26) { goto case_26; } else { } if (tmp == 27) { goto case_27; } else { } if (tmp == 28) { goto case_28; } else { } if (tmp == 29) { goto case_29; } else { } if (tmp == 30) { goto case_30; } else { } if (tmp == 31) { goto case_31; } else { } if (tmp == 32) { goto case_32; } else { } if (tmp == 33) { goto case_33; } else { } if (tmp == 34) { goto case_34; } else { } if (tmp == 35) { goto case_35; } else { } if (tmp == 36) { goto case_36; } else { } if (tmp == 37) { goto case_37; } else { } if (tmp == 38) { goto case_38; } else { } if (tmp == 39) { goto case_39; } else { } if (tmp == 40) { goto case_40; } else { } if (tmp == 41) { goto case_41; } else { } if (tmp == 42) { goto case_42; } else { } if (tmp == 43) { goto case_43; } else { } if (tmp == 44) { goto case_44; } else { } if (tmp == 45) { goto case_45; } else { } if (tmp == 46) { goto case_46; } else { } goto switch_default; case_0: /* CIL Label */ ; return (1); case_1: /* CIL Label */ ; return (3); case_2: /* CIL Label */ ; return (7); case_3: /* CIL Label */ ; return (8); case_4: /* CIL Label */ ; return (10); case_5: /* CIL Label */ ; return (12); case_6: /* CIL Label */ ; return (14); case_7: /* CIL Label */ ; return (16); case_8: /* CIL Label */ ; return (17); case_9: /* CIL Label */ ; return (18); case_10: /* CIL Label */ ; return (19); case_11: /* CIL Label */ ; return (20); case_12: /* CIL Label */ ; return (21); case_13: /* CIL Label */ ; return (23); case_14: /* CIL Label */ ; return (25); case_15: /* CIL Label */ ; return (27); case_16: /* CIL Label */ ; return (30); case_17: /* CIL Label */ ; return (32); case_18: /* CIL Label */ ; return (33); case_19: /* CIL Label */ ; return (35); case_20: /* CIL Label */ ; return (38); case_21: /* CIL Label */ ; return (41); case_22: /* CIL Label */ ; return (44); case_23: /* CIL Label */ ; return (46); case_24: /* CIL Label */ ; return (48); case_25: /* CIL Label */ ; return (50); case_26: /* CIL Label */ ; return (52); case_27: /* CIL Label */ ; return (54); case_28: /* CIL Label */ ; return (55); case_29: /* CIL Label */ ; return (57); case_30: /* CIL Label */ ; return (60); case_31: /* CIL Label */ ; return (63); case_32: /* CIL Label */ ; return (66); case_33: /* CIL Label */ ; return (68); case_34: /* CIL Label */ ; return (69); case_35: /* CIL Label */ ; return (70); case_36: /* CIL Label */ ; return (72); case_37: /* CIL Label */ ; return (75); case_38: /* CIL Label */ ; return (77); case_39: /* CIL Label */ ; return (79); case_40: /* CIL Label */ ; return (81); case_41: /* CIL Label */ ; return (82); case_42: /* CIL Label */ ; return (84); case_43: /* CIL Label */ ; return (86); case_44: /* CIL Label */ ; return (87); case_45: /* CIL Label */ ; return (88); case_46: /* CIL Label */ ; return (89); switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } return (0); } } int ldv_switch_2(void) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } if (tmp == 3) { goto case_3; } else { } if (tmp == 4) { goto case_4; } else { } if (tmp == 5) { goto case_5; } else { } goto switch_default; case_0: /* CIL Label */ ; return (3); case_1: /* CIL Label */ ; return (8); case_2: /* CIL Label */ ; return (10); case_3: /* CIL Label */ ; return (23); case_4: /* CIL Label */ ; return (24); case_5: /* CIL Label */ ; return (26); switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } return (0); } } int ldv_switch_3(void) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } if (tmp == 3) { goto case_3; } else { } if (tmp == 4) { goto case_4; } else { } goto switch_default; case_0: /* CIL Label */ ; return (1); case_1: /* CIL Label */ ; return (3); case_2: /* CIL Label */ ; return (8); case_3: /* CIL Label */ ; return (10); case_4: /* CIL Label */ ; return (11); switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } return (0); } } void ldv_switch_automaton_state_10_1(void) { { ldv_statevar_10 = 5; return; } } void ldv_switch_automaton_state_10_5(void) { { ldv_statevar_10 = 4; return; } } void ldv_switch_automaton_state_11_1(void) { { ldv_statevar_11 = 3; return; } } void ldv_switch_automaton_state_11_3(void) { { ldv_statevar_11 = 2; return; } } void ldv_switch_automaton_state_5_1(void) { { ldv_statevar_5 = 6; return; } } void ldv_switch_automaton_state_5_6(void) { { ldv_statevar_5 = 5; return; } } void ldv_switch_automaton_state_6_1(void) { { ldv_statevar_6 = 6; return; } } void ldv_switch_automaton_state_6_6(void) { { ldv_statevar_6 = 5; return; } } void ldv_switch_automaton_state_7_1(void) { { ldv_statevar_7 = 6; return; } } void ldv_switch_automaton_state_7_6(void) { { ldv_statevar_7 = 5; return; } } void ldv_switch_automaton_state_8_1(void) { { ldv_statevar_8 = 5; return; } } void ldv_switch_automaton_state_8_5(void) { { ldv_statevar_8 = 4; return; } } void ldv_switch_automaton_state_9_11(void) { { ldv_9_ret_default = 1; ldv_statevar_9 = 20; return; } } void ldv_switch_automaton_state_9_20(void) { { ldv_statevar_9 = 19; return; } } void ldv_timer_instance_callback_11_2(void (*arg0)(unsigned long ) , unsigned long arg1 ) { { { (*arg0)(arg1); } return; } } void ldv_timer_timer_instance_11(void *arg0 ) { { { if (ldv_statevar_11 == 2) { goto case_2; } else { } if (ldv_statevar_11 == 3) { goto case_3; } else { } goto switch_default; case_2: /* CIL Label */ { ldv_switch_to_interrupt_context(); } if ((unsigned long )ldv_11_container_timer_list->function != (unsigned long )((void (*)(unsigned long ))0)) { { ldv_timer_instance_callback_11_2(ldv_11_container_timer_list->function, ldv_11_container_timer_list->data); } } else { } { ldv_switch_to_process_context(); ldv_statevar_11 = 3; } goto ldv_60752; case_3: /* CIL Label */ ; goto ldv_60752; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_60752: ; return; } } void ldv_unregister_netdev_stop_21_2(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_close(arg1); } return; } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { { tmp = ldv_kzalloc(size, flags); } return (tmp); } } static void *ldv_dev_get_drvdata_8(struct device const *dev ) { void *tmp ; { { tmp = ldv_dev_get_drvdata(dev); } return (tmp); } } static int ldv_dev_set_drvdata_9(struct device *dev , void *data ) { int tmp ; { { tmp = ldv_dev_set_drvdata(dev, data); } return (tmp); } } __inline static int ldv_request_irq_10(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = ldv_request_irq(ldv_func_res, irq, handler, flags, (char *)name, dev); } return (tmp___0); return (ldv_func_res); } } static void ldv_free_irq_11(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { { free_irq(ldv_func_arg1, ldv_func_arg2); ldv_free_irq((void *)0, (int )ldv_func_arg1, ldv_func_arg2); } return; } } __inline static int ldv_request_irq_12(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = ldv_request_irq(ldv_func_res, irq, handler, flags, (char *)name, dev); } return (tmp___0); return (ldv_func_res); } } __inline static int ldv_request_irq_13(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = ldv_request_irq(ldv_func_res, irq, handler, flags, (char *)name, dev); } return (tmp___0); return (ldv_func_res); } } static void ldv_free_irq_14(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { { free_irq(ldv_func_arg1, ldv_func_arg2); ldv_free_irq((void *)0, (int )ldv_func_arg1, ldv_func_arg2); } return; } } static void ldv_free_irq_15(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { { free_irq(ldv_func_arg1, ldv_func_arg2); ldv_free_irq((void *)0, (int )ldv_func_arg1, ldv_func_arg2); } return; } } static int ldv_mod_timer_16(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; tmp___0 = ldv_mod_timer(ldv_func_res, ldv_func_arg1, ldv_func_arg2); } return (tmp___0); return (ldv_func_res); } } __inline static int ldv_request_irq_17(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = ldv_request_irq(ldv_func_res, irq, handler, flags, (char *)name, dev); } return (tmp___0); return (ldv_func_res); } } static struct net_device *ldv_alloc_etherdev_mqs_18(int ldv_func_arg1 , unsigned int ldv_func_arg2 , unsigned int ldv_func_arg3 ) { ldv_func_ret_type___4 ldv_func_res ; struct net_device *tmp ; struct net_device *tmp___0 ; { { tmp = alloc_etherdev_mqs(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; tmp___0 = ldv_alloc_etherdev_mqs(ldv_func_res, ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); } return (tmp___0); return (ldv_func_res); } } static void ldv_unregister_netdev_19(struct net_device *ldv_func_arg1 ) { { { unregister_netdev(ldv_func_arg1); ldv_unregister_netdev((void *)0, ldv_func_arg1); } return; } } static void ldv_free_netdev_20(struct net_device *ldv_func_arg1 ) { { { free_netdev(ldv_func_arg1); ldv_free_netdev((void *)0, ldv_func_arg1); } return; } } static void ldv_unregister_netdev_21(struct net_device *ldv_func_arg1 ) { { { unregister_netdev(ldv_func_arg1); ldv_unregister_netdev((void *)0, ldv_func_arg1); } return; } } static void ldv_free_netdev_22(struct net_device *ldv_func_arg1 ) { { { free_netdev(ldv_func_arg1); ldv_free_netdev((void *)0, ldv_func_arg1); } return; } } static int ldv_register_netdev_23(struct net_device *ldv_func_arg1 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = register_netdev(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_register_netdev(ldv_func_res, ldv_func_arg1); } return (tmp___0); return (ldv_func_res); } } static void ldv_unregister_netdev_24(struct net_device *ldv_func_arg1 ) { { { unregister_netdev(ldv_func_arg1); ldv_unregister_netdev((void *)0, ldv_func_arg1); } return; } } static void ldv_free_netdev_25(struct net_device *ldv_func_arg1 ) { { { free_netdev(ldv_func_arg1); ldv_free_netdev((void *)0, ldv_func_arg1); } return; } } static int ldv_mod_timer_26(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; tmp___0 = ldv_mod_timer(ldv_func_res, ldv_func_arg1, ldv_func_arg2); } return (tmp___0); return (ldv_func_res); } } static int ldv_del_timer_sync_27(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_del_timer_sync(ldv_func_res, ldv_func_arg1); } return (tmp___0); return (ldv_func_res); } } static int ldv_del_timer_sync_28(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___8 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_del_timer_sync(ldv_func_res, ldv_func_arg1); } return (tmp___0); return (ldv_func_res); } } static void ldv_free_irq_29(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { { free_irq(ldv_func_arg1, ldv_func_arg2); ldv_free_irq((void *)0, (int )ldv_func_arg1, ldv_func_arg2); } return; } } static int ldv___pci_register_driver_30(struct pci_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) { ldv_func_ret_type___9 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = __pci_register_driver(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; tmp___0 = ldv___pci_register_driver(ldv_func_res, ldv_func_arg1, ldv_func_arg2, (char *)ldv_func_arg3); } return (tmp___0); return (ldv_func_res); } } static void ldv_pci_unregister_driver_31(struct pci_driver *ldv_func_arg1 ) { { { pci_unregister_driver(ldv_func_arg1); ldv_pci_unregister_driver((void *)0, ldv_func_arg1); } return; } } extern size_t strlcpy(char * , char const * , size_t ) ; __inline static char const *kobject_name(struct kobject const *kobj ) { { return ((char const *)kobj->name); } } __inline static char const *dev_name(struct device const *dev ) { char const *tmp ; { if ((unsigned long )dev->init_name != (unsigned long )((char const */* const */)0)) { return ((char const *)dev->init_name); } else { } { tmp = kobject_name(& dev->kobj); } return (tmp); } } __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static void ethtool_cmd_speed_set(struct ethtool_cmd *ep , __u32 speed ) { { ep->speed = (unsigned short )speed; ep->speed_hi = (unsigned short )(speed >> 16); return; } } extern u32 ethtool_op_get_link(struct net_device * ) ; __inline static 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 * ) ; u32 i40e_led_get(struct i40e_hw *hw ) ; void i40e_led_set(struct i40e_hw *hw , u32 mode , bool blink ) ; i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_read_nvm(struct i40e_hw *hw , u8 module_pointer , u32 offset , u16 length , void *data , bool last_command , struct i40e_asq_cmd_details *cmd_details ) ; bool i40e_get_link_status(struct i40e_hw *hw ) ; i40e_status i40e_acquire_nvm(struct i40e_hw *hw , enum i40e_aq_resource_access_type access ) ; void i40e_release_nvm(struct i40e_hw *hw ) ; i40e_status i40e_read_nvm_word(struct i40e_hw *hw , u16 offset , u16 *data ) ; __inline static struct i40e_pf *i40e_netdev_to_pf(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; } return (vsi->back); } } int i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data , struct i40e_pf *pf , bool add ) ; struct i40e_diag_reg_test_info i40e_reg_list[12U] ; i40e_status i40e_diag_reg_test(struct i40e_hw *hw ) ; i40e_status i40e_diag_eeprom_test(struct i40e_hw *hw ) ; static struct i40e_stats const i40e_gstrings_net_stats[12U] = { {{'r', 'x', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}, 8, 0}, {{'t', 'x', '_', 'p', 'a', 'c', 'k', 'e', 't', 's', '\000'}, 8, 8}, {{'r', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}, 8, 16}, {{'t', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}, 8, 24}, {{'r', 'x', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}, 8, 32}, {{'t', 'x', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}, 8, 40}, {{'r', 'x', '_', 'd', 'r', 'o', 'p', 'p', 'e', 'd', '\000'}, 8, 48}, {{'t', 'x', '_', 'd', 'r', 'o', 'p', 'p', 'e', 'd', '\000'}, 8, 56}, {{'m', 'u', 'l', 't', 'i', 'c', 'a', 's', 't', '\000'}, 8, 64}, {{'c', 'o', 'l', 'l', 'i', 's', 'i', 'o', 'n', 's', '\000'}, 8, 72}, {{'r', 'x', '_', 'l', 'e', 'n', 'g', 't', 'h', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}, 8, 80}, {{'r', 'x', '_', 'c', 'r', 'c', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}, 8, 96}}; static struct i40e_stats i40e_gstrings_stats[37U] = { {{'r', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}, 8, 1872}, {{'t', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}, 8, 1936}, {{'r', 'x', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}, 8, 1912}, {{'t', 'x', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}, 8, 1976}, {{'r', 'x', '_', 'd', 'r', 'o', 'p', 'p', 'e', 'd', '\000'}, 8, 1904}, {{'t', 'x', '_', 'd', 'r', 'o', 'p', 'p', 'e', 'd', '\000'}, 8, 1968}, {{'t', 'x', '_', 'd', 'r', 'o', 'p', 'p', 'e', 'd', '_', 'l', 'i', 'n', 'k', '_', 'd', 'o', 'w', 'n', '\000'}, 8, 1984}, {{'c', 'r', 'c', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}, 8, 1992}, {{'i', 'l', 'l', 'e', 'g', 'a', 'l', '_', 'b', 'y', 't', 'e', 's', '\000'}, 8, 2000}, {{'m', 'a', 'c', '_', 'l', 'o', 'c', 'a', 'l', '_', 'f', 'a', 'u', 'l', 't', 's', '\000'}, 8, 2016}, {{'m', 'a', 'c', '_', 'r', 'e', 'm', 'o', 't', 'e', '_', 'f', 'a', 'u', 'l', 't', 's', '\000'}, 8, 2024}, {{'r', 'x', '_', 'l', 'e', 'n', 'g', 't', 'h', '_', 'e', 'r', 'r', 'o', 'r', 's', '\000'}, 8, 2032}, {{'l', 'i', 'n', 'k', '_', 'x', 'o', 'n', '_', 'r', 'x', '\000'}, 8, 2040}, {{'l', 'i', 'n', 'k', '_', 'x', 'o', 'f', 'f', '_', 'r', 'x', '\000'}, 8, 2048}, {{'l', 'i', 'n', 'k', '_', 'x', 'o', 'n', '_', 't', 'x', '\000'}, 8, 2184}, {{'l', 'i', 'n', 'k', '_', 'x', 'o', 'f', 'f', '_', 't', 'x', '\000'}, 8, 2192}, {{'r', 'x', '_', 's', 'i', 'z', 'e', '_', '6', '4', '\000'}, 8, 2392}, {{'r', 'x', '_', 's', 'i', 'z', 'e', '_', '1', '2', '7', '\000'}, 8, 2400}, {{'r', 'x', '_', 's', 'i', 'z', 'e', '_', '2', '5', '5', '\000'}, 8, 2408}, {{'r', 'x', '_', 's', 'i', 'z', 'e', '_', '5', '1', '1', '\000'}, 8, 2416}, {{'r', 'x', '_', 's', 'i', 'z', 'e', '_', '1', '0', '2', '3', '\000'}, 8, 2424}, {{'r', 'x', '_', 's', 'i', 'z', 'e', '_', '1', '5', '2', '2', '\000'}, 8, 2432}, {{'r', 'x', '_', 's', 'i', 'z', 'e', '_', 'b', 'i', 'g', '\000'}, 8, 2440}, {{'t', 'x', '_', 's', 'i', 'z', 'e', '_', '6', '4', '\000'}, 8, 2480}, {{'t', 'x', '_', 's', 'i', 'z', 'e', '_', '1', '2', '7', '\000'}, 8, 2488}, {{'t', 'x', '_', 's', 'i', 'z', 'e', '_', '2', '5', '5', '\000'}, 8, 2496}, {{'t', 'x', '_', 's', 'i', 'z', 'e', '_', '5', '1', '1', '\000'}, 8, 2504}, {{'t', 'x', '_', 's', 'i', 'z', 'e', '_', '1', '0', '2', '3', '\000'}, 8, 2512}, {{'t', 'x', '_', 's', 'i', 'z', 'e', '_', '1', '5', '2', '2', '\000'}, 8, 2520}, {{'t', 'x', '_', 's', 'i', 'z', 'e', '_', 'b', 'i', 'g', '\000'}, 8, 2528}, {{'r', 'x', '_', 'u', 'n', 'd', 'e', 'r', 's', 'i', 'z', 'e', '\000'}, 8, 2448}, {{'r', 'x', '_', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', '\000'}, 8, 2456}, {{'r', 'x', '_', 'o', 'v', 'e', 'r', 's', 'i', 'z', 'e', '\000'}, 8, 2464}, {{'r', 'x', '_', 'j', 'a', 'b', 'b', 'e', 'r', '\000'}, 8, 2472}, {{'V', 'F', '_', 'a', 'd', 'm', 'i', 'n', '_', 'q', 'u', 'e', 'u', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '\000'}, 4, 3652}, {{'t', 'x', '_', 'h', 'w', 't', 's', 't', 'a', 'm', 'p', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', 's', '\000'}, 4, 3992}, {{'r', 'x', '_', 'h', 'w', 't', 's', 't', 'a', 'm', 'p', '_', 'c', 'l', 'e', 'a', 'r', 'e', 'd', '\000'}, 4, 3996}}; static char const i40e_gstrings_test[5U][32U] = { { 'R', 'e', 'g', 'i', 's', 't', 'e', 'r', ' ', 't', 'e', 's', 't', ' ', ' ', '(', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', '\000'}, { 'E', 'e', 'p', 'r', 'o', 'm', ' ', 't', 'e', 's', 't', ' ', ' ', ' ', ' ', '(', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', '\000'}, { 'I', 'n', 't', 'e', 'r', 'r', 'u', 'p', 't', ' ', 't', 'e', 's', 't', ' ', '(', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', '\000'}, { 'L', 'o', 'o', 'p', 'b', 'a', 'c', 'k', ' ', 't', 'e', 's', 't', ' ', ' ', '(', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', '\000'}, { 'L', 'i', 'n', 'k', ' ', 't', 'e', 's', 't', ' ', ' ', ' ', '(', 'o', 'n', '/', 'o', 'f', 'f', 'l', 'i', 'n', 'e', ')', '\000'}}; static int i40e_get_settings(struct net_device *netdev , struct ethtool_cmd *ecmd ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_link_status *hw_link_info ; bool link_up ; u32 link_speed ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; hw = & pf->hw; hw_link_info = & hw->phy.link_info; link_up = ((int )hw_link_info->link_info & 1) != 0; link_speed = hw_link_info->link_speed; } { if ((unsigned int )hw_link_info->phy_type == 24U) { goto case_24; } else { } if ((unsigned int )hw_link_info->phy_type == 10U) { goto case_10; } else { } if ((unsigned int )hw_link_info->phy_type == 4U) { goto case_4; } else { } if ((unsigned int )hw_link_info->phy_type == 25U) { goto case_25; } else { } if ((unsigned int )hw_link_info->phy_type == 26U) { goto case_26; } else { } if ((unsigned int )hw_link_info->phy_type == 2U) { goto case_2; } else { } if ((unsigned int )hw_link_info->phy_type == 3U) { goto case_3; } else { } goto switch_default; case_24: /* CIL Label */ ; case_10: /* CIL Label */ ecmd->supported = 16777216U; ecmd->advertising = 16777216U; goto ldv_56812; case_4: /* CIL Label */ ecmd->supported = 8388608U; ecmd->advertising = 8388608U; goto ldv_56812; case_25: /* CIL Label */ ecmd->supported = 33554432U; ecmd->advertising = 33554432U; goto ldv_56812; case_26: /* CIL Label */ ecmd->supported = 67108864U; ecmd->advertising = 67108864U; goto ldv_56812; case_2: /* CIL Label */ ecmd->supported = 262144U; ecmd->advertising = 262144U; goto ldv_56812; case_3: /* CIL Label */ ecmd->supported = 524288U; ecmd->advertising = 524288U; goto ldv_56812; switch_default: /* CIL Label */ ; if ((unsigned int )hw->device_id - 5507U <= 2U) { ecmd->supported = 33554432U; ecmd->advertising = 33554432U; } else { ecmd->supported = 4096U; ecmd->advertising = 4096U; } goto ldv_56812; switch_break: /* CIL Label */ ; } ldv_56812: ecmd->supported = ecmd->supported | 64U; ecmd->advertising = ecmd->advertising | 64U; ecmd->autoneg = (unsigned int )hw_link_info->an_info & 1U; { if ((unsigned int )hw->phy.media_type == 3U) { goto case_3___0; } else { } if ((unsigned int )hw->phy.media_type == 2U) { goto case_2___0; } else { } if ((unsigned int )hw->phy.media_type == 5U) { goto case_5; } else { } if ((unsigned int )hw->phy.media_type == 4U) { goto case_4___0; } else { } if ((unsigned int )hw->phy.media_type == 1U) { goto case_1; } else { } if ((unsigned int )hw->phy.media_type == 0U) { goto case_0; } else { } goto switch_default___0; case_3___0: /* CIL Label */ ecmd->supported = ecmd->supported | 65536U; ecmd->advertising = ecmd->advertising | 65536U; ecmd->port = 239U; goto ldv_56820; case_2___0: /* CIL Label */ ecmd->supported = ecmd->supported | 128U; ecmd->advertising = ecmd->advertising | 128U; ecmd->port = 0U; goto ldv_56820; case_5: /* CIL Label */ ; case_4___0: /* CIL Label */ ecmd->supported = ecmd->supported | 1024U; ecmd->advertising = ecmd->advertising | 1024U; ecmd->port = 5U; goto ldv_56820; case_1: /* CIL Label */ ecmd->supported = ecmd->supported | 1024U; ecmd->advertising = ecmd->advertising | 1024U; ecmd->port = 3U; goto ldv_56820; case_0: /* CIL Label */ ; switch_default___0: /* CIL Label */ ecmd->port = 255U; goto ldv_56820; switch_break___0: /* CIL Label */ ; } ldv_56820: ecmd->transceiver = 1U; if ((int )link_up) { { if (link_speed == 16U) { goto case_16; } else { } if (link_speed == 8U) { goto case_8; } else { } goto switch_default___1; case_16: /* CIL Label */ { ethtool_cmd_speed_set(ecmd, 40000U); } goto ldv_56828; case_8: /* CIL Label */ { ethtool_cmd_speed_set(ecmd, 10000U); } goto ldv_56828; switch_default___1: /* CIL Label */ ; goto ldv_56828; switch_break___1: /* CIL Label */ ; } ldv_56828: ecmd->duplex = 1U; } else { { ethtool_cmd_speed_set(ecmd, 4294967295U); ecmd->duplex = 255U; } } return (0); } } static void i40e_get_pauseparam(struct net_device *netdev , struct ethtool_pauseparam *pause ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_link_status *hw_link_info ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; hw = & pf->hw; hw_link_info = & hw->phy.link_info; pause->autoneg = (__u32 )hw_link_info->an_info & 1U; } if ((unsigned int )hw->fc.current_mode == 1U) { pause->rx_pause = 1U; } else if ((unsigned int )hw->fc.current_mode == 2U) { pause->tx_pause = 1U; } else if ((unsigned int )hw->fc.current_mode == 3U) { pause->rx_pause = 1U; pause->tx_pause = 1U; } else { } return; } } static u32 i40e_get_msglevel(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; } return ((u32 )pf->msg_enable); } } static void i40e_set_msglevel(struct net_device *netdev , u32 data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; } if ((data & 4026531840U) != 0U) { pf->hw.debug_mask = data; } else { } pf->msg_enable = (u16 )data; return; } } static int i40e_get_regs_len(struct net_device *netdev ) { int reg_count ; int i ; { reg_count = 0; i = 0; goto ldv_56856; ldv_56855: reg_count = (int )((u32 )reg_count + i40e_reg_list[i].elements); i = i + 1; ldv_56856: ; if (i40e_reg_list[i].offset != 0U) { goto ldv_56855; } else { } return ((int )((unsigned int )reg_count * 4U)); } } static void i40e_get_regs(struct net_device *netdev , struct ethtool_regs *regs , void *p ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_hw *hw ; u32 *reg_buf ; int i ; int j ; int ri ; u32 reg ; int tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; hw = & pf->hw; reg_buf = (u32 *)p; regs->version = 1U; ri = 0; i = 0; } goto ldv_56875; ldv_56874: j = 0; goto ldv_56872; ldv_56871: { reg = i40e_reg_list[i].offset + (u32 )j * i40e_reg_list[i].stride; tmp___0 = ri; ri = ri + 1; *(reg_buf + (unsigned long )tmp___0) = readl((void const volatile *)hw->hw_addr + (unsigned long )reg); j = j + 1; } ldv_56872: ; if ((u32 )j < i40e_reg_list[i].elements) { goto ldv_56871; } else { } i = i + 1; ldv_56875: ; if (i40e_reg_list[i].offset != 0U) { goto ldv_56874; } else { } return; } } static int i40e_get_eeprom(struct net_device *netdev , struct ethtool_eeprom *eeprom , u8 *bytes ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_hw *hw ; struct i40e_pf *pf ; int ret_val ; int len ; u8 *eeprom_buff ; u16 i ; u16 sectors ; bool last ; void *tmp___0 ; i40e_status tmp___1 ; i40e_status tmp___2 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; hw = & ((np->vsi)->back)->hw; pf = (np->vsi)->back; ret_val = 0; } if (eeprom->len == 0U) { return (-22); } else { } { eeprom->magic = (__u32 )((int )hw->vendor_id | ((int )hw->device_id << 16)); tmp___0 = kzalloc((size_t )eeprom->len, 208U); eeprom_buff = (u8 *)tmp___0; } if ((unsigned long )eeprom_buff == (unsigned long )((u8 *)0U)) { return (-12); } else { } { tmp___1 = i40e_acquire_nvm(hw, 1); ret_val = (int )tmp___1; } if (ret_val != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Failed Acquiring NVM resource for read err=%d status=0x%x\n", ret_val, (unsigned int )hw->aq.asq_last_status); } goto free_buff; } else { } sectors = (u16 )(eeprom->len / 4096U); sectors = (int )sectors + ((eeprom->len & 4095U) != 0U); len = 4096; last = 0; i = 0U; goto ldv_56894; ldv_56893: ; if ((int )i == (int )sectors + -1) { len = (int )(eeprom->len + (__u32 )((int )i * -4096)); last = 1; } else { } { tmp___2 = i40e_aq_read_nvm(hw, 0, eeprom->offset + (__u32 )((int )i * 4096), (int )((u16 )len), (void *)eeprom_buff + (unsigned long )((int )i * 4096), (int )last, (struct i40e_asq_cmd_details *)0); ret_val = (int )tmp___2; } if (ret_val != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "read NVM failed err=%d status=0x%x\n", ret_val, (unsigned int )hw->aq.asq_last_status); } goto release_nvm; } else { } i = (u16 )((int )i + 1); ldv_56894: ; if ((int )i < (int )sectors) { goto ldv_56893; } else { } release_nvm: { i40e_release_nvm(hw); memcpy((void *)bytes, (void const *)eeprom_buff, (size_t )eeprom->len); } free_buff: { kfree((void const *)eeprom_buff); } return (ret_val); } } static int i40e_get_eeprom_len(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_hw *hw ; u32 val ; unsigned int tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; hw = & ((np->vsi)->back)->hw; tmp___0 = readl((void const volatile *)hw->hw_addr + 779396U); val = (tmp___0 & 448U) >> 6; val = (u32 )(65536 << (int )val); } return ((int )val); } } static void i40e_get_drvinfo(struct net_device *netdev , struct ethtool_drvinfo *drvinfo ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; char *tmp___0 ; char const *tmp___1 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; strlcpy((char *)(& drvinfo->driver), (char const *)(& i40e_driver_name), 32UL); strlcpy((char *)(& drvinfo->version), (char const *)(& i40e_driver_version_str), 32UL); tmp___0 = i40e_fw_version_str(& pf->hw); strlcpy((char *)(& drvinfo->fw_version), (char const *)tmp___0, 32UL); tmp___1 = pci_name((struct pci_dev const *)pf->pdev); strlcpy((char *)(& drvinfo->bus_info), tmp___1, 32UL); } return; } } static void i40e_get_ringparam(struct net_device *netdev , struct ethtool_ringparam *ring ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_vsi *vsi ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; vsi = *(pf->vsi + (unsigned long )pf->lan_vsi); ring->rx_max_pending = 4096U; ring->tx_max_pending = 4096U; ring->rx_mini_max_pending = 0U; ring->rx_jumbo_max_pending = 0U; ring->rx_pending = (__u32 )(*(vsi->rx_rings))->count; ring->tx_pending = (__u32 )(*(vsi->tx_rings))->count; ring->rx_mini_pending = 0U; ring->rx_jumbo_pending = 0U; } return; } } static int i40e_set_ringparam(struct net_device *netdev , struct ethtool_ringparam *ring ) { struct i40e_ring *tx_rings ; struct i40e_ring *rx_rings ; struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; u32 new_rx_count ; u32 new_tx_count ; int i ; int err ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; void *tmp___3 ; void *tmp___4 ; { { tx_rings = (struct i40e_ring *)0; rx_rings = (struct i40e_ring *)0; tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; err = 0; } if (ring->rx_mini_pending != 0U || ring->rx_jumbo_pending != 0U) { return (-22); } else { } if ((ring->tx_pending - 64U > 4032U || ring->rx_pending > 4096U) || ring->rx_pending <= 63U) { { netdev_info((struct net_device const *)netdev, "Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d]\n", ring->tx_pending, ring->rx_pending, 64, 4096); } return (-22); } else { } new_tx_count = (ring->tx_pending + 31U) & 4294967264U; new_rx_count = (ring->rx_pending + 31U) & 4294967264U; if (new_tx_count == (u32 )(*(vsi->tx_rings))->count && new_rx_count == (u32 )(*(vsi->rx_rings))->count) { return (0); } else { } goto ldv_56930; ldv_56929: { usleep_range(1000UL, 2000UL); } ldv_56930: { tmp___0 = test_and_set_bit(1L, (unsigned long volatile *)(& pf->state)); } if (tmp___0 != 0) { goto ldv_56929; } else { } { tmp___1 = netif_running((struct net_device const *)vsi->netdev); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { i = 0; goto ldv_56933; ldv_56932: (*(vsi->tx_rings + (unsigned long )i))->count = (u16 )new_tx_count; (*(vsi->rx_rings + (unsigned long )i))->count = (u16 )new_rx_count; i = i + 1; ldv_56933: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56932; } else { } goto done; } else { } if (new_tx_count != (u32 )(*(vsi->tx_rings))->count) { { netdev_info((struct net_device const *)netdev, "Changing Tx descriptor count from %d to %d.\n", (int )(*(vsi->tx_rings))->count, new_tx_count); tmp___3 = kcalloc((size_t )vsi->alloc_queue_pairs, 4096UL, 208U); tx_rings = (struct i40e_ring *)tmp___3; } if ((unsigned long )tx_rings == (unsigned long )((struct i40e_ring *)0)) { err = -12; goto done; } else { } i = 0; goto ldv_56940; ldv_56939: { *(tx_rings + (unsigned long )i) = *(*(vsi->tx_rings + (unsigned long )i)); (tx_rings + (unsigned long )i)->count = (u16 )new_tx_count; err = i40e_setup_tx_descriptors(tx_rings + (unsigned long )i); } if (err != 0) { goto ldv_56937; ldv_56936: { i = i - 1; i40e_free_tx_resources(tx_rings + (unsigned long )i); } ldv_56937: ; if (i != 0) { goto ldv_56936; } else { } { kfree((void const *)tx_rings); tx_rings = (struct i40e_ring *)0; } goto done; } else { } i = i + 1; ldv_56940: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56939; } else { } } else { } if (new_rx_count != (u32 )(*(vsi->rx_rings))->count) { { netdev_info((struct net_device const *)netdev, "Changing Rx descriptor count from %d to %d\n", (int )(*(vsi->rx_rings))->count, new_rx_count); tmp___4 = kcalloc((size_t )vsi->alloc_queue_pairs, 4096UL, 208U); rx_rings = (struct i40e_ring *)tmp___4; } if ((unsigned long )rx_rings == (unsigned long )((struct i40e_ring *)0)) { err = -12; goto free_tx; } else { } i = 0; goto ldv_56947; ldv_56946: { *(rx_rings + (unsigned long )i) = *(*(vsi->rx_rings + (unsigned long )i)); (rx_rings + (unsigned long )i)->count = (u16 )new_rx_count; err = i40e_setup_rx_descriptors(rx_rings + (unsigned long )i); } if (err != 0) { goto ldv_56944; ldv_56943: { i = i - 1; i40e_free_rx_resources(rx_rings + (unsigned long )i); } ldv_56944: ; if (i != 0) { goto ldv_56943; } else { } { kfree((void const *)rx_rings); rx_rings = (struct i40e_ring *)0; } goto free_tx; } else { } i = i + 1; ldv_56947: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56946; } else { } } else { } { i40e_down(vsi); } if ((unsigned long )tx_rings != (unsigned long )((struct i40e_ring *)0)) { i = 0; goto ldv_56950; ldv_56949: { i40e_free_tx_resources(*(vsi->tx_rings + (unsigned long )i)); *(*(vsi->tx_rings + (unsigned long )i)) = *(tx_rings + (unsigned long )i); i = i + 1; } ldv_56950: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56949; } else { } { kfree((void const *)tx_rings); tx_rings = (struct i40e_ring *)0; } } else { } if ((unsigned long )rx_rings != (unsigned long )((struct i40e_ring *)0)) { i = 0; goto ldv_56953; ldv_56952: { i40e_free_rx_resources(*(vsi->rx_rings + (unsigned long )i)); *(*(vsi->rx_rings + (unsigned long )i)) = *(rx_rings + (unsigned long )i); i = i + 1; } ldv_56953: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56952; } else { } { kfree((void const *)rx_rings); rx_rings = (struct i40e_ring *)0; } } else { } { i40e_up(vsi); } free_tx: ; if ((unsigned long )tx_rings != (unsigned long )((struct i40e_ring *)0)) { i = 0; goto ldv_56956; ldv_56955: { i40e_free_tx_resources(tx_rings + (unsigned long )i); i = i + 1; } ldv_56956: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56955; } else { } { kfree((void const *)tx_rings); tx_rings = (struct i40e_ring *)0; } } else { } done: { clear_bit(1L, (unsigned long volatile *)(& pf->state)); } return (err); } } static int i40e_get_sset_count(struct net_device *netdev , int sset ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; } { if (sset == 0) { goto case_0; } else { } if (sset == 1) { goto case_1; } else { } goto switch_default; case_0: /* CIL Label */ ; return (5); case_1: /* CIL Label */ ; if ((unsigned long )vsi == (unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi)) { { tmp___0 = netdev_priv((struct net_device const *)netdev); tmp___1 = netdev_priv((struct net_device const *)netdev); } return ((int )((unsigned int )(((int )(((struct i40e_netdev_priv *)tmp___0)->vsi)->num_queue_pairs + (int )(((struct i40e_netdev_priv *)tmp___1)->vsi)->num_queue_pairs) * 2) + 89U)); } else { { tmp___2 = netdev_priv((struct net_device const *)netdev); tmp___3 = netdev_priv((struct net_device const *)netdev); } return ((int )(((unsigned int )((int )(((struct i40e_netdev_priv *)tmp___2)->vsi)->num_queue_pairs + (int )(((struct i40e_netdev_priv *)tmp___3)->vsi)->num_queue_pairs) + 6U) * 2U)); } switch_default: /* CIL Label */ ; return (-95); switch_break: /* CIL Label */ ; } } } static void i40e_get_ethtool_stats(struct net_device *netdev , struct ethtool_stats *stats , u64 *data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; int i ; char *p ; int j ; struct rtnl_link_stats64 *net_stats ; struct rtnl_link_stats64 *tmp___0 ; unsigned int start ; int tmp___1 ; struct i40e_ring *tx_ring ; struct i40e_ring *rx_ring ; bool tmp___2 ; bool tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; i = 0; tmp___0 = i40e_get_vsi_stats_struct(vsi); net_stats = tmp___0; i40e_update_stats(vsi); j = 0; } goto ldv_56990; ldv_56989: p = (char *)net_stats + (unsigned long )i40e_gstrings_net_stats[j].stat_offset; tmp___1 = i; i = i + 1; *(data + (unsigned long )tmp___1) = i40e_gstrings_net_stats[j].sizeof_stat == 8 ? *((u64 *)p) : (u64 )*((u32 *)p); j = j + 1; ldv_56990: ; if ((unsigned int )j <= 11U) { goto ldv_56989; } else { } { rcu_read_lock(); j = 0; } goto ldv_57000; ldv_56999: tx_ring = *((struct i40e_ring * volatile *)vsi->tx_rings + (unsigned long )j); if ((unsigned long )tx_ring == (unsigned long )((struct i40e_ring *)0)) { goto ldv_56994; } else { } ldv_56995: { start = u64_stats_fetch_begin_bh((struct u64_stats_sync const *)(& tx_ring->syncp)); *(data + (unsigned long )i) = tx_ring->stats.packets; *(data + ((unsigned long )i + 1UL)) = tx_ring->stats.bytes; tmp___2 = u64_stats_fetch_retry_bh((struct u64_stats_sync const *)(& tx_ring->syncp), start); } if ((int )tmp___2) { goto ldv_56995; } else { } rx_ring = tx_ring + 1UL; ldv_56997: { start = u64_stats_fetch_begin_bh((struct u64_stats_sync const *)(& rx_ring->syncp)); *(data + ((unsigned long )i + 2UL)) = rx_ring->stats.packets; *(data + ((unsigned long )i + 3UL)) = rx_ring->stats.bytes; tmp___3 = u64_stats_fetch_retry_bh((struct u64_stats_sync const *)(& rx_ring->syncp), start); } if ((int )tmp___3) { goto ldv_56997; } else { } ldv_56994: j = j + 1; i = i + 4; ldv_57000: ; if (j < (int )vsi->num_queue_pairs) { goto ldv_56999; } else { } { rcu_read_unlock(); } if ((unsigned long )vsi == (unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi)) { j = 0; goto ldv_57005; ldv_57004: p = (char *)pf + (unsigned long )i40e_gstrings_stats[j].stat_offset; tmp___4 = i; i = i + 1; *(data + (unsigned long )tmp___4) = i40e_gstrings_stats[j].sizeof_stat == 8 ? *((u64 *)p) : (u64 )*((u32 *)p); j = j + 1; ldv_57005: ; if ((unsigned int )j <= 36U) { goto ldv_57004; } else { } j = 0; goto ldv_57008; ldv_57007: tmp___5 = i; i = i + 1; *(data + (unsigned long )tmp___5) = pf->stats.priority_xon_tx[j]; tmp___6 = i; i = i + 1; *(data + (unsigned long )tmp___6) = pf->stats.priority_xoff_tx[j]; j = j + 1; ldv_57008: ; if (j <= 7) { goto ldv_57007; } else { } j = 0; goto ldv_57011; ldv_57010: tmp___7 = i; i = i + 1; *(data + (unsigned long )tmp___7) = pf->stats.priority_xon_rx[j]; tmp___8 = i; i = i + 1; *(data + (unsigned long )tmp___8) = pf->stats.priority_xoff_rx[j]; j = j + 1; ldv_57011: ; if (j <= 7) { goto ldv_57010; } else { } j = 0; goto ldv_57014; ldv_57013: tmp___9 = i; i = i + 1; *(data + (unsigned long )tmp___9) = pf->stats.priority_xon_2_xoff[j]; j = j + 1; ldv_57014: ; if (j <= 7) { goto ldv_57013; } else { } } else { } return; } } static void i40e_get_strings(struct net_device *netdev , u32 stringset , u8 *data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; char *p ; int i ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; p = (char *)data; } { if (stringset == 0U) { goto case_0; } else { } if (stringset == 1U) { goto case_1; } else { } goto switch_break; case_0: /* CIL Label */ i = 0; goto ldv_57028; ldv_57027: { memcpy((void *)data, (void const *)(& i40e_gstrings_test) + (unsigned long )i, 32UL); data = data + 32UL; i = i + 1; } ldv_57028: ; if ((unsigned int )i <= 4U) { goto ldv_57027; } else { } goto ldv_57030; case_1: /* CIL Label */ i = 0; goto ldv_57035; ldv_57034: { snprintf(p, 32UL, "%s", (char const *)(& i40e_gstrings_net_stats[i].stat_string)); p = p + 32UL; i = i + 1; } ldv_57035: ; if ((unsigned int )i <= 11U) { goto ldv_57034; } else { } i = 0; goto ldv_57038; ldv_57037: { snprintf(p, 32UL, "tx-%u.tx_packets", i); p = p + 32UL; snprintf(p, 32UL, "tx-%u.tx_bytes", i); p = p + 32UL; snprintf(p, 32UL, "rx-%u.rx_packets", i); p = p + 32UL; snprintf(p, 32UL, "rx-%u.rx_bytes", i); p = p + 32UL; i = i + 1; } ldv_57038: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_57037; } else { } if ((unsigned long )vsi == (unsigned long )*(pf->vsi + (unsigned long )pf->lan_vsi)) { i = 0; goto ldv_57043; ldv_57042: { snprintf(p, 32UL, "port.%s", (char *)(& i40e_gstrings_stats[i].stat_string)); p = p + 32UL; i = i + 1; } ldv_57043: ; if ((unsigned int )i <= 36U) { goto ldv_57042; } else { } i = 0; goto ldv_57046; ldv_57045: { snprintf(p, 32UL, "port.tx_priority_%u_xon", i); p = p + 32UL; snprintf(p, 32UL, "port.tx_priority_%u_xoff", i); p = p + 32UL; i = i + 1; } ldv_57046: ; if (i <= 7) { goto ldv_57045; } else { } i = 0; goto ldv_57049; ldv_57048: { snprintf(p, 32UL, "port.rx_priority_%u_xon", i); p = p + 32UL; snprintf(p, 32UL, "port.rx_priority_%u_xoff", i); p = p + 32UL; i = i + 1; } ldv_57049: ; if (i <= 7) { goto ldv_57048; } else { } i = 0; goto ldv_57052; ldv_57051: { snprintf(p, 32UL, "port.rx_priority_%u_xon_2_xoff", i); p = p + 32UL; i = i + 1; } ldv_57052: ; if (i <= 7) { goto ldv_57051; } else { } } else { } goto ldv_57030; switch_break: /* CIL Label */ ; } ldv_57030: ; return; } } static int i40e_get_ts_info(struct net_device *dev , struct ethtool_ts_info *info ) { struct i40e_pf *pf ; struct i40e_pf *tmp ; { { tmp = i40e_netdev_to_pf(dev); pf = tmp; info->so_timestamping = 95U; } if ((unsigned long )pf->ptp_clock != (unsigned long )((struct ptp_clock *)0)) { { info->phc_index = ptp_clock_index(pf->ptp_clock); } } else { info->phc_index = -1; } info->tx_types = 3U; info->rx_filters = 32753U; return (0); } } static int i40e_link_test(struct net_device *netdev , u64 *data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; bool tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; } if (((int )pf->msg_enable & 8192) != 0) { { netdev_info((struct net_device const *)netdev, "link test\n"); } } else { } { tmp___0 = i40e_get_link_status(& pf->hw); } if ((int )tmp___0) { *data = 0ULL; } else { *data = 1ULL; } return ((int )*data); } } static int i40e_reg_test(struct net_device *netdev , u64 *data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; i40e_status tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; } if (((int )pf->msg_enable & 8192) != 0) { { netdev_info((struct net_device const *)netdev, "register test\n"); } } else { } { tmp___0 = i40e_diag_reg_test(& pf->hw); *data = (u64 )tmp___0; } return ((int )*data); } } static int i40e_eeprom_test(struct net_device *netdev , u64 *data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; i40e_status tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; } if (((int )pf->msg_enable & 8192) != 0) { { netdev_info((struct net_device const *)netdev, "eeprom test\n"); } } else { } { tmp___0 = i40e_diag_eeprom_test(& pf->hw); *data = (u64 )tmp___0; } return ((int )*data); } } static int i40e_intr_test(struct net_device *netdev , u64 *data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; u16 swc_old ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; swc_old = pf->sw_int_count; } if (((int )pf->msg_enable & 8192) != 0) { { netdev_info((struct net_device const *)netdev, "interrupt test\n"); } } else { } { writel(5U, (void volatile *)pf->hw.hw_addr + 230528U); usleep_range(1000UL, 2000UL); *data = (int )swc_old == (int )pf->sw_int_count; } return ((int )*data); } } static int i40e_loopback_test(struct net_device *netdev , u64 *data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; } if (((int )pf->msg_enable & 8192) != 0) { { netdev_info((struct net_device const *)netdev, "loopback test not implemented\n"); } } else { } *data = 0ULL; return ((int )*data); } } static void i40e_diag_test(struct net_device *netdev , struct ethtool_test *eth_test , u64 *data ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; } if (eth_test->flags == 1U) { if ((int )pf->msg_enable & 1) { { netdev_info((struct net_device const *)netdev, "offline testing starting\n"); } } else { } { set_bit(0L, (unsigned long volatile *)(& pf->state)); tmp___0 = i40e_link_test(netdev, data + 4UL); } if (tmp___0 != 0) { eth_test->flags = eth_test->flags | 2U; } else { } { tmp___1 = i40e_eeprom_test(netdev, data + 1UL); } if (tmp___1 != 0) { eth_test->flags = eth_test->flags | 2U; } else { } { tmp___2 = i40e_intr_test(netdev, data + 2UL); } if (tmp___2 != 0) { eth_test->flags = eth_test->flags | 2U; } else { } { tmp___3 = i40e_loopback_test(netdev, data + 3UL); } if (tmp___3 != 0) { eth_test->flags = eth_test->flags | 2U; } else { } { tmp___4 = i40e_reg_test(netdev, data); } if (tmp___4 != 0) { eth_test->flags = eth_test->flags | 2U; } else { } { clear_bit(0L, (unsigned long volatile *)(& pf->state)); i40e_do_reset(pf, 4096U); } } else { if ((int )pf->msg_enable & 1) { { netdev_info((struct net_device const *)netdev, "online testing starting\n"); } } else { } { tmp___5 = i40e_link_test(netdev, data + 4UL); } if (tmp___5 != 0) { eth_test->flags = eth_test->flags | 2U; } else { } *data = 0ULL; *(data + 1UL) = 0ULL; *(data + 2UL) = 0ULL; *(data + 3UL) = 0ULL; } if ((int )pf->msg_enable & 1) { { netdev_info((struct net_device const *)netdev, "testing finished\n"); } } else { } return; } } static void i40e_get_wol(struct net_device *netdev , struct ethtool_wolinfo *wol ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_hw *hw ; u16 wol_nvm_bits ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; hw = & pf->hw; i40e_read_nvm_word(hw, 25, & wol_nvm_bits); } if (((int )wol_nvm_bits >> (int )hw->port) & 1) { wol->supported = 0U; wol->wolopts = 0U; } else { wol->supported = 32U; wol->wolopts = (int )pf->wol_en ? 32U : 0U; } return; } } static int i40e_set_wol(struct net_device *netdev , struct ethtool_wolinfo *wol ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_hw *hw ; u16 wol_nvm_bits ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; hw = & pf->hw; i40e_read_nvm_word(hw, 25, & wol_nvm_bits); } if (((int )wol_nvm_bits >> (int )hw->port) & 1) { return (-95); } else { } if (wol->wolopts != 0U && wol->wolopts != 32U) { return (-95); } else { } if ((int )pf->wol_en != (wol->wolopts != 0U)) { { pf->wol_en = wol->wolopts != 0U; device_set_wakeup_enable(& (pf->pdev)->dev, (int )pf->wol_en); } } else { } return (0); } } static int i40e_nway_reset(struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_hw *hw ; i40e_status ret ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; hw = & pf->hw; ret = 0; ret = i40e_aq_set_link_restart_an(hw, (struct i40e_asq_cmd_details *)0); } if ((int )ret != 0) { { netdev_info((struct net_device const *)netdev, "link restart failed, aq_err=%d\n", (unsigned int )pf->hw.aq.asq_last_status); } return (-5); } else { } return (0); } } static int i40e_set_phys_id(struct net_device *netdev , enum ethtool_phys_id_state state ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_hw *hw ; int blink_freq ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; hw = & pf->hw; blink_freq = 2; } { if ((unsigned int )state == 1U) { goto case_1; } else { } if ((unsigned int )state == 2U) { goto case_2; } else { } if ((unsigned int )state == 3U) { goto case_3; } else { } if ((unsigned int )state == 0U) { goto case_0; } else { } goto switch_break; case_1: /* CIL Label */ { pf->led_status = i40e_led_get(hw); } return (blink_freq); case_2: /* CIL Label */ { i40e_led_set(hw, 15U, 0); } goto ldv_57130; case_3: /* CIL Label */ { i40e_led_set(hw, 0U, 0); } goto ldv_57130; case_0: /* CIL Label */ { i40e_led_set(hw, pf->led_status, 0); } goto ldv_57130; switch_break: /* CIL Label */ ; } ldv_57130: ; return (0); } } static int i40e_get_coalesce(struct net_device *netdev , struct ethtool_coalesce *ec ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; ec->tx_max_coalesced_frames_irq = (__u32 )vsi->work_limit; ec->rx_max_coalesced_frames_irq = (__u32 )vsi->work_limit; } if ((int )((short )vsi->rx_itr_setting) < 0) { ec->rx_coalesce_usecs = 1U; } else { ec->rx_coalesce_usecs = (__u32 )vsi->rx_itr_setting; } if ((int )((short )vsi->tx_itr_setting) < 0) { ec->tx_coalesce_usecs = 1U; } else { ec->tx_coalesce_usecs = (__u32 )vsi->tx_itr_setting; } return (0); } } static int i40e_set_coalesce(struct net_device *netdev , struct ethtool_coalesce *ec ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_q_vector *q_vector ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; struct i40e_hw *hw ; u16 vector ; int i ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; hw = & pf->hw; } if (ec->tx_max_coalesced_frames_irq != 0U || ec->rx_max_coalesced_frames_irq != 0U) { vsi->work_limit = (u16 )ec->tx_max_coalesced_frames_irq; } else { } { if (ec->rx_coalesce_usecs == 0U) { goto case_0; } else { } if (ec->rx_coalesce_usecs == 1U) { goto case_1; } else { } goto switch_default; case_0: /* CIL Label */ vsi->rx_itr_setting = 0U; goto ldv_57151; case_1: /* CIL Label */ vsi->rx_itr_setting = 32892U; goto ldv_57151; switch_default: /* CIL Label */ ; if (ec->rx_coalesce_usecs - 8U > 8152U) { return (-22); } else { } vsi->rx_itr_setting = (u16 )ec->rx_coalesce_usecs; goto ldv_57151; switch_break: /* CIL Label */ ; } ldv_57151: ; { if (ec->tx_coalesce_usecs == 0U) { goto case_0___0; } else { } if (ec->tx_coalesce_usecs == 1U) { goto case_1___0; } else { } goto switch_default___0; case_0___0: /* CIL Label */ vsi->tx_itr_setting = 0U; goto ldv_57155; case_1___0: /* CIL Label */ vsi->tx_itr_setting = 33012U; goto ldv_57155; switch_default___0: /* CIL Label */ ; if (ec->tx_coalesce_usecs - 8U > 8152U) { return (-22); } else { } vsi->tx_itr_setting = (u16 )ec->tx_coalesce_usecs; goto ldv_57155; switch_break___0: /* CIL Label */ ; } ldv_57155: vector = (u16 )vsi->base_vector; i = 0; goto ldv_57159; ldv_57158: { q_vector = *(vsi->q_vectors + (unsigned long )i); q_vector->rx.itr = (u16 )(((int )vsi->rx_itr_setting & -32769) >> 1); writel((unsigned int )q_vector->rx.itr, (void volatile *)hw->hw_addr + (unsigned long )(((int )vector + 49151) * 4)); q_vector->tx.itr = (u16 )(((int )vsi->tx_itr_setting & -32769) >> 1); writel((unsigned int )q_vector->tx.itr, (void volatile *)hw->hw_addr + (unsigned long )(((int )vector + 49663) * 4)); readl((void const volatile *)hw->hw_addr + 745772U); i = i + 1; vector = (u16 )((int )vector + 1); } ldv_57159: ; if (i < vsi->num_q_vectors) { goto ldv_57158; } else { } return (0); } } static int i40e_get_rss_hash_opts(struct i40e_pf *pf , struct ethtool_rxnfc *cmd ) { { cmd->data = 0ULL; { if (cmd->flow_type == 1U) { goto case_1; } else { } if (cmd->flow_type == 2U) { goto case_2; } else { } if (cmd->flow_type == 3U) { goto case_3; } else { } if (cmd->flow_type == 4U) { goto case_4; } else { } if (cmd->flow_type == 9U) { goto case_9; } else { } if (cmd->flow_type == 10U) { goto case_10; } else { } if (cmd->flow_type == 16U) { goto case_16; } else { } if (cmd->flow_type == 5U) { goto case_5; } else { } if (cmd->flow_type == 6U) { goto case_6; } else { } if (cmd->flow_type == 7U) { goto case_7; } else { } if (cmd->flow_type == 8U) { goto case_8; } else { } if (cmd->flow_type == 11U) { goto case_11; } else { } if (cmd->flow_type == 12U) { goto case_12; } else { } if (cmd->flow_type == 17U) { goto case_17; } else { } goto switch_default; case_1: /* CIL Label */ ; case_2: /* CIL Label */ cmd->data = cmd->data | 192ULL; case_3: /* CIL Label */ ; case_4: /* CIL Label */ ; case_9: /* CIL Label */ ; case_10: /* CIL Label */ ; case_16: /* CIL Label */ cmd->data = cmd->data | 48ULL; goto ldv_57172; case_5: /* CIL Label */ ; case_6: /* CIL Label */ cmd->data = cmd->data | 192ULL; case_7: /* CIL Label */ ; case_8: /* CIL Label */ ; case_11: /* CIL Label */ ; case_12: /* CIL Label */ ; case_17: /* CIL Label */ cmd->data = cmd->data | 48ULL; goto ldv_57172; switch_default: /* CIL Label */ ; return (-22); switch_break: /* CIL Label */ ; } ldv_57172: ; return (0); } } static int i40e_get_rxnfc(struct net_device *netdev , struct ethtool_rxnfc *cmd , u32 *rule_locs ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; int ret ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; ret = -95; } { if (cmd->cmd == 45U) { goto case_45; } else { } if (cmd->cmd == 41U) { goto case_41; } else { } if (cmd->cmd == 46U) { goto case_46; } else { } if (cmd->cmd == 47U) { goto case_47; } else { } if (cmd->cmd == 48U) { goto case_48; } else { } goto switch_default; case_45: /* CIL Label */ cmd->data = (__u64 )vsi->alloc_queue_pairs; ret = 0; goto ldv_57191; case_41: /* CIL Label */ { ret = i40e_get_rss_hash_opts(pf, cmd); } goto ldv_57191; case_46: /* CIL Label */ cmd->rule_cnt = 10U; ret = 0; goto ldv_57191; case_47: /* CIL Label */ ret = 0; goto ldv_57191; case_48: /* CIL Label */ cmd->data = 500ULL; ret = 0; switch_default: /* CIL Label */ ; goto ldv_57191; switch_break: /* CIL Label */ ; } ldv_57191: ; return (ret); } } static int i40e_set_rss_hash_opt(struct i40e_pf *pf , struct ethtool_rxnfc *nfc ) { struct i40e_hw *hw ; u64 hena ; unsigned int tmp ; unsigned int tmp___0 ; { { hw = & pf->hw; tmp = readl((void const volatile *)hw->hw_addr + 2382080U); tmp___0 = readl((void const volatile *)hw->hw_addr + 2382208U); hena = (unsigned long long )tmp | ((unsigned long long )tmp___0 << 32); } if ((nfc->data & 0xffffffffffffff0fULL) != 0ULL) { return (-22); } else { } if (*((unsigned long *)nfc + 1UL) != 48UL) { return (-22); } else { } { if (nfc->flow_type == 1U) { goto case_1; } else { } if (nfc->flow_type == 5U) { goto case_5; } else { } if (nfc->flow_type == 2U) { goto case_2; } else { } if (nfc->flow_type == 6U) { goto case_6; } else { } if (nfc->flow_type == 4U) { goto case_4; } else { } if (nfc->flow_type == 9U) { goto case_9; } else { } if (nfc->flow_type == 10U) { goto case_10; } else { } if (nfc->flow_type == 3U) { goto case_3; } else { } if (nfc->flow_type == 8U) { goto case_8; } else { } if (nfc->flow_type == 11U) { goto case_11; } else { } if (nfc->flow_type == 12U) { goto case_12; } else { } if (nfc->flow_type == 7U) { goto case_7; } else { } if (nfc->flow_type == 16U) { goto case_16; } else { } if (nfc->flow_type == 17U) { goto case_17; } else { } goto switch_default___3; case_1: /* CIL Label */ ; { if ((nfc->data & 192ULL) == 0ULL) { goto case_0; } else { } if ((nfc->data & 192ULL) == 192ULL) { goto case_192; } else { } goto switch_default; case_0: /* CIL Label */ hena = hena & 0xfffffffdffffffffULL; goto ldv_57205; case_192: /* CIL Label */ hena = hena | 8589934592ULL; goto ldv_57205; switch_default: /* CIL Label */ ; return (-22); switch_break___0: /* CIL Label */ ; } ldv_57205: ; goto ldv_57208; case_5: /* CIL Label */ ; { if ((nfc->data & 192ULL) == 0ULL) { goto case_0___0; } else { } if ((nfc->data & 192ULL) == 192ULL) { goto case_192___0; } else { } goto switch_default___0; case_0___0: /* CIL Label */ hena = hena & 0xfffff7ffffffffffULL; goto ldv_57211; case_192___0: /* CIL Label */ hena = hena | 8796093022208ULL; goto ldv_57211; switch_default___0: /* CIL Label */ ; return (-22); switch_break___1: /* CIL Label */ ; } ldv_57211: ; goto ldv_57208; case_2: /* CIL Label */ ; { if ((nfc->data & 192ULL) == 0ULL) { goto case_0___1; } else { } if ((nfc->data & 192ULL) == 192ULL) { goto case_192___1; } else { } goto switch_default___1; case_0___1: /* CIL Label */ hena = hena & 0xffffffef9fffffffULL; goto ldv_57216; case_192___1: /* CIL Label */ hena = hena | 70330089472ULL; goto ldv_57216; switch_default___1: /* CIL Label */ ; return (-22); switch_break___2: /* CIL Label */ ; } ldv_57216: ; goto ldv_57208; case_6: /* CIL Label */ ; { if ((nfc->data & 192ULL) == 0ULL) { goto case_0___2; } else { } if ((nfc->data & 192ULL) == 192ULL) { goto case_192___2; } else { } goto switch_default___2; case_0___2: /* CIL Label */ hena = hena & 0xffffbe7fffffffffULL; goto ldv_57221; case_192___2: /* CIL Label */ hena = hena | 72018011619328ULL; goto ldv_57221; switch_default___2: /* CIL Label */ ; return (-22); switch_break___3: /* CIL Label */ ; } ldv_57221: ; goto ldv_57208; case_4: /* CIL Label */ ; case_9: /* CIL Label */ ; case_10: /* CIL Label */ ; case_3: /* CIL Label */ ; if (*((unsigned long *)nfc + 1UL) != 0UL) { return (-22); } else { } hena = hena | 34359738368ULL; goto ldv_57208; case_8: /* CIL Label */ ; case_11: /* CIL Label */ ; case_12: /* CIL Label */ ; case_7: /* CIL Label */ ; if (*((unsigned long *)nfc + 1UL) != 0UL) { return (-22); } else { } hena = hena | 35184372088832ULL; goto ldv_57208; case_16: /* CIL Label */ hena = hena | 103079215104ULL; goto ldv_57208; case_17: /* CIL Label */ hena = hena | 105553116266496ULL; goto ldv_57208; switch_default___3: /* CIL Label */ ; return (-22); switch_break: /* CIL Label */ ; } ldv_57208: { writel((unsigned int )hena, (void volatile *)hw->hw_addr + 2382080U); writel((unsigned int )(hena >> 32), (void volatile *)hw->hw_addr + 2382208U); readl((void const volatile *)hw->hw_addr + 745772U); } return (0); } } static int i40e_add_del_fdir_udpv4(struct i40e_vsi *vsi , struct i40e_fdir_data *fd_data , struct ethtool_rx_flow_spec *fsp , bool add ) { struct i40e_pf *pf ; struct udphdr *udp ; struct iphdr *ip ; bool err ; int ret ; int i ; char packet[42U] ; { { pf = vsi->back; err = 0; packet[0] = 0; packet[1] = 0; packet[2] = 0; packet[3] = 0; packet[4] = 0; packet[5] = 0; packet[6] = 0; packet[7] = 0; packet[8] = 0; packet[9] = 0; packet[10] = 0; packet[11] = 0; packet[12] = 8; packet[13] = 0; packet[14] = 69; packet[15] = 0; packet[16] = 0; packet[17] = 28; packet[18] = 0; packet[19] = 0; packet[20] = 64; packet[21] = 0; packet[22] = 64; packet[23] = 17; packet[24] = 0; packet[25] = 0; packet[26] = 0; packet[27] = 0; packet[28] = 0; packet[29] = 0; packet[30] = 0; packet[31] = 0; packet[32] = 0; packet[33] = 0; packet[34] = 0; packet[35] = 0; packet[36] = 0; packet[37] = 0; packet[38] = 0; packet[39] = 0; packet[40] = 0; packet[41] = 0; memcpy((void *)fd_data->raw_packet, (void const *)(& packet), 42UL); ip = (struct iphdr *)fd_data->raw_packet + 14U; udp = (struct udphdr *)fd_data->raw_packet + 34U; ip->saddr = fsp->h_u.tcp_ip4_spec.ip4src; ip->daddr = fsp->h_u.tcp_ip4_spec.ip4dst; udp->source = fsp->h_u.tcp_ip4_spec.psrc; udp->dest = fsp->h_u.tcp_ip4_spec.pdst; i = 29; } goto ldv_57249; ldv_57248: { fd_data->pctype = (u8 )i; ret = i40e_program_fdir_filter(fd_data, pf, (int )add); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter command send failed for PCTYPE %d (ret = %d)\n", (int )fd_data->pctype, ret); err = 1; } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter OK for PCTYPE %d (ret = %d)\n", (int )fd_data->pctype, ret); } } i = i + 1; ldv_57249: ; if (i <= 31) { goto ldv_57248; } else { } return ((int )err ? -95 : 0); } } static int i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi , struct i40e_fdir_data *fd_data , struct ethtool_rx_flow_spec *fsp , bool add ) { struct i40e_pf *pf ; struct tcphdr *tcp ; struct iphdr *ip ; bool err ; int ret ; char packet[54U] ; { { pf = vsi->back; err = 0; packet[0] = 0; packet[1] = 0; packet[2] = 0; packet[3] = 0; packet[4] = 0; packet[5] = 0; packet[6] = 0; packet[7] = 0; packet[8] = 0; packet[9] = 0; packet[10] = 0; packet[11] = 0; packet[12] = 8; packet[13] = 0; packet[14] = 69; packet[15] = 0; packet[16] = 0; packet[17] = 40; packet[18] = 0; packet[19] = 0; packet[20] = 64; packet[21] = 0; packet[22] = 64; packet[23] = 6; packet[24] = 0; packet[25] = 0; packet[26] = 0; packet[27] = 0; packet[28] = 0; packet[29] = 0; packet[30] = 0; packet[31] = 0; packet[32] = 0; packet[33] = 0; packet[34] = 0; packet[35] = 0; packet[36] = 0; packet[37] = 0; packet[38] = 0; packet[39] = 0; packet[40] = 0; packet[41] = 0; packet[42] = 0; packet[43] = 0; packet[44] = 0; packet[45] = 0; packet[46] = -128; packet[47] = 17; packet[48] = 0; packet[49] = 114; packet[50] = 0; packet[51] = 0; packet[52] = 0; packet[53] = 0; memcpy((void *)fd_data->raw_packet, (void const *)(& packet), 54UL); ip = (struct iphdr *)fd_data->raw_packet + 14U; tcp = (struct tcphdr *)fd_data->raw_packet + 34U; ip->daddr = fsp->h_u.tcp_ip4_spec.ip4dst; tcp->dest = fsp->h_u.tcp_ip4_spec.pdst; ip->saddr = fsp->h_u.tcp_ip4_spec.ip4src; tcp->source = fsp->h_u.tcp_ip4_spec.psrc; } if ((int )add) { if ((pf->flags & 4194304ULL) != 0ULL) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Forcing ATR off, sideband rules for TCP/IPv4 flow being applied\n"); pf->flags = pf->flags & 0xffffffffffbfffffULL; } } else { } } else { } { fd_data->pctype = 32U; ret = i40e_program_fdir_filter(fd_data, pf, (int )add); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter command send failed for PCTYPE %d (ret = %d)\n", (int )fd_data->pctype, ret); err = 1; } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter OK for PCTYPE %d (ret = %d)\n", (int )fd_data->pctype, ret); } } { fd_data->pctype = 33U; ret = i40e_program_fdir_filter(fd_data, pf, (int )add); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter command send failed for PCTYPE %d (ret = %d)\n", (int )fd_data->pctype, ret); err = 1; } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter OK for PCTYPE %d (ret = %d)\n", (int )fd_data->pctype, ret); } } return ((int )err ? -95 : 0); } } static int i40e_add_del_fdir_sctpv4(struct i40e_vsi *vsi , struct i40e_fdir_data *fd_data , struct ethtool_rx_flow_spec *fsp , bool add ) { { return (-95); } } static int i40e_add_del_fdir_ipv4(struct i40e_vsi *vsi , struct i40e_fdir_data *fd_data , struct ethtool_rx_flow_spec *fsp , bool add ) { struct i40e_pf *pf ; struct iphdr *ip ; bool err ; int ret ; int i ; char packet[34U] ; { { pf = vsi->back; err = 0; packet[0] = 0; packet[1] = 0; packet[2] = 0; packet[3] = 0; packet[4] = 0; packet[5] = 0; packet[6] = 0; packet[7] = 0; packet[8] = 0; packet[9] = 0; packet[10] = 0; packet[11] = 0; packet[12] = 8; packet[13] = 0; packet[14] = 69; packet[15] = 0; packet[16] = 0; packet[17] = 20; packet[18] = 0; packet[19] = 0; packet[20] = 64; packet[21] = 0; packet[22] = 64; packet[23] = 16; packet[24] = 0; packet[25] = 0; packet[26] = 0; packet[27] = 0; packet[28] = 0; packet[29] = 0; packet[30] = 0; packet[31] = 0; packet[32] = 0; packet[33] = 0; memcpy((void *)fd_data->raw_packet, (void const *)(& packet), 34UL); ip = (struct iphdr *)fd_data->raw_packet + 14U; ip->saddr = fsp->h_u.usr_ip4_spec.ip4src; ip->daddr = fsp->h_u.usr_ip4_spec.ip4dst; ip->protocol = fsp->h_u.usr_ip4_spec.proto; i = 35; } goto ldv_57282; ldv_57281: { fd_data->pctype = (u8 )i; ret = i40e_program_fdir_filter(fd_data, pf, (int )add); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter command send failed for PCTYPE %d (ret = %d)\n", (int )fd_data->pctype, ret); err = 1; } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter OK for PCTYPE %d (ret = %d)\n", (int )fd_data->pctype, ret); } } i = i + 1; ldv_57282: ; if (i <= 36) { goto ldv_57281; } else { } return ((int )err ? -95 : 0); } } static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi , struct ethtool_rxnfc *cmd , bool add ) { struct i40e_fdir_data fd_data ; int ret ; struct i40e_pf *pf ; struct ethtool_rx_flow_spec *fsp ; void *tmp ; { ret = -22; fsp = & cmd->fs; if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { return (-22); } else { } pf = vsi->back; if (fsp->ring_cookie != 0xffffffffffffffffULL && fsp->ring_cookie >= (__u64 )vsi->num_queue_pairs) { return (-22); } else { } { tmp = kzalloc(512UL, 208U); fd_data.raw_packet = (u8 *)tmp; } if ((unsigned long )fd_data.raw_packet == (unsigned long )((u8 *)0U)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Could not allocate memory\n"); } return (-12); } else { } fd_data.q_index = (u16 )fsp->ring_cookie; fd_data.flex_off = 0U; fd_data.pctype = 0U; fd_data.dest_vsi = vsi->id; fd_data.dest_ctl = 1U; fd_data.fd_status = 1U; fd_data.cnt_index = 0U; fd_data.fd_id = 0U; { if ((fsp->flow_type & 2147483647U) == 1U) { goto case_1; } else { } if ((fsp->flow_type & 2147483647U) == 2U) { goto case_2; } else { } if ((fsp->flow_type & 2147483647U) == 3U) { goto case_3; } else { } if ((fsp->flow_type & 2147483647U) == 16U) { goto case_16; } else { } if ((fsp->flow_type & 2147483647U) == 13U) { goto case_13; } else { } goto switch_default___0; case_1: /* CIL Label */ { ret = i40e_add_del_fdir_tcpv4(vsi, & fd_data, fsp, (int )add); } goto ldv_57294; case_2: /* CIL Label */ { ret = i40e_add_del_fdir_udpv4(vsi, & fd_data, fsp, (int )add); } goto ldv_57294; case_3: /* CIL Label */ { ret = i40e_add_del_fdir_sctpv4(vsi, & fd_data, fsp, (int )add); } goto ldv_57294; case_16: /* CIL Label */ { ret = i40e_add_del_fdir_ipv4(vsi, & fd_data, fsp, (int )add); } goto ldv_57294; case_13: /* CIL Label */ ; { if ((int )fsp->h_u.usr_ip4_spec.proto == 6) { goto case_6; } else { } if ((int )fsp->h_u.usr_ip4_spec.proto == 17) { goto case_17; } else { } if ((int )fsp->h_u.usr_ip4_spec.proto == 132) { goto case_132; } else { } goto switch_default; case_6: /* CIL Label */ { ret = i40e_add_del_fdir_tcpv4(vsi, & fd_data, fsp, (int )add); } goto ldv_57300; case_17: /* CIL Label */ { ret = i40e_add_del_fdir_udpv4(vsi, & fd_data, fsp, (int )add); } goto ldv_57300; case_132: /* CIL Label */ { ret = i40e_add_del_fdir_sctpv4(vsi, & fd_data, fsp, (int )add); } goto ldv_57300; switch_default: /* CIL Label */ { ret = i40e_add_del_fdir_ipv4(vsi, & fd_data, fsp, (int )add); } goto ldv_57300; switch_break___0: /* CIL Label */ ; } ldv_57300: ; goto ldv_57294; switch_default___0: /* CIL Label */ { _dev_info((struct device const *)(& (pf->pdev)->dev), "Could not specify spec type\n"); ret = -22; } switch_break: /* CIL Label */ ; } ldv_57294: { kfree((void const *)fd_data.raw_packet); fd_data.raw_packet = (u8 *)0U; } return (ret); } } static int i40e_set_rxnfc(struct net_device *netdev , struct ethtool_rxnfc *cmd ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; int ret ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; ret = -95; } { if (cmd->cmd == 42U) { goto case_42; } else { } if (cmd->cmd == 50U) { goto case_50; } else { } if (cmd->cmd == 49U) { goto case_49; } else { } goto switch_default; case_42: /* CIL Label */ { ret = i40e_set_rss_hash_opt(pf, cmd); } goto ldv_57314; case_50: /* CIL Label */ { ret = i40e_add_del_fdir_ethtool(vsi, cmd, 1); } goto ldv_57314; case_49: /* CIL Label */ { ret = i40e_add_del_fdir_ethtool(vsi, cmd, 0); } goto ldv_57314; switch_default: /* CIL Label */ ; goto ldv_57314; switch_break: /* CIL Label */ ; } ldv_57314: ; return (ret); } } static unsigned int i40e_max_channels(struct i40e_vsi *vsi ) { { return ((unsigned int )vsi->alloc_queue_pairs); } } static void i40e_get_channels(struct net_device *dev , struct ethtool_channels *ch ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; { { tmp = netdev_priv((struct net_device const *)dev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; ch->max_combined = i40e_max_channels(vsi); ch->other_count = (pf->flags & 2097152ULL) != 0ULL; ch->max_other = ch->other_count; ch->combined_count = (__u32 )vsi->num_queue_pairs; } return; } } static int i40e_set_channels(struct net_device *dev , struct ethtool_channels *ch ) { struct i40e_netdev_priv *np ; void *tmp ; unsigned int count ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; int new_count ; unsigned int tmp___0 ; { { tmp = netdev_priv((struct net_device const *)dev); np = (struct i40e_netdev_priv *)tmp; count = ch->combined_count; vsi = np->vsi; pf = vsi->back; } if ((unsigned int )vsi->type != 0U) { return (-22); } else { } if ((count == 0U || ch->rx_count != 0U) || ch->tx_count != 0U) { return (-22); } else { } if (ch->other_count != ((pf->flags & 2097152ULL) != 0ULL ? 1U : 0U)) { return (-22); } else { } { tmp___0 = i40e_max_channels(vsi); } if (count > tmp___0) { return (-22); } else { } if (count > (unsigned int )pf->rss_size_max) { count = (unsigned int )pf->rss_size_max; } else { } { new_count = i40e_reconfig_rss_queues(pf, (int )count); } if (new_count > 0) { return (0); } else { return (-22); } } } static struct ethtool_ops const i40e_ethtool_ops = {& i40e_get_settings, 0, & i40e_get_drvinfo, & i40e_get_regs_len, & i40e_get_regs, & i40e_get_wol, & i40e_set_wol, & i40e_get_msglevel, & i40e_set_msglevel, & i40e_nway_reset, & ethtool_op_get_link, & i40e_get_eeprom_len, & i40e_get_eeprom, 0, & i40e_get_coalesce, & i40e_set_coalesce, & i40e_get_ringparam, & i40e_set_ringparam, & i40e_get_pauseparam, 0, & i40e_diag_test, & i40e_get_strings, & i40e_set_phys_id, & i40e_get_ethtool_stats, 0, 0, 0, 0, & i40e_get_sset_count, & i40e_get_rxnfc, & i40e_set_rxnfc, 0, 0, 0, 0, 0, & i40e_get_channels, & i40e_set_channels, 0, 0, 0, & i40e_get_ts_info, 0, 0, 0, 0}; void i40e_set_ethtool_ops(struct net_device *netdev ) { { netdev->ethtool_ops = & i40e_ethtool_ops; return; } } void ldv_dummy_resourceless_instance_callback_8_12(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_13(void (*arg0)(struct net_device * , struct ethtool_stats * , unsigned long long * ) , struct net_device *arg1 , struct ethtool_stats *arg2 , unsigned long long *arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_16(unsigned int (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_17(unsigned int (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_18(void (*arg0)(struct net_device * , struct ethtool_pauseparam * ) , struct net_device *arg1 , struct ethtool_pauseparam *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_19(void (*arg0)(struct net_device * , struct ethtool_regs * , void * ) , struct net_device *arg1 , struct ethtool_regs *arg2 , void *arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_20(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_21(void (*arg0)(struct net_device * , struct ethtool_ringparam * ) , struct net_device *arg1 , struct ethtool_ringparam *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_22(int (*arg0)(struct net_device * , struct ethtool_rxnfc * , unsigned int * ) , struct net_device *arg1 , struct ethtool_rxnfc *arg2 , unsigned int *arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_25(int (*arg0)(struct net_device * , struct ethtool_cmd * ) , struct net_device *arg1 , struct ethtool_cmd *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_26(int (*arg0)(struct net_device * , int ) , struct net_device *arg1 , int arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_29(void (*arg0)(struct net_device * , unsigned int , unsigned char * ) , struct net_device *arg1 , unsigned int arg2 , unsigned char *arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_32(int (*arg0)(struct net_device * , struct ethtool_ts_info * ) , struct net_device *arg1 , struct ethtool_ts_info *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_33(void (*arg0)(struct net_device * , struct ethtool_wolinfo * ) , struct net_device *arg1 , struct ethtool_wolinfo *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_7(int (*arg0)(struct net_device * , struct ethtool_coalesce * ) , struct net_device *arg1 , struct ethtool_coalesce *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_77(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) ; void ldv_dummy_resourceless_instance_callback_8_78(void (*arg0)(struct net_device * , struct ethtool_test * , unsigned long long * ) , struct net_device *arg1 , struct ethtool_test *arg2 , unsigned long long *arg3 ) ; void ldv_dummy_resourceless_instance_callback_8_8(void (*arg0)(struct net_device * , struct ethtool_drvinfo * ) , struct net_device *arg1 , struct ethtool_drvinfo *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_81(int (*arg0)(struct net_device * , struct ethtool_channels * ) , struct net_device *arg1 , struct ethtool_channels *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_82(int (*arg0)(struct net_device * , struct ethtool_coalesce * ) , struct net_device *arg1 , struct ethtool_coalesce *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_83(void (*arg0)(struct net_device * , unsigned int ) , struct net_device *arg1 , unsigned int arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_86(int (*arg0)(struct net_device * , enum ethtool_phys_id_state ) , struct net_device *arg1 , enum ethtool_phys_id_state arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_87(int (*arg0)(struct net_device * , struct ethtool_ringparam * ) , struct net_device *arg1 , struct ethtool_ringparam *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_88(int (*arg0)(struct net_device * , struct ethtool_rxnfc * ) , struct net_device *arg1 , struct ethtool_rxnfc *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_89(int (*arg0)(struct net_device * , struct ethtool_wolinfo * ) , struct net_device *arg1 , struct ethtool_wolinfo *arg2 ) ; void ldv_dummy_resourceless_instance_callback_8_9(int (*arg0)(struct net_device * , struct ethtool_eeprom * , unsigned char * ) , struct net_device *arg1 , struct ethtool_eeprom *arg2 , unsigned char *arg3 ) ; int (*ldv_8_callback_get_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*ldv_8_callback_get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) ; int (*ldv_8_callback_get_eeprom)(struct net_device * , struct ethtool_eeprom * , unsigned char * ) ; int (*ldv_8_callback_get_eeprom_len)(struct net_device * ) ; void (*ldv_8_callback_get_ethtool_stats)(struct net_device * , struct ethtool_stats * , unsigned long long * ) ; unsigned int (*ldv_8_callback_get_link)(struct net_device * ) ; unsigned int (*ldv_8_callback_get_msglevel)(struct net_device * ) ; void (*ldv_8_callback_get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; void (*ldv_8_callback_get_regs)(struct net_device * , struct ethtool_regs * , void * ) ; int (*ldv_8_callback_get_regs_len)(struct net_device * ) ; void (*ldv_8_callback_get_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*ldv_8_callback_get_rxnfc)(struct net_device * , struct ethtool_rxnfc * , unsigned int * ) ; int (*ldv_8_callback_get_settings)(struct net_device * , struct ethtool_cmd * ) ; int (*ldv_8_callback_get_sset_count)(struct net_device * , int ) ; void (*ldv_8_callback_get_strings)(struct net_device * , unsigned int , unsigned char * ) ; int (*ldv_8_callback_get_ts_info)(struct net_device * , struct ethtool_ts_info * ) ; void (*ldv_8_callback_get_wol)(struct net_device * , struct ethtool_wolinfo * ) ; int (*ldv_8_callback_nway_reset)(struct net_device * ) ; void (*ldv_8_callback_self_test)(struct net_device * , struct ethtool_test * , unsigned long long * ) ; int (*ldv_8_callback_set_channels)(struct net_device * , struct ethtool_channels * ) ; int (*ldv_8_callback_set_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*ldv_8_callback_set_msglevel)(struct net_device * , unsigned int ) ; int (*ldv_8_callback_set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) ; int (*ldv_8_callback_set_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*ldv_8_callback_set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*ldv_8_callback_set_wol)(struct net_device * , struct ethtool_wolinfo * ) ; void (*ldv_8_callback_get_channels)(struct net_device * , struct ethtool_channels * ) = & i40e_get_channels; int (*ldv_8_callback_get_coalesce)(struct net_device * , struct ethtool_coalesce * ) = & i40e_get_coalesce; void (*ldv_8_callback_get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) = & i40e_get_drvinfo; int (*ldv_8_callback_get_eeprom)(struct net_device * , struct ethtool_eeprom * , unsigned char * ) = & i40e_get_eeprom; int (*ldv_8_callback_get_eeprom_len)(struct net_device * ) = & i40e_get_eeprom_len; void (*ldv_8_callback_get_ethtool_stats)(struct net_device * , struct ethtool_stats * , unsigned long long * ) = & i40e_get_ethtool_stats; unsigned int (*ldv_8_callback_get_link)(struct net_device * ) = & ethtool_op_get_link; unsigned int (*ldv_8_callback_get_msglevel)(struct net_device * ) = & i40e_get_msglevel; void (*ldv_8_callback_get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) = & i40e_get_pauseparam; void (*ldv_8_callback_get_regs)(struct net_device * , struct ethtool_regs * , void * ) = & i40e_get_regs; int (*ldv_8_callback_get_regs_len)(struct net_device * ) = & i40e_get_regs_len; void (*ldv_8_callback_get_ringparam)(struct net_device * , struct ethtool_ringparam * ) = & i40e_get_ringparam; int (*ldv_8_callback_get_rxnfc)(struct net_device * , struct ethtool_rxnfc * , unsigned int * ) = & i40e_get_rxnfc; int (*ldv_8_callback_get_settings)(struct net_device * , struct ethtool_cmd * ) = & i40e_get_settings; int (*ldv_8_callback_get_sset_count)(struct net_device * , int ) = & i40e_get_sset_count; void (*ldv_8_callback_get_strings)(struct net_device * , unsigned int , unsigned char * ) = & i40e_get_strings; int (*ldv_8_callback_get_ts_info)(struct net_device * , struct ethtool_ts_info * ) = & i40e_get_ts_info; void (*ldv_8_callback_get_wol)(struct net_device * , struct ethtool_wolinfo * ) = & i40e_get_wol; int (*ldv_8_callback_nway_reset)(struct net_device * ) = & i40e_nway_reset; void (*ldv_8_callback_self_test)(struct net_device * , struct ethtool_test * , unsigned long long * ) = & i40e_diag_test; int (*ldv_8_callback_set_channels)(struct net_device * , struct ethtool_channels * ) = & i40e_set_channels; int (*ldv_8_callback_set_coalesce)(struct net_device * , struct ethtool_coalesce * ) = & i40e_set_coalesce; void (*ldv_8_callback_set_msglevel)(struct net_device * , unsigned int ) = & i40e_set_msglevel; int (*ldv_8_callback_set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) = & i40e_set_phys_id; int (*ldv_8_callback_set_ringparam)(struct net_device * , struct ethtool_ringparam * ) = & i40e_set_ringparam; int (*ldv_8_callback_set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) = & i40e_set_rxnfc; int (*ldv_8_callback_set_wol)(struct net_device * , struct ethtool_wolinfo * ) = & i40e_set_wol; void ldv_dummy_resourceless_instance_callback_8_12(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_get_eeprom_len(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_13(void (*arg0)(struct net_device * , struct ethtool_stats * , unsigned long long * ) , struct net_device *arg1 , struct ethtool_stats *arg2 , unsigned long long *arg3 ) { { { i40e_get_ethtool_stats(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_16(unsigned int (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { ethtool_op_get_link(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_17(unsigned int (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_get_msglevel(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_18(void (*arg0)(struct net_device * , struct ethtool_pauseparam * ) , struct net_device *arg1 , struct ethtool_pauseparam *arg2 ) { { { i40e_get_pauseparam(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_19(void (*arg0)(struct net_device * , struct ethtool_regs * , void * ) , struct net_device *arg1 , struct ethtool_regs *arg2 , void *arg3 ) { { { i40e_get_regs(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_20(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_get_regs_len(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_21(void (*arg0)(struct net_device * , struct ethtool_ringparam * ) , struct net_device *arg1 , struct ethtool_ringparam *arg2 ) { { { i40e_get_ringparam(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_22(int (*arg0)(struct net_device * , struct ethtool_rxnfc * , unsigned int * ) , struct net_device *arg1 , struct ethtool_rxnfc *arg2 , unsigned int *arg3 ) { { { i40e_get_rxnfc(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_25(int (*arg0)(struct net_device * , struct ethtool_cmd * ) , struct net_device *arg1 , struct ethtool_cmd *arg2 ) { { { i40e_get_settings(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_26(int (*arg0)(struct net_device * , int ) , struct net_device *arg1 , int arg2 ) { { { i40e_get_sset_count(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_29(void (*arg0)(struct net_device * , unsigned int , unsigned char * ) , struct net_device *arg1 , unsigned int arg2 , unsigned char *arg3 ) { { { i40e_get_strings(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_3(void (*arg0)(struct net_device * , struct ethtool_channels * ) , struct net_device *arg1 , struct ethtool_channels *arg2 ) { { { i40e_get_channels(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_32(int (*arg0)(struct net_device * , struct ethtool_ts_info * ) , struct net_device *arg1 , struct ethtool_ts_info *arg2 ) { { { i40e_get_ts_info(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_33(void (*arg0)(struct net_device * , struct ethtool_wolinfo * ) , struct net_device *arg1 , struct ethtool_wolinfo *arg2 ) { { { i40e_get_wol(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_7(int (*arg0)(struct net_device * , struct ethtool_coalesce * ) , struct net_device *arg1 , struct ethtool_coalesce *arg2 ) { { { i40e_get_coalesce(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_77(int (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_nway_reset(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_8_78(void (*arg0)(struct net_device * , struct ethtool_test * , unsigned long long * ) , struct net_device *arg1 , struct ethtool_test *arg2 , unsigned long long *arg3 ) { { { i40e_diag_test(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_8_8(void (*arg0)(struct net_device * , struct ethtool_drvinfo * ) , struct net_device *arg1 , struct ethtool_drvinfo *arg2 ) { { { i40e_get_drvinfo(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_81(int (*arg0)(struct net_device * , struct ethtool_channels * ) , struct net_device *arg1 , struct ethtool_channels *arg2 ) { { { i40e_set_channels(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_82(int (*arg0)(struct net_device * , struct ethtool_coalesce * ) , struct net_device *arg1 , struct ethtool_coalesce *arg2 ) { { { i40e_set_coalesce(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_83(void (*arg0)(struct net_device * , unsigned int ) , struct net_device *arg1 , unsigned int arg2 ) { { { i40e_set_msglevel(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_86(int (*arg0)(struct net_device * , enum ethtool_phys_id_state ) , struct net_device *arg1 , enum ethtool_phys_id_state arg2 ) { { { i40e_set_phys_id(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_87(int (*arg0)(struct net_device * , struct ethtool_ringparam * ) , struct net_device *arg1 , struct ethtool_ringparam *arg2 ) { { { i40e_set_ringparam(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_88(int (*arg0)(struct net_device * , struct ethtool_rxnfc * ) , struct net_device *arg1 , struct ethtool_rxnfc *arg2 ) { { { i40e_set_rxnfc(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_89(int (*arg0)(struct net_device * , struct ethtool_wolinfo * ) , struct net_device *arg1 , struct ethtool_wolinfo *arg2 ) { { { i40e_set_wol(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_9(int (*arg0)(struct net_device * , struct ethtool_eeprom * , unsigned char * ) , struct net_device *arg1 , struct ethtool_eeprom *arg2 , unsigned char *arg3 ) { { { i40e_get_eeprom(arg1, arg2, arg3); } return; } } extern void __udelay(unsigned long ) ; void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc , u16 opcode ) ; i40e_status i40e_asq_send_command(struct i40e_hw *hw , struct i40e_aq_desc *desc , void *buff , u16 buff_size , struct i40e_asq_cmd_details *cmd_details ) ; void i40e_debug_aq(struct i40e_hw *hw , enum i40e_debug_mask mask , void *desc , void *buffer ) ; i40e_status i40e_aq_queue_shutdown(struct i40e_hw *hw , bool unloading ) ; i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw , u16 *fw_major_version , u16 *fw_minor_version , u16 *api_major_version , u16 *api_minor_version , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_release_resource(struct i40e_hw *hw , enum i40e_aq_resources_ids resource , u8 sdp_number , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_set_hmc_resource_profile(struct i40e_hw *hw , enum i40e_aq_hmc_profile profile , u8 pe_vf_enabled_count , struct i40e_asq_cmd_details *cmd_details ) ; static void i40e_resume_aq(struct i40e_hw *hw ) ; static void i40e_adminq_init_regs(struct i40e_hw *hw ) { { if ((unsigned int )hw->mac.type == 3U) { hw->aq.asq.tail = 33792U; hw->aq.asq.head = 25600U; hw->aq.asq.len = 26624U; hw->aq.arq.tail = 28672U; hw->aq.arq.head = 29696U; hw->aq.arq.len = 32768U; } else { hw->aq.asq.tail = 525312U; hw->aq.asq.head = 525056U; hw->aq.asq.len = 524800U; hw->aq.arq.tail = 525440U; hw->aq.arq.head = 525184U; hw->aq.arq.len = 524928U; } return; } } static i40e_status i40e_alloc_adminq_asq_ring(struct i40e_hw *hw ) { i40e_status ret_code ; { { ret_code = i40e_allocate_dma_mem_d(hw, & hw->aq.asq.desc_buf, (u64 )((unsigned long )hw->aq.num_asq_entries * 32UL), 4096U); } if ((int )ret_code != 0) { return (ret_code); } else { } { ret_code = i40e_allocate_virt_mem_d(hw, & hw->aq.asq.cmd_buf, (u32 )hw->aq.num_asq_entries * 24U); } if ((int )ret_code != 0) { { i40e_free_dma_mem_d(hw, & hw->aq.asq.desc_buf); } return (ret_code); } else { } return (ret_code); } } static i40e_status i40e_alloc_adminq_arq_ring(struct i40e_hw *hw ) { i40e_status ret_code ; { { ret_code = i40e_allocate_dma_mem_d(hw, & hw->aq.arq.desc_buf, (u64 )((unsigned long )hw->aq.num_arq_entries * 32UL), 4096U); } return (ret_code); } } static void i40e_free_adminq_asq(struct i40e_hw *hw ) { { { i40e_free_dma_mem_d(hw, & hw->aq.asq.desc_buf); } return; } } static void i40e_free_adminq_arq(struct i40e_hw *hw ) { { { i40e_free_dma_mem_d(hw, & hw->aq.arq.desc_buf); } return; } } static i40e_status i40e_alloc_arq_bufs(struct i40e_hw *hw ) { i40e_status ret_code ; struct i40e_aq_desc *desc ; struct i40e_dma_mem *bi ; int i ; { { ret_code = i40e_allocate_virt_mem_d(hw, & hw->aq.arq.dma_head, (u32 )hw->aq.num_arq_entries * 20U); } if ((int )ret_code != 0) { goto alloc_arq_bufs; } else { } hw->aq.arq.r.arq_bi = (struct i40e_dma_mem *)hw->aq.arq.dma_head.va; i = 0; goto ldv_49300; ldv_49299: { bi = hw->aq.arq.r.arq_bi + (unsigned long )i; ret_code = i40e_allocate_dma_mem_d(hw, bi, (u64 )hw->aq.arq_buf_size, 4096U); } if ((int )ret_code != 0) { goto unwind_alloc_arq_bufs; } else { } desc = (struct i40e_aq_desc *)hw->aq.arq.desc_buf.va + (unsigned long )i; desc->flags = 4096U; if ((unsigned int )hw->aq.arq_buf_size > 512U) { desc->flags = (__le16 )((unsigned int )desc->flags | 512U); } else { } desc->opcode = 0U; desc->datalen = (unsigned short )bi->size; desc->retval = 0U; desc->cookie_high = 0U; desc->cookie_low = 0U; desc->params.external.addr_high = (unsigned int )(bi->pa >> 32ULL); desc->params.external.addr_low = (unsigned int )bi->pa; desc->params.external.param0 = 0U; desc->params.external.param1 = 0U; i = i + 1; ldv_49300: ; if (i < (int )hw->aq.num_arq_entries) { goto ldv_49299; } else { } alloc_arq_bufs: ; return (ret_code); unwind_alloc_arq_bufs: i = i - 1; goto ldv_49303; ldv_49302: { i40e_free_dma_mem_d(hw, hw->aq.arq.r.arq_bi + (unsigned long )i); i = i - 1; } ldv_49303: ; if (i >= 0) { goto ldv_49302; } else { } { i40e_free_virt_mem_d(hw, & hw->aq.arq.dma_head); } return (ret_code); } } static i40e_status i40e_alloc_asq_bufs(struct i40e_hw *hw ) { i40e_status ret_code ; struct i40e_dma_mem *bi ; int i ; { { ret_code = i40e_allocate_virt_mem_d(hw, & hw->aq.asq.dma_head, (u32 )hw->aq.num_asq_entries * 20U); } if ((int )ret_code != 0) { goto alloc_asq_bufs; } else { } hw->aq.asq.r.asq_bi = (struct i40e_dma_mem *)hw->aq.asq.dma_head.va; i = 0; goto ldv_49314; ldv_49313: { bi = hw->aq.asq.r.asq_bi + (unsigned long )i; ret_code = i40e_allocate_dma_mem_d(hw, bi, (u64 )hw->aq.asq_buf_size, 4096U); } if ((int )ret_code != 0) { goto unwind_alloc_asq_bufs; } else { } i = i + 1; ldv_49314: ; if (i < (int )hw->aq.num_asq_entries) { goto ldv_49313; } else { } alloc_asq_bufs: ; return (ret_code); unwind_alloc_asq_bufs: i = i - 1; goto ldv_49317; ldv_49316: { i40e_free_dma_mem_d(hw, hw->aq.asq.r.asq_bi + (unsigned long )i); i = i - 1; } ldv_49317: ; if (i >= 0) { goto ldv_49316; } else { } { i40e_free_virt_mem_d(hw, & hw->aq.asq.dma_head); } return (ret_code); } } static void i40e_free_arq_bufs(struct i40e_hw *hw ) { int i ; { i = 0; goto ldv_49324; ldv_49323: { i40e_free_dma_mem_d(hw, hw->aq.arq.r.arq_bi + (unsigned long )i); i = i + 1; } ldv_49324: ; if (i < (int )hw->aq.num_arq_entries) { goto ldv_49323; } else { } { i40e_free_dma_mem_d(hw, & hw->aq.arq.desc_buf); i40e_free_virt_mem_d(hw, & hw->aq.arq.dma_head); } return; } } static void i40e_free_asq_bufs(struct i40e_hw *hw ) { int i ; { i = 0; goto ldv_49331; ldv_49330: ; if ((hw->aq.asq.r.asq_bi + (unsigned long )i)->pa != 0ULL) { { i40e_free_dma_mem_d(hw, hw->aq.asq.r.asq_bi + (unsigned long )i); } } else { } i = i + 1; ldv_49331: ; if (i < (int )hw->aq.num_asq_entries) { goto ldv_49330; } else { } { i40e_free_virt_mem_d(hw, & hw->aq.asq.cmd_buf); i40e_free_dma_mem_d(hw, & hw->aq.asq.desc_buf); i40e_free_virt_mem_d(hw, & hw->aq.asq.dma_head); } return; } } static void i40e_config_asq_regs(struct i40e_hw *hw ) { { if ((unsigned int )hw->mac.type == 3U) { { writel((unsigned int )(hw->aq.asq.desc_buf.pa >> 32ULL), (void volatile *)hw->hw_addr + 30720U); writel((unsigned int )hw->aq.asq.desc_buf.pa, (void volatile *)hw->hw_addr + 31744U); writel((unsigned int )((long )((int )hw->aq.num_asq_entries) | (-0x7FFFFFFF-1)), (void volatile *)hw->hw_addr + 26624U); } } else { { writel((unsigned int )(hw->aq.asq.desc_buf.pa >> 32ULL), (void volatile *)hw->hw_addr + 524544U); writel((unsigned int )hw->aq.asq.desc_buf.pa, (void volatile *)hw->hw_addr + 524288U); writel((unsigned int )((long )((int )hw->aq.num_asq_entries) | (-0x7FFFFFFF-1)), (void volatile *)hw->hw_addr + 524800U); } } return; } } static void i40e_config_arq_regs(struct i40e_hw *hw ) { { if ((unsigned int )hw->mac.type == 3U) { { writel((unsigned int )(hw->aq.arq.desc_buf.pa >> 32ULL), (void volatile *)hw->hw_addr + 24576U); writel((unsigned int )hw->aq.arq.desc_buf.pa, (void volatile *)hw->hw_addr + 27648U); writel((unsigned int )((long )((int )hw->aq.num_arq_entries) | (-0x7FFFFFFF-1)), (void volatile *)hw->hw_addr + 32768U); } } else { { writel((unsigned int )(hw->aq.arq.desc_buf.pa >> 32ULL), (void volatile *)hw->hw_addr + 524672U); writel((unsigned int )hw->aq.arq.desc_buf.pa, (void volatile *)hw->hw_addr + 524416U); writel((unsigned int )((long )((int )hw->aq.num_arq_entries) | (-0x7FFFFFFF-1)), (void volatile *)hw->hw_addr + 524928U); } } { writel((unsigned int )((int )hw->aq.num_arq_entries + -1), (void volatile *)hw->hw_addr + (unsigned long )hw->aq.arq.tail); } return; } } static i40e_status i40e_init_asq(struct i40e_hw *hw ) { i40e_status ret_code ; { ret_code = 0; if ((unsigned int )hw->aq.asq.count != 0U) { ret_code = -63; goto init_adminq_exit; } else { } if ((unsigned int )hw->aq.num_asq_entries == 0U || (unsigned int )hw->aq.asq_buf_size == 0U) { ret_code = -4; goto init_adminq_exit; } else { } { hw->aq.asq.next_to_use = 0U; hw->aq.asq.next_to_clean = 0U; hw->aq.asq.count = hw->aq.num_asq_entries; ret_code = i40e_alloc_adminq_asq_ring(hw); } if ((int )ret_code != 0) { goto init_adminq_exit; } else { } { ret_code = i40e_alloc_asq_bufs(hw); } if ((int )ret_code != 0) { goto init_adminq_free_rings; } else { } { i40e_config_asq_regs(hw); } goto init_adminq_exit; init_adminq_free_rings: { i40e_free_adminq_asq(hw); } init_adminq_exit: ; return (ret_code); } } static i40e_status i40e_init_arq(struct i40e_hw *hw ) { i40e_status ret_code ; { ret_code = 0; if ((unsigned int )hw->aq.arq.count != 0U) { ret_code = -63; goto init_adminq_exit; } else { } if ((unsigned int )hw->aq.num_arq_entries == 0U || (unsigned int )hw->aq.arq_buf_size == 0U) { ret_code = -4; goto init_adminq_exit; } else { } { hw->aq.arq.next_to_use = 0U; hw->aq.arq.next_to_clean = 0U; hw->aq.arq.count = hw->aq.num_arq_entries; ret_code = i40e_alloc_adminq_arq_ring(hw); } if ((int )ret_code != 0) { goto init_adminq_exit; } else { } { ret_code = i40e_alloc_arq_bufs(hw); } if ((int )ret_code != 0) { goto init_adminq_free_rings; } else { } { i40e_config_arq_regs(hw); } goto init_adminq_exit; init_adminq_free_rings: { i40e_free_adminq_arq(hw); } init_adminq_exit: ; return (ret_code); } } static i40e_status i40e_shutdown_asq(struct i40e_hw *hw ) { i40e_status ret_code ; { ret_code = 0; if ((unsigned int )hw->aq.asq.count == 0U) { return (-63); } else { } { writel(0U, (void volatile *)hw->hw_addr + (unsigned long )hw->aq.asq.head); writel(0U, (void volatile *)hw->hw_addr + (unsigned long )hw->aq.asq.tail); writel(0U, (void volatile *)hw->hw_addr + (unsigned long )hw->aq.asq.len); mutex_lock_nested(& hw->aq.asq_mutex, 0U); hw->aq.asq.count = 0U; i40e_free_asq_bufs(hw); mutex_unlock(& hw->aq.asq_mutex); } return (ret_code); } } static i40e_status i40e_shutdown_arq(struct i40e_hw *hw ) { i40e_status ret_code ; { ret_code = 0; if ((unsigned int )hw->aq.arq.count == 0U) { return (-63); } else { } { writel(0U, (void volatile *)hw->hw_addr + (unsigned long )hw->aq.arq.head); writel(0U, (void volatile *)hw->hw_addr + (unsigned long )hw->aq.arq.tail); writel(0U, (void volatile *)hw->hw_addr + (unsigned long )hw->aq.arq.len); mutex_lock_nested(& hw->aq.arq_mutex, 0U); hw->aq.arq.count = 0U; i40e_free_arq_bufs(hw); mutex_unlock(& hw->aq.arq_mutex); } return (ret_code); } } i40e_status i40e_init_adminq(struct i40e_hw *hw ) { i40e_status ret_code ; u16 eetrack_lo ; u16 eetrack_hi ; int retry ; struct lock_class_key __key ; struct lock_class_key __key___0 ; { retry = 0; if ((((unsigned int )hw->aq.num_arq_entries == 0U || (unsigned int )hw->aq.num_asq_entries == 0U) || (unsigned int )hw->aq.arq_buf_size == 0U) || (unsigned int )hw->aq.asq_buf_size == 0U) { ret_code = -4; goto init_adminq_exit; } else { } { __mutex_init(& hw->aq.asq_mutex, "&hw->aq.asq_mutex", & __key); __mutex_init(& hw->aq.arq_mutex, "&hw->aq.arq_mutex", & __key___0); i40e_adminq_init_regs(hw); ret_code = i40e_init_asq(hw); } if ((int )ret_code != 0) { goto init_adminq_destroy_locks; } else { } { ret_code = i40e_init_arq(hw); } if ((int )ret_code != 0) { goto init_adminq_free_asq; } else { } ldv_49372: { ret_code = i40e_aq_get_firmware_version(hw, & hw->aq.fw_maj_ver, & hw->aq.fw_min_ver, & hw->aq.api_maj_ver, & hw->aq.api_min_ver, (struct i40e_asq_cmd_details *)0); } if ((int )ret_code != -54) { goto ldv_49371; } else { } { retry = retry + 1; msleep(100U); i40e_resume_aq(hw); } if (retry <= 9) { goto ldv_49372; } else { } ldv_49371: ; if ((int )ret_code != 0) { goto init_adminq_free_arq; } else { } { i40e_read_nvm_word(hw, 24, & hw->nvm.version); i40e_read_nvm_word(hw, 45, & eetrack_lo); i40e_read_nvm_word(hw, 46, & eetrack_hi); hw->nvm.eetrack = (u32 )(((int )eetrack_hi << 16) | (int )eetrack_lo); } if ((unsigned int )hw->aq.api_maj_ver != 1U || (unsigned int )hw->aq.api_min_ver > 1U) { ret_code = -65; goto init_adminq_free_arq; } else { } { i40e_aq_release_resource(hw, 1, 0, (struct i40e_asq_cmd_details *)0); ret_code = i40e_aq_set_hmc_resource_profile(hw, 1, 0, (struct i40e_asq_cmd_details *)0); ret_code = 0; } goto init_adminq_exit; init_adminq_free_arq: { i40e_shutdown_arq(hw); } init_adminq_free_asq: { i40e_shutdown_asq(hw); } init_adminq_destroy_locks: ; init_adminq_exit: ; return (ret_code); } } i40e_status i40e_shutdown_adminq(struct i40e_hw *hw ) { i40e_status ret_code ; bool tmp ; { { ret_code = 0; tmp = i40e_check_asq_alive(hw); } if ((int )tmp) { { i40e_aq_queue_shutdown(hw, 1); } } else { } { i40e_shutdown_asq(hw); i40e_shutdown_arq(hw); } return (ret_code); } } static u16 i40e_clean_asq(struct i40e_hw *hw ) { struct i40e_adminq_ring *asq ; struct i40e_asq_cmd_details *details ; u16 ntc ; struct i40e_aq_desc desc_cb ; struct i40e_aq_desc *desc ; void (*cb_func)(struct i40e_hw * , struct i40e_aq_desc * ) ; unsigned int tmp ; { asq = & hw->aq.asq; ntc = asq->next_to_clean; desc = (struct i40e_aq_desc *)asq->desc_buf.va + (unsigned long )ntc; details = (struct i40e_asq_cmd_details *)asq->cmd_buf.va + (unsigned long )ntc; goto ldv_49388; ldv_49387: ; if ((unsigned long )details->callback != (unsigned long )((void *)0)) { { cb_func = (void (*)(struct i40e_hw * , struct i40e_aq_desc * ))details->callback; desc_cb = *desc; (*cb_func)(hw, & desc_cb); } } else { } { memset((void *)desc, 0, 32UL); memset((void *)details, 0, 24UL); ntc = (u16 )((int )ntc + 1); } if ((int )ntc == (int )asq->count) { ntc = 0U; } else { } desc = (struct i40e_aq_desc *)asq->desc_buf.va + (unsigned long )ntc; details = (struct i40e_asq_cmd_details *)asq->cmd_buf.va + (unsigned long )ntc; ldv_49388: { tmp = readl((void const volatile *)hw->hw_addr + (unsigned long )hw->aq.asq.head); } if (tmp != (unsigned int )ntc) { goto ldv_49387; } else { } asq->next_to_clean = ntc; return (((((int )asq->next_to_clean <= (int )asq->next_to_use ? asq->count : 0U) + (unsigned int )asq->next_to_clean) - (unsigned int )asq->next_to_use) + 65535U); } } static bool i40e_asq_done(struct i40e_hw *hw ) { unsigned int tmp ; { { tmp = readl((void const volatile *)hw->hw_addr + (unsigned long )hw->aq.asq.head); } return (tmp == (unsigned int )hw->aq.asq.next_to_use); } } i40e_status i40e_asq_send_command(struct i40e_hw *hw , struct i40e_aq_desc *desc , void *buff , u16 buff_size , struct i40e_asq_cmd_details *cmd_details ) { i40e_status status ; struct i40e_dma_mem *dma_buff ; struct i40e_asq_cmd_details *details ; struct i40e_aq_desc *desc_on_ring ; bool cmd_completed ; u16 retval ; u16 tmp ; u32 total_delay ; u32 delay_len ; bool tmp___0 ; bool tmp___1 ; { status = 0; dma_buff = (struct i40e_dma_mem *)0; cmd_completed = 0; retval = 0U; if ((unsigned int )hw->aq.asq.count == 0U) { if ((hw->debug_mask & 16777216U) != 0U) { { printk("\016i40e %02x.%x AQTX: Admin queue not initialized.\n", (int )hw->bus.device, (int )hw->bus.func); } } else { } status = -32; goto asq_send_command_exit; } else { } details = (struct i40e_asq_cmd_details *)hw->aq.asq.cmd_buf.va + (unsigned long )hw->aq.asq.next_to_use; if ((unsigned long )cmd_details != (unsigned long )((struct i40e_asq_cmd_details *)0)) { *details = *cmd_details; if (details->cookie != 0ULL) { desc->cookie_high = (unsigned int )(details->cookie >> 32ULL); desc->cookie_low = (unsigned int )details->cookie; } else { } } else { { memset((void *)details, 0, 24UL); } } { desc->flags = (__le16 )((int )((short )desc->flags) & ~ ((int )((short )details->flags_dis))); desc->flags = (__le16 )((int )desc->flags | (int )details->flags_ena); mutex_lock_nested(& hw->aq.asq_mutex, 0U); } if ((int )buff_size > (int )hw->aq.asq_buf_size) { if ((hw->debug_mask & 16777216U) != 0U) { { printk("\016i40e %02x.%x AQTX: Invalid buffer size: %d.\n", (int )hw->bus.device, (int )hw->bus.func, (int )buff_size); } } else { } status = -26; goto asq_send_command_error; } else { } if ((int )details->postpone && ! details->async) { if ((hw->debug_mask & 16777216U) != 0U) { { printk("\016i40e %02x.%x AQTX: Async flag not set along with postpone flag", (int )hw->bus.device, (int )hw->bus.func); } } else { } status = -5; goto asq_send_command_error; } else { } { tmp = i40e_clean_asq(hw); } if ((unsigned int )tmp == 0U) { if ((hw->debug_mask & 16777216U) != 0U) { { printk("\016i40e %02x.%x AQTX: Error queue is full.\n", (int )hw->bus.device, (int )hw->bus.func); } } else { } status = -56; goto asq_send_command_error; } else { } desc_on_ring = (struct i40e_aq_desc *)hw->aq.asq.desc_buf.va + (unsigned long )hw->aq.asq.next_to_use; *desc_on_ring = *desc; if ((unsigned long )buff != (unsigned long )((void *)0)) { { dma_buff = hw->aq.asq.r.asq_bi + (unsigned long )hw->aq.asq.next_to_use; memcpy(dma_buff->va, (void const *)buff, (size_t )buff_size); desc_on_ring->datalen = buff_size; desc_on_ring->params.external.addr_high = (unsigned int )(dma_buff->pa >> 32ULL); desc_on_ring->params.external.addr_low = (unsigned int )dma_buff->pa; } } else { } { i40e_debug_aq(hw, 100663296, (void *)desc_on_ring, buff); hw->aq.asq.next_to_use = (u16 )((int )hw->aq.asq.next_to_use + 1); } if ((int )hw->aq.asq.next_to_use == (int )hw->aq.asq.count) { hw->aq.asq.next_to_use = 0U; } else { } if (! details->postpone) { { writel((unsigned int )hw->aq.asq.next_to_use, (void volatile *)hw->hw_addr + (unsigned long )hw->aq.asq.tail); } } else { } if (! details->async && ! details->postpone) { total_delay = 0U; delay_len = 10U; ldv_49411: { tmp___0 = i40e_asq_done(hw); } if ((int )tmp___0) { goto ldv_49410; } else { } { __udelay((unsigned long )delay_len); total_delay = total_delay + delay_len; } if (total_delay <= 99999U) { goto ldv_49411; } else { } ldv_49410: ; } else { } { tmp___1 = i40e_asq_done(hw); } if ((int )tmp___1) { *desc = *desc_on_ring; if ((unsigned long )buff != (unsigned long )((void *)0)) { { memcpy(buff, (void const *)dma_buff->va, (size_t )buff_size); } } else { } retval = desc->retval; if ((unsigned int )retval != 0U) { if ((hw->debug_mask & 16777216U) != 0U) { { printk("\016i40e %02x.%x AQTX: Command completed with error 0x%X.\n", (int )hw->bus.device, (int )hw->bus.func, (int )retval); } } else { } retval = (unsigned int )retval & 255U; } else { } cmd_completed = 1; if ((unsigned int )retval == 0U) { status = 0; } else { status = -53; } hw->aq.asq_last_status = (enum i40e_admin_queue_err )retval; } else { } if (! cmd_completed && (! details->async && ! details->postpone)) { if ((hw->debug_mask & 16777216U) != 0U) { { printk("\016i40e %02x.%x AQTX: Writeback timeout.\n", (int )hw->bus.device, (int )hw->bus.func); } } else { } status = -54; } else { } asq_send_command_error: { mutex_unlock(& hw->aq.asq_mutex); } asq_send_command_exit: ; return (status); } } void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc , u16 opcode ) { { { memset((void *)desc, 0, 32UL); desc->opcode = opcode; desc->flags = 8192U; } return; } } i40e_status i40e_clean_arq_element(struct i40e_hw *hw , struct i40e_arq_event_info *e , u16 *pending ) { i40e_status ret_code ; u16 ntc ; struct i40e_aq_desc *desc ; struct i40e_dma_mem *bi ; u16 desc_idx ; u16 datalen ; u16 flags ; u16 ntu ; unsigned int tmp ; u16 _min1 ; u16 _min2 ; { { ret_code = 0; ntc = hw->aq.arq.next_to_clean; mutex_lock_nested(& hw->aq.arq_mutex, 0U); tmp = readl((void const volatile *)hw->hw_addr + (unsigned long )hw->aq.arq.head); ntu = (unsigned int )((u16 )tmp) & 1023U; } if ((int )ntu == (int )ntc) { if ((hw->debug_mask & 16777216U) != 0U) { { printk("\016i40e %02x.%x AQRX: Queue is empty.\n", (int )hw->bus.device, (int )hw->bus.func); } } else { } ret_code = -57; goto clean_arq_element_out; } else { } { desc = (struct i40e_aq_desc *)hw->aq.arq.desc_buf.va + (unsigned long )ntc; desc_idx = ntc; i40e_debug_aq(hw, 100663296, (void *)desc, (hw->aq.arq.r.arq_bi + (unsigned long )desc_idx)->va); flags = desc->flags; } if (((int )flags & 4) != 0) { ret_code = -53; hw->aq.arq_last_status = (enum i40e_admin_queue_err )desc->retval; if ((hw->debug_mask & 16777216U) != 0U) { { printk("\016i40e %02x.%x AQRX: Event received with error 0x%X.\n", (int )hw->bus.device, (int )hw->bus.func, (unsigned int )hw->aq.arq_last_status); } } else { } } else { e->desc = *desc; datalen = desc->datalen; _min1 = datalen; _min2 = e->msg_size; e->msg_size = (u16 )((int )_min1 < (int )_min2 ? _min1 : _min2); if ((unsigned long )e->msg_buf != (unsigned long )((u8 *)0U) && (unsigned int )e->msg_size != 0U) { { memcpy((void *)e->msg_buf, (void const *)(hw->aq.arq.r.arq_bi + (unsigned long )desc_idx)->va, (size_t )e->msg_size); } } else { } } { bi = hw->aq.arq.r.arq_bi + (unsigned long )ntc; memset((void *)desc, 0, 32UL); desc->flags = 4096U; } if ((unsigned int )hw->aq.arq_buf_size > 512U) { desc->flags = (__le16 )((unsigned int )desc->flags | 512U); } else { } { desc->datalen = (unsigned short )bi->size; desc->params.external.addr_high = (unsigned int )(bi->pa >> 32ULL); desc->params.external.addr_low = (unsigned int )bi->pa; writel((unsigned int )ntc, (void volatile *)hw->hw_addr + (unsigned long )hw->aq.arq.tail); ntc = (u16 )((int )ntc + 1); } if ((int )ntc == (int )hw->aq.num_arq_entries) { ntc = 0U; } else { } hw->aq.arq.next_to_clean = ntc; hw->aq.arq.next_to_use = ntu; clean_arq_element_out: ; if ((unsigned long )pending != (unsigned long )((u16 *)0U)) { *pending = ((int )ntc > (int )ntu ? hw->aq.arq.count : 0U) + (unsigned int )((int )ntu - (int )ntc); } else { } { mutex_unlock(& hw->aq.arq_mutex); } return (ret_code); } } static void i40e_resume_aq(struct i40e_hw *hw ) { { { hw->aq.asq.next_to_use = 0U; hw->aq.asq.next_to_clean = 0U; i40e_config_asq_regs(hw); hw->aq.arq.next_to_use = 0U; hw->aq.arq.next_to_clean = 0U; i40e_config_arq_regs(hw); } return; } } i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw , u16 vfid , u32 v_opcode , u32 v_retval , u8 *msg , u16 msglen , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_request_resource(struct i40e_hw *hw , enum i40e_aq_resources_ids resource , enum i40e_aq_resource_access_type access , u8 sdp_number , u64 *timeout , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw , u8 bridge_type , u8 mib_type , void *buff , u16 buff_size , u16 *local_len , u16 *remote_len , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw , bool enable_update , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw , bool shutdown_agent , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_start_lldp(struct i40e_hw *hw , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_dcb_updated(struct i40e_hw *hw , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_config_switch_comp_ets(struct i40e_hw *hw , u16 seid , struct i40e_aqc_configure_switching_comp_ets_data *ets_data , enum i40e_admin_queue_opc opcode , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_aq_query_port_ets_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_port_ets_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) ; i40e_status i40e_init_nvm(struct i40e_hw *hw ) ; i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw , u8 *mac_addr , u16 ethtype , u16 flags , u16 vsi_seid , u16 queue , bool is_add , struct i40e_control_filter_stats *stats , struct i40e_asq_cmd_details *cmd_details ) ; static i40e_status i40e_set_mac_type(struct i40e_hw *hw ) { i40e_status status ; { status = 0; if ((unsigned int )hw->vendor_id == 32902U) { { if ((int )hw->device_id == 5490) { goto case_5490; } else { } if ((int )hw->device_id == 5491) { goto case_5491; } else { } if ((int )hw->device_id == 5492) { goto case_5492; } else { } if ((int )hw->device_id == 5503) { goto case_5503; } else { } if ((int )hw->device_id == 5504) { goto case_5504; } else { } if ((int )hw->device_id == 5505) { goto case_5505; } else { } if ((int )hw->device_id == 5506) { goto case_5506; } else { } if ((int )hw->device_id == 5507) { goto case_5507; } else { } if ((int )hw->device_id == 5508) { goto case_5508; } else { } if ((int )hw->device_id == 5509) { goto case_5509; } else { } if ((int )hw->device_id == 5452) { goto case_5452; } else { } if ((int )hw->device_id == 5489) { goto case_5489; } else { } goto switch_default; case_5490: /* CIL Label */ ; case_5491: /* CIL Label */ ; case_5492: /* CIL Label */ ; case_5503: /* CIL Label */ ; case_5504: /* CIL Label */ ; case_5505: /* CIL Label */ ; case_5506: /* CIL Label */ ; case_5507: /* CIL Label */ ; case_5508: /* CIL Label */ ; case_5509: /* CIL Label */ hw->mac.type = 2; goto ldv_49285; case_5452: /* CIL Label */ ; case_5489: /* CIL Label */ hw->mac.type = 3; goto ldv_49285; switch_default: /* CIL Label */ hw->mac.type = 4; goto ldv_49285; switch_break: /* CIL Label */ ; } ldv_49285: ; } else { status = -11; } return (status); } } void i40e_debug_aq(struct i40e_hw *hw , enum i40e_debug_mask mask , void *desc , void *buffer ) { struct i40e_aq_desc *aq_desc ; u8 *aq_buffer ; u32 data[4U] ; u32 i ; { aq_desc = (struct i40e_aq_desc *)desc; aq_buffer = (u8 *)buffer; i = 0U; if (((unsigned int )mask & hw->debug_mask) == 0U || (unsigned long )desc == (unsigned long )((void *)0)) { return; } else { } if (((unsigned int )mask & hw->debug_mask) != 0U) { { printk("\016i40e %02x.%x AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n", (int )hw->bus.device, (int )hw->bus.func, (int )aq_desc->opcode, (int )aq_desc->flags, (int )aq_desc->datalen, (int )aq_desc->retval); } } else { } if (((unsigned int )mask & hw->debug_mask) != 0U) { { printk("\016i40e %02x.%x \tcookie (h,l) 0x%08X 0x%08X\n", (int )hw->bus.device, (int )hw->bus.func, aq_desc->cookie_high, aq_desc->cookie_low); } } else { } if (((unsigned int )mask & hw->debug_mask) != 0U) { { printk("\016i40e %02x.%x \tparam (0,1) 0x%08X 0x%08X\n", (int )hw->bus.device, (int )hw->bus.func, aq_desc->params.internal.param0, aq_desc->params.internal.param1); } } else { } if (((unsigned int )mask & hw->debug_mask) != 0U) { { printk("\016i40e %02x.%x \taddr (h,l) 0x%08X 0x%08X\n", (int )hw->bus.device, (int )hw->bus.func, aq_desc->params.external.addr_high, aq_desc->params.external.addr_low); } } else { } if ((unsigned long )buffer != (unsigned long )((void *)0) && (unsigned int )aq_desc->datalen != 0U) { { memset((void *)(& data), 0, 16UL); } if (((unsigned int )mask & hw->debug_mask) != 0U) { { printk("\016i40e %02x.%x AQ CMD Buffer:\n", (int )hw->bus.device, (int )hw->bus.func); } } else { } i = 0U; goto ldv_49300; ldv_49299: data[(i & 15U) / 4U] = data[(i & 15U) / 4U] | ((unsigned int )*(aq_buffer + (unsigned long )i) << (int )((i & 3U) * 8U)); if ((i & 15U) == 15U) { if (((unsigned int )mask & hw->debug_mask) != 0U) { { printk("\016i40e %02x.%x \t0x%04X %08X %08X %08X %08X\n", (int )hw->bus.device, (int )hw->bus.func, i - 15U, data[0], data[1], data[2], data[3]); } } else { } { memset((void *)(& data), 0, 16UL); } } else { } i = i + 1U; ldv_49300: ; if (i < (u32 )aq_desc->datalen) { goto ldv_49299; } else { } if ((i & 15U) != 0U) { if (((unsigned int )mask & hw->debug_mask) != 0U) { { printk("\016i40e %02x.%x \t0x%04X %08X %08X %08X %08X\n", (int )hw->bus.device, (int )hw->bus.func, i & 4294967280U, data[0], data[1], data[2], data[3]); } } else { } } else { } } else { } return; } } bool i40e_check_asq_alive(struct i40e_hw *hw ) { unsigned int tmp ; { { tmp = readl((void const volatile *)hw->hw_addr + (unsigned long )hw->aq.asq.len); } return ((int )tmp < 0); } } i40e_status i40e_aq_queue_shutdown(struct i40e_hw *hw , bool unloading ) { struct i40e_aq_desc desc ; struct i40e_aqc_queue_shutdown *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_queue_shutdown *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 3); } if ((int )unloading) { cmd->driver_unloading = 1U; } else { } { status = i40e_asq_send_command(hw, & desc, (void *)0, 0, (struct i40e_asq_cmd_details *)0); } return (status); } } i40e_status i40e_init_shared_code(struct i40e_hw *hw ) { i40e_status status ; u32 reg ; { { status = 0; i40e_set_mac_type(hw); } { if ((unsigned int )hw->mac.type == 2U) { goto case_2; } else { } goto switch_default; case_2: /* CIL Label */ ; goto ldv_49318; switch_default: /* CIL Label */ ; return (-11); switch_break: /* CIL Label */ ; } ldv_49318: { hw->phy.get_link_info = 1; reg = readl((void const volatile *)hw->hw_addr + 1836160U); reg = reg & 3U; hw->port = (unsigned char )reg; reg = readl((void const volatile *)hw->hw_addr + 779432U); } if ((reg & 16U) != 0U) { hw->pf_id = (unsigned char )((int )((signed char )((int )hw->bus.device << 3)) | (int )((signed char )hw->bus.func)); } else { hw->pf_id = (unsigned char )hw->bus.func; } { status = i40e_init_nvm(hw); } return (status); } } static i40e_status i40e_aq_mac_address_read(struct i40e_hw *hw , u16 *flags , struct i40e_aqc_mac_address_read_data *addrs , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_mac_address_read *cmd_data ; i40e_status status ; { { cmd_data = (struct i40e_aqc_mac_address_read *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 263); desc.flags = (__le16 )((unsigned int )desc.flags | 4096U); status = i40e_asq_send_command(hw, & desc, (void *)addrs, 24, cmd_details); *flags = cmd_data->command_flags; } return (status); } } i40e_status i40e_aq_mac_address_write(struct i40e_hw *hw , u16 flags , u8 *mac_addr , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_mac_address_write *cmd_data ; i40e_status status ; { { cmd_data = (struct i40e_aqc_mac_address_write *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 264); cmd_data->command_flags = flags; cmd_data->mac_sah = (unsigned short )((int )((short )((int )*mac_addr << 8)) | (int )((short )*(mac_addr + 1UL))); cmd_data->mac_sal = ((((unsigned int )*(mac_addr + 2UL) << 24) | ((unsigned int )*(mac_addr + 3UL) << 16)) | ((unsigned int )*(mac_addr + 4UL) << 8)) | (unsigned int )*(mac_addr + 5UL); status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_get_mac_addr(struct i40e_hw *hw , u8 *mac_addr ) { struct i40e_aqc_mac_address_read_data addrs ; i40e_status status ; u16 flags ; { { flags = 0U; status = i40e_aq_mac_address_read(hw, & flags, & addrs, (struct i40e_asq_cmd_details *)0); } if (((int )flags & 16) != 0) { { memcpy((void *)mac_addr, (void const *)(& addrs.pf_lan_mac), 6UL); } } else { } return (status); } } static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw ) { enum i40e_media_type media ; { { if ((unsigned int )hw->phy.link_info.phy_type == 20U) { goto case_20; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 21U) { goto case_21; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 25U) { goto case_25; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 26U) { goto case_26; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 17U) { goto case_17; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 18U) { goto case_18; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 19U) { goto case_19; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 11U) { goto case_11; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 10U) { goto case_10; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 23U) { goto case_23; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 24U) { goto case_24; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 22U) { goto case_22; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 1U) { goto case_1; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 2U) { goto case_2; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 3U) { goto case_3; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 4U) { goto case_4; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 0U) { goto case_0; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 5U) { goto case_5; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 6U) { goto case_6; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 8U) { goto case_8; } else { } if ((unsigned int )hw->phy.link_info.phy_type == 9U) { goto case_9; } else { } goto switch_default; case_20: /* CIL Label */ ; case_21: /* CIL Label */ ; case_25: /* CIL Label */ ; case_26: /* CIL Label */ media = 1; goto ldv_49353; case_17: /* CIL Label */ ; case_18: /* CIL Label */ ; case_19: /* CIL Label */ media = 2; goto ldv_49353; case_11: /* CIL Label */ ; case_10: /* CIL Label */ ; case_23: /* CIL Label */ ; case_24: /* CIL Label */ ; case_22: /* CIL Label */ media = 5; goto ldv_49353; case_1: /* CIL Label */ ; case_2: /* CIL Label */ ; case_3: /* CIL Label */ ; case_4: /* CIL Label */ media = 3; goto ldv_49353; case_0: /* CIL Label */ ; case_5: /* CIL Label */ ; case_6: /* CIL Label */ ; case_8: /* CIL Label */ ; case_9: /* CIL Label */ ; switch_default: /* CIL Label */ media = 0; goto ldv_49353; switch_break: /* CIL Label */ ; } ldv_49353: ; return (media); } } i40e_status i40e_pf_reset(struct i40e_hw *hw ) { u32 cnt ; u32 cnt1 ; u32 reg ; u32 grst_del ; unsigned int tmp ; { { cnt = 0U; cnt1 = 0U; reg = 0U; tmp = readl((void const volatile *)hw->hw_addr + 754048U); grst_del = tmp & 63U; cnt = 0U; } goto ldv_49381; ldv_49380: { reg = readl((void const volatile *)hw->hw_addr + 754056U); } if ((reg & 3U) == 0U) { goto ldv_49379; } else { } { msleep(100U); cnt = cnt + 1U; } ldv_49381: ; if (cnt < grst_del + 2U) { goto ldv_49380; } else { } ldv_49379: ; if ((reg & 3U) != 0U) { return (-15); } else { } cnt1 = 0U; goto ldv_49384; ldv_49383: { reg = readl((void const volatile *)hw->hw_addr + 745480U); reg = reg & 24U; } if (reg == 24U) { goto ldv_49382; } else { } { usleep_range(10000UL, 20000UL); cnt1 = cnt1 + 1U; } ldv_49384: ; if (cnt1 <= 9U) { goto ldv_49383; } else { } ldv_49382: ; if ((reg & 24U) == 0U) { return (-15); } else { } if (cnt == 0U) { if ((unsigned int )hw->revision_id == 0U) { cnt = 200U; } else { cnt = 10U; } { reg = readl((void const volatile *)hw->hw_addr + 599040U); writel(reg | 1U, (void volatile *)hw->hw_addr + 599040U); } goto ldv_49387; ldv_49386: { reg = readl((void const volatile *)hw->hw_addr + 599040U); } if ((reg & 1U) == 0U) { goto ldv_49385; } else { } { usleep_range(1000UL, 2000UL); cnt = cnt - 1U; } ldv_49387: ; if (cnt != 0U) { goto ldv_49386; } else { } ldv_49385: ; if ((int )reg & 1) { return (-15); } else { } } else { } { i40e_clear_pxe_mode(hw); } return (0); } } void i40e_clear_pxe_mode(struct i40e_hw *hw ) { u32 reg ; { { reg = readl((void const volatile *)hw->hw_addr + 1221888U); } if ((unsigned int )hw->revision_id == 0U) { { writel(reg & 4294967294U, (void volatile *)hw->hw_addr + 1221888U); } } else { { writel(reg | 1U, (void volatile *)hw->hw_addr + 1221888U); } } return; } } static u32 i40e_led_is_mine(struct i40e_hw *hw , int idx ) { u32 gpio_val ; u32 port ; { gpio_val = 0U; if (! hw->func_caps.led[idx]) { return (0U); } else { } { gpio_val = readl((void const volatile *)hw->hw_addr + (unsigned long )((idx + 139328) * 4)); port = gpio_val & 3U; } if ((gpio_val & 8U) != 0U || port != (u32 )hw->port) { return (0U); } else { } return (gpio_val); } } u32 i40e_led_get(struct i40e_hw *hw ) { u32 mode ; int i ; u32 gpio_val ; u32 tmp ; { mode = 0U; i = 22; goto ldv_49407; ldv_49406: { tmp = i40e_led_is_mine(hw, i); gpio_val = tmp; } if (gpio_val == 0U) { goto ldv_49404; } else { } mode = (gpio_val & 61440U) >> 12; goto ldv_49405; ldv_49404: i = i + 1; ldv_49407: ; if (i <= 29) { goto ldv_49406; } else { } ldv_49405: ; return (mode); } } void i40e_led_set(struct i40e_hw *hw , u32 mode , bool blink ) { int i ; u32 gpio_val ; u32 tmp ; { i = 22; goto ldv_49418; ldv_49417: { tmp = i40e_led_is_mine(hw, i); gpio_val = tmp; } if (gpio_val == 0U) { goto ldv_49415; } else { } gpio_val = gpio_val & 4294905855U; gpio_val = gpio_val | ((mode << 12) & 65535U); if (mode == 12U) { blink = 0; } else { } { gpio_val = gpio_val | (u32 )((int )blink << 11); writel(gpio_val, (void volatile *)hw->hw_addr + (unsigned long )((i + 139328) * 4)); } goto ldv_49416; ldv_49415: i = i + 1; ldv_49418: ; if (i <= 29) { goto ldv_49417; } else { } ldv_49416: ; return; } } i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_set_link_restart_an *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_set_link_restart_an *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 1541); cmd->command = 2U; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_get_link_info(struct i40e_hw *hw , bool enable_lse , struct i40e_link_status *link , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_get_link_status *resp ; struct i40e_link_status *hw_link_info ; i40e_status status ; u16 command_flags ; { { resp = (struct i40e_aqc_get_link_status *)(& desc.params.raw); hw_link_info = & hw->phy.link_info; i40e_fill_default_direct_cmd_desc(& desc, 1543); } if ((int )enable_lse) { command_flags = 3U; } else { command_flags = 2U; } { resp->command_flags = command_flags; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } if ((int )status != 0) { goto aq_get_link_info_exit; } else { } { hw->phy.link_info_old = *hw_link_info; hw_link_info->phy_type = (enum i40e_aq_phy_type )resp->phy_type; hw->phy.media_type = i40e_get_media_type(hw); hw_link_info->link_speed = (enum i40e_aq_link_speed )resp->link_speed; hw_link_info->link_info = resp->link_info; hw_link_info->an_info = resp->an_info; hw_link_info->ext_info = resp->ext_info; hw_link_info->loopback = resp->loopback; } if (((int )resp->command_flags & 3) != 0) { hw_link_info->lse_enable = 1; } else { hw_link_info->lse_enable = 0; } if ((unsigned long )link != (unsigned long )((struct i40e_link_status *)0)) { *link = *hw_link_info; } else { } hw->phy.get_link_info = 0; aq_get_link_info_exit: ; return (status); } } i40e_status i40e_aq_add_vsi(struct i40e_hw *hw , struct i40e_vsi_context *vsi_ctx , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_add_get_update_vsi *cmd ; struct i40e_aqc_add_get_update_vsi_completion *resp ; i40e_status status ; { { cmd = (struct i40e_aqc_add_get_update_vsi *)(& desc.params.raw); resp = (struct i40e_aqc_add_get_update_vsi_completion *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 528); cmd->uplink_seid = vsi_ctx->uplink_seid; cmd->connection_type = vsi_ctx->connection_type; cmd->vf_id = vsi_ctx->vf_num; cmd->vsi_flags = vsi_ctx->flags; desc.flags = (__le16 )((unsigned int )desc.flags | 5120U); status = i40e_asq_send_command(hw, & desc, (void *)(& vsi_ctx->info), 128, cmd_details); } if ((int )status != 0) { goto aq_add_vsi_exit; } else { } vsi_ctx->seid = resp->seid; vsi_ctx->vsi_number = resp->vsi_number; vsi_ctx->vsis_allocated = resp->vsi_used; vsi_ctx->vsis_unallocated = resp->vsi_free; aq_add_vsi_exit: ; return (status); } } i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw , u16 seid , bool set , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_set_vsi_promiscuous_modes *cmd ; i40e_status status ; u16 flags ; { { cmd = (struct i40e_aqc_set_vsi_promiscuous_modes *)(& desc.params.raw); flags = 0U; i40e_fill_default_direct_cmd_desc(& desc, 596); } if ((int )set) { flags = (u16 )((unsigned int )flags | 1U); } else { } { cmd->promiscuous_flags = flags; cmd->valid_flags = 1U; cmd->seid = seid; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw , u16 seid , bool set , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_set_vsi_promiscuous_modes *cmd ; i40e_status status ; u16 flags ; { { cmd = (struct i40e_aqc_set_vsi_promiscuous_modes *)(& desc.params.raw); flags = 0U; i40e_fill_default_direct_cmd_desc(& desc, 596); } if ((int )set) { flags = (u16 )((unsigned int )flags | 2U); } else { } { cmd->promiscuous_flags = flags; cmd->valid_flags = 2U; cmd->seid = seid; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw , u16 seid , bool set_filter , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_set_vsi_promiscuous_modes *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_set_vsi_promiscuous_modes *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 596); } if ((int )set_filter) { cmd->promiscuous_flags = (__le16 )((unsigned int )cmd->promiscuous_flags | 4U); } else { cmd->promiscuous_flags = (unsigned int )cmd->promiscuous_flags & 65531U; } { cmd->valid_flags = 4U; cmd->seid = seid; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw , struct i40e_vsi_context *vsi_ctx , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_add_get_update_vsi *cmd ; struct i40e_aqc_add_get_update_vsi_completion *resp ; i40e_status status ; { { cmd = (struct i40e_aqc_add_get_update_vsi *)(& desc.params.raw); resp = (struct i40e_aqc_add_get_update_vsi_completion *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 530); cmd->uplink_seid = vsi_ctx->seid; desc.flags = (__le16 )((unsigned int )desc.flags | 4096U); status = i40e_asq_send_command(hw, & desc, (void *)(& vsi_ctx->info), 128, (struct i40e_asq_cmd_details *)0); } if ((int )status != 0) { goto aq_get_vsi_params_exit; } else { } vsi_ctx->seid = resp->seid; vsi_ctx->vsi_number = resp->vsi_number; vsi_ctx->vsis_allocated = resp->vsi_used; vsi_ctx->vsis_unallocated = resp->vsi_free; aq_get_vsi_params_exit: ; return (status); } } i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw , struct i40e_vsi_context *vsi_ctx , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_add_get_update_vsi *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_add_get_update_vsi *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 529); cmd->uplink_seid = vsi_ctx->seid; desc.flags = (__le16 )((unsigned int )desc.flags | 5120U); status = i40e_asq_send_command(hw, & desc, (void *)(& vsi_ctx->info), 128, cmd_details); } return (status); } } i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw , struct i40e_aqc_get_switch_config_resp *buf , u16 buf_size , u16 *start_seid , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_switch_seid *scfg ; i40e_status status ; { { scfg = (struct i40e_aqc_switch_seid *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 512); desc.flags = (__le16 )((unsigned int )desc.flags | 4096U); } if ((unsigned int )buf_size > 512U) { desc.flags = (__le16 )((unsigned int )desc.flags | 512U); } else { } { scfg->seid = *start_seid; status = i40e_asq_send_command(hw, & desc, (void *)buf, (int )buf_size, cmd_details); *start_seid = scfg->seid; } return (status); } } i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw , u16 *fw_major_version , u16 *fw_minor_version , u16 *api_major_version , u16 *api_minor_version , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_get_version *resp ; i40e_status status ; { { resp = (struct i40e_aqc_get_version *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 1); status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } if ((int )status == 0) { if ((unsigned long )fw_major_version != (unsigned long )((u16 *)0U)) { *fw_major_version = resp->fw_major; } else { } if ((unsigned long )fw_minor_version != (unsigned long )((u16 *)0U)) { *fw_minor_version = resp->fw_minor; } else { } if ((unsigned long )api_major_version != (unsigned long )((u16 *)0U)) { *api_major_version = resp->api_major; } else { } if ((unsigned long )api_minor_version != (unsigned long )((u16 *)0U)) { *api_minor_version = resp->api_minor; } else { } } else { } return (status); } } i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw , struct i40e_driver_version *dv , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_driver_version *cmd ; i40e_status status ; { cmd = (struct i40e_aqc_driver_version *)(& desc.params.raw); if ((unsigned long )dv == (unsigned long )((struct i40e_driver_version *)0)) { return (-5); } else { } { i40e_fill_default_direct_cmd_desc(& desc, 2); desc.flags = (__le16 )((unsigned int )desc.flags | 8192U); cmd->driver_major_ver = dv->major_version; cmd->driver_minor_ver = dv->minor_version; cmd->driver_build_ver = dv->build_version; cmd->driver_subbuild_ver = dv->subbuild_version; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } bool i40e_get_link_status(struct i40e_hw *hw ) { i40e_status status ; bool link_status ; { status = 0; link_status = 0; if ((int )hw->phy.get_link_info) { { status = i40e_aq_get_link_info(hw, 1, (struct i40e_link_status *)0, (struct i40e_asq_cmd_details *)0); } if ((int )status != 0) { goto i40e_get_link_status_exit; } else { } } else { } link_status = ((int )hw->phy.link_info.link_info & 1) != 0; i40e_get_link_status_exit: ; return (link_status); } } i40e_status i40e_aq_add_veb(struct i40e_hw *hw , u16 uplink_seid , u16 downlink_seid , u8 enabled_tc , bool default_port , bool enable_l2_filtering , u16 *veb_seid , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_add_veb *cmd ; struct i40e_aqc_add_veb_completion *resp ; i40e_status status ; u16 veb_flags ; { cmd = (struct i40e_aqc_add_veb *)(& desc.params.raw); resp = (struct i40e_aqc_add_veb_completion *)(& desc.params.raw); veb_flags = 0U; if (((unsigned int )uplink_seid != 0U) ^ ((unsigned int )downlink_seid != 0U)) { return (-5); } else { } { i40e_fill_default_direct_cmd_desc(& desc, 560); cmd->uplink_seid = uplink_seid; cmd->downlink_seid = downlink_seid; cmd->enable_tcs = enabled_tc; } if ((unsigned int )uplink_seid == 0U) { veb_flags = (u16 )((unsigned int )veb_flags | 1U); } else { } if ((int )default_port) { veb_flags = (u16 )((unsigned int )veb_flags | 2U); } else { veb_flags = (u16 )((unsigned int )veb_flags | 4U); } if ((int )enable_l2_filtering) { veb_flags = (u16 )((unsigned int )veb_flags | 8U); } else { } { cmd->veb_flags = veb_flags; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } if ((int )status == 0 && (unsigned long )veb_seid != (unsigned long )((u16 *)0U)) { *veb_seid = resp->veb_seid; } else { } return (status); } } i40e_status i40e_aq_get_veb_parameters(struct i40e_hw *hw , u16 veb_seid , u16 *switch_id , bool *floating , u16 *statistic_index , u16 *vebs_used , u16 *vebs_free , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_get_veb_parameters_completion *cmd_resp ; i40e_status status ; u16 flags ; { cmd_resp = (struct i40e_aqc_get_veb_parameters_completion *)(& desc.params.raw); if ((unsigned int )veb_seid == 0U) { return (-5); } else { } { i40e_fill_default_direct_cmd_desc(& desc, 562); cmd_resp->seid = veb_seid; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } if ((int )status != 0) { goto get_veb_exit; } else { } if ((unsigned long )switch_id != (unsigned long )((u16 *)0U)) { *switch_id = cmd_resp->switch_id; } else { } if ((unsigned long )statistic_index != (unsigned long )((u16 *)0U)) { *statistic_index = cmd_resp->statistic_index; } else { } if ((unsigned long )vebs_used != (unsigned long )((u16 *)0U)) { *vebs_used = cmd_resp->vebs_used; } else { } if ((unsigned long )vebs_free != (unsigned long )((u16 *)0U)) { *vebs_free = cmd_resp->vebs_free; } else { } if ((unsigned long )floating != (unsigned long )((bool *)0)) { flags = cmd_resp->veb_flags; if ((int )flags & 1) { *floating = 1; } else { *floating = 0; } } else { } get_veb_exit: ; return (status); } } i40e_status i40e_aq_add_macvlan(struct i40e_hw *hw , u16 seid , struct i40e_aqc_add_macvlan_element_data *mv_list , u16 count , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_macvlan *cmd ; i40e_status status ; u16 buf_size ; { cmd = (struct i40e_aqc_macvlan *)(& desc.params.raw); if (((unsigned int )count == 0U || (unsigned long )mv_list == (unsigned long )((struct i40e_aqc_add_macvlan_element_data *)0)) || (unsigned long )hw == (unsigned long )((struct i40e_hw *)0)) { return (-5); } else { } { buf_size = (unsigned int )count * 16U; i40e_fill_default_direct_cmd_desc(& desc, 592); cmd->num_addresses = count; cmd->seid[0] = (unsigned int )seid | 32768U; cmd->seid[1] = 0U; cmd->seid[2] = 0U; desc.flags = (__le16 )((unsigned int )desc.flags | 5120U); } if ((unsigned int )buf_size > 512U) { desc.flags = (__le16 )((unsigned int )desc.flags | 512U); } else { } { status = i40e_asq_send_command(hw, & desc, (void *)mv_list, (int )buf_size, cmd_details); } return (status); } } i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw , u16 seid , struct i40e_aqc_remove_macvlan_element_data *mv_list , u16 count , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_macvlan *cmd ; i40e_status status ; u16 buf_size ; { cmd = (struct i40e_aqc_macvlan *)(& desc.params.raw); if (((unsigned int )count == 0U || (unsigned long )mv_list == (unsigned long )((struct i40e_aqc_remove_macvlan_element_data *)0)) || (unsigned long )hw == (unsigned long )((struct i40e_hw *)0)) { return (-5); } else { } { buf_size = (unsigned int )count * 16U; i40e_fill_default_direct_cmd_desc(& desc, 593); cmd->num_addresses = count; cmd->seid[0] = (unsigned int )seid | 32768U; cmd->seid[1] = 0U; cmd->seid[2] = 0U; desc.flags = (__le16 )((unsigned int )desc.flags | 5120U); } if ((unsigned int )buf_size > 512U) { desc.flags = (__le16 )((unsigned int )desc.flags | 512U); } else { } { status = i40e_asq_send_command(hw, & desc, (void *)mv_list, (int )buf_size, cmd_details); } return (status); } } i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw , u16 vfid , u32 v_opcode , u32 v_retval , u8 *msg , u16 msglen , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_pf_vf_message *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_pf_vf_message *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 2050); cmd->id = (unsigned int )vfid; desc.cookie_high = v_opcode; desc.cookie_low = v_retval; desc.flags = (__le16 )((unsigned int )desc.flags | 8192U); } if ((unsigned int )msglen != 0U) { desc.flags = (__le16 )((unsigned int )desc.flags | 5120U); if ((unsigned int )msglen > 512U) { desc.flags = (__le16 )((unsigned int )desc.flags | 512U); } else { } desc.datalen = msglen; } else { } { status = i40e_asq_send_command(hw, & desc, (void *)msg, (int )msglen, cmd_details); } return (status); } } i40e_status i40e_aq_set_hmc_resource_profile(struct i40e_hw *hw , enum i40e_aq_hmc_profile profile , u8 pe_vf_enabled_count , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aq_get_set_hmc_resource_profile *cmd ; i40e_status status ; { { cmd = (struct i40e_aq_get_set_hmc_resource_profile *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 1281); cmd->pm_profile = (unsigned char )profile; cmd->pe_vf_enabled = pe_vf_enabled_count; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_request_resource(struct i40e_hw *hw , enum i40e_aq_resources_ids resource , enum i40e_aq_resource_access_type access , u8 sdp_number , u64 *timeout , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_request_resource *cmd_resp ; i40e_status status ; { { cmd_resp = (struct i40e_aqc_request_resource *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 8); cmd_resp->resource_id = (unsigned short )resource; cmd_resp->access_type = (unsigned short )access; cmd_resp->resource_number = (unsigned int )sdp_number; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } if ((int )status == 0 || (unsigned int )hw->aq.asq_last_status == 12U) { *timeout = (u64 )cmd_resp->timeout; } else { } return (status); } } i40e_status i40e_aq_release_resource(struct i40e_hw *hw , enum i40e_aq_resources_ids resource , u8 sdp_number , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_request_resource *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_request_resource *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 9); cmd->resource_id = (unsigned short )resource; cmd->resource_number = (unsigned int )sdp_number; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_read_nvm(struct i40e_hw *hw , u8 module_pointer , u32 offset , u16 length , void *data , bool last_command , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_nvm_update *cmd ; i40e_status status ; { cmd = (struct i40e_aqc_nvm_update *)(& desc.params.raw); if ((offset & 4278190080U) != 0U) { status = -5; goto i40e_aq_read_nvm_exit; } else { } { i40e_fill_default_direct_cmd_desc(& desc, 1793); } if ((int )last_command) { cmd->command_flags = (u8 )((unsigned int )cmd->command_flags | 1U); } else { } cmd->module_pointer = module_pointer; cmd->offset = offset; cmd->length = length; desc.flags = (__le16 )((unsigned int )desc.flags | 4096U); if ((unsigned int )length > 512U) { desc.flags = (__le16 )((unsigned int )desc.flags | 512U); } else { } { status = i40e_asq_send_command(hw, & desc, data, (int )length, cmd_details); } i40e_aq_read_nvm_exit: ; return (status); } } static void i40e_parse_discover_capabilities(struct i40e_hw *hw , void *buff , u32 cap_count , enum i40e_admin_queue_opc list_type_opc ) { struct i40e_aqc_list_capabilities_element_resp *cap ; u32 number ; u32 logical_id ; u32 phys_id ; struct i40e_hw_capabilities *p ; u32 reg_val ; u32 i ; u16 id ; { i = 0U; cap = (struct i40e_aqc_list_capabilities_element_resp *)buff; if ((unsigned int )list_type_opc == 11U) { p = & hw->dev_caps; } else if ((unsigned int )list_type_opc == 10U) { p = & hw->func_caps; } else { return; } i = 0U; goto ldv_49679; ldv_49678: id = cap->id; number = cap->number; logical_id = cap->logical_id; phys_id = cap->phys_id; { if ((int )id == 1) { goto case_1; } else { } if ((int )id == 2) { goto case_2; } else { } if ((int )id == 3) { goto case_3; } else { } if ((int )id == 4) { goto case_4; } else { } if ((int )id == 5) { goto case_5; } else { } if ((int )id == 18) { goto case_18; } else { } if ((int )id == 19) { goto case_19; } else { } if ((int )id == 20) { goto case_20; } else { } if ((int )id == 21) { goto case_21; } else { } if ((int )id == 22) { goto case_22; } else { } if ((int )id == 23) { goto case_23; } else { } if ((int )id == 24) { goto case_24; } else { } if ((int )id == 33) { goto case_33; } else { } if ((int )id == 64) { goto case_64; } else { } if ((int )id == 65) { goto case_65; } else { } if ((int )id == 66) { goto case_66; } else { } if ((int )id == 67) { goto case_67; } else { } if ((int )id == 68) { goto case_68; } else { } if ((int )id == 241) { goto case_241; } else { } if ((int )id == 242) { goto case_242; } else { } if ((int )id == 81) { goto case_81; } else { } if ((int )id == 97) { goto case_97; } else { } if ((int )id == 98) { goto case_98; } else { } if ((int )id == 99) { goto case_99; } else { } if ((int )id == 70) { goto case_70; } else { } if ((int )id == 69) { goto case_69; } else { } goto switch_default; case_1: /* CIL Label */ p->switch_mode = number; goto ldv_49651; case_2: /* CIL Label */ p->management_mode = number; goto ldv_49651; case_3: /* CIL Label */ p->npar_enable = number; goto ldv_49651; case_4: /* CIL Label */ p->os2bmc = number; goto ldv_49651; case_5: /* CIL Label */ p->valid_functions = number; goto ldv_49651; case_18: /* CIL Label */ ; if (number == 1U) { p->sr_iov_1_1 = 1; } else { } goto ldv_49651; case_19: /* CIL Label */ p->num_vfs = number; p->vf_base_id = logical_id; goto ldv_49651; case_20: /* CIL Label */ ; if (number == 1U) { p->vmdq = 1; } else { } goto ldv_49651; case_21: /* CIL Label */ ; if (number == 1U) { p->evb_802_1_qbg = 1; } else { } goto ldv_49651; case_22: /* CIL Label */ ; if (number == 1U) { p->evb_802_1_qbh = 1; } else { } goto ldv_49651; case_23: /* CIL Label */ p->num_vsis = number; goto ldv_49651; case_24: /* CIL Label */ ; if (number == 1U) { p->dcb = 1; p->enabled_tcmap = logical_id; p->maxtc = phys_id; } else { } goto ldv_49651; case_33: /* CIL Label */ ; if (number == 1U) { p->fcoe = 1; } else { } goto ldv_49651; case_64: /* CIL Label */ { p->rss = 1; reg_val = readl((void const volatile *)hw->hw_addr + 1837760U); } if ((reg_val & 65536U) != 0U) { p->rss_table_size = number; } else { p->rss_table_size = 128U; } p->rss_table_entry_width = logical_id; goto ldv_49651; case_65: /* CIL Label */ p->num_rx_qp = number; p->base_queue = phys_id; goto ldv_49651; case_66: /* CIL Label */ p->num_tx_qp = number; p->base_queue = phys_id; goto ldv_49651; case_67: /* CIL Label */ p->num_msix_vectors = number; goto ldv_49651; case_68: /* CIL Label */ p->num_msix_vectors_vf = number; goto ldv_49651; case_241: /* CIL Label */ ; if (number == 1U) { p->mfp_mode_1 = 1; } else { } goto ldv_49651; case_242: /* CIL Label */ ; if (number == 1U) { p->mgmt_cem = 1; } else { } goto ldv_49651; case_81: /* CIL Label */ ; if (number == 1U) { p->iwarp = 1; } else { } goto ldv_49651; case_97: /* CIL Label */ ; if (phys_id <= 29U) { p->led[phys_id] = 1; } else { } goto ldv_49651; case_98: /* CIL Label */ ; if (phys_id <= 29U) { p->sdp[phys_id] = 1; } else { } goto ldv_49651; case_99: /* CIL Label */ ; if (number == 1U) { p->mdio_port_num = phys_id; p->mdio_port_mode = logical_id; } else { } goto ldv_49651; case_70: /* CIL Label */ ; if (number == 1U) { p->ieee_1588 = 1; } else { } goto ldv_49651; case_69: /* CIL Label */ p->fd = 1; p->fd_filters_guaranteed = number; p->fd_filters_best_effort = logical_id; goto ldv_49651; switch_default: /* CIL Label */ ; goto ldv_49651; switch_break: /* CIL Label */ ; } ldv_49651: i = i + 1U; cap = cap + 1; ldv_49679: ; if (i < cap_count) { goto ldv_49678; } else { } p->rx_buf_chain_len = 5U; return; } } i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw , void *buff , u16 buff_size , u16 *data_size , enum i40e_admin_queue_opc list_type_opc , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aqc_list_capabilites *cmd ; struct i40e_aq_desc desc ; i40e_status status ; { status = 0; cmd = (struct i40e_aqc_list_capabilites *)(& desc.params.raw); if ((unsigned int )list_type_opc - 10U > 1U) { status = -5; goto exit; } else { } { i40e_fill_default_direct_cmd_desc(& desc, (int )((u16 )list_type_opc)); desc.flags = (__le16 )((unsigned int )desc.flags | 4096U); } if ((unsigned int )buff_size > 512U) { desc.flags = (__le16 )((unsigned int )desc.flags | 512U); } else { } { status = i40e_asq_send_command(hw, & desc, buff, (int )buff_size, cmd_details); *data_size = desc.datalen; } if ((int )status != 0) { goto exit; } else { } { i40e_parse_discover_capabilities(hw, buff, cmd->count, list_type_opc); } exit: ; return (status); } } i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw , u8 bridge_type , u8 mib_type , void *buff , u16 buff_size , u16 *local_len , u16 *remote_len , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_lldp_get_mib *cmd ; struct i40e_aqc_lldp_get_mib *resp ; i40e_status status ; { cmd = (struct i40e_aqc_lldp_get_mib *)(& desc.params.raw); resp = (struct i40e_aqc_lldp_get_mib *)(& desc.params.raw); if ((unsigned int )buff_size == 0U || (unsigned long )buff == (unsigned long )((void *)0)) { return (-5); } else { } { i40e_fill_default_direct_cmd_desc(& desc, 2560); desc.flags = (__le16 )((unsigned int )desc.flags | 4096U); cmd->type = (unsigned int )mib_type & 3U; cmd->type = (u8 )((int )((signed char )cmd->type) | ((int )((signed char )((int )bridge_type << 2)) & 12)); desc.datalen = buff_size; desc.flags = (__le16 )((unsigned int )desc.flags | 4096U); } if ((unsigned int )buff_size > 512U) { desc.flags = (__le16 )((unsigned int )desc.flags | 512U); } else { } { status = i40e_asq_send_command(hw, & desc, buff, (int )buff_size, cmd_details); } if ((int )status == 0) { if ((unsigned long )local_len != (unsigned long )((u16 *)0U)) { *local_len = resp->local_len; } else { } if ((unsigned long )remote_len != (unsigned long )((u16 *)0U)) { *remote_len = resp->remote_len; } else { } } else { } return (status); } } i40e_status i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw , bool enable_update , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_lldp_update_mib *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_lldp_update_mib *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 2561); } if (! enable_update) { cmd->command = (u8 )((unsigned int )cmd->command | 1U); } else { } { status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw , bool shutdown_agent , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_lldp_stop *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_lldp_stop *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 2565); } if ((int )shutdown_agent) { cmd->command = (u8 )((unsigned int )cmd->command | 1U); } else { } { status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_start_lldp(struct i40e_hw *hw , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_lldp_start *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_lldp_start *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 2566); cmd->command = 1U; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw , u16 udp_port , u8 header_len , u8 protocol_index , u8 *filter_index , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_add_udp_tunnel *cmd ; struct i40e_aqc_del_udp_tunnel_completion *resp ; i40e_status status ; { { cmd = (struct i40e_aqc_add_udp_tunnel *)(& desc.params.raw); resp = (struct i40e_aqc_del_udp_tunnel_completion *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 2816); cmd->udp_port = udp_port; cmd->protocol_type = protocol_index; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } if ((int )status == 0) { *filter_index = resp->index; } else { } return (status); } } i40e_status i40e_aq_del_udp_tunnel(struct i40e_hw *hw , u8 index , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_remove_udp_tunnel *cmd ; i40e_status status ; { { cmd = (struct i40e_aqc_remove_udp_tunnel *)(& desc.params.raw); i40e_fill_default_direct_cmd_desc(& desc, 2817); cmd->index = index; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_delete_element(struct i40e_hw *hw , u16 seid , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_switch_seid *cmd ; i40e_status status ; { cmd = (struct i40e_aqc_switch_seid *)(& desc.params.raw); if ((unsigned int )seid == 0U) { return (-5); } else { } { i40e_fill_default_direct_cmd_desc(& desc, 579); cmd->seid = seid; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } i40e_status i40e_aq_dcb_updated(struct i40e_hw *hw , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; i40e_status status ; { { i40e_fill_default_direct_cmd_desc(& desc, 770); status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } return (status); } } static i40e_status i40e_aq_tx_sched_cmd(struct i40e_hw *hw , u16 seid , void *buff , u16 buff_size , enum i40e_admin_queue_opc opcode , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_tx_sched_ind *cmd ; i40e_status status ; bool cmd_param_flag ; { cmd = (struct i40e_aqc_tx_sched_ind *)(& desc.params.raw); cmd_param_flag = 0; { if ((unsigned int )opcode == 1030U) { goto case_1030; } else { } if ((unsigned int )opcode == 1031U) { goto case_1031; } else { } if ((unsigned int )opcode == 1043U) { goto case_1043; } else { } if ((unsigned int )opcode == 1044U) { goto case_1044; } else { } if ((unsigned int )opcode == 1045U) { goto case_1045; } else { } if ((unsigned int )opcode == 1046U) { goto case_1046; } else { } if ((unsigned int )opcode == 1047U) { goto case_1047; } else { } if ((unsigned int )opcode == 1032U) { goto case_1032; } else { } if ((unsigned int )opcode == 1034U) { goto case_1034; } else { } if ((unsigned int )opcode == 1048U) { goto case_1048; } else { } if ((unsigned int )opcode == 1049U) { goto case_1049; } else { } if ((unsigned int )opcode == 1050U) { goto case_1050; } else { } goto switch_default; case_1030: /* CIL Label */ ; case_1031: /* CIL Label */ ; case_1043: /* CIL Label */ ; case_1044: /* CIL Label */ ; case_1045: /* CIL Label */ ; case_1046: /* CIL Label */ ; case_1047: /* CIL Label */ cmd_param_flag = 1; goto ldv_49783; case_1032: /* CIL Label */ ; case_1034: /* CIL Label */ ; case_1048: /* CIL Label */ ; case_1049: /* CIL Label */ ; case_1050: /* CIL Label */ cmd_param_flag = 0; goto ldv_49783; switch_default: /* CIL Label */ ; return (-5); switch_break: /* CIL Label */ ; } ldv_49783: { i40e_fill_default_direct_cmd_desc(& desc, (int )((u16 )opcode)); desc.flags = (__le16 )((unsigned int )desc.flags | 4096U); } if ((int )cmd_param_flag) { desc.flags = (__le16 )((unsigned int )desc.flags | 1024U); } else { } if ((unsigned int )buff_size > 512U) { desc.flags = (__le16 )((unsigned int )desc.flags | 512U); } else { } { desc.datalen = buff_size; cmd->vsi_seid = seid; status = i40e_asq_send_command(hw, & desc, buff, (int )buff_size, cmd_details); } return (status); } } i40e_status i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw , u16 seid , struct i40e_aqc_configure_vsi_tc_bw_data *bw_data , struct i40e_asq_cmd_details *cmd_details ) { i40e_status tmp ; { { tmp = i40e_aq_tx_sched_cmd(hw, (int )seid, (void *)bw_data, 32, 1031, cmd_details); } return (tmp); } } i40e_status i40e_aq_config_switch_comp_ets(struct i40e_hw *hw , u16 seid , struct i40e_aqc_configure_switching_comp_ets_data *ets_data , enum i40e_admin_queue_opc opcode , struct i40e_asq_cmd_details *cmd_details ) { i40e_status tmp ; { { tmp = i40e_aq_tx_sched_cmd(hw, (int )seid, (void *)ets_data, 128, opcode, cmd_details); } return (tmp); } } i40e_status i40e_aq_config_switch_comp_bw_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_configure_switching_comp_bw_config_data *bw_data , struct i40e_asq_cmd_details *cmd_details ) { i40e_status tmp ; { { tmp = i40e_aq_tx_sched_cmd(hw, (int )seid, (void *)bw_data, 32, 1047, cmd_details); } return (tmp); } } i40e_status i40e_aq_query_vsi_bw_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_vsi_bw_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) { i40e_status tmp ; { { tmp = i40e_aq_tx_sched_cmd(hw, (int )seid, (void *)bw_data, 64, 1032, cmd_details); } return (tmp); } } i40e_status i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_vsi_ets_sla_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) { i40e_status tmp ; { { tmp = i40e_aq_tx_sched_cmd(hw, (int )seid, (void *)bw_data, 32, 1034, cmd_details); } return (tmp); } } i40e_status i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_switching_comp_ets_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) { i40e_status tmp ; { { tmp = i40e_aq_tx_sched_cmd(hw, (int )seid, (void *)bw_data, 64, 1048, cmd_details); } return (tmp); } } i40e_status i40e_aq_query_port_ets_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_port_ets_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) { i40e_status tmp ; { { tmp = i40e_aq_tx_sched_cmd(hw, (int )seid, (void *)bw_data, 68, 1049, cmd_details); } return (tmp); } } i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw , u16 seid , struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data , struct i40e_asq_cmd_details *cmd_details ) { i40e_status tmp ; { { tmp = i40e_aq_tx_sched_cmd(hw, (int )seid, (void *)bw_data, 32, 1050, cmd_details); } return (tmp); } } static i40e_status i40e_validate_filter_settings(struct i40e_hw *hw , struct i40e_filter_control_settings *settings ) { u32 fcoe_cntx_size ; u32 fcoe_filt_size ; u32 pe_cntx_size ; u32 pe_filt_size ; u32 fcoe_fmax ; u32 pe_fmax ; u32 val ; { { if ((unsigned int )settings->fcoe_filt_num == 0U) { goto case_0; } else { } if ((unsigned int )settings->fcoe_filt_num == 1U) { goto case_1; } else { } if ((unsigned int )settings->fcoe_filt_num == 2U) { goto case_2; } else { } if ((unsigned int )settings->fcoe_filt_num == 3U) { goto case_3; } else { } if ((unsigned int )settings->fcoe_filt_num == 4U) { goto case_4; } else { } if ((unsigned int )settings->fcoe_filt_num == 5U) { goto case_5; } else { } goto switch_default; case_0: /* CIL Label */ ; case_1: /* CIL Label */ ; case_2: /* CIL Label */ ; case_3: /* CIL Label */ ; case_4: /* CIL Label */ ; case_5: /* CIL Label */ fcoe_filt_size = 1024U; fcoe_filt_size = fcoe_filt_size << (int )settings->fcoe_filt_num; goto ldv_49856; switch_default: /* CIL Label */ ; return (-5); switch_break: /* CIL Label */ ; } ldv_49856: ; { if ((unsigned int )settings->fcoe_cntx_num == 0U) { goto case_0___0; } else { } if ((unsigned int )settings->fcoe_cntx_num == 1U) { goto case_1___0; } else { } if ((unsigned int )settings->fcoe_cntx_num == 2U) { goto case_2___0; } else { } if ((unsigned int )settings->fcoe_cntx_num == 3U) { goto case_3___0; } else { } goto switch_default___0; case_0___0: /* CIL Label */ ; case_1___0: /* CIL Label */ ; case_2___0: /* CIL Label */ ; case_3___0: /* CIL Label */ fcoe_cntx_size = 512U; fcoe_cntx_size = fcoe_cntx_size << (int )settings->fcoe_cntx_num; goto ldv_49862; switch_default___0: /* CIL Label */ ; return (-5); switch_break___0: /* CIL Label */ ; } ldv_49862: ; { if ((unsigned int )settings->pe_filt_num == 0U) { goto case_0___1; } else { } if ((unsigned int )settings->pe_filt_num == 1U) { goto case_1___1; } else { } if ((unsigned int )settings->pe_filt_num == 2U) { goto case_2___1; } else { } if ((unsigned int )settings->pe_filt_num == 3U) { goto case_3___1; } else { } if ((unsigned int )settings->pe_filt_num == 4U) { goto case_4___0; } else { } if ((unsigned int )settings->pe_filt_num == 5U) { goto case_5___0; } else { } if ((unsigned int )settings->pe_filt_num == 6U) { goto case_6; } else { } if ((unsigned int )settings->pe_filt_num == 7U) { goto case_7; } else { } if ((unsigned int )settings->pe_filt_num == 8U) { goto case_8; } else { } if ((unsigned int )settings->pe_filt_num == 9U) { goto case_9; } else { } if ((unsigned int )settings->pe_filt_num == 10U) { goto case_10; } else { } goto switch_default___1; case_0___1: /* CIL Label */ ; case_1___1: /* CIL Label */ ; case_2___1: /* CIL Label */ ; case_3___1: /* CIL Label */ ; case_4___0: /* CIL Label */ ; case_5___0: /* CIL Label */ ; case_6: /* CIL Label */ ; case_7: /* CIL Label */ ; case_8: /* CIL Label */ ; case_9: /* CIL Label */ ; case_10: /* CIL Label */ pe_filt_size = 1024U; pe_filt_size = pe_filt_size << (int )settings->pe_filt_num; goto ldv_49875; switch_default___1: /* CIL Label */ ; return (-5); switch_break___1: /* CIL Label */ ; } ldv_49875: ; { if ((unsigned int )settings->pe_cntx_num == 0U) { goto case_0___2; } else { } if ((unsigned int )settings->pe_cntx_num == 1U) { goto case_1___2; } else { } if ((unsigned int )settings->pe_cntx_num == 2U) { goto case_2___2; } else { } if ((unsigned int )settings->pe_cntx_num == 3U) { goto case_3___2; } else { } if ((unsigned int )settings->pe_cntx_num == 4U) { goto case_4___1; } else { } if ((unsigned int )settings->pe_cntx_num == 5U) { goto case_5___1; } else { } if ((unsigned int )settings->pe_cntx_num == 6U) { goto case_6___0; } else { } if ((unsigned int )settings->pe_cntx_num == 7U) { goto case_7___0; } else { } if ((unsigned int )settings->pe_cntx_num == 8U) { goto case_8___0; } else { } if ((unsigned int )settings->pe_cntx_num == 9U) { goto case_9___0; } else { } goto switch_default___2; case_0___2: /* CIL Label */ ; case_1___2: /* CIL Label */ ; case_2___2: /* CIL Label */ ; case_3___2: /* CIL Label */ ; case_4___1: /* CIL Label */ ; case_5___1: /* CIL Label */ ; case_6___0: /* CIL Label */ ; case_7___0: /* CIL Label */ ; case_8___0: /* CIL Label */ ; case_9___0: /* CIL Label */ pe_cntx_size = 512U; pe_cntx_size = pe_cntx_size << (int )settings->pe_cntx_num; goto ldv_49887; switch_default___2: /* CIL Label */ ; return (-5); switch_break___2: /* CIL Label */ ; } ldv_49887: { val = readl((void const volatile *)hw->hw_addr + 794832U); fcoe_fmax = val & 65535U; } if (fcoe_filt_size + fcoe_cntx_size > fcoe_fmax) { return (-26); } else { } { val = readl((void const volatile *)hw->hw_addr + 794696U); pe_fmax = val & 67108863U; } if (pe_filt_size + pe_cntx_size > pe_fmax) { return (-26); } else { } return (0); } } i40e_status i40e_set_filter_control(struct i40e_hw *hw , struct i40e_filter_control_settings *settings ) { i40e_status ret ; u32 hash_lut_size ; u32 val ; { ret = 0; hash_lut_size = 0U; if ((unsigned long )settings == (unsigned long )((struct i40e_filter_control_settings *)0)) { return (-5); } else { } { ret = i40e_validate_filter_settings(hw, settings); } if ((int )ret != 0) { return (ret); } else { } { val = readl((void const volatile *)hw->hw_addr + 1837760U); val = val & 4294967264U; val = val | ((u32 )settings->pe_filt_num & 31U); val = val & 4294966303U; val = val | (((unsigned int )settings->pe_cntx_num << 5) & 992U); val = val & 4294951935U; val = val | (((unsigned int )settings->fcoe_filt_num << 10) & 15360U); val = val & 4294918143U; val = val | (((unsigned int )settings->fcoe_cntx_num << 14) & 65535U); val = val & 4294901759U; } if ((unsigned int )settings->hash_lut_size == 1U) { hash_lut_size = 1U; } else { } val = val | ((hash_lut_size << 16) & 65536U); if ((int )settings->enable_fdir) { val = val | 131072U; } else { } if ((int )settings->enable_ethtype) { val = val | 262144U; } else { } if ((int )settings->enable_macvlan) { val = val | 524288U; } else { } { writel(val, (void volatile *)hw->hw_addr + 1837760U); } return (0); } } i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw , u8 *mac_addr , u16 ethtype , u16 flags , u16 vsi_seid , u16 queue , bool is_add , struct i40e_control_filter_stats *stats , struct i40e_asq_cmd_details *cmd_details ) { struct i40e_aq_desc desc ; struct i40e_aqc_add_remove_control_packet_filter *cmd ; struct i40e_aqc_add_remove_control_packet_filter_completion *resp ; i40e_status status ; { cmd = (struct i40e_aqc_add_remove_control_packet_filter *)(& desc.params.raw); resp = (struct i40e_aqc_add_remove_control_packet_filter_completion *)(& desc.params.raw); if ((unsigned int )vsi_seid == 0U) { return (-5); } else { } if ((int )is_add) { { i40e_fill_default_direct_cmd_desc(& desc, 602); cmd->queue = queue; } } else { { i40e_fill_default_direct_cmd_desc(& desc, 603); } } if ((unsigned long )mac_addr != (unsigned long )((u8 *)0U)) { { memcpy((void *)(& cmd->mac), (void const *)mac_addr, 6UL); } } else { } { cmd->etype = ethtype; cmd->flags = flags; cmd->seid = vsi_seid; status = i40e_asq_send_command(hw, & desc, (void *)0, 0, cmd_details); } if ((int )status == 0 && (unsigned long )stats != (unsigned long )((struct i40e_control_filter_stats *)0)) { stats->mac_etype_used = resp->mac_etype_used; stats->etype_used = resp->etype_used; stats->mac_etype_free = resp->mac_etype_free; stats->etype_free = resp->etype_free; } else { } return (status); } } void i40e_set_pci_config_data(struct i40e_hw *hw , u16 link_status ) { { hw->bus.type = 3; { if (((int )link_status & 1008) == 16) { goto case_16; } else { } if (((int )link_status & 1008) == 32) { goto case_32; } else { } if (((int )link_status & 1008) == 64) { goto case_64; } else { } if (((int )link_status & 1008) == 128) { goto case_128; } else { } goto switch_default; case_16: /* CIL Label */ hw->bus.width = 1; goto ldv_49916; case_32: /* CIL Label */ hw->bus.width = 2; goto ldv_49916; case_64: /* CIL Label */ hw->bus.width = 4; goto ldv_49916; case_128: /* CIL Label */ hw->bus.width = 8; goto ldv_49916; switch_default: /* CIL Label */ hw->bus.width = 0; goto ldv_49916; switch_break: /* CIL Label */ ; } ldv_49916: ; { if (((int )link_status & 15) == 1) { goto case_1; } else { } if (((int )link_status & 15) == 2) { goto case_2; } else { } if (((int )link_status & 15) == 3) { goto case_3; } else { } goto switch_default___0; case_1: /* CIL Label */ hw->bus.speed = 2500; goto ldv_49922; case_2: /* CIL Label */ hw->bus.speed = 5000; goto ldv_49922; case_3: /* CIL Label */ hw->bus.speed = 8000; goto ldv_49922; switch_default___0: /* CIL Label */ hw->bus.speed = 0; goto ldv_49922; switch_break___0: /* CIL Label */ ; } ldv_49922: ; return; } } i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 sd_index , enum i40e_sd_entry_type type , u64 direct_mode_sz ) ; i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 pd_index ) ; i40e_status i40e_remove_pd_bp(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 idx , bool is_pf ) ; i40e_status i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info , u32 idx ) ; i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 idx , bool is_pf ) ; i40e_status i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info , u32 idx ) ; i40e_status i40e_remove_pd_page_new(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 idx , bool is_pf ) ; i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 sd_index , enum i40e_sd_entry_type type , u64 direct_mode_sz ) { enum i40e_memory_type mem_type ; struct i40e_hmc_sd_entry *sd_entry ; bool dma_mem_alloc_done ; struct i40e_dma_mem mem ; i40e_status ret_code ; u64 alloc_len ; { dma_mem_alloc_done = 0; if ((unsigned long )hmc_info->sd_table.sd_entry == (unsigned long )((struct i40e_hmc_sd_entry *)0)) { ret_code = -19; goto exit; } else { } if (sd_index >= hmc_info->sd_table.sd_cnt) { ret_code = -45; goto exit; } else { } sd_entry = hmc_info->sd_table.sd_entry + (unsigned long )sd_index; if (! sd_entry->valid) { if ((unsigned int )type == 1U) { mem_type = 5; alloc_len = 4096ULL; } else { mem_type = 7; alloc_len = direct_mode_sz; } { ret_code = i40e_allocate_dma_mem_d(hw, & mem, alloc_len, 4096U); } if ((int )ret_code != 0) { goto exit; } else { } dma_mem_alloc_done = 1; if ((unsigned int )type == 1U) { { ret_code = i40e_allocate_virt_mem_d(hw, & sd_entry->u.pd_table.pd_entry_virt_mem, 20480U); } if ((int )ret_code != 0) { goto exit; } else { } sd_entry->u.pd_table.pd_entry = (struct i40e_hmc_pd_entry *)sd_entry->u.pd_table.pd_entry_virt_mem.va; sd_entry->u.pd_table.pd_page_addr = mem; } else { sd_entry->u.bp.addr = mem; sd_entry->u.bp.sd_pd_index = sd_index; } (hmc_info->sd_table.sd_entry + (unsigned long )sd_index)->entry_type = type; hmc_info->sd_table.ref_cnt = hmc_info->sd_table.ref_cnt + 1U; } else { } if ((unsigned int )sd_entry->entry_type == 2U) { sd_entry->u.bp.ref_cnt = sd_entry->u.bp.ref_cnt + 1U; } else { } exit: ; if ((int )ret_code != 0) { if ((int )dma_mem_alloc_done) { { i40e_free_dma_mem_d(hw, & mem); } } else { } } else { } return (ret_code); } } i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 pd_index ) { i40e_status ret_code ; struct i40e_hmc_pd_table *pd_table ; struct i40e_hmc_pd_entry *pd_entry ; struct i40e_dma_mem mem ; u32 sd_idx ; u32 rel_pd_idx ; u64 *pd_addr ; u64 page_desc ; { ret_code = 0; if (pd_index / 512U >= hmc_info->sd_table.sd_cnt) { ret_code = -46; goto exit; } else { } sd_idx = pd_index / 512U; if ((unsigned int )(hmc_info->sd_table.sd_entry + (unsigned long )sd_idx)->entry_type != 1U) { goto exit; } else { } rel_pd_idx = pd_index & 511U; pd_table = & (hmc_info->sd_table.sd_entry + (unsigned long )sd_idx)->u.pd_table; pd_entry = pd_table->pd_entry + (unsigned long )rel_pd_idx; if (! pd_entry->valid) { { ret_code = i40e_allocate_dma_mem_d(hw, & mem, 4096ULL, 4096U); } if ((int )ret_code != 0) { goto exit; } else { } { pd_entry->bp.addr = mem; pd_entry->bp.sd_pd_index = pd_index; pd_entry->bp.entry_type = 1; page_desc = mem.pa | 1ULL; pd_addr = (u64 *)pd_table->pd_page_addr.va; pd_addr = pd_addr + (unsigned long )rel_pd_idx; memcpy((void *)pd_addr, (void const *)(& page_desc), 8UL); pd_entry->sd_index = sd_idx; pd_entry->valid = 1; pd_table->ref_cnt = pd_table->ref_cnt + 1U; } } else { } pd_entry->bp.ref_cnt = pd_entry->bp.ref_cnt + 1U; exit: ; return (ret_code); } } i40e_status i40e_remove_pd_bp(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 idx , bool is_pf ) { i40e_status ret_code ; struct i40e_hmc_pd_entry *pd_entry ; struct i40e_hmc_pd_table *pd_table ; struct i40e_hmc_sd_entry *sd_entry ; u32 sd_idx ; u32 rel_pd_idx ; u64 *pd_addr ; { ret_code = 0; sd_idx = idx / 512U; rel_pd_idx = idx & 511U; if (sd_idx >= hmc_info->sd_table.sd_cnt) { ret_code = -46; goto exit; } else { } sd_entry = hmc_info->sd_table.sd_entry + (unsigned long )sd_idx; if ((unsigned int )sd_entry->entry_type != 1U) { ret_code = -47; goto exit; } else { } pd_table = & (hmc_info->sd_table.sd_entry + (unsigned long )sd_idx)->u.pd_table; pd_entry = pd_table->pd_entry + (unsigned long )rel_pd_idx; pd_entry->bp.ref_cnt = pd_entry->bp.ref_cnt - 1U; if (pd_entry->bp.ref_cnt != 0U) { goto exit; } else { } { pd_entry->valid = 0; pd_table->ref_cnt = pd_table->ref_cnt - 1U; pd_addr = (u64 *)pd_table->pd_page_addr.va; pd_addr = pd_addr + (unsigned long )rel_pd_idx; memset((void *)pd_addr, 0, 8UL); } if ((int )is_pf) { { writel(sd_idx | (idx << 16), (void volatile *)hw->hw_addr + 787200U); } } else { { writel(sd_idx | (idx << 16), (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_info->hmc_fn_id + 204976) * 4)); } } { ret_code = i40e_free_dma_mem_d(hw, & pd_entry->bp.addr); } if ((int )ret_code != 0) { goto exit; } else { } if (pd_table->ref_cnt == 0U) { { i40e_free_virt_mem_d(hw, & pd_table->pd_entry_virt_mem); } } else { } exit: ; return (ret_code); } } i40e_status i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info , u32 idx ) { i40e_status ret_code ; struct i40e_hmc_sd_entry *sd_entry ; { ret_code = 0; sd_entry = hmc_info->sd_table.sd_entry + (unsigned long )idx; sd_entry->u.bp.ref_cnt = sd_entry->u.bp.ref_cnt - 1U; if (sd_entry->u.bp.ref_cnt != 0U) { ret_code = -63; goto exit; } else { } hmc_info->sd_table.ref_cnt = hmc_info->sd_table.ref_cnt - 1U; sd_entry->valid = 0; exit: ; return (ret_code); } } i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 idx , bool is_pf ) { struct i40e_hmc_sd_entry *sd_entry ; i40e_status ret_code ; u32 val2 ; u32 val3 ; { ret_code = 0; sd_entry = hmc_info->sd_table.sd_entry + (unsigned long )idx; if ((int )is_pf) { { val2 = 2050U; val3 = idx | 2147483648U; writel(0U, (void volatile *)hw->hw_addr + 786944U); writel(val2, (void volatile *)hw->hw_addr + 786688U); writel(val3, (void volatile *)hw->hw_addr + 786432U); } } else { ret_code = -64; goto exit; } { ret_code = i40e_free_dma_mem_d(hw, & sd_entry->u.bp.addr); } if ((int )ret_code != 0) { } else { } exit: ; return (ret_code); } } i40e_status i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info , u32 idx ) { i40e_status ret_code ; struct i40e_hmc_sd_entry *sd_entry ; { ret_code = 0; sd_entry = hmc_info->sd_table.sd_entry + (unsigned long )idx; if (sd_entry->u.pd_table.ref_cnt != 0U) { ret_code = -63; goto exit; } else { } sd_entry->valid = 0; hmc_info->sd_table.ref_cnt = hmc_info->sd_table.ref_cnt - 1U; exit: ; return (ret_code); } } i40e_status i40e_remove_pd_page_new(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 idx , bool is_pf ) { i40e_status ret_code ; struct i40e_hmc_sd_entry *sd_entry ; u32 val2 ; u32 val3 ; { ret_code = 0; sd_entry = hmc_info->sd_table.sd_entry + (unsigned long )idx; if ((int )is_pf) { { val2 = 2048U; val3 = idx | 2147483648U; writel(0U, (void volatile *)hw->hw_addr + 786944U); writel(val2, (void volatile *)hw->hw_addr + 786688U); writel(val3, (void volatile *)hw->hw_addr + 786432U); } } else { ret_code = -64; goto exit; } { ret_code = i40e_free_dma_mem_d(hw, & sd_entry->u.pd_table.pd_page_addr); } if ((int )ret_code != 0) { } else { } exit: ; return (ret_code); } } static u64 i40e_align_l2obj_base(u64 offset ) { u64 aligned_offset ; { aligned_offset = offset; if ((offset & 511ULL) != 0ULL) { aligned_offset = (aligned_offset - (offset & 511ULL)) + 512ULL; } else { } return (aligned_offset); } } static u64 i40e_calculate_l2fpm_size(u32 txq_num , u32 rxq_num , u32 fcoe_cntx_num , u32 fcoe_filt_num ) { u64 fpm_size ; { { fpm_size = 0ULL; fpm_size = (u64 )(txq_num * 128U); fpm_size = i40e_align_l2obj_base(fpm_size); fpm_size = fpm_size + (u64 )(rxq_num * 32U); fpm_size = i40e_align_l2obj_base(fpm_size); fpm_size = fpm_size + (u64 )(fcoe_cntx_num * 64U); fpm_size = i40e_align_l2obj_base(fpm_size); fpm_size = fpm_size + (u64 )(fcoe_filt_num * 64U); fpm_size = i40e_align_l2obj_base(fpm_size); } return (fpm_size); } } i40e_status i40e_init_lan_hmc(struct i40e_hw *hw , u32 txq_num , u32 rxq_num , u32 fcoe_cntx_num , u32 fcoe_filt_num ) { struct i40e_hmc_obj_info *obj ; struct i40e_hmc_obj_info *full_obj ; i40e_status ret_code ; u64 l2fpm_size ; u32 size_exp ; { { ret_code = 0; hw->hmc.signature = 1213027143U; hw->hmc.hmc_fn_id = hw->pf_id; ret_code = i40e_allocate_virt_mem_d(hw, & hw->hmc.hmc_obj_virt_mem, 120U); } if ((int )ret_code != 0) { goto init_lan_hmc_out; } else { } { hw->hmc.hmc_obj = (struct i40e_hmc_obj_info *)hw->hmc.hmc_obj_virt_mem.va; full_obj = hw->hmc.hmc_obj; full_obj->max_cnt = 0U; full_obj->cnt = 0U; full_obj->base = 0ULL; full_obj->size = 0ULL; obj = hw->hmc.hmc_obj + 1UL; obj->max_cnt = readl((void const volatile *)hw->hw_addr + 794632U); obj->cnt = txq_num; obj->base = 0ULL; size_exp = readl((void const volatile *)hw->hw_addr + 794628U); obj->size = 1ULL << (int )size_exp; } if (txq_num > obj->max_cnt) { ret_code = -50; goto init_lan_hmc_out; } else { } { full_obj->max_cnt = full_obj->max_cnt + obj->max_cnt; full_obj->cnt = full_obj->cnt + obj->cnt; obj = hw->hmc.hmc_obj + 2UL; obj->max_cnt = readl((void const volatile *)hw->hw_addr + 794632U); obj->cnt = rxq_num; obj->base = (hw->hmc.hmc_obj + 1UL)->base + (u64 )(hw->hmc.hmc_obj + 1UL)->cnt * (hw->hmc.hmc_obj + 1UL)->size; obj->base = i40e_align_l2obj_base(obj->base); size_exp = readl((void const volatile *)hw->hw_addr + 794636U); obj->size = 1ULL << (int )size_exp; } if (rxq_num > obj->max_cnt) { ret_code = -50; goto init_lan_hmc_out; } else { } { full_obj->max_cnt = full_obj->max_cnt + obj->max_cnt; full_obj->cnt = full_obj->cnt + obj->cnt; obj = hw->hmc.hmc_obj + 3UL; obj->max_cnt = readl((void const volatile *)hw->hw_addr + 794644U); obj->cnt = fcoe_cntx_num; obj->base = (hw->hmc.hmc_obj + 2UL)->base + (u64 )(hw->hmc.hmc_obj + 2UL)->cnt * (hw->hmc.hmc_obj + 2UL)->size; obj->base = i40e_align_l2obj_base(obj->base); size_exp = readl((void const volatile *)hw->hw_addr + 794640U); obj->size = 1ULL << (int )size_exp; } if (fcoe_cntx_num > obj->max_cnt) { ret_code = -50; goto init_lan_hmc_out; } else { } { full_obj->max_cnt = full_obj->max_cnt + obj->max_cnt; full_obj->cnt = full_obj->cnt + obj->cnt; obj = hw->hmc.hmc_obj + 4UL; obj->max_cnt = readl((void const volatile *)hw->hw_addr + 794832U); obj->cnt = fcoe_filt_num; obj->base = (hw->hmc.hmc_obj + 3UL)->base + (u64 )(hw->hmc.hmc_obj + 3UL)->cnt * (hw->hmc.hmc_obj + 3UL)->size; obj->base = i40e_align_l2obj_base(obj->base); size_exp = readl((void const volatile *)hw->hw_addr + 794648U); obj->size = 1ULL << (int )size_exp; } if (fcoe_filt_num > obj->max_cnt) { ret_code = -50; goto init_lan_hmc_out; } else { } { full_obj->max_cnt = full_obj->max_cnt + obj->max_cnt; full_obj->cnt = full_obj->cnt + obj->cnt; hw->hmc.first_sd_index = 0U; hw->hmc.sd_table.ref_cnt = 0U; l2fpm_size = i40e_calculate_l2fpm_size(txq_num, rxq_num, fcoe_cntx_num, fcoe_filt_num); } if ((unsigned long )hw->hmc.sd_table.sd_entry == (unsigned long )((struct i40e_hmc_sd_entry *)0)) { { hw->hmc.sd_table.sd_cnt = ((unsigned int )l2fpm_size + 2097151U) / 2097152U; ret_code = i40e_allocate_virt_mem_d(hw, & hw->hmc.sd_table.addr, hw->hmc.sd_table.sd_cnt * 64U); } if ((int )ret_code != 0) { goto init_lan_hmc_out; } else { } hw->hmc.sd_table.sd_entry = (struct i40e_hmc_sd_entry *)hw->hmc.sd_table.addr.va; } else { } full_obj->size = l2fpm_size; init_lan_hmc_out: ; return (ret_code); } } static i40e_status i40e_remove_pd_page(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 idx ) { i40e_status ret_code ; i40e_status tmp ; { { ret_code = 0; tmp = i40e_prep_remove_pd_page(hmc_info, idx); } if ((int )tmp == 0) { { ret_code = i40e_remove_pd_page_new(hw, hmc_info, idx, 1); } } else { } return (ret_code); } } static i40e_status i40e_remove_sd_bp(struct i40e_hw *hw , struct i40e_hmc_info *hmc_info , u32 idx ) { i40e_status ret_code ; i40e_status tmp ; { { ret_code = 0; tmp = i40e_prep_remove_sd_bp(hmc_info, idx); } if ((int )tmp == 0) { { ret_code = i40e_remove_sd_bp_new(hw, hmc_info, idx, 1); } } else { } return (ret_code); } } static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw , struct i40e_hmc_lan_create_obj_info *info ) { i40e_status ret_code ; struct i40e_hmc_sd_entry *sd_entry ; u32 pd_idx1 ; u32 pd_lmt1 ; u32 pd_idx ; u32 pd_lmt ; bool pd_error ; u32 sd_idx ; u32 sd_lmt ; u64 sd_size ; u32 i ; u32 j ; u64 fpm_addr ; u64 fpm_limit ; u64 fpm_adr ; u64 fpm_limit___0 ; u32 _max1 ; u32 _max2 ; u32 _min1 ; u32 _min2 ; u32 val1 ; u32 val2 ; u32 val3 ; u32 val1___0 ; u32 val2___0 ; u32 val3___0 ; u32 _max1___0 ; u32 _max2___0 ; u32 _min1___0 ; u32 _min2___0 ; { ret_code = 0; pd_idx1 = 0U; pd_lmt1 = 0U; pd_idx = 0U; pd_lmt = 0U; pd_error = 0; if ((unsigned long )info == (unsigned long )((struct i40e_hmc_lan_create_obj_info *)0)) { ret_code = -19; goto exit; } else { } if ((unsigned long )info->hmc_info == (unsigned long )((struct i40e_hmc_info *)0)) { ret_code = -19; goto exit; } else { } if ((info->hmc_info)->signature != 1213027143U) { ret_code = -19; goto exit; } else { } if (info->start_idx >= ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->cnt) { ret_code = -49; goto exit; } else { } if (info->start_idx + info->count > ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->cnt) { ret_code = -50; goto exit; } else { } fpm_addr = ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->base + ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->size * (u64 )info->start_idx; fpm_limit = fpm_addr + ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->size * (u64 )info->count; sd_idx = (unsigned int )(fpm_addr / 2097152ULL); sd_lmt = (unsigned int )((fpm_limit - 1ULL) / 2097152ULL); sd_lmt = sd_lmt + 1U; if (sd_idx >= (info->hmc_info)->sd_table.sd_cnt || sd_lmt > (info->hmc_info)->sd_table.sd_cnt) { ret_code = -45; goto exit; } else { } fpm_adr = ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->base + ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->size * (u64 )info->start_idx; fpm_limit___0 = fpm_adr + ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->size * (u64 )info->count; pd_idx = (unsigned int )(fpm_adr / 4096ULL); pd_lmt = (unsigned int )((fpm_limit___0 - 1ULL) / 4096ULL); pd_lmt = pd_lmt + 1U; if (info->direct_mode_sz == 0ULL) { sd_size = 2097152ULL; } else { sd_size = info->direct_mode_sz; } j = sd_idx; goto ldv_49352; ldv_49351: { ret_code = i40e_add_sd_table_entry(hw, info->hmc_info, j, info->entry_type, sd_size); } if ((int )ret_code != 0) { goto exit_sd_error; } else { } sd_entry = (info->hmc_info)->sd_table.sd_entry + (unsigned long )j; if ((unsigned int )sd_entry->entry_type == 1U) { _max1 = pd_idx; _max2 = j * 512U; pd_idx1 = _max1 > _max2 ? _max1 : _max2; _min1 = pd_lmt; _min2 = (j + 1U) * 512U; pd_lmt1 = _min1 < _min2 ? _min1 : _min2; i = pd_idx1; goto ldv_49337; ldv_49336: { ret_code = i40e_add_pd_table_entry(hw, info->hmc_info, i); } if ((int )ret_code != 0) { pd_error = 1; goto ldv_49335; } else { } i = i + 1U; ldv_49337: ; if (i < pd_lmt1) { goto ldv_49336; } else { } ldv_49335: ; if ((int )pd_error) { goto ldv_49339; ldv_49338: { i40e_remove_pd_bp(hw, info->hmc_info, i - 1U, 1); i = i - 1U; } ldv_49339: ; if (i != 0U && i > pd_idx1) { goto ldv_49338; } else { } } else { } } else { } if (! sd_entry->valid) { sd_entry->valid = 1; { if ((unsigned int )sd_entry->entry_type == 1U) { goto case_1; } else { } if ((unsigned int )sd_entry->entry_type == 2U) { goto case_2; } else { } goto switch_default; case_1: /* CIL Label */ { val1 = (unsigned int )(sd_entry->u.pd_table.pd_page_addr.pa >> 32ULL); val2 = ((unsigned int )sd_entry->u.pd_table.pd_page_addr.pa | ((unsigned int )sd_entry->entry_type != 1U ? 2U : 0U)) | 2049U; val3 = j | 2147483648U; writel(val1, (void volatile *)hw->hw_addr + 786944U); writel(val2, (void volatile *)hw->hw_addr + 786688U); writel(val3, (void volatile *)hw->hw_addr + 786432U); } goto ldv_49345; case_2: /* CIL Label */ { val1___0 = (unsigned int )(sd_entry->u.bp.addr.pa >> 32ULL); val2___0 = ((unsigned int )sd_entry->u.bp.addr.pa | ((unsigned int )sd_entry->entry_type != 1U ? 2U : 0U)) | 2049U; val3___0 = j | 2147483648U; writel(val1___0, (void volatile *)hw->hw_addr + 786944U); writel(val2___0, (void volatile *)hw->hw_addr + 786688U); writel(val3___0, (void volatile *)hw->hw_addr + 786432U); } goto ldv_49345; switch_default: /* CIL Label */ ret_code = -47; goto exit; switch_break: /* CIL Label */ ; } ldv_49345: ; } else { } j = j + 1U; ldv_49352: ; if (j < sd_lmt) { goto ldv_49351; } else { } goto exit; exit_sd_error: ; goto ldv_49368; ldv_49367: sd_entry = (info->hmc_info)->sd_table.sd_entry + (unsigned long )(j - 1U); { if ((unsigned int )sd_entry->entry_type == 1U) { goto case_1___0; } else { } if ((unsigned int )sd_entry->entry_type == 2U) { goto case_2___0; } else { } goto switch_default___0; case_1___0: /* CIL Label */ _max1___0 = pd_idx; _max2___0 = (j + 8388607U) * 512U; pd_idx1 = _max1___0 > _max2___0 ? _max1___0 : _max2___0; _min1___0 = pd_lmt; _min2___0 = j * 512U; pd_lmt1 = _min1___0 < _min2___0 ? _min1___0 : _min2___0; i = pd_idx1; goto ldv_49362; ldv_49361: { i40e_remove_pd_bp(hw, info->hmc_info, i, 1); i = i + 1U; } ldv_49362: ; if (i < pd_lmt1) { goto ldv_49361; } else { } { i40e_remove_pd_page(hw, info->hmc_info, j - 1U); } goto ldv_49364; case_2___0: /* CIL Label */ { i40e_remove_sd_bp(hw, info->hmc_info, j - 1U); } goto ldv_49364; switch_default___0: /* CIL Label */ ret_code = -47; goto ldv_49364; switch_break___0: /* CIL Label */ ; } ldv_49364: j = j - 1U; ldv_49368: ; if (j != 0U && j > sd_idx) { goto ldv_49367; } else { } exit: ; return (ret_code); } } i40e_status i40e_configure_lan_hmc(struct i40e_hw *hw , enum i40e_hmc_model model ) { struct i40e_hmc_lan_create_obj_info info ; i40e_status ret_code ; u8 hmc_fn_id ; struct i40e_hmc_obj_info *obj ; { ret_code = 0; hmc_fn_id = hw->hmc.hmc_fn_id; info.hmc_info = & hw->hmc; info.rsrc_type = 0U; info.start_idx = 0U; info.direct_mode_sz = (hw->hmc.hmc_obj)->size; { if ((unsigned int )model == 0U) { goto case_0; } else { } if ((unsigned int )model == 1U) { goto case_1; } else { } if ((unsigned int )model == 2U) { goto case_2; } else { } goto switch_default; case_0: /* CIL Label */ ; case_1: /* CIL Label */ { info.entry_type = 2; info.count = 1U; ret_code = i40e_create_lan_hmc_object(hw, & info); } if ((int )ret_code != 0 && (unsigned int )model == 0U) { goto try_type_paged; } else if ((int )ret_code != 0) { goto configure_lan_hmc_out; } else { } goto ldv_49382; case_2: /* CIL Label */ ; try_type_paged: { info.entry_type = 1; info.count = 1U; ret_code = i40e_create_lan_hmc_object(hw, & info); } if ((int )ret_code != 0) { goto configure_lan_hmc_out; } else { } goto ldv_49382; switch_default: /* CIL Label */ ret_code = -47; goto configure_lan_hmc_out; switch_break: /* CIL Label */ ; } ldv_49382: { obj = hw->hmc.hmc_obj + 1UL; writel((unsigned int )((obj->base & 16777215ULL) / 512ULL), (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_fn_id + 202880) * 4)); writel(obj->cnt, (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_fn_id + 202944) * 4)); obj = hw->hmc.hmc_obj + 2UL; writel((unsigned int )((obj->base & 16777215ULL) / 512ULL), (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_fn_id + 203008) * 4)); writel(obj->cnt, (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_fn_id + 203072) * 4)); obj = hw->hmc.hmc_obj + 3UL; writel((unsigned int )((obj->base & 16777215ULL) / 512ULL), (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_fn_id + 203136) * 4)); writel(obj->cnt, (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_fn_id + 203200) * 4)); obj = hw->hmc.hmc_obj + 4UL; writel((unsigned int )((obj->base & 16777215ULL) / 512ULL), (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_fn_id + 203264) * 4)); writel(obj->cnt, (void volatile *)hw->hw_addr + (unsigned long )(((int )hmc_fn_id + 203328) * 4)); } configure_lan_hmc_out: ; return (ret_code); } } static i40e_status i40e_delete_lan_hmc_object(struct i40e_hw *hw , struct i40e_hmc_lan_delete_obj_info *info ) { i40e_status ret_code ; struct i40e_hmc_pd_table *pd_table ; u32 pd_idx ; u32 pd_lmt ; u32 rel_pd_idx ; u32 sd_idx ; u32 sd_lmt ; u32 i ; u32 j ; u64 fpm_adr ; u64 fpm_limit ; u64 fpm_addr ; u64 fpm_limit___0 ; { ret_code = 0; if ((unsigned long )info == (unsigned long )((struct i40e_hmc_lan_delete_obj_info *)0)) { ret_code = -19; goto exit; } else { } if ((unsigned long )info->hmc_info == (unsigned long )((struct i40e_hmc_info *)0)) { ret_code = -19; goto exit; } else { } if ((info->hmc_info)->signature != 1213027143U) { ret_code = -19; goto exit; } else { } if ((unsigned long )(info->hmc_info)->sd_table.sd_entry == (unsigned long )((struct i40e_hmc_sd_entry *)0)) { ret_code = -19; goto exit; } else { } if ((unsigned long )(info->hmc_info)->hmc_obj == (unsigned long )((struct i40e_hmc_obj_info *)0)) { ret_code = -19; goto exit; } else { } if (info->start_idx >= ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->cnt) { ret_code = -49; goto exit; } else { } if (info->start_idx + info->count > ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->cnt) { ret_code = -50; goto exit; } else { } fpm_adr = ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->base + ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->size * (u64 )info->start_idx; fpm_limit = fpm_adr + ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->size * (u64 )info->count; pd_idx = (unsigned int )(fpm_adr / 4096ULL); pd_lmt = (unsigned int )((fpm_limit - 1ULL) / 4096ULL); pd_lmt = pd_lmt + 1U; j = pd_idx; goto ldv_49403; ldv_49402: sd_idx = j / 512U; if ((unsigned int )((info->hmc_info)->sd_table.sd_entry + (unsigned long )sd_idx)->entry_type != 1U) { goto ldv_49401; } else { } rel_pd_idx = j & 511U; pd_table = & ((info->hmc_info)->sd_table.sd_entry + (unsigned long )sd_idx)->u.pd_table; if ((int )(pd_table->pd_entry + (unsigned long )rel_pd_idx)->valid) { { ret_code = i40e_remove_pd_bp(hw, info->hmc_info, j, 1); } if ((int )ret_code != 0) { goto exit; } else { } } else { } ldv_49401: j = j + 1U; ldv_49403: ; if (j < pd_lmt) { goto ldv_49402; } else { } fpm_addr = ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->base + ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->size * (u64 )info->start_idx; fpm_limit___0 = fpm_addr + ((info->hmc_info)->hmc_obj + (unsigned long )info->rsrc_type)->size * (u64 )info->count; sd_idx = (unsigned int )(fpm_addr / 2097152ULL); sd_lmt = (unsigned int )((fpm_limit___0 - 1ULL) / 2097152ULL); sd_lmt = sd_lmt + 1U; if (sd_idx >= (info->hmc_info)->sd_table.sd_cnt || sd_lmt > (info->hmc_info)->sd_table.sd_cnt) { ret_code = -45; goto exit; } else { } i = sd_idx; goto ldv_49413; ldv_49412: ; if (! ((info->hmc_info)->sd_table.sd_entry + (unsigned long )i)->valid) { goto ldv_49407; } else { } { if ((unsigned int )((info->hmc_info)->sd_table.sd_entry + (unsigned long )i)->entry_type == 2U) { goto case_2; } else { } if ((unsigned int )((info->hmc_info)->sd_table.sd_entry + (unsigned long )i)->entry_type == 1U) { goto case_1; } else { } goto switch_default; case_2: /* CIL Label */ { ret_code = i40e_remove_sd_bp(hw, info->hmc_info, i); } if ((int )ret_code != 0) { goto exit; } else { } goto ldv_49409; case_1: /* CIL Label */ { ret_code = i40e_remove_pd_page(hw, info->hmc_info, i); } if ((int )ret_code != 0) { goto exit; } else { } goto ldv_49409; switch_default: /* CIL Label */ ; goto ldv_49409; switch_break: /* CIL Label */ ; } ldv_49409: ; ldv_49407: i = i + 1U; ldv_49413: ; if (i < sd_lmt) { goto ldv_49412; } else { } exit: ; return (ret_code); } } i40e_status i40e_shutdown_lan_hmc(struct i40e_hw *hw ) { struct i40e_hmc_lan_delete_obj_info info ; i40e_status ret_code ; { { info.hmc_info = & hw->hmc; info.rsrc_type = 0U; info.start_idx = 0U; info.count = 1U; ret_code = i40e_delete_lan_hmc_object(hw, & info); i40e_free_virt_mem_d(hw, & hw->hmc.sd_table.addr); hw->hmc.sd_table.sd_cnt = 0U; hw->hmc.sd_table.sd_entry = (struct i40e_hmc_sd_entry *)0; i40e_free_virt_mem_d(hw, & hw->hmc.hmc_obj_virt_mem); hw->hmc.hmc_obj = (struct i40e_hmc_obj_info *)0; } return (ret_code); } } static struct i40e_context_ele i40e_hmc_txq_ce_info[19U] = { {0U, 2U, 13U, 0U}, {2U, 1U, 1U, 30U}, {8U, 8U, 57U, 32U}, {16U, 1U, 1U, 89U}, {17U, 1U, 1U, 90U}, {18U, 1U, 1U, 91U}, {19U, 1U, 1U, 92U}, {22U, 2U, 8U, 96U}, {20U, 2U, 13U, 128U}, {24U, 1U, 1U, 160U}, {26U, 2U, 13U, 161U}, {28U, 1U, 1U, 174U}, {29U, 1U, 1U, 175U}, {30U, 1U, 1U, 176U}, {32U, 8U, 64U, 192U}, {40U, 4U, 32U, 896U}, {44U, 2U, 10U, 980U}, {46U, 1U, 1U, 990U}, {0U, (unsigned short)0, (unsigned short)0, (unsigned short)0}}; static struct i40e_context_ele i40e_hmc_rxq_ce_info[21U] = { {0U, 2U, 13U, 0U}, {2U, 1U, 8U, 13U}, {8U, 8U, 57U, 32U}, {16U, 2U, 13U, 89U}, {18U, 1U, 7U, 102U}, {19U, 1U, 5U, 109U}, {20U, 1U, 2U, 114U}, {21U, 1U, 1U, 116U}, {22U, 1U, 1U, 117U}, {23U, 1U, 1U, 118U}, {24U, 1U, 1U, 119U}, {25U, 1U, 4U, 120U}, {26U, 1U, 2U, 124U}, {27U, 1U, 1U, 127U}, {28U, 2U, 14U, 174U}, {30U, 1U, 1U, 193U}, {31U, 1U, 1U, 194U}, {32U, 1U, 1U, 195U}, {33U, 1U, 1U, 196U}, {34U, 1U, 3U, 198U}, {0U, (unsigned short)0, (unsigned short)0, (unsigned short)0}}; static i40e_status i40e_clear_hmc_context(struct i40e_hw *hw , u8 *context_bytes , enum i40e_hmc_lan_rsrc_type hmc_type ) { { { memset((void *)context_bytes, 0, (size_t )((unsigned int )(hw->hmc.hmc_obj + (unsigned long )hmc_type)->size)); } return (0); } } static i40e_status i40e_set_hmc_context(u8 *context_bytes , struct i40e_context_ele *ce_info , u8 *dest ) { u16 shift_width ; u64 bitfield ; u8 hi_byte ; u8 hi_mask ; u64 t_bits ; u64 mask ; u8 *p ; int f ; u8 byte ; { f = 0; goto ldv_49452; ldv_49451: bitfield = 0ULL; p = dest + (unsigned long )(ce_info + (unsigned long )f)->offset; { if ((int )(ce_info + (unsigned long )f)->size_of == 1) { goto case_1; } else { } if ((int )(ce_info + (unsigned long )f)->size_of == 2) { goto case_2; } else { } if ((int )(ce_info + (unsigned long )f)->size_of == 4) { goto case_4; } else { } if ((int )(ce_info + (unsigned long )f)->size_of == 8) { goto case_8; } else { } goto switch_break; case_1: /* CIL Label */ bitfield = (u64 )*p; goto ldv_49446; case_2: /* CIL Label */ bitfield = (u64 )*((u16 *)p); goto ldv_49446; case_4: /* CIL Label */ bitfield = (u64 )*((u32 *)p); goto ldv_49446; case_8: /* CIL Label */ bitfield = *((u64 *)p); goto ldv_49446; switch_break: /* CIL Label */ ; } ldv_49446: { shift_width = (unsigned int )(ce_info + (unsigned long )f)->lsb & 7U; mask = (1ULL << (int )(ce_info + (unsigned long )f)->width) - 1ULL; hi_mask = (unsigned char )(mask >> 56); hi_byte = (unsigned char )(bitfield >> 56); mask = mask << (int )shift_width; bitfield = bitfield << (int )shift_width; p = context_bytes + (unsigned long )((unsigned int )(ce_info + (unsigned long )f)->lsb / 8U); memcpy((void *)(& t_bits), (void const *)p, 8UL); t_bits = t_bits & ~ mask; t_bits = t_bits | bitfield; memcpy((void *)p, (void const *)(& t_bits), 8UL); } if ((int )shift_width + (int )(ce_info + (unsigned long )f)->width > 64) { hi_mask = (u8 )((int )hi_mask >> (8 - (int )shift_width)); hi_byte = (u8 )((int )hi_byte >> (8 - (int )shift_width)); byte = (u8 )((int )((signed char )*(p + 8UL)) & ~ ((int )((signed char )hi_mask))); byte = (u8 )((int )byte | (int )hi_byte); *(p + 8UL) = byte; } else { } f = f + 1; ldv_49452: ; if ((unsigned int )(ce_info + (unsigned long )f)->width != 0U) { goto ldv_49451; } else { } return (0); } } static i40e_status i40e_hmc_get_object_va(struct i40e_hmc_info *hmc_info , u8 **object_base , enum i40e_hmc_lan_rsrc_type rsrc_type , u32 obj_idx ) { u32 obj_offset_in_sd ; u32 obj_offset_in_pd ; i40e_status ret_code ; struct i40e_hmc_sd_entry *sd_entry ; struct i40e_hmc_pd_entry *pd_entry ; u32 pd_idx ; u32 pd_lmt ; u32 rel_pd_idx ; u64 obj_offset_in_fpm ; u32 sd_idx ; u32 sd_lmt ; u64 fpm_addr ; u64 fpm_limit ; u64 fpm_adr ; u64 fpm_limit___0 ; { ret_code = 0; if ((unsigned long )hmc_info == (unsigned long )((struct i40e_hmc_info *)0)) { ret_code = -19; goto exit; } else { } if ((unsigned long )hmc_info->hmc_obj == (unsigned long )((struct i40e_hmc_obj_info *)0)) { ret_code = -19; goto exit; } else { } if ((unsigned long )object_base == (unsigned long )((u8 **)0U)) { ret_code = -19; goto exit; } else { } if (hmc_info->signature != 1213027143U) { ret_code = -19; goto exit; } else { } if (obj_idx >= (hmc_info->hmc_obj + (unsigned long )rsrc_type)->cnt) { ret_code = -49; goto exit; } else { } fpm_addr = (hmc_info->hmc_obj + (unsigned long )rsrc_type)->base + (hmc_info->hmc_obj + (unsigned long )rsrc_type)->size * (u64 )obj_idx; fpm_limit = fpm_addr + (hmc_info->hmc_obj + (unsigned long )rsrc_type)->size; sd_idx = (unsigned int )(fpm_addr / 2097152ULL); sd_lmt = (unsigned int )((fpm_limit - 1ULL) / 2097152ULL); sd_lmt = sd_lmt + 1U; sd_entry = hmc_info->sd_table.sd_entry + (unsigned long )sd_idx; obj_offset_in_fpm = (hmc_info->hmc_obj + (unsigned long )rsrc_type)->base + (hmc_info->hmc_obj + (unsigned long )rsrc_type)->size * (u64 )obj_idx; if ((unsigned int )sd_entry->entry_type == 1U) { fpm_adr = (hmc_info->hmc_obj + (unsigned long )rsrc_type)->base + (hmc_info->hmc_obj + (unsigned long )rsrc_type)->size * (u64 )obj_idx; fpm_limit___0 = fpm_adr + (hmc_info->hmc_obj + (unsigned long )rsrc_type)->size; pd_idx = (unsigned int )(fpm_adr / 4096ULL); pd_lmt = (unsigned int )((fpm_limit___0 - 1ULL) / 4096ULL); pd_lmt = pd_lmt + 1U; rel_pd_idx = pd_idx & 511U; pd_entry = sd_entry->u.pd_table.pd_entry + (unsigned long )rel_pd_idx; obj_offset_in_pd = (unsigned int )obj_offset_in_fpm & 4095U; *object_base = (u8 *)pd_entry->bp.addr.va + (unsigned long )obj_offset_in_pd; } else { obj_offset_in_sd = (unsigned int )obj_offset_in_fpm & 2097151U; *object_base = (u8 *)sd_entry->u.bp.addr.va + (unsigned long )obj_offset_in_sd; } exit: ; return (ret_code); } } i40e_status i40e_clear_lan_tx_queue_context(struct i40e_hw *hw , u16 queue ) { i40e_status err ; u8 *context_bytes ; i40e_status tmp ; { { err = i40e_hmc_get_object_va(& hw->hmc, & context_bytes, 1, (u32 )queue); } if ((int )err < 0) { return (err); } else { } { tmp = i40e_clear_hmc_context(hw, context_bytes, 1); } return (tmp); } } i40e_status i40e_set_lan_tx_queue_context(struct i40e_hw *hw , u16 queue , struct i40e_hmc_obj_txq *s ) { i40e_status err ; u8 *context_bytes ; i40e_status tmp ; { { err = i40e_hmc_get_object_va(& hw->hmc, & context_bytes, 1, (u32 )queue); } if ((int )err < 0) { return (err); } else { } { tmp = i40e_set_hmc_context(context_bytes, (struct i40e_context_ele *)(& i40e_hmc_txq_ce_info), (u8 *)s); } return (tmp); } } i40e_status i40e_clear_lan_rx_queue_context(struct i40e_hw *hw , u16 queue ) { i40e_status err ; u8 *context_bytes ; i40e_status tmp ; { { err = i40e_hmc_get_object_va(& hw->hmc, & context_bytes, 2, (u32 )queue); } if ((int )err < 0) { return (err); } else { } { tmp = i40e_clear_hmc_context(hw, context_bytes, 2); } return (tmp); } } i40e_status i40e_set_lan_rx_queue_context(struct i40e_hw *hw , u16 queue , struct i40e_hmc_obj_rxq *s ) { i40e_status err ; u8 *context_bytes ; i40e_status tmp ; { { err = i40e_hmc_get_object_va(& hw->hmc, & context_bytes, 2, (u32 )queue); } if ((int )err < 0) { return (err); } else { } { tmp = i40e_set_hmc_context(context_bytes, (struct i40e_context_ele *)(& i40e_hmc_rxq_ce_info), (u8 *)s); } return (tmp); } } i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw , u16 offset , u16 *words , u16 *data ) ; i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw , u16 *checksum ) ; i40e_status i40e_init_nvm(struct i40e_hw *hw ) { struct i40e_nvm_info *nvm ; i40e_status ret_code ; u32 fla ; u32 gens ; u8 sr_size ; { { nvm = & hw->nvm; ret_code = 0; gens = readl((void const volatile *)hw->hw_addr + 745728U); sr_size = (u8 )((gens & 224U) >> 5); nvm->sr_size = (u16 )(512 << (int )sr_size); fla = readl((void const volatile *)hw->hw_addr + 745736U); } if ((fla & 64U) != 0U) { nvm->timeout = 18000U; nvm->blank_nvm_mode = 0; } else { nvm->blank_nvm_mode = 1; ret_code = -59; } return (ret_code); } } i40e_status i40e_acquire_nvm(struct i40e_hw *hw , enum i40e_aq_resource_access_type access ) { i40e_status ret_code ; u64 gtime ; u64 timeout ; u64 time ; unsigned int tmp ; unsigned int tmp___0 ; { ret_code = 0; time = 0ULL; if ((int )hw->nvm.blank_nvm_mode) { goto i40e_i40e_acquire_nvm_exit; } else { } { ret_code = i40e_aq_request_resource(hw, 1, access, 0, & time, (struct i40e_asq_cmd_details *)0); tmp = readl((void const volatile *)hw->hw_addr + 557500U); gtime = (u64 )tmp; hw->nvm.hw_semaphore_timeout = (time * 1000ULL) / 2ULL + gtime; } if ((int )ret_code != 0) { if (time > 18000ULL) { timeout = gtime + 9000000ULL; } else { timeout = hw->nvm.hw_semaphore_timeout; } goto ldv_49290; ldv_49289: { usleep_range(10000UL, 20000UL); ret_code = i40e_aq_request_resource(hw, 1, access, 0, & time, (struct i40e_asq_cmd_details *)0); } if ((int )ret_code == 0) { hw->nvm.hw_semaphore_timeout = (time * 1000ULL) / 2ULL + gtime; goto ldv_49288; } else { } { tmp___0 = readl((void const volatile *)hw->hw_addr + 557500U); gtime = (u64 )tmp___0; } ldv_49290: ; if (gtime < timeout) { goto ldv_49289; } else { } ldv_49288: ; if ((int )ret_code != 0) { hw->nvm.hw_semaphore_timeout = 0ULL; hw->nvm.hw_semaphore_wait = (time * 1000ULL) / 2ULL + gtime; } else { } } else { } i40e_i40e_acquire_nvm_exit: ; return (ret_code); } } void i40e_release_nvm(struct i40e_hw *hw ) { { if (! hw->nvm.blank_nvm_mode) { { i40e_aq_release_resource(hw, 1, 0, (struct i40e_asq_cmd_details *)0); } } else { } return; } } static i40e_status i40e_poll_sr_srctl_done_bit(struct i40e_hw *hw ) { i40e_status ret_code ; u32 srctl ; u32 wait_cnt ; { ret_code = -37; wait_cnt = 0U; goto ldv_49302; ldv_49301: { srctl = readl((void const volatile *)hw->hw_addr + 745744U); } if ((int )srctl < 0) { ret_code = 0; goto ldv_49300; } else { } { __const_udelay(21475UL); wait_cnt = wait_cnt + 1U; } ldv_49302: ; if (wait_cnt <= 99999U) { goto ldv_49301; } else { } ldv_49300: ; return (ret_code); } } i40e_status i40e_read_nvm_word(struct i40e_hw *hw , u16 offset , u16 *data ) { i40e_status ret_code ; u32 sr_reg ; { ret_code = -37; if ((int )offset >= (int )hw->nvm.sr_size) { ret_code = -5; goto read_nvm_exit; } else { } { ret_code = i40e_poll_sr_srctl_done_bit(hw); } if ((int )ret_code == 0) { { sr_reg = (unsigned int )((int )offset << 14) | 1073741824U; writel(sr_reg, (void volatile *)hw->hw_addr + 745744U); ret_code = i40e_poll_sr_srctl_done_bit(hw); } if ((int )ret_code == 0) { { sr_reg = readl((void const volatile *)hw->hw_addr + 745748U); *data = (unsigned short )(sr_reg >> 16); } } else { } } else { } read_nvm_exit: ; return (ret_code); } } i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw , u16 offset , u16 *words , u16 *data ) { i40e_status ret_code ; u16 index ; u16 word ; { ret_code = 0; word = 0U; goto ldv_49322; ldv_49321: { index = (int )offset + (int )word; ret_code = i40e_read_nvm_word(hw, (int )index, data + (unsigned long )word); } if ((int )ret_code != 0) { goto ldv_49320; } else { } word = (u16 )((int )word + 1); ldv_49322: ; if ((int )word < (int )*words) { goto ldv_49321; } else { } ldv_49320: *words = word; return (ret_code); } } static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw , u16 *checksum ) { i40e_status ret_code ; u16 pcie_alt_module ; u16 checksum_local ; u16 vpd_module ; u16 word ; u32 i ; { { ret_code = 0; pcie_alt_module = 0U; checksum_local = 0U; vpd_module = 0U; word = 0U; i = 0U; ret_code = i40e_read_nvm_word(hw, 47, & vpd_module); } if ((int )ret_code != 0) { ret_code = -2; goto i40e_calc_nvm_checksum_exit; } else { } { ret_code = i40e_read_nvm_word(hw, 62, & pcie_alt_module); } if ((int )ret_code != 0) { ret_code = -2; goto i40e_calc_nvm_checksum_exit; } else { } i = 0U; goto ldv_49336; ldv_49335: ; if (i == 63U) { i = i + 1U; } else { } if (i == (u32 )vpd_module) { i = i + 512U; if (i >= (u32 )hw->nvm.sr_size) { goto ldv_49334; } else { } } else { } if (i == (u32 )pcie_alt_module) { i = i + 512U; if (i >= (u32 )hw->nvm.sr_size) { goto ldv_49334; } else { } } else { } { ret_code = i40e_read_nvm_word(hw, (int )((unsigned short )i), & word); } if ((int )ret_code != 0) { ret_code = -2; goto i40e_calc_nvm_checksum_exit; } else { } checksum_local = (int )checksum_local + (int )word; i = i + 1U; ldv_49336: ; if (i < (u32 )hw->nvm.sr_size) { goto ldv_49335; } else { } ldv_49334: *checksum = 47802U - (unsigned int )checksum_local; i40e_calc_nvm_checksum_exit: ; return (ret_code); } } i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw , u16 *checksum ) { i40e_status ret_code ; u16 checksum_sr ; u16 checksum_local ; { { ret_code = 0; checksum_sr = 0U; checksum_local = 0U; ret_code = i40e_acquire_nvm(hw, 1); } if ((int )ret_code != 0) { goto i40e_validate_nvm_checksum_exit; } else { } { ret_code = i40e_calc_nvm_checksum(hw, & checksum_local); } if ((int )ret_code != 0) { goto i40e_validate_nvm_checksum_free; } else { } { i40e_read_nvm_word(hw, 63, & checksum_sr); } if ((int )checksum_local != (int )checksum_sr) { ret_code = -2; } else { } if ((unsigned long )checksum != (unsigned long )((u16 *)0U)) { *checksum = checksum_local; } else { } i40e_validate_nvm_checksum_free: { i40e_release_nvm(hw); } i40e_validate_nvm_checksum_exit: ; return (ret_code); } } extern void print_hex_dump(char const * , char const * , int , int , int , void const * , size_t , bool ) ; extern void might_fault(void) ; extern int kstrtol_from_user(char const * , size_t , unsigned int , long * ) ; extern int sscanf(char const * , char const * , ...) ; extern int strncmp(char const * , char const * , __kernel_size_t ) ; extern char *strchr(char const * , int ) ; extern int simple_open(struct inode * , struct file * ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; 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 ; long tmp ; long tmp___0 ; { { sz = -1; might_fault(); tmp = ldv__builtin_expect(sz < 0, 1L); } if (tmp != 0L) { { n = _copy_from_user(to, from, (unsigned int )n); } } else { { tmp___0 = ldv__builtin_expect((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 ; long tmp ; long tmp___0 ; { { sz = -1; might_fault(); tmp = ldv__builtin_expect(sz < 0, 1L); } if (tmp != 0L) { { n = _copy_to_user(to, from, (unsigned int )n); } } else { { tmp___0 = ldv__builtin_expect((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 struct dentry *debugfs_create_file(char const * , umode_t , struct dentry * , void * , struct file_operations const * ) ; extern struct dentry *debugfs_create_dir(char const * , struct dentry * ) ; extern void debugfs_remove_recursive(struct dentry * ) ; extern int rtnl_trylock(void) ; static struct dentry *i40e_dbg_root ; static struct i40e_vsi *i40e_dbg_find_vsi(struct i40e_pf *pf , int seid ) { int i ; { if (seid < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%d: bad seid\n", seid); } } else { i = 0; goto ldv_56893; ldv_56892: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (int )(*(pf->vsi + (unsigned long )i))->seid == seid) { return (*(pf->vsi + (unsigned long )i)); } else { } i = i + 1; ldv_56893: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_56892; } else { } } return ((struct i40e_vsi *)0); } } static struct i40e_veb *i40e_dbg_find_veb(struct i40e_pf *pf , int seid ) { int i ; { if ((unsigned int )seid - 288U > 16U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%d: bad seid\n", seid); } } else { i = 0; goto ldv_56901; ldv_56900: ; if ((unsigned long )pf->veb[i] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[i])->seid == seid) { return (pf->veb[i]); } else { } i = i + 1; ldv_56901: ; if (i <= 15) { goto ldv_56900; } else { } } return ((struct i40e_veb *)0); } } static char *i40e_dbg_dump_buf ; static ssize_t i40e_dbg_dump_data_len ; static ssize_t i40e_dbg_dump_buffer_len ; static ssize_t i40e_dbg_dump_read(struct file *filp , char *buffer , size_t count , loff_t *ppos ) { int bytes_not_copied ; int len ; int __min1 ; int __min2 ; unsigned long tmp ; { if (*ppos >= (long long )i40e_dbg_dump_data_len || (unsigned long )i40e_dbg_dump_buf == (unsigned long )((char *)0)) { return (0L); } else { } { __min1 = (int )count; __min2 = (int )((unsigned int )i40e_dbg_dump_data_len - (unsigned int )*ppos); len = __min1 < __min2 ? __min1 : __min2; tmp = copy_to_user((void *)buffer, (void const *)i40e_dbg_dump_buf + (unsigned long )*ppos, (unsigned long )len); bytes_not_copied = (int )tmp; } if (bytes_not_copied < 0) { return ((ssize_t )bytes_not_copied); } else { } *ppos = *ppos + (loff_t )len; return ((ssize_t )len); } } static int i40e_dbg_prep_dump_buf(struct i40e_pf *pf , int buflen ) { void *tmp ; { if (i40e_dbg_dump_buffer_len != 0L && i40e_dbg_dump_buffer_len < (ssize_t )buflen) { { kfree((void const *)i40e_dbg_dump_buf); i40e_dbg_dump_buffer_len = 0L; i40e_dbg_dump_buf = (char *)0; } } else { } if ((unsigned long )i40e_dbg_dump_buf == (unsigned long )((char *)0)) { { tmp = kzalloc((size_t )buflen, 208U); i40e_dbg_dump_buf = (char *)tmp; } if ((unsigned long )i40e_dbg_dump_buf != (unsigned long )((char *)0)) { i40e_dbg_dump_buffer_len = (ssize_t )buflen; } else { } } else { } return ((int )i40e_dbg_dump_buffer_len); } } static ssize_t i40e_dbg_dump_write(struct file *filp , char const *buffer , size_t count , loff_t *ppos ) { struct i40e_pf *pf ; bool seid_found ; long seid ; int buflen ; int i ; int ret ; int len ; u8 *p ; int tmp ; struct i40e_vsi *vsi ; struct i40e_mac_filter *f ; int filter_count ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; int tmp___0 ; struct i40e_veb *veb ; int tmp___1 ; { pf = (struct i40e_pf *)filp->private_data; seid_found = 0; seid = -1L; buflen = 0; if (*ppos != 0LL) { return (0L); } else { } { ret = kstrtol_from_user(buffer, count, 0U, & seid); } if (ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "bad seid value\n"); } } else if (seid == 0L) { { seid_found = 1; kfree((void const *)i40e_dbg_dump_buf); i40e_dbg_dump_buffer_len = 0L; i40e_dbg_dump_data_len = 0L; i40e_dbg_dump_buf = (char *)0; _dev_info((struct device const *)(& (pf->pdev)->dev), "debug buffer freed\n"); } } else if (seid == (long )pf->pf_seid || seid == 1L) { { seid_found = 1; buflen = 4008; buflen = (int )((unsigned int )buflen + (unsigned int )((unsigned long )((int )pf->hw.aq.num_arq_entries + (int )pf->hw.aq.num_asq_entries)) * 32U); tmp = i40e_dbg_prep_dump_buf(pf, buflen); } if (tmp != 0) { { p = (u8 *)i40e_dbg_dump_buf; len = 4008; memcpy((void *)p, (void const *)pf, (size_t )len); p = p + (unsigned long )len; len = (int )((unsigned int )pf->hw.aq.num_asq_entries * 32U); memcpy((void *)p, (void const *)pf->hw.aq.asq.desc_buf.va, (size_t )len); p = p + (unsigned long )len; len = (int )((unsigned int )pf->hw.aq.num_arq_entries * 32U); memcpy((void *)p, (void const *)pf->hw.aq.arq.desc_buf.va, (size_t )len); p = p + (unsigned long )len; i40e_dbg_dump_data_len = (ssize_t )buflen; _dev_info((struct device const *)(& (pf->pdev)->dev), "PF seid %ld dumped %d bytes\n", seid, (int )i40e_dbg_dump_data_len); } } else { } } else if (seid > 511L) { { vsi = (struct i40e_vsi *)0; filter_count = 0; mutex_lock_nested(& pf->switch_mutex, 0U); vsi = i40e_dbg_find_vsi(pf, (int )seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { mutex_unlock(& pf->switch_mutex); } goto write_exit; } else { } buflen = 4096; buflen = (int )((unsigned int )buflen + (unsigned int )((unsigned long )vsi->num_q_vectors) * 4096U); buflen = (int )((unsigned int )buflen + (unsigned int )vsi->num_queue_pairs * 8192U); buflen = (int )((unsigned int )buflen + (unsigned int )vsi->num_queue_pairs * 48U); buflen = (int )((unsigned int )buflen + (unsigned int )vsi->num_queue_pairs * 40U); __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; goto ldv_56944; ldv_56943: filter_count = filter_count + 1; __mptr___0 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___0; ldv_56944: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_56943; } else { } { buflen = (int )((unsigned int )buflen + (unsigned int )((unsigned long )filter_count) * 32U); tmp___0 = i40e_dbg_prep_dump_buf(pf, buflen); } if (tmp___0 != 0) { { p = (u8 *)i40e_dbg_dump_buf; seid_found = 1; len = 4096; memcpy((void *)p, (void const *)vsi, (size_t )len); p = p + (unsigned long )len; } if (vsi->num_q_vectors != 0) { { len = (int )((unsigned int )vsi->num_q_vectors * 4096U); memcpy((void *)p, (void const *)vsi->q_vectors, (size_t )len); p = p + (unsigned long )len; } } else { } if ((unsigned int )vsi->num_queue_pairs != 0U) { { len = (int )((unsigned int )vsi->num_queue_pairs * 4096U); memcpy((void *)p, (void const *)vsi->tx_rings, (size_t )len); p = p + (unsigned long )len; memcpy((void *)p, (void const *)vsi->rx_rings, (size_t )len); p = p + (unsigned long )len; } } else { } if ((unsigned long )*(vsi->tx_rings) != (unsigned long )((struct i40e_ring *)0)) { len = 48; i = 0; goto ldv_56947; ldv_56946: { memcpy((void *)p, (void const *)(*(vsi->tx_rings + (unsigned long )i))->__annonCompField94.tx_bi, (size_t )len); p = p + (unsigned long )len; i = i + 1; } ldv_56947: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56946; } else { } len = 40; i = 0; goto ldv_56950; ldv_56949: { memcpy((void *)p, (void const *)(*(vsi->rx_rings + (unsigned long )i))->__annonCompField94.rx_bi, (size_t )len); p = p + (unsigned long )len; i = i + 1; } ldv_56950: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56949; } else { } } else { } len = 32; __mptr___1 = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr___1; goto ldv_56957; ldv_56956: { memcpy((void *)p, (void const *)f, (size_t )len); p = p + (unsigned long )len; __mptr___2 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___2; } ldv_56957: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_56956; } else { } { i40e_dbg_dump_data_len = (ssize_t )buflen; _dev_info((struct device const *)(& (pf->pdev)->dev), "VSI seid %ld dumped %d bytes\n", seid, (int )i40e_dbg_dump_data_len); } } else { } { mutex_unlock(& pf->switch_mutex); } } else if (seid > 287L) { { veb = (struct i40e_veb *)0; mutex_lock_nested(& pf->switch_mutex, 0U); veb = i40e_dbg_find_veb(pf, (int )seid); } if ((unsigned long )veb == (unsigned long )((struct i40e_veb *)0)) { { mutex_unlock(& pf->switch_mutex); } goto write_exit; } else { } { buflen = 304; tmp___1 = i40e_dbg_prep_dump_buf(pf, buflen); } if (tmp___1 != 0) { { seid_found = 1; memcpy((void *)i40e_dbg_dump_buf, (void const *)veb, (size_t )buflen); i40e_dbg_dump_data_len = (ssize_t )buflen; _dev_info((struct device const *)(& (pf->pdev)->dev), "VEB seid %ld dumped %d bytes\n", seid, (int )i40e_dbg_dump_data_len); } } else { } { mutex_unlock(& pf->switch_mutex); } } else { } write_exit: ; if (! seid_found) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "unknown seid %ld\n", seid); } } else { } return ((ssize_t )count); } } static struct file_operations const i40e_dbg_dump_fops = {& __this_module, 0, & i40e_dbg_dump_read, & i40e_dbg_dump_write, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static char i40e_dbg_command_buf[256U] = { 'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '\000'}; static ssize_t i40e_dbg_command_read(struct file *filp , char *buffer , size_t count , loff_t *ppos ) { struct i40e_pf *pf ; int bytes_not_copied ; int buf_size ; char *buf ; int len ; void *tmp ; unsigned long tmp___0 ; { pf = (struct i40e_pf *)filp->private_data; buf_size = 256; if (*ppos != 0LL) { return (0L); } else { } if (count < (size_t )buf_size) { return (-28L); } else { } { tmp = kzalloc((size_t )buf_size, 208U); buf = (char *)tmp; } if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-28L); } else { } { len = snprintf(buf, (size_t )buf_size, "%s: %s\n", (char *)(& ((*(pf->vsi + (unsigned long )pf->lan_vsi))->netdev)->name), (char *)(& i40e_dbg_command_buf)); tmp___0 = copy_to_user((void *)buffer, (void const *)buf, (unsigned long )len); bytes_not_copied = (int )tmp___0; kfree((void const *)buf); } if (bytes_not_copied < 0) { return ((ssize_t )bytes_not_copied); } else { } *ppos = (loff_t )len; return ((ssize_t )len); } } static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf , int seid ) { struct rtnl_link_stats64 *nstat ; struct i40e_mac_filter *f ; struct i40e_vsi *vsi ; int i ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct i40e_ring *rx_ring ; struct i40e_ring *tx_ring ; { { vsi = i40e_dbg_find_vsi(pf, seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "dump %d: seid not found\n", seid); } return; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "vsi seid %d\n", seid); } if ((unsigned long )vsi->netdev != (unsigned long )((struct net_device *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), " netdev: name = %s\n", (char *)(& (vsi->netdev)->name)); } } else { } if ((unsigned long )(& vsi->active_vlans) != (unsigned long )((unsigned long (*)[64])0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), " vlgrp: & = %p\n", (unsigned long *)(& vsi->active_vlans)); } } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), " netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n", (int )vsi->netdev_registered, vsi->current_netdev_flags, vsi->state, vsi->flags); __mptr = (struct list_head const *)vsi->mac_filter_list.next; f = (struct i40e_mac_filter *)__mptr; } goto ldv_56986; ldv_56985: { _dev_info((struct device const *)(& (pf->pdev)->dev), " mac_filter_list: %pM vid=%d, is_netdev=%d is_vf=%d counter=%d\n", (u8 *)(& f->macaddr), (int )f->vlan, (int )f->is_netdev, (int )f->is_vf, (int )f->counter); __mptr___0 = (struct list_head const *)f->list.next; f = (struct i40e_mac_filter *)__mptr___0; } ldv_56986: ; if ((unsigned long )(& f->list) != (unsigned long )(& vsi->mac_filter_list)) { goto ldv_56985; } else { } { nstat = i40e_get_vsi_stats_struct(vsi); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n", (unsigned long )nstat->rx_packets, (unsigned long )nstat->rx_bytes, (unsigned long )nstat->rx_errors, (unsigned long )nstat->rx_dropped); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n", (unsigned long )nstat->tx_packets, (unsigned long )nstat->tx_bytes, (unsigned long )nstat->tx_errors, (unsigned long )nstat->tx_dropped); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats: multicast = %lu, collisions = %lu\n", (unsigned long )nstat->multicast, (unsigned long )nstat->collisions); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n", (unsigned long )nstat->rx_length_errors, (unsigned long )nstat->rx_over_errors, (unsigned long )nstat->rx_crc_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n", (unsigned long )nstat->rx_frame_errors, (unsigned long )nstat->rx_fifo_errors, (unsigned long )nstat->rx_missed_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n", (unsigned long )nstat->tx_aborted_errors, (unsigned long )nstat->tx_carrier_errors, (unsigned long )nstat->tx_fifo_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n", (unsigned long )nstat->tx_heartbeat_errors, (unsigned long )nstat->tx_window_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats: rx_compressed = %lu, tx_compressed = %lu\n", (unsigned long )nstat->rx_compressed, (unsigned long )nstat->tx_compressed); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats_offsets: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\n", (unsigned long )vsi->net_stats_offsets.rx_packets, (unsigned long )vsi->net_stats_offsets.rx_bytes, (unsigned long )vsi->net_stats_offsets.rx_errors, (unsigned long )vsi->net_stats_offsets.rx_dropped); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats_offsets: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\n", (unsigned long )vsi->net_stats_offsets.tx_packets, (unsigned long )vsi->net_stats_offsets.tx_bytes, (unsigned long )vsi->net_stats_offsets.tx_errors, (unsigned long )vsi->net_stats_offsets.tx_dropped); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats_offsets: multicast = %lu, collisions = %lu\n", (unsigned long )vsi->net_stats_offsets.multicast, (unsigned long )vsi->net_stats_offsets.collisions); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats_offsets: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\n", (unsigned long )vsi->net_stats_offsets.rx_length_errors, (unsigned long )vsi->net_stats_offsets.rx_over_errors, (unsigned long )vsi->net_stats_offsets.rx_crc_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats_offsets: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\n", (unsigned long )vsi->net_stats_offsets.rx_frame_errors, (unsigned long )vsi->net_stats_offsets.rx_fifo_errors, (unsigned long )vsi->net_stats_offsets.rx_missed_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats_offsets: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\n", (unsigned long )vsi->net_stats_offsets.tx_aborted_errors, (unsigned long )vsi->net_stats_offsets.tx_carrier_errors, (unsigned long )vsi->net_stats_offsets.tx_fifo_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats_offsets: tx_heartbeat_errors = %lu, tx_window_errors = %lu\n", (unsigned long )vsi->net_stats_offsets.tx_heartbeat_errors, (unsigned long )vsi->net_stats_offsets.tx_window_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " net_stats_offsets: rx_compressed = %lu, tx_compressed = %lu\n", (unsigned long )vsi->net_stats_offsets.rx_compressed, (unsigned long )vsi->net_stats_offsets.tx_compressed); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\n", vsi->tx_restart, vsi->tx_busy, vsi->rx_buf_failed, vsi->rx_page_failed); rcu_read_lock(); i = 0; } goto ldv_56991; ldv_56990: rx_ring = *((struct i40e_ring * volatile *)vsi->rx_rings + (unsigned long )i); if ((unsigned long )rx_ring == (unsigned long )((struct i40e_ring *)0)) { goto ldv_56989; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: desc = %p\n", i, rx_ring->desc); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: dev = %p, netdev = %p, rx_bi = %p\n", i, rx_ring->dev, rx_ring->netdev, rx_ring->__annonCompField94.rx_bi); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n", i, rx_ring->state, (int )rx_ring->queue_index, (int )rx_ring->reg_idx); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: rx_hdr_len = %d, rx_buf_len = %d, dtype = %d\n", i, (int )rx_ring->rx_hdr_len, (int )rx_ring->rx_buf_len, (int )rx_ring->dtype); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n", i, (int )rx_ring->hsplit, (int )rx_ring->next_to_use, (int )rx_ring->next_to_clean, (int )rx_ring->ring_active); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: rx_stats: packets = %lld, bytes = %lld, non_eop_descs = %lld\n", i, rx_ring->stats.packets, rx_ring->stats.bytes, rx_ring->__annonCompField95.rx_stats.non_eop_descs); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: rx_stats: alloc_page_failed = %lld, alloc_buff_failed = %lld\n", i, rx_ring->__annonCompField95.rx_stats.alloc_page_failed, rx_ring->__annonCompField95.rx_stats.alloc_buff_failed); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: size = %i, dma = 0x%08lx\n", i, rx_ring->size, (unsigned long )rx_ring->dma); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_rings[%i]: vsi = %p, q_vector = %p\n", i, rx_ring->vsi, rx_ring->q_vector); } ldv_56989: i = i + 1; ldv_56991: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56990; } else { } i = 0; goto ldv_56996; ldv_56995: tx_ring = *((struct i40e_ring * volatile *)vsi->tx_rings + (unsigned long )i); if ((unsigned long )tx_ring == (unsigned long )((struct i40e_ring *)0)) { goto ldv_56994; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: desc = %p\n", i, tx_ring->desc); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: dev = %p, netdev = %p, tx_bi = %p\n", i, tx_ring->dev, tx_ring->netdev, tx_ring->__annonCompField94.tx_bi); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n", i, tx_ring->state, (int )tx_ring->queue_index, (int )tx_ring->reg_idx); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: dtype = %d\n", i, (int )tx_ring->dtype); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: hsplit = %d, next_to_use = %d, next_to_clean = %d, ring_active = %i\n", i, (int )tx_ring->hsplit, (int )tx_ring->next_to_use, (int )tx_ring->next_to_clean, (int )tx_ring->ring_active); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: tx_stats: packets = %lld, bytes = %lld, restart_queue = %lld\n", i, tx_ring->stats.packets, tx_ring->stats.bytes, tx_ring->__annonCompField95.tx_stats.restart_queue); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: tx_stats: tx_busy = %lld, tx_done_old = %lld\n", i, tx_ring->__annonCompField95.tx_stats.tx_busy, tx_ring->__annonCompField95.tx_stats.tx_done_old); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: size = %i, dma = 0x%08lx\n", i, tx_ring->size, (unsigned long )tx_ring->dma); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: vsi = %p, q_vector = %p\n", i, tx_ring->vsi, tx_ring->q_vector); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_rings[%i]: DCB tc = %d\n", i, (int )tx_ring->dcb_tc); } ldv_56994: i = i + 1; ldv_56996: ; if (i < (int )vsi->num_queue_pairs) { goto ldv_56995; } else { } { rcu_read_unlock(); _dev_info((struct device const *)(& (pf->pdev)->dev), " work_limit = %d, rx_itr_setting = %d (%s), tx_itr_setting = %d (%s)\n", (int )vsi->work_limit, (int )vsi->rx_itr_setting, (int )((short )vsi->rx_itr_setting) < 0 ? (char *)"dynamic" : (char *)"fixed", (int )vsi->tx_itr_setting, (int )((short )vsi->tx_itr_setting) < 0 ? (char *)"dynamic" : (char *)"fixed"); _dev_info((struct device const *)(& (pf->pdev)->dev), " max_frame = %d, rx_hdr_len = %d, rx_buf_len = %d dtype = %d\n", (int )vsi->max_frame, (int )vsi->rx_hdr_len, (int )vsi->rx_buf_len, (int )vsi->dtype); _dev_info((struct device const *)(& (pf->pdev)->dev), " num_q_vectors = %i, base_vector = %i\n", vsi->num_q_vectors, vsi->base_vector); _dev_info((struct device const *)(& (pf->pdev)->dev), " seid = %d, id = %d, uplink_seid = %d\n", (int )vsi->seid, (int )vsi->id, (int )vsi->uplink_seid); _dev_info((struct device const *)(& (pf->pdev)->dev), " base_queue = %d, num_queue_pairs = %d, num_desc = %d\n", (int )vsi->base_queue, (int )vsi->num_queue_pairs, (int )vsi->num_desc); _dev_info((struct device const *)(& (pf->pdev)->dev), " type = %i\n", (unsigned int )vsi->type); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: valid_sections = 0x%04x, switch_id = 0x%04x\n", (int )vsi->info.valid_sections, (int )vsi->info.switch_id); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: sw_reserved[] = 0x%02x 0x%02x\n", (int )vsi->info.sw_reserved[0], (int )vsi->info.sw_reserved[1]); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: sec_flags = 0x%02x, sec_reserved = 0x%02x\n", (int )vsi->info.sec_flags, (int )vsi->info.sec_reserved); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: pvid = 0x%04x, fcoe_pvid = 0x%04x, port_vlan_flags = 0x%02x\n", (int )vsi->info.pvid, (int )vsi->info.fcoe_pvid, (int )vsi->info.port_vlan_flags); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: pvlan_reserved[] = 0x%02x 0x%02x 0x%02x\n", (int )vsi->info.pvlan_reserved[0], (int )vsi->info.pvlan_reserved[1], (int )vsi->info.pvlan_reserved[2]); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: ingress_table = 0x%08x, egress_table = 0x%08x\n", vsi->info.ingress_table, vsi->info.egress_table); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: cas_pv_stag = 0x%04x, cas_pv_flags= 0x%02x, cas_pv_reserved = 0x%02x\n", (int )vsi->info.cas_pv_tag, (int )vsi->info.cas_pv_flags, (int )vsi->info.cas_pv_reserved); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: queue_mapping[0..7 ] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", (int )vsi->info.queue_mapping[0], (int )vsi->info.queue_mapping[1], (int )vsi->info.queue_mapping[2], (int )vsi->info.queue_mapping[3], (int )vsi->info.queue_mapping[4], (int )vsi->info.queue_mapping[5], (int )vsi->info.queue_mapping[6], (int )vsi->info.queue_mapping[7]); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: queue_mapping[8..15] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", (int )vsi->info.queue_mapping[8], (int )vsi->info.queue_mapping[9], (int )vsi->info.queue_mapping[10], (int )vsi->info.queue_mapping[11], (int )vsi->info.queue_mapping[12], (int )vsi->info.queue_mapping[13], (int )vsi->info.queue_mapping[14], (int )vsi->info.queue_mapping[15]); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: tc_mapping[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", (int )vsi->info.tc_mapping[0], (int )vsi->info.tc_mapping[1], (int )vsi->info.tc_mapping[2], (int )vsi->info.tc_mapping[3], (int )vsi->info.tc_mapping[4], (int )vsi->info.tc_mapping[5], (int )vsi->info.tc_mapping[6], (int )vsi->info.tc_mapping[7]); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: queueing_opt_flags = 0x%02x queueing_opt_reserved[0..2] = 0x%02x 0x%02x 0x%02x\n", (int )vsi->info.queueing_opt_flags, (int )vsi->info.queueing_opt_reserved[0], (int )vsi->info.queueing_opt_reserved[1], (int )vsi->info.queueing_opt_reserved[2]); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: up_enable_bits = 0x%02x\n", (int )vsi->info.up_enable_bits); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: sched_reserved = 0x%02x, outer_up_table = 0x%04x\n", (int )vsi->info.sched_reserved, vsi->info.outer_up_table); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: cmd_reserved[] = 0x%02x 0x%02x 0x%02x 0x0%02x 0x%02x 0x%02x 0x%02x 0x0%02x\n", (int )vsi->info.cmd_reserved[0], (int )vsi->info.cmd_reserved[1], (int )vsi->info.cmd_reserved[2], (int )vsi->info.cmd_reserved[3], (int )vsi->info.cmd_reserved[4], (int )vsi->info.cmd_reserved[5], (int )vsi->info.cmd_reserved[6], (int )vsi->info.cmd_reserved[7]); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: qs_handle[] = 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", (int )vsi->info.qs_handle[0], (int )vsi->info.qs_handle[1], (int )vsi->info.qs_handle[2], (int )vsi->info.qs_handle[3], (int )vsi->info.qs_handle[4], (int )vsi->info.qs_handle[5], (int )vsi->info.qs_handle[6], (int )vsi->info.qs_handle[7]); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: stat_counter_idx = 0x%04x, sched_id = 0x%04x\n", (int )vsi->info.stat_counter_idx, (int )vsi->info.sched_id); _dev_info((struct device const *)(& (pf->pdev)->dev), " info: resp_reserved[] = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", (int )vsi->info.resp_reserved[0], (int )vsi->info.resp_reserved[1], (int )vsi->info.resp_reserved[2], (int )vsi->info.resp_reserved[3], (int )vsi->info.resp_reserved[4], (int )vsi->info.resp_reserved[5], (int )vsi->info.resp_reserved[6], (int )vsi->info.resp_reserved[7], (int )vsi->info.resp_reserved[8], (int )vsi->info.resp_reserved[9], (int )vsi->info.resp_reserved[10], (int )vsi->info.resp_reserved[11]); } if ((unsigned long )vsi->back != (unsigned long )((struct i40e_pf *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), " pf = %p\n", vsi->back); } } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), " idx = %d\n", (int )vsi->idx); _dev_info((struct device const *)(& (pf->pdev)->dev), " tc_config: numtc = %d, enabled_tc = 0x%x\n", (int )vsi->tc_config.numtc, (int )vsi->tc_config.enabled_tc); i = 0; } goto ldv_56999; ldv_56998: { _dev_info((struct device const *)(& (pf->pdev)->dev), " tc_config: tc = %d, qoffset = %d, qcount = %d, netdev_tc = %d\n", i, (int )vsi->tc_config.tc_info[i].qoffset, (int )vsi->tc_config.tc_info[i].qcount, (int )vsi->tc_config.tc_info[i].netdev_tc); i = i + 1; } ldv_56999: ; if (i <= 7) { goto ldv_56998; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), " bw: bw_limit = %d, bw_max_quanta = %d\n", (int )vsi->bw_limit, (int )vsi->bw_max_quanta); i = 0; } goto ldv_57002; ldv_57001: { _dev_info((struct device const *)(& (pf->pdev)->dev), " bw[%d]: ets_share_credits = %d, ets_limit_credits = %d, max_quanta = %d\n", i, (int )vsi->bw_ets_share_credits[i], (int )vsi->bw_ets_limit_credits[i], (int )vsi->bw_ets_max_quanta[i]); i = i + 1; } ldv_57002: ; if (i <= 7) { goto ldv_57001; } else { } return; } } static void i40e_dbg_dump_aq_desc(struct i40e_pf *pf ) { struct i40e_adminq_ring *ring ; struct i40e_hw *hw ; char hdr[32U] ; int i ; char const *tmp ; char const *tmp___0 ; struct i40e_aq_desc *d ; struct i40e_aq_desc *d___0 ; { { hw = & pf->hw; tmp = dev_name((struct device const *)(& (pf->pdev)->dev)); tmp___0 = dev_driver_string((struct device const *)(& (pf->pdev)->dev)); snprintf((char *)(& hdr), 32UL, "%s %s: ", tmp___0, tmp); _dev_info((struct device const *)(& (pf->pdev)->dev), "AdminQ Tx Ring\n"); ring = & hw->aq.asq; i = 0; } goto ldv_57013; ldv_57012: { d = (struct i40e_aq_desc *)ring->desc_buf.va + (unsigned long )i; _dev_info((struct device const *)(& (pf->pdev)->dev), " at[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n", i, (int )d->flags, (int )d->opcode, (int )d->datalen, (int )d->retval, d->cookie_high, d->cookie_low); print_hex_dump("\016", (char const *)(& hdr), 0, 16, 1, (void const *)(& d->params.raw), 16UL, 0); i = i + 1; } ldv_57013: ; if (i < (int )ring->count) { goto ldv_57012; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "AdminQ Rx Ring\n"); ring = & hw->aq.arq; i = 0; } goto ldv_57017; ldv_57016: { d___0 = (struct i40e_aq_desc *)ring->desc_buf.va + (unsigned long )i; _dev_info((struct device const *)(& (pf->pdev)->dev), " ar[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\n", i, (int )d___0->flags, (int )d___0->opcode, (int )d___0->datalen, (int )d___0->retval, d___0->cookie_high, d___0->cookie_low); print_hex_dump("\016", (char const *)(& hdr), 0, 16, 1, (void const *)(& d___0->params.raw), 16UL, 0); i = i + 1; } ldv_57017: ; if (i < (int )ring->count) { goto ldv_57016; } else { } return; } } static void i40e_dbg_dump_desc(int cnt , int vsi_seid , int ring_id , int desc_n , struct i40e_pf *pf , bool is_rx_ring ) { struct i40e_tx_desc *txd ; union i40e_32byte_rx_desc *rxd ; struct i40e_ring ring ; struct i40e_vsi *vsi ; int i ; { { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "vsi %d not found\n", vsi_seid); } return; } else { } if (ring_id >= (int )vsi->num_queue_pairs || ring_id < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "ring %d not found\n", ring_id); } return; } else { } if ((unsigned long )vsi->tx_rings == (unsigned long )((struct i40e_ring **)0) || (unsigned long )(*(vsi->tx_rings))->desc == (unsigned long )((void *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "descriptor rings have not been allocated for vsi %d\n", vsi_seid); } return; } else { } if ((int )is_rx_ring) { ring = *(*(vsi->rx_rings + (unsigned long )ring_id)); } else { ring = *(*(vsi->tx_rings + (unsigned long )ring_id)); } if (cnt == 2) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "vsi = %02i %s ring = %02i\n", vsi_seid, (int )is_rx_ring ? (char *)"rx" : (char *)"tx", ring_id); i = 0; } goto ldv_57033; ldv_57032: ; if (! is_rx_ring) { { txd = (struct i40e_tx_desc *)ring.desc + (unsigned long )i; _dev_info((struct device const *)(& (pf->pdev)->dev), " d[%03i] = 0x%016llx 0x%016llx\n", i, txd->buffer_addr, txd->cmd_type_offset_bsz); } } else { { constant_test_bit(6L, (unsigned long const volatile *)(& ring.state)); rxd = (union i40e_32byte_rx_desc *)ring.desc + (unsigned long )i; _dev_info((struct device const *)(& (pf->pdev)->dev), " d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n", i, rxd->read.pkt_addr, rxd->read.hdr_addr, rxd->read.rsvd1, rxd->read.rsvd2); } } i = i + 1; ldv_57033: ; if (i < (int )ring.count) { goto ldv_57032; } else { } } else if (cnt == 3) { if (desc_n >= (int )ring.count || desc_n < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "descriptor %d not found\n", desc_n); } return; } else { } if (! is_rx_ring) { { txd = (struct i40e_tx_desc *)ring.desc + (unsigned long )desc_n; _dev_info((struct device const *)(& (pf->pdev)->dev), "vsi = %02i tx ring = %02i d[%03i] = 0x%016llx 0x%016llx\n", vsi_seid, ring_id, desc_n, txd->buffer_addr, txd->cmd_type_offset_bsz); } } else { { constant_test_bit(6L, (unsigned long const volatile *)(& ring.state)); rxd = (union i40e_32byte_rx_desc *)ring.desc + (unsigned long )desc_n; _dev_info((struct device const *)(& (pf->pdev)->dev), "vsi = %02i rx ring = %02i d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n", vsi_seid, ring_id, desc_n, rxd->read.pkt_addr, rxd->read.hdr_addr, rxd->read.rsvd1, rxd->read.rsvd2); } } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "dump desc rx/tx []\n"); } } return; } } static void i40e_dbg_dump_vsi_no_seid(struct i40e_pf *pf ) { int i ; { i = 0; goto ldv_57040; ldv_57039: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "dump vsi[%d]: %d\n", i, (int )(*(pf->vsi + (unsigned long )i))->seid); } } else { } i = i + 1; ldv_57040: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_57039; } else { } return; } } static void i40e_dbg_dump_eth_stats(struct i40e_pf *pf , struct i40e_eth_stats *estats ) { { { _dev_info((struct device const *)(& (pf->pdev)->dev), " ethstats:\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_bytes = \t%lld \trx_unicast = \t\t%lld \trx_multicast = \t%lld\n", estats->rx_bytes, estats->rx_unicast, estats->rx_multicast); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_broadcast = \t%lld \trx_discards = \t\t%lld \trx_errors = \t%lld\n", estats->rx_broadcast, estats->rx_discards, estats->rx_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_missed = \t%lld \trx_unknown_protocol = \t%lld \ttx_bytes = \t%lld\n", estats->rx_missed, estats->rx_unknown_protocol, estats->tx_bytes); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_unicast = \t%lld \ttx_multicast = \t\t%lld \ttx_broadcast = \t%lld\n", estats->tx_unicast, estats->tx_multicast, estats->tx_broadcast); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_discards = \t%lld \ttx_errors = \t\t%lld\n", estats->tx_discards, estats->tx_errors); } return; } } static void i40e_dbg_dump_stats(struct i40e_pf *pf , struct i40e_hw_port_stats *stats ) { int i ; { { _dev_info((struct device const *)(& (pf->pdev)->dev), " stats:\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " crc_errors = \t\t%lld \tillegal_bytes = \t%lld \terror_bytes = \t\t%lld\n", stats->crc_errors, stats->illegal_bytes, stats->error_bytes); _dev_info((struct device const *)(& (pf->pdev)->dev), " mac_local_faults = \t%lld \tmac_remote_faults = \t%lld \trx_length_errors = \t%lld\n", stats->mac_local_faults, stats->mac_remote_faults, stats->rx_length_errors); _dev_info((struct device const *)(& (pf->pdev)->dev), " link_xon_rx = \t\t%lld \tlink_xoff_rx = \t\t%lld \tlink_xon_tx = \t\t%lld\n", stats->link_xon_rx, stats->link_xoff_rx, stats->link_xon_tx); _dev_info((struct device const *)(& (pf->pdev)->dev), " link_xoff_tx = \t\t%lld \trx_size_64 = \t\t%lld \trx_size_127 = \t\t%lld\n", stats->link_xoff_tx, stats->rx_size_64, stats->rx_size_127); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_size_255 = \t\t%lld \trx_size_511 = \t\t%lld \trx_size_1023 = \t\t%lld\n", stats->rx_size_255, stats->rx_size_511, stats->rx_size_1023); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_size_big = \t\t%lld \trx_undersize = \t\t%lld \trx_jabber = \t\t%lld\n", stats->rx_size_big, stats->rx_undersize, stats->rx_jabber); _dev_info((struct device const *)(& (pf->pdev)->dev), " rx_fragments = \t\t%lld \trx_oversize = \t\t%lld \ttx_size_64 = \t\t%lld\n", stats->rx_fragments, stats->rx_oversize, stats->tx_size_64); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_size_127 = \t\t%lld \ttx_size_255 = \t\t%lld \ttx_size_511 = \t\t%lld\n", stats->tx_size_127, stats->tx_size_255, stats->tx_size_511); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_size_1023 = \t\t%lld \ttx_size_big = \t\t%lld \tmac_short_packet_dropped = \t%lld\n", stats->tx_size_1023, stats->tx_size_big, stats->mac_short_packet_dropped); i = 0; } goto ldv_57052; ldv_57051: { _dev_info((struct device const *)(& (pf->pdev)->dev), " priority_xon_rx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n", i, stats->priority_xon_rx[i], i + 1, stats->priority_xon_rx[i + 1], i + 2, stats->priority_xon_rx[i + 2], i + 3, stats->priority_xon_rx[i + 3]); i = i + 4; } ldv_57052: ; if (i <= 7) { goto ldv_57051; } else { } i = 0; goto ldv_57055; ldv_57054: { _dev_info((struct device const *)(& (pf->pdev)->dev), " priority_xoff_rx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n", i, stats->priority_xoff_rx[i], i + 1, stats->priority_xoff_rx[i + 1], i + 2, stats->priority_xoff_rx[i + 2], i + 3, stats->priority_xoff_rx[i + 3]); i = i + 4; } ldv_57055: ; if (i <= 7) { goto ldv_57054; } else { } i = 0; goto ldv_57058; ldv_57057: { _dev_info((struct device const *)(& (pf->pdev)->dev), " priority_xon_tx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n", i, stats->priority_xon_tx[i], i + 1, stats->priority_xon_tx[i + 1], i + 2, stats->priority_xon_tx[i + 2], i + 3, stats->priority_xon_rx[i + 3]); i = i + 4; } ldv_57058: ; if (i <= 7) { goto ldv_57057; } else { } i = 0; goto ldv_57061; ldv_57060: { _dev_info((struct device const *)(& (pf->pdev)->dev), " priority_xoff_tx[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n", i, stats->priority_xoff_tx[i], i + 1, stats->priority_xoff_tx[i + 1], i + 2, stats->priority_xoff_tx[i + 2], i + 3, stats->priority_xoff_tx[i + 3]); i = i + 4; } ldv_57061: ; if (i <= 7) { goto ldv_57060; } else { } i = 0; goto ldv_57064; ldv_57063: { _dev_info((struct device const *)(& (pf->pdev)->dev), " priority_xon_2_xoff[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld \t[%d] = \t%lld\n", i, stats->priority_xon_2_xoff[i], i + 1, stats->priority_xon_2_xoff[i + 1], i + 2, stats->priority_xon_2_xoff[i + 2], i + 3, stats->priority_xon_2_xoff[i + 3]); i = i + 4; } ldv_57064: ; if (i <= 7) { goto ldv_57063; } else { } { i40e_dbg_dump_eth_stats(pf, & stats->eth); } return; } } static void i40e_dbg_dump_veb_seid(struct i40e_pf *pf , int seid ) { struct i40e_veb *veb ; { if ((unsigned int )seid - 288U > 15U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%d: bad seid\n", seid); } return; } else { } { veb = i40e_dbg_find_veb(pf, seid); } if ((unsigned long )veb == (unsigned long )((struct i40e_veb *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "can\'t find veb %d\n", seid); } return; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "veb idx=%d,%d stats_ic=%d seid=%d uplink=%d\n", (int )veb->idx, (int )veb->veb_idx, (int )veb->stats_idx, (int )veb->seid, (int )veb->uplink_seid); i40e_dbg_dump_eth_stats(pf, & veb->stats); } return; } } static void i40e_dbg_dump_veb_all(struct i40e_pf *pf ) { struct i40e_veb *veb ; int i ; { i = 0; goto ldv_57077; ldv_57076: veb = pf->veb[i]; if ((unsigned long )veb != (unsigned long )((struct i40e_veb *)0)) { { i40e_dbg_dump_veb_seid(pf, (int )veb->seid); } } else { } i = i + 1; ldv_57077: ; if (i <= 15) { goto ldv_57076; } else { } return; } } static void i40e_dbg_cmd_fd_ctrl(struct i40e_pf *pf , u64 flag , bool enable ) { { if ((int )enable) { pf->flags = pf->flags | flag; } else { pf->flags = pf->flags & ~ flag; } { _dev_info((struct device const *)(& (pf->pdev)->dev), "requesting a pf reset\n"); i40e_do_reset_safe(pf, 4096U); } return; } } static ssize_t i40e_dbg_command_write(struct file *filp , char const *buffer , size_t count , loff_t *ppos ) { struct i40e_pf *pf ; char *cmd_buf ; char *cmd_buf_tmp ; int bytes_not_copied ; struct i40e_vsi *vsi ; int vsi_seid ; int veb_seid ; int cnt ; void *tmp ; unsigned long tmp___0 ; struct i40e_veb *veb ; int uplink_seid ; int i ; int i___0 ; struct i40e_mac_filter *f ; int vlan ; u8 ma[6U] ; int ret ; int vlan___0 ; u8 ma___0[6U] ; int ret___0 ; i40e_status ret___1 ; u16 vid ; int v ; int ring_id ; int desc_n ; int tmp___1 ; int tmp___2 ; int tmp___3 ; struct i40e_aqc_query_port_ets_config_resp *bw_data ; struct i40e_dcbx_config *cfg ; struct i40e_dcbx_config *r_cfg ; int i___1 ; int ret___2 ; void *tmp___4 ; i40e_status tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; u32 level ; u32 address ; u32 value ; u32 address___0 ; u32 value___0 ; int i___2 ; int tmp___13 ; int tmp___14 ; struct i40e_aq_desc *desc ; i40e_status ret___3 ; void *tmp___15 ; struct i40e_aq_desc *desc___0 ; i40e_status ret___4 ; u16 buffer_len ; u8 *buff ; void *tmp___16 ; void *tmp___17 ; struct i40e_fdir_data fd_data ; u16 packet_len ; u16 i___3 ; u16 j ; char *asc_packet ; bool add ; int ret___5 ; void *tmp___18 ; void *tmp___19 ; int tmp___20 ; u16 __min1 ; u16 __min2 ; int ret___6 ; i40e_status tmp___21 ; i40e_status tmp___22 ; int ret___7 ; i40e_status tmp___23 ; i40e_status tmp___24 ; u16 llen ; u16 rlen ; int ret___8 ; u8 *buff___0 ; void *tmp___25 ; i40e_status tmp___26 ; u16 llen___0 ; u16 rlen___0 ; int ret___9 ; u8 *buff___1 ; void *tmp___27 ; i40e_status tmp___28 ; int ret___10 ; i40e_status tmp___29 ; int ret___11 ; i40e_status tmp___30 ; int tmp___31 ; int tmp___32 ; int tmp___33 ; int tmp___34 ; int tmp___35 ; int tmp___36 ; u16 buffer_len___0 ; u16 bytes ; u16 module ; u32 offset ; u16 *buff___2 ; int ret___12 ; u16 __min1___0 ; u16 __min2___0 ; u16 __val ; unsigned short __min ; unsigned short __max ; void *tmp___37 ; i40e_status tmp___38 ; i40e_status tmp___39 ; int tmp___40 ; int tmp___41 ; int tmp___42 ; int tmp___43 ; int tmp___44 ; int tmp___45 ; int tmp___46 ; int tmp___47 ; int tmp___48 ; int tmp___49 ; int tmp___50 ; int tmp___51 ; int tmp___52 ; int tmp___53 ; int tmp___54 ; int tmp___55 ; int tmp___56 ; int tmp___57 ; int tmp___58 ; int tmp___59 ; int tmp___60 ; int tmp___61 ; int tmp___62 ; int tmp___63 ; int tmp___64 ; int tmp___65 ; int tmp___66 ; { pf = (struct i40e_pf *)filp->private_data; if (*ppos != 0LL) { return (0L); } else { } { tmp = kzalloc(count + 1UL, 208U); cmd_buf = (char *)tmp; } if ((unsigned long )cmd_buf == (unsigned long )((char *)0)) { return ((ssize_t )count); } else { } { tmp___0 = copy_from_user((void *)cmd_buf, (void const *)buffer, count); bytes_not_copied = (int )tmp___0; } if (bytes_not_copied < 0) { return ((ssize_t )bytes_not_copied); } else { } if (bytes_not_copied > 0) { count = count - (size_t )bytes_not_copied; } else { } { *(cmd_buf + count) = 0; cmd_buf_tmp = strchr((char const *)cmd_buf, 10); } if ((unsigned long )cmd_buf_tmp != (unsigned long )((char *)0)) { *cmd_buf_tmp = 0; count = (size_t )(((long )cmd_buf_tmp - (long )cmd_buf) + 1L); } else { } { tmp___66 = strncmp((char const *)cmd_buf, "add vsi", 7UL); } if (tmp___66 == 0) { { vsi_seid = -1; cnt = sscanf((char const *)cmd_buf + 7U, "%i", & vsi_seid); } if (cnt == 0) { vsi_seid = (int )(*(pf->vsi + (unsigned long )pf->lan_vsi))->seid; } else if (vsi_seid < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add VSI %d: bad vsi seid\n", vsi_seid); } goto command_write_done; } else { } { vsi = i40e_vsi_setup(pf, 2, (int )((u16 )vsi_seid), 0U); } if ((unsigned long )vsi != (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "added VSI %d to relay %d\n", (int )vsi->seid, (int )vsi->uplink_seid); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "\'%s\' failed\n", cmd_buf); } } } else { { tmp___65 = strncmp((char const *)cmd_buf, "del vsi", 7UL); } if (tmp___65 == 0) { { sscanf((char const *)cmd_buf + 7U, "%i", & vsi_seid); vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del VSI %d: seid not found\n", vsi_seid); } goto command_write_done; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "deleting VSI %d\n", vsi_seid); i40e_vsi_release(vsi); } } else { { tmp___64 = strncmp((char const *)cmd_buf, "add relay", 9UL); } if (tmp___64 == 0) { { cnt = sscanf((char const *)cmd_buf + 9U, "%i %i", & uplink_seid, & vsi_seid); } if (cnt != 2) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add relay: bad command string, cnt=%d\n", cnt); } goto command_write_done; } else if (uplink_seid < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add relay %d: bad uplink seid\n", uplink_seid); } goto command_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add relay: VSI %d not found\n", vsi_seid); } goto command_write_done; } else { } i = 0; goto ldv_57104; ldv_57103: ; if ((unsigned long )pf->veb[i] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[i])->seid == uplink_seid) { goto ldv_57102; } else { } i = i + 1; ldv_57104: ; if (i <= 15) { goto ldv_57103; } else { } ldv_57102: ; if ((i > 15 && uplink_seid != 0) && uplink_seid != (int )pf->mac_seid) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add relay: relay uplink %d not found\n", uplink_seid); } goto command_write_done; } else { } { veb = i40e_veb_setup(pf, 0, (int )((u16 )uplink_seid), (int )((u16 )vsi_seid), (int )vsi->tc_config.enabled_tc); } if ((unsigned long )veb != (unsigned long )((struct i40e_veb *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "added relay %d\n", (int )veb->seid); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add relay failed\n"); } } } else { { tmp___63 = strncmp((char const *)cmd_buf, "del relay", 9UL); } if (tmp___63 == 0) { { cnt = sscanf((char const *)cmd_buf + 9U, "%i", & veb_seid); } if (cnt != 1) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del relay: bad command string, cnt=%d\n", cnt); } goto command_write_done; } else if (veb_seid < 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del relay %d: bad relay seid\n", veb_seid); } goto command_write_done; } else { } i___0 = 0; goto ldv_57108; ldv_57107: ; if ((unsigned long )pf->veb[i___0] != (unsigned long )((struct i40e_veb *)0) && (int )(pf->veb[i___0])->seid == veb_seid) { goto ldv_57106; } else { } i___0 = i___0 + 1; ldv_57108: ; if (i___0 <= 15) { goto ldv_57107; } else { } ldv_57106: ; if (i___0 > 15) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del relay: relay %d not found\n", veb_seid); } goto command_write_done; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "deleting relay %d\n", veb_seid); i40e_veb_release(pf->veb[i___0]); } } else { { tmp___62 = strncmp((char const *)cmd_buf, "add macaddr", 11UL); } if (tmp___62 == 0) { { vlan = 0; cnt = sscanf((char const *)cmd_buf + 11U, "%i %hhx:%hhx:%hhx:%hhx:%hhx:%hhx %i", & vsi_seid, (u8 *)(& ma), (u8 *)(& ma) + 1UL, (u8 *)(& ma) + 2UL, (u8 *)(& ma) + 3UL, (u8 *)(& ma) + 4UL, (u8 *)(& ma) + 5UL, & vlan); } if (cnt == 7) { vlan = 0; } else if (cnt != 8) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add macaddr: bad command string, cnt=%d\n", cnt); } goto command_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add macaddr: VSI %d not found\n", vsi_seid); } goto command_write_done; } else { } { f = i40e_add_filter(vsi, (u8 *)(& ma), (int )((s16 )vlan), 0, 0); ret = i40e_sync_vsi_filters(vsi); } if ((unsigned long )f != (unsigned long )((struct i40e_mac_filter *)0) && ret == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add macaddr: %pM vlan=%d added to VSI %d\n", (u8 *)(& ma), vlan, vsi_seid); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add macaddr: %pM vlan=%d to VSI %d failed, f=%p ret=%d\n", (u8 *)(& ma), vlan, vsi_seid, f, ret); } } } else { { tmp___61 = strncmp((char const *)cmd_buf, "del macaddr", 11UL); } if (tmp___61 == 0) { { vlan___0 = 0; cnt = sscanf((char const *)cmd_buf + 11U, "%i %hhx:%hhx:%hhx:%hhx:%hhx:%hhx %i", & vsi_seid, (u8 *)(& ma___0), (u8 *)(& ma___0) + 1UL, (u8 *)(& ma___0) + 2UL, (u8 *)(& ma___0) + 3UL, (u8 *)(& ma___0) + 4UL, (u8 *)(& ma___0) + 5UL, & vlan___0); } if (cnt == 7) { vlan___0 = 0; } else if (cnt != 8) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del macaddr: bad command string, cnt=%d\n", cnt); } goto command_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del macaddr: VSI %d not found\n", vsi_seid); } goto command_write_done; } else { } { i40e_del_filter(vsi, (u8 *)(& ma___0), (int )((s16 )vlan___0), 0, 0); ret___0 = i40e_sync_vsi_filters(vsi); } if (ret___0 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del macaddr: %pM vlan=%d removed from VSI %d\n", (u8 *)(& ma___0), vlan___0, vsi_seid); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del macaddr: %pM vlan=%d from VSI %d failed, ret=%d\n", (u8 *)(& ma___0), vlan___0, vsi_seid, ret___0); } } } else { { tmp___60 = strncmp((char const *)cmd_buf, "add pvid", 8UL); } if (tmp___60 == 0) { { cnt = sscanf((char const *)cmd_buf + 8U, "%i %u", & vsi_seid, & v); } if (cnt != 2) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add pvid: bad command string, cnt=%d\n", cnt); } goto command_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add pvid: VSI %d not found\n", vsi_seid); } goto command_write_done; } else { } { vid = (u16 )v; ret___1 = i40e_vsi_add_pvid(vsi, (int )vid); } if ((int )ret___1 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add pvid: %d added to VSI %d\n", (int )vid, vsi_seid); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "add pvid: %d to VSI %d failed, ret=%d\n", (int )vid, vsi_seid, (int )ret___1); } } } else { { tmp___59 = strncmp((char const *)cmd_buf, "del pvid", 8UL); } if (tmp___59 == 0) { { cnt = sscanf((char const *)cmd_buf + 8U, "%i", & vsi_seid); } if (cnt != 1) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del pvid: bad command string, cnt=%d\n", cnt); } goto command_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "del pvid: VSI %d not found\n", vsi_seid); } goto command_write_done; } else { } { i40e_vsi_remove_pvid(vsi); _dev_info((struct device const *)(& (pf->pdev)->dev), "del pvid: removed from VSI %d\n", vsi_seid); } } else { { tmp___58 = strncmp((char const *)cmd_buf, "dump", 4UL); } if (tmp___58 == 0) { { tmp___12 = strncmp((char const *)cmd_buf + 5U, "switch", 6UL); } if (tmp___12 == 0) { { i40e_fetch_switch_configuration(pf, 1); } } else { { tmp___11 = strncmp((char const *)cmd_buf + 5U, "vsi", 3UL); } if (tmp___11 == 0) { { cnt = sscanf((char const *)cmd_buf + 8U, "%i", & vsi_seid); } if (cnt > 0) { { i40e_dbg_dump_vsi_seid(pf, vsi_seid); } } else { { i40e_dbg_dump_vsi_no_seid(pf); } } } else { { tmp___10 = strncmp((char const *)cmd_buf + 5U, "veb", 3UL); } if (tmp___10 == 0) { { cnt = sscanf((char const *)cmd_buf + 8U, "%i", & vsi_seid); } if (cnt > 0) { { i40e_dbg_dump_veb_seid(pf, vsi_seid); } } else { { i40e_dbg_dump_veb_all(pf); } } } else { { tmp___9 = strncmp((char const *)cmd_buf + 5U, "desc", 4UL); } if (tmp___9 == 0) { { tmp___3 = strncmp((char const *)cmd_buf + 10U, "rx", 2UL); } if (tmp___3 == 0) { { cnt = sscanf((char const *)cmd_buf + 12U, "%i %i %i", & vsi_seid, & ring_id, & desc_n); i40e_dbg_dump_desc(cnt, vsi_seid, ring_id, desc_n, pf, 1); } } else { { tmp___2 = strncmp((char const *)cmd_buf + 10U, "tx", 2UL); } if (tmp___2 == 0) { { cnt = sscanf((char const *)cmd_buf + 12U, "%i %i %i", & vsi_seid, & ring_id, & desc_n); i40e_dbg_dump_desc(cnt, vsi_seid, ring_id, desc_n, pf, 0); } } else { { tmp___1 = strncmp((char const *)cmd_buf + 10U, "aq", 2UL); } if (tmp___1 == 0) { { i40e_dbg_dump_aq_desc(pf); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "dump desc tx []\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), "dump desc rx []\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), "dump desc aq\n"); } } } } } else { { tmp___8 = strncmp((char const *)cmd_buf + 5U, "stats", 5UL); } if (tmp___8 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "pf stats:\n"); i40e_dbg_dump_stats(pf, & pf->stats); _dev_info((struct device const *)(& (pf->pdev)->dev), "pf stats_offsets:\n"); i40e_dbg_dump_stats(pf, & pf->stats_offsets); } } else { { tmp___7 = strncmp((char const *)cmd_buf + 5U, "reset stats", 11UL); } if (tmp___7 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "core reset count: %d\n", (int )pf->corer_count); _dev_info((struct device const *)(& (pf->pdev)->dev), "global reset count: %d\n", (int )pf->globr_count); _dev_info((struct device const *)(& (pf->pdev)->dev), "emp reset count: %d\n", (int )pf->empr_count); _dev_info((struct device const *)(& (pf->pdev)->dev), "pf reset count: %d\n", (int )pf->pfr_count); } } else { { tmp___6 = strncmp((char const *)cmd_buf + 5U, "port", 4UL); } if (tmp___6 == 0) { { cfg = & pf->hw.local_dcbx_config; r_cfg = & pf->hw.remote_dcbx_config; tmp___4 = kzalloc(68UL, 208U); bw_data = (struct i40e_aqc_query_port_ets_config_resp *)tmp___4; } if ((unsigned long )bw_data == (unsigned long )((struct i40e_aqc_query_port_ets_config_resp *)0)) { ret___2 = -12; goto command_write_done; } else { } { tmp___5 = i40e_aq_query_port_ets_config(& pf->hw, (int )pf->mac_seid, bw_data, (struct i40e_asq_cmd_details *)0); ret___2 = (int )tmp___5; } if (ret___2 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Query Port ETS Config AQ command failed =0x%x\n", (unsigned int )pf->hw.aq.asq_last_status); kfree((void const *)bw_data); bw_data = (struct i40e_aqc_query_port_ets_config_resp *)0; } goto command_write_done; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "port bw: tc_valid=0x%x tc_strict_prio=0x%x, tc_bw_max=0x%04x,0x%04x\n", (int )bw_data->tc_valid_bits, (int )bw_data->tc_strict_priority_bits, (int )bw_data->tc_bw_max[0], (int )bw_data->tc_bw_max[1]); i___1 = 0; } goto ldv_57127; ldv_57126: { _dev_info((struct device const *)(& (pf->pdev)->dev), "port bw: tc_bw_share=%d tc_bw_limit=%d\n", (int )bw_data->tc_bw_share_credits[i___1], (int )bw_data->tc_bw_limits[i___1]); i___1 = i___1 + 1; } ldv_57127: ; if (i___1 <= 7) { goto ldv_57126; } else { } { kfree((void const *)bw_data); bw_data = (struct i40e_aqc_query_port_ets_config_resp *)0; _dev_info((struct device const *)(& (pf->pdev)->dev), "port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n", (int )cfg->etscfg.willing, (int )cfg->etscfg.cbs, (int )cfg->etscfg.maxtcs); i___1 = 0; } goto ldv_57130; ldv_57129: { _dev_info((struct device const *)(& (pf->pdev)->dev), "port ets_cfg: %d prio_tc=%d tcbw=%d tctsa=%d\n", i___1, (int )cfg->etscfg.prioritytable[i___1], (int )cfg->etscfg.tcbwtable[i___1], (int )cfg->etscfg.tsatable[i___1]); i___1 = i___1 + 1; } ldv_57130: ; if (i___1 <= 7) { goto ldv_57129; } else { } i___1 = 0; goto ldv_57133; ldv_57132: { _dev_info((struct device const *)(& (pf->pdev)->dev), "port ets_rec: %d prio_tc=%d tcbw=%d tctsa=%d\n", i___1, (int )cfg->etsrec.prioritytable[i___1], (int )cfg->etsrec.tcbwtable[i___1], (int )cfg->etsrec.tsatable[i___1]); i___1 = i___1 + 1; } ldv_57133: ; if (i___1 <= 7) { goto ldv_57132; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "port pfc_cfg: willing=%d mbc=%d, pfccap=%d pfcenable=0x%x\n", (int )cfg->pfc.willing, (int )cfg->pfc.mbc, (int )cfg->pfc.pfccap, (int )cfg->pfc.pfcenable); _dev_info((struct device const *)(& (pf->pdev)->dev), "port app_table: num_apps=%d\n", cfg->numapps); i___1 = 0; } goto ldv_57136; ldv_57135: { _dev_info((struct device const *)(& (pf->pdev)->dev), "port app_table: %d prio=%d selector=%d protocol=0x%x\n", i___1, (int )cfg->app[i___1].priority, (int )cfg->app[i___1].selector, (int )cfg->app[i___1].protocolid); i___1 = i___1 + 1; } ldv_57136: ; if ((u32 )i___1 < cfg->numapps) { goto ldv_57135; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "remote port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n", (int )r_cfg->etscfg.willing, (int )r_cfg->etscfg.cbs, (int )r_cfg->etscfg.maxtcs); i___1 = 0; } goto ldv_57139; ldv_57138: { _dev_info((struct device const *)(& (pf->pdev)->dev), "remote port ets_cfg: %d prio_tc=%d tcbw=%d tctsa=%d\n", i___1, (int )r_cfg->etscfg.prioritytable[i___1], (int )r_cfg->etscfg.tcbwtable[i___1], (int )r_cfg->etscfg.tsatable[i___1]); i___1 = i___1 + 1; } ldv_57139: ; if (i___1 <= 7) { goto ldv_57138; } else { } i___1 = 0; goto ldv_57142; ldv_57141: { _dev_info((struct device const *)(& (pf->pdev)->dev), "remote port ets_rec: %d prio_tc=%d tcbw=%d tctsa=%d\n", i___1, (int )r_cfg->etsrec.prioritytable[i___1], (int )r_cfg->etsrec.tcbwtable[i___1], (int )r_cfg->etsrec.tsatable[i___1]); i___1 = i___1 + 1; } ldv_57142: ; if (i___1 <= 7) { goto ldv_57141; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "remote port pfc_cfg: willing=%d mbc=%d, pfccap=%d pfcenable=0x%x\n", (int )r_cfg->pfc.willing, (int )r_cfg->pfc.mbc, (int )r_cfg->pfc.pfccap, (int )r_cfg->pfc.pfcenable); _dev_info((struct device const *)(& (pf->pdev)->dev), "remote port app_table: num_apps=%d\n", r_cfg->numapps); i___1 = 0; } goto ldv_57145; ldv_57144: { _dev_info((struct device const *)(& (pf->pdev)->dev), "remote port app_table: %d prio=%d selector=%d protocol=0x%x\n", i___1, (int )r_cfg->app[i___1].priority, (int )r_cfg->app[i___1].selector, (int )r_cfg->app[i___1].protocolid); i___1 = i___1 + 1; } ldv_57145: ; if ((u32 )i___1 < r_cfg->numapps) { goto ldv_57144; } else { } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "dump desc tx [], dump desc rx [],\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), "dump switch, dump vsi [seid] or\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), "dump stats\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), "dump reset stats\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), "dump port\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), "dump debug fwdata \n"); } } } } } } } } } else { { tmp___57 = strncmp((char const *)cmd_buf, "msg_enable", 10UL); } if (tmp___57 == 0) { { cnt = sscanf((char const *)cmd_buf + 10U, "%i", & level); } if (cnt != 0) { if ((level & 4026531840U) != 0U) { { pf->hw.debug_mask = level; _dev_info((struct device const *)(& (pf->pdev)->dev), "set hw.debug_mask = 0x%08x\n", pf->hw.debug_mask); } } else { } { pf->msg_enable = (u16 )level; _dev_info((struct device const *)(& (pf->pdev)->dev), "set msg_enable = 0x%08x\n", (int )pf->msg_enable); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "msg_enable = 0x%08x\n", (int )pf->msg_enable); } } } else { { tmp___56 = strncmp((char const *)cmd_buf, "pfr", 3UL); } if (tmp___56 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "forcing PFR\n"); i40e_do_reset_safe(pf, 4096U); } } else { { tmp___55 = strncmp((char const *)cmd_buf, "corer", 5UL); } if (tmp___55 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "forcing CoreR\n"); i40e_do_reset_safe(pf, 8192U); } } else { { tmp___54 = strncmp((char const *)cmd_buf, "globr", 5UL); } if (tmp___54 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "forcing GlobR\n"); i40e_do_reset_safe(pf, 16384U); } } else { { tmp___53 = strncmp((char const *)cmd_buf, "empr", 4UL); } if (tmp___53 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "forcing EMPR\n"); i40e_do_reset_safe(pf, 32768U); } } else { { tmp___52 = strncmp((char const *)cmd_buf, "read", 4UL); } if (tmp___52 == 0) { { cnt = sscanf((char const *)cmd_buf + 4U, "%i", & address); } if (cnt != 1) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "read \n"); } goto command_write_done; } else { } if (address > 8388607U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "read reg address 0x%08x too large\n", address); } goto command_write_done; } else { } { value = readl((void const volatile *)pf->hw.hw_addr + (unsigned long )address); _dev_info((struct device const *)(& (pf->pdev)->dev), "read: 0x%08x = 0x%08x\n", address, value); } } else { { tmp___51 = strncmp((char const *)cmd_buf, "write", 5UL); } if (tmp___51 == 0) { { cnt = sscanf((char const *)cmd_buf + 5U, "%i %i", & address___0, & value___0); } if (cnt != 2) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "write \n"); } goto command_write_done; } else { } if (address___0 > 8388607U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "write reg address 0x%08x too large\n", address___0); } goto command_write_done; } else { } { writel(value___0, (void volatile *)pf->hw.hw_addr + (unsigned long )address___0); value___0 = readl((void const volatile *)pf->hw.hw_addr + (unsigned long )address___0); _dev_info((struct device const *)(& (pf->pdev)->dev), "write: 0x%08x = 0x%08x\n", address___0, value___0); } } else { { tmp___50 = strncmp((char const *)cmd_buf, "clear_stats", 11UL); } if (tmp___50 == 0) { { tmp___14 = strncmp((char const *)cmd_buf + 12U, "vsi", 3UL); } if (tmp___14 == 0) { { cnt = sscanf((char const *)cmd_buf + 15U, "%i", & vsi_seid); } if (cnt == 0) { i___2 = 0; goto ldv_57154; ldv_57153: { i40e_vsi_reset_stats(*(pf->vsi + (unsigned long )i___2)); i___2 = i___2 + 1; } ldv_57154: ; if ((u32 )i___2 < pf->hw.func_caps.num_vsis) { goto ldv_57153; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "vsi clear stats called for all vsi\'s\n"); } } else if (cnt == 1) { { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "clear_stats vsi: bad vsi %d\n", vsi_seid); } goto command_write_done; } else { } { i40e_vsi_reset_stats(vsi); _dev_info((struct device const *)(& (pf->pdev)->dev), "vsi clear stats called for vsi %d\n", vsi_seid); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "clear_stats vsi [seid]\n"); } } } else { { tmp___13 = strncmp((char const *)cmd_buf + 12U, "pf", 2UL); } if (tmp___13 == 0) { { i40e_pf_reset_stats(pf); _dev_info((struct device const *)(& (pf->pdev)->dev), "pf clear stats called\n"); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "clear_stats vsi [seid] or clear_stats pf\n"); } } } } else { { tmp___49 = strncmp((char const *)cmd_buf, "send aq_cmd", 11UL); } if (tmp___49 == 0) { { tmp___15 = kzalloc(32UL, 208U); desc = (struct i40e_aq_desc *)tmp___15; } if ((unsigned long )desc == (unsigned long )((struct i40e_aq_desc *)0)) { goto command_write_done; } else { } { cnt = sscanf((char const *)cmd_buf + 11U, "%hx %hx %hx %hx %x %x %x %x %x %x", & desc->flags, & desc->opcode, & desc->datalen, & desc->retval, & desc->cookie_high, & desc->cookie_low, & desc->params.internal.param0, & desc->params.internal.param1, & desc->params.internal.param2, & desc->params.internal.param3); } if (cnt != 10) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "send aq_cmd: bad command string, cnt=%d\n", cnt); kfree((void const *)desc); desc = (struct i40e_aq_desc *)0; } goto command_write_done; } else { } { ret___3 = i40e_asq_send_command(& pf->hw, desc, (void *)0, 0, (struct i40e_asq_cmd_details *)0); } if ((int )ret___3 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "AQ command sent Status : Success\n"); } } else if ((int )ret___3 == -53) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "AQ command send failed Opcode %x AQ Error: %d\n", (int )desc->opcode, (unsigned int )pf->hw.aq.asq_last_status); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "AQ command send failed Opcode %x Status: %d\n", (int )desc->opcode, (int )ret___3); } } { _dev_info((struct device const *)(& (pf->pdev)->dev), "AQ desc WB 0x%04x 0x%04x 0x%04x 0x%04x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", (int )desc->flags, (int )desc->opcode, (int )desc->datalen, (int )desc->retval, desc->cookie_high, desc->cookie_low, desc->params.internal.param0, desc->params.internal.param1, desc->params.internal.param2, desc->params.internal.param3); kfree((void const *)desc); desc = (struct i40e_aq_desc *)0; } } else { { tmp___48 = strncmp((char const *)cmd_buf, "send indirect aq_cmd", 20UL); } if (tmp___48 == 0) { { tmp___16 = kzalloc(32UL, 208U); desc___0 = (struct i40e_aq_desc *)tmp___16; } if ((unsigned long )desc___0 == (unsigned long )((struct i40e_aq_desc *)0)) { goto command_write_done; } else { } { cnt = sscanf((char const *)cmd_buf + 20U, "%hx %hx %hx %hx %x %x %x %x %x %x %hd", & desc___0->flags, & desc___0->opcode, & desc___0->datalen, & desc___0->retval, & desc___0->cookie_high, & desc___0->cookie_low, & desc___0->params.internal.param0, & desc___0->params.internal.param1, & desc___0->params.internal.param2, & desc___0->params.internal.param3, & buffer_len); } if (cnt != 11) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "send indirect aq_cmd: bad command string, cnt=%d\n", cnt); kfree((void const *)desc___0); desc___0 = (struct i40e_aq_desc *)0; } goto command_write_done; } else { } if ((unsigned int )buffer_len == 0U) { buffer_len = 1280U; } else { } { tmp___17 = kzalloc((size_t )buffer_len, 208U); buff = (u8 *)tmp___17; } if ((unsigned long )buff == (unsigned long )((u8 *)0U)) { { kfree((void const *)desc___0); desc___0 = (struct i40e_aq_desc *)0; } goto command_write_done; } else { } { desc___0->flags = (__le16 )((unsigned int )desc___0->flags | 4096U); ret___4 = i40e_asq_send_command(& pf->hw, desc___0, (void *)buff, (int )buffer_len, (struct i40e_asq_cmd_details *)0); } if ((int )ret___4 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "AQ command sent Status : Success\n"); } } else if ((int )ret___4 == -53) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "AQ command send failed Opcode %x AQ Error: %d\n", (int )desc___0->opcode, (unsigned int )pf->hw.aq.asq_last_status); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "AQ command send failed Opcode %x Status: %d\n", (int )desc___0->opcode, (int )ret___4); } } { _dev_info((struct device const *)(& (pf->pdev)->dev), "AQ desc WB 0x%04x 0x%04x 0x%04x 0x%04x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", (int )desc___0->flags, (int )desc___0->opcode, (int )desc___0->datalen, (int )desc___0->retval, desc___0->cookie_high, desc___0->cookie_low, desc___0->params.internal.param0, desc___0->params.internal.param1, desc___0->params.internal.param2, desc___0->params.internal.param3); print_hex_dump("\016", "AQ buffer WB: ", 2, 16, 1, (void const *)buff, (size_t )buffer_len, 1); kfree((void const *)buff); buff = (u8 *)0U; kfree((void const *)desc___0); desc___0 = (struct i40e_aq_desc *)0; } } else { { tmp___46 = strncmp((char const *)cmd_buf, "add fd_filter", 13UL); } if (tmp___46 == 0) { goto _L; } else { { tmp___47 = strncmp((char const *)cmd_buf, "rem fd_filter", 13UL); } if (tmp___47 == 0) { _L: /* CIL Label */ { j = 0U; add = 0; tmp___18 = kzalloc(512UL, 208U); asc_packet = (char *)tmp___18; } if ((unsigned long )asc_packet == (unsigned long )((char *)0)) { goto command_write_done; } else { } { tmp___19 = kzalloc(512UL, 208U); fd_data.raw_packet = (u8 *)tmp___19; } if ((unsigned long )fd_data.raw_packet == (unsigned long )((u8 *)0U)) { { kfree((void const *)asc_packet); asc_packet = (char *)0; } goto command_write_done; } else { } { tmp___20 = strncmp((char const *)cmd_buf, "add", 3UL); } if (tmp___20 == 0) { add = 1; } else { } { cnt = sscanf((char const *)cmd_buf + 13U, "%hx %2hhx %2hhx %hx %2hhx %2hhx %hx %x %hd %511s", & fd_data.q_index, & fd_data.flex_off, & fd_data.pctype, & fd_data.dest_vsi, & fd_data.dest_ctl, & fd_data.fd_status, & fd_data.cnt_index, & fd_data.fd_id, & packet_len, asc_packet); } if (cnt != 10) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "program fd_filter: bad command string, cnt=%d\n", cnt); kfree((void const *)asc_packet); asc_packet = (char *)0; kfree((void const *)fd_data.raw_packet); } goto command_write_done; } else { } if ((unsigned int )packet_len == 0U) { packet_len = 512U; } else { } __min1 = packet_len; __min2 = 512U; packet_len = (u16 )((int )__min1 < (int )__min2 ? __min1 : __min2); i___3 = 0U; goto ldv_57173; ldv_57172: { sscanf((char const *)asc_packet + (unsigned long )j, "%2hhx ", fd_data.raw_packet + (unsigned long )i___3); j = (unsigned int )j + 3U; i___3 = (u16 )((int )i___3 + 1); } ldv_57173: ; if ((int )i___3 < (int )packet_len) { goto ldv_57172; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "FD raw packet dump\n"); print_hex_dump("\016", "FD raw packet: ", 2, 16, 1, (void const *)fd_data.raw_packet, (size_t )packet_len, 1); ret___5 = i40e_program_fdir_filter(& fd_data, pf, (int )add); } if (ret___5 == 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter command send Status : Success\n"); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Filter command send failed %d\n", ret___5); } } { kfree((void const *)fd_data.raw_packet); fd_data.raw_packet = (u8 *)0U; kfree((void const *)asc_packet); asc_packet = (char *)0; } } else { { tmp___45 = strncmp((char const *)cmd_buf, "fd-atr off", 10UL); } if (tmp___45 == 0) { { i40e_dbg_cmd_fd_ctrl(pf, 4194304ULL, 0); } } else { { tmp___44 = strncmp((char const *)cmd_buf, "fd-atr on", 9UL); } if (tmp___44 == 0) { { i40e_dbg_cmd_fd_ctrl(pf, 4194304ULL, 1); } } else { { tmp___43 = strncmp((char const *)cmd_buf, "fd-sb off", 9UL); } if (tmp___43 == 0) { { i40e_dbg_cmd_fd_ctrl(pf, 2097152ULL, 0); } } else { { tmp___42 = strncmp((char const *)cmd_buf, "fd-sb on", 8UL); } if (tmp___42 == 0) { { i40e_dbg_cmd_fd_ctrl(pf, 2097152ULL, 1); } } else { { tmp___41 = strncmp((char const *)cmd_buf, "lldp", 4UL); } if (tmp___41 == 0) { { tmp___36 = strncmp((char const *)cmd_buf + 5U, "stop", 4UL); } if (tmp___36 == 0) { { tmp___21 = i40e_aq_stop_lldp(& pf->hw, 0, (struct i40e_asq_cmd_details *)0); ret___6 = (int )tmp___21; } if (ret___6 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Stop LLDP AQ command failed =0x%x\n", (unsigned int )pf->hw.aq.asq_last_status); } goto command_write_done; } else { } { tmp___22 = i40e_aq_add_rem_control_packet_filter(& pf->hw, (u8 *)(& pf->hw.mac.addr), 35020, 0, (int )(*(pf->vsi + (unsigned long )pf->lan_vsi))->seid, 0, 1, (struct i40e_control_filter_stats *)0, (struct i40e_asq_cmd_details *)0); ret___6 = (int )tmp___22; } if (ret___6 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: Add Control Packet Filter AQ command failed =0x%x\n", "i40e_dbg_command_write", (unsigned int )pf->hw.aq.asq_last_status); } goto command_write_done; } else { } pf->dcbx_cap = 9U; } else { { tmp___35 = strncmp((char const *)cmd_buf + 5U, "start", 5UL); } if (tmp___35 == 0) { { tmp___23 = i40e_aq_add_rem_control_packet_filter(& pf->hw, (u8 *)(& pf->hw.mac.addr), 35020, 0, (int )(*(pf->vsi + (unsigned long )pf->lan_vsi))->seid, 0, 0, (struct i40e_control_filter_stats *)0, (struct i40e_asq_cmd_details *)0); ret___7 = (int )tmp___23; } if (ret___7 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: Remove Control Packet Filter AQ command failed =0x%x\n", "i40e_dbg_command_write", (unsigned int )pf->hw.aq.asq_last_status); } } else { } { tmp___24 = i40e_aq_start_lldp(& pf->hw, (struct i40e_asq_cmd_details *)0); ret___7 = (int )tmp___24; } if (ret___7 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Start LLDP AQ command failed =0x%x\n", (unsigned int )pf->hw.aq.asq_last_status); } goto command_write_done; } else { } pf->dcbx_cap = 10U; } else { { tmp___34 = strncmp((char const *)cmd_buf + 5U, "get local", 9UL); } if (tmp___34 == 0) { { tmp___25 = kzalloc(1500UL, 208U); buff___0 = (u8 *)tmp___25; } if ((unsigned long )buff___0 == (unsigned long )((u8 *)0U)) { goto command_write_done; } else { } { tmp___26 = i40e_aq_get_lldp_mib(& pf->hw, 0, 0, (void *)buff___0, 1500, & llen, & rlen, (struct i40e_asq_cmd_details *)0); ret___8 = (int )tmp___26; } if (ret___8 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Get LLDP MIB (local) AQ command failed =0x%x\n", (unsigned int )pf->hw.aq.asq_last_status); kfree((void const *)buff___0); buff___0 = (u8 *)0U; } goto command_write_done; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "LLDP MIB (local)\n"); print_hex_dump("\016", "LLDP MIB (local): ", 2, 16, 1, (void const *)buff___0, 1500UL, 1); kfree((void const *)buff___0); buff___0 = (u8 *)0U; } } else { { tmp___33 = strncmp((char const *)cmd_buf + 5U, "get remote", 10UL); } if (tmp___33 == 0) { { tmp___27 = kzalloc(1500UL, 208U); buff___1 = (u8 *)tmp___27; } if ((unsigned long )buff___1 == (unsigned long )((u8 *)0U)) { goto command_write_done; } else { } { tmp___28 = i40e_aq_get_lldp_mib(& pf->hw, 0, 0, (void *)buff___1, 1500, & llen___0, & rlen___0, (struct i40e_asq_cmd_details *)0); ret___9 = (int )tmp___28; } if (ret___9 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Get LLDP MIB (remote) AQ command failed =0x%x\n", (unsigned int )pf->hw.aq.asq_last_status); kfree((void const *)buff___1); buff___1 = (u8 *)0U; } goto command_write_done; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "LLDP MIB (remote)\n"); print_hex_dump("\016", "LLDP MIB (remote): ", 2, 16, 1, (void const *)buff___1, 1500UL, 1); kfree((void const *)buff___1); buff___1 = (u8 *)0U; } } else { { tmp___32 = strncmp((char const *)cmd_buf + 5U, "event on", 8UL); } if (tmp___32 == 0) { { tmp___29 = i40e_aq_cfg_lldp_mib_change_event(& pf->hw, 1, (struct i40e_asq_cmd_details *)0); ret___10 = (int )tmp___29; } if (ret___10 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Config LLDP MIB Change Event (on) AQ command failed =0x%x\n", (unsigned int )pf->hw.aq.asq_last_status); } goto command_write_done; } else { } } else { { tmp___31 = strncmp((char const *)cmd_buf + 5U, "event off", 9UL); } if (tmp___31 == 0) { { tmp___30 = i40e_aq_cfg_lldp_mib_change_event(& pf->hw, 0, (struct i40e_asq_cmd_details *)0); ret___11 = (int )tmp___30; } if (ret___11 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Config LLDP MIB Change Event (off) AQ command failed =0x%x\n", (unsigned int )pf->hw.aq.asq_last_status); } goto command_write_done; } else { } } else { } } } } } } } else { { tmp___40 = strncmp((char const *)cmd_buf, "nvm read", 8UL); } if (tmp___40 == 0) { { cnt = sscanf((char const *)cmd_buf + 8U, "%hx %x %hx", & module, & offset, & buffer_len___0); } if (cnt == 0) { module = 0U; offset = 0U; buffer_len___0 = 0U; } else if (cnt == 1) { offset = 0U; buffer_len___0 = 0U; } else if (cnt == 2) { buffer_len___0 = 0U; } else if (cnt > 3) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "nvm read: bad command string, cnt=%d\n", cnt); } goto command_write_done; } else { } { __min1___0 = buffer_len___0; __min2___0 = 2048U; buffer_len___0 = (u16 )((int )__min1___0 < (int )__min2___0 ? __min1___0 : __min2___0); bytes = (unsigned int )buffer_len___0 * 2U; __val = bytes; __min = 1024U; __max = 4096U; __val = (int )__min > (int )__val ? __min : __val; bytes = (u16 )((int )__val > (int )__max ? (int )__max : (int )__val); tmp___37 = kzalloc((size_t )bytes, 208U); buff___2 = (u16 *)tmp___37; } if ((unsigned long )buff___2 == (unsigned long )((u16 *)0U)) { goto command_write_done; } else { } { tmp___38 = i40e_acquire_nvm(& pf->hw, 1); ret___12 = (int )tmp___38; } if (ret___12 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Failed Acquiring NVM resource for read err=%d status=0x%x\n", ret___12, (unsigned int )pf->hw.aq.asq_last_status); kfree((void const *)buff___2); } goto command_write_done; } else { } { tmp___39 = i40e_aq_read_nvm(& pf->hw, (int )((u8 )module), offset * 2U, (int )bytes, (void *)buff___2, 1, (struct i40e_asq_cmd_details *)0); ret___12 = (int )tmp___39; i40e_release_nvm(& pf->hw); } if (ret___12 != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Read NVM AQ failed err=%d status=0x%x\n", ret___12, (unsigned int )pf->hw.aq.asq_last_status); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Read NVM module=0x%x offset=0x%x words=%d\n", (int )module, offset, (int )buffer_len___0); } if ((unsigned int )bytes != 0U) { { print_hex_dump("\016", "NVM Dump: ", 2, 16, 2, (void const *)buff___2, (size_t )bytes, 1); } } else { } } { kfree((void const *)buff___2); buff___2 = (u16 *)0U; } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "unknown command \'%s\'\n", cmd_buf); _dev_info((struct device const *)(& (pf->pdev)->dev), "available commands\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " add vsi [relay_seid]\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " del vsi [vsi_seid]\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " add relay \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " del relay \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " add macaddr [vlan]\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " del macaddr [vlan]\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " add pvid \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " del pvid \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " dump switch\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " dump vsi [seid]\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " dump desc tx []\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " dump desc rx []\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " dump desc aq\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " dump stats\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " dump reset stats\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " msg_enable [level]\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " read \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " write \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " clear_stats vsi [seid]\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " clear_stats pf\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " pfr\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " corer\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " globr\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " send aq_cmd \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " send indirect aq_cmd \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " add fd_filter \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " rem fd_filter \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " fd-atr off\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " fd-atr on\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " fd-sb off\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " fd-sb on\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " lldp start\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " lldp stop\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " lldp get local\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " lldp get remote\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " lldp event on\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " lldp event off\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " nvm read [module] [word_offset] [word_count]\n"); } } } } } } } } } } } } } } } } } } } } } } } } } } } } command_write_done: { kfree((void const *)cmd_buf); cmd_buf = (char *)0; } return ((ssize_t )count); } } static struct file_operations const i40e_dbg_command_fops = {& __this_module, 0, & i40e_dbg_command_read, & i40e_dbg_command_write, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static char i40e_dbg_netdev_ops_buf[256U] = { 'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '\000'}; static ssize_t i40e_dbg_netdev_ops_read(struct file *filp , char *buffer , size_t count , loff_t *ppos ) { struct i40e_pf *pf ; int bytes_not_copied ; int buf_size ; char *buf ; int len ; void *tmp ; unsigned long tmp___0 ; { pf = (struct i40e_pf *)filp->private_data; buf_size = 256; if (*ppos != 0LL) { return (0L); } else { } if (count < (size_t )buf_size) { return (-28L); } else { } { tmp = kzalloc((size_t )buf_size, 208U); buf = (char *)tmp; } if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-28L); } else { } { len = snprintf(buf, (size_t )buf_size, "%s: %s\n", (char *)(& ((*(pf->vsi + (unsigned long )pf->lan_vsi))->netdev)->name), (char *)(& i40e_dbg_netdev_ops_buf)); tmp___0 = copy_to_user((void *)buffer, (void const *)buf, (unsigned long )len); bytes_not_copied = (int )tmp___0; kfree((void const *)buf); } if (bytes_not_copied < 0) { return ((ssize_t )bytes_not_copied); } else { } *ppos = (loff_t )len; return ((ssize_t )len); } } static ssize_t i40e_dbg_netdev_ops_write(struct file *filp , char const *buffer , size_t count , loff_t *ppos ) { struct i40e_pf *pf ; int bytes_not_copied ; struct i40e_vsi *vsi ; char *buf_tmp ; int vsi_seid ; int i ; int cnt ; unsigned long tmp ; int tmp___0 ; int mtu ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; { pf = (struct i40e_pf *)filp->private_data; if (*ppos != 0LL) { return (0L); } else { } if (count > 255UL) { return (-28L); } else { } { memset((void *)(& i40e_dbg_netdev_ops_buf), 0, 256UL); tmp = copy_from_user((void *)(& i40e_dbg_netdev_ops_buf), (void const *)buffer, count); bytes_not_copied = (int )tmp; } if (bytes_not_copied < 0) { return ((ssize_t )bytes_not_copied); } else if (bytes_not_copied > 0) { count = count - (size_t )bytes_not_copied; } else { } { i40e_dbg_netdev_ops_buf[count] = 0; buf_tmp = strchr((char const *)(& i40e_dbg_netdev_ops_buf), 10); } if ((unsigned long )buf_tmp != (unsigned long )((char *)0)) { *buf_tmp = 0; count = (size_t )((long )buf_tmp + (1L - (long )(& i40e_dbg_netdev_ops_buf))); } else { } { tmp___6 = strncmp((char const *)(& i40e_dbg_netdev_ops_buf), "tx_timeout", 10UL); } if (tmp___6 == 0) { { cnt = sscanf((char const *)(& i40e_dbg_netdev_ops_buf) + 11U, "%i", & vsi_seid); } if (cnt != 1) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "tx_timeout \n"); } goto netdev_ops_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "tx_timeout: VSI %d not found\n", vsi_seid); } goto netdev_ops_write_done; } else { } { tmp___0 = rtnl_trylock(); } if (tmp___0 != 0) { { (*(((vsi->netdev)->netdev_ops)->ndo_tx_timeout))(vsi->netdev); rtnl_unlock(); _dev_info((struct device const *)(& (pf->pdev)->dev), "tx_timeout called\n"); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Could not acquire RTNL - please try again\n"); } } } else { { tmp___5 = strncmp((char const *)(& i40e_dbg_netdev_ops_buf), "change_mtu", 10UL); } if (tmp___5 == 0) { { cnt = sscanf((char const *)(& i40e_dbg_netdev_ops_buf) + 11U, "%i %i", & vsi_seid, & mtu); } if (cnt != 2) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "change_mtu \n"); } goto netdev_ops_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "change_mtu: VSI %d not found\n", vsi_seid); } goto netdev_ops_write_done; } else { } { tmp___1 = rtnl_trylock(); } if (tmp___1 != 0) { { (*(((vsi->netdev)->netdev_ops)->ndo_change_mtu))(vsi->netdev, mtu); rtnl_unlock(); _dev_info((struct device const *)(& (pf->pdev)->dev), "change_mtu called\n"); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Could not acquire RTNL - please try again\n"); } } } else { { tmp___4 = strncmp((char const *)(& i40e_dbg_netdev_ops_buf), "set_rx_mode", 11UL); } if (tmp___4 == 0) { { cnt = sscanf((char const *)(& i40e_dbg_netdev_ops_buf) + 11U, "%i", & vsi_seid); } if (cnt != 1) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "set_rx_mode \n"); } goto netdev_ops_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "set_rx_mode: VSI %d not found\n", vsi_seid); } goto netdev_ops_write_done; } else { } { tmp___2 = rtnl_trylock(); } if (tmp___2 != 0) { { (*(((vsi->netdev)->netdev_ops)->ndo_set_rx_mode))(vsi->netdev); rtnl_unlock(); _dev_info((struct device const *)(& (pf->pdev)->dev), "set_rx_mode called\n"); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Could not acquire RTNL - please try again\n"); } } } else { { tmp___3 = strncmp((char const *)(& i40e_dbg_netdev_ops_buf), "napi", 4UL); } if (tmp___3 == 0) { { cnt = sscanf((char const *)(& i40e_dbg_netdev_ops_buf) + 4U, "%i", & vsi_seid); } if (cnt != 1) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "napi \n"); } goto netdev_ops_write_done; } else { } { vsi = i40e_dbg_find_vsi(pf, vsi_seid); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "napi: VSI %d not found\n", vsi_seid); } goto netdev_ops_write_done; } else { } i = 0; goto ldv_57230; ldv_57229: { napi_schedule(& (*(vsi->q_vectors + (unsigned long )i))->napi); i = i + 1; } ldv_57230: ; if (i < vsi->num_q_vectors) { goto ldv_57229; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "napi called\n"); } } else { { _dev_info((struct device const *)(& (pf->pdev)->dev), "unknown command \'%s\'\n", (char *)(& i40e_dbg_netdev_ops_buf)); _dev_info((struct device const *)(& (pf->pdev)->dev), "available commands\n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " tx_timeout \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " change_mtu \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " set_rx_mode \n"); _dev_info((struct device const *)(& (pf->pdev)->dev), " napi \n"); } } } } } netdev_ops_write_done: ; return ((ssize_t )count); } } static struct file_operations const i40e_dbg_netdev_ops_fops = {& __this_module, 0, & i40e_dbg_netdev_ops_read, & i40e_dbg_netdev_ops_write, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void i40e_dbg_pf_init(struct i40e_pf *pf ) { struct dentry *pfile ; char const *name ; char const *tmp ; struct device const *dev ; { { tmp = pci_name((struct pci_dev const *)pf->pdev); name = tmp; dev = (struct device const *)(& (pf->pdev)->dev); pf->i40e_dbg_pf = debugfs_create_dir(name, i40e_dbg_root); } if ((unsigned long )pf->i40e_dbg_pf == (unsigned long )((struct dentry *)0)) { return; } else { } { pfile = debugfs_create_file("command", 384, pf->i40e_dbg_pf, (void *)pf, & i40e_dbg_command_fops); } if ((unsigned long )pfile == (unsigned long )((struct dentry *)0)) { goto create_failed; } else { } { pfile = debugfs_create_file("dump", 384, pf->i40e_dbg_pf, (void *)pf, & i40e_dbg_dump_fops); } if ((unsigned long )pfile == (unsigned long )((struct dentry *)0)) { goto create_failed; } else { } { pfile = debugfs_create_file("netdev_ops", 384, pf->i40e_dbg_pf, (void *)pf, & i40e_dbg_netdev_ops_fops); } if ((unsigned long )pfile == (unsigned long )((struct dentry *)0)) { goto create_failed; } else { } return; create_failed: { _dev_info(dev, "debugfs dir/file for %s failed\n", name); debugfs_remove_recursive(pf->i40e_dbg_pf); } return; } } void i40e_dbg_pf_exit(struct i40e_pf *pf ) { { { debugfs_remove_recursive(pf->i40e_dbg_pf); pf->i40e_dbg_pf = (struct dentry *)0; kfree((void const *)i40e_dbg_dump_buf); i40e_dbg_dump_buf = (char *)0; } return; } } void i40e_dbg_init(void) { { { i40e_dbg_root = debugfs_create_dir((char const *)(& i40e_driver_name), (struct dentry *)0); } if ((unsigned long )i40e_dbg_root == (unsigned long )((struct dentry *)0)) { { printk("\016init of debugfs failed\n"); } } else { } return; } } void i40e_dbg_exit(void) { { { debugfs_remove_recursive(i40e_dbg_root); i40e_dbg_root = (struct dentry *)0; } return; } } void ldv_file_operations_instance_callback_0_5(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; void ldv_file_operations_instance_callback_1_5(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; void ldv_file_operations_instance_callback_2_5(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; int ldv_file_operations_instance_probe_0_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; int ldv_file_operations_instance_probe_1_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; int ldv_file_operations_instance_probe_2_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; void ldv_file_operations_instance_write_0_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; void ldv_file_operations_instance_write_1_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; void ldv_file_operations_instance_write_2_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; long (*ldv_0_callback_read)(struct file * , char * , unsigned long , long long * ) ; struct file_operations *ldv_0_container_file_operations ; long (*ldv_1_callback_read)(struct file * , char * , unsigned long , long long * ) ; struct file_operations *ldv_1_container_file_operations ; long (*ldv_2_callback_read)(struct file * , char * , unsigned long , long long * ) ; struct file_operations *ldv_2_container_file_operations ; int ldv_statevar_0 ; int ldv_statevar_1 ; int ldv_statevar_2 ; long (*ldv_0_callback_read)(struct file * , char * , unsigned long , long long * ) = & i40e_dbg_command_read; long (*ldv_1_callback_read)(struct file * , char * , unsigned long , long long * ) = & i40e_dbg_dump_read; long (*ldv_2_callback_read)(struct file * , char * , unsigned long , long long * ) = & i40e_dbg_netdev_ops_read; void ldv_file_operations_file_operations_instance_0(void *arg0 ) { int tmp ; int tmp___0 ; int tmp___1 ; void *tmp___2 ; void *tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; void *tmp___7 ; void *tmp___8 ; void *tmp___9 ; { { if (ldv_statevar_0 == 1) { goto case_1; } else { } if (ldv_statevar_0 == 2) { goto case_2; } else { } if (ldv_statevar_0 == 3) { goto case_3; } else { } if (ldv_statevar_0 == 7) { goto case_7; } else { } if (ldv_statevar_0 == 9) { goto case_9; } else { } if (ldv_statevar_0 == 11) { goto case_11; } else { } if (ldv_statevar_0 == 12) { goto case_12; } else { } if (ldv_statevar_0 == 14) { goto case_14; } else { } if (ldv_statevar_0 == 15) { goto case_15; } else { } if (ldv_statevar_0 == 18) { goto case_18; } else { } if (ldv_statevar_0 == 20) { goto case_20; } else { } goto switch_default; case_1: /* CIL Label */ { tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_0 = 7; } else { ldv_statevar_0 = 12; } goto ldv_57421; case_2: /* CIL Label */ ldv_statevar_0 = 1; goto ldv_57421; case_3: /* CIL Label */ { ldv_statevar_0 = ldv_switch_0(); } goto ldv_57421; case_7: /* CIL Label */ { ldv_free((void *)ldv_0_resource_file); ldv_free((void *)ldv_0_resource_inode); ldv_0_ret_default = 1; ldv_statevar_0 = 15; } goto ldv_57421; case_9: /* CIL Label */ { ldv_assume(ldv_0_ret_default != 0); tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { ldv_statevar_0 = 7; } else { ldv_statevar_0 = 12; } goto ldv_57421; case_11: /* CIL Label */ { ldv_assume(ldv_0_ret_default == 0); ldv_statevar_0 = ldv_switch_0(); } goto ldv_57421; case_12: /* CIL Label */ { ldv_0_ret_default = ldv_file_operations_instance_probe_0_12(ldv_0_container_file_operations->open, ldv_0_resource_inode, ldv_0_resource_file); ldv_0_ret_default = ldv_filter_err_code(ldv_0_ret_default); tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { ldv_statevar_0 = 9; } else { ldv_statevar_0 = 11; } goto ldv_57421; case_14: /* CIL Label */ { tmp___2 = ldv_xmalloc(520UL); ldv_0_resource_file = (struct file *)tmp___2; tmp___3 = ldv_xmalloc(1032UL); ldv_0_resource_inode = (struct inode *)tmp___3; tmp___4 = ldv_undef_int(); ldv_0_size_cnt_write_size = (unsigned long )tmp___4; tmp___5 = ldv_undef_int(); } if (tmp___5 != 0) { ldv_statevar_0 = 7; } else { ldv_statevar_0 = 12; } goto ldv_57421; case_15: /* CIL Label */ ; goto ldv_57421; case_18: /* CIL Label */ { tmp___6 = ldv_xmalloc(1UL); ldv_0_ldv_param_4_1_default = (char *)tmp___6; tmp___7 = ldv_xmalloc(8UL); ldv_0_ldv_param_4_3_default = (long long *)tmp___7; ldv_assume((((ldv_statevar_5 == 2 || ldv_statevar_6 == 2) || ldv_statevar_7 == 2) || ldv_statevar_8 == 5) || ldv_statevar_8 == 1); ldv_assume(ldv_0_size_cnt_write_size <= 2147479552UL); ldv_file_operations_instance_write_0_4((long (*)(struct file * , char * , unsigned long , long long * ))ldv_0_container_file_operations->write, ldv_0_resource_file, ldv_0_ldv_param_4_1_default, ldv_0_size_cnt_write_size, ldv_0_ldv_param_4_3_default); ldv_free((void *)ldv_0_ldv_param_4_1_default); ldv_free((void *)ldv_0_ldv_param_4_3_default); ldv_statevar_0 = 3; } goto ldv_57421; case_20: /* CIL Label */ { tmp___8 = ldv_xmalloc(1UL); ldv_0_ldv_param_5_1_default = (char *)tmp___8; tmp___9 = ldv_xmalloc(8UL); ldv_0_ldv_param_5_3_default = (long long *)tmp___9; ldv_file_operations_instance_callback_0_5(ldv_0_callback_read, ldv_0_resource_file, ldv_0_ldv_param_5_1_default, ldv_0_size_cnt_write_size, ldv_0_ldv_param_5_3_default); ldv_free((void *)ldv_0_ldv_param_5_1_default); ldv_free((void *)ldv_0_ldv_param_5_3_default); ldv_statevar_0 = 3; } goto ldv_57421; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_57421: ; return; } } void ldv_file_operations_file_operations_instance_1(void *arg0 ) { int tmp ; int tmp___0 ; int tmp___1 ; void *tmp___2 ; void *tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; void *tmp___7 ; void *tmp___8 ; void *tmp___9 ; { { if (ldv_statevar_1 == 1) { goto case_1; } else { } if (ldv_statevar_1 == 2) { goto case_2; } else { } if (ldv_statevar_1 == 3) { goto case_3; } else { } if (ldv_statevar_1 == 7) { goto case_7; } else { } if (ldv_statevar_1 == 9) { goto case_9; } else { } if (ldv_statevar_1 == 11) { goto case_11; } else { } if (ldv_statevar_1 == 12) { goto case_12; } else { } if (ldv_statevar_1 == 14) { goto case_14; } else { } if (ldv_statevar_1 == 15) { goto case_15; } else { } if (ldv_statevar_1 == 18) { goto case_18; } else { } if (ldv_statevar_1 == 20) { goto case_20; } else { } goto switch_default; case_1: /* CIL Label */ { tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_1 = 7; } else { ldv_statevar_1 = 12; } goto ldv_57437; case_2: /* CIL Label */ ldv_statevar_1 = 1; goto ldv_57437; case_3: /* CIL Label */ { ldv_statevar_1 = ldv_switch_0(); } goto ldv_57437; case_7: /* CIL Label */ { ldv_free((void *)ldv_1_resource_file); ldv_free((void *)ldv_1_resource_inode); ldv_1_ret_default = 1; ldv_statevar_1 = 15; } goto ldv_57437; case_9: /* CIL Label */ { ldv_assume(ldv_1_ret_default != 0); tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { ldv_statevar_1 = 7; } else { ldv_statevar_1 = 12; } goto ldv_57437; case_11: /* CIL Label */ { ldv_assume(ldv_1_ret_default == 0); ldv_statevar_1 = ldv_switch_0(); } goto ldv_57437; case_12: /* CIL Label */ { ldv_1_ret_default = ldv_file_operations_instance_probe_1_12(ldv_1_container_file_operations->open, ldv_1_resource_inode, ldv_1_resource_file); ldv_1_ret_default = ldv_filter_err_code(ldv_1_ret_default); tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { ldv_statevar_1 = 9; } else { ldv_statevar_1 = 11; } goto ldv_57437; case_14: /* CIL Label */ { tmp___2 = ldv_xmalloc(520UL); ldv_1_resource_file = (struct file *)tmp___2; tmp___3 = ldv_xmalloc(1032UL); ldv_1_resource_inode = (struct inode *)tmp___3; tmp___4 = ldv_undef_int(); ldv_1_size_cnt_write_size = (unsigned long )tmp___4; tmp___5 = ldv_undef_int(); } if (tmp___5 != 0) { ldv_statevar_1 = 7; } else { ldv_statevar_1 = 12; } goto ldv_57437; case_15: /* CIL Label */ ; goto ldv_57437; case_18: /* CIL Label */ { tmp___6 = ldv_xmalloc(1UL); ldv_1_ldv_param_4_1_default = (char *)tmp___6; tmp___7 = ldv_xmalloc(8UL); ldv_1_ldv_param_4_3_default = (long long *)tmp___7; ldv_assume(ldv_1_size_cnt_write_size <= 2147479552UL); ldv_file_operations_instance_write_1_4((long (*)(struct file * , char * , unsigned long , long long * ))ldv_1_container_file_operations->write, ldv_1_resource_file, ldv_1_ldv_param_4_1_default, ldv_1_size_cnt_write_size, ldv_1_ldv_param_4_3_default); ldv_free((void *)ldv_1_ldv_param_4_1_default); ldv_free((void *)ldv_1_ldv_param_4_3_default); ldv_statevar_1 = 3; } goto ldv_57437; case_20: /* CIL Label */ { tmp___8 = ldv_xmalloc(1UL); ldv_1_ldv_param_5_1_default = (char *)tmp___8; tmp___9 = ldv_xmalloc(8UL); ldv_1_ldv_param_5_3_default = (long long *)tmp___9; ldv_file_operations_instance_callback_1_5(ldv_1_callback_read, ldv_1_resource_file, ldv_1_ldv_param_5_1_default, ldv_1_size_cnt_write_size, ldv_1_ldv_param_5_3_default); ldv_free((void *)ldv_1_ldv_param_5_1_default); ldv_free((void *)ldv_1_ldv_param_5_3_default); ldv_statevar_1 = 3; } goto ldv_57437; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_57437: ; return; } } void ldv_file_operations_file_operations_instance_2(void *arg0 ) { int tmp ; int tmp___0 ; int tmp___1 ; void *tmp___2 ; void *tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; void *tmp___7 ; void *tmp___8 ; void *tmp___9 ; { { if (ldv_statevar_2 == 1) { goto case_1; } else { } if (ldv_statevar_2 == 2) { goto case_2; } else { } if (ldv_statevar_2 == 3) { goto case_3; } else { } if (ldv_statevar_2 == 7) { goto case_7; } else { } if (ldv_statevar_2 == 9) { goto case_9; } else { } if (ldv_statevar_2 == 11) { goto case_11; } else { } if (ldv_statevar_2 == 12) { goto case_12; } else { } if (ldv_statevar_2 == 14) { goto case_14; } else { } if (ldv_statevar_2 == 15) { goto case_15; } else { } if (ldv_statevar_2 == 18) { goto case_18; } else { } if (ldv_statevar_2 == 20) { goto case_20; } else { } goto switch_default; case_1: /* CIL Label */ { tmp = ldv_undef_int(); } if (tmp != 0) { ldv_statevar_2 = 7; } else { ldv_statevar_2 = 12; } goto ldv_57453; case_2: /* CIL Label */ ldv_statevar_2 = 1; goto ldv_57453; case_3: /* CIL Label */ { ldv_statevar_2 = ldv_switch_0(); } goto ldv_57453; case_7: /* CIL Label */ { ldv_free((void *)ldv_2_resource_file); ldv_free((void *)ldv_2_resource_inode); ldv_2_ret_default = 1; ldv_statevar_2 = 15; } goto ldv_57453; case_9: /* CIL Label */ { ldv_assume(ldv_2_ret_default != 0); tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { ldv_statevar_2 = 7; } else { ldv_statevar_2 = 12; } goto ldv_57453; case_11: /* CIL Label */ { ldv_assume(ldv_2_ret_default == 0); ldv_statevar_2 = ldv_switch_0(); } goto ldv_57453; case_12: /* CIL Label */ { ldv_2_ret_default = ldv_file_operations_instance_probe_2_12(ldv_2_container_file_operations->open, ldv_2_resource_inode, ldv_2_resource_file); ldv_2_ret_default = ldv_filter_err_code(ldv_2_ret_default); tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { ldv_statevar_2 = 9; } else { ldv_statevar_2 = 11; } goto ldv_57453; case_14: /* CIL Label */ { tmp___2 = ldv_xmalloc(520UL); ldv_2_resource_file = (struct file *)tmp___2; tmp___3 = ldv_xmalloc(1032UL); ldv_2_resource_inode = (struct inode *)tmp___3; tmp___4 = ldv_undef_int(); ldv_2_size_cnt_write_size = (unsigned long )tmp___4; tmp___5 = ldv_undef_int(); } if (tmp___5 != 0) { ldv_statevar_2 = 7; } else { ldv_statevar_2 = 12; } goto ldv_57453; case_15: /* CIL Label */ ; goto ldv_57453; case_18: /* CIL Label */ { tmp___6 = ldv_xmalloc(1UL); ldv_2_ldv_param_4_1_default = (char *)tmp___6; tmp___7 = ldv_xmalloc(8UL); ldv_2_ldv_param_4_3_default = (long long *)tmp___7; ldv_assume(ldv_2_size_cnt_write_size <= 2147479552UL); ldv_file_operations_instance_write_2_4((long (*)(struct file * , char * , unsigned long , long long * ))ldv_2_container_file_operations->write, ldv_2_resource_file, ldv_2_ldv_param_4_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_4_3_default); ldv_free((void *)ldv_2_ldv_param_4_1_default); ldv_free((void *)ldv_2_ldv_param_4_3_default); ldv_statevar_2 = 3; } goto ldv_57453; case_20: /* CIL Label */ { tmp___8 = ldv_xmalloc(1UL); ldv_2_ldv_param_5_1_default = (char *)tmp___8; tmp___9 = ldv_xmalloc(8UL); ldv_2_ldv_param_5_3_default = (long long *)tmp___9; ldv_file_operations_instance_callback_2_5(ldv_2_callback_read, ldv_2_resource_file, ldv_2_ldv_param_5_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_5_3_default); ldv_free((void *)ldv_2_ldv_param_5_1_default); ldv_free((void *)ldv_2_ldv_param_5_3_default); ldv_statevar_2 = 3; } goto ldv_57453; switch_default: /* CIL Label */ ; switch_break: /* CIL Label */ ; } ldv_57453: ; return; } } void ldv_file_operations_instance_callback_0_5(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { i40e_dbg_command_read(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_1_5(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { i40e_dbg_dump_read(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_2_5(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { i40e_dbg_netdev_ops_read(arg1, arg2, arg3, arg4); } return; } } int ldv_file_operations_instance_probe_0_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { int tmp ; { { tmp = simple_open(arg1, arg2); } return (tmp); } } int ldv_file_operations_instance_probe_1_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { int tmp ; { { tmp = simple_open(arg1, arg2); } return (tmp); } } int ldv_file_operations_instance_probe_2_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { int tmp ; { { tmp = simple_open(arg1, arg2); } return (tmp); } } void ldv_file_operations_instance_write_0_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { i40e_dbg_command_write(arg1, (char const *)arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_write_1_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { i40e_dbg_dump_write(arg1, (char const *)arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_write_2_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { i40e_dbg_netdev_ops_write(arg1, (char const *)arg2, arg3, arg4); } return; } } void ldv_switch_automaton_state_0_15(void) { { ldv_statevar_0 = 14; return; } } void ldv_switch_automaton_state_0_6(void) { { ldv_0_ret_default = 1; ldv_statevar_0 = 15; return; } } void ldv_switch_automaton_state_1_15(void) { { ldv_statevar_1 = 14; return; } } void ldv_switch_automaton_state_1_6(void) { { ldv_1_ret_default = 1; ldv_statevar_1 = 15; return; } } void ldv_switch_automaton_state_2_15(void) { { ldv_statevar_2 = 14; return; } } void ldv_switch_automaton_state_2_6(void) { { ldv_2_ret_default = 1; ldv_statevar_2 = 15; return; } } static i40e_status i40e_diag_reg_pattern_test(struct i40e_hw *hw , u32 reg , u32 mask ) { u32 patterns[4U] ; u32 pat ; u32 val ; u32 orig_val ; int i ; { { patterns[0] = 1515870810U; patterns[1] = 2779096485U; patterns[2] = 0U; patterns[3] = 4294967295U; orig_val = readl((void const volatile *)hw->hw_addr + (unsigned long )reg); i = 0; } goto ldv_49300; ldv_49299: { pat = patterns[i]; writel(pat & mask, (void volatile *)hw->hw_addr + (unsigned long )reg); val = readl((void const volatile *)hw->hw_addr + (unsigned long )reg); } if (((val ^ pat) & mask) != 0U) { if ((hw->debug_mask & 2048U) != 0U) { { printk("\016i40e %02x.%x %s: reg pattern test failed - reg 0x%08x pat 0x%08x val 0x%08x\n", (int )hw->bus.device, (int )hw->bus.func, "i40e_diag_reg_pattern_test", reg, pat, val); } } else { } return (-62); } else { } i = i + 1; ldv_49300: ; if ((unsigned int )i <= 3U) { goto ldv_49299; } else { } { writel(orig_val, (void volatile *)hw->hw_addr + (unsigned long )reg); val = readl((void const volatile *)hw->hw_addr + (unsigned long )reg); } if (val != orig_val) { if ((hw->debug_mask & 2048U) != 0U) { { printk("\016i40e %02x.%x %s: reg restore test failed - reg 0x%08x orig_val 0x%08x val 0x%08x\n", (int )hw->bus.device, (int )hw->bus.func, "i40e_diag_reg_pattern_test", reg, orig_val, val); } } else { } return (-62); } else { } return (0); } } struct i40e_diag_reg_test_info i40e_reg_list[12U] = { {1064960U, 65471U, 4U, 4U}, {229376U, 4095U, 3U, 128U}, {196608U, 4095U, 8U, 4U}, {198656U, 4095U, 8U, 4U}, {200704U, 4095U, 8U, 4U}, {230400U, 12U, 1U, 0U}, {230656U, 8191U, 1U, 0U}, {217088U, 2047U, 64U, 4U}, {245760U, 255U, 64U, 4U}, {237568U, 255U, 64U, 4U}, {231424U, 4159832064U, 1U, 0U}, {0U, 0U, 0U, 0U}}; i40e_status i40e_diag_reg_test(struct i40e_hw *hw ) { i40e_status ret_code ; u32 reg ; u32 mask ; u32 i ; u32 j ; { ret_code = 0; i = 0U; goto ldv_49315; ldv_49314: mask = i40e_reg_list[i].mask; j = 0U; goto ldv_49312; ldv_49311: { reg = i40e_reg_list[i].offset + j * i40e_reg_list[i].stride; ret_code = i40e_diag_reg_pattern_test(hw, reg, mask); j = j + 1U; } ldv_49312: ; if (j < i40e_reg_list[i].elements && (int )ret_code == 0) { goto ldv_49311; } else { } i = i + 1U; ldv_49315: ; if (i40e_reg_list[i].offset != 0U && (int )ret_code == 0) { goto ldv_49314; } else { } return (ret_code); } } i40e_status i40e_diag_eeprom_test(struct i40e_hw *hw ) { i40e_status ret_code ; u16 reg_val ; { { ret_code = i40e_read_nvm_word(hw, 0, & reg_val); } if ((int )ret_code == 0 && ((int )reg_val & 192) == 64) { { ret_code = i40e_validate_nvm_checksum(hw, (u16 *)0U); } } else { ret_code = -62; } return (ret_code); } } extern unsigned long __phys_addr(unsigned long ) ; __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int volatile *)(& v->counter))); } } __inline static void atomic_inc(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; incl %0": "+m" (v->counter)); return; } } extern void dump_page(struct page * , char * ) ; extern int numa_node ; __inline static int numa_node_id(void) { int pscr_ret__ ; void const *__vpp_verify ; int pfo_ret__ ; int pfo_ret_____0 ; int pfo_ret_____1 ; int pfo_ret_____2 ; { __vpp_verify = (void const *)0; { if (4UL == 1UL) { goto case_1; } else { } if (4UL == 2UL) { goto case_2___0; } else { } if (4UL == 4UL) { goto case_4___1; } else { } if (4UL == 8UL) { goto case_8___2; } else { } goto switch_default___3; case_1: /* CIL Label */ ; { if (4UL == 1UL) { goto case_1___0; } else { } if (4UL == 2UL) { goto case_2; } else { } if (4UL == 4UL) { goto case_4; } else { } if (4UL == 8UL) { goto case_8; } else { } goto switch_default; case_1___0: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "m" (numa_node)); goto ldv_13833; case_2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "m" (numa_node)); goto ldv_13833; case_4: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "m" (numa_node)); goto ldv_13833; case_8: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "m" (numa_node)); goto ldv_13833; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break___0: /* CIL Label */ ; } ldv_13833: pscr_ret__ = pfo_ret__; goto ldv_13839; case_2___0: /* CIL Label */ ; { if (4UL == 1UL) { goto case_1___1; } else { } if (4UL == 2UL) { goto case_2___1; } else { } if (4UL == 4UL) { goto case_4___0; } else { } if (4UL == 8UL) { goto case_8___0; } else { } goto switch_default___0; case_1___1: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____0): "m" (numa_node)); goto ldv_13843; case_2___1: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (numa_node)); goto ldv_13843; case_4___0: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (numa_node)); goto ldv_13843; case_8___0: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____0): "m" (numa_node)); goto ldv_13843; switch_default___0: /* CIL Label */ { __bad_percpu_size(); } switch_break___1: /* CIL Label */ ; } ldv_13843: pscr_ret__ = pfo_ret_____0; goto ldv_13839; case_4___1: /* CIL Label */ ; { if (4UL == 1UL) { goto case_1___2; } else { } if (4UL == 2UL) { goto case_2___2; } else { } if (4UL == 4UL) { goto case_4___2; } else { } if (4UL == 8UL) { goto case_8___1; } else { } goto switch_default___1; case_1___2: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____1): "m" (numa_node)); goto ldv_13852; case_2___2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (numa_node)); goto ldv_13852; case_4___2: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (numa_node)); goto ldv_13852; case_8___1: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____1): "m" (numa_node)); goto ldv_13852; switch_default___1: /* CIL Label */ { __bad_percpu_size(); } switch_break___2: /* CIL Label */ ; } ldv_13852: pscr_ret__ = pfo_ret_____1; goto ldv_13839; case_8___2: /* CIL Label */ ; { if (4UL == 1UL) { goto case_1___3; } else { } if (4UL == 2UL) { goto case_2___3; } else { } if (4UL == 4UL) { goto case_4___3; } else { } if (4UL == 8UL) { goto case_8___3; } else { } goto switch_default___2; case_1___3: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret_____2): "m" (numa_node)); goto ldv_13861; case_2___3: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (numa_node)); goto ldv_13861; case_4___3: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (numa_node)); goto ldv_13861; case_8___3: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret_____2): "m" (numa_node)); goto ldv_13861; switch_default___2: /* CIL Label */ { __bad_percpu_size(); } switch_break___3: /* CIL Label */ ; } ldv_13861: pscr_ret__ = pfo_ret_____2; goto ldv_13839; switch_default___3: /* CIL Label */ { __bad_size_call_parameter(); } goto ldv_13839; switch_break: /* CIL Label */ ; } ldv_13839: ; return (pscr_ret__); } } 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 void __free_pages(struct page * , unsigned int ) ; __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(struct page *page ) { struct page *head ; int tmp ; long tmp___0 ; int tmp___1 ; long tmp___2 ; { { tmp___1 = PageTail((struct page const *)page); tmp___2 = ldv__builtin_expect(tmp___1 != 0, 0L); } if (tmp___2 != 0L) { { head = page->__annonCompField46.first_page; __asm__ volatile ("": : : "memory"); tmp = PageTail((struct page const *)page); tmp___0 = ldv__builtin_expect(tmp != 0, 1L); } if (tmp___0 != 0L) { return (head); } else { } } else { } return (page); } } __inline static int page_count(struct page *page ) { struct page *tmp ; int tmp___0 ; { { tmp = compound_head(page); tmp___0 = atomic_read((atomic_t const *)(& tmp->__annonCompField43.__annonCompField42.__annonCompField41._count)); } return (tmp___0); } } 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->__annonCompField43.__annonCompField42.__annonCompField41._count)); tmp___4 = ldv__builtin_expect(tmp___3 <= 0, 0L); } if (tmp___4 != 0L) { { dump_page(page, (char *)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" (488), "i" (12UL)); __builtin_unreachable(); } } else { } { atomic_inc(& page->__annonCompField43.__annonCompField42.__annonCompField41._count); } return; } } __inline static int page_to_nid(struct page const *page ) { { return ((int )(page->flags >> 54)); } } __inline static void *lowmem_page_address(struct page const *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 64L) << 12) + 0xffff880000000000UL)); } } __inline static 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)); __builtin_unreachable(); } } else { } dql->num_queued = dql->num_queued + count; dql->last_obj_cnt = count; return; } } __inline static int dql_avail(struct dql const *dql ) { { return ((int )((unsigned int )dql->adj_limit - (unsigned int )dql->num_queued)); } } extern void dql_completed(struct dql * , unsigned int ) ; extern void dql_reset(struct dql * ) ; __inline static void kmemcheck_mark_initialized(void *address , unsigned int n ) { { return; } } __inline static void *kzalloc(size_t size , gfp_t flags ) ; __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 __wsum csum_add(__wsum csum , __wsum addend ) { u32 res ; { res = csum; res = res + addend; return (res + (u32 )(res < addend)); } } 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 ) ; __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)); __builtin_unreachable(); } } else { } { tmp___2 = __phys_addr((unsigned long )ptr); addr = (*(ops->map_page))(dev, (struct page *)-24189255811072L + (tmp___2 >> 12), (unsigned long )ptr & 4095UL, size, dir, attrs); tmp___3 = __phys_addr((unsigned long )ptr); debug_dma_map_page(dev, (struct page *)-24189255811072L + (tmp___3 >> 12), (unsigned long )ptr & 4095UL, size, (int )dir, addr, 1); } return (addr); } } __inline static dma_addr_t dma_map_page(struct device *dev , struct page *page , size_t offset , size_t size , enum dma_data_direction dir ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; dma_addr_t addr ; void *tmp___0 ; int tmp___1 ; long tmp___2 ; { { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = lowmem_page_address((struct page const *)page); kmemcheck_mark_initialized(tmp___0 + offset, (unsigned int )size); tmp___1 = valid_dma_direction((int )dir); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); } if (tmp___2 != 0L) { { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (79), "i" (12UL)); __builtin_unreachable(); } } 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(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" (91), "i" (12UL)); __builtin_unreachable(); } } 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 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 int pskb_expand_head(struct sk_buff * , int , int , gfp_t ) ; extern int skb_pad(struct sk_buff * , 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 sk_buff *skb_get(struct sk_buff *skb ) { { { atomic_inc(& skb->users); } return (skb); } } __inline static int skb_header_cloned(struct sk_buff const *skb ) { int dataref ; unsigned char *tmp ; { if ((unsigned int )*((unsigned char *)skb + 124UL) == 0U) { return (0); } else { } { tmp = skb_end_pointer(skb); dataref = atomic_read((atomic_t const *)(& ((struct skb_shared_info *)tmp)->dataref)); dataref = (dataref & 65535) - (dataref >> 16); } return (dataref != 1); } } __inline static unsigned int skb_headlen(struct sk_buff const *skb ) { { return ((unsigned int )skb->len - (unsigned int )skb->data_len); } } __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->__annonCompField43.__annonCompField38.pfmemalloc && (unsigned long )page->__annonCompField37.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; } } __inline static void skb_reset_tail_pointer(struct sk_buff *skb ) { { skb->tail = (sk_buff_data_t )((long )skb->data) - (sk_buff_data_t )((long )skb->head); return; } } __inline static void skb_set_tail_pointer(struct sk_buff *skb , int const offset ) { { { skb_reset_tail_pointer(skb); skb->tail = skb->tail + (sk_buff_data_t )offset; } return; } } extern unsigned char *skb_put(struct sk_buff * , unsigned int ) ; __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 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); } } __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))); } } __inline static u32 skb_network_header_len(struct sk_buff const *skb ) { { return ((u32 )((int )skb->transport_header - (int )skb->network_header)); } } __inline static u32 skb_inner_network_header_len(struct sk_buff const *skb ) { { return ((u32 )((int )skb->inner_transport_header - (int )skb->inner_network_header)); } } __inline static int skb_network_offset(struct sk_buff const *skb ) { unsigned char *tmp ; { { tmp = skb_network_header(skb); } return ((int )((unsigned int )((long )tmp) - (unsigned int )((long )skb->data))); } } __inline static int skb_inner_network_offset(struct sk_buff const *skb ) { unsigned char *tmp ; { { tmp = skb_inner_network_header(skb); } return ((int )((unsigned int )((long )tmp) - (unsigned int )((long )skb->data))); } } extern struct sk_buff *__netdev_alloc_skb(struct net_device * , unsigned int , gfp_t ) ; __inline static struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev , unsigned int length , gfp_t gfp ) { struct sk_buff *skb ; struct sk_buff *tmp ; { { tmp = __netdev_alloc_skb(dev, length, gfp); skb = tmp; } return (skb); } } __inline static struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { { tmp = __netdev_alloc_skb_ip_align(dev, 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); } } extern int skb_copy_bits(struct sk_buff const * , int , void * , int ) ; __inline static void *skb_header_pointer(struct sk_buff const *skb , int offset , int len , void *buffer ) { int hlen ; unsigned int tmp ; int tmp___0 ; { { tmp = skb_headlen(skb); hlen = (int )tmp; } if (hlen - offset >= len) { return ((void *)skb->data + (unsigned long )offset); } else { } { tmp___0 = skb_copy_bits(skb, offset, buffer, len); } if (tmp___0 < 0) { return ((void *)0); } else { } return (buffer); } } extern void skb_clone_tx_timestamp(struct sk_buff * ) ; extern void skb_tstamp_tx(struct sk_buff * , struct skb_shared_hwtstamps * ) ; __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 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 u64_stats_update_begin(struct u64_stats_sync *syncp ) { { return; } } extern void napi_complete(struct napi_struct * ) ; __inline static void netif_schedule_queue(struct netdev_queue *txq ) { { if ((txq->state & 3UL) == 0UL) { { __netif_schedule(txq->qdisc); } } 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_set_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; } } __inline static void netif_start_subqueue(struct net_device *dev , u16 queue_index ) { struct netdev_queue *txq ; struct netdev_queue *tmp ; { { tmp = netdev_get_tx_queue((struct net_device const *)dev, (unsigned int )queue_index); txq = tmp; netif_tx_start_queue(txq); } return; } } __inline static void netif_stop_subqueue(struct net_device *dev , u16 queue_index ) { struct netdev_queue *txq ; struct netdev_queue *tmp ; int tmp___0 ; { { tmp = netdev_get_tx_queue((struct net_device const *)dev, (unsigned int )queue_index); txq = tmp; tmp___0 = netpoll_trap(); } if (tmp___0 != 0) { return; } else { } { netif_tx_stop_queue(txq); } return; } } __inline static bool __netif_subqueue_stopped(struct net_device const *dev , u16 queue_index ) { struct netdev_queue *txq ; struct netdev_queue *tmp ; bool tmp___0 ; { { tmp = netdev_get_tx_queue(dev, (unsigned int )queue_index); txq = tmp; tmp___0 = netif_tx_queue_stopped((struct netdev_queue const *)txq); } return (tmp___0); } } __inline static void netif_wake_subqueue(struct net_device *dev , u16 queue_index ) { struct netdev_queue *txq ; struct netdev_queue *tmp ; int tmp___0 ; int tmp___1 ; { { tmp = netdev_get_tx_queue((struct net_device const *)dev, (unsigned int )queue_index); txq = tmp; tmp___0 = netpoll_trap(); } if (tmp___0 != 0) { return; } else { } { tmp___1 = test_and_set_bit(0L, (unsigned long volatile *)(& txq->state)); } if (tmp___1 != 0) { { __netif_schedule(txq->qdisc); } } else { } return; } } extern void __dev_kfree_skb_any(struct sk_buff * , enum skb_free_reason ) ; __inline static void dev_kfree_skb_any(struct sk_buff *skb ) { { { __dev_kfree_skb_any(skb, 1); } return; } } extern int netif_rx(struct sk_buff * ) ; extern gro_result_t napi_gro_receive(struct napi_struct * , struct sk_buff * ) ; __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 iphdr *ip_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { { tmp = skb_network_header(skb); } return ((struct iphdr *)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 udphdr *udp_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { { tmp = skb_transport_header(skb); } return ((struct udphdr *)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 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 __wsum udp_csum(struct sk_buff *skb ) { __wsum csum ; unsigned char *tmp ; __wsum tmp___0 ; unsigned char *tmp___1 ; { { tmp = skb_transport_header((struct sk_buff const *)skb); tmp___0 = csum_partial((void const *)tmp, 8, skb->__annonCompField68.csum); csum = tmp___0; tmp___1 = skb_end_pointer((struct sk_buff const *)skb); skb = ((struct skb_shared_info *)tmp___1)->frag_list; } goto ldv_51168; ldv_51167: { csum = csum_add(csum, skb->__annonCompField68.csum); skb = skb->next; } ldv_51168: ; if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_51167; } else { } return (csum); } } extern __be16 eth_type_trans(struct sk_buff * , struct net_device * ) ; __inline static struct sk_buff *__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 (skb); } } __inline static bool i40e_rx_is_programming_status(u64 qw ) { { return (qw >> 38 == 33554432ULL); } } void i40e_ptp_rx_hwtstamp(struct i40e_pf *pf , struct sk_buff *skb , u8 index ) ; __inline static __le64 build_ctob(u32 td_cmd , u32 td_offset , unsigned int size , u32 td_tag ) { { return (((((unsigned long long )td_cmd << 4) | ((unsigned long long )td_offset << 16)) | ((unsigned long long )size << 34)) | ((unsigned long long )td_tag << 48)); } } int i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data , struct i40e_pf *pf , bool add ) { struct i40e_filter_program_desc *fdir_desc ; struct i40e_tx_buffer *tx_buf ; struct i40e_tx_desc *tx_desc ; struct i40e_ring *tx_ring ; unsigned int fpt ; unsigned int dcc ; struct i40e_vsi *vsi ; struct device *dev ; dma_addr_t dma ; u32 td_cmd ; u16 i ; int tmp ; { td_cmd = 0U; vsi = (struct i40e_vsi *)0; i = 0U; goto ldv_56795; ldv_56794: ; if ((unsigned long )*(pf->vsi + (unsigned long )i) != (unsigned long )((struct i40e_vsi *)0) && (unsigned int )(*(pf->vsi + (unsigned long )i))->type == 7U) { vsi = *(pf->vsi + (unsigned long )i); } else { } i = (u16 )((int )i + 1); ldv_56795: ; if ((u32 )i < pf->hw.func_caps.num_vsis) { goto ldv_56794; } else { } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { return (-2); } else { } { tx_ring = *(vsi->tx_rings); dev = tx_ring->dev; dma = dma_map_single_attrs(dev, (void *)fdir_data->raw_packet, 512UL, 1, (struct dma_attrs *)0); tmp = dma_mapping_error(dev, dma); } if (tmp != 0) { goto dma_fail; } else { } i = tx_ring->next_to_use; fdir_desc = (struct i40e_filter_program_desc *)tx_ring->desc + (unsigned long )i; tx_ring->next_to_use = (int )i + 1 < (int )tx_ring->count ? (unsigned int )i + 1U : 0U; fpt = (unsigned int )fdir_data->q_index & 2047U; fpt = fpt | ((unsigned int )((int )fdir_data->flex_off << 11) & 14336U); fpt = fpt | ((unsigned int )((int )fdir_data->pctype << 17) & 8257536U); if ((unsigned int )fdir_data->dest_vsi == 0U) { fpt = fpt | (unsigned int )((int )(*(pf->vsi + (unsigned long )pf->lan_vsi))->id << 23); } else { fpt = fpt | ((unsigned int )fdir_data->dest_vsi << 23); } fdir_desc->qindex_flex_ptype_vsi = fpt; dcc = 8U; if ((int )add) { dcc = dcc | 16U; } else { dcc = dcc | 32U; } dcc = dcc | ((unsigned int )((int )fdir_data->dest_ctl << 7) & 384U); dcc = dcc | ((unsigned int )((int )fdir_data->fd_status << 13) & 24576U); if ((unsigned int )fdir_data->cnt_index != 0U) { dcc = dcc | 2048U; dcc = dcc | (((unsigned int )fdir_data->cnt_index << 20) & 535822336U); } else { } { fdir_desc->dtype_cmd_cntindex = dcc; fdir_desc->fd_id = fdir_data->fd_id; i = tx_ring->next_to_use; tx_desc = (struct i40e_tx_desc *)tx_ring->desc + (unsigned long )i; tx_buf = tx_ring->__annonCompField94.tx_bi + (unsigned long )i; tx_ring->next_to_use = (int )i + 1 < (int )tx_ring->count ? (unsigned int )i + 1U : 0U; tx_buf->len = 512U; tx_buf->dma = dma; tx_desc->buffer_addr = dma; td_cmd = 19U; tx_desc->cmd_type_offset_bsz = build_ctob(td_cmd, 0U, 512U, 0U); tx_buf->time_stamp = jiffies; __asm__ volatile ("sfence": : : "memory"); tx_buf->next_to_watch = tx_desc; writel((unsigned int )tx_ring->next_to_use, (void volatile *)tx_ring->tail); } return (0); dma_fail: ; return (-1); } } static void i40e_fd_handle_status(struct i40e_ring *rx_ring , u32 qw , u8 prog_id ) { struct pci_dev *pdev ; u32 error ; { { pdev = ((rx_ring->vsi)->back)->pdev; error = (u32 )(((unsigned long )qw & 33030144UL) >> 19); _dev_info((struct device const *)(& pdev->dev), "FD programming id %02x, Status %08x\n", (int )prog_id, error); } return; } } static void i40e_unmap_and_free_tx_resource(struct i40e_ring *ring , struct i40e_tx_buffer *tx_buffer ) { { if ((unsigned long )tx_buffer->skb != (unsigned long )((struct sk_buff *)0)) { { dev_kfree_skb_any(tx_buffer->skb); } if (tx_buffer->len != 0U) { { dma_unmap_single_attrs(ring->dev, tx_buffer->dma, (size_t )tx_buffer->len, 1, (struct dma_attrs *)0); } } else { } } else if (tx_buffer->len != 0U) { { dma_unmap_page(ring->dev, tx_buffer->dma, (size_t )tx_buffer->len, 1); } } else { } tx_buffer->next_to_watch = (struct i40e_tx_desc *)0; tx_buffer->skb = (struct sk_buff *)0; tx_buffer->len = 0U; return; } } void i40e_clean_tx_ring(struct i40e_ring *tx_ring ) { unsigned long bi_size ; u16 i ; struct netdev_queue *tmp ; { if ((unsigned long )tx_ring->__annonCompField94.tx_bi == (unsigned long )((struct i40e_tx_buffer *)0)) { return; } else { } i = 0U; goto ldv_56815; ldv_56814: { i40e_unmap_and_free_tx_resource(tx_ring, tx_ring->__annonCompField94.tx_bi + (unsigned long )i); i = (u16 )((int )i + 1); } ldv_56815: ; if ((int )i < (int )tx_ring->count) { goto ldv_56814; } else { } { bi_size = (unsigned long )tx_ring->count * 48UL; memset((void *)tx_ring->__annonCompField94.tx_bi, 0, bi_size); memset(tx_ring->desc, 0, (size_t )tx_ring->size); tx_ring->next_to_use = 0U; tx_ring->next_to_clean = 0U; } if ((unsigned long )tx_ring->netdev == (unsigned long )((struct net_device *)0)) { return; } else { } { tmp = netdev_get_tx_queue((struct net_device const *)tx_ring->netdev, (unsigned int )tx_ring->queue_index); netdev_tx_reset_queue(tmp); } return; } } void i40e_free_tx_resources(struct i40e_ring *tx_ring ) { { { i40e_clean_tx_ring(tx_ring); kfree((void const *)tx_ring->__annonCompField94.tx_bi); tx_ring->__annonCompField94.tx_bi = (struct i40e_tx_buffer *)0; } if ((unsigned long )tx_ring->desc != (unsigned long )((void *)0)) { { dma_free_attrs(tx_ring->dev, (size_t )tx_ring->size, tx_ring->desc, tx_ring->dma, (struct dma_attrs *)0); tx_ring->desc = (void *)0; } } else { } return; } } static u32 i40e_get_tx_pending(struct i40e_ring *ring ) { u32 ntu ; { ntu = (int )ring->next_to_clean <= (int )ring->next_to_use ? (u32 )ring->next_to_use : (u32 )((int )ring->next_to_use + (int )ring->count); return (ntu - (u32 )ring->next_to_clean); } } static bool i40e_check_tx_hang(struct i40e_ring *tx_ring ) { u32 tx_pending ; u32 tmp ; bool ret ; int tmp___0 ; { { tmp = i40e_get_tx_pending(tx_ring); tx_pending = tmp; ret = 0; clear_bit(2L, (unsigned long volatile *)(& tx_ring->state)); } if (tx_ring->__annonCompField95.tx_stats.tx_done_old == tx_ring->stats.packets && tx_pending != 0U) { { tmp___0 = test_and_set_bit(3L, (unsigned long volatile *)(& tx_ring->state)); ret = tmp___0 != 0; } } else { { tx_ring->__annonCompField95.tx_stats.tx_done_old = tx_ring->stats.packets; clear_bit(3L, (unsigned long volatile *)(& tx_ring->state)); } } return (ret); } } static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring , int budget ) { u16 i ; struct i40e_tx_buffer *tx_buf ; struct i40e_tx_desc *tx_desc ; unsigned int total_packets ; unsigned int total_bytes ; struct i40e_tx_desc *eop_desc ; long tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; bool tmp___3 ; struct netdev_queue *tmp___4 ; bool tmp___5 ; int tmp___6 ; long tmp___7 ; bool tmp___8 ; long tmp___9 ; int tmp___10 ; long tmp___11 ; { i = tx_ring->next_to_clean; total_packets = 0U; total_bytes = 0U; tx_buf = tx_ring->__annonCompField94.tx_bi + (unsigned long )i; tx_desc = (struct i40e_tx_desc *)tx_ring->desc + (unsigned long )i; i = (int )i - (int )tx_ring->count; ldv_56843: eop_desc = tx_buf->next_to_watch; if ((unsigned long )eop_desc == (unsigned long )((struct i40e_tx_desc *)0)) { goto ldv_56839; } else { } if ((eop_desc->cmd_type_offset_bsz & 15ULL) == 0ULL) { goto ldv_56839; } else { } { tx_buf->next_to_watch = (struct i40e_tx_desc *)0; total_bytes = total_bytes + tx_buf->bytecount; total_packets = total_packets + (unsigned int )tx_buf->gso_segs; dev_kfree_skb_any(tx_buf->skb); dma_unmap_single_attrs(tx_ring->dev, tx_buf->dma, (size_t )tx_buf->len, 1, (struct dma_attrs *)0); tx_buf->skb = (struct sk_buff *)0; tx_buf->len = 0U; } goto ldv_56841; ldv_56840: { tx_buf = tx_buf + 1; tx_desc = tx_desc + 1; i = (u16 )((int )i + 1); tmp = ldv__builtin_expect((unsigned int )i == 0U, 0L); } if (tmp != 0L) { i = (int )i - (int )tx_ring->count; tx_buf = tx_ring->__annonCompField94.tx_bi; tx_desc = (struct i40e_tx_desc *)tx_ring->desc; } else { } if (tx_buf->len != 0U) { { dma_unmap_page(tx_ring->dev, tx_buf->dma, (size_t )tx_buf->len, 1); tx_buf->len = 0U; } } else { } ldv_56841: ; if ((unsigned long )tx_desc != (unsigned long )eop_desc) { goto ldv_56840; } else { } { tx_buf = tx_buf + 1; tx_desc = tx_desc + 1; i = (u16 )((int )i + 1); tmp___0 = ldv__builtin_expect((unsigned int )i == 0U, 0L); } if (tmp___0 != 0L) { i = (int )i - (int )tx_ring->count; tx_buf = tx_ring->__annonCompField94.tx_bi; tx_desc = (struct i40e_tx_desc *)tx_ring->desc; } else { } { budget = budget - 1; tmp___1 = ldv__builtin_expect(budget != 0, 1L); } if (tmp___1 != 0L) { goto ldv_56843; } else { } ldv_56839: { i = (int )i + (int )tx_ring->count; tx_ring->next_to_clean = i; u64_stats_update_begin(& tx_ring->syncp); tx_ring->stats.bytes = tx_ring->stats.bytes + (u64 )total_bytes; tx_ring->stats.packets = tx_ring->stats.packets + (u64 )total_packets; u64_stats_update_begin(& tx_ring->syncp); (tx_ring->q_vector)->tx.total_bytes = (tx_ring->q_vector)->tx.total_bytes + total_bytes; (tx_ring->q_vector)->tx.total_packets = (tx_ring->q_vector)->tx.total_packets + total_packets; tmp___2 = constant_test_bit(2L, (unsigned long const volatile *)(& tx_ring->state)); } if (tmp___2 != 0) { { tmp___3 = i40e_check_tx_hang(tx_ring); } if ((int )tmp___3) { { _dev_info((struct device const *)tx_ring->dev, "Detected Tx Unit Hang\n VSI <%d>\n Tx Queue <%d>\n next_to_use <%x>\n next_to_clean <%x>\n", (int )(tx_ring->vsi)->seid, (int )tx_ring->queue_index, (int )tx_ring->next_to_use, (int )i); _dev_info((struct device const *)tx_ring->dev, "tx_bi[next_to_clean]\n time_stamp <%lx>\n jiffies <%lx>\n", (tx_ring->__annonCompField94.tx_bi + (unsigned long )i)->time_stamp, jiffies); netif_stop_subqueue(tx_ring->netdev, (int )tx_ring->queue_index); _dev_info((struct device const *)tx_ring->dev, "tx hang detected on queue %d, resetting adapter\n", (int )tx_ring->queue_index); (*(((tx_ring->netdev)->netdev_ops)->ndo_tx_timeout))(tx_ring->netdev); } return (1); } else { } } else { } { tmp___4 = netdev_get_tx_queue((struct net_device const *)tx_ring->netdev, (unsigned int )tx_ring->queue_index); netdev_tx_completed_queue(tmp___4, total_packets, total_bytes); tmp___7 = ldv__builtin_expect(total_packets != 0U, 0L); } if (tmp___7 != 0L) { { tmp___8 = netif_carrier_ok((struct net_device const *)tx_ring->netdev); tmp___9 = ldv__builtin_expect((long )tmp___8, 0L); } if (tmp___9 != 0L) { tmp___10 = 1; } else { tmp___10 = 0; } } else { tmp___10 = 0; } if (tmp___10 != 0) { { tmp___11 = ldv__builtin_expect((unsigned int )(((((int )tx_ring->next_to_clean <= (int )tx_ring->next_to_use ? (int )tx_ring->count : 0) + (int )tx_ring->next_to_clean) - (int )tx_ring->next_to_use) + -1) > 41U, 0L); } if (tmp___11 != 0L) { { __asm__ volatile ("mfence": : : "memory"); tmp___5 = __netif_subqueue_stopped((struct net_device const *)tx_ring->netdev, (int )tx_ring->queue_index); } if ((int )tmp___5) { { tmp___6 = constant_test_bit(3L, (unsigned long const volatile *)(& (tx_ring->vsi)->state)); } if (tmp___6 == 0) { { netif_wake_subqueue(tx_ring->netdev, (int )tx_ring->queue_index); tx_ring->__annonCompField95.tx_stats.restart_queue = tx_ring->__annonCompField95.tx_stats.restart_queue + 1ULL; } } else { } } else { } } else { } } else { } return (budget > 0); } } static void i40e_set_new_dynamic_itr(struct i40e_ring_container *rc ) { enum i40e_latency_range new_latency_range ; u32 new_itr ; int bytes_per_int ; { new_latency_range = rc->latency_range; new_itr = (u32 )rc->itr; if (rc->total_packets == 0U || (unsigned int )rc->itr == 0U) { return; } else { } bytes_per_int = (int )(rc->total_bytes / (unsigned int )rc->itr); { if ((int )rc->itr == 0) { goto case_0; } else { } if ((int )rc->itr == 1) { goto case_1; } else { } if ((int )rc->itr == 2) { goto case_2; } else { } goto switch_break; case_0: /* CIL Label */ ; if (bytes_per_int > 10) { new_latency_range = 1; } else { } goto ldv_56851; case_1: /* CIL Label */ ; if (bytes_per_int > 20) { new_latency_range = 2; } else if (bytes_per_int <= 10) { new_latency_range = 0; } else { } goto ldv_56851; case_2: /* CIL Label */ ; if (bytes_per_int <= 20) { rc->latency_range = 1; } else { } goto ldv_56851; switch_break: /* CIL Label */ ; } ldv_56851: ; { if ((unsigned int )new_latency_range == 0U) { goto case_0___0; } else { } if ((unsigned int )new_latency_range == 1U) { goto case_1___0; } else { } if ((unsigned int )new_latency_range == 2U) { goto case_2___0; } else { } goto switch_default; case_0___0: /* CIL Label */ new_itr = 5U; goto ldv_56855; case_1___0: /* CIL Label */ new_itr = 25U; goto ldv_56855; case_2___0: /* CIL Label */ new_itr = 62U; goto ldv_56855; switch_default: /* CIL Label */ ; goto ldv_56855; switch_break___0: /* CIL Label */ ; } ldv_56855: ; if (new_itr != (u32 )rc->itr) { new_itr = ((new_itr * (u32 )rc->itr) * 10U) / (new_itr * 9U + (u32 )rc->itr); rc->itr = (unsigned int )((u16 )new_itr) & 4080U; } else { } rc->total_bytes = 0U; rc->total_packets = 0U; return; } } static void i40e_update_dynamic_itr(struct i40e_q_vector *q_vector ) { u16 vector ; struct i40e_hw *hw ; u32 reg_addr ; u16 old_itr ; { { vector = (int )((u16 )(q_vector->vsi)->base_vector) + (int )q_vector->v_idx; hw = & ((q_vector->vsi)->back)->hw; reg_addr = (u32 )(((int )vector + 49151) * 4); old_itr = q_vector->rx.itr; i40e_set_new_dynamic_itr(& q_vector->rx); } if ((int )old_itr != (int )q_vector->rx.itr) { { writel((unsigned int )q_vector->rx.itr, (void volatile *)hw->hw_addr + (unsigned long )reg_addr); } } else { } { reg_addr = (u32 )(((int )vector + 49663) * 4); old_itr = q_vector->tx.itr; i40e_set_new_dynamic_itr(& q_vector->tx); } if ((int )old_itr != (int )q_vector->tx.itr) { { writel((unsigned int )q_vector->tx.itr, (void volatile *)hw->hw_addr + (unsigned long )reg_addr); } } else { } return; } } static void i40e_clean_programming_status(struct i40e_ring *rx_ring , union i40e_32byte_rx_desc *rx_desc ) { u64 qw ; u8 id ; { qw = rx_desc->wb.qword1.status_error_len; id = (u8 )((qw & 28ULL) >> 2); if ((unsigned int )id == 1U) { { i40e_fd_handle_status(rx_ring, (u32 )qw, (int )id); } } else { } return; } } int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring ) { struct device *dev ; int bi_size ; void *tmp ; { dev = tx_ring->dev; if ((unsigned long )dev == (unsigned long )((struct device *)0)) { return (-12); } else { } { bi_size = (int )((unsigned int )tx_ring->count * 48U); tmp = kzalloc((size_t )bi_size, 208U); tx_ring->__annonCompField94.tx_bi = (struct i40e_tx_buffer *)tmp; } if ((unsigned long )tx_ring->__annonCompField94.tx_bi == (unsigned long )((struct i40e_tx_buffer *)0)) { goto err; } else { } { tx_ring->size = (unsigned int )tx_ring->count * 16U; tx_ring->size = (tx_ring->size + 4095U) & 4294963200U; tx_ring->desc = dma_alloc_attrs(dev, (size_t )tx_ring->size, & tx_ring->dma, 208U, (struct dma_attrs *)0); } if ((unsigned long )tx_ring->desc == (unsigned long )((void *)0)) { { _dev_info((struct device const *)dev, "Unable to allocate memory for the Tx descriptor ring, size=%d\n", tx_ring->size); } goto err; } else { } tx_ring->next_to_use = 0U; tx_ring->next_to_clean = 0U; return (0); err: { kfree((void const *)tx_ring->__annonCompField94.tx_bi); tx_ring->__annonCompField94.tx_bi = (struct i40e_tx_buffer *)0; } return (-12); } } void i40e_clean_rx_ring(struct i40e_ring *rx_ring ) { struct device *dev ; struct i40e_rx_buffer *rx_bi ; unsigned long bi_size ; u16 i ; { dev = rx_ring->dev; if ((unsigned long )rx_ring->__annonCompField94.rx_bi == (unsigned long )((struct i40e_rx_buffer *)0)) { return; } else { } i = 0U; goto ldv_56886; ldv_56885: rx_bi = rx_ring->__annonCompField94.rx_bi + (unsigned long )i; if (rx_bi->dma != 0ULL) { { dma_unmap_single_attrs(dev, rx_bi->dma, (size_t )rx_ring->rx_buf_len, 2, (struct dma_attrs *)0); rx_bi->dma = 0ULL; } } else { } if ((unsigned long )rx_bi->skb != (unsigned long )((struct sk_buff *)0)) { { consume_skb(rx_bi->skb); rx_bi->skb = (struct sk_buff *)0; } } else { } if ((unsigned long )rx_bi->page != (unsigned long )((struct page *)0)) { if (rx_bi->page_dma != 0ULL) { { dma_unmap_page(dev, rx_bi->page_dma, 2048UL, 2); rx_bi->page_dma = 0ULL; } } else { } { __free_pages(rx_bi->page, 0U); rx_bi->page = (struct page *)0; rx_bi->page_offset = 0U; } } else { } i = (u16 )((int )i + 1); ldv_56886: ; if ((int )i < (int )rx_ring->count) { goto ldv_56885; } else { } { bi_size = (unsigned long )rx_ring->count * 40UL; memset((void *)rx_ring->__annonCompField94.rx_bi, 0, bi_size); memset(rx_ring->desc, 0, (size_t )rx_ring->size); rx_ring->next_to_clean = 0U; rx_ring->next_to_use = 0U; } return; } } void i40e_free_rx_resources(struct i40e_ring *rx_ring ) { { { i40e_clean_rx_ring(rx_ring); kfree((void const *)rx_ring->__annonCompField94.rx_bi); rx_ring->__annonCompField94.rx_bi = (struct i40e_rx_buffer *)0; } if ((unsigned long )rx_ring->desc != (unsigned long )((void *)0)) { { dma_free_attrs(rx_ring->dev, (size_t )rx_ring->size, rx_ring->desc, rx_ring->dma, (struct dma_attrs *)0); rx_ring->desc = (void *)0; } } else { } return; } } int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring ) { struct device *dev ; int bi_size ; void *tmp ; int tmp___0 ; { { dev = rx_ring->dev; bi_size = (int )((unsigned int )rx_ring->count * 40U); tmp = kzalloc((size_t )bi_size, 208U); rx_ring->__annonCompField94.rx_bi = (struct i40e_rx_buffer *)tmp; } if ((unsigned long )rx_ring->__annonCompField94.rx_bi == (unsigned long )((struct i40e_rx_buffer *)0)) { goto err; } else { } { tmp___0 = constant_test_bit(6L, (unsigned long const volatile *)(& rx_ring->state)); rx_ring->size = tmp___0 != 0 ? (unsigned int )rx_ring->count * 16U : (unsigned int )rx_ring->count * 32U; rx_ring->size = (rx_ring->size + 4095U) & 4294963200U; rx_ring->desc = dma_alloc_attrs(dev, (size_t )rx_ring->size, & rx_ring->dma, 208U, (struct dma_attrs *)0); } if ((unsigned long )rx_ring->desc == (unsigned long )((void *)0)) { { _dev_info((struct device const *)dev, "Unable to allocate memory for the Rx descriptor ring, size=%d\n", rx_ring->size); } goto err; } else { } rx_ring->next_to_clean = 0U; rx_ring->next_to_use = 0U; return (0); err: { kfree((void const *)rx_ring->__annonCompField94.rx_bi); rx_ring->__annonCompField94.rx_bi = (struct i40e_rx_buffer *)0; } return (-12); } } __inline static void i40e_release_rx_desc(struct i40e_ring *rx_ring , u32 val ) { { { rx_ring->next_to_use = (u16 )val; __asm__ volatile ("sfence": : : "memory"); writel(val, (void volatile *)rx_ring->tail); } return; } } void i40e_alloc_rx_buffers(struct i40e_ring *rx_ring , u16 cleaned_count ) { u16 i ; union i40e_32byte_rx_desc *rx_desc ; struct i40e_rx_buffer *bi ; struct sk_buff *skb ; int tmp ; int tmp___0 ; int tmp___1 ; u16 tmp___2 ; { i = rx_ring->next_to_use; if ((unsigned long )rx_ring->netdev == (unsigned long )((struct net_device *)0) || (unsigned int )cleaned_count == 0U) { return; } else { } goto ldv_56911; ldv_56910: { constant_test_bit(6L, (unsigned long const volatile *)(& rx_ring->state)); rx_desc = (union i40e_32byte_rx_desc *)rx_ring->desc + (unsigned long )i; bi = rx_ring->__annonCompField94.rx_bi + (unsigned long )i; skb = bi->skb; } if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { { skb = netdev_alloc_skb_ip_align(rx_ring->netdev, (unsigned int )rx_ring->rx_buf_len); } if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { rx_ring->__annonCompField95.rx_stats.alloc_buff_failed = rx_ring->__annonCompField95.rx_stats.alloc_buff_failed + 1ULL; goto no_buffers; } else { } { skb_record_rx_queue(skb, (int )rx_ring->queue_index); bi->skb = skb; } } else { } if (bi->dma == 0ULL) { { bi->dma = dma_map_single_attrs(rx_ring->dev, (void *)skb->data, (size_t )rx_ring->rx_buf_len, 2, (struct dma_attrs *)0); tmp = dma_mapping_error(rx_ring->dev, bi->dma); } if (tmp != 0) { rx_ring->__annonCompField95.rx_stats.alloc_buff_failed = rx_ring->__annonCompField95.rx_stats.alloc_buff_failed + 1ULL; bi->dma = 0ULL; goto no_buffers; } else { } } else { } { tmp___1 = constant_test_bit(4L, (unsigned long const volatile *)(& rx_ring->state)); } if (tmp___1 != 0) { if ((unsigned long )bi->page == (unsigned long )((struct page *)0)) { { bi->page = alloc_pages(32U, 0U); } if ((unsigned long )bi->page == (unsigned long )((struct page *)0)) { rx_ring->__annonCompField95.rx_stats.alloc_page_failed = rx_ring->__annonCompField95.rx_stats.alloc_page_failed + 1ULL; goto no_buffers; } else { } } else { } if (bi->page_dma == 0ULL) { { bi->page_offset = bi->page_offset ^ 2048U; bi->page_dma = dma_map_page(rx_ring->dev, bi->page, (size_t )bi->page_offset, 2048UL, 2); tmp___0 = dma_mapping_error(rx_ring->dev, bi->page_dma); } if (tmp___0 != 0) { rx_ring->__annonCompField95.rx_stats.alloc_page_failed = rx_ring->__annonCompField95.rx_stats.alloc_page_failed + 1ULL; bi->page_dma = 0ULL; goto no_buffers; } else { } } else { } rx_desc->read.pkt_addr = bi->page_dma; rx_desc->read.hdr_addr = bi->dma; } else { rx_desc->read.pkt_addr = bi->dma; rx_desc->read.hdr_addr = 0ULL; } i = (u16 )((int )i + 1); if ((int )i == (int )rx_ring->count) { i = 0U; } else { } ldv_56911: tmp___2 = cleaned_count; cleaned_count = (u16 )((int )cleaned_count - 1); if ((unsigned int )tmp___2 != 0U) { goto ldv_56910; } else { } no_buffers: ; if ((int )rx_ring->next_to_use != (int )i) { { i40e_release_rx_desc(rx_ring, (u32 )i); } } else { } return; } } static void i40e_receive_skb(struct i40e_ring *rx_ring , struct sk_buff *skb , u16 vlan_tag ) { struct i40e_q_vector *q_vector ; struct i40e_vsi *vsi ; u64 flags ; { q_vector = rx_ring->q_vector; vsi = rx_ring->vsi; flags = (vsi->back)->flags; if (((int )vlan_tag & 4095) != 0) { { __vlan_hwaccel_put_tag(skb, 129, (int )vlan_tag); } } else { } if ((flags & 4096ULL) != 0ULL) { { netif_rx(skb); } } else { { napi_gro_receive(& q_vector->napi, skb); } } return; } } __inline static void i40e_rx_checksum(struct i40e_vsi *vsi , struct sk_buff *skb , u32 rx_status , u32 rx_error , u16 rx_ptype ) { bool ipv4_tunnel ; bool ipv6_tunnel ; __wsum rx_udp_csum ; __sum16 csum ; struct iphdr *iph ; struct iphdr *tmp ; int tmp___0 ; struct udphdr *tmp___1 ; { ipv4_tunnel = (unsigned int )rx_ptype - 59U <= 27U; ipv6_tunnel = (unsigned int )rx_ptype - 125U <= 27U; skb->encapsulation = (unsigned char )((int )ipv4_tunnel || (int )ipv6_tunnel); skb->ip_summed = 0U; if (((vsi->netdev)->features & 4294967296ULL) == 0ULL || (rx_status & 8U) == 0U) { return; } else { } if ((rx_status & 32768U) != 0U) { return; } else { } if ((rx_error & 56U) != 0U) { (vsi->back)->hw_csum_rx_error = (vsi->back)->hw_csum_rx_error + 1U; return; } else { } if ((int )ipv4_tunnel && (rx_status & 262144U) == 0U) { { tmp = ip_hdr((struct sk_buff const *)skb); skb->transport_header = ((unsigned int )skb->mac_header + (unsigned int )((__u16 )tmp->ihl) * 4U) + 14U; skb->transport_header = (unsigned int )skb->transport_header + ((unsigned int )skb->protocol == 129U || (unsigned int )skb->protocol == 43144U ? 4U : 0U); rx_udp_csum = udp_csum(skb); iph = ip_hdr((struct sk_buff const *)skb); tmp___0 = skb_transport_offset((struct sk_buff const *)skb); csum = csum_tcpudp_magic(iph->saddr, iph->daddr, (int )((unsigned short )skb->len) - (int )((unsigned short )tmp___0), 17, rx_udp_csum); tmp___1 = udp_hdr((struct sk_buff const *)skb); } if ((int )tmp___1->check != (int )csum) { (vsi->back)->hw_csum_rx_error = (vsi->back)->hw_csum_rx_error + 1U; return; } else { } } else { } skb->ip_summed = 1U; return; } } __inline static u32 i40e_rx_hash(struct i40e_ring *ring , union i40e_32byte_rx_desc *rx_desc ) { __le64 rss_mask ; { rss_mask = 12288ULL; if (((ring->netdev)->features & 2147483648ULL) != 0ULL && (rx_desc->wb.qword1.status_error_len & 12288ULL) == 12288ULL) { return (rx_desc->wb.qword0.hi_dword.rss); } else { return (0U); } } } static int i40e_clean_rx_irq(struct i40e_ring *rx_ring , int budget ) { unsigned int total_rx_bytes ; unsigned int total_rx_packets ; u16 rx_packet_len ; u16 rx_header_len ; u16 rx_sph ; u16 rx_hbo ; u16 cleaned_count ; int current_node ; int tmp ; struct i40e_vsi *vsi ; u16 i ; union i40e_32byte_rx_desc *rx_desc ; u32 rx_error ; u32 rx_status ; u64 qword ; u16 rx_ptype ; union i40e_32byte_rx_desc *next_rxd ; struct i40e_rx_buffer *rx_bi ; struct sk_buff *skb ; u16 vlan_tag ; bool tmp___0 ; u16 len ; unsigned char *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; struct i40e_rx_buffer *next_buffer ; int tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; { { total_rx_bytes = 0U; total_rx_packets = 0U; cleaned_count = ((((int )rx_ring->next_to_clean <= (int )rx_ring->next_to_use ? rx_ring->count : 0U) + (unsigned int )rx_ring->next_to_clean) - (unsigned int )rx_ring->next_to_use) + 65535U; tmp = numa_node_id(); current_node = tmp; vsi = rx_ring->vsi; i = rx_ring->next_to_clean; constant_test_bit(6L, (unsigned long const volatile *)(& rx_ring->state)); rx_desc = (union i40e_32byte_rx_desc *)rx_ring->desc + (unsigned long )i; qword = rx_desc->wb.qword1.status_error_len; rx_status = (u32 )qword & 32767U; } goto ldv_56966; ldv_56965: { tmp___0 = i40e_rx_is_programming_status(qword); } if ((int )tmp___0) { { i40e_clean_programming_status(rx_ring, rx_desc); i = (u16 )((int )i + 1); } if ((int )i == (int )rx_ring->count) { i = 0U; } else { } { constant_test_bit(6L, (unsigned long const volatile *)(& rx_ring->state)); next_rxd = (union i40e_32byte_rx_desc *)rx_ring->desc + (unsigned long )i; } goto next_desc; } else { } rx_bi = rx_ring->__annonCompField94.rx_bi + (unsigned long )i; skb = rx_bi->skb; rx_packet_len = (u16 )((qword & 4503324749463552ULL) >> 38); rx_header_len = (u16 )((qword & 9218868437227405312ULL) >> 52); rx_sph = (u16 )(qword >> 63); rx_error = (u32 )((qword & 133693440ULL) >> 19); rx_hbo = (unsigned int )((u16 )rx_error) & 4U; rx_error = rx_error & 4294967291U; rx_ptype = (u16 )((qword & 273804165120ULL) >> 30); rx_bi->skb = (struct sk_buff *)0; __asm__ volatile ("lfence": : : "memory"); if (rx_bi->dma != 0ULL) { if ((unsigned int )rx_hbo != 0U) { len = 512U; } else if ((unsigned int )rx_sph != 0U) { len = rx_header_len; } else if ((unsigned int )rx_packet_len != 0U) { len = rx_packet_len; } else { len = rx_header_len; } { skb_put(skb, (unsigned int )len); dma_unmap_single_attrs(rx_ring->dev, rx_bi->dma, (size_t )rx_ring->rx_buf_len, 2, (struct dma_attrs *)0); rx_bi->dma = 0ULL; } } else { } { tmp___4 = constant_test_bit(4L, (unsigned long const volatile *)(& rx_ring->state)); } if (tmp___4 != 0 && (unsigned int )rx_packet_len != 0U) { { tmp___1 = skb_end_pointer((struct sk_buff const *)skb); skb_fill_page_desc(skb, (int )((struct skb_shared_info *)tmp___1)->nr_frags, rx_bi->page, (int )rx_bi->page_offset, (int )rx_packet_len); skb->len = skb->len + (unsigned int )rx_packet_len; skb->data_len = skb->data_len + (unsigned int )rx_packet_len; skb->truesize = skb->truesize + (unsigned int )rx_packet_len; tmp___2 = page_count(rx_bi->page); } if (tmp___2 == 1) { { tmp___3 = page_to_nid((struct page const *)rx_bi->page); } if (tmp___3 == current_node) { { get_page(rx_bi->page); } } else { rx_bi->page = (struct page *)0; } } else { rx_bi->page = (struct page *)0; } { dma_unmap_page(rx_ring->dev, rx_bi->page_dma, 2048UL, 2); rx_bi->page_dma = 0ULL; } } else { } i = (u16 )((int )i + 1); if ((int )i == (int )rx_ring->count) { i = 0U; } else { } { constant_test_bit(6L, (unsigned long const volatile *)(& rx_ring->state)); next_rxd = (union i40e_32byte_rx_desc *)rx_ring->desc + (unsigned long )i; tmp___6 = ldv__builtin_expect((rx_status & 2U) == 0U, 0L); } if (tmp___6 != 0L) { { next_buffer = rx_ring->__annonCompField94.rx_bi + (unsigned long )i; tmp___5 = constant_test_bit(4L, (unsigned long const volatile *)(& rx_ring->state)); } if (tmp___5 != 0) { rx_bi->skb = next_buffer->skb; rx_bi->dma = next_buffer->dma; next_buffer->skb = skb; next_buffer->dma = 0ULL; } else { } rx_ring->__annonCompField95.rx_stats.non_eop_descs = rx_ring->__annonCompField95.rx_stats.non_eop_descs + 1ULL; goto next_desc; } else { } { tmp___7 = ldv__builtin_expect((long )((int )rx_error) & 1L, 0L); } if (tmp___7 != 0L) { { dev_kfree_skb_any(skb); } goto next_desc; } else { } { skb->rxhash = i40e_rx_hash(rx_ring, rx_desc); tmp___8 = ldv__builtin_expect(((unsigned long )rx_status & 128UL) != 0UL, 0L); } if (tmp___8 != 0L) { { i40e_ptp_rx_hwtstamp(vsi->back, skb, (int )((u8 )(((unsigned long )rx_status & 96UL) >> 5))); rx_ring->last_rx_timestamp = jiffies; } } else { } { total_rx_bytes = total_rx_bytes + skb->len; total_rx_packets = total_rx_packets + 1U; skb->protocol = eth_type_trans(skb, rx_ring->netdev); i40e_rx_checksum(vsi, skb, rx_status, rx_error, (int )rx_ptype); vlan_tag = (rx_status & 4U) != 0U ? rx_desc->wb.qword0.lo_dword.l2tag1 : 0U; i40e_receive_skb(rx_ring, skb, (int )vlan_tag); (rx_ring->netdev)->last_rx = jiffies; budget = budget - 1; } next_desc: rx_desc->wb.qword1.status_error_len = 0ULL; if (budget == 0) { goto ldv_56964; } else { } cleaned_count = (u16 )((int )cleaned_count + 1); if ((unsigned int )cleaned_count > 15U) { { i40e_alloc_rx_buffers(rx_ring, (int )cleaned_count); cleaned_count = 0U; } } else { } rx_desc = next_rxd; qword = rx_desc->wb.qword1.status_error_len; rx_status = (u32 )qword & 32767U; ldv_56966: ; if ((int )rx_status & 1) { goto ldv_56965; } else { } ldv_56964: { rx_ring->next_to_clean = i; u64_stats_update_begin(& rx_ring->syncp); rx_ring->stats.packets = rx_ring->stats.packets + (u64 )total_rx_packets; rx_ring->stats.bytes = rx_ring->stats.bytes + (u64 )total_rx_bytes; u64_stats_update_begin(& rx_ring->syncp); (rx_ring->q_vector)->rx.total_packets = (rx_ring->q_vector)->rx.total_packets + total_rx_packets; (rx_ring->q_vector)->rx.total_bytes = (rx_ring->q_vector)->rx.total_bytes + total_rx_bytes; } if ((unsigned int )cleaned_count != 0U) { { i40e_alloc_rx_buffers(rx_ring, (int )cleaned_count); } } else { } return (budget > 0); } } int i40e_napi_poll(struct napi_struct *napi , int budget ) { struct i40e_q_vector *q_vector ; struct napi_struct const *__mptr ; struct i40e_vsi *vsi ; struct i40e_ring *ring ; bool clean_complete ; int budget_per_ring ; int tmp ; bool tmp___0 ; int _max1 ; int _max2 ; int tmp___1 ; struct i40e_hw *hw ; u32 qval ; unsigned int tmp___2 ; int tmp___3 ; { { __mptr = (struct napi_struct const *)napi; q_vector = (struct i40e_q_vector *)__mptr + 0xfffffffffffffff0UL; vsi = q_vector->vsi; clean_complete = 1; tmp = constant_test_bit(3L, (unsigned long const volatile *)(& vsi->state)); } if (tmp != 0) { { napi_complete(napi); } return (0); } else { } ring = q_vector->tx.ring; goto ldv_56979; ldv_56978: { tmp___0 = i40e_clean_tx_irq(ring, (int )vsi->work_limit); clean_complete = ((int )clean_complete & (int )tmp___0) != 0; ring = ring->next; } ldv_56979: ; if ((unsigned long )ring != (unsigned long )((struct i40e_ring *)0)) { goto ldv_56978; } else { } _max1 = budget / (int )q_vector->num_ringpairs; _max2 = 1; budget_per_ring = _max1 > _max2 ? _max1 : _max2; ring = q_vector->rx.ring; goto ldv_56985; ldv_56984: { tmp___1 = i40e_clean_rx_irq(ring, budget_per_ring); clean_complete = ((int )clean_complete & tmp___1) != 0; ring = ring->next; } ldv_56985: ; if ((unsigned long )ring != (unsigned long )((struct i40e_ring *)0)) { goto ldv_56984; } else { } if (! clean_complete) { return (budget); } else { } { napi_complete(napi); } if ((int )((short )vsi->rx_itr_setting) < 0 || (int )((short )vsi->tx_itr_setting) < 0) { { i40e_update_dynamic_itr(q_vector); } } else { } { tmp___3 = constant_test_bit(3L, (unsigned long const volatile *)(& vsi->state)); } if (tmp___3 == 0) { if (((vsi->back)->flags & 8ULL) != 0ULL) { { i40e_irq_dynamic_enable(vsi, (int )q_vector->v_idx + vsi->base_vector); } } else { { hw = & (vsi->back)->hw; tmp___2 = readl((void const volatile *)hw->hw_addr + 237568U); qval = tmp___2; qval = qval | 1073741824U; writel(qval, (void volatile *)hw->hw_addr + 237568U); qval = readl((void const volatile *)hw->hw_addr + 245760U); qval = qval | 1073741824U; writel(qval, (void volatile *)hw->hw_addr + 245760U); i40e_irq_dynamic_enable_icr0(vsi->back); } } } else { } return (0); } } static void i40e_atr(struct i40e_ring *tx_ring , struct sk_buff *skb , u32 flags , __be16 protocol ) { struct i40e_filter_program_desc *fdir_desc ; struct i40e_pf *pf ; union __anonunion_hdr_324 hdr ; struct tcphdr *th ; unsigned int hlen ; u32 flex_ptype ; u32 dtype_cmd ; u16 i ; { pf = (tx_ring->vsi)->back; if ((pf->flags & 4194304ULL) == 0ULL) { return; } else { } if ((unsigned int )tx_ring->atr_sample_rate == 0U) { return; } else { } { tx_ring->atr_count = (u8 )((int )tx_ring->atr_count + 1); hdr.network = skb_network_header((struct sk_buff const *)skb); } if ((unsigned int )protocol == 8U) { if ((unsigned int )(hdr.ipv4)->protocol != 6U) { return; } else { } hlen = (unsigned int )(((int )*(hdr.network) & 15) << 2); } else if ((unsigned int )protocol == 56710U) { if ((unsigned int )(hdr.ipv6)->nexthdr != 6U) { return; } else { } hlen = 40U; } else { return; } th = (struct tcphdr *)hdr.network + (unsigned long )hlen; if ((unsigned int )*((unsigned char *)th + 13UL) == 0U && (int )tx_ring->atr_count < (int )tx_ring->atr_sample_rate) { return; } else { } tx_ring->atr_count = 0U; i = tx_ring->next_to_use; fdir_desc = (struct i40e_filter_program_desc *)tx_ring->desc + (unsigned long )i; i = (u16 )((int )i + 1); tx_ring->next_to_use = (int )i < (int )tx_ring->count ? i : 0U; flex_ptype = (u32 )tx_ring->queue_index & 2047U; flex_ptype = flex_ptype | ((unsigned int )protocol == 8U ? 4325376U : 5636096U); flex_ptype = flex_ptype | (u32 )((int )(tx_ring->vsi)->id << 23); dtype_cmd = 8U; dtype_cmd = dtype_cmd | ((unsigned int )*((unsigned char *)th + 13UL) != 0U ? 32U : 16U); dtype_cmd = dtype_cmd | 128U; dtype_cmd = dtype_cmd | 8192U; fdir_desc->qindex_flex_ptype_vsi = flex_ptype; fdir_desc->dtype_cmd_cntindex = dtype_cmd; return; } } static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb , struct i40e_ring *tx_ring , u32 *flags ) { __be16 protocol ; u32 tx_flags ; struct vlan_hdr *vhdr ; struct vlan_hdr _vhdr ; void *tmp ; __u16 tmp___0 ; struct vlan_ethhdr *vhdr___0 ; int tmp___1 ; int tmp___2 ; __u16 tmp___3 ; { protocol = skb->protocol; tx_flags = 0U; if (((int )skb->vlan_tci & 4096) != 0) { tx_flags = tx_flags | (u32 )(((int )skb->vlan_tci & -4097) << 16); tx_flags = tx_flags | 2U; } else if ((unsigned int )protocol == 129U) { { tmp = skb_header_pointer((struct sk_buff const *)skb, 14, 4, (void *)(& _vhdr)); vhdr = (struct vlan_hdr *)tmp; } if ((unsigned long )vhdr == (unsigned long )((struct vlan_hdr *)0)) { return (-22); } else { } { protocol = vhdr->h_vlan_encapsulated_proto; tmp___0 = __fswab16((int )vhdr->h_vlan_TCI); tx_flags = tx_flags | (u32 )((int )tmp___0 << 16); tx_flags = tx_flags | 4U; } } else { } if ((((tx_ring->vsi)->back)->flags & 1048576ULL) != 0ULL && ((tx_flags & 6U) != 0U || skb->priority != 7U)) { tx_flags = tx_flags & 536870911U; tx_flags = tx_flags | (skb->priority << 29); if ((tx_flags & 4U) != 0U) { { tmp___1 = skb_header_cloned((struct sk_buff const *)skb); } if (tmp___1 != 0) { { tmp___2 = pskb_expand_head(skb, 0, 0, 32U); } if (tmp___2 != 0) { return (-12); } else { } } else { } { vhdr___0 = (struct vlan_ethhdr *)skb->data; tmp___3 = __fswab16((int )((__u16 )(tx_flags >> 16))); vhdr___0->h_vlan_TCI = tmp___3; } } else { tx_flags = tx_flags | 2U; } } else { } *flags = tx_flags; return (0); } } static int i40e_tso(struct i40e_ring *tx_ring , struct sk_buff *skb , u32 tx_flags , __be16 protocol , u8 *hdr_len , u64 *cd_type_cmd_tso_mss , u32 *cd_tunneling ) { u32 cd_cmd ; u32 cd_tso_len ; u32 cd_mss ; struct tcphdr *tcph ; struct iphdr *iph ; u32 l4len ; int err ; struct ipv6hdr *ipv6h ; bool tmp ; int tmp___0 ; int tmp___1 ; struct iphdr *tmp___2 ; struct iphdr *tmp___3 ; struct tcphdr *tmp___4 ; struct tcphdr *tmp___5 ; __sum16 tmp___6 ; struct ipv6hdr *tmp___7 ; struct ipv6hdr *tmp___8 ; struct tcphdr *tmp___9 ; struct tcphdr *tmp___10 ; __sum16 tmp___11 ; bool tmp___12 ; unsigned int tmp___13 ; unsigned int tmp___14 ; unsigned char *tmp___15 ; int tmp___16 ; int tmp___17 ; unsigned char *tmp___18 ; { { tmp = skb_is_gso((struct sk_buff const *)skb); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (0); } else { } { tmp___1 = skb_header_cloned((struct sk_buff const *)skb); } if (tmp___1 != 0) { { err = pskb_expand_head(skb, 0, 0, 32U); } if (err != 0) { return (err); } else { } } else { } if ((unsigned int )protocol == 8U) { if ((unsigned int )*((unsigned char *)skb + 171UL) != 0U) { { tmp___2 = inner_ip_hdr((struct sk_buff const *)skb); iph = tmp___2; } } else { { tmp___3 = ip_hdr((struct sk_buff const *)skb); iph = tmp___3; } } if ((unsigned int )*((unsigned char *)skb + 171UL) != 0U) { { tmp___4 = inner_tcp_hdr((struct sk_buff const *)skb); tcph = tmp___4; } } else { { tmp___5 = tcp_hdr((struct sk_buff const *)skb); tcph = tmp___5; } } { iph->tot_len = 0U; iph->check = 0U; tmp___6 = csum_tcpudp_magic(iph->saddr, iph->daddr, 0, 6, 0U); tcph->check = ~ ((int )tmp___6); } } else { { tmp___12 = skb_is_gso_v6((struct sk_buff const *)skb); } if ((int )tmp___12) { if ((unsigned int )*((unsigned char *)skb + 171UL) != 0U) { { tmp___7 = inner_ipv6_hdr((struct sk_buff const *)skb); ipv6h = tmp___7; } } else { { tmp___8 = ipv6_hdr((struct sk_buff const *)skb); ipv6h = tmp___8; } } if ((unsigned int )*((unsigned char *)skb + 171UL) != 0U) { { tmp___9 = inner_tcp_hdr((struct sk_buff const *)skb); tcph = tmp___9; } } else { { tmp___10 = tcp_hdr((struct sk_buff const *)skb); tcph = tmp___10; } } { ipv6h->payload_len = 0U; tmp___11 = csum_ipv6_magic((struct in6_addr const *)(& ipv6h->saddr), (struct in6_addr const *)(& ipv6h->daddr), 0U, 6, 0U); tcph->check = ~ ((int )tmp___11); } } else { } } if ((unsigned int )*((unsigned char *)skb + 171UL) != 0U) { { tmp___13 = inner_tcp_hdrlen((struct sk_buff const *)skb); l4len = tmp___13; } } else { { tmp___14 = tcp_hdrlen((struct sk_buff const *)skb); l4len = tmp___14; } } if ((unsigned int )*((unsigned char *)skb + 171UL) != 0U) { { tmp___15 = skb_inner_transport_header((struct sk_buff const *)skb); tmp___17 = (int )((u8 )((long )tmp___15)) - (int )((u8 )((long )skb->data)); } } else { { tmp___16 = skb_transport_offset((struct sk_buff const *)skb); tmp___17 = (u8 )tmp___16; } } { *hdr_len = tmp___17 + (int )((u8 )l4len); cd_cmd = 1U; cd_tso_len = skb->len - (unsigned int )*hdr_len; tmp___18 = skb_end_pointer((struct sk_buff const *)skb); cd_mss = (u32 )((struct skb_shared_info *)tmp___18)->gso_size; *cd_type_cmd_tso_mss = *cd_type_cmd_tso_mss | ((((unsigned long long )cd_cmd << 4) | ((unsigned long long )cd_tso_len << 30)) | ((unsigned long long )cd_mss << 50)); } return (1); } } static int i40e_tsyn(struct i40e_ring *tx_ring , struct sk_buff *skb , u32 tx_flags , u64 *cd_type_cmd_tso_mss ) { struct i40e_pf *pf ; unsigned char *tmp ; long tmp___0 ; unsigned char *tmp___1 ; unsigned char *tmp___2 ; { { tmp = skb_end_pointer((struct sk_buff const *)skb); tmp___0 = ldv__builtin_expect(((int )((struct skb_shared_info *)tmp)->tx_flags & 1) == 0, 1L); } if (tmp___0 != 0L) { return (0); } else { } if ((tx_flags & 8U) != 0U) { return (0); } else { } { pf = i40e_netdev_to_pf(tx_ring->netdev); } if ((int )pf->ptp_tx && (unsigned long )pf->ptp_tx_skb == (unsigned long )((struct sk_buff *)0)) { { tmp___1 = skb_end_pointer((struct sk_buff const *)skb); tmp___2 = skb_end_pointer((struct sk_buff const *)skb); ((struct skb_shared_info *)tmp___1)->tx_flags = (__u8 )((unsigned int )((struct skb_shared_info *)tmp___2)->tx_flags | 4U); pf->ptp_tx_skb = skb_get(skb); } } else { return (0); } { *cd_type_cmd_tso_mss = *cd_type_cmd_tso_mss | 32ULL; pf->ptp_tx_start = jiffies; schedule_work(& pf->ptp_tx_work); } return (1); } } static void i40e_tx_enable_csum(struct sk_buff *skb , u32 tx_flags , u32 *td_cmd , u32 *td_offset , struct i40e_ring *tx_ring , u32 *cd_tunneling ) { struct ipv6hdr *this_ipv6_hdr ; unsigned int this_tcp_hdrlen ; struct iphdr *this_ip_hdr ; u32 network_hdr_len ; u8 l4_hdr ; struct iphdr *tmp ; struct iphdr *tmp___0 ; u32 tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { l4_hdr = 0U; if ((unsigned int )*((unsigned char *)skb + 171UL) != 0U) { { network_hdr_len = skb_inner_network_header_len((struct sk_buff const *)skb); this_ip_hdr = inner_ip_hdr((struct sk_buff const *)skb); this_ipv6_hdr = inner_ipv6_hdr((struct sk_buff const *)skb); this_tcp_hdrlen = inner_tcp_hdrlen((struct sk_buff const *)skb); } if ((tx_flags & 16U) != 0U) { if ((tx_flags & 8U) != 0U) { { *cd_tunneling = *cd_tunneling | 3U; tmp = ip_hdr((struct sk_buff const *)skb); tmp->check = 0U; } } else { *cd_tunneling = *cd_tunneling | 2U; } } else if ((tx_flags & 32U) != 0U) { if ((tx_flags & 8U) != 0U) { { *cd_tunneling = *cd_tunneling | 1U; tmp___0 = ip_hdr((struct sk_buff const *)skb); tmp___0->check = 0U; } } else { *cd_tunneling = *cd_tunneling | 2U; } } else { } { tmp___1 = skb_network_header_len((struct sk_buff const *)skb); tmp___2 = skb_inner_network_offset((struct sk_buff const *)skb); tmp___3 = skb_transport_offset((struct sk_buff const *)skb); *cd_tunneling = (*cd_tunneling | ((tmp___1 & 4294966780U) | (u32 )(((tmp___2 - tmp___3) >> 1) << 12))) | 512U; } } else { { network_hdr_len = skb_network_header_len((struct sk_buff const *)skb); this_ip_hdr = ip_hdr((struct sk_buff const *)skb); this_ipv6_hdr = ipv6_hdr((struct sk_buff const *)skb); this_tcp_hdrlen = tcp_hdrlen((struct sk_buff const *)skb); } } if ((tx_flags & 16U) != 0U) { l4_hdr = this_ip_hdr->protocol; if ((tx_flags & 8U) != 0U) { *td_cmd = *td_cmd | 96U; this_ip_hdr->check = 0U; } else { *td_cmd = *td_cmd | 64U; } *td_offset = (network_hdr_len >> 2) << 7; } else if ((tx_flags & 32U) != 0U) { l4_hdr = this_ipv6_hdr->nexthdr; *td_cmd = *td_cmd | 32U; *td_offset = (network_hdr_len >> 2) << 7; } else { } { tmp___4 = skb_network_offset((struct sk_buff const *)skb); *td_offset = *td_offset | (u32 )(tmp___4 >> 1); } { if ((int )l4_hdr == 6) { goto case_6; } else { } if ((int )l4_hdr == 132) { goto case_132; } else { } if ((int )l4_hdr == 17) { goto case_17; } else { } goto switch_default; case_6: /* CIL Label */ *td_cmd = *td_cmd | 256U; *td_offset = *td_offset | ((this_tcp_hdrlen >> 2) << 14); goto ldv_57055; case_132: /* CIL Label */ *td_cmd = *td_cmd | 512U; *td_offset = *td_offset | 49152U; goto ldv_57055; case_17: /* CIL Label */ *td_cmd = *td_cmd | 768U; *td_offset = *td_offset | 32768U; goto ldv_57055; switch_default: /* CIL Label */ ; goto ldv_57055; switch_break: /* CIL Label */ ; } ldv_57055: ; return; } } static void i40e_create_tx_ctx(struct i40e_ring *tx_ring , u64 const cd_type_cmd_tso_mss , u32 const cd_tunneling , u32 const cd_l2tag2 ) { struct i40e_tx_context_desc *context_desc ; int i ; { i = (int )tx_ring->next_to_use; if (((unsigned long long )cd_type_cmd_tso_mss == 0ULL && (unsigned int )cd_tunneling == 0U) && (unsigned int )cd_l2tag2 == 0U) { return; } else { } context_desc = (struct i40e_tx_context_desc *)tx_ring->desc + (unsigned long )i; i = i + 1; tx_ring->next_to_use = i < (int )tx_ring->count ? (u16 )i : 0U; context_desc->tunneling_params = cd_tunneling; context_desc->l2tag2 = (unsigned short )cd_l2tag2; context_desc->type_cmd_tso_mss = cd_type_cmd_tso_mss; return; } } static void i40e_tx_map(struct i40e_ring *tx_ring , struct sk_buff *skb , struct i40e_tx_buffer *first , u32 tx_flags , u8 const hdr_len , u32 td_cmd , u32 td_offset ) { unsigned int data_len ; unsigned int size ; unsigned int tmp ; struct skb_frag_struct *frag ; struct i40e_tx_buffer *tx_bi ; struct i40e_tx_desc *tx_desc ; u16 i ; u32 td_tag ; dma_addr_t dma ; u16 gso_segs ; unsigned char *tmp___0 ; unsigned char *tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; __le64 tmp___5 ; struct netdev_queue *tmp___6 ; { { data_len = skb->data_len; tmp = skb_headlen((struct sk_buff const *)skb); size = tmp; i = tx_ring->next_to_use; td_tag = 0U; } if ((tx_flags & 2U) != 0U) { td_cmd = td_cmd | 8U; td_tag = tx_flags >> 16; } else { } if ((tx_flags & 136U) != 0U) { { tmp___0 = skb_end_pointer((struct sk_buff const *)skb); gso_segs = ((struct skb_shared_info *)tmp___0)->gso_segs; } } else { gso_segs = 1U; } { first->bytecount = (skb->len - (unsigned int )hdr_len) + (unsigned int )((int )gso_segs * (int )hdr_len); first->gso_segs = gso_segs; first->skb = skb; first->tx_flags = tx_flags; dma = dma_map_single_attrs(tx_ring->dev, (void *)skb->data, (size_t )size, 1, (struct dma_attrs *)0); tx_desc = (struct i40e_tx_desc *)tx_ring->desc + (unsigned long )i; tx_bi = first; tmp___1 = skb_end_pointer((struct sk_buff const *)skb); frag = (struct skb_frag_struct *)(& ((struct skb_shared_info *)tmp___1)->frags); } ldv_57090: { tmp___2 = dma_mapping_error(tx_ring->dev, dma); } if (tmp___2 != 0) { goto dma_error; } else { } tx_bi->len = size; tx_bi->dma = dma; tx_desc->buffer_addr = dma; goto ldv_57087; ldv_57086: { tx_desc->cmd_type_offset_bsz = build_ctob(td_cmd, td_offset, 16383U, td_tag); tx_desc = tx_desc + 1; i = (u16 )((int )i + 1); } if ((int )i == (int )tx_ring->count) { tx_desc = (struct i40e_tx_desc *)tx_ring->desc; i = 0U; } else { } dma = dma + 16383ULL; size = size - 16383U; tx_desc->buffer_addr = dma; ldv_57087: { tmp___3 = ldv__builtin_expect(size > 16383U, 0L); } if (tmp___3 != 0L) { goto ldv_57086; } else { } { tmp___4 = ldv__builtin_expect(data_len == 0U, 1L); } if (tmp___4 != 0L) { goto ldv_57089; } else { } { tx_desc->cmd_type_offset_bsz = build_ctob(td_cmd, td_offset, size, td_tag); tx_desc = tx_desc + 1; i = (u16 )((int )i + 1); } if ((int )i == (int )tx_ring->count) { tx_desc = (struct i40e_tx_desc *)tx_ring->desc; i = 0U; } else { } { size = skb_frag_size((skb_frag_t const *)frag); data_len = data_len - size; dma = skb_frag_dma_map(tx_ring->dev, (skb_frag_t const *)frag, 0UL, (size_t )size, 1); tx_bi = tx_ring->__annonCompField94.tx_bi + (unsigned long )i; frag = frag + 1; } goto ldv_57090; ldv_57089: { tmp___5 = build_ctob(td_cmd, td_offset, size, td_tag); tx_desc->cmd_type_offset_bsz = tmp___5 | 48ULL; tmp___6 = netdev_get_tx_queue((struct net_device const *)tx_ring->netdev, (unsigned int )tx_ring->queue_index); netdev_tx_sent_queue(tmp___6, first->bytecount); first->time_stamp = jiffies; __asm__ volatile ("sfence": : : "memory"); first->next_to_watch = tx_desc; i = (u16 )((int )i + 1); } if ((int )i == (int )tx_ring->count) { i = 0U; } else { } { tx_ring->next_to_use = i; writel((unsigned int )i, (void volatile *)tx_ring->tail); } return; dma_error: { _dev_info((struct device const *)tx_ring->dev, "TX DMA map failed\n"); } ldv_57092: { tx_bi = tx_ring->__annonCompField94.tx_bi + (unsigned long )i; i40e_unmap_and_free_tx_resource(tx_ring, tx_bi); } if ((unsigned long )tx_bi == (unsigned long )first) { goto ldv_57091; } else { } if ((unsigned int )i == 0U) { i = tx_ring->count; } else { } i = (u16 )((int )i - 1); goto ldv_57092; ldv_57091: tx_ring->next_to_use = i; return; } } __inline static int __i40e_maybe_stop_tx(struct i40e_ring *tx_ring , int size ) { long tmp ; { { netif_stop_subqueue(tx_ring->netdev, (int )tx_ring->queue_index); __asm__ volatile ("mfence": : : "memory"); tmp = ldv__builtin_expect(((((int )tx_ring->next_to_clean <= (int )tx_ring->next_to_use ? (int )tx_ring->count : 0) + (int )tx_ring->next_to_clean) - (int )tx_ring->next_to_use) + -1 < size, 1L); } if (tmp != 0L) { return (-16); } else { } { netif_start_subqueue(tx_ring->netdev, (int )tx_ring->queue_index); tx_ring->__annonCompField95.tx_stats.restart_queue = tx_ring->__annonCompField95.tx_stats.restart_queue + 1ULL; } return (0); } } static int i40e_maybe_stop_tx(struct i40e_ring *tx_ring , int size ) { long tmp ; int tmp___0 ; { { tmp = ldv__builtin_expect(((((int )tx_ring->next_to_clean <= (int )tx_ring->next_to_use ? (int )tx_ring->count : 0) + (int )tx_ring->next_to_clean) - (int )tx_ring->next_to_use) + -1 >= size, 1L); } if (tmp != 0L) { return (0); } else { } { tmp___0 = __i40e_maybe_stop_tx(tx_ring, size); } return (tmp___0); } } static int i40e_xmit_descriptor_count(struct sk_buff *skb , struct i40e_ring *tx_ring ) { int count ; unsigned char *tmp ; unsigned int tmp___0 ; int tmp___1 ; { { count = 0; tmp = skb_end_pointer((struct sk_buff const *)skb); count = count + (int )((struct skb_shared_info *)tmp)->nr_frags; tmp___0 = skb_headlen((struct sk_buff const *)skb); count = (int )((unsigned int )count + (tmp___0 + 16382U) / 16383U); tmp___1 = i40e_maybe_stop_tx(tx_ring, count + 3); } if (tmp___1 != 0) { tx_ring->__annonCompField95.tx_stats.tx_busy = tx_ring->__annonCompField95.tx_stats.tx_busy + 1ULL; return (0); } else { } return (count); } } static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb , struct i40e_ring *tx_ring ) { u64 cd_type_cmd_tso_mss ; u32 cd_tunneling ; u32 cd_l2tag2 ; struct i40e_tx_buffer *first ; u32 td_offset ; u32 tx_flags ; __be16 protocol ; u32 td_cmd ; u8 hdr_len ; int tsyn ; int tso ; int tmp ; int tmp___0 ; { { cd_type_cmd_tso_mss = 1ULL; cd_tunneling = 0U; cd_l2tag2 = 0U; td_offset = 0U; tx_flags = 0U; td_cmd = 0U; hdr_len = 0U; tmp = i40e_xmit_descriptor_count(skb, tx_ring); } if (tmp == 0) { return (16); } else { } { tmp___0 = i40e_tx_prepare_vlan_flags(skb, tx_ring, & tx_flags); } if (tmp___0 != 0) { goto out_drop; } else { } protocol = skb->protocol; first = tx_ring->__annonCompField94.tx_bi + (unsigned long )tx_ring->next_to_use; if ((unsigned int )protocol == 8U) { tx_flags = tx_flags | 16U; } else if ((unsigned int )protocol == 56710U) { tx_flags = tx_flags | 32U; } else { } { tso = i40e_tso(tx_ring, skb, tx_flags, (int )protocol, & hdr_len, & cd_type_cmd_tso_mss, & cd_tunneling); } if (tso < 0) { goto out_drop; } else if (tso != 0) { tx_flags = tx_flags | 8U; } else { } { skb_tx_timestamp(skb); tsyn = i40e_tsyn(tx_ring, skb, tx_flags, & cd_type_cmd_tso_mss); } if (tsyn != 0) { tx_flags = tx_flags | 256U; } else { } td_cmd = td_cmd | 4U; if ((unsigned int )*((unsigned char *)skb + 124UL) == 12U) { { tx_flags = tx_flags | 1U; i40e_tx_enable_csum(skb, tx_flags, & td_cmd, & td_offset, tx_ring, & cd_tunneling); } } else { } { i40e_create_tx_ctx(tx_ring, cd_type_cmd_tso_mss, cd_tunneling, cd_l2tag2); i40e_atr(tx_ring, skb, tx_flags, (int )protocol); i40e_tx_map(tx_ring, skb, first, tx_flags, (int )hdr_len, td_cmd, td_offset); i40e_maybe_stop_tx(tx_ring, 21); } return (0); out_drop: { dev_kfree_skb_any(skb); } return (0); } } netdev_tx_t i40e_lan_xmit_frame(struct sk_buff *skb , struct net_device *netdev ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_ring *tx_ring ; int tmp___0 ; long tmp___1 ; netdev_tx_t tmp___2 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; tx_ring = *(vsi->tx_rings + (unsigned long )skb->queue_mapping); tmp___1 = ldv__builtin_expect(skb->len <= 16U, 0L); } if (tmp___1 != 0L) { { tmp___0 = skb_pad(skb, (int )(17U - skb->len)); } if (tmp___0 != 0) { return (0); } else { } { skb->len = 17U; skb_set_tail_pointer(skb, 17); } } else { } { tmp___2 = i40e_xmit_frame_ring(skb, tx_ring); } return (tmp___2); } } long ldv_is_err(void const *ptr ) ; __inline static long IS_ERR(void const *ptr ) ; extern char *strncpy(char * , char const * , __kernel_size_t ) ; __inline static u64 div_u64_rem(u64 dividend , u32 divisor , u32 *remainder ) { { *remainder = (u32 )(dividend % (u64 )divisor); return (dividend / (u64 )divisor); } } __inline static u64 div_u64(u64 dividend , u32 divisor ) { u32 remainder ; u64 tmp ; { { tmp = div_u64_rem(dividend, divisor, & remainder); } return (tmp); } } extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern unsigned long _raw_spin_lock_irqsave(raw_spinlock_t * ) ; extern void _raw_spin_unlock_irqrestore(raw_spinlock_t * , unsigned long ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->__annonCompField19.rlock); } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { { _raw_spin_unlock_irqrestore(& lock->__annonCompField19.rlock, flags); } return; } } extern void set_normalized_timespec(struct timespec * , time_t , s64 ) ; __inline static struct timespec timespec_add(struct timespec lhs , struct timespec rhs ) { struct timespec ts_delta ; { { set_normalized_timespec(& ts_delta, lhs.tv_sec + rhs.tv_sec, (s64 )(lhs.tv_nsec + rhs.tv_nsec)); } return (ts_delta); } } __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 ) ; __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_real(void) ; __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); } } extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info * , struct device * ) ; extern int ptp_clock_unregister(struct ptp_clock * ) ; static void i40e_ptp_read(struct i40e_pf *pf , struct timespec *ts ) { struct i40e_hw *hw ; u32 hi ; u32 lo ; u64 ns ; { { hw = & pf->hw; lo = readl((void const volatile *)hw->hw_addr + 1982720U); hi = readl((void const volatile *)hw->hw_addr + 1982752U); ns = ((unsigned long long )hi << 32) | (unsigned long long )lo; *ts = ns_to_timespec((s64 const )ns); } return; } } static void i40e_ptp_write(struct i40e_pf *pf , struct timespec const *ts ) { struct i40e_hw *hw ; u64 ns ; s64 tmp ; { { hw = & pf->hw; tmp = timespec_to_ns(ts); ns = (u64 )tmp; writel((unsigned int )ns, (void volatile *)hw->hw_addr + 1982720U); writel((unsigned int )(ns >> 32), (void volatile *)hw->hw_addr + 1982752U); } return; } } static void i40e_ptp_convert_to_hwtstamp(struct skb_shared_hwtstamps *hwtstamps , u64 timestamp ) { { { memset((void *)hwtstamps, 0, 16UL); hwtstamps->hwtstamp = ns_to_ktime(timestamp); } return; } } static int i40e_ptp_adjfreq(struct ptp_clock_info *ptp , s32 ppb ) { struct i40e_pf *pf ; struct ptp_clock_info const *__mptr ; struct i40e_hw *hw ; u64 adj ; u64 freq ; u64 diff ; int neg_adj ; { __mptr = (struct ptp_clock_info const *)ptp; pf = (struct i40e_pf *)__mptr + 0xfffffffffffff188UL; hw = & pf->hw; neg_adj = 0; if (ppb < 0) { neg_adj = 1; ppb = - ppb; } else { } { __asm__ volatile ("mfence": : : "memory"); adj = *((u64 volatile *)(& pf->ptp_base_adj)); freq = adj; freq = freq * (u64 )ppb; diff = div_u64(freq, 1000000000U); } if (neg_adj != 0) { adj = adj - diff; } else { adj = adj + diff; } { writel((unsigned int )adj, (void volatile *)hw->hw_addr + 1982528U); writel((unsigned int )(adj >> 32), (void volatile *)hw->hw_addr + 1982560U); } return (0); } } static int i40e_ptp_adjtime(struct ptp_clock_info *ptp , s64 delta ) { struct i40e_pf *pf ; struct ptp_clock_info const *__mptr ; struct timespec now ; struct timespec then ; struct timespec tmp ; unsigned long flags ; raw_spinlock_t *tmp___0 ; { { __mptr = (struct ptp_clock_info const *)ptp; pf = (struct i40e_pf *)__mptr + 0xfffffffffffff188UL; tmp = ns_to_timespec(delta); then = tmp; tmp___0 = spinlock_check(& pf->tmreg_lock); flags = _raw_spin_lock_irqsave(tmp___0); i40e_ptp_read(pf, & now); now = timespec_add(now, then); i40e_ptp_write(pf, (struct timespec const *)(& now)); spin_unlock_irqrestore(& pf->tmreg_lock, flags); } return (0); } } static int i40e_ptp_gettime(struct ptp_clock_info *ptp , struct timespec *ts ) { struct i40e_pf *pf ; struct ptp_clock_info const *__mptr ; unsigned long flags ; raw_spinlock_t *tmp ; { { __mptr = (struct ptp_clock_info const *)ptp; pf = (struct i40e_pf *)__mptr + 0xfffffffffffff188UL; tmp = spinlock_check(& pf->tmreg_lock); flags = _raw_spin_lock_irqsave(tmp); i40e_ptp_read(pf, ts); spin_unlock_irqrestore(& pf->tmreg_lock, flags); } return (0); } } static int i40e_ptp_settime(struct ptp_clock_info *ptp , struct timespec const *ts ) { struct i40e_pf *pf ; struct ptp_clock_info const *__mptr ; unsigned long flags ; raw_spinlock_t *tmp ; { { __mptr = (struct ptp_clock_info const *)ptp; pf = (struct i40e_pf *)__mptr + 0xfffffffffffff188UL; tmp = spinlock_check(& pf->tmreg_lock); flags = _raw_spin_lock_irqsave(tmp); i40e_ptp_write(pf, ts); spin_unlock_irqrestore(& pf->tmreg_lock, flags); } return (0); } } static void i40e_ptp_tx_work(struct work_struct *work ) { struct i40e_pf *pf ; struct work_struct const *__mptr ; struct i40e_hw *hw ; u32 prttsyn_stat_0 ; { __mptr = (struct work_struct const *)work; pf = (struct i40e_pf *)__mptr + 0xfffffffffffff128UL; hw = & pf->hw; if ((unsigned long )pf->ptp_tx_skb == (unsigned long )((struct sk_buff *)0)) { return; } else { } if ((long )((pf->ptp_tx_start - (unsigned long )jiffies) + 3750UL) < 0L) { { dev_kfree_skb_any(pf->ptp_tx_skb); pf->ptp_tx_skb = (struct sk_buff *)0; pf->tx_hwtstamp_timeouts = pf->tx_hwtstamp_timeouts + 1U; dev_warn((struct device const *)(& (pf->pdev)->dev), "clearing Tx timestamp hang"); } return; } else { } { prttsyn_stat_0 = readl((void const volatile *)hw->hw_addr + 1983008U); } if ((prttsyn_stat_0 & 16U) != 0U) { { i40e_ptp_tx_hwtstamp(pf); } } else { { schedule_work(& pf->ptp_tx_work); } } return; } } static int i40e_ptp_enable(struct ptp_clock_info *ptp , struct ptp_clock_request *rq , int on ) { { return (-95); } } void i40e_ptp_rx_hang(struct i40e_vsi *vsi ) { struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_ring *rx_ring ; unsigned long rx_event ; u32 prttsyn_stat ; int n ; { pf = vsi->back; hw = & pf->hw; if ((pf->flags & 33554432ULL) != 0ULL) { return; } else { } { prttsyn_stat = readl((void const volatile *)hw->hw_addr + 545088U); } if ((prttsyn_stat & 85U) == 0U) { pf->last_rx_ptp_check = jiffies; return; } else { } rx_event = pf->last_rx_ptp_check; n = 0; goto ldv_56876; ldv_56875: rx_ring = *(vsi->rx_rings + (unsigned long )n); if ((long )(rx_event - rx_ring->last_rx_timestamp) < 0L) { rx_event = rx_ring->last_rx_timestamp; } else { } n = n + 1; ldv_56876: ; if (n < (int )vsi->num_queue_pairs) { goto ldv_56875; } else { } if ((long )((rx_event - (unsigned long )jiffies) + 1250UL) < 0L) { { readl((void const volatile *)hw->hw_addr + 544832U); readl((void const volatile *)hw->hw_addr + 544864U); readl((void const volatile *)hw->hw_addr + 544896U); readl((void const volatile *)hw->hw_addr + 544928U); pf->last_rx_ptp_check = jiffies; pf->rx_hwtstamp_cleared = pf->rx_hwtstamp_cleared + 1U; dev_warn((struct device const *)(& ((vsi->back)->pdev)->dev), "%s: clearing Rx timestamp hang", "i40e_ptp_rx_hang"); } } else { } return; } } void i40e_ptp_tx_hwtstamp(struct i40e_pf *pf ) { struct skb_shared_hwtstamps shhwtstamps ; struct i40e_hw *hw ; u32 hi ; u32 lo ; u64 ns ; { { hw = & pf->hw; lo = readl((void const volatile *)hw->hw_addr + 1982912U); hi = readl((void const volatile *)hw->hw_addr + 1982944U); ns = ((unsigned long long )hi << 32) | (unsigned long long )lo; i40e_ptp_convert_to_hwtstamp(& shhwtstamps, ns); skb_tstamp_tx(pf->ptp_tx_skb, & shhwtstamps); dev_kfree_skb_any(pf->ptp_tx_skb); pf->ptp_tx_skb = (struct sk_buff *)0; } return; } } void i40e_ptp_rx_hwtstamp(struct i40e_pf *pf , struct sk_buff *skb , u8 index ) { u32 prttsyn_stat ; u32 hi ; u32 lo ; struct i40e_hw *hw ; u64 ns ; struct skb_shared_hwtstamps *tmp ; { if (! pf->ptp_rx) { return; } else { } { hw = & pf->hw; prttsyn_stat = readl((void const volatile *)hw->hw_addr + 545088U); } if ((prttsyn_stat & (u32 )(1 << (int )index)) == 0U) { return; } else { } { lo = readl((void const volatile *)hw->hw_addr + (unsigned long )(((int )index + 17030) * 32)); hi = readl((void const volatile *)hw->hw_addr + (unsigned long )(((int )index + 17026) * 32)); ns = ((unsigned long long )hi << 32) | (unsigned long long )lo; tmp = skb_hwtstamps(skb); i40e_ptp_convert_to_hwtstamp(tmp, ns); } return; } } void i40e_ptp_set_increment(struct i40e_pf *pf ) { struct i40e_link_status *hw_link_info ; struct i40e_hw *hw ; u64 incval ; { { hw = & pf->hw; hw_link_info = & hw->phy.link_info; i40e_aq_get_link_info(& pf->hw, 1, (struct i40e_link_status *)0, (struct i40e_asq_cmd_details *)0); } { if ((unsigned int )hw_link_info->link_speed == 8U) { goto case_8; } else { } if ((unsigned int )hw_link_info->link_speed == 4U) { goto case_4; } else { } if ((unsigned int )hw_link_info->link_speed == 2U) { goto case_2; } else { } if ((unsigned int )hw_link_info->link_speed == 16U) { goto case_16; } else { } goto switch_default; case_8: /* CIL Label */ incval = 13743895347ULL; goto ldv_56910; case_4: /* CIL Label */ incval = 137438953472ULL; goto ldv_56910; case_2: /* CIL Label */ { dev_warn((struct device const *)(& (pf->pdev)->dev), "%s: 1588 functionality is not supported at 100 Mbps. Stopping the PHC.\n", "i40e_ptp_set_increment"); incval = 0ULL; } goto ldv_56910; case_16: /* CIL Label */ ; switch_default: /* CIL Label */ incval = 6871947673ULL; goto ldv_56910; switch_break: /* CIL Label */ ; } ldv_56910: { writel((unsigned int )incval, (void volatile *)hw->hw_addr + 1982528U); writel((unsigned int )(incval >> 32), (void volatile *)hw->hw_addr + 1982560U); *((u64 volatile *)(& pf->ptp_base_adj)) = incval; __asm__ volatile ("mfence": : : "memory"); } return; } } int i40e_ptp_get_ts_config(struct i40e_pf *pf , struct ifreq *ifr ) { struct hwtstamp_config *config ; unsigned long tmp ; { { config = & pf->tstamp_config; tmp = copy_to_user(ifr->ifr_ifru.ifru_data, (void const *)config, 12UL); } return (tmp != 0UL ? -14 : 0); } } int i40e_ptp_set_ts_config(struct i40e_pf *pf , struct ifreq *ifr ) { struct i40e_hw *hw ; struct hwtstamp_config *config ; u32 pf_id ; u32 tsyntype ; u32 regval ; unsigned long tmp ; unsigned int tmp___0 ; unsigned long tmp___1 ; { { hw = & pf->hw; config = & pf->tstamp_config; tmp = copy_from_user((void *)config, (void const *)ifr->ifr_ifru.ifru_data, 12UL); } if (tmp != 0UL) { return (-14); } else { } if (config->flags != 0) { return (-22); } else { } { tmp___0 = readl((void const volatile *)hw->hw_addr + 1982976U); pf_id = (tmp___0 & 3840U) >> 8; } if ((u32 )hw->pf_id != pf_id) { return (-22); } else { } { if (config->tx_type == 0) { goto case_0; } else { } if (config->tx_type == 1) { goto case_1; } else { } goto switch_default; case_0: /* CIL Label */ pf->ptp_tx = 0; goto ldv_56931; case_1: /* CIL Label */ pf->ptp_tx = 1; goto ldv_56931; switch_default: /* CIL Label */ ; return (-34); switch_break: /* CIL Label */ ; } ldv_56931: ; { if (config->rx_filter == 0) { goto case_0___0; } else { } if (config->rx_filter == 4) { goto case_4; } else { } if (config->rx_filter == 5) { goto case_5; } else { } if (config->rx_filter == 3) { goto case_3; } else { } if (config->rx_filter == 12) { goto case_12; } else { } if (config->rx_filter == 9) { goto case_9; } else { } if (config->rx_filter == 6) { goto case_6; } else { } if (config->rx_filter == 13) { goto case_13; } else { } if (config->rx_filter == 10) { goto case_10; } else { } if (config->rx_filter == 7) { goto case_7; } else { } if (config->rx_filter == 14) { goto case_14; } else { } if (config->rx_filter == 11) { goto case_11; } else { } if (config->rx_filter == 8) { goto case_8; } else { } if (config->rx_filter == 1) { goto case_1___0; } else { } goto switch_default___0; case_0___0: /* CIL Label */ pf->ptp_rx = 0; tsyntype = 0U; goto ldv_56935; case_4: /* CIL Label */ ; case_5: /* CIL Label */ ; case_3: /* CIL Label */ pf->ptp_rx = 1; tsyntype = 218104063U; config->rx_filter = 3; goto ldv_56935; case_12: /* CIL Label */ ; case_9: /* CIL Label */ ; case_6: /* CIL Label */ ; case_13: /* CIL Label */ ; case_10: /* CIL Label */ ; case_7: /* CIL Label */ ; case_14: /* CIL Label */ ; case_11: /* CIL Label */ ; case_8: /* CIL Label */ pf->ptp_rx = 1; tsyntype = 235864064U; config->rx_filter = 12; goto ldv_56935; case_1___0: /* CIL Label */ ; switch_default___0: /* CIL Label */ ; return (-34); switch_break___0: /* CIL Label */ ; } ldv_56935: { readl((void const volatile *)hw->hw_addr + 1983008U); readl((void const volatile *)hw->hw_addr + 1982944U); readl((void const volatile *)hw->hw_addr + 544832U); readl((void const volatile *)hw->hw_addr + 544864U); readl((void const volatile *)hw->hw_addr + 544896U); readl((void const volatile *)hw->hw_addr + 544928U); regval = readl((void const volatile *)hw->hw_addr + 1982976U); } if ((int )pf->ptp_tx) { regval = regval | 2U; } else { regval = regval & 4294967293U; } { writel(regval, (void volatile *)hw->hw_addr + 1982976U); regval = readl((void const volatile *)hw->hw_addr + 231424U); } if ((int )pf->ptp_tx) { regval = regval | 8388608U; } else { regval = regval & 4286578687U; } { writel(regval, (void volatile *)hw->hw_addr + 231424U); } if ((int )pf->ptp_rx) { { regval = readl((void const volatile *)hw->hw_addr + 544800U); regval = regval & 2147483648U; regval = regval | tsyntype; writel(regval, (void volatile *)hw->hw_addr + 544800U); } } else { } { tmp___1 = copy_to_user(ifr->ifr_ifru.ifru_data, (void const *)config, 12UL); } return (tmp___1 != 0UL ? -14 : 0); } } void i40e_ptp_init(struct i40e_pf *pf ) { struct i40e_hw *hw ; struct net_device *netdev ; struct timespec ts ; u32 regval ; struct lock_class_key __key ; struct lock_class_key __key___0 ; atomic_long_t __constr_expr_0 ; ktime_t tmp ; long tmp___0 ; { { hw = & pf->hw; netdev = (*(pf->vsi + (unsigned long )pf->lan_vsi))->netdev; strncpy((char *)(& pf->ptp_caps.name), "i40e", 16UL); pf->ptp_caps.owner = & __this_module; pf->ptp_caps.max_adj = 999999999; pf->ptp_caps.n_ext_ts = 0; pf->ptp_caps.pps = 0; pf->ptp_caps.adjfreq = & i40e_ptp_adjfreq; pf->ptp_caps.adjtime = & i40e_ptp_adjtime; pf->ptp_caps.gettime = & i40e_ptp_gettime; pf->ptp_caps.settime = & i40e_ptp_settime; pf->ptp_caps.enable = & i40e_ptp_enable; pf->ptp_clock = ptp_clock_register(& pf->ptp_caps, & (pf->pdev)->dev); tmp___0 = IS_ERR((void const *)pf->ptp_clock); } if (tmp___0 != 0L) { { pf->ptp_clock = (struct ptp_clock *)0; dev_err((struct device const *)(& (pf->pdev)->dev), "%s: ptp_clock_register failed\n", "i40e_ptp_init"); } } else { { spinlock_check(& pf->tmreg_lock); __raw_spin_lock_init(& pf->tmreg_lock.__annonCompField19.rlock, "&(&pf->tmreg_lock)->rlock", & __key); __init_work(& pf->ptp_tx_work, 0); __constr_expr_0.counter = 137438953408L; pf->ptp_tx_work.data = __constr_expr_0; lockdep_init_map(& pf->ptp_tx_work.lockdep_map, "(&pf->ptp_tx_work)", & __key___0, 0); INIT_LIST_HEAD(& pf->ptp_tx_work.entry); pf->ptp_tx_work.func = & i40e_ptp_tx_work; _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: added PHC on %s\n", "i40e_ptp_init", (char *)(& netdev->name)); pf->flags = pf->flags | 33554432ULL; regval = readl((void const volatile *)hw->hw_addr + 1982976U); regval = regval | 2147483648U; writel(regval, (void volatile *)hw->hw_addr + 1982976U); regval = readl((void const volatile *)hw->hw_addr + 544800U); regval = regval | 2147483648U; writel(regval, (void volatile *)hw->hw_addr + 544800U); i40e_ptp_set_increment(pf); memset((void *)(& pf->tstamp_config), 0, 12UL); tmp = ktime_get_real(); ts = ns_to_timespec(tmp.tv64); i40e_ptp_settime(& pf->ptp_caps, (struct timespec const *)(& ts)); } } return; } } void i40e_ptp_stop(struct i40e_pf *pf ) { { { pf->flags = pf->flags & 0xfffffffffdffffffULL; pf->ptp_tx = 0; pf->ptp_rx = 0; cancel_work_sync(& pf->ptp_tx_work); } if ((unsigned long )pf->ptp_tx_skb != (unsigned long )((struct sk_buff *)0)) { { dev_kfree_skb_any(pf->ptp_tx_skb); pf->ptp_tx_skb = (struct sk_buff *)0; } } else { } if ((unsigned long )pf->ptp_clock != (unsigned long )((struct ptp_clock *)0)) { { ptp_clock_unregister(pf->ptp_clock); pf->ptp_clock = (struct ptp_clock *)0; _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: removed PHC on %s\n", "i40e_ptp_stop", (char *)(& ((*(pf->vsi + (unsigned long )pf->lan_vsi))->netdev)->name)); } } else { } return; } } __inline static long IS_ERR(void const *ptr ) { long tmp ; { { tmp = ldv_is_err(ptr); } return (tmp); } } static void *ldv_dev_get_drvdata_8___0(struct device const *dev ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static struct pci_dev *pci_physfn(struct pci_dev *dev ) { { if ((unsigned int )*((unsigned char *)dev + 2499UL) != 0U) { dev = dev->__annonCompField75.physfn; } else { } return (dev); } } extern struct pci_dev *pci_get_device(unsigned int , unsigned int , struct pci_dev * ) ; __inline static void *pci_get_drvdata___0(struct pci_dev *pdev ) { void *tmp ; { { tmp = ldv_dev_get_drvdata_8___0((struct device const *)(& pdev->dev)); } return (tmp); } } extern int pci_enable_sriov(struct pci_dev * , int ) ; extern void pci_disable_sriov(struct pci_dev * ) ; extern int pci_num_vf(struct pci_dev * ) ; __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); } } __inline static bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf , u8 vsi_id ) { struct i40e_pf *pf ; { pf = vf->pf; return ((int )(*(pf->vsi + (unsigned long )vsi_id))->vf_id == (int )vf->vf_id); } } __inline static bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf , u8 vsi_id , u8 qid ) { struct i40e_pf *pf ; { pf = vf->pf; return ((int )((unsigned short )qid) < (int )(*(pf->vsi + (unsigned long )vsi_id))->num_queue_pairs); } } __inline static bool i40e_vc_isvalid_vector_id(struct i40e_vf *vf , u8 vector_id ) { struct i40e_pf *pf ; { pf = vf->pf; return ((u32 )vector_id <= pf->hw.func_caps.num_msix_vectors_vf); } } static u16 i40e_vc_get_pf_queue_id(struct i40e_vf *vf , u8 vsi_idx , u8 vsi_queue_id ) { struct i40e_pf *pf ; struct i40e_vsi *vsi ; u16 pf_queue_id ; { pf = vf->pf; vsi = *(pf->vsi + (unsigned long )vsi_idx); pf_queue_id = 2047U; if ((int )vsi->info.mapping_flags & 1) { pf_queue_id = vsi->info.queue_mapping[(int )vsi_queue_id]; } else { pf_queue_id = (int )vsi->info.queue_mapping[0] + (int )((u16 )vsi_queue_id); } return (pf_queue_id); } } static void i40e_config_irq_link_list(struct i40e_vf *vf , u16 vsi_idx , struct i40e_virtchnl_vector_map *vecmap ) { unsigned long linklistmap ; unsigned long tempmap ; struct i40e_pf *pf ; struct i40e_hw *hw ; u16 vsi_queue_id ; u16 pf_queue_id ; enum i40e_queue_type qtype ; u16 next_q ; u16 vector_id ; u32 reg ; u32 reg_idx ; u16 itr_idx ; unsigned long tmp ; unsigned long tmp___0 ; unsigned long tmp___1 ; unsigned long tmp___2 ; unsigned long tmp___3 ; unsigned long tmp___4 ; { linklistmap = 0UL; pf = vf->pf; hw = & pf->hw; itr_idx = 0U; vector_id = vecmap->vector_id; if ((unsigned int )vector_id == 0U) { reg_idx = (u32 )(((int )vf->vf_id + 43520) * 4); } else { reg_idx = ((pf->hw.func_caps.num_msix_vectors_vf * (u32 )vf->vf_id + (u32 )vector_id) + 37887U) * 4U; } if ((unsigned int )vecmap->rxq_map == 0U && (unsigned int )vecmap->txq_map == 0U) { { writel(2047U, (void volatile *)hw->hw_addr + (unsigned long )reg_idx); } goto irq_list_done; } else { } { tempmap = (unsigned long )vecmap->rxq_map; tmp = find_first_bit((unsigned long const *)(& tempmap), 16UL); vsi_queue_id = (u16 )tmp; } goto ldv_56815; ldv_56814: { linklistmap = linklistmap | (unsigned long )(1 << (int )vsi_queue_id * 2); tmp___0 = find_next_bit((unsigned long const *)(& tempmap), 16UL, (unsigned long )((int )vsi_queue_id + 1)); vsi_queue_id = (u16 )tmp___0; } ldv_56815: ; if ((unsigned int )vsi_queue_id <= 15U) { goto ldv_56814; } else { } { tempmap = (unsigned long )vecmap->txq_map; tmp___1 = find_first_bit((unsigned long const *)(& tempmap), 16UL); vsi_queue_id = (u16 )tmp___1; } goto ldv_56818; ldv_56817: { linklistmap = linklistmap | (unsigned long )(1 << ((int )vsi_queue_id * 2 + 1)); tmp___2 = find_next_bit((unsigned long const *)(& tempmap), 16UL, (unsigned long )((int )vsi_queue_id + 1)); vsi_queue_id = (u16 )tmp___2; } ldv_56818: ; if ((unsigned int )vsi_queue_id <= 15U) { goto ldv_56817; } else { } { tmp___3 = find_first_bit((unsigned long const *)(& linklistmap), 32UL); next_q = (u16 )tmp___3; vsi_queue_id = (u16 )((unsigned int )next_q / 2U); qtype = (enum i40e_queue_type )((int )next_q & 1); pf_queue_id = i40e_vc_get_pf_queue_id(vf, (int )((u8 )vsi_idx), (int )((u8 )vsi_queue_id)); reg = ((unsigned int )qtype << 11) | (unsigned int )pf_queue_id; writel(reg, (void volatile *)hw->hw_addr + (unsigned long )reg_idx); } goto ldv_56825; ldv_56824: ; { if ((unsigned int )qtype == 0U) { goto case_0; } else { } if ((unsigned int )qtype == 1U) { goto case_1; } else { } goto switch_default; case_0: /* CIL Label */ reg_idx = (u32 )(((int )pf_queue_id + 59392) * 4); itr_idx = vecmap->rxitr_idx; goto ldv_56821; case_1: /* CIL Label */ reg_idx = (u32 )(((int )pf_queue_id + 61440) * 4); itr_idx = vecmap->txitr_idx; goto ldv_56821; switch_default: /* CIL Label */ ; goto ldv_56821; switch_break: /* CIL Label */ ; } ldv_56821: { tmp___4 = find_next_bit((unsigned long const *)(& linklistmap), 32UL, (unsigned long )((int )next_q + 1)); next_q = (u16 )tmp___4; } if ((unsigned int )next_q <= 31U) { { vsi_queue_id = (u16 )((unsigned int )next_q / 2U); qtype = (enum i40e_queue_type )((int )next_q & 1); pf_queue_id = i40e_vc_get_pf_queue_id(vf, (int )((u8 )vsi_idx), (int )((u8 )vsi_queue_id)); } } else { pf_queue_id = 2047U; qtype = 0; } { reg = ((((unsigned int )vector_id | ((unsigned int )qtype << 27)) | (unsigned int )((int )pf_queue_id << 16)) | (unsigned int )((int )itr_idx << 11)) | 1073741824U; writel(reg, (void volatile *)hw->hw_addr + (unsigned long )reg_idx); } ldv_56825: ; if ((unsigned int )next_q <= 31U) { goto ldv_56824; } else { } irq_list_done: { readl((void const volatile *)hw->hw_addr + 745772U); } return; } } static int i40e_config_vsi_tx_queue(struct i40e_vf *vf , u16 vsi_idx , u16 vsi_queue_id , struct i40e_virtchnl_txq_info *info ) { struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_hmc_obj_txq tx_ctx ; u16 pf_queue_id ; u32 qtx_ctl ; int ret ; i40e_status tmp ; i40e_status tmp___0 ; { { pf = vf->pf; hw = & pf->hw; ret = 0; pf_queue_id = i40e_vc_get_pf_queue_id(vf, (int )((u8 )vsi_idx), (int )((u8 )vsi_queue_id)); memset((void *)(& tx_ctx), 0, 48UL); tx_ctx.base = info->dma_ring_addr / 128ULL; tx_ctx.qlen = info->ring_len; tx_ctx.rdylist = (*(pf->vsi + (unsigned long )vsi_idx))->info.qs_handle[0]; tx_ctx.rdylist_act = 0U; tmp = i40e_clear_lan_tx_queue_context(hw, (int )pf_queue_id); ret = (int )tmp; } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Failed to clear VF LAN Tx queue context %d, error: %d\n", (int )pf_queue_id, ret); ret = -2; } goto error_context; } else { } { tmp___0 = i40e_set_lan_tx_queue_context(hw, (int )pf_queue_id, & tx_ctx); ret = (int )tmp___0; } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Failed to set VF LAN Tx queue context %d error: %d\n", (int )pf_queue_id, ret); ret = -2; } goto error_context; } else { } { qtx_ctl = 0U; qtx_ctl = qtx_ctl | ((u32 )((int )hw->pf_id << 2) & 60U); qtx_ctl = qtx_ctl | ((((u32 )vf->vf_id + hw->func_caps.vf_base_id) << 7) & 65535U); writel(qtx_ctl, (void volatile *)hw->hw_addr + (unsigned long )(((int )pf_queue_id + 266240) * 4)); readl((void const volatile *)hw->hw_addr + 745772U); } error_context: ; return (ret); } } static int i40e_config_vsi_rx_queue(struct i40e_vf *vf , u16 vsi_idx , u16 vsi_queue_id , struct i40e_virtchnl_rxq_info *info ) { struct i40e_pf *pf ; struct i40e_hw *hw ; struct i40e_hmc_obj_rxq rx_ctx ; u16 pf_queue_id ; int ret ; i40e_status tmp ; i40e_status tmp___0 ; { { pf = vf->pf; hw = & pf->hw; ret = 0; pf_queue_id = i40e_vc_get_pf_queue_id(vf, (int )((u8 )vsi_idx), (int )((u8 )vsi_queue_id)); memset((void *)(& rx_ctx), 0, 40UL); rx_ctx.base = info->dma_ring_addr / 128ULL; rx_ctx.qlen = (u16 )info->ring_len; } if ((unsigned int )info->splithdr_enabled != 0U) { rx_ctx.hsplit_0 = 15U; if ((unsigned int )info->hdr_size > 1984U) { ret = -22; goto error_param; } else { } rx_ctx.hbuff = (u8 )((int )info->hdr_size >> 6); rx_ctx.dtype = 2U; } else { } if (info->databuffer_size > 16256U) { ret = -22; goto error_param; } else { } rx_ctx.dbuff = (u8 )(info->databuffer_size >> 7); if (info->max_pkt_size - 64U > 16319U) { ret = -22; goto error_param; } else { } { rx_ctx.rxmax = (u16 )info->max_pkt_size; rx_ctx.dsize = 1U; rx_ctx.tphrdesc_ena = 1U; rx_ctx.tphwdesc_ena = 1U; rx_ctx.tphdata_ena = 1U; rx_ctx.tphhead_ena = 1U; rx_ctx.lrxqthresh = 2U; rx_ctx.crcstrip = 1U; tmp = i40e_clear_lan_rx_queue_context(hw, (int )pf_queue_id); ret = (int )tmp; } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Failed to clear VF LAN Rx queue context %d, error: %d\n", (int )pf_queue_id, ret); ret = -2; } goto error_param; } else { } { tmp___0 = i40e_set_lan_rx_queue_context(hw, (int )pf_queue_id, & rx_ctx); ret = (int )tmp___0; } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Failed to set VF LAN Rx queue context %d error: %d\n", (int )pf_queue_id, ret); ret = -2; } goto error_param; } else { } error_param: ; return (ret); } } static int i40e_alloc_vsi_res(struct i40e_vf *vf , enum i40e_vsi_type type ) { struct i40e_mac_filter *f ; struct i40e_pf *pf ; struct i40e_vsi *vsi ; int ret ; u8 brdcast[6U] ; { { f = (struct i40e_mac_filter *)0; pf = vf->pf; ret = 0; vsi = i40e_vsi_setup(pf, (int )((u8 )type), (int )(*(pf->vsi + (unsigned long )pf->lan_vsi))->seid, (u32 )vf->vf_id); } if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { { dev_err((struct device const *)(& (pf->pdev)->dev), "add vsi failed for vf %d, aq_err %d\n", (int )vf->vf_id, (unsigned int )pf->hw.aq.asq_last_status); ret = -2; } goto error_alloc_vsi_res; } else { } if ((unsigned int )type == 6U) { { brdcast[0] = 255U; brdcast[1] = 255U; brdcast[2] = 255U; brdcast[3] = 255U; brdcast[4] = 255U; brdcast[5] = 255U; vf->lan_vsi_index = (u8 )vsi->idx; vf->lan_vsi_id = (u8 )vsi->id; _dev_info((struct device const *)(& (pf->pdev)->dev), "VF %d assigned LAN VSI index %d, VSI id %d\n", (int )vf->vf_id, (int )vsi->idx, (int )vsi->id); } if ((unsigned int )vf->port_vlan_id != 0U) { { i40e_vsi_add_pvid(vsi, (int )vf->port_vlan_id); } } else { } { f = i40e_add_filter(vsi, (u8 *)(& vf->default_lan_addr.addr), (int )((s16 )vf->port_vlan_id), 1, 0); } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Could not allocate VF MAC addr\n"); } } else { } { f = i40e_add_filter(vsi, (u8 *)(& brdcast), (int )((s16 )vf->port_vlan_id), 1, 0); } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Could not allocate VF broadcast filter\n"); } } else { } } else { } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to add ucast filter\n"); ret = -12; } goto error_alloc_vsi_res; } else { } { ret = i40e_sync_vsi_filters(vsi); } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to program ucast filters\n"); } goto error_alloc_vsi_res; } else { } error_alloc_vsi_res: ; return (ret); } } static void i40e_enable_vf_mappings(struct i40e_vf *vf ) { struct i40e_pf *pf ; struct i40e_hw *hw ; u32 reg ; u32 total_queue_pairs ; int j ; u16 qid ; u16 tmp ; u16 qid___0 ; u16 tmp___0 ; { { pf = vf->pf; hw = & pf->hw; total_queue_pairs = 0U; writel(2048U, (void volatile *)hw->hw_addr + (unsigned long )(((int )vf->lan_vsi_id + 537088) * 4)); reg = 1U; writel(reg, (void volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 118784) * 4)); j = 0; } goto ldv_56872; ldv_56871: { tmp = i40e_vc_get_pf_queue_id(vf, (int )vf->lan_vsi_index, (int )((u8 )j)); qid = tmp; reg = (u32 )qid & 2047U; writel(reg, (void volatile *)hw->hw_addr + (unsigned long )(((total_queue_pairs * 256U + (u32 )vf->vf_id) + 114688U) * 4U)); total_queue_pairs = total_queue_pairs + 1U; j = j + 1; } ldv_56872: ; if (j < (int )(*(pf->vsi + (unsigned long )vf->lan_vsi_index))->num_queue_pairs) { goto ldv_56871; } else { } j = 0; goto ldv_56876; ldv_56875: ; if (j * 2 >= (int )(*(pf->vsi + (unsigned long )vf->lan_vsi_index))->num_queue_pairs) { reg = 134154239U; } else { { tmp___0 = i40e_vc_get_pf_queue_id(vf, (int )vf->lan_vsi_index, (int )((unsigned int )((u8 )j) * 2U)); qid___0 = tmp___0; reg = (u32 )qid___0; qid___0 = i40e_vc_get_pf_queue_id(vf, (int )vf->lan_vsi_index, (int )((unsigned int )((u8 )j) * 2U + 1U)); reg = reg | (u32 )((int )qid___0 << 16); } } { writel(reg, (void volatile *)hw->hw_addr + (unsigned long )(((j * 512 + (int )vf->lan_vsi_id) + 524288) * 4)); j = j + 1; } ldv_56876: ; if (j <= 6) { goto ldv_56875; } else { } { readl((void const volatile *)hw->hw_addr + 745772U); } return; } } static void i40e_disable_vf_mappings(struct i40e_vf *vf ) { struct i40e_pf *pf ; struct i40e_hw *hw ; int i ; { { pf = vf->pf; hw = & pf->hw; writel(0U, (void volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 118784) * 4)); i = 0; } goto ldv_56885; ldv_56884: { writel(2047U, (void volatile *)hw->hw_addr + (unsigned long )(((i * 256 + (int )vf->vf_id) + 114688) * 4)); i = i + 1; } ldv_56885: ; if (i <= 15) { goto ldv_56884; } else { } { readl((void const volatile *)hw->hw_addr + 745772U); } return; } } static void i40e_free_vf_res(struct i40e_vf *vf ) { struct i40e_pf *pf ; struct i40e_hw *hw ; u32 reg_idx ; u32 reg ; int i ; int msix_vf ; { pf = vf->pf; hw = & pf->hw; if ((unsigned int )vf->lan_vsi_index != 0U) { { i40e_vsi_release(*(pf->vsi + (unsigned long )vf->lan_vsi_index)); vf->lan_vsi_index = 0U; vf->lan_vsi_id = 0U; } } else { } msix_vf = (int )(pf->hw.func_caps.num_msix_vectors_vf + 1U); i = 0; goto ldv_56897; ldv_56896: ; if (i == 0) { reg_idx = (u32 )(((int )vf->vf_id + 43264) * 4); } else { reg_idx = (u32 )((((msix_vf + -1) * 4) * (int )vf->vf_id + (i + -1) * 4) + 149504); } { writel(2U, (void volatile *)hw->hw_addr + (unsigned long )reg_idx); readl((void const volatile *)hw->hw_addr + 745772U); i = i + 1; } ldv_56897: ; if (i < msix_vf) { goto ldv_56896; } else { } i = 0; goto ldv_56900; ldv_56899: ; if (i == 0) { reg_idx = (u32 )(((int )vf->vf_id + 43520) * 4); } else { reg_idx = (u32 )((((msix_vf + -1) * 4) * (int )vf->vf_id + (i + -1) * 4) + 151552); } { reg = 8191U; writel(reg, (void volatile *)hw->hw_addr + (unsigned long )reg_idx); readl((void const volatile *)hw->hw_addr + 745772U); i = i + 1; } ldv_56900: ; if (i < msix_vf) { goto ldv_56899; } else { } vf->num_queue_pairs = 0U; vf->vf_states = 0UL; return; } } static int i40e_alloc_vf_res(struct i40e_vf *vf ) { struct i40e_pf *pf ; int total_queue_pairs ; int ret ; { { pf = vf->pf; total_queue_pairs = 0; ret = i40e_alloc_vsi_res(vf, 6); } if (ret != 0) { goto error_alloc; } else { } { total_queue_pairs = total_queue_pairs + (int )(*(pf->vsi + (unsigned long )vf->lan_vsi_index))->num_queue_pairs; set_bit(0L, (unsigned long volatile *)(& vf->vf_caps)); vf->num_queue_pairs = (u8 )total_queue_pairs; set_bit(0L, (unsigned long volatile *)(& vf->vf_states)); } error_alloc: ; if (ret != 0) { { i40e_free_vf_res(vf); } } else { } return (ret); } } static int i40e_quiesce_vf_pci(struct i40e_vf *vf ) { struct i40e_pf *pf ; struct i40e_hw *hw ; int vf_abs_id ; int i ; u32 reg ; { { pf = vf->pf; hw = & pf->hw; vf_abs_id = (int )((u32 )vf->vf_id + hw->func_caps.vf_base_id); writel((unsigned int )((vf_abs_id << 12) | 170), (void volatile *)hw->hw_addr + 639104U); i = 0; } goto ldv_56918; ldv_56917: { reg = readl((void const volatile *)hw->hw_addr + 639232U); } if ((reg & 32U) == 0U) { return (0); } else { } { __const_udelay(4295UL); i = i + 1; } ldv_56918: ; if (i <= 99) { goto ldv_56917; } else { } return (-5); } } void i40e_reset_vf(struct i40e_vf *vf , bool flr ) { struct i40e_pf *pf ; struct i40e_hw *hw ; bool rsd ; int i ; u32 reg ; int tmp ; unsigned long __ms ; unsigned long tmp___0 ; { { pf = vf->pf; hw = & pf->hw; rsd = 0; clear_bit(1L, (unsigned long volatile *)(& vf->vf_states)); } if (! flr) { { reg = readl((void const volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 148992) * 4)); reg = reg | 1U; writel(reg, (void volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 148992) * 4)); readl((void const volatile *)hw->hw_addr + 745772U); } } else { } { tmp = i40e_quiesce_vf_pci(vf); } if (tmp != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "VF %d PCI transactions stuck\n", (int )vf->vf_id); } } else { } i = 0; goto ldv_56931; ldv_56930: { __const_udelay(42950UL); reg = readl((void const volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 149248) * 4)); } if ((int )reg & 1) { rsd = 1; goto ldv_56929; } else { } i = i + 1; ldv_56931: ; if (i <= 99) { goto ldv_56930; } else { } ldv_56929: ; if (! rsd) { { dev_err((struct device const *)(& (pf->pdev)->dev), "VF reset check timeout on VF %d\n", (int )vf->vf_id); } } else { } { writel(1U, (void volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 119040) * 4)); reg = readl((void const volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 148992) * 4)); reg = reg & 4294967294U; writel(reg, (void volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 148992) * 4)); } if ((unsigned int )vf->lan_vsi_index == 0U) { goto complete_reset; } else { } { i40e_vsi_control_rings(*(pf->vsi + (unsigned long )vf->lan_vsi_index), 0); } complete_reset: { i40e_free_vf_res(vf); __ms = 10UL; } goto ldv_56935; ldv_56934: { __const_udelay(4295000UL); } ldv_56935: tmp___0 = __ms; __ms = __ms - 1UL; if (tmp___0 != 0UL) { goto ldv_56934; } else { } { i40e_alloc_vf_res(vf); i40e_enable_vf_mappings(vf); writel(2U, (void volatile *)hw->hw_addr + (unsigned long )(((int )vf->vf_id + 119040) * 4)); readl((void const volatile *)hw->hw_addr + 745772U); } return; } } static bool i40e_vfs_are_assigned(struct i40e_pf *pf ) { struct pci_dev *pdev ; struct pci_dev *vfdev ; struct pci_dev *tmp ; { { pdev = pf->pdev; vfdev = pci_get_device(32902U, 5452U, (struct pci_dev *)0); } goto ldv_56943; ldv_56942: ; if ((unsigned int )*((unsigned char *)vfdev + 2499UL) != 0U) { { tmp = pci_physfn(vfdev); } if ((unsigned long )tmp == (unsigned long )pdev) { if (((int )vfdev->dev_flags & 4) != 0) { return (1); } else { } } else { } } else { } { vfdev = pci_get_device(32902U, 5452U, vfdev); } ldv_56943: ; if ((unsigned long )vfdev != (unsigned long )((struct pci_dev *)0)) { goto ldv_56942; } else { } return (0); } } static void i40e_enable_pf_switch_lb(struct i40e_pf *pf ) { struct i40e_vsi *vsi ; struct i40e_vsi_context ctxt ; int aq_ret ; i40e_status tmp ; i40e_status tmp___0 ; { { vsi = *(pf->vsi + (unsigned long )pf->lan_vsi); ctxt.seid = pf->main_vsi_seid; ctxt.pf_num = pf->hw.pf_id; ctxt.vf_num = 0U; tmp = i40e_aq_get_vsi_params(& pf->hw, & ctxt, (struct i40e_asq_cmd_details *)0); aq_ret = (int )tmp; } if (aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%s couldn\'t get pf vsi config, err %d, aq_err %d\n", "i40e_enable_pf_switch_lb", aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } return; } else { } { ctxt.flags = 2U; ctxt.info.valid_sections = 1U; ctxt.info.switch_id = (__le16 )((unsigned int )ctxt.info.switch_id | 8192U); tmp___0 = i40e_aq_update_vsi_params(& (vsi->back)->hw, & ctxt, (struct i40e_asq_cmd_details *)0); aq_ret = (int )tmp___0; } if (aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: update vsi switch failed, aq_err=%d\n", "i40e_enable_pf_switch_lb", (unsigned int )(vsi->back)->hw.aq.asq_last_status); } } else { } return; } } static void i40e_disable_pf_switch_lb(struct i40e_pf *pf ) { struct i40e_vsi *vsi ; struct i40e_vsi_context ctxt ; int aq_ret ; i40e_status tmp ; i40e_status tmp___0 ; { { vsi = *(pf->vsi + (unsigned long )pf->lan_vsi); ctxt.seid = pf->main_vsi_seid; ctxt.pf_num = pf->hw.pf_id; ctxt.vf_num = 0U; tmp = i40e_aq_get_vsi_params(& pf->hw, & ctxt, (struct i40e_asq_cmd_details *)0); aq_ret = (int )tmp; } if (aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%s couldn\'t get pf vsi config, err %d, aq_err %d\n", "i40e_disable_pf_switch_lb", aq_ret, (unsigned int )pf->hw.aq.asq_last_status); } return; } else { } { ctxt.flags = 2U; ctxt.info.valid_sections = 1U; ctxt.info.switch_id = (unsigned int )ctxt.info.switch_id & 57343U; tmp___0 = i40e_aq_update_vsi_params(& (vsi->back)->hw, & ctxt, (struct i40e_asq_cmd_details *)0); aq_ret = (int )tmp___0; } if (aq_ret != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: update vsi switch failed, aq_err=%d\n", "i40e_disable_pf_switch_lb", (unsigned int )(vsi->back)->hw.aq.asq_last_status); } } else { } return; } } void i40e_free_vfs(struct i40e_pf *pf ) { struct i40e_hw *hw ; u32 reg_idx ; u32 bit_idx ; int i ; int tmp ; int vf_id ; unsigned long __ms ; unsigned long tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; { hw = & pf->hw; if ((unsigned long )pf->vf == (unsigned long )((struct i40e_vf *)0)) { return; } else { } { i40e_irq_dynamic_disable_icr0(pf); __ms = 10UL; } goto ldv_56970; ldv_56969: { __const_udelay(4295000UL); } ldv_56970: tmp___0 = __ms; __ms = __ms - 1UL; if (tmp___0 != 0UL) { goto ldv_56969; } else { } tmp = pf->num_alloc_vfs; pf->num_alloc_vfs = 0; i = 0; goto ldv_56973; ldv_56972: { tmp___1 = constant_test_bit(0L, (unsigned long const volatile *)(& (pf->vf + (unsigned long )i)->vf_states)); } if (tmp___1 != 0) { { i40e_free_vf_res(pf->vf + (unsigned long )i); } } else { } { i40e_disable_vf_mappings(pf->vf + (unsigned long )i); i = i + 1; } ldv_56973: ; if (i < tmp) { goto ldv_56972; } else { } { kfree((void const *)pf->vf); pf->vf = (struct i40e_vf *)0; tmp___2 = i40e_vfs_are_assigned(pf); } if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { { pci_disable_sriov(pf->pdev); vf_id = 0; } goto ldv_56976; ldv_56975: { reg_idx = (hw->func_caps.vf_base_id + (u32 )vf_id) / 32U; bit_idx = (hw->func_caps.vf_base_id + (u32 )vf_id) & 31U; writel((unsigned int )(1 << (int )bit_idx), (void volatile *)hw->hw_addr + (unsigned long )((reg_idx + 149888U) * 4U)); vf_id = vf_id + 1; } ldv_56976: ; if (vf_id < tmp) { goto ldv_56975; } else { } { i40e_disable_pf_switch_lb(pf); } } else { { dev_warn((struct device const *)(& (pf->pdev)->dev), "unable to disable SR-IOV because VFs are assigned.\n"); } } { i40e_irq_dynamic_enable_icr0(pf); } return; } } static int i40e_alloc_vfs(struct i40e_pf *pf , u16 num_alloc_vfs ) { struct i40e_vf *vfs ; int i ; int ret ; void *tmp ; { { ret = 0; i40e_irq_dynamic_disable_icr0(pf); ret = pci_enable_sriov(pf->pdev, (int )num_alloc_vfs); } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "pci_enable_sriov failed with error %d!\n", ret); pf->num_alloc_vfs = 0; } goto err_iov; } else { } { tmp = kzalloc((unsigned long )num_alloc_vfs * 80UL, 208U); vfs = (struct i40e_vf *)tmp; } if ((unsigned long )vfs == (unsigned long )((struct i40e_vf *)0)) { ret = -12; goto err_alloc; } else { } i = 0; goto ldv_56988; ldv_56987: { (vfs + (unsigned long )i)->pf = pf; (vfs + (unsigned long )i)->parent_type = 17; (vfs + (unsigned long )i)->vf_id = (u16 )i; set_bit(1L, (unsigned long volatile *)(& (vfs + (unsigned long )i)->vf_caps)); i40e_reset_vf(vfs + (unsigned long )i, 0); i40e_enable_vf_mappings(vfs + (unsigned long )i); i = i + 1; } ldv_56988: ; if (i < (int )num_alloc_vfs) { goto ldv_56987; } else { } { pf->vf = vfs; pf->num_alloc_vfs = (int )num_alloc_vfs; i40e_enable_pf_switch_lb(pf); } err_alloc: ; if (ret != 0) { { i40e_free_vfs(pf); } } else { } err_iov: { i40e_irq_dynamic_enable_icr0(pf); } return (ret); } } static int i40e_pci_sriov_enable(struct pci_dev *pdev , int num_vfs ) { struct i40e_pf *pf ; void *tmp ; int pre_existing_vfs ; int tmp___0 ; int err ; { { tmp = pci_get_drvdata___0(pdev); pf = (struct i40e_pf *)tmp; tmp___0 = pci_num_vf(pdev); pre_existing_vfs = tmp___0; err = 0; _dev_info((struct device const *)(& pdev->dev), "Allocating %d VFs.\n", num_vfs); } if (pre_existing_vfs != 0 && pre_existing_vfs != num_vfs) { { i40e_free_vfs(pf); } } else if (pre_existing_vfs != 0 && pre_existing_vfs == num_vfs) { goto out; } else { } if (num_vfs > (int )pf->num_req_vfs) { err = -1; goto err_out; } else { } { err = i40e_alloc_vfs(pf, (int )((u16 )num_vfs)); } if (err != 0) { { dev_warn((struct device const *)(& pdev->dev), "Failed to enable SR-IOV: %d\n", err); } goto err_out; } else { } out: ; return (num_vfs); err_out: ; return (err); return (0); } } int i40e_pci_sriov_configure(struct pci_dev *pdev , int num_vfs ) { struct i40e_pf *pf ; void *tmp ; int tmp___0 ; { { tmp = pci_get_drvdata___0(pdev); pf = (struct i40e_pf *)tmp; } if (num_vfs != 0) { { tmp___0 = i40e_pci_sriov_enable(pdev, num_vfs); } return (tmp___0); } else { } { i40e_free_vfs(pf); } return (0); } } static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf , u32 v_opcode , u32 v_retval , u8 *msg , u16 msglen ) { struct i40e_pf *pf ; struct i40e_hw *hw ; int true_vf_id ; i40e_status aq_ret ; { pf = vf->pf; hw = & pf->hw; true_vf_id = (int )((u32 )vf->vf_id + hw->func_caps.vf_base_id); if (v_retval != 0U) { { vf->num_invalid_msgs = vf->num_invalid_msgs + 1ULL; dev_err((struct device const *)(& (pf->pdev)->dev), "Failed opcode %d Error: %d\n", v_opcode, v_retval); } if (vf->num_invalid_msgs > 10ULL) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Number of invalid messages exceeded for VF %d\n", (int )vf->vf_id); dev_err((struct device const *)(& (pf->pdev)->dev), "Use PF Control I/F to enable the VF\n"); set_bit(3L, (unsigned long volatile *)(& vf->vf_states)); } } else { } } else { vf->num_valid_msgs = vf->num_valid_msgs + 1ULL; } { aq_ret = i40e_aq_send_msg_to_vf(hw, (int )((u16 )true_vf_id), v_opcode, v_retval, msg, (int )msglen, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to send the message to VF %d aq_err %d\n", (int )vf->vf_id, (unsigned int )pf->hw.aq.asq_last_status); } return (-5); } else { } return (0); } } static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf , enum i40e_virtchnl_ops opcode , i40e_status retval ) { int tmp ; { { tmp = i40e_vc_send_msg_to_vf(vf, (u32 )opcode, (u32 )retval, (u8 *)0U, 0); } return (tmp); } } static int i40e_vc_get_version_msg(struct i40e_vf *vf ) { struct i40e_virtchnl_version_info info ; int tmp ; { { info.major = 1U; info.minor = 0U; tmp = i40e_vc_send_msg_to_vf(vf, 1U, 0U, (u8 *)(& info), 8); } return (tmp); } } static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf ) { struct i40e_virtchnl_vf_resource *vfres ; struct i40e_pf *pf ; i40e_status aq_ret ; struct i40e_vsi *vsi ; int i ; int len ; int num_vsis ; int ret ; int tmp ; void *tmp___0 ; { { vfres = (struct i40e_virtchnl_vf_resource *)0; pf = vf->pf; aq_ret = 0; i = 0; len = 0; num_vsis = 1; tmp = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto err; } else { } { len = (int )((unsigned int )((unsigned long )num_vsis) * 16U + 36U); tmp___0 = kzalloc((size_t )len, 208U); vfres = (struct i40e_virtchnl_vf_resource *)tmp___0; } if ((unsigned long )vfres == (unsigned long )((struct i40e_virtchnl_vf_resource *)0)) { aq_ret = -18; len = 0; goto err; } else { } vfres->vf_offload_flags = 1U; vsi = *(pf->vsi + (unsigned long )vf->lan_vsi_index); if ((unsigned int )vsi->info.pvid == 0U) { vfres->vf_offload_flags = vfres->vf_offload_flags | 65536U; } else { } vfres->num_vsis = (u16 )num_vsis; vfres->num_queue_pairs = (u16 )vf->num_queue_pairs; vfres->max_vectors = (u16 )pf->hw.func_caps.num_msix_vectors_vf; if ((unsigned int )vf->lan_vsi_index != 0U) { { vfres->vsi_res[i].vsi_id = (u16 )vf->lan_vsi_index; vfres->vsi_res[i].vsi_type = 6; vfres->vsi_res[i].num_queue_pairs = (*(pf->vsi + (unsigned long )vf->lan_vsi_index))->num_queue_pairs; memcpy((void *)(& vfres->vsi_res[i].default_mac_addr), (void const *)(& vf->default_lan_addr.addr), 6UL); i = i + 1; } } else { } { set_bit(1L, (unsigned long volatile *)(& vf->vf_states)); } err: { ret = i40e_vc_send_msg_to_vf(vf, 3U, (u32 )aq_ret, (u8 *)vfres, (int )((u16 )len)); kfree((void const *)vfres); } return (ret); } } static void i40e_vc_reset_vf_msg(struct i40e_vf *vf ) { int tmp ; { { tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp != 0) { { i40e_reset_vf(vf, 0); } } else { } return; } } static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_promisc_info *info ; struct i40e_pf *pf ; struct i40e_hw *hw ; bool allmulti ; bool promisc ; i40e_status aq_ret ; int tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; { { info = (struct i40e_virtchnl_promisc_info *)msg; pf = vf->pf; hw = & pf->hw; allmulti = 0; promisc = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto error_param; } else { { tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_caps)); } if (tmp___0 == 0) { aq_ret = -5; goto error_param; } else { { tmp___1 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )info->vsi_id)); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { aq_ret = -5; goto error_param; } else if ((unsigned int )(*(pf->vsi + (unsigned long )info->vsi_id))->type != 4U) { aq_ret = -5; goto error_param; } else { } } } if ((int )info->flags & 1) { promisc = 1; } else { } { aq_ret = i40e_aq_set_vsi_unicast_promiscuous(hw, (int )info->vsi_id, (int )promisc, (struct i40e_asq_cmd_details *)0); } if ((int )aq_ret != 0) { goto error_param; } else { } if (((int )info->flags & 2) != 0) { allmulti = 1; } else { } { aq_ret = i40e_aq_set_vsi_multicast_promiscuous(hw, (int )info->vsi_id, (int )allmulti, (struct i40e_asq_cmd_details *)0); } error_param: { tmp___3 = i40e_vc_send_resp_to_vf(vf, 14, aq_ret); } return (tmp___3); } } static int i40e_vc_config_queues_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_vsi_queue_config_info *qci ; struct i40e_virtchnl_queue_pair_info *qpi ; u16 vsi_id ; u16 vsi_queue_id ; i40e_status aq_ret ; int i ; int tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; { { qci = (struct i40e_virtchnl_vsi_queue_config_info *)msg; aq_ret = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto error_param; } else { } { vsi_id = qci->vsi_id; tmp___0 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vsi_id)); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { aq_ret = -5; goto error_param; } else { } i = 0; goto ldv_57064; ldv_57063: qpi = (struct i40e_virtchnl_queue_pair_info *)(& qci->qpair) + (unsigned long )i; vsi_queue_id = qpi->txq.queue_id; if (((int )qpi->txq.vsi_id != (int )vsi_id || (int )qpi->rxq.vsi_id != (int )vsi_id) || (int )qpi->rxq.queue_id != (int )vsi_queue_id) { aq_ret = -5; goto error_param; } else { { tmp___2 = i40e_vc_isvalid_queue_id(vf, (int )((u8 )vsi_id), (int )((u8 )vsi_queue_id)); } if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { aq_ret = -5; goto error_param; } else { } } { tmp___4 = i40e_config_vsi_rx_queue(vf, (int )vsi_id, (int )vsi_queue_id, & qpi->rxq); } if (tmp___4 != 0) { aq_ret = -5; goto error_param; } else { { tmp___5 = i40e_config_vsi_tx_queue(vf, (int )vsi_id, (int )vsi_queue_id, & qpi->txq); } if (tmp___5 != 0) { aq_ret = -5; goto error_param; } else { } } i = i + 1; ldv_57064: ; if (i < (int )qci->num_queue_pairs) { goto ldv_57063; } else { } error_param: { tmp___6 = i40e_vc_send_resp_to_vf(vf, 6, aq_ret); } return (tmp___6); } } static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_irq_map_info *irqmap_info ; struct i40e_virtchnl_vector_map *map ; u16 vsi_id ; u16 vsi_queue_id ; u16 vector_id ; i40e_status aq_ret ; unsigned long tempmap ; int i ; int tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; unsigned long tmp___4 ; bool tmp___5 ; int tmp___6 ; unsigned long tmp___7 ; unsigned long tmp___8 ; bool tmp___9 ; int tmp___10 ; unsigned long tmp___11 ; int tmp___12 ; { { irqmap_info = (struct i40e_virtchnl_irq_map_info *)msg; aq_ret = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto error_param; } else { } i = 0; goto ldv_57087; ldv_57086: { map = (struct i40e_virtchnl_vector_map *)(& irqmap_info->vecmap) + (unsigned long )i; vector_id = map->vector_id; vsi_id = map->vsi_id; tmp___0 = i40e_vc_isvalid_vector_id(vf, (int )((u8 )vector_id)); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { aq_ret = -5; goto error_param; } else { { tmp___2 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vsi_id)); } if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { aq_ret = -5; goto error_param; } else { } } { tempmap = (unsigned long )map->rxq_map; tmp___4 = find_first_bit((unsigned long const *)(& tempmap), 16UL); vsi_queue_id = (u16 )tmp___4; } goto ldv_57081; ldv_57080: { tmp___5 = i40e_vc_isvalid_queue_id(vf, (int )((u8 )vsi_id), (int )((u8 )vsi_queue_id)); } if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } if (tmp___6) { aq_ret = -5; goto error_param; } else { } { tmp___7 = find_next_bit((unsigned long const *)(& tempmap), 16UL, (unsigned long )((int )vsi_queue_id + 1)); vsi_queue_id = (u16 )tmp___7; } ldv_57081: ; if ((unsigned int )vsi_queue_id <= 15U) { goto ldv_57080; } else { } { tempmap = (unsigned long )map->txq_map; tmp___8 = find_first_bit((unsigned long const *)(& tempmap), 16UL); vsi_queue_id = (u16 )tmp___8; } goto ldv_57084; ldv_57083: { tmp___9 = i40e_vc_isvalid_queue_id(vf, (int )((u8 )vsi_id), (int )((u8 )vsi_queue_id)); } if (tmp___9) { tmp___10 = 0; } else { tmp___10 = 1; } if (tmp___10) { aq_ret = -5; goto error_param; } else { } { tmp___11 = find_next_bit((unsigned long const *)(& tempmap), 16UL, (unsigned long )((int )vsi_queue_id + 1)); vsi_queue_id = (u16 )tmp___11; } ldv_57084: ; if ((unsigned int )vsi_queue_id <= 15U) { goto ldv_57083; } else { } { i40e_config_irq_link_list(vf, (int )vsi_id, map); i = i + 1; } ldv_57087: ; if (i < (int )irqmap_info->num_vectors) { goto ldv_57086; } else { } error_param: { tmp___12 = i40e_vc_send_resp_to_vf(vf, 7, aq_ret); } return (tmp___12); } } static int i40e_vc_enable_queues_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_queue_select *vqs ; struct i40e_pf *pf ; u16 vsi_id ; i40e_status aq_ret ; int tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { { vqs = (struct i40e_virtchnl_queue_select *)msg; pf = vf->pf; vsi_id = vqs->vsi_id; aq_ret = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto error_param; } else { } { tmp___0 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vsi_id)); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { aq_ret = -5; goto error_param; } else { } if (vqs->rx_queues == 0U && vqs->tx_queues == 0U) { aq_ret = -5; goto error_param; } else { } { tmp___2 = i40e_vsi_control_rings(*(pf->vsi + (unsigned long )vsi_id), 1); } if (tmp___2 != 0) { aq_ret = -37; } else { } error_param: { tmp___3 = i40e_vc_send_resp_to_vf(vf, 8, aq_ret); } return (tmp___3); } } static int i40e_vc_disable_queues_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_queue_select *vqs ; struct i40e_pf *pf ; u16 vsi_id ; i40e_status aq_ret ; int tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { { vqs = (struct i40e_virtchnl_queue_select *)msg; pf = vf->pf; vsi_id = vqs->vsi_id; aq_ret = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto error_param; } else { } { tmp___0 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vqs->vsi_id)); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { aq_ret = -5; goto error_param; } else { } if (vqs->rx_queues == 0U && vqs->tx_queues == 0U) { aq_ret = -5; goto error_param; } else { } { tmp___2 = i40e_vsi_control_rings(*(pf->vsi + (unsigned long )vsi_id), 0); } if (tmp___2 != 0) { aq_ret = -37; } else { } error_param: { tmp___3 = i40e_vc_send_resp_to_vf(vf, 9, aq_ret); } return (tmp___3); } } static int i40e_vc_get_stats_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_queue_select *vqs ; struct i40e_pf *pf ; struct i40e_eth_stats stats ; i40e_status aq_ret ; struct i40e_vsi *vsi ; int tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; { { vqs = (struct i40e_virtchnl_queue_select *)msg; pf = vf->pf; aq_ret = 0; memset((void *)(& stats), 0, 112UL); tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto error_param; } else { } { tmp___0 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vqs->vsi_id)); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { aq_ret = -5; goto error_param; } else { } vsi = *(pf->vsi + (unsigned long )vqs->vsi_id); if ((unsigned long )vsi == (unsigned long )((struct i40e_vsi *)0)) { aq_ret = -5; goto error_param; } else { } { i40e_update_eth_stats(vsi); stats = vsi->eth_stats; } error_param: { tmp___2 = i40e_vc_send_msg_to_vf(vf, 15U, (u32 )aq_ret, (u8 *)(& stats), 112); } return (tmp___2); } } __inline static int i40e_check_vf_permission(struct i40e_vf *vf , u8 *macaddr ) { struct i40e_pf *pf ; int ret ; bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; bool tmp___4 ; { { pf = vf->pf; ret = 0; tmp___3 = is_broadcast_ether_addr((u8 const *)macaddr); } if ((int )tmp___3) { { dev_err((struct device const *)(& (pf->pdev)->dev), "invalid VF MAC addr %pM\n", macaddr); ret = -10; } } else { { tmp___4 = is_zero_ether_addr((u8 const *)macaddr); } if ((int )tmp___4) { { dev_err((struct device const *)(& (pf->pdev)->dev), "invalid VF MAC addr %pM\n", macaddr); ret = -10; } } else if ((int )vf->pf_set_mac) { { tmp = is_multicast_ether_addr((u8 const *)macaddr); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { { tmp___1 = ether_addr_equal((u8 const *)macaddr, (u8 const *)(& vf->default_lan_addr.addr)); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { { dev_err((struct device const *)(& (pf->pdev)->dev), "VF attempting to override administratively set MAC address\nPlease reload the VF driver to resume normal operation\n"); ret = -1; } } else { } } else { } } else { } } return (ret); } } static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_ether_addr_list *al ; struct i40e_pf *pf ; struct i40e_vsi *vsi ; u16 vsi_id ; i40e_status ret ; int i ; int tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; struct i40e_mac_filter *f ; bool tmp___4 ; int tmp___5 ; int tmp___6 ; { { al = (struct i40e_virtchnl_ether_addr_list *)msg; pf = vf->pf; vsi = (struct i40e_vsi *)0; vsi_id = al->vsi_id; ret = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { ret = -5; goto error_param; } else { { tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_caps)); } if (tmp___0 == 0) { ret = -5; goto error_param; } else { { tmp___1 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vsi_id)); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { ret = -5; goto error_param; } else { } } } i = 0; goto ldv_57139; ldv_57138: { tmp___3 = i40e_check_vf_permission(vf, (u8 *)(& al->list[i].addr)); ret = (i40e_status )tmp___3; } if ((int )ret != 0) { goto error_param; } else { } i = i + 1; ldv_57139: ; if (i < (int )al->num_elements) { goto ldv_57138; } else { } vsi = *(pf->vsi + (unsigned long )vsi_id); i = 0; goto ldv_57143; ldv_57142: { f = i40e_find_mac(vsi, (u8 *)(& al->list[i].addr), 1, 0); } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { { tmp___4 = i40e_is_vsi_in_vlan(vsi); } if ((int )tmp___4) { { f = i40e_put_mac_in_vlan(vsi, (u8 *)(& al->list[i].addr), 1, 0); } } else { { f = i40e_add_filter(vsi, (u8 *)(& al->list[i].addr), -1, 1, 0); } } } else { } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to add VF MAC filter\n"); ret = -5; } goto error_param; } else { } i = i + 1; ldv_57143: ; if (i < (int )al->num_elements) { goto ldv_57142; } else { } { tmp___5 = i40e_sync_vsi_filters(vsi); } if (tmp___5 != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to program VF MAC filters\n"); } } else { } error_param: { tmp___6 = i40e_vc_send_resp_to_vf(vf, 10, ret); } return (tmp___6); } } static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_ether_addr_list *al ; struct i40e_pf *pf ; struct i40e_vsi *vsi ; u16 vsi_id ; i40e_status ret ; int i ; int tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; bool tmp___4 ; int tmp___5 ; int tmp___6 ; { { al = (struct i40e_virtchnl_ether_addr_list *)msg; pf = vf->pf; vsi = (struct i40e_vsi *)0; vsi_id = al->vsi_id; ret = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { ret = -5; goto error_param; } else { { tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_caps)); } if (tmp___0 == 0) { ret = -5; goto error_param; } else { { tmp___1 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vsi_id)); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { ret = -5; goto error_param; } else { } } } i = 0; goto ldv_57158; ldv_57157: { tmp___3 = is_broadcast_ether_addr((u8 const *)(& al->list[i].addr)); } if ((int )tmp___3) { { dev_err((struct device const *)(& (pf->pdev)->dev), "invalid VF MAC addr %pM\n", (u8 *)(& al->list[i].addr)); ret = -10; } goto error_param; } else { { tmp___4 = is_zero_ether_addr((u8 const *)(& al->list[i].addr)); } if ((int )tmp___4) { { dev_err((struct device const *)(& (pf->pdev)->dev), "invalid VF MAC addr %pM\n", (u8 *)(& al->list[i].addr)); ret = -10; } goto error_param; } else { } } i = i + 1; ldv_57158: ; if (i < (int )al->num_elements) { goto ldv_57157; } else { } vsi = *(pf->vsi + (unsigned long )vsi_id); i = 0; goto ldv_57161; ldv_57160: { i40e_del_filter(vsi, (u8 *)(& al->list[i].addr), -1, 1, 0); i = i + 1; } ldv_57161: ; if (i < (int )al->num_elements) { goto ldv_57160; } else { } { tmp___5 = i40e_sync_vsi_filters(vsi); } if (tmp___5 != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to program VF MAC filters\n"); } } else { } error_param: { tmp___6 = i40e_vc_send_resp_to_vf(vf, 11, ret); } return (tmp___6); } } static int i40e_vc_add_vlan_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_vlan_filter_list *vfl ; struct i40e_pf *pf ; struct i40e_vsi *vsi ; u16 vsi_id ; i40e_status aq_ret ; int i ; int tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int ret ; int tmp___3 ; int tmp___4 ; { { vfl = (struct i40e_virtchnl_vlan_filter_list *)msg; pf = vf->pf; vsi = (struct i40e_vsi *)0; vsi_id = vfl->vsi_id; aq_ret = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto error_param; } else { { tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_caps)); } if (tmp___0 == 0) { aq_ret = -5; goto error_param; } else { { tmp___1 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vsi_id)); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { aq_ret = -5; goto error_param; } else { } } } i = 0; goto ldv_57176; ldv_57175: ; if ((unsigned int )vfl->vlan_id[i] > 4095U) { { aq_ret = -5; dev_err((struct device const *)(& (pf->pdev)->dev), "invalid VF VLAN id %d\n", (int )vfl->vlan_id[i]); } goto error_param; } else { } i = i + 1; ldv_57176: ; if (i < (int )vfl->num_elements) { goto ldv_57175; } else { } vsi = *(pf->vsi + (unsigned long )vsi_id); if ((unsigned int )vsi->info.pvid != 0U) { aq_ret = -5; goto error_param; } else { } { i40e_vlan_stripping_enable(vsi); i = 0; } goto ldv_57180; ldv_57179: { tmp___3 = i40e_vsi_add_vlan(vsi, (int )((s16 )vfl->vlan_id[i])); ret = tmp___3; } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to add VF vlan filter %d, error %d\n", (int )vfl->vlan_id[i], ret); } } else { } i = i + 1; ldv_57180: ; if (i < (int )vfl->num_elements) { goto ldv_57179; } else { } error_param: { tmp___4 = i40e_vc_send_resp_to_vf(vf, 12, aq_ret); } return (tmp___4); } } static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf , u8 *msg , u16 msglen ) { struct i40e_virtchnl_vlan_filter_list *vfl ; struct i40e_pf *pf ; struct i40e_vsi *vsi ; u16 vsi_id ; i40e_status aq_ret ; int i ; int tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int ret ; int tmp___3 ; int tmp___4 ; { { vfl = (struct i40e_virtchnl_vlan_filter_list *)msg; pf = vf->pf; vsi = (struct i40e_vsi *)0; vsi_id = vfl->vsi_id; aq_ret = 0; tmp = constant_test_bit(1L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp == 0) { aq_ret = -5; goto error_param; } else { { tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_caps)); } if (tmp___0 == 0) { aq_ret = -5; goto error_param; } else { { tmp___1 = i40e_vc_isvalid_vsi_id(vf, (int )((u8 )vsi_id)); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { aq_ret = -5; goto error_param; } else { } } } i = 0; goto ldv_57195; ldv_57194: ; if ((unsigned int )vfl->vlan_id[i] > 4095U) { aq_ret = -5; goto error_param; } else { } i = i + 1; ldv_57195: ; if (i < (int )vfl->num_elements) { goto ldv_57194; } else { } vsi = *(pf->vsi + (unsigned long )vsi_id); if ((unsigned int )vsi->info.pvid != 0U) { aq_ret = -5; goto error_param; } else { } i = 0; goto ldv_57199; ldv_57198: { tmp___3 = i40e_vsi_kill_vlan(vsi, (int )((s16 )vfl->vlan_id[i])); ret = tmp___3; } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to delete VF vlan filter %d, error %d\n", (int )vfl->vlan_id[i], ret); } } else { } i = i + 1; ldv_57199: ; if (i < (int )vfl->num_elements) { goto ldv_57198; } else { } error_param: { tmp___4 = i40e_vc_send_resp_to_vf(vf, 13, aq_ret); } return (tmp___4); } } static int i40e_vc_validate_vf_msg(struct i40e_vf *vf , u32 v_opcode , u32 v_retval , u8 *msg , u16 msglen ) { bool err_msg_format ; int valid_len ; int tmp ; struct i40e_virtchnl_vsi_queue_config_info *vqc ; struct i40e_virtchnl_irq_map_info *vimi ; struct i40e_virtchnl_ether_addr_list *veal ; struct i40e_virtchnl_vlan_filter_list *vfl ; { { err_msg_format = 0; tmp = constant_test_bit(3L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp != 0) { return (-5); } else { } { if (v_opcode == 1U) { goto case_1; } else { } if (v_opcode == 2U) { goto case_2; } else { } if (v_opcode == 3U) { goto case_3; } else { } if (v_opcode == 4U) { goto case_4; } else { } if (v_opcode == 5U) { goto case_5; } else { } if (v_opcode == 6U) { goto case_6; } else { } if (v_opcode == 7U) { goto case_7; } else { } if (v_opcode == 8U) { goto case_8; } else { } if (v_opcode == 9U) { goto case_9; } else { } if (v_opcode == 10U) { goto case_10; } else { } if (v_opcode == 11U) { goto case_11; } else { } if (v_opcode == 12U) { goto case_12; } else { } if (v_opcode == 13U) { goto case_13; } else { } if (v_opcode == 14U) { goto case_14; } else { } if (v_opcode == 15U) { goto case_15; } else { } if (v_opcode == 17U) { goto case_17; } else { } if (v_opcode == 0U) { goto case_0; } else { } goto switch_default; case_1: /* CIL Label */ valid_len = 8; goto ldv_57211; case_2: /* CIL Label */ ; case_3: /* CIL Label */ valid_len = 0; goto ldv_57211; case_4: /* CIL Label */ valid_len = 24; goto ldv_57211; case_5: /* CIL Label */ valid_len = 40; goto ldv_57211; case_6: /* CIL Label */ valid_len = 72; if ((int )msglen >= valid_len) { vqc = (struct i40e_virtchnl_vsi_queue_config_info *)msg; valid_len = (int )((unsigned int )valid_len + (unsigned int )vqc->num_queue_pairs * 64U); if ((unsigned int )vqc->num_queue_pairs == 0U) { err_msg_format = 1; } else { } } else { } goto ldv_57211; case_7: /* CIL Label */ valid_len = 14; if ((int )msglen >= valid_len) { vimi = (struct i40e_virtchnl_irq_map_info *)msg; valid_len = (int )((unsigned int )valid_len + (unsigned int )vimi->num_vectors * 12U); if ((unsigned int )vimi->num_vectors == 0U) { err_msg_format = 1; } else { } } else { } goto ldv_57211; case_8: /* CIL Label */ ; case_9: /* CIL Label */ valid_len = 12; goto ldv_57211; case_10: /* CIL Label */ ; case_11: /* CIL Label */ valid_len = 12; if ((int )msglen >= valid_len) { veal = (struct i40e_virtchnl_ether_addr_list *)msg; valid_len = (int )((unsigned int )valid_len + (unsigned int )veal->num_elements * 8U); if ((unsigned int )veal->num_elements == 0U) { err_msg_format = 1; } else { } } else { } goto ldv_57211; case_12: /* CIL Label */ ; case_13: /* CIL Label */ valid_len = 6; if ((int )msglen >= valid_len) { vfl = (struct i40e_virtchnl_vlan_filter_list *)msg; valid_len = (int )((unsigned int )valid_len + (unsigned int )vfl->num_elements * 2U); if ((unsigned int )vfl->num_elements == 0U) { err_msg_format = 1; } else { } } else { } goto ldv_57211; case_14: /* CIL Label */ valid_len = 4; goto ldv_57211; case_15: /* CIL Label */ valid_len = 12; goto ldv_57211; case_17: /* CIL Label */ ; case_0: /* CIL Label */ ; switch_default: /* CIL Label */ ; return (-1); switch_break: /* CIL Label */ ; } ldv_57211: ; if (valid_len != (int )msglen || (int )err_msg_format) { { i40e_vc_send_resp_to_vf(vf, (enum i40e_virtchnl_ops )v_opcode, -5); } return (-22); } else { return (0); } } } int i40e_vc_process_vf_msg(struct i40e_pf *pf , u16 vf_id , u32 v_opcode , u32 v_retval , u8 *msg , u16 msglen ) { struct i40e_hw *hw ; int local_vf_id ; struct i40e_vf *vf ; int ret ; { hw = & pf->hw; local_vf_id = (int )((u32 )vf_id - hw->func_caps.vf_base_id); pf->vf_aq_requests = pf->vf_aq_requests + 1U; if (local_vf_id >= pf->num_alloc_vfs) { return (-22); } else { } { vf = pf->vf + (unsigned long )local_vf_id; ret = i40e_vc_validate_vf_msg(vf, v_opcode, v_retval, msg, (int )msglen); } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Invalid message from vf %d, opcode %d, len %d\n", local_vf_id, v_opcode, (int )msglen); } return (ret); } else { } { if (v_opcode == 1U) { goto case_1; } else { } if (v_opcode == 3U) { goto case_3; } else { } if (v_opcode == 2U) { goto case_2; } else { } if (v_opcode == 14U) { goto case_14; } else { } if (v_opcode == 6U) { goto case_6; } else { } if (v_opcode == 7U) { goto case_7; } else { } if (v_opcode == 8U) { goto case_8; } else { } if (v_opcode == 9U) { goto case_9; } else { } if (v_opcode == 10U) { goto case_10; } else { } if (v_opcode == 11U) { goto case_11; } else { } if (v_opcode == 12U) { goto case_12; } else { } if (v_opcode == 13U) { goto case_13; } else { } if (v_opcode == 15U) { goto case_15; } else { } if (v_opcode == 0U) { goto case_0; } else { } goto switch_default; case_1: /* CIL Label */ { ret = i40e_vc_get_version_msg(vf); } goto ldv_57246; case_3: /* CIL Label */ { ret = i40e_vc_get_vf_resources_msg(vf); } goto ldv_57246; case_2: /* CIL Label */ { i40e_vc_reset_vf_msg(vf); ret = 0; } goto ldv_57246; case_14: /* CIL Label */ { ret = i40e_vc_config_promiscuous_mode_msg(vf, msg, (int )msglen); } goto ldv_57246; case_6: /* CIL Label */ { ret = i40e_vc_config_queues_msg(vf, msg, (int )msglen); } goto ldv_57246; case_7: /* CIL Label */ { ret = i40e_vc_config_irq_map_msg(vf, msg, (int )msglen); } goto ldv_57246; case_8: /* CIL Label */ { ret = i40e_vc_enable_queues_msg(vf, msg, (int )msglen); } goto ldv_57246; case_9: /* CIL Label */ { ret = i40e_vc_disable_queues_msg(vf, msg, (int )msglen); } goto ldv_57246; case_10: /* CIL Label */ { ret = i40e_vc_add_mac_addr_msg(vf, msg, (int )msglen); } goto ldv_57246; case_11: /* CIL Label */ { ret = i40e_vc_del_mac_addr_msg(vf, msg, (int )msglen); } goto ldv_57246; case_12: /* CIL Label */ { ret = i40e_vc_add_vlan_msg(vf, msg, (int )msglen); } goto ldv_57246; case_13: /* CIL Label */ { ret = i40e_vc_remove_vlan_msg(vf, msg, (int )msglen); } goto ldv_57246; case_15: /* CIL Label */ { ret = i40e_vc_get_stats_msg(vf, msg, (int )msglen); } goto ldv_57246; case_0: /* CIL Label */ ; switch_default: /* CIL Label */ { dev_err((struct device const *)(& (pf->pdev)->dev), "Unsupported opcode %d from vf %d\n", v_opcode, local_vf_id); ret = i40e_vc_send_resp_to_vf(vf, (enum i40e_virtchnl_ops )v_opcode, -60); } goto ldv_57246; switch_break: /* CIL Label */ ; } ldv_57246: ; return (ret); } } int i40e_vc_process_vflr_event(struct i40e_pf *pf ) { u32 reg ; u32 reg_idx ; u32 bit_idx ; u32 vf_id ; struct i40e_hw *hw ; struct i40e_vf *vf ; int tmp ; { { hw = & pf->hw; tmp = constant_test_bit(8L, (unsigned long const volatile *)(& pf->state)); } if (tmp == 0) { return (0); } else { } { clear_bit(8L, (unsigned long volatile *)(& pf->state)); vf_id = 0U; } goto ldv_57271; ldv_57270: { reg_idx = (hw->func_caps.vf_base_id + vf_id) / 32U; bit_idx = (hw->func_caps.vf_base_id + vf_id) & 31U; vf = pf->vf + (unsigned long )vf_id; reg = readl((void const volatile *)hw->hw_addr + (unsigned long )((reg_idx + 149888U) * 4U)); } if ((reg & (u32 )(1 << (int )bit_idx)) != 0U) { { writel((unsigned int )(1 << (int )bit_idx), (void volatile *)hw->hw_addr + (unsigned long )((reg_idx + 149888U) * 4U)); i40e_reset_vf(vf, 1); } } else { } vf_id = vf_id + 1U; ldv_57271: ; if (vf_id < (u32 )pf->num_alloc_vfs) { goto ldv_57270; } else { } { reg = readl((void const volatile *)hw->hw_addr + 231424U); reg = reg | 536870912U; writel(reg, (void volatile *)hw->hw_addr + 231424U); readl((void const volatile *)hw->hw_addr + 745772U); } return (0); } } static void i40e_vc_vf_broadcast(struct i40e_pf *pf , enum i40e_virtchnl_ops v_opcode , i40e_status v_retval , u8 *msg , u16 msglen ) { struct i40e_hw *hw ; struct i40e_vf *vf ; int i ; { hw = & pf->hw; vf = pf->vf; i = 0; goto ldv_57284; ldv_57283: { i40e_aq_send_msg_to_vf(hw, (int )vf->vf_id, (u32 )v_opcode, (u32 )v_retval, msg, (int )msglen, (struct i40e_asq_cmd_details *)0); vf = vf + 1; i = i + 1; } ldv_57284: ; if (i < pf->num_alloc_vfs) { goto ldv_57283; } else { } return; } } void i40e_vc_notify_link_state(struct i40e_pf *pf ) { struct i40e_virtchnl_pf_event pfe ; { { pfe.event = 1; pfe.severity = 0; pfe.event_data.link_event.link_status = ((int )pf->hw.phy.link_info.link_info & 1) != 0; pfe.event_data.link_event.link_speed = pf->hw.phy.link_info.link_speed; i40e_vc_vf_broadcast(pf, 17, 0, (u8 *)(& pfe), 16); } return; } } void i40e_vc_notify_reset(struct i40e_pf *pf ) { struct i40e_virtchnl_pf_event pfe ; { { pfe.event = 2; pfe.severity = 255; i40e_vc_vf_broadcast(pf, 17, 0, (u8 *)(& pfe), 16); } return; } } void i40e_vc_notify_vf_reset(struct i40e_vf *vf ) { struct i40e_virtchnl_pf_event pfe ; { { pfe.event = 2; pfe.severity = 255; i40e_aq_send_msg_to_vf(& (vf->pf)->hw, (int )vf->vf_id, 17U, 0U, (u8 *)(& pfe), 16, (struct i40e_asq_cmd_details *)0); } return; } } int i40e_ndo_set_vf_mac(struct net_device *netdev , int vf_id , u8 *mac ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; struct i40e_mac_filter *f ; struct i40e_vf *vf ; int ret ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; ret = 0; } if (vf_id >= pf->num_alloc_vfs) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Invalid VF Identifier %d\n", vf_id); ret = -22; } goto error_param; } else { } { vf = pf->vf + (unsigned long )vf_id; vsi = *(pf->vsi + (unsigned long )vf->lan_vsi_index); tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp___0 == 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Uninitialized VF %d\n", vf_id); ret = -22; } goto error_param; } else { } { tmp___1 = is_valid_ether_addr((u8 const *)mac); } if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Invalid VF ethernet address\n"); ret = -22; } goto error_param; } else { } { i40e_del_filter(vsi, (u8 *)(& vf->default_lan_addr.addr), 0, 1, 0); f = i40e_add_filter(vsi, mac, 0, 1, 0); } if ((unsigned long )f == (unsigned long )((struct i40e_mac_filter *)0)) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to add VF ucast filter\n"); ret = -12; } goto error_param; } else { } { _dev_info((struct device const *)(& (pf->pdev)->dev), "Setting MAC %pM on VF %d\n", mac, vf_id); tmp___3 = i40e_sync_vsi_filters(vsi); } if (tmp___3 != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to program ucast filters\n"); ret = -5; } goto error_param; } else { } { memcpy((void *)(& vf->default_lan_addr.addr), (void const *)mac, 6UL); vf->pf_set_mac = 1; _dev_info((struct device const *)(& (pf->pdev)->dev), "Reload the VF driver to make this change effective.\n"); ret = 0; } error_param: ; return (ret); } } int i40e_ndo_set_vf_port_vlan(struct net_device *netdev , int vf_id , u16 vlan_id , u8 qos ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_pf *pf ; struct i40e_vsi *vsi ; struct i40e_vf *vf ; int ret ; int tmp___0 ; bool tmp___1 ; i40e_status tmp___2 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; pf = (np->vsi)->back; ret = 0; } if (vf_id >= pf->num_alloc_vfs) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Invalid VF Identifier %d\n", vf_id); ret = -22; } goto error_pvid; } else { } if ((unsigned int )vlan_id > 4095U || (unsigned int )qos > 7U) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Invalid VF Parameters\n"); ret = -22; } goto error_pvid; } else { } { vf = pf->vf + (unsigned long )vf_id; vsi = *(pf->vsi + (unsigned long )vf->lan_vsi_index); tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp___0 == 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Uninitialized VF %d\n", vf_id); ret = -22; } goto error_pvid; } else { } if ((unsigned int )vsi->info.pvid == 0U) { { tmp___1 = i40e_is_vsi_in_vlan(vsi); } if ((int )tmp___1) { { dev_err((struct device const *)(& (pf->pdev)->dev), "VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\nPlease unload and reload the VF driver for this change to take effect.\n", vf_id); } } else { } } else { } if (((unsigned int )vlan_id == 0U && (unsigned int )qos == 0U) && (unsigned int )vsi->info.pvid != 0U) { { ret = i40e_vsi_add_vlan(vsi, -1); } } else { } if ((unsigned int )vsi->info.pvid != 0U) { { ret = i40e_vsi_kill_vlan(vsi, (int )((s16 )vsi->info.pvid) & 4095); } if (ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "remove VLAN failed, ret=%d, aq_err=%d\n", ret, (unsigned int )pf->hw.aq.asq_last_status); } } else { } } else { } if ((unsigned int )vlan_id != 0U || (unsigned int )qos != 0U) { { tmp___2 = i40e_vsi_add_pvid(vsi, (int )((u16 )((int )((short )vlan_id) | (int )((short )((int )qos << 12))))); ret = (int )tmp___2; } } else { { i40e_vsi_remove_pvid(vsi); } } if ((unsigned int )vlan_id != 0U) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "Setting VLAN %d, QOS 0x%x on VF %d\n", (int )vlan_id, (int )qos, vf_id); ret = i40e_vsi_add_vlan(vsi, (int )((s16 )vlan_id)); } if (ret != 0) { { _dev_info((struct device const *)(& ((vsi->back)->pdev)->dev), "add VF VLAN failed, ret=%d aq_err=%d\n", ret, (unsigned int )(vsi->back)->hw.aq.asq_last_status); } goto error_pvid; } else { } { i40e_vsi_kill_vlan(vsi, -1); } } else { } if (ret != 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Unable to update VF vsi context\n"); } goto error_pvid; } else { } vf->port_vlan_id = vsi->info.pvid; ret = 0; error_pvid: ; return (ret); } } int i40e_ndo_set_vf_bw(struct net_device *netdev , int vf_id , int tx_rate ) { { return (-95); } } int i40e_ndo_get_vf_config(struct net_device *netdev , int vf_id , struct ifla_vf_info *ivi ) { struct i40e_netdev_priv *np ; void *tmp ; struct i40e_vsi *vsi ; struct i40e_pf *pf ; struct i40e_vf *vf ; int ret ; int tmp___0 ; { { tmp = netdev_priv((struct net_device const *)netdev); np = (struct i40e_netdev_priv *)tmp; vsi = np->vsi; pf = vsi->back; ret = 0; } if (vf_id >= pf->num_alloc_vfs) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Invalid VF Identifier %d\n", vf_id); ret = -22; } goto error_param; } else { } { vf = pf->vf + (unsigned long )vf_id; vsi = *(pf->vsi + (unsigned long )vf->lan_vsi_index); tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& vf->vf_states)); } if (tmp___0 == 0) { { dev_err((struct device const *)(& (pf->pdev)->dev), "Uninitialized VF %d\n", vf_id); ret = -22; } goto error_param; } else { } { ivi->vf = (__u32 )vf_id; memcpy((void *)(& ivi->mac), (void const *)(& vf->default_lan_addr.addr), 6UL); ivi->tx_rate = 0U; ivi->vlan = (__u32 )vsi->info.pvid & 4095U; ivi->qos = (__u32 )(((int )vsi->info.pvid & 28672) >> 12); ret = 0; } error_param: ; return (ret); } } static void *ldv_dev_get_drvdata_8___0(struct device const *dev ) { void *tmp ; { { tmp = ldv_dev_get_drvdata(dev); } return (tmp); } } __inline static __u32 __fswab32(__u32 val ) { int tmp ; { { tmp = __builtin_bswap32(val); } return ((__u32 )tmp); } } i40e_status i40e_get_dcbx_status(struct i40e_hw *hw , u16 *status ) ; i40e_status i40e_get_dcb_config(struct i40e_hw *hw ) ; i40e_status i40e_get_dcbx_status(struct i40e_hw *hw , u16 *status ) { u32 reg ; { if ((unsigned long )status == (unsigned long )((u16 *)0U)) { return (-5); } else { } { reg = readl((void const volatile *)hw->hw_addr + 536608U); *status = (unsigned int )((unsigned short )reg) & 7U; } return (0); } } static void i40e_parse_ieee_etscfg_tlv(struct i40e_lldp_org_tlv *tlv , struct i40e_dcbx_config *dcbcfg ) { struct i40e_ieee_ets_config *etscfg ; u8 *buf ; u16 offset ; u8 priority ; int i ; u16 tmp ; u16 tmp___0 ; { buf = (u8 *)(& tlv->tlvinfo); offset = 0U; etscfg = & dcbcfg->etscfg; etscfg->willing = (unsigned char )((int )*(buf + (unsigned long )offset) >> 7); etscfg->cbs = (unsigned char )(((int )*(buf + (unsigned long )offset) & 64) >> 6); etscfg->maxtcs = (unsigned int )*(buf + (unsigned long )offset) & 7U; offset = (u16 )((int )offset + 1); i = 0; goto ldv_49305; ldv_49304: priority = (unsigned char )(((int )*(buf + (unsigned long )offset) & 112) >> 4); etscfg->prioritytable[i * 2] = priority; priority = (unsigned int )*(buf + (unsigned long )offset) & 7U; etscfg->prioritytable[i * 2 + 1] = priority; offset = (u16 )((int )offset + 1); i = i + 1; ldv_49305: ; if (i <= 3) { goto ldv_49304; } else { } i = 0; goto ldv_49308; ldv_49307: tmp = offset; offset = (u16 )((int )offset + 1); etscfg->tcbwtable[i] = *(buf + (unsigned long )tmp); i = i + 1; ldv_49308: ; if (i <= 7) { goto ldv_49307; } else { } i = 0; goto ldv_49311; ldv_49310: tmp___0 = offset; offset = (u16 )((int )offset + 1); etscfg->tsatable[i] = *(buf + (unsigned long )tmp___0); i = i + 1; ldv_49311: ; if (i <= 7) { goto ldv_49310; } else { } return; } } static void i40e_parse_ieee_etsrec_tlv(struct i40e_lldp_org_tlv *tlv , struct i40e_dcbx_config *dcbcfg ) { u8 *buf ; u16 offset ; u8 priority ; int i ; u16 tmp ; u16 tmp___0 ; { buf = (u8 *)(& tlv->tlvinfo); offset = 0U; offset = (u16 )((int )offset + 1); i = 0; goto ldv_49322; ldv_49321: priority = (unsigned char )(((int )*(buf + (unsigned long )offset) & 112) >> 4); dcbcfg->etsrec.prioritytable[i * 2] = priority; priority = (unsigned int )*(buf + (unsigned long )offset) & 7U; dcbcfg->etsrec.prioritytable[i * 2 + 1] = priority; offset = (u16 )((int )offset + 1); i = i + 1; ldv_49322: ; if (i <= 3) { goto ldv_49321; } else { } i = 0; goto ldv_49325; ldv_49324: tmp = offset; offset = (u16 )((int )offset + 1); dcbcfg->etsrec.tcbwtable[i] = *(buf + (unsigned long )tmp); i = i + 1; ldv_49325: ; if (i <= 7) { goto ldv_49324; } else { } i = 0; goto ldv_49328; ldv_49327: tmp___0 = offset; offset = (u16 )((int )offset + 1); dcbcfg->etsrec.tsatable[i] = *(buf + (unsigned long )tmp___0); i = i + 1; ldv_49328: ; if (i <= 7) { goto ldv_49327; } else { } return; } } static void i40e_parse_ieee_pfccfg_tlv(struct i40e_lldp_org_tlv *tlv , struct i40e_dcbx_config *dcbcfg ) { u8 *buf ; { buf = (u8 *)(& tlv->tlvinfo); dcbcfg->pfc.willing = (unsigned char )((int )*buf >> 7); dcbcfg->pfc.mbc = (unsigned char )(((int )*buf & 64) >> 6); dcbcfg->pfc.pfccap = (unsigned int )*buf & 15U; dcbcfg->pfc.pfcenable = *(buf + 1UL); return; } } static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv , struct i40e_dcbx_config *dcbcfg ) { u16 typelength ; u16 offset ; u16 length ; int i ; u8 *buf ; __u16 tmp ; { { offset = 0U; i = 0; tmp = __fswab16((int )tlv->typelength); typelength = tmp; length = (unsigned int )typelength & 511U; buf = (u8 *)(& tlv->tlvinfo); length = (unsigned int )length - 5U; offset = (u16 )((int )offset + 1); } goto ldv_49346; ldv_49345: dcbcfg->app[i].priority = (unsigned char )((int )*(buf + (unsigned long )offset) >> 5); dcbcfg->app[i].selector = (unsigned int )*(buf + (unsigned long )offset) & 7U; dcbcfg->app[i].protocolid = (u16 )((int )((short )((int )*(buf + ((unsigned long )offset + 1UL)) << 8)) | (int )((short )*(buf + ((unsigned long )offset + 2UL)))); offset = (unsigned int )offset + 3U; i = i + 1; if (i > 31) { goto ldv_49344; } else { } ldv_49346: ; if ((int )offset < (int )length) { goto ldv_49345; } else { } ldv_49344: dcbcfg->numapps = (u32 )i; return; } } static void i40e_parse_ieee_tlv(struct i40e_lldp_org_tlv *tlv , struct i40e_dcbx_config *dcbcfg ) { u32 ouisubtype ; u8 subtype ; __u32 tmp ; { { tmp = __fswab32(tlv->ouisubtype); ouisubtype = tmp; subtype = (unsigned char )ouisubtype; } { if ((int )subtype == 9) { goto case_9; } else { } if ((int )subtype == 10) { goto case_10; } else { } if ((int )subtype == 11) { goto case_11; } else { } if ((int )subtype == 12) { goto case_12; } else { } goto switch_default; case_9: /* CIL Label */ { i40e_parse_ieee_etscfg_tlv(tlv, dcbcfg); } goto ldv_49354; case_10: /* CIL Label */ { i40e_parse_ieee_etsrec_tlv(tlv, dcbcfg); } goto ldv_49354; case_11: /* CIL Label */ { i40e_parse_ieee_pfccfg_tlv(tlv, dcbcfg); } goto ldv_49354; case_12: /* CIL Label */ { i40e_parse_ieee_app_tlv(tlv, dcbcfg); } goto ldv_49354; switch_default: /* CIL Label */ ; goto ldv_49354; switch_break: /* CIL Label */ ; } ldv_49354: ; return; } } static void i40e_parse_org_tlv(struct i40e_lldp_org_tlv *tlv , struct i40e_dcbx_config *dcbcfg ) { u32 ouisubtype ; u32 oui ; __u32 tmp ; { { tmp = __fswab32(tlv->ouisubtype); ouisubtype = tmp; oui = ouisubtype >> 8; } { if (oui == 32962U) { goto case_32962; } else { } goto switch_default; case_32962: /* CIL Label */ { i40e_parse_ieee_tlv(tlv, dcbcfg); } goto ldv_49366; switch_default: /* CIL Label */ ; goto ldv_49366; switch_break: /* CIL Label */ ; } ldv_49366: ; return; } } i40e_status i40e_lldp_to_dcb_config(u8 *lldpmib , struct i40e_dcbx_config *dcbcfg ) { i40e_status ret ; struct i40e_lldp_org_tlv *tlv ; u16 type ; u16 length ; u16 typelength ; __u16 tmp ; { ret = 0; if ((unsigned long )lldpmib == (unsigned long )((u8 *)0U) || (unsigned long )dcbcfg == (unsigned long )((struct i40e_dcbx_config *)0)) { return (-5); } else { } lldpmib = lldpmib + 14UL; tlv = (struct i40e_lldp_org_tlv *)lldpmib; goto ldv_49382; ldv_49381: { tmp = __fswab16((int )tlv->typelength); typelength = tmp; type = (unsigned short )((int )typelength >> 9); length = (unsigned int )typelength & 511U; } if ((unsigned int )type == 0U) { goto ldv_49377; } else { } { if ((int )type == 127) { goto case_127; } else { } goto switch_default; case_127: /* CIL Label */ { i40e_parse_org_tlv(tlv, dcbcfg); } goto ldv_49379; switch_default: /* CIL Label */ ; goto ldv_49379; switch_break: /* CIL Label */ ; } ldv_49379: tlv = tlv + ((unsigned long )length + 2UL); ldv_49382: ; if ((unsigned long )tlv != (unsigned long )((struct i40e_lldp_org_tlv *)0)) { goto ldv_49381; } else { } ldv_49377: ; return (ret); } } i40e_status i40e_aq_get_dcb_config(struct i40e_hw *hw , u8 mib_type , u8 bridgetype , struct i40e_dcbx_config *dcbcfg ) { i40e_status ret ; struct i40e_virt_mem mem ; u8 *lldpmib ; { { ret = 0; ret = i40e_allocate_virt_mem_d(hw, & mem, 1500U); } if ((int )ret != 0) { return (ret); } else { } { lldpmib = (u8 *)mem.va; ret = i40e_aq_get_lldp_mib(hw, (int )bridgetype, (int )mib_type, (void *)lldpmib, 1500, (u16 *)0U, (u16 *)0U, (struct i40e_asq_cmd_details *)0); } if ((int )ret != 0) { goto free_mem; } else { } { ret = i40e_lldp_to_dcb_config(lldpmib, dcbcfg); } free_mem: { i40e_free_virt_mem_d(hw, & mem); } return (ret); } } i40e_status i40e_get_dcb_config(struct i40e_hw *hw ) { i40e_status ret ; { { ret = 0; ret = i40e_aq_get_dcb_config(hw, 0, 0, & hw->local_dcbx_config); } if ((int )ret != 0) { goto out; } else { } { ret = i40e_aq_get_dcb_config(hw, 1, 0, & hw->remote_dcbx_config); } out: ; return (ret); } } i40e_status i40e_init_dcb(struct i40e_hw *hw ) { i40e_status ret ; { ret = 0; if (! hw->func_caps.dcb) { return (ret); } else { } { ret = i40e_get_dcbx_status(hw, & hw->dcbx_status); } if ((int )ret != 0) { return (ret); } else { } { if ((int )hw->dcbx_status == 2) { goto case_2; } else { } if ((int )hw->dcbx_status == 1) { goto case_1; } else { } if ((int )hw->dcbx_status == 7) { goto case_7; } else { } if ((int )hw->dcbx_status == 0) { goto case_0; } else { } if ((int )hw->dcbx_status == 3) { goto case_3; } else { } goto switch_default; case_2: /* CIL Label */ ; case_1: /* CIL Label */ { ret = i40e_get_dcb_config(hw); } goto ldv_49404; case_7: /* CIL Label */ ; return (ret); case_0: /* CIL Label */ ; case_3: /* CIL Label */ ; switch_default: /* CIL Label */ ; goto ldv_49404; switch_break: /* CIL Label */ ; } ldv_49404: { ret = i40e_aq_cfg_lldp_mib_change_event(hw, 1, (struct i40e_asq_cmd_details *)0); } if ((int )ret != 0) { return (ret); } else { } return (ret); } } extern int dcb_ieee_setapp(struct net_device * , struct dcb_app * ) ; extern int dcb_ieee_delapp(struct net_device * , struct dcb_app * ) ; extern int dcbnl_ieee_notify(struct net_device * , int , int , u32 , u32 ) ; static void i40e_get_pfc_delay(struct i40e_hw *hw , u16 *delay ) { u32 val ; { { val = readl((void const volatile *)hw->hw_addr + 536576U); *delay = (unsigned short )val; } return; } } static int i40e_dcbnl_ieee_getets(struct net_device *dev , struct ieee_ets *ets ) { struct i40e_pf *pf ; struct i40e_pf *tmp ; struct i40e_dcbx_config *dcbxcfg ; struct i40e_hw *hw ; { { tmp = i40e_netdev_to_pf(dev); pf = tmp; hw = & pf->hw; } if (((int )pf->dcbx_cap & 8) == 0) { return (-22); } else { } { dcbxcfg = & hw->local_dcbx_config; ets->willing = dcbxcfg->etscfg.willing; ets->ets_cap = dcbxcfg->etscfg.maxtcs; ets->cbs = dcbxcfg->etscfg.cbs; memcpy((void *)(& ets->tc_tx_bw), (void const *)(& dcbxcfg->etscfg.tcbwtable), 8UL); memcpy((void *)(& ets->tc_rx_bw), (void const *)(& dcbxcfg->etscfg.tcbwtable), 8UL); memcpy((void *)(& ets->tc_tsa), (void const *)(& dcbxcfg->etscfg.tsatable), 8UL); memcpy((void *)(& ets->prio_tc), (void const *)(& dcbxcfg->etscfg.prioritytable), 8UL); memcpy((void *)(& ets->tc_reco_bw), (void const *)(& dcbxcfg->etsrec.tcbwtable), 8UL); memcpy((void *)(& ets->tc_reco_tsa), (void const *)(& dcbxcfg->etsrec.tsatable), 8UL); memcpy((void *)(& ets->reco_prio_tc), (void const *)(& dcbxcfg->etscfg.prioritytable), 8UL); } return (0); } } static int i40e_dcbnl_ieee_getpfc(struct net_device *dev , struct ieee_pfc *pfc ) { struct i40e_pf *pf ; struct i40e_pf *tmp ; struct i40e_dcbx_config *dcbxcfg ; struct i40e_hw *hw ; int i ; { { tmp = i40e_netdev_to_pf(dev); pf = tmp; hw = & pf->hw; } if (((int )pf->dcbx_cap & 8) == 0) { return (-22); } else { } { dcbxcfg = & hw->local_dcbx_config; pfc->pfc_cap = dcbxcfg->pfc.pfccap; pfc->pfc_en = dcbxcfg->pfc.pfcenable; pfc->mbc = dcbxcfg->pfc.mbc; i40e_get_pfc_delay(hw, & pfc->delay); i = 0; } goto ldv_56793; ldv_56792: pfc->requests[i] = pf->stats.priority_xoff_tx[i]; pfc->indications[i] = pf->stats.priority_xoff_rx[i]; i = i + 1; ldv_56793: ; if (i <= 7) { goto ldv_56792; } else { } return (0); } } static u8 i40e_dcbnl_getdcbx(struct net_device *dev ) { struct i40e_pf *pf ; struct i40e_pf *tmp ; { { tmp = i40e_netdev_to_pf(dev); pf = tmp; } return ((u8 )pf->dcbx_cap); } } static void i40e_dcbnl_get_perm_hw_addr(struct net_device *dev , u8 *perm_addr ) { struct i40e_pf *pf ; struct i40e_pf *tmp ; int i ; int j ; { { tmp = i40e_netdev_to_pf(dev); pf = tmp; memset((void *)perm_addr, 255, 32UL); i = 0; } goto ldv_56807; ldv_56806: *(perm_addr + (unsigned long )i) = pf->hw.mac.perm_addr[i]; i = i + 1; ldv_56807: ; if (i < (int )dev->addr_len) { goto ldv_56806; } else { } j = 0; goto ldv_56810; ldv_56809: *(perm_addr + (unsigned long )i) = pf->hw.mac.san_addr[j]; j = j + 1; i = i + 1; ldv_56810: ; if (j < (int )dev->addr_len) { goto ldv_56809; } else { } return; } } static struct dcbnl_rtnl_ops const dcbnl_ops = {& i40e_dcbnl_ieee_getets, 0, 0, 0, & i40e_dcbnl_ieee_getpfc, 0, 0, 0, 0, 0, 0, 0, 0, & i40e_dcbnl_get_perm_hw_addr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & i40e_dcbnl_getdcbx, 0, 0, 0, 0, 0}; void i40e_dcbnl_set_all(struct i40e_vsi *vsi ) { struct net_device *dev ; struct i40e_pf *pf ; struct i40e_pf *tmp ; struct i40e_dcbx_config *dcbxcfg ; struct i40e_hw *hw ; struct dcb_app sapp ; u8 prio ; u8 tc_map ; int i ; { { dev = vsi->netdev; tmp = i40e_netdev_to_pf(dev); pf = tmp; hw = & pf->hw; } if ((pf->flags & 1048576ULL) == 0ULL) { return; } else { } dcbxcfg = & hw->local_dcbx_config; i = 0; goto ldv_56825; ldv_56824: prio = dcbxcfg->app[i].priority; tc_map = (u8 )(1 << (int )dcbxcfg->etscfg.prioritytable[(int )prio]); if ((unsigned int )((int )tc_map & (int )vsi->tc_config.enabled_tc) != 0U) { { sapp.selector = dcbxcfg->app[i].selector; sapp.protocol = dcbxcfg->app[i].protocolid; sapp.priority = prio; dcb_ieee_setapp(dev, & sapp); } } else { } i = i + 1; ldv_56825: ; if ((u32 )i < dcbxcfg->numapps) { goto ldv_56824; } else { } { dcbnl_ieee_notify(dev, 79, 20, 0U, 0U); } return; } } static int i40e_dcbnl_vsi_del_app(struct i40e_vsi *vsi , struct i40e_ieee_app_priority_table *app ) { struct net_device *dev ; struct dcb_app sapp ; int tmp ; { dev = vsi->netdev; if ((unsigned long )dev == (unsigned long )((struct net_device *)0)) { return (-22); } else { } { sapp.selector = app->selector; sapp.protocol = app->protocolid; sapp.priority = app->priority; tmp = dcb_ieee_delapp(dev, & sapp); } return (tmp); } } static void i40e_dcbnl_del_app(struct i40e_pf *pf , struct i40e_ieee_app_priority_table *app ) { int v ; int err ; { v = 0; goto ldv_56841; ldv_56840: ; if ((unsigned long )*(pf->vsi + (unsigned long )v) != (unsigned long )((struct i40e_vsi *)0) && (unsigned long )(*(pf->vsi + (unsigned long )v))->netdev != (unsigned long )((struct net_device *)0)) { { err = i40e_dcbnl_vsi_del_app(*(pf->vsi + (unsigned long )v), app); } if (err != 0) { { _dev_info((struct device const *)(& (pf->pdev)->dev), "%s: Failed deleting app for VSI seid=%d err=%d sel=%d proto=0x%x prio=%d\n", "i40e_dcbnl_del_app", (int )(*(pf->vsi + (unsigned long )v))->seid, err, (int )app->selector, (int )app->protocolid, (int )app->priority); } } else { } } else { } v = v + 1; ldv_56841: ; if ((u32 )v < pf->hw.func_caps.num_vsis) { goto ldv_56840; } else { } return; } } static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg , struct i40e_ieee_app_priority_table *app ) { int i ; { i = 0; goto ldv_56849; ldv_56848: ; if (((int )app->selector == (int )cfg->app[i].selector && (int )app->protocolid == (int )cfg->app[i].protocolid) && (int )app->priority == (int )cfg->app[i].priority) { return (1); } else { } i = i + 1; ldv_56849: ; if ((u32 )i < cfg->numapps) { goto ldv_56848; } else { } return (0); } } void i40e_dcbnl_flush_apps(struct i40e_pf *pf , struct i40e_dcbx_config *new_cfg ) { struct i40e_ieee_app_priority_table app ; struct i40e_dcbx_config *dcbxcfg ; struct i40e_hw *hw ; int i ; bool tmp ; int tmp___0 ; { hw = & pf->hw; dcbxcfg = & hw->local_dcbx_config; i = 0; goto ldv_56860; ldv_56859: { app = dcbxcfg->app[i]; tmp = i40e_dcbnl_find_app(new_cfg, & app); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { { i40e_dcbnl_del_app(pf, & app); } } else { } i = i + 1; ldv_56860: ; if ((u32 )i < dcbxcfg->numapps) { goto ldv_56859; } else { } return; } } void i40e_dcbnl_setup(struct i40e_vsi *vsi ) { struct net_device *dev ; struct i40e_pf *pf ; struct i40e_pf *tmp ; { { dev = vsi->netdev; tmp = i40e_netdev_to_pf(dev); pf = tmp; } if ((pf->flags & 1048576ULL) == 0ULL) { return; } else { } if ((pf->flags & 67108864ULL) == 0ULL) { dev->dcbnl_ops = & dcbnl_ops; } else { } { i40e_dcbnl_set_all(vsi); } return; } } unsigned char (*ldv_10_callback_getdcbx)(struct net_device * ) = & i40e_dcbnl_getdcbx; void (*ldv_10_callback_getpermhwaddr)(struct net_device * , unsigned char * ) = & i40e_dcbnl_get_perm_hw_addr; int (*ldv_10_callback_ieee_getets)(struct net_device * , struct ieee_ets * ) = & i40e_dcbnl_ieee_getets; int (*ldv_10_callback_ieee_getpfc)(struct net_device * , struct ieee_pfc * ) = & i40e_dcbnl_ieee_getpfc; void ldv_dummy_resourceless_instance_callback_10_10(int (*arg0)(struct net_device * , struct ieee_ets * ) , struct net_device *arg1 , struct ieee_ets *arg2 ) { { { i40e_dcbnl_ieee_getets(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_10_11(int (*arg0)(struct net_device * , struct ieee_pfc * ) , struct net_device *arg1 , struct ieee_pfc *arg2 ) { { { i40e_dcbnl_ieee_getpfc(arg1, arg2); } return; } } void ldv_dummy_resourceless_instance_callback_10_3(unsigned char (*arg0)(struct net_device * ) , struct net_device *arg1 ) { { { i40e_dcbnl_getdcbx(arg1); } return; } } void ldv_dummy_resourceless_instance_callback_10_7(void (*arg0)(struct net_device * , unsigned char * ) , struct net_device *arg1 , unsigned char *arg2 ) { { { i40e_dcbnl_get_perm_hw_addr(arg1, arg2); } return; } } void *ldv_xzalloc(size_t size ) ; void *ldv_dev_get_drvdata(struct device const *dev ) { { if ((unsigned long )dev != (unsigned long )((struct device const *)0) && (unsigned long )dev->p != (unsigned long )((struct device_private */* const */)0)) { return ((dev->p)->driver_data); } else { } return ((void *)0); } } int ldv_dev_set_drvdata(struct device *dev , void *data ) { void *tmp ; { { tmp = ldv_xzalloc(8UL); dev->p = (struct device_private *)tmp; (dev->p)->driver_data = data; } return (0); } } void *ldv_zalloc(size_t size ) ; struct spi_master *ldv_spi_alloc_master(struct device *host , unsigned int size ) { struct spi_master *master ; void *tmp ; { { tmp = ldv_zalloc((unsigned long )size + 2200UL); master = (struct spi_master *)tmp; } if ((unsigned long )master == (unsigned long )((struct spi_master *)0)) { return ((struct spi_master *)0); } else { } { ldv_dev_set_drvdata(& master->dev, (void *)master + 1U); } return (master); } } long ldv_is_err(void const *ptr ) { { return ((unsigned long )ptr > 4294967295UL); } } void *ldv_err_ptr(long error ) { { return ((void *)(4294967295L - error)); } } long ldv_ptr_err(void const *ptr ) { { return ((long )(4294967295UL - (unsigned long )ptr)); } } long ldv_is_err_or_null(void const *ptr ) { long tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { { tmp = ldv_is_err(ptr); } if (tmp != 0L) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((long )tmp___0); } } static int ldv_filter_positive_int(int val ) { { { ldv_assume(val <= 0); } return (val); } } int ldv_post_init(int init_ret_val ) { int tmp ; { { tmp = ldv_filter_positive_int(init_ret_val); } return (tmp); } } int ldv_post_probe(int probe_ret_val ) { int tmp ; { { tmp = ldv_filter_positive_int(probe_ret_val); } return (tmp); } } int ldv_filter_err_code(int ret_val ) { int tmp ; { { tmp = ldv_filter_positive_int(ret_val); } return (tmp); } } extern void ldv_check_alloc_flags(gfp_t ) ; extern void ldv_after_alloc(void * ) ; void *ldv_kzalloc(size_t size , gfp_t flags ) { void *res ; { { ldv_check_alloc_flags(flags); res = ldv_zalloc(size); ldv_after_alloc(res); } return (res); } } extern void ldv_assert(char const * , int ) ; void ldv__builtin_trap(void) ; void ldv_assume(int expression ) { { if (expression == 0) { ldv_assume_label: ; goto ldv_assume_label; } else { } return; } } void ldv_stop(void) { { ldv_stop_label: ; goto ldv_stop_label; } } long ldv__builtin_expect(long exp , long c ) { { return (exp); } } void ldv__builtin_trap(void) { { { ldv_assert("", 0); } return; } } void *ldv_malloc(size_t size ) ; void *ldv_calloc(size_t nmemb , size_t size ) ; void *ldv_malloc_unknown_size(void) ; void *ldv_calloc_unknown_size(void) ; void *ldv_zalloc_unknown_size(void) ; void *ldv_xmalloc_unknown_size(size_t size ) ; extern void *malloc(size_t ) ; extern void *calloc(size_t , size_t ) ; extern void free(void * ) ; void *ldv_malloc(size_t size ) { void *res ; void *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { { tmp = malloc(size); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } else { return ((void *)0); } } } void *ldv_calloc(size_t nmemb , size_t size ) { void *res ; void *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { { tmp = calloc(nmemb, size); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } else { return ((void *)0); } } } void *ldv_zalloc(size_t size ) { void *tmp ; { { tmp = ldv_calloc(1UL, size); } return (tmp); } } void ldv_free(void *s ) { { { free(s); } return; } } void *ldv_xmalloc(size_t size ) { void *res ; void *tmp ; long tmp___0 ; { { tmp = malloc(size); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } } void *ldv_xzalloc(size_t size ) { void *res ; void *tmp ; long tmp___0 ; { { tmp = calloc(1UL, size); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } } void *ldv_malloc_unknown_size(void) { void *res ; void *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { { tmp = external_allocated_data(); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } else { return ((void *)0); } } } void *ldv_calloc_unknown_size(void) { void *res ; void *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { { tmp = external_allocated_data(); res = tmp; memset(res, 0, 8UL); ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } else { return ((void *)0); } } } void *ldv_zalloc_unknown_size(void) { void *tmp ; { { tmp = ldv_calloc_unknown_size(); } return (tmp); } } void *ldv_xmalloc_unknown_size(size_t size ) { void *res ; void *tmp ; long tmp___0 ; { { tmp = external_allocated_data(); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } } void *ldv_undef_ptr(void) ; unsigned long ldv_undef_ulong(void) ; int ldv_undef_int_negative(void) ; int ldv_undef_int_nonpositive(void) ; extern int __VERIFIER_nondet_int(void) ; extern unsigned long __VERIFIER_nondet_ulong(void) ; extern void *__VERIFIER_nondet_pointer(void) ; 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); } } int ldv_undef_int_negative(void) { int ret ; int tmp ; { { tmp = ldv_undef_int(); ret = tmp; ldv_assume(ret < 0); } return (ret); } } int ldv_undef_int_nonpositive(void) { int ret ; int tmp ; { { tmp = ldv_undef_int(); ret = tmp; ldv_assume(ret <= 0); } return (ret); } } int ldv_thread_create(struct ldv_thread *ldv_thread , void (*function)(void * ) , void *data ) ; int ldv_thread_create_N(struct ldv_thread_set *ldv_thread_set , void (*function)(void * ) , void *data ) ; int ldv_thread_join(struct ldv_thread *ldv_thread , void (*function)(void * ) ) ; int ldv_thread_join_N(struct ldv_thread_set *ldv_thread_set , void (*function)(void * ) ) ; int ldv_thread_create(struct ldv_thread *ldv_thread , void (*function)(void * ) , void *data ) { { if ((unsigned long )function != (unsigned long )((void (*)(void * ))0)) { { (*function)(data); } } else { } return (0); } } int ldv_thread_create_N(struct ldv_thread_set *ldv_thread_set , void (*function)(void * ) , void *data ) { int i ; { if ((unsigned long )function != (unsigned long )((void (*)(void * ))0)) { i = 0; goto ldv_1179; ldv_1178: { (*function)(data); i = i + 1; } ldv_1179: ; if (i < ldv_thread_set->number) { goto ldv_1178; } else { } } else { } return (0); } } int ldv_thread_join(struct ldv_thread *ldv_thread , void (*function)(void * ) ) { { return (0); } } int ldv_thread_join_N(struct ldv_thread_set *ldv_thread_set , void (*function)(void * ) ) { { return (0); } } void ldv_assert_linux_drivers_clk1__more_at_exit(int expr ) ; int ldv_counter = 0; void ldv_clk_disable(struct clk *clk ) { { ldv_counter = 0; return; } } int ldv_clk_enable(void) { int retval ; int tmp ; { { tmp = ldv_undef_int(); retval = tmp; } if (retval == 0) { ldv_counter = 1; } else { } return (retval); } } void ldv_check_final_state(void) { { { ldv_assert_linux_drivers_clk1__more_at_exit(ldv_counter == 0); } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_drivers_clk1__more_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } }