Error Trace

[Home]

Bug # 152

Show/hide error trace
Error trace
Function bodies
Blocks
  • Others...
    Function bodies without model function calls
    Initialization function calls
    Initialization function bodies
    Entry point
    Entry point body
    Function calls
    Skipped function calls
    Formal parameter names
    Declarations
    Assumes
    Assume conditions
    Returns
    Return values
    DEG initialization
    DEG function calls
    Model function calls
    Model function bodies
    Model asserts
    Model state changes
    Model function function calls
    Model function function bodies
    Model returns
    Model others
    Identation
    Line numbers
    Expand signs
-__CPAchecker_initialize()
{
20 typedef unsigned char __u8;
23 typedef unsigned short __u16;
25 typedef int __s32;
26 typedef unsigned int __u32;
30 typedef unsigned long long __u64;
15 typedef signed char s8;
16 typedef unsigned char u8;
19 typedef unsigned short u16;
21 typedef int s32;
22 typedef unsigned int u32;
24 typedef long long s64;
25 typedef unsigned long long u64;
14 typedef long __kernel_long_t;
15 typedef unsigned long __kernel_ulong_t;
27 typedef int __kernel_pid_t;
48 typedef unsigned int __kernel_uid32_t;
49 typedef unsigned int __kernel_gid32_t;
71 typedef __kernel_ulong_t __kernel_size_t;
72 typedef __kernel_long_t __kernel_ssize_t;
87 typedef long long __kernel_loff_t;
88 typedef __kernel_long_t __kernel_time_t;
89 typedef __kernel_long_t __kernel_clock_t;
90 typedef int __kernel_timer_t;
91 typedef int __kernel_clockid_t;
33 typedef __u16 __be16;
35 typedef __u32 __be32;
40 typedef __u32 __wsum;
255 struct kernel_symbol { unsigned long value; const char *name; } ;
33 struct module ;
12 typedef __u32 __kernel_dev_t;
15 typedef __kernel_dev_t dev_t;
18 typedef unsigned short umode_t;
21 typedef __kernel_pid_t pid_t;
26 typedef __kernel_clockid_t clockid_t;
29 typedef _Bool bool;
31 typedef __kernel_uid32_t uid_t;
32 typedef __kernel_gid32_t gid_t;
45 typedef __kernel_loff_t loff_t;
54 typedef __kernel_size_t size_t;
59 typedef __kernel_ssize_t ssize_t;
69 typedef __kernel_time_t time_t;
102 typedef __s32 int32_t;
106 typedef __u8 uint8_t;
108 typedef __u32 uint32_t;
111 typedef __u64 uint64_t;
133 typedef unsigned long sector_t;
134 typedef unsigned long blkcnt_t;
152 typedef u64 dma_addr_t;
157 typedef unsigned int gfp_t;
158 typedef unsigned int fmode_t;
159 typedef unsigned int oom_flags_t;
162 typedef u64 phys_addr_t;
167 typedef phys_addr_t resource_size_t;
173 typedef unsigned long irq_hw_number_t;
177 struct __anonstruct_atomic_t_6 { int counter; } ;
177 typedef struct __anonstruct_atomic_t_6 atomic_t;
182 struct __anonstruct_atomic64_t_7 { long counter; } ;
182 typedef struct __anonstruct_atomic64_t_7 atomic64_t;
183 struct list_head { struct list_head *next; struct list_head *prev; } ;
188 struct hlist_node ;
188 struct hlist_head { struct hlist_node *first; } ;
192 struct hlist_node { struct hlist_node *next; struct hlist_node **pprev; } ;
203 struct callback_head { struct callback_head *next; void (*func)(struct callback_head *); } ;
72 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; } ;
66 struct __anonstruct____missing_field_name_9 { unsigned int a; unsigned int b; } ;
66 struct __anonstruct____missing_field_name_10 { u16 limit0; u16 base0; unsigned char base1; unsigned char type; unsigned char s; unsigned char dpl; unsigned char p; unsigned char limit; unsigned char avl; unsigned char l; unsigned char d; unsigned char g; unsigned char base2; } ;
66 union __anonunion____missing_field_name_8 { struct __anonstruct____missing_field_name_9 __annonCompField4; struct __anonstruct____missing_field_name_10 __annonCompField5; } ;
66 struct desc_struct { union __anonunion____missing_field_name_8 __annonCompField6; } ;
12 typedef unsigned long pteval_t;
13 typedef unsigned long pmdval_t;
15 typedef unsigned long pgdval_t;
16 typedef unsigned long pgprotval_t;
18 struct __anonstruct_pte_t_11 { pteval_t pte; } ;
18 typedef struct __anonstruct_pte_t_11 pte_t;
20 struct pgprot { pgprotval_t pgprot; } ;
221 typedef struct pgprot pgprot_t;
223 struct __anonstruct_pgd_t_12 { pgdval_t pgd; } ;
223 typedef struct __anonstruct_pgd_t_12 pgd_t;
262 struct __anonstruct_pmd_t_14 { pmdval_t pmd; } ;
262 typedef struct __anonstruct_pmd_t_14 pmd_t;
390 struct page ;
390 typedef struct page *pgtable_t;
401 struct file ;
414 struct seq_file ;
452 struct thread_struct ;
454 struct mm_struct ;
455 struct task_struct ;
456 struct cpumask ;
20 struct qspinlock { atomic_t val; } ;
33 typedef struct qspinlock arch_spinlock_t;
34 struct qrwlock { atomic_t cnts; arch_spinlock_t wait_lock; } ;
14 typedef struct qrwlock arch_rwlock_t;
131 typedef void (*ctor_fn_t)();
48 struct device ;
54 struct net_device ;
420 struct file_operations ;
432 struct completion ;
27 union __anonunion___u_16 { struct list_head *__val; char __c[1U]; } ;
200 union __anonunion___u_20 { struct list_head *__val; char __c[1U]; } ;
555 struct bug_entry { int bug_addr_disp; int file_disp; unsigned short line; unsigned short flags; } ;
102 struct timespec ;
103 struct compat_timespec ;
104 struct __anonstruct_futex_32 { u32 *uaddr; u32 val; u32 flags; u32 bitset; u64 time; u32 *uaddr2; } ;
104 struct __anonstruct_nanosleep_33 { clockid_t clockid; struct timespec *rmtp; struct compat_timespec *compat_rmtp; u64 expires; } ;
104 struct pollfd ;
104 struct __anonstruct_poll_34 { struct pollfd *ufds; int nfds; int has_timeout; unsigned long tv_sec; unsigned long tv_nsec; } ;
104 union __anonunion____missing_field_name_31 { struct __anonstruct_futex_32 futex; struct __anonstruct_nanosleep_33 nanosleep; struct __anonstruct_poll_34 poll; } ;
104 struct restart_block { long int (*fn)(struct restart_block *); union __anonunion____missing_field_name_31 __annonCompField7; } ;
27 struct math_emu_info { long ___orig_eip; struct pt_regs *regs; } ;
328 struct cpumask { unsigned long bits[128U]; } ;
15 typedef struct cpumask cpumask_t;
656 typedef struct cpumask *cpumask_var_t;
23 typedef atomic64_t atomic_long_t;
82 struct static_key { atomic_t enabled; } ;
264 struct tracepoint_func { void *func; void *data; int prio; } ;
18 struct tracepoint { const char *name; struct static_key key; void (*regfunc)(); void (*unregfunc)(); struct tracepoint_func *funcs; } ;
260 struct fregs_state { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u32 status; } ;
26 struct __anonstruct____missing_field_name_59 { u64 rip; u64 rdp; } ;
26 struct __anonstruct____missing_field_name_60 { u32 fip; u32 fcs; u32 foo; u32 fos; } ;
26 union __anonunion____missing_field_name_58 { struct __anonstruct____missing_field_name_59 __annonCompField13; struct __anonstruct____missing_field_name_60 __annonCompField14; } ;
26 union __anonunion____missing_field_name_61 { u32 padding1[12U]; u32 sw_reserved[12U]; } ;
26 struct fxregs_state { u16 cwd; u16 swd; u16 twd; u16 fop; union __anonunion____missing_field_name_58 __annonCompField15; u32 mxcsr; u32 mxcsr_mask; u32 st_space[32U]; u32 xmm_space[64U]; u32 padding[12U]; union __anonunion____missing_field_name_61 __annonCompField16; } ;
66 struct swregs_state { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u8 ftop; u8 changed; u8 lookahead; u8 no_update; u8 rm; u8 alimit; struct math_emu_info *info; u32 entry_eip; } ;
214 struct xstate_header { u64 xfeatures; u64 xcomp_bv; u64 reserved[6U]; } ;
220 struct xregs_state { struct fxregs_state i387; struct xstate_header header; u8 extended_state_area[0U]; } ;
235 union fpregs_state { struct fregs_state fsave; struct fxregs_state fxsave; struct swregs_state soft; struct xregs_state xsave; u8 __padding[4096U]; } ;
252 struct fpu { unsigned int last_cpu; unsigned char fpstate_active; unsigned char fpregs_active; unsigned char counter; union fpregs_state state; } ;
170 struct seq_operations ;
369 struct perf_event ;
370 struct thread_struct { struct desc_struct tls_array[3U]; unsigned long sp0; unsigned long sp; unsigned short es; unsigned short ds; unsigned short fsindex; unsigned short gsindex; unsigned long fs; unsigned long gs; struct perf_event *ptrace_bps[4U]; unsigned long debugreg6; unsigned long ptrace_dr7; unsigned long cr2; unsigned long trap_nr; unsigned long error_code; unsigned long *io_bitmap_ptr; unsigned long iopl; unsigned int io_bitmap_max; struct fpu fpu; } ;
488 struct __anonstruct_mm_segment_t_73 { unsigned long seg; } ;
488 typedef struct __anonstruct_mm_segment_t_73 mm_segment_t;
842 struct thread_info { struct task_struct *task; __u32 flags; __u32 status; __u32 cpu; mm_segment_t addr_limit; unsigned char sig_on_uaccess_error; unsigned char uaccess_err; } ;
33 struct lockdep_map ;
55 struct stack_trace { unsigned int nr_entries; unsigned int max_entries; unsigned long *entries; int skip; } ;
28 struct lockdep_subclass_key { char __one_byte; } ;
53 struct lock_class_key { struct lockdep_subclass_key subkeys[8U]; } ;
59 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; const char *name; int name_version; unsigned long contention_point[4U]; unsigned long contending_point[4U]; } ;
144 struct lockdep_map { struct lock_class_key *key; struct lock_class *class_cache[2U]; const char *name; int cpu; unsigned long ip; } ;
205 struct held_lock { u64 prev_chain_key; unsigned long acquire_ip; struct lockdep_map *instance; struct lockdep_map *nest_lock; u64 waittime_stamp; u64 holdtime_stamp; unsigned short class_idx; unsigned char irq_context; unsigned char trylock; unsigned char read; unsigned char check; unsigned char hardirqs_off; unsigned short references; unsigned int pin_count; } ;
546 struct raw_spinlock { arch_spinlock_t raw_lock; unsigned int magic; unsigned int owner_cpu; void *owner; struct lockdep_map dep_map; } ;
32 typedef struct raw_spinlock raw_spinlock_t;
33 struct __anonstruct____missing_field_name_75 { u8 __padding[24U]; struct lockdep_map dep_map; } ;
33 union __anonunion____missing_field_name_74 { struct raw_spinlock rlock; struct __anonstruct____missing_field_name_75 __annonCompField19; } ;
33 struct spinlock { union __anonunion____missing_field_name_74 __annonCompField20; } ;
76 typedef struct spinlock spinlock_t;
23 struct __anonstruct_rwlock_t_76 { arch_rwlock_t raw_lock; unsigned int magic; unsigned int owner_cpu; void *owner; struct lockdep_map dep_map; } ;
23 typedef struct __anonstruct_rwlock_t_76 rwlock_t;
416 struct seqcount { unsigned int sequence; struct lockdep_map dep_map; } ;
52 typedef struct seqcount seqcount_t;
404 struct __anonstruct_seqlock_t_89 { struct seqcount seqcount; spinlock_t lock; } ;
404 typedef struct __anonstruct_seqlock_t_89 seqlock_t;
598 struct timespec { __kernel_time_t tv_sec; long tv_nsec; } ;
83 struct user_namespace ;
22 struct __anonstruct_kuid_t_90 { uid_t val; } ;
22 typedef struct __anonstruct_kuid_t_90 kuid_t;
27 struct __anonstruct_kgid_t_91 { gid_t val; } ;
27 typedef struct __anonstruct_kgid_t_91 kgid_t;
139 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; } ;
36 struct vm_area_struct ;
12 struct __wait_queue ;
12 typedef struct __wait_queue wait_queue_t;
15 struct __wait_queue { unsigned int flags; void *private; int (*func)(wait_queue_t *, unsigned int, int, void *); struct list_head task_list; } ;
38 struct __wait_queue_head { spinlock_t lock; struct list_head task_list; } ;
43 typedef struct __wait_queue_head wait_queue_head_t;
95 struct __anonstruct_nodemask_t_92 { unsigned long bits[16U]; } ;
95 typedef struct __anonstruct_nodemask_t_92 nodemask_t;
13 struct optimistic_spin_queue { atomic_t tail; } ;
39 struct mutex { atomic_t count; spinlock_t wait_lock; struct list_head wait_list; struct task_struct *owner; void *magic; struct lockdep_map dep_map; } ;
67 struct mutex_waiter { struct list_head list; struct task_struct *task; void *magic; } ;
177 struct rw_semaphore ;
178 struct rw_semaphore { long count; struct list_head wait_list; raw_spinlock_t wait_lock; struct optimistic_spin_queue osq; struct task_struct *owner; struct lockdep_map dep_map; } ;
172 struct completion { unsigned int done; wait_queue_head_t wait; } ;
446 union ktime { s64 tv64; } ;
41 typedef union ktime ktime_t;
335 struct notifier_block ;
1148 struct timer_list { struct hlist_node entry; unsigned long expires; void (*function)(unsigned long); unsigned long data; u32 flags; int slack; int start_pid; void *start_site; char start_comm[16U]; struct lockdep_map lockdep_map; } ;
238 struct hrtimer ;
239 enum hrtimer_restart ;
240 struct rb_node { unsigned long __rb_parent_color; struct rb_node *rb_right; struct rb_node *rb_left; } ;
41 struct rb_root { struct rb_node *rb_node; } ;
837 struct ctl_table ;
838 struct nsproxy ;
839 struct ctl_table_root ;
840 struct ctl_table_header ;
841 struct ctl_dir ;
37 typedef int proc_handler(struct ctl_table *, int, void *, size_t *, loff_t *);
57 struct ctl_table_poll { atomic_t event; wait_queue_head_t wait; } ;
96 struct ctl_table { const char *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; } ;
117 struct ctl_node { struct rb_node node; struct ctl_table_header *header; } ;
122 struct __anonstruct____missing_field_name_96 { struct ctl_table *ctl_table; int used; int count; int nreg; } ;
122 union __anonunion____missing_field_name_95 { struct __anonstruct____missing_field_name_96 __annonCompField21; struct callback_head rcu; } ;
122 struct ctl_table_set ;
122 struct ctl_table_header { union __anonunion____missing_field_name_95 __annonCompField22; 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; } ;
143 struct ctl_dir { struct ctl_table_header header; struct rb_root root; } ;
149 struct ctl_table_set { int (*is_seen)(struct ctl_table_set *); struct ctl_dir dir; } ;
154 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 *); } ;
259 struct workqueue_struct ;
260 struct work_struct ;
54 struct work_struct { atomic_long_t data; struct list_head entry; void (*func)(struct work_struct *); struct lockdep_map lockdep_map; } ;
107 struct delayed_work { struct work_struct work; struct timer_list timer; struct workqueue_struct *wq; int cpu; } ;
51 struct notifier_block { int (*notifier_call)(struct notifier_block *, unsigned long, void *); struct notifier_block *next; int priority; } ;
215 struct resource ;
64 struct resource { resource_size_t start; resource_size_t end; const char *name; unsigned long flags; struct resource *parent; struct resource *sibling; struct resource *child; } ;
169 struct pci_dev ;
58 struct pm_message { int event; } ;
64 typedef struct pm_message pm_message_t;
65 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 *); } ;
320 enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ;
327 enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ;
335 struct wakeup_source ;
336 struct wake_irq ;
337 struct pm_domain_data ;
338 struct pm_subsys_data { spinlock_t lock; unsigned int refcount; struct list_head clock_list; struct pm_domain_data *domain_data; } ;
556 struct dev_pm_qos ;
556 struct dev_pm_info { pm_message_t power_state; unsigned char can_wakeup; unsigned char async_suspend; bool is_prepared; bool is_suspended; bool is_noirq_suspended; bool is_late_suspended; bool ignore_children; bool early_init; bool direct_complete; spinlock_t lock; struct list_head entry; struct completion completion; struct wakeup_source *wakeup; bool wakeup_path; bool syscore; bool no_pm_callbacks; struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; struct wake_irq *wakeirq; atomic_t usage_count; atomic_t child_count; unsigned char disable_depth; unsigned char idle_notification; unsigned char request_pending; unsigned char deferred_resume; unsigned char run_wake; unsigned char runtime_auto; unsigned char no_callbacks; unsigned char irq_safe; unsigned char use_autosuspend; unsigned char timer_autosuspends; unsigned char memalloc_noio; enum rpm_request request; enum rpm_status runtime_status; int runtime_error; int autosuspend_delay; unsigned long last_busy; unsigned long active_jiffies; unsigned long suspended_jiffies; unsigned long accounting_timestamp; struct pm_subsys_data *subsys_data; void (*set_latency_tolerance)(struct device *, s32 ); struct dev_pm_qos *qos; } ;
616 struct dev_pm_domain { struct dev_pm_ops ops; void (*detach)(struct device *, bool ); int (*activate)(struct device *); void (*sync)(struct device *); void (*dismiss)(struct device *); } ;
133 struct pci_bus ;
25 struct ldt_struct ;
25 struct __anonstruct_mm_context_t_161 { struct ldt_struct *ldt; unsigned short ia32_compat; struct mutex lock; void *vdso; atomic_t perf_rdpmc_allowed; } ;
25 typedef struct __anonstruct_mm_context_t_161 mm_context_t;
22 struct bio_vec ;
1211 struct llist_node ;
1211 struct llist_head { struct llist_node *first; } ;
64 struct llist_node { struct llist_node *next; } ;
37 struct cred ;
19 struct inode ;
58 struct arch_uprobe_task { unsigned long saved_scratch_register; unsigned int saved_trap_nr; unsigned int saved_tf; } ;
66 enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ;
73 struct __anonstruct____missing_field_name_197 { struct arch_uprobe_task autask; unsigned long vaddr; } ;
73 struct __anonstruct____missing_field_name_198 { struct callback_head dup_xol_work; unsigned long dup_xol_addr; } ;
73 union __anonunion____missing_field_name_196 { struct __anonstruct____missing_field_name_197 __annonCompField35; struct __anonstruct____missing_field_name_198 __annonCompField36; } ;
73 struct uprobe ;
73 struct return_instance ;
73 struct uprobe_task { enum uprobe_task_state state; union __anonunion____missing_field_name_196 __annonCompField37; struct uprobe *active_uprobe; unsigned long xol_vaddr; struct return_instance *return_instances; unsigned int depth; } ;
94 struct return_instance { struct uprobe *uprobe; unsigned long func; unsigned long stack; unsigned long orig_ret_vaddr; bool chained; struct return_instance *next; } ;
110 struct xol_area ;
111 struct uprobes_state { struct xol_area *xol_area; } ;
150 struct address_space ;
151 struct mem_cgroup ;
152 union __anonunion____missing_field_name_199 { struct address_space *mapping; void *s_mem; atomic_t compound_mapcount; } ;
152 union __anonunion____missing_field_name_201 { unsigned long index; void *freelist; } ;
152 struct __anonstruct____missing_field_name_205 { unsigned short inuse; unsigned short objects; unsigned char frozen; } ;
152 union __anonunion____missing_field_name_204 { atomic_t _mapcount; struct __anonstruct____missing_field_name_205 __annonCompField40; int units; } ;
152 struct __anonstruct____missing_field_name_203 { union __anonunion____missing_field_name_204 __annonCompField41; atomic_t _count; } ;
152 union __anonunion____missing_field_name_202 { unsigned long counters; struct __anonstruct____missing_field_name_203 __annonCompField42; unsigned int active; } ;
152 struct __anonstruct____missing_field_name_200 { union __anonunion____missing_field_name_201 __annonCompField39; union __anonunion____missing_field_name_202 __annonCompField43; } ;
152 struct dev_pagemap ;
152 struct __anonstruct____missing_field_name_207 { struct page *next; int pages; int pobjects; } ;
152 struct __anonstruct____missing_field_name_208 { unsigned long compound_head; unsigned int compound_dtor; unsigned int compound_order; } ;
152 struct __anonstruct____missing_field_name_209 { unsigned long __pad; pgtable_t pmd_huge_pte; } ;
152 union __anonunion____missing_field_name_206 { struct list_head lru; struct dev_pagemap *pgmap; struct __anonstruct____missing_field_name_207 __annonCompField45; struct callback_head callback_head; struct __anonstruct____missing_field_name_208 __annonCompField46; struct __anonstruct____missing_field_name_209 __annonCompField47; } ;
152 struct kmem_cache ;
152 union __anonunion____missing_field_name_210 { unsigned long private; spinlock_t *ptl; struct kmem_cache *slab_cache; } ;
152 struct page { unsigned long flags; union __anonunion____missing_field_name_199 __annonCompField38; struct __anonstruct____missing_field_name_200 __annonCompField44; union __anonunion____missing_field_name_206 __annonCompField48; union __anonunion____missing_field_name_210 __annonCompField49; struct mem_cgroup *mem_cgroup; } ;
191 struct page_frag { struct page *page; __u32 offset; __u32 size; } ;
276 struct userfaultfd_ctx ;
276 struct vm_userfaultfd_ctx { struct userfaultfd_ctx *ctx; } ;
283 struct __anonstruct_shared_211 { struct rb_node rb; unsigned long rb_subtree_last; } ;
283 struct anon_vma ;
283 struct vm_operations_struct ;
283 struct mempolicy ;
283 struct vm_area_struct { unsigned long vm_start; unsigned long vm_end; struct vm_area_struct *vm_next; struct vm_area_struct *vm_prev; struct rb_node vm_rb; unsigned long rb_subtree_gap; struct mm_struct *vm_mm; pgprot_t vm_page_prot; unsigned long vm_flags; struct __anonstruct_shared_211 shared; struct list_head anon_vma_chain; struct anon_vma *anon_vma; const struct vm_operations_struct *vm_ops; unsigned long vm_pgoff; struct file *vm_file; void *vm_private_data; struct mempolicy *vm_policy; struct vm_userfaultfd_ctx vm_userfaultfd_ctx; } ;
356 struct core_thread { struct task_struct *task; struct core_thread *next; } ;
361 struct core_state { atomic_t nr_threads; struct core_thread dumper; struct completion startup; } ;
375 struct task_rss_stat { int events; int count[4U]; } ;
383 struct mm_rss_stat { atomic_long_t count[4U]; } ;
388 struct kioctx_table ;
389 struct linux_binfmt ;
389 struct mmu_notifier_mm ;
389 struct mm_struct { struct vm_area_struct *mmap; struct rb_root mm_rb; u32 vmacache_seqnum; unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); unsigned long mmap_base; unsigned long mmap_legacy_base; unsigned long task_size; unsigned long highest_vm_end; pgd_t *pgd; atomic_t mm_users; atomic_t mm_count; atomic_long_t nr_ptes; atomic_long_t nr_pmds; int map_count; spinlock_t page_table_lock; struct rw_semaphore mmap_sem; struct list_head mmlist; unsigned long hiwater_rss; unsigned long hiwater_vm; unsigned long total_vm; unsigned long locked_vm; unsigned long pinned_vm; unsigned long data_vm; unsigned long exec_vm; unsigned long stack_vm; unsigned long def_flags; unsigned long start_code; unsigned long end_code; unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; unsigned long start_stack; unsigned long arg_start; unsigned long arg_end; unsigned long env_start; unsigned long env_end; unsigned long saved_auxv[46U]; struct mm_rss_stat rss_stat; struct linux_binfmt *binfmt; cpumask_var_t cpu_vm_mask_var; mm_context_t context; unsigned long flags; struct core_state *core_state; spinlock_t ioctx_lock; struct kioctx_table *ioctx_table; struct task_struct *owner; struct file *exe_file; struct mmu_notifier_mm *mmu_notifier_mm; struct cpumask cpumask_allocation; unsigned long numa_next_scan; unsigned long numa_scan_offset; int numa_scan_seq; bool tlb_flush_pending; struct uprobes_state uprobes_state; void *bd_addr; atomic_long_t hugetlb_usage; } ;
15 typedef __u64 Elf64_Addr;
16 typedef __u16 Elf64_Half;
20 typedef __u32 Elf64_Word;
21 typedef __u64 Elf64_Xword;
190 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; } ;
198 typedef struct elf64_sym Elf64_Sym;
53 union __anonunion____missing_field_name_216 { unsigned long bitmap[4U]; struct callback_head callback_head; } ;
53 struct idr_layer { int prefix; int layer; struct idr_layer *ary[256U]; int count; union __anonunion____missing_field_name_216 __annonCompField50; } ;
41 struct idr { struct idr_layer *hint; struct idr_layer *top; int layers; int cur; spinlock_t lock; int id_free_cnt; struct idr_layer *id_free; } ;
124 struct ida_bitmap { long nr_busy; unsigned long bitmap[15U]; } ;
167 struct ida { struct idr idr; struct ida_bitmap *free_bitmap; } ;
199 struct dentry ;
200 struct iattr ;
201 struct super_block ;
202 struct file_system_type ;
203 struct kernfs_open_node ;
204 struct kernfs_iattrs ;
227 struct kernfs_root ;
227 struct kernfs_elem_dir { unsigned long subdirs; struct rb_root children; struct kernfs_root *root; } ;
85 struct kernfs_node ;
85 struct kernfs_elem_symlink { struct kernfs_node *target_kn; } ;
89 struct kernfs_ops ;
89 struct kernfs_elem_attr { const struct kernfs_ops *ops; struct kernfs_open_node *open; loff_t size; struct kernfs_node *notify_next; } ;
96 union __anonunion____missing_field_name_221 { struct kernfs_elem_dir dir; struct kernfs_elem_symlink symlink; struct kernfs_elem_attr attr; } ;
96 struct kernfs_node { atomic_t count; atomic_t active; struct lockdep_map dep_map; struct kernfs_node *parent; const char *name; struct rb_node rb; const void *ns; unsigned int hash; union __anonunion____missing_field_name_221 __annonCompField51; void *priv; unsigned short flags; umode_t mode; unsigned int ino; struct kernfs_iattrs *iattr; } ;
138 struct kernfs_syscall_ops { int (*remount_fs)(struct kernfs_root *, int *, char *); int (*show_options)(struct seq_file *, struct kernfs_root *); int (*mkdir)(struct kernfs_node *, const char *, umode_t ); int (*rmdir)(struct kernfs_node *); int (*rename)(struct kernfs_node *, struct kernfs_node *, const char *); } ;
155 struct kernfs_root { struct kernfs_node *kn; unsigned int flags; struct ida ino_ida; struct kernfs_syscall_ops *syscall_ops; struct list_head supers; wait_queue_head_t deactivate_waitq; } ;
171 struct kernfs_open_file { struct kernfs_node *kn; struct file *file; void *priv; struct mutex mutex; int event; struct list_head list; char *prealloc_buf; size_t atomic_write_len; bool mmapped; const struct vm_operations_struct *vm_ops; } ;
188 struct kernfs_ops { int (*seq_show)(struct seq_file *, void *); void * (*seq_start)(struct seq_file *, loff_t *); void * (*seq_next)(struct seq_file *, void *, loff_t *); void (*seq_stop)(struct seq_file *, void *); ssize_t (*read)(struct kernfs_open_file *, char *, size_t , loff_t ); size_t atomic_write_len; bool prealloc; ssize_t (*write)(struct kernfs_open_file *, char *, size_t , loff_t ); int (*mmap)(struct kernfs_open_file *, struct vm_area_struct *); struct lock_class_key lockdep_key; } ;
493 struct sock ;
494 struct kobject ;
495 enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ;
501 struct kobj_ns_type_operations { enum kobj_ns_type type; bool (*current_may_mount)(); void * (*grab_current_ns)(); const void * (*netlink_ns)(struct sock *); const void * (*initial_ns)(); void (*drop_ns)(void *); } ;
59 struct bin_attribute ;
60 struct attribute { const char *name; umode_t mode; bool ignore_lockdep; struct lock_class_key *key; struct lock_class_key skey; } ;
37 struct attribute_group { const char *name; umode_t (*is_visible)(struct kobject *, struct attribute *, int); umode_t (*is_bin_visible)(struct kobject *, struct bin_attribute *, int); struct attribute **attrs; struct bin_attribute **bin_attrs; } ;
92 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 *); } ;
165 struct sysfs_ops { ssize_t (*show)(struct kobject *, struct attribute *, char *); ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t ); } ;
530 struct kref { atomic_t refcount; } ;
52 struct kset ;
52 struct kobj_type ;
52 struct kobject { const char *name; struct list_head entry; struct kobject *parent; struct kset *kset; struct kobj_type *ktype; struct kernfs_node *sd; struct kref kref; struct delayed_work release; unsigned char state_initialized; unsigned char state_in_sysfs; unsigned char state_add_uevent_sent; unsigned char state_remove_uevent_sent; unsigned char uevent_suppress; } ;
115 struct kobj_type { void (*release)(struct kobject *); const struct sysfs_ops *sysfs_ops; struct attribute **default_attrs; const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject *); const void * (*namespace)(struct kobject *); } ;
123 struct kobj_uevent_env { char *argv[3U]; char *envp[32U]; int envp_idx; char buf[2048U]; int buflen; } ;
131 struct kset_uevent_ops { const int (*filter)(struct kset *, struct kobject *); const const char * (*name)(struct kset *, struct kobject *); const int (*uevent)(struct kset *, struct kobject *, struct kobj_uevent_env *); } ;
148 struct kset { struct list_head list; spinlock_t list_lock; struct kobject kobj; const struct kset_uevent_ops *uevent_ops; } ;
223 struct kernel_param ;
228 struct kernel_param_ops { unsigned int flags; int (*set)(const char *, const struct kernel_param *); int (*get)(char *, const struct kernel_param *); void (*free)(void *); } ;
62 struct kparam_string ;
62 struct kparam_array ;
62 union __anonunion____missing_field_name_224 { void *arg; const struct kparam_string *str; const struct kparam_array *arr; } ;
62 struct kernel_param { const char *name; struct module *mod; const struct kernel_param_ops *ops; const u16 perm; s8 level; u8 flags; union __anonunion____missing_field_name_224 __annonCompField52; } ;
83 struct kparam_string { unsigned int maxlen; char *string; } ;
89 struct kparam_array { unsigned int max; unsigned int elemsize; unsigned int *num; const struct kernel_param_ops *ops; void *elem; } ;
470 struct latch_tree_node { struct rb_node node[2U]; } ;
211 struct mod_arch_specific { } ;
38 struct module_param_attrs ;
38 struct module_kobject { struct kobject kobj; struct module *mod; struct kobject *drivers_dir; struct module_param_attrs *mp; struct completion *kobj_completion; } ;
48 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 *, const char *, size_t ); void (*setup)(struct module *, const char *); int (*test)(struct module *); void (*free)(struct module *); } ;
74 struct exception_table_entry ;
290 enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ;
297 struct mod_tree_node { struct module *mod; struct latch_tree_node node; } ;
304 struct module_layout { void *base; unsigned int size; unsigned int text_size; unsigned int ro_size; struct mod_tree_node mtn; } ;
318 struct module_sect_attrs ;
318 struct module_notes_attrs ;
318 struct trace_event_call ;
318 struct trace_enum_map ;
318 struct module { enum module_state state; struct list_head list; char name[56U]; struct module_kobject mkobj; struct module_attribute *modinfo_attrs; const char *version; const char *srcversion; struct kobject *holders_dir; const struct kernel_symbol *syms; const unsigned long *crcs; unsigned int num_syms; struct mutex param_lock; struct kernel_param *kp; unsigned int num_kp; unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const unsigned long *gpl_crcs; const struct kernel_symbol *unused_syms; const unsigned long *unused_crcs; unsigned int num_unused_syms; unsigned int num_unused_gpl_syms; const struct kernel_symbol *unused_gpl_syms; const unsigned long *unused_gpl_crcs; bool sig_ok; bool async_probe_requested; const struct kernel_symbol *gpl_future_syms; const unsigned long *gpl_future_crcs; unsigned int num_gpl_future_syms; unsigned int num_exentries; struct exception_table_entry *extable; int (*init)(); struct module_layout core_layout; struct module_layout init_layout; 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; const struct tracepoint **tracepoints_ptrs; unsigned int num_trace_bprintk_fmt; const char **trace_bprintk_fmt_start; struct trace_event_call **trace_events; unsigned int num_trace_events; struct trace_enum_map **trace_enums; unsigned int num_trace_enums; bool klp_alive; struct list_head source_list; struct list_head target_list; void (*exit)(); atomic_t refcnt; ctor_fn_t (**ctors)(); unsigned int num_ctors; } ;
24 struct __anonstruct_sigset_t_231 { unsigned long sig[1U]; } ;
24 typedef struct __anonstruct_sigset_t_231 sigset_t;
25 struct siginfo ;
17 typedef void __signalfn_t(int);
18 typedef __signalfn_t *__sighandler_t;
20 typedef void __restorefn_t();
21 typedef __restorefn_t *__sigrestore_t;
34 union sigval { int sival_int; void *sival_ptr; } ;
10 typedef union sigval sigval_t;
11 struct __anonstruct__kill_233 { __kernel_pid_t _pid; __kernel_uid32_t _uid; } ;
11 struct __anonstruct__timer_234 { __kernel_timer_t _tid; int _overrun; char _pad[0U]; sigval_t _sigval; int _sys_private; } ;
11 struct __anonstruct__rt_235 { __kernel_pid_t _pid; __kernel_uid32_t _uid; sigval_t _sigval; } ;
11 struct __anonstruct__sigchld_236 { __kernel_pid_t _pid; __kernel_uid32_t _uid; int _status; __kernel_clock_t _utime; __kernel_clock_t _stime; } ;
11 struct __anonstruct__addr_bnd_238 { void *_lower; void *_upper; } ;
11 struct __anonstruct__sigfault_237 { void *_addr; short _addr_lsb; struct __anonstruct__addr_bnd_238 _addr_bnd; } ;
11 struct __anonstruct__sigpoll_239 { long _band; int _fd; } ;
11 struct __anonstruct__sigsys_240 { void *_call_addr; int _syscall; unsigned int _arch; } ;
11 union __anonunion__sifields_232 { int _pad[28U]; struct __anonstruct__kill_233 _kill; struct __anonstruct__timer_234 _timer; struct __anonstruct__rt_235 _rt; struct __anonstruct__sigchld_236 _sigchld; struct __anonstruct__sigfault_237 _sigfault; struct __anonstruct__sigpoll_239 _sigpoll; struct __anonstruct__sigsys_240 _sigsys; } ;
11 struct siginfo { int si_signo; int si_errno; int si_code; union __anonunion__sifields_232 _sifields; } ;
113 typedef struct siginfo siginfo_t;
12 struct user_struct ;
22 struct sigpending { struct list_head list; sigset_t signal; } ;
242 struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; __sigrestore_t sa_restorer; sigset_t sa_mask; } ;
256 struct k_sigaction { struct sigaction sa; } ;
22 struct kernel_cap_struct { __u32 cap[2U]; } ;
25 typedef struct kernel_cap_struct kernel_cap_t;
84 struct plist_node { int prio; struct list_head prio_list; struct list_head node_list; } ;
4 typedef unsigned long cputime_t;
25 struct sem_undo_list ;
25 struct sysv_sem { struct sem_undo_list *undo_list; } ;
26 struct sysv_shm { struct list_head shm_clist; } ;
57 enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ;
64 struct pid_namespace ;
64 struct upid { int nr; struct pid_namespace *ns; struct hlist_node pid_chain; } ;
56 struct pid { atomic_t count; unsigned int level; struct hlist_head tasks[3U]; struct callback_head rcu; struct upid numbers[1U]; } ;
68 struct pid_link { struct hlist_node node; struct pid *pid; } ;
174 struct percpu_counter { raw_spinlock_t lock; s64 count; struct list_head list; s32 *counters; } ;
53 struct seccomp_filter ;
54 struct seccomp { int mode; struct seccomp_filter *filter; } ;
40 struct rt_mutex_waiter ;
41 struct rlimit { __kernel_ulong_t rlim_cur; __kernel_ulong_t rlim_max; } ;
11 struct timerqueue_node { struct rb_node node; ktime_t expires; } ;
12 struct timerqueue_head { struct rb_root head; struct timerqueue_node *next; } ;
50 struct hrtimer_clock_base ;
51 struct hrtimer_cpu_base ;
60 enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ;
65 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]; } ;
123 struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base; int index; clockid_t clockid; struct timerqueue_head active; ktime_t (*get_time)(); ktime_t offset; } ;
156 struct hrtimer_cpu_base { raw_spinlock_t lock; seqcount_t seq; struct hrtimer *running; unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set_seq; bool migration_enabled; bool nohz_active; unsigned char in_hrtirq; unsigned char hres_active; unsigned char hang_detected; ktime_t expires_next; struct hrtimer *next_timer; unsigned int nr_events; unsigned int nr_retries; unsigned int nr_hangs; unsigned int max_hang_time; struct hrtimer_clock_base clock_base[4U]; } ;
466 struct task_io_accounting { u64 rchar; u64 wchar; u64 syscr; u64 syscw; u64 read_bytes; u64 write_bytes; u64 cancelled_write_bytes; } ;
45 struct latency_record { unsigned long backtrace[12U]; unsigned int count; unsigned long time; unsigned long max; } ;
39 struct assoc_array_ptr ;
39 struct assoc_array { struct assoc_array_ptr *root; unsigned long nr_leaves_on_tree; } ;
31 typedef int32_t key_serial_t;
34 typedef uint32_t key_perm_t;
35 struct key ;
36 struct signal_struct ;
37 struct key_type ;
41 struct keyring_index_key { struct key_type *type; const char *description; size_t desc_len; } ;
91 union key_payload { void *rcu_data0; void *data[4U]; } ;
128 union __anonunion____missing_field_name_260 { struct list_head graveyard_link; struct rb_node serial_node; } ;
128 struct key_user ;
128 union __anonunion____missing_field_name_261 { time_t expiry; time_t revoked_at; } ;
128 struct __anonstruct____missing_field_name_263 { struct key_type *type; char *description; } ;
128 union __anonunion____missing_field_name_262 { struct keyring_index_key index_key; struct __anonstruct____missing_field_name_263 __annonCompField55; } ;
128 struct __anonstruct____missing_field_name_265 { struct list_head name_link; struct assoc_array keys; } ;
128 union __anonunion____missing_field_name_264 { union key_payload payload; struct __anonstruct____missing_field_name_265 __annonCompField57; int reject_error; } ;
128 struct key { atomic_t usage; key_serial_t serial; union __anonunion____missing_field_name_260 __annonCompField53; struct rw_semaphore sem; struct key_user *user; void *security; union __anonunion____missing_field_name_261 __annonCompField54; 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_262 __annonCompField56; union __anonunion____missing_field_name_264 __annonCompField58; } ;
354 struct audit_context ;
27 struct group_info { atomic_t usage; int ngroups; int nblocks; kgid_t small_block[32U]; kgid_t *blocks[0U]; } ;
90 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; kernel_cap_t cap_ambient; 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; } ;
377 struct percpu_ref ;
55 typedef void percpu_ref_func_t(struct percpu_ref *);
68 struct percpu_ref { atomic_long_t count; unsigned long percpu_count_ptr; percpu_ref_func_t *release; percpu_ref_func_t *confirm_switch; bool force_atomic; struct callback_head rcu; } ;
327 enum rcu_sync_type { RCU_SYNC = 0, RCU_SCHED_SYNC = 1, RCU_BH_SYNC = 2 } ;
333 struct rcu_sync { int gp_state; int gp_count; wait_queue_head_t gp_wait; int cb_state; struct callback_head cb_head; enum rcu_sync_type gp_type; } ;
65 struct percpu_rw_semaphore { struct rcu_sync rss; unsigned int *fast_read_ctr; struct rw_semaphore rw_sem; atomic_t slow_read_ctr; wait_queue_head_t write_waitq; } ;
54 struct cgroup ;
55 struct cgroup_root ;
56 struct cgroup_subsys ;
57 struct cgroup_taskset ;
100 struct cgroup_file { struct kernfs_node *kn; } ;
89 struct cgroup_subsys_state { struct cgroup *cgroup; struct cgroup_subsys *ss; struct percpu_ref refcnt; struct cgroup_subsys_state *parent; struct list_head sibling; struct list_head children; int id; unsigned int flags; u64 serial_nr; struct callback_head callback_head; struct work_struct destroy_work; } ;
134 struct css_set { atomic_t refcount; struct hlist_node hlist; struct list_head tasks; struct list_head mg_tasks; struct list_head cgrp_links; struct cgroup *dfl_cgrp; struct cgroup_subsys_state *subsys[13U]; struct list_head mg_preload_node; struct list_head mg_node; struct cgroup *mg_src_cgrp; struct css_set *mg_dst_cset; struct list_head e_cset_node[13U]; struct list_head task_iters; struct callback_head callback_head; } ;
210 struct cgroup { struct cgroup_subsys_state self; unsigned long flags; int id; int level; int populated_cnt; struct kernfs_node *kn; struct cgroup_file procs_file; struct cgroup_file events_file; unsigned int subtree_control; unsigned int child_subsys_mask; struct cgroup_subsys_state *subsys[13U]; struct cgroup_root *root; struct list_head cset_links; struct list_head e_csets[13U]; struct list_head pidlists; struct mutex pidlist_mutex; wait_queue_head_t offline_waitq; struct work_struct release_agent_work; int ancestor_ids[]; } ;
294 struct cgroup_root { struct kernfs_root *kf_root; unsigned int subsys_mask; int hierarchy_id; struct cgroup cgrp; int cgrp_ancestor_id_storage; atomic_t nr_cgrps; struct list_head root_list; unsigned int flags; struct idr cgroup_idr; char release_agent_path[4096U]; char name[64U]; } ;
333 struct cftype { char name[64U]; unsigned long private; size_t max_write_len; unsigned int flags; unsigned int file_offset; struct cgroup_subsys *ss; struct list_head node; struct kernfs_ops *kf_ops; u64 (*read_u64)(struct cgroup_subsys_state *, struct cftype *); s64 (*read_s64)(struct cgroup_subsys_state *, struct cftype *); int (*seq_show)(struct seq_file *, void *); void * (*seq_start)(struct seq_file *, loff_t *); void * (*seq_next)(struct seq_file *, void *, loff_t *); void (*seq_stop)(struct seq_file *, void *); int (*write_u64)(struct cgroup_subsys_state *, struct cftype *, u64 ); int (*write_s64)(struct cgroup_subsys_state *, struct cftype *, s64 ); ssize_t (*write)(struct kernfs_open_file *, char *, size_t , loff_t ); struct lock_class_key lockdep_key; } ;
418 struct cgroup_subsys { struct cgroup_subsys_state * (*css_alloc)(struct cgroup_subsys_state *); int (*css_online)(struct cgroup_subsys_state *); void (*css_offline)(struct cgroup_subsys_state *); void (*css_released)(struct cgroup_subsys_state *); void (*css_free)(struct cgroup_subsys_state *); void (*css_reset)(struct cgroup_subsys_state *); void (*css_e_css_changed)(struct cgroup_subsys_state *); int (*can_attach)(struct cgroup_taskset *); void (*cancel_attach)(struct cgroup_taskset *); void (*attach)(struct cgroup_taskset *); int (*can_fork)(struct task_struct *); void (*cancel_fork)(struct task_struct *); void (*fork)(struct task_struct *); void (*exit)(struct task_struct *); void (*free)(struct task_struct *); void (*bind)(struct cgroup_subsys_state *); int early_init; bool broken_hierarchy; bool warned_broken_hierarchy; int id; const char *name; const char *legacy_name; struct cgroup_root *root; struct idr css_idr; struct list_head cfts; struct cftype *dfl_cftypes; struct cftype *legacy_cftypes; unsigned int depends_on; } ;
128 struct futex_pi_state ;
129 struct robust_list_head ;
130 struct bio_list ;
131 struct fs_struct ;
132 struct perf_event_context ;
133 struct blk_plug ;
135 struct nameidata ;
188 struct cfs_rq ;
189 struct task_group ;
482 struct sighand_struct { atomic_t count; struct k_sigaction action[64U]; spinlock_t siglock; wait_queue_head_t signalfd_wqh; } ;
523 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; } ;
531 struct cpu_itimer { cputime_t expires; cputime_t incr; u32 error; u32 incr_error; } ;
538 struct prev_cputime { cputime_t utime; cputime_t stime; raw_spinlock_t lock; } ;
563 struct task_cputime { cputime_t utime; cputime_t stime; unsigned long long sum_exec_runtime; } ;
579 struct task_cputime_atomic { atomic64_t utime; atomic64_t stime; atomic64_t sum_exec_runtime; } ;
601 struct thread_group_cputimer { struct task_cputime_atomic cputime_atomic; bool running; bool checking_timer; } ;
646 struct autogroup ;
647 struct tty_struct ;
647 struct taskstats ;
647 struct tty_audit_buf ;
647 struct signal_struct { atomic_t sigcnt; atomic_t live; int nr_threads; struct list_head thread_head; wait_queue_head_t wait_chldexit; struct task_struct *curr_target; struct sigpending shared_pending; int group_exit_code; int notify_count; struct task_struct *group_exit_task; int group_stop_count; unsigned int flags; unsigned char is_child_subreaper; unsigned char has_child_subreaper; int posix_timer_id; struct list_head posix_timers; struct hrtimer real_timer; struct pid *leader_pid; ktime_t it_real_incr; struct cpu_itimer it[2U]; struct thread_group_cputimer cputimer; struct task_cputime cputime_expires; struct list_head cpu_timers[3U]; struct pid *tty_old_pgrp; int leader; struct tty_struct *tty; struct autogroup *autogroup; seqlock_t stats_lock; cputime_t utime; cputime_t stime; cputime_t cutime; cputime_t cstime; cputime_t gtime; cputime_t cgtime; struct prev_cputime prev_cputime; unsigned long nvcsw; unsigned long nivcsw; unsigned long cnvcsw; unsigned long cnivcsw; unsigned long min_flt; unsigned long maj_flt; unsigned long cmin_flt; unsigned long cmaj_flt; unsigned long inblock; unsigned long oublock; unsigned long cinblock; unsigned long coublock; unsigned long maxrss; unsigned long cmaxrss; struct task_io_accounting ioac; unsigned long long sum_sched_runtime; struct rlimit rlim[16U]; struct pacct_struct pacct; struct taskstats *stats; unsigned int audit_tty; unsigned int audit_tty_log_passwd; struct tty_audit_buf *tty_audit_buf; oom_flags_t oom_flags; short oom_score_adj; short oom_score_adj_min; struct mutex cred_guard_mutex; } ;
814 struct user_struct { atomic_t __count; atomic_t processes; atomic_t sigpending; atomic_t inotify_watches; atomic_t inotify_devs; atomic_t fanotify_listeners; atomic_long_t epoll_watches; unsigned long mq_bytes; unsigned long locked_shm; unsigned long unix_inflight; atomic_long_t pipe_bufs; struct key *uid_keyring; struct key *session_keyring; struct hlist_node uidhash_node; kuid_t uid; atomic_long_t locked_vm; } ;
859 struct backing_dev_info ;
860 struct reclaim_state ;
861 struct sched_info { unsigned long pcount; unsigned long long run_delay; unsigned long long last_arrival; unsigned long long last_queued; } ;
875 struct task_delay_info { spinlock_t lock; unsigned int flags; u64 blkio_start; u64 blkio_delay; u64 swapin_delay; u32 blkio_count; u32 swapin_count; u64 freepages_start; u64 freepages_delay; u32 freepages_count; } ;
923 struct wake_q_node { struct wake_q_node *next; } ;
1150 struct io_context ;
1184 struct pipe_inode_info ;
1185 struct uts_namespace ;
1186 struct load_weight { unsigned long weight; u32 inv_weight; } ;
1193 struct sched_avg { u64 last_update_time; u64 load_sum; u32 util_sum; u32 period_contrib; unsigned long load_avg; unsigned long util_avg; } ;
1213 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; } ;
1248 struct sched_entity { struct load_weight load; struct rb_node run_node; struct list_head group_node; unsigned int on_rq; u64 exec_start; u64 sum_exec_runtime; u64 vruntime; u64 prev_sum_exec_runtime; u64 nr_migrations; struct sched_statistics statistics; int depth; struct sched_entity *parent; struct cfs_rq *cfs_rq; struct cfs_rq *my_q; struct sched_avg avg; } ;
1285 struct rt_rq ;
1285 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; } ;
1301 struct sched_dl_entity { struct rb_node rb_node; u64 dl_runtime; u64 dl_deadline; u64 dl_period; u64 dl_bw; s64 runtime; u64 deadline; unsigned int flags; int dl_throttled; int dl_new; int dl_boosted; int dl_yielded; struct hrtimer dl_timer; } ;
1369 struct tlbflush_unmap_batch { struct cpumask cpumask; bool flush_required; bool writable; } ;
1388 struct sched_class ;
1388 struct files_struct ;
1388 struct compat_robust_list_head ;
1388 struct numa_group ;
1388 struct task_struct { volatile long state; void *stack; atomic_t usage; unsigned int flags; unsigned int ptrace; struct llist_node wake_entry; int on_cpu; unsigned int wakee_flips; unsigned long wakee_flip_decay_ts; struct task_struct *last_wakee; int wake_cpu; int on_rq; int prio; int static_prio; int normal_prio; unsigned int rt_priority; const struct sched_class *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 policy; int nr_cpus_allowed; cpumask_t cpus_allowed; unsigned long rcu_tasks_nvcsw; bool rcu_tasks_holdout; struct list_head rcu_tasks_holdout_list; int rcu_tasks_idle_cpu; struct sched_info sched_info; struct list_head tasks; struct plist_node pushable_tasks; struct rb_node pushable_dl_tasks; struct mm_struct *mm; struct mm_struct *active_mm; u32 vmacache_seqnum; struct vm_area_struct *vmacache[4U]; struct task_rss_stat rss_stat; int exit_state; int exit_code; int exit_signal; int pdeath_signal; unsigned long jobctl; unsigned int personality; unsigned char sched_reset_on_fork; unsigned char sched_contributes_to_load; unsigned char sched_migrated; unsigned char; unsigned char in_execve; unsigned char in_iowait; unsigned char memcg_may_oom; unsigned char memcg_kmem_skip_account; unsigned char brk_randomized; unsigned long atomic_flags; struct restart_block restart_block; pid_t pid; pid_t tgid; struct task_struct *real_parent; struct task_struct *parent; struct list_head children; struct list_head sibling; struct task_struct *group_leader; struct list_head ptraced; struct list_head ptrace_entry; struct pid_link pids[3U]; struct list_head thread_group; struct list_head thread_node; struct completion *vfork_done; int *set_child_tid; int *clear_child_tid; cputime_t utime; cputime_t stime; cputime_t utimescaled; cputime_t stimescaled; cputime_t gtime; struct prev_cputime prev_cputime; unsigned long nvcsw; unsigned long nivcsw; u64 start_time; u64 real_start_time; unsigned long min_flt; unsigned long maj_flt; struct task_cputime cputime_expires; struct list_head cpu_timers[3U]; const struct cred *real_cred; const struct cred *cred; char comm[16U]; struct nameidata *nameidata; struct sysv_sem sysvsem; struct sysv_shm sysvshm; unsigned long last_switch_count; 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; struct callback_head *task_works; struct audit_context *audit_context; kuid_t loginuid; unsigned int sessionid; struct seccomp seccomp; u32 parent_exec_id; u32 self_exec_id; spinlock_t alloc_lock; raw_spinlock_t pi_lock; struct wake_q_node wake_q; struct rb_root pi_waiters; struct rb_node *pi_waiters_leftmost; struct rt_mutex_waiter *pi_blocked_on; struct mutex_waiter *blocked_on; unsigned int irq_events; unsigned long hardirq_enable_ip; unsigned long hardirq_disable_ip; unsigned int hardirq_enable_event; unsigned int hardirq_disable_event; int hardirqs_enabled; int hardirq_context; unsigned long softirq_disable_ip; unsigned long softirq_enable_ip; unsigned int softirq_disable_event; unsigned int softirq_enable_event; int softirqs_enabled; int softirq_context; u64 curr_chain_key; int lockdep_depth; unsigned int lockdep_recursion; struct held_lock held_locks[48U]; gfp_t lockdep_reclaim_gfp; unsigned int in_ubsan; void *journal_info; struct bio_list *bio_list; struct blk_plug *plug; struct reclaim_state *reclaim_state; struct backing_dev_info *backing_dev_info; struct io_context *io_context; unsigned long ptrace_message; siginfo_t *last_siginfo; struct task_io_accounting ioac; u64 acct_rss_mem1; u64 acct_vm_mem1; cputime_t acct_timexpd; nodemask_t mems_allowed; seqcount_t mems_allowed_seq; int cpuset_mem_spread_rotor; int cpuset_slab_spread_rotor; struct css_set *cgroups; struct list_head cg_list; struct robust_list_head *robust_list; struct compat_robust_list_head *compat_robust_list; struct list_head pi_state_list; struct futex_pi_state *pi_state_cache; struct perf_event_context *perf_event_ctxp[2U]; struct mutex perf_event_mutex; struct list_head perf_event_list; struct mempolicy *mempolicy; short il_next; short pref_node_fork; int numa_scan_seq; unsigned int numa_scan_period; unsigned int numa_scan_period_max; int numa_preferred_nid; unsigned long numa_migrate_retry; u64 node_stamp; u64 last_task_numa_placement; u64 last_sum_exec_runtime; struct callback_head numa_work; struct list_head numa_entry; struct numa_group *numa_group; unsigned long *numa_faults; unsigned long total_numa_faults; unsigned long numa_faults_locality[3U]; unsigned long numa_pages_migrated; struct tlbflush_unmap_batch tlb_ubc; struct callback_head rcu; struct pipe_inode_info *splice_pipe; struct page_frag task_frag; struct task_delay_info *delays; int make_it_fail; int nr_dirtied; int nr_dirtied_pause; unsigned long dirty_paused_when; int latency_record_count; struct latency_record latency_record[32U]; unsigned long timer_slack_ns; unsigned long default_timer_slack_ns; unsigned int kasan_depth; unsigned long trace; unsigned long trace_recursion; struct mem_cgroup *memcg_in_oom; gfp_t memcg_oom_gfp_mask; int memcg_oom_order; unsigned int memcg_nr_pages_over_high; struct uprobe_task *utask; unsigned int sequential_io; unsigned int sequential_io_avg; unsigned long task_state_change; int pagefault_disabled; struct thread_struct thread; } ;
3209 enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ;
16 typedef enum irqreturn irqreturn_t;
8 struct irq_desc ;
135 struct irq_data ;
30 struct msi_msg ;
31 enum irqchip_irq_state ;
63 struct msi_desc ;
64 struct irq_domain ;
65 struct irq_common_data { unsigned int state_use_accessors; unsigned int node; void *handler_data; struct msi_desc *msi_desc; cpumask_var_t affinity; } ;
148 struct irq_chip ;
148 struct irq_data { u32 mask; unsigned int irq; unsigned long hwirq; struct irq_common_data *common; struct irq_chip *chip; struct irq_domain *domain; struct irq_data *parent_data; void *chip_data; } ;
306 struct irq_chip { const char *name; unsigned int (*irq_startup)(struct irq_data *); void (*irq_shutdown)(struct irq_data *); void (*irq_enable)(struct irq_data *); void (*irq_disable)(struct irq_data *); void (*irq_ack)(struct irq_data *); void (*irq_mask)(struct irq_data *); void (*irq_mask_ack)(struct irq_data *); void (*irq_unmask)(struct irq_data *); void (*irq_eoi)(struct irq_data *); int (*irq_set_affinity)(struct irq_data *, const struct cpumask *, bool ); int (*irq_retrigger)(struct irq_data *); int (*irq_set_type)(struct irq_data *, unsigned int); int (*irq_set_wake)(struct irq_data *, unsigned int); void (*irq_bus_lock)(struct irq_data *); void (*irq_bus_sync_unlock)(struct irq_data *); void (*irq_cpu_online)(struct irq_data *); void (*irq_cpu_offline)(struct irq_data *); void (*irq_suspend)(struct irq_data *); void (*irq_resume)(struct irq_data *); void (*irq_pm_shutdown)(struct irq_data *); void (*irq_calc_mask)(struct irq_data *); void (*irq_print_chip)(struct irq_data *, struct seq_file *); int (*irq_request_resources)(struct irq_data *); void (*irq_release_resources)(struct irq_data *); void (*irq_compose_msi_msg)(struct irq_data *, struct msi_msg *); void (*irq_write_msi_msg)(struct irq_data *, struct msi_msg *); int (*irq_get_irqchip_state)(struct irq_data *, enum irqchip_irq_state , bool *); int (*irq_set_irqchip_state)(struct irq_data *, enum irqchip_irq_state , bool ); int (*irq_set_vcpu_affinity)(struct irq_data *, void *); unsigned long flags; } ;
400 struct irq_affinity_notify ;
401 struct proc_dir_entry ;
402 struct irqaction ;
402 struct irq_desc { struct irq_common_data irq_common_data; struct irq_data irq_data; unsigned int *kstat_irqs; void (*handle_irq)(struct irq_desc *); struct irqaction *action; unsigned int status_use_accessors; unsigned int core_internal_state__do_not_mess_with_it; unsigned int depth; unsigned int wake_depth; unsigned int irq_count; unsigned long last_unhandled; unsigned int irqs_unhandled; atomic_t threads_handled; int threads_handled_last; raw_spinlock_t lock; struct cpumask *percpu_enabled; const struct cpumask *affinity_hint; struct irq_affinity_notify *affinity_notify; cpumask_var_t pending_mask; unsigned long threads_oneshot; atomic_t threads_active; wait_queue_head_t wait_for_threads; unsigned int nr_actions; unsigned int no_suspend_depth; unsigned int cond_suspend_depth; unsigned int force_resume_depth; struct proc_dir_entry *dir; struct callback_head rcu; int parent_irq; struct module *owner; const char *name; } ;
62 struct exception_table_entry { int insn; int fixup; } ;
710 struct irq_chip_regs { unsigned long enable; unsigned long disable; unsigned long mask; unsigned long ack; unsigned long eoi; unsigned long type; unsigned long polarity; } ;
749 struct irq_chip_type { struct irq_chip chip; struct irq_chip_regs regs; void (*handler)(struct irq_desc *); u32 type; u32 mask_cache_priv; u32 *mask_cache; } ;
771 struct irq_chip_generic { raw_spinlock_t lock; void *reg_base; u32 (*reg_readl)(void *); void (*reg_writel)(u32 , void *); void (*suspend)(struct irq_chip_generic *); void (*resume)(struct irq_chip_generic *); unsigned int irq_base; unsigned int irq_cnt; u32 mask_cache; u32 type_cache; u32 polarity_cache; u32 wake_enabled; u32 wake_active; unsigned int num_ct; void *private; unsigned long installed; unsigned long unused; struct irq_domain *domain; struct list_head list; struct irq_chip_type chip_types[0U]; } ;
827 enum irq_gc_flags { IRQ_GC_INIT_MASK_CACHE = 1, IRQ_GC_INIT_NESTED_LOCK = 2, IRQ_GC_MASK_CACHE_PER_TYPE = 4, IRQ_GC_NO_MASK = 8, IRQ_GC_BE_IO = 16 } ;
835 struct irq_domain_chip_generic { unsigned int irqs_per_chip; unsigned int num_chips; unsigned int irq_flags_to_clear; unsigned int irq_flags_to_set; enum irq_gc_flags gc_flags; struct irq_chip_generic *gc[0U]; } ;
93 struct irqaction { irqreturn_t (*handler)(int, void *); void *dev_id; void *percpu_dev_id; struct irqaction *next; irqreturn_t (*thread_fn)(int, void *); struct task_struct *thread; struct irqaction *secondary; unsigned int irq; unsigned int flags; unsigned long thread_flags; unsigned long thread_mask; const char *name; struct proc_dir_entry *dir; } ;
204 struct irq_affinity_notify { unsigned int irq; struct kref kref; struct work_struct work; void (*notify)(struct irq_affinity_notify *, const cpumask_t *); void (*release)(struct kref *); } ;
366 enum irqchip_irq_state { IRQCHIP_STATE_PENDING = 0, IRQCHIP_STATE_ACTIVE = 1, IRQCHIP_STATE_MASKED = 2, IRQCHIP_STATE_LINE_LEVEL = 3 } ;
468 struct tasklet_struct { struct tasklet_struct *next; unsigned long state; atomic_t count; void (*func)(unsigned long); unsigned long data; } ;
13 typedef unsigned long kernel_ulong_t;
14 struct pci_device_id { __u32 vendor; __u32 device; __u32 subvendor; __u32 subdevice; __u32 class; __u32 class_mask; kernel_ulong_t driver_data; } ;
186 struct acpi_device_id { __u8 id[9U]; kernel_ulong_t driver_data; __u32 cls; __u32 cls_msk; } ;
229 struct of_device_id { char name[32U]; char type[32U]; char compatible[128U]; const void *data; } ;
659 struct klist_node ;
37 struct klist_node { void *n_klist; struct list_head n_node; struct kref n_ref; } ;
68 struct path ;
69 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; const struct seq_operations *op; int poll_event; struct user_namespace *user_ns; void *private; } ;
35 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 *); } ;
227 struct pinctrl ;
228 struct pinctrl_state ;
194 struct dev_pin_info { struct pinctrl *p; struct pinctrl_state *default_state; struct pinctrl_state *init_state; struct pinctrl_state *sleep_state; struct pinctrl_state *idle_state; } ;
48 struct dma_map_ops ;
48 struct dev_archdata { struct dma_map_ops *dma_ops; void *iommu; } ;
24 struct device_private ;
25 struct device_driver ;
26 struct driver_private ;
27 struct class ;
28 struct subsys_private ;
29 struct bus_type ;
30 struct device_node ;
31 struct fwnode_handle ;
32 struct iommu_ops ;
33 struct iommu_group ;
61 struct device_attribute ;
61 struct bus_type { const char *name; const char *dev_name; struct device *dev_root; struct device_attribute *dev_attrs; const struct attribute_group **bus_groups; const struct attribute_group **dev_groups; const struct attribute_group **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 *); const struct dev_pm_ops *pm; const struct iommu_ops *iommu_ops; struct subsys_private *p; struct lock_class_key lock_key; } ;
139 struct device_type ;
198 enum probe_type { PROBE_DEFAULT_STRATEGY = 0, PROBE_PREFER_ASYNCHRONOUS = 1, PROBE_FORCE_SYNCHRONOUS = 2 } ;
204 struct device_driver { const char *name; struct bus_type *bus; struct module *owner; const char *mod_name; bool suppress_bind_attrs; enum probe_type probe_type; const struct of_device_id *of_match_table; const struct acpi_device_id *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 *); const struct attribute_group **groups; const struct dev_pm_ops *pm; struct driver_private *p; } ;
354 struct class_attribute ;
354 struct class { const char *name; struct module *owner; struct class_attribute *class_attrs; const struct attribute_group **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 *); const struct kobj_ns_type_operations *ns_type; const void * (*namespace)(struct device *); const struct dev_pm_ops *pm; struct subsys_private *p; } ;
447 struct class_attribute { struct attribute attr; ssize_t (*show)(struct class *, struct class_attribute *, char *); ssize_t (*store)(struct class *, struct class_attribute *, const char *, size_t ); } ;
515 struct device_type { const char *name; const struct attribute_group **groups; int (*uevent)(struct device *, struct kobj_uevent_env *); char * (*devnode)(struct device *, umode_t *, kuid_t *, kgid_t *); void (*release)(struct device *); const struct dev_pm_ops *pm; } ;
543 struct device_attribute { struct attribute attr; ssize_t (*show)(struct device *, struct device_attribute *, char *); ssize_t (*store)(struct device *, struct device_attribute *, const char *, size_t ); } ;
684 struct device_dma_parameters { unsigned int max_segment_size; unsigned long segment_boundary_mask; } ;
693 struct dma_coherent_mem ;
693 struct cma ;
693 struct device { struct device *parent; struct device_private *p; struct kobject kobj; const char *init_name; const struct device_type *type; struct mutex mutex; struct bus_type *bus; struct device_driver *driver; void *platform_data; void *driver_data; struct dev_pm_info power; struct dev_pm_domain *pm_domain; struct irq_domain *msi_domain; struct dev_pin_info *pins; struct list_head msi_list; int numa_node; u64 *dma_mask; u64 coherent_dma_mask; unsigned long dma_pfn_offset; struct device_dma_parameters *dma_parms; struct list_head dma_pools; struct dma_coherent_mem *dma_mem; struct cma *cma_area; struct dev_archdata archdata; struct device_node *of_node; struct fwnode_handle *fwnode; dev_t devt; u32 id; spinlock_t devres_lock; struct list_head devres_head; struct klist_node knode_class; struct class *class; const struct attribute_group **groups; void (*release)(struct device *); struct iommu_group *iommu_group; bool offline_disabled; bool offline; } ;
847 struct wakeup_source { const char *name; struct list_head entry; spinlock_t lock; struct wake_irq *wakeirq; struct timer_list timer; unsigned long timer_expires; ktime_t total_time; ktime_t max_time; ktime_t last_time; ktime_t start_prevent_time; ktime_t prevent_sleep_time; unsigned long event_count; unsigned long active_count; unsigned long relax_count; unsigned long expire_count; unsigned long wakeup_count; bool active; bool autosleep_enabled; } ;
70 struct hotplug_slot ;
70 struct pci_slot { struct pci_bus *bus; struct list_head list; struct hotplug_slot *hotplug; unsigned char number; struct kobject kobj; } ;
110 typedef int pci_power_t;
137 typedef unsigned int pci_channel_state_t;
138 enum pci_channel_state { pci_channel_io_normal = 1, pci_channel_io_frozen = 2, pci_channel_io_perm_failure = 3 } ;
163 typedef unsigned short pci_dev_flags_t;
192 typedef unsigned short pci_bus_flags_t;
249 struct pcie_link_state ;
250 struct pci_vpd ;
251 struct pci_sriov ;
253 struct pci_driver ;
253 union __anonunion____missing_field_name_302 { struct pci_sriov *sriov; struct pci_dev *physfn; } ;
253 struct pci_dev { struct list_head bus_list; struct pci_bus *bus; struct pci_bus *subordinate; void *sysdata; struct proc_dir_entry *procent; struct pci_slot *slot; unsigned int devfn; unsigned short vendor; unsigned short device; unsigned short subsystem_vendor; unsigned short subsystem_device; unsigned int class; u8 revision; u8 hdr_type; u8 pcie_cap; u8 msi_cap; u8 msix_cap; unsigned char pcie_mpss; u8 rom_base_reg; u8 pin; u16 pcie_flags_reg; u8 dma_alias_devfn; struct pci_driver *driver; u64 dma_mask; struct device_dma_parameters dma_parms; pci_power_t current_state; u8 pm_cap; unsigned char pme_support; unsigned char pme_interrupt; unsigned char pme_poll; unsigned char d1_support; unsigned char d2_support; unsigned char no_d1d2; unsigned char no_d3cold; unsigned char d3cold_allowed; unsigned char mmio_always_on; unsigned char wakeup_prepared; unsigned char runtime_d3cold; unsigned char ignore_hotplug; unsigned int d3_delay; unsigned int d3cold_delay; struct pcie_link_state *link_state; pci_channel_state_t error_state; struct device dev; int cfg_size; unsigned int irq; struct resource resource[17U]; bool match_driver; unsigned char transparent; unsigned char multifunction; unsigned char is_added; unsigned char is_busmaster; unsigned char no_msi; unsigned char no_64bit_msi; unsigned char block_cfg_access; unsigned char broken_parity_status; unsigned char irq_reroute_variant; unsigned char msi_enabled; unsigned char msix_enabled; unsigned char ari_enabled; unsigned char ats_enabled; unsigned char is_managed; unsigned char needs_freset; unsigned char state_saved; unsigned char is_physfn; unsigned char is_virtfn; unsigned char reset_fn; unsigned char is_hotplug_bridge; unsigned char __aer_firmware_first_valid; unsigned char __aer_firmware_first; unsigned char broken_intx_masking; unsigned char io_window_1k; unsigned char irq_managed; unsigned char has_secondary_link; 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]; const struct attribute_group **msi_irq_groups; struct pci_vpd *vpd; union __anonunion____missing_field_name_302 __annonCompField72; u16 ats_cap; u8 ats_stu; atomic_t ats_ref_cnt; phys_addr_t rom; size_t romlen; char *driver_override; } ;
453 struct pci_ops ;
453 struct msi_controller ;
453 struct pci_bus { struct list_head node; struct pci_bus *parent; struct list_head children; struct list_head devices; struct pci_dev *self; struct list_head slots; struct resource *resource[4U]; struct list_head resources; struct resource busn_res; struct pci_ops *ops; struct msi_controller *msi; void *sysdata; struct proc_dir_entry *procdir; unsigned char number; unsigned char primary; unsigned char max_bus_speed; unsigned char cur_bus_speed; char name[48U]; unsigned short bridge_ctl; pci_bus_flags_t bus_flags; struct device *bridge; struct device dev; struct bin_attribute *legacy_io; struct bin_attribute *legacy_mem; unsigned char is_added; } ;
577 struct pci_ops { void * (*map_bus)(struct pci_bus *, unsigned int, int); int (*read)(struct pci_bus *, unsigned int, int, int, u32 *); int (*write)(struct pci_bus *, unsigned int, int, int, u32 ); } ;
605 struct pci_dynids { spinlock_t lock; struct list_head list; } ;
619 typedef unsigned int pci_ers_result_t;
629 struct pci_error_handlers { pci_ers_result_t (*error_detected)(struct pci_dev *, enum pci_channel_state ); pci_ers_result_t (*mmio_enabled)(struct pci_dev *); pci_ers_result_t (*link_reset)(struct pci_dev *); pci_ers_result_t (*slot_reset)(struct pci_dev *); void (*reset_notify)(struct pci_dev *, bool ); void (*resume)(struct pci_dev *); } ;
662 struct pci_driver { struct list_head node; const char *name; const struct pci_device_id *id_table; int (*probe)(struct pci_dev *, const struct pci_device_id *); 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); const struct pci_error_handlers *err_handler; struct device_driver driver; struct pci_dynids dynids; } ;
93 struct shrink_control { gfp_t gfp_mask; unsigned long nr_to_scan; int nid; struct mem_cgroup *memcg; } ;
27 struct shrinker { unsigned long int (*count_objects)(struct shrinker *, struct shrink_control *); unsigned long int (*scan_objects)(struct shrinker *, struct shrink_control *); int seeks; long batch; unsigned long flags; struct list_head list; atomic_long_t *nr_deferred; } ;
68 struct file_ra_state ;
69 struct writeback_control ;
70 struct bdi_writeback ;
226 struct vm_fault { unsigned int flags; gfp_t gfp_mask; unsigned long pgoff; void *virtual_address; struct page *cow_page; struct page *page; unsigned long max_pgoff; pte_t *pte; } ;
262 struct vm_operations_struct { void (*open)(struct vm_area_struct *); void (*close)(struct vm_area_struct *); int (*mremap)(struct vm_area_struct *); int (*fault)(struct vm_area_struct *, struct vm_fault *); int (*pmd_fault)(struct vm_area_struct *, unsigned long, pmd_t *, unsigned int); void (*map_pages)(struct vm_area_struct *, struct vm_fault *); int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *); int (*pfn_mkwrite)(struct vm_area_struct *, struct vm_fault *); int (*access)(struct vm_area_struct *, unsigned long, void *, int, int); const char * (*name)(struct vm_area_struct *); int (*set_policy)(struct vm_area_struct *, struct mempolicy *); struct mempolicy * (*get_policy)(struct vm_area_struct *, unsigned long); struct page * (*find_special_page)(struct vm_area_struct *, unsigned long); } ;
1285 struct kvec ;
2365 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; } ;
21 struct sg_table { struct scatterlist *sgl; unsigned int nents; unsigned int orig_nents; } ;
34 struct dma_attrs { unsigned long flags[1U]; } ;
89 enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ;
158 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; } ;
81 struct hlist_bl_node ;
81 struct hlist_bl_head { struct hlist_bl_node *first; } ;
36 struct hlist_bl_node { struct hlist_bl_node *next; struct hlist_bl_node **pprev; } ;
114 struct __anonstruct____missing_field_name_320 { spinlock_t lock; int count; } ;
114 union __anonunion____missing_field_name_319 { struct __anonstruct____missing_field_name_320 __annonCompField73; } ;
114 struct lockref { union __anonunion____missing_field_name_319 __annonCompField74; } ;
50 struct vfsmount ;
51 struct __anonstruct____missing_field_name_322 { u32 hash; u32 len; } ;
51 union __anonunion____missing_field_name_321 { struct __anonstruct____missing_field_name_322 __annonCompField75; u64 hash_len; } ;
51 struct qstr { union __anonunion____missing_field_name_321 __annonCompField76; const unsigned char *name; } ;
90 struct dentry_operations ;
90 union __anonunion_d_u_323 { struct hlist_node d_alias; struct callback_head d_rcu; } ;
90 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; const struct dentry_operations *d_op; struct super_block *d_sb; unsigned long d_time; void *d_fsdata; struct list_head d_lru; struct list_head d_child; struct list_head d_subdirs; union __anonunion_d_u_323 d_u; } ;
142 struct dentry_operations { int (*d_revalidate)(struct dentry *, unsigned int); int (*d_weak_revalidate)(struct dentry *, unsigned int); int (*d_hash)(const struct dentry *, struct qstr *); int (*d_compare)(const struct dentry *, const struct dentry *, unsigned int, const char *, const struct qstr *); int (*d_delete)(const struct dentry *); void (*d_release)(struct dentry *); void (*d_prune)(struct dentry *); void (*d_iput)(struct dentry *, struct inode *); char * (*d_dname)(struct dentry *, char *, int); struct vfsmount * (*d_automount)(struct path *); int (*d_manage)(struct dentry *, bool ); struct inode * (*d_select_inode)(struct dentry *, unsigned int); } ;
586 struct path { struct vfsmount *mnt; struct dentry *dentry; } ;
27 struct list_lru_one { struct list_head list; long nr_items; } ;
32 struct list_lru_memcg { struct list_lru_one *lru[0U]; } ;
37 struct list_lru_node { spinlock_t lock; struct list_lru_one lru; struct list_lru_memcg *memcg_lrus; } ;
47 struct list_lru { struct list_lru_node *node; struct list_head list; } ;
67 struct __anonstruct____missing_field_name_327 { struct radix_tree_node *parent; void *private_data; } ;
67 union __anonunion____missing_field_name_326 { struct __anonstruct____missing_field_name_327 __annonCompField77; struct callback_head callback_head; } ;
67 struct radix_tree_node { unsigned int path; unsigned int count; union __anonunion____missing_field_name_326 __annonCompField78; struct list_head private_list; void *slots[64U]; unsigned long tags[3U][1U]; } ;
114 struct radix_tree_root { unsigned int height; gfp_t gfp_mask; struct radix_tree_node *rnode; } ;
45 struct fiemap_extent { __u64 fe_logical; __u64 fe_physical; __u64 fe_length; __u64 fe_reserved64[2U]; __u32 fe_flags; __u32 fe_reserved[3U]; } ;
38 enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ;
47 struct block_device ;
19 struct bio_vec { struct page *bv_page; unsigned int bv_len; unsigned int bv_offset; } ;
268 struct delayed_call { void (*fn)(void *); void *arg; } ;
162 struct export_operations ;
164 struct iovec ;
165 struct kiocb ;
166 struct poll_table_struct ;
167 struct kstatfs ;
168 struct swap_info_struct ;
169 struct iov_iter ;
76 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; } ;
212 struct dquot ;
19 typedef __kernel_uid32_t projid_t;
23 struct __anonstruct_kprojid_t_333 { projid_t val; } ;
23 typedef struct __anonstruct_kprojid_t_333 kprojid_t;
166 enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ;
66 typedef long long qsize_t;
67 union __anonunion____missing_field_name_334 { kuid_t uid; kgid_t gid; kprojid_t projid; } ;
67 struct kqid { union __anonunion____missing_field_name_334 __annonCompField80; enum quota_type type; } ;
184 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; } ;
206 struct quota_format_type ;
207 struct mem_dqinfo { struct quota_format_type *dqi_format; int dqi_fmt_id; struct list_head dqi_dirty_list; unsigned long dqi_flags; unsigned int dqi_bgrace; unsigned int dqi_igrace; qsize_t dqi_max_spc_limit; qsize_t dqi_max_ino_limit; void *dqi_priv; } ;
272 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; } ;
299 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 *); } ;
310 struct dquot_operations { int (*write_dquot)(struct dquot *); struct dquot * (*alloc_dquot)(struct super_block *, int); void (*destroy_dquot)(struct dquot *); int (*acquire_dquot)(struct dquot *); int (*release_dquot)(struct dquot *); int (*mark_dirty)(struct dquot *); int (*write_info)(struct super_block *, int); qsize_t * (*get_reserved_space)(struct inode *); int (*get_projid)(struct inode *, kprojid_t *); } ;
325 struct qc_dqblk { int d_fieldmask; u64 d_spc_hardlimit; u64 d_spc_softlimit; u64 d_ino_hardlimit; u64 d_ino_softlimit; u64 d_space; u64 d_ino_count; s64 d_ino_timer; s64 d_spc_timer; int d_ino_warns; int d_spc_warns; u64 d_rt_spc_hardlimit; u64 d_rt_spc_softlimit; u64 d_rt_space; s64 d_rt_spc_timer; int d_rt_spc_warns; } ;
348 struct qc_type_state { unsigned int flags; unsigned int spc_timelimit; unsigned int ino_timelimit; unsigned int rt_spc_timelimit; unsigned int spc_warnlimit; unsigned int ino_warnlimit; unsigned int rt_spc_warnlimit; unsigned long long ino; blkcnt_t blocks; blkcnt_t nextents; } ;
394 struct qc_state { unsigned int s_incoredqs; struct qc_type_state s_state[3U]; } ;
405 struct qc_info { int i_fieldmask; unsigned int i_flags; unsigned int i_spc_timelimit; unsigned int i_ino_timelimit; unsigned int i_rt_spc_timelimit; unsigned int i_spc_warnlimit; unsigned int i_ino_warnlimit; unsigned int i_rt_spc_warnlimit; } ;
418 struct quotactl_ops { int (*quota_on)(struct super_block *, int, int, struct path *); int (*quota_off)(struct super_block *, int); int (*quota_enable)(struct super_block *, unsigned int); int (*quota_disable)(struct super_block *, unsigned int); int (*quota_sync)(struct super_block *, int); int (*set_info)(struct super_block *, int, struct qc_info *); int (*get_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *); int (*set_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *); int (*get_state)(struct super_block *, struct qc_state *); int (*rm_xquota)(struct super_block *, unsigned int); } ;
432 struct quota_format_type { int qf_fmt_id; const struct quota_format_ops *qf_ops; struct module *qf_owner; struct quota_format_type *qf_next; } ;
496 struct quota_info { unsigned int flags; struct mutex dqio_mutex; struct mutex dqonoff_mutex; struct inode *files[3U]; struct mem_dqinfo info[3U]; const struct quota_format_ops *ops[3U]; } ;
526 struct kiocb { struct file *ki_filp; loff_t ki_pos; void (*ki_complete)(struct kiocb *, long, long); void *private; int ki_flags; } ;
367 struct address_space_operations { int (*writepage)(struct page *, struct writeback_control *); int (*readpage)(struct file *, struct page *); int (*writepages)(struct address_space *, struct writeback_control *); int (*set_page_dirty)(struct page *); int (*readpages)(struct file *, struct address_space *, struct list_head *, unsigned int); int (*write_begin)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page **, void **); int (*write_end)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page *, void *); sector_t (*bmap)(struct address_space *, sector_t ); void (*invalidatepage)(struct page *, unsigned int, unsigned int); int (*releasepage)(struct page *, gfp_t ); void (*freepage)(struct page *); ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *, loff_t ); int (*migratepage)(struct address_space *, struct page *, struct page *, enum migrate_mode ); int (*launder_page)(struct page *); int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long); void (*is_dirty_writeback)(struct page *, bool *, bool *); int (*error_remove_page)(struct address_space *, struct page *); int (*swap_activate)(struct swap_info_struct *, struct file *, sector_t *); void (*swap_deactivate)(struct file *); } ;
424 struct address_space { struct inode *host; struct radix_tree_root page_tree; spinlock_t tree_lock; atomic_t i_mmap_writable; struct rb_root i_mmap; struct rw_semaphore i_mmap_rwsem; unsigned long nrpages; unsigned long nrexceptional; unsigned long writeback_index; const struct address_space_operations *a_ops; unsigned long flags; spinlock_t private_lock; struct list_head private_list; void *private_data; } ;
445 struct request_queue ;
446 struct hd_struct ;
446 struct gendisk ;
446 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; int bd_map_count; } ;
565 struct posix_acl ;
566 struct inode_operations ;
566 union __anonunion____missing_field_name_339 { const unsigned int i_nlink; unsigned int __i_nlink; } ;
566 union __anonunion____missing_field_name_340 { struct hlist_head i_dentry; struct callback_head i_rcu; } ;
566 struct file_lock_context ;
566 struct cdev ;
566 union __anonunion____missing_field_name_341 { struct pipe_inode_info *i_pipe; struct block_device *i_bdev; struct cdev *i_cdev; char *i_link; } ;
566 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; const struct inode_operations *i_op; struct super_block *i_sb; struct address_space *i_mapping; void *i_security; unsigned long i_ino; union __anonunion____missing_field_name_339 __annonCompField81; dev_t i_rdev; loff_t i_size; struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime; spinlock_t i_lock; unsigned short i_bytes; unsigned int i_blkbits; blkcnt_t i_blocks; unsigned long i_state; struct mutex i_mutex; unsigned long dirtied_when; unsigned long dirtied_time_when; struct hlist_node i_hash; struct list_head i_io_list; struct bdi_writeback *i_wb; int i_wb_frn_winner; u16 i_wb_frn_avg_time; u16 i_wb_frn_history; struct list_head i_lru; struct list_head i_sb_list; union __anonunion____missing_field_name_340 __annonCompField82; u64 i_version; atomic_t i_count; atomic_t i_dio_count; atomic_t i_writecount; atomic_t i_readcount; const struct file_operations *i_fop; struct file_lock_context *i_flctx; struct address_space i_data; struct list_head i_devices; union __anonunion____missing_field_name_341 __annonCompField83; __u32 i_generation; __u32 i_fsnotify_mask; struct hlist_head i_fsnotify_marks; void *i_private; } ;
837 struct fown_struct { rwlock_t lock; struct pid *pid; enum pid_type pid_type; kuid_t uid; kuid_t euid; int signum; } ;
845 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; } ;
868 union __anonunion_f_u_342 { struct llist_node fu_llist; struct callback_head fu_rcuhead; } ;
868 struct file { union __anonunion_f_u_342 f_u; struct path f_path; struct inode *f_inode; const struct file_operations *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; const struct cred *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; } ;
953 typedef void *fl_owner_t;
954 struct file_lock ;
955 struct file_lock_operations { void (*fl_copy_lock)(struct file_lock *, struct file_lock *); void (*fl_release_private)(struct file_lock *); } ;
961 struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock *, struct file_lock *); unsigned long int (*lm_owner_key)(struct file_lock *); fl_owner_t (*lm_get_owner)(fl_owner_t ); void (*lm_put_owner)(fl_owner_t ); void (*lm_notify)(struct file_lock *); int (*lm_grant)(struct file_lock *, int); bool (*lm_break)(struct file_lock *); int (*lm_change)(struct file_lock *, int, struct list_head *); void (*lm_setup)(struct file_lock *, void **); } ;
982 struct net ;
988 struct nlm_lockowner ;
989 struct nfs_lock_info { u32 state; struct nlm_lockowner *owner; struct list_head list; } ;
14 struct nfs4_lock_state ;
15 struct nfs4_lock_info { struct nfs4_lock_state *owner; } ;
19 struct fasync_struct ;
19 struct __anonstruct_afs_344 { struct list_head link; int state; } ;
19 union __anonunion_fl_u_343 { struct nfs_lock_info nfs_fl; struct nfs4_lock_info nfs4_fl; struct __anonstruct_afs_344 afs; } ;
19 struct file_lock { struct file_lock *fl_next; struct list_head fl_list; struct hlist_node fl_link; struct list_head fl_block; fl_owner_t fl_owner; unsigned int fl_flags; unsigned char fl_type; unsigned int fl_pid; int fl_link_cpu; struct pid *fl_nspid; wait_queue_head_t fl_wait; struct file *fl_file; loff_t fl_start; loff_t fl_end; struct fasync_struct *fl_fasync; unsigned long fl_break_time; unsigned long fl_downgrade_time; const struct file_lock_operations *fl_ops; const struct lock_manager_operations *fl_lmops; union __anonunion_fl_u_343 fl_u; } ;
1041 struct file_lock_context { spinlock_t flc_lock; struct list_head flc_flock; struct list_head flc_posix; struct list_head flc_lease; } ;
1244 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; } ;
1279 struct sb_writers { int frozen; wait_queue_head_t wait_unfrozen; struct percpu_rw_semaphore rw_sem[3U]; } ;
1305 struct super_operations ;
1305 struct xattr_handler ;
1305 struct mtd_info ;
1305 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; const struct super_operations *s_op; const struct dquot_operations *dq_op; const struct quotactl_ops *s_qcop; const struct export_operations *s_export_op; unsigned long s_flags; unsigned long s_iflags; unsigned long s_magic; struct dentry *s_root; struct rw_semaphore s_umount; int s_count; atomic_t s_active; void *s_security; const struct xattr_handler **s_xattr; struct hlist_bl_head s_anon; struct list_head s_mounts; struct block_device *s_bdev; struct backing_dev_info *s_bdi; struct mtd_info *s_mtd; struct hlist_node s_instances; unsigned int s_quota_types; struct quota_info s_dquot; struct sb_writers s_writers; char s_id[32U]; u8 s_uuid[16U]; void *s_fs_info; unsigned int s_max_links; fmode_t s_mode; u32 s_time_gran; struct mutex s_vfs_rename_mutex; char *s_subtype; char *s_options; const struct dentry_operations *s_d_op; int cleancache_poolid; struct shrinker s_shrink; atomic_long_t s_remove_count; int s_readonly_remount; struct workqueue_struct *s_dio_done_wq; struct hlist_head s_pins; struct list_lru s_dentry_lru; struct list_lru s_inode_lru; struct callback_head rcu; struct work_struct destroy_work; struct mutex s_sync_lock; int s_stack_depth; spinlock_t s_inode_list_lock; struct list_head s_inodes; } ;
1554 struct fiemap_extent_info { unsigned int fi_flags; unsigned int fi_extents_mapped; unsigned int fi_extents_max; struct fiemap_extent *fi_extents_start; } ;
1568 struct dir_context ;
1593 struct dir_context { int (*actor)(struct dir_context *, const char *, int, loff_t , u64 , unsigned int); loff_t pos; } ;
1600 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 *, const char *, size_t , loff_t *); ssize_t (*read_iter)(struct kiocb *, struct iov_iter *); ssize_t (*write_iter)(struct kiocb *, struct iov_iter *); int (*iterate)(struct file *, struct dir_context *); unsigned int (*poll)(struct file *, struct poll_table_struct *); long int (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); long int (*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 int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*check_flags)(int); int (*flock)(struct file *, int, struct file_lock *); ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t , unsigned int); ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t , unsigned int); int (*setlease)(struct file *, long, struct file_lock **, void **); long int (*fallocate)(struct file *, int, loff_t , loff_t ); void (*show_fdinfo)(struct seq_file *, struct file *); ssize_t (*copy_file_range)(struct file *, loff_t , struct file *, loff_t , size_t , unsigned int); int (*clone_file_range)(struct file *, loff_t , struct file *, loff_t , u64 ); ssize_t (*dedupe_file_range)(struct file *, u64 , u64 , struct file *, u64 ); } ;
1668 struct inode_operations { struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int); const char * (*get_link)(struct dentry *, struct inode *, struct delayed_call *); int (*permission)(struct inode *, int); struct posix_acl * (*get_acl)(struct inode *, int); int (*readlink)(struct dentry *, char *, int); 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 *, const char *); int (*mkdir)(struct inode *, struct dentry *, umode_t ); int (*rmdir)(struct inode *, struct dentry *); int (*mknod)(struct inode *, struct dentry *, umode_t , dev_t ); int (*rename)(struct inode *, struct dentry *, struct inode *, struct dentry *); int (*rename2)(struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*setattr)(struct dentry *, struct iattr *); int (*getattr)(struct vfsmount *, struct dentry *, struct kstat *); int (*setxattr)(struct dentry *, const char *, const void *, size_t , int); ssize_t (*getxattr)(struct dentry *, const char *, void *, size_t ); ssize_t (*listxattr)(struct dentry *, char *, size_t ); int (*removexattr)(struct dentry *, const char *); 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); } ;
1723 struct super_operations { struct inode * (*alloc_inode)(struct super_block *); void (*destroy_inode)(struct inode *); void (*dirty_inode)(struct inode *, int); int (*write_inode)(struct inode *, struct writeback_control *); int (*drop_inode)(struct inode *); void (*evict_inode)(struct inode *); void (*put_super)(struct super_block *); int (*sync_fs)(struct super_block *, int); int (*freeze_super)(struct super_block *); int (*freeze_fs)(struct super_block *); int (*thaw_super)(struct super_block *); int (*unfreeze_fs)(struct super_block *); int (*statfs)(struct dentry *, struct kstatfs *); int (*remount_fs)(struct super_block *, int *, char *); void (*umount_begin)(struct super_block *); int (*show_options)(struct seq_file *, struct dentry *); int (*show_devname)(struct seq_file *, struct dentry *); int (*show_path)(struct seq_file *, struct dentry *); int (*show_stats)(struct seq_file *, struct dentry *); ssize_t (*quota_read)(struct super_block *, int, char *, size_t , loff_t ); ssize_t (*quota_write)(struct super_block *, int, const char *, size_t , loff_t ); struct dquot ** (*get_dquots)(struct inode *); int (*bdev_try_to_free_page)(struct super_block *, struct page *, gfp_t ); long int (*nr_cached_objects)(struct super_block *, struct shrink_control *); long int (*free_cached_objects)(struct super_block *, struct shrink_control *); } ;
1962 struct file_system_type { const char *name; int fs_flags; struct dentry * (*mount)(struct file_system_type *, int, const char *, 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; } ;
6 typedef unsigned char cc_t;
7 typedef unsigned int speed_t;
8 typedef unsigned int tcflag_t;
30 struct ktermios { tcflag_t c_iflag; tcflag_t c_oflag; tcflag_t c_cflag; tcflag_t c_lflag; cc_t c_line; cc_t c_cc[19U]; speed_t c_ispeed; speed_t c_ospeed; } ;
41 struct winsize { unsigned short ws_row; unsigned short ws_col; unsigned short ws_xpixel; unsigned short ws_ypixel; } ;
93 struct termiox { __u16 x_hflag; __u16 x_cflag; __u16 x_rflag[5U]; __u16 x_sflag; } ;
16 struct cdev { struct kobject kobj; struct module *owner; const struct file_operations *ops; struct list_head list; dev_t dev; unsigned int count; } ;
32 struct tty_driver ;
33 struct serial_icounter_struct ;
34 struct tty_operations { struct tty_struct * (*lookup)(struct tty_driver *, struct inode *, int); int (*install)(struct tty_driver *, struct tty_struct *); void (*remove)(struct tty_driver *, struct tty_struct *); int (*open)(struct tty_struct *, struct file *); void (*close)(struct tty_struct *, struct file *); void (*shutdown)(struct tty_struct *); void (*cleanup)(struct tty_struct *); int (*write)(struct tty_struct *, const unsigned char *, int); int (*put_char)(struct tty_struct *, unsigned char); void (*flush_chars)(struct tty_struct *); int (*write_room)(struct tty_struct *); int (*chars_in_buffer)(struct tty_struct *); int (*ioctl)(struct tty_struct *, unsigned int, unsigned long); long int (*compat_ioctl)(struct tty_struct *, unsigned int, unsigned long); void (*set_termios)(struct tty_struct *, struct ktermios *); void (*throttle)(struct tty_struct *); void (*unthrottle)(struct tty_struct *); void (*stop)(struct tty_struct *); void (*start)(struct tty_struct *); void (*hangup)(struct tty_struct *); int (*break_ctl)(struct tty_struct *, int); void (*flush_buffer)(struct tty_struct *); void (*set_ldisc)(struct tty_struct *); void (*wait_until_sent)(struct tty_struct *, int); void (*send_xchar)(struct tty_struct *, char); int (*tiocmget)(struct tty_struct *); int (*tiocmset)(struct tty_struct *, unsigned int, unsigned int); int (*resize)(struct tty_struct *, struct winsize *); int (*set_termiox)(struct tty_struct *, struct termiox *); int (*get_icount)(struct tty_struct *, struct serial_icounter_struct *); int (*poll_init)(struct tty_driver *, int, char *); int (*poll_get_char)(struct tty_driver *, int); void (*poll_put_char)(struct tty_driver *, int, char); const struct file_operations *proc_fops; } ;
295 struct tty_port ;
295 struct tty_driver { int magic; struct kref kref; struct cdev **cdevs; struct module *owner; const char *driver_name; const char *name; int name_base; int major; int minor_start; unsigned int num; short type; short subtype; struct ktermios init_termios; unsigned long flags; struct proc_dir_entry *proc_entry; struct tty_driver *other; struct tty_struct **ttys; struct tty_port **ports; struct ktermios **termios; void *driver_state; const struct tty_operations *ops; struct list_head tty_drivers; } ;
362 struct ld_semaphore { long count; raw_spinlock_t wait_lock; unsigned int wait_readers; struct list_head read_wait; struct list_head write_wait; struct lockdep_map dep_map; } ;
170 struct tty_ldisc_ops { int magic; char *name; int num; int flags; int (*open)(struct tty_struct *); void (*close)(struct tty_struct *); void (*flush_buffer)(struct tty_struct *); ssize_t (*chars_in_buffer)(struct tty_struct *); ssize_t (*read)(struct tty_struct *, struct file *, unsigned char *, size_t ); ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t ); int (*ioctl)(struct tty_struct *, struct file *, unsigned int, unsigned long); long int (*compat_ioctl)(struct tty_struct *, struct file *, unsigned int, unsigned long); void (*set_termios)(struct tty_struct *, struct ktermios *); unsigned int (*poll)(struct tty_struct *, struct file *, struct poll_table_struct *); int (*hangup)(struct tty_struct *); void (*receive_buf)(struct tty_struct *, const unsigned char *, char *, int); void (*write_wakeup)(struct tty_struct *); void (*dcd_change)(struct tty_struct *, unsigned int); void (*fasync)(struct tty_struct *, int); int (*receive_buf2)(struct tty_struct *, const unsigned char *, char *, int); struct module *owner; int refcount; } ;
220 struct tty_ldisc { struct tty_ldisc_ops *ops; struct tty_struct *tty; } ;
230 union __anonunion____missing_field_name_345 { struct tty_buffer *next; struct llist_node free; } ;
230 struct tty_buffer { union __anonunion____missing_field_name_345 __annonCompField84; int used; int size; int commit; int read; int flags; unsigned long data[0U]; } ;
82 struct tty_bufhead { struct tty_buffer *head; struct work_struct work; struct mutex lock; atomic_t priority; struct tty_buffer sentinel; struct llist_head free; atomic_t mem_used; int mem_limit; struct tty_buffer *tail; } ;
94 struct tty_port_operations { int (*carrier_raised)(struct tty_port *); void (*dtr_rts)(struct tty_port *, int); void (*shutdown)(struct tty_port *); int (*activate)(struct tty_port *, struct tty_struct *); void (*destruct)(struct tty_port *); } ;
220 struct tty_port { struct tty_bufhead buf; struct tty_struct *tty; struct tty_struct *itty; const struct tty_port_operations *ops; spinlock_t lock; int blocked_open; int count; wait_queue_head_t open_wait; wait_queue_head_t delta_msr_wait; unsigned long flags; unsigned char console; unsigned char low_latency; struct mutex mutex; struct mutex buf_mutex; unsigned char *xmit_buf; unsigned int close_delay; unsigned int closing_wait; int drain_delay; struct kref kref; } ;
244 struct tty_struct { int magic; struct kref kref; struct device *dev; struct tty_driver *driver; const struct tty_operations *ops; int index; struct ld_semaphore ldisc_sem; struct tty_ldisc *ldisc; struct mutex atomic_write_lock; struct mutex legacy_mutex; struct mutex throttle_mutex; struct rw_semaphore termios_rwsem; struct mutex winsize_mutex; spinlock_t ctrl_lock; spinlock_t flow_lock; struct ktermios termios; struct ktermios termios_locked; struct termiox *termiox; char name[64U]; struct pid *pgrp; struct pid *session; unsigned long flags; int count; struct winsize winsize; unsigned char stopped; unsigned char flow_stopped; unsigned long unused; int hw_stopped; unsigned char ctrl_status; unsigned char packet; unsigned long unused_ctrl; unsigned int receive_room; int flow_change; struct tty_struct *link; struct fasync_struct *fasync; int alt_speed; wait_queue_head_t write_wait; wait_queue_head_t read_wait; struct work_struct hangup_work; void *disc_data; void *driver_data; struct list_head tty_files; int closing; unsigned char *write_buf; int write_cnt; struct work_struct SAK_work; struct tty_port *port; } ;
96 struct serial_icounter_struct { int cts; int dsr; int rng; int dcd; int rx; int tx; int frame; int overrun; int parity; int brk; int buf_overrun; int reserved[9U]; } ;
25 struct mnt_namespace ;
26 struct ipc_namespace ;
27 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; } ;
84 struct proc_ns_operations ;
85 struct ns_common { atomic_long_t stashed; const struct proc_ns_operations *ops; unsigned int inum; } ;
11 struct pidmap { atomic_t nr_free; void *page; } ;
17 struct fs_pin ;
18 struct pid_namespace { struct kref kref; struct pidmap pidmap[128U]; struct callback_head rcu; int last_pid; unsigned int nr_hashed; struct task_struct *child_reaper; struct kmem_cache *pid_cachep; unsigned int level; struct pid_namespace *parent; struct vfsmount *proc_mnt; struct dentry *proc_self; struct dentry *proc_thread_self; struct fs_pin *bacct; struct user_namespace *user_ns; struct work_struct proc_work; kgid_t pid_gid; int hide_pid; int reboot; struct ns_common ns; } ;
56 struct iovec { void *iov_base; __kernel_size_t iov_len; } ;
21 struct kvec { void *iov_base; size_t iov_len; } ;
27 union __anonunion____missing_field_name_350 { const struct iovec *iov; const struct kvec *kvec; const struct bio_vec *bvec; } ;
27 struct iov_iter { int type; size_t iov_offset; size_t count; union __anonunion____missing_field_name_350 __annonCompField85; unsigned long nr_segs; } ;
1380 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; } ;
11 typedef unsigned short __kernel_sa_family_t;
23 typedef __kernel_sa_family_t sa_family_t;
24 struct sockaddr { sa_family_t sa_family; char sa_data[14U]; } ;
43 struct __anonstruct_sync_serial_settings_352 { unsigned int clock_rate; unsigned int clock_type; unsigned short loopback; } ;
43 typedef struct __anonstruct_sync_serial_settings_352 sync_serial_settings;
50 struct __anonstruct_te1_settings_353 { unsigned int clock_rate; unsigned int clock_type; unsigned short loopback; unsigned int slot_map; } ;
50 typedef struct __anonstruct_te1_settings_353 te1_settings;
55 struct __anonstruct_raw_hdlc_proto_354 { unsigned short encoding; unsigned short parity; } ;
55 typedef struct __anonstruct_raw_hdlc_proto_354 raw_hdlc_proto;
65 struct __anonstruct_fr_proto_355 { unsigned int t391; unsigned int t392; unsigned int n391; unsigned int n392; unsigned int n393; unsigned short lmi; unsigned short dce; } ;
65 typedef struct __anonstruct_fr_proto_355 fr_proto;
69 struct __anonstruct_fr_proto_pvc_356 { unsigned int dlci; } ;
69 typedef struct __anonstruct_fr_proto_pvc_356 fr_proto_pvc;
74 struct __anonstruct_fr_proto_pvc_info_357 { unsigned int dlci; char master[16U]; } ;
74 typedef struct __anonstruct_fr_proto_pvc_info_357 fr_proto_pvc_info;
79 struct __anonstruct_cisco_proto_358 { unsigned int interval; unsigned int timeout; } ;
79 typedef struct __anonstruct_cisco_proto_358 cisco_proto;
117 struct ifmap { unsigned long mem_start; unsigned long mem_end; unsigned short base_addr; unsigned char irq; unsigned char dma; unsigned char port; } ;
177 union __anonunion_ifs_ifsu_359 { 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; } ;
177 struct if_settings { unsigned int type; unsigned int size; union __anonunion_ifs_ifsu_359 ifs_ifsu; } ;
195 union __anonunion_ifr_ifrn_360 { char ifrn_name[16U]; } ;
195 union __anonunion_ifr_ifru_361 { 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; } ;
195 struct ifreq { union __anonunion_ifr_ifrn_360 ifr_ifrn; union __anonunion_ifr_ifru_361 ifr_ifru; } ;
18 typedef s32 compat_time_t;
39 typedef s32 compat_long_t;
44 typedef u32 compat_uptr_t;
45 struct compat_timespec { compat_time_t tv_sec; s32 tv_nsec; } ;
276 struct compat_robust_list { compat_uptr_t next; } ;
280 struct compat_robust_list_head { struct compat_robust_list list; compat_long_t futex_offset; compat_uptr_t list_op_pending; } ;
161 struct in6_addr ;
140 struct sk_buff ;
15 typedef u64 netdev_features_t;
66 union __anonunion_in6_u_377 { __u8 u6_addr8[16U]; __be16 u6_addr16[8U]; __be32 u6_addr32[4U]; } ;
66 struct in6_addr { union __anonunion_in6_u_377 in6_u; } ;
46 struct ethhdr { unsigned char h_dest[6U]; unsigned char h_source[6U]; __be16 h_proto; } ;
186 struct pipe_buf_operations ;
186 struct pipe_buffer { struct page *page; unsigned int offset; unsigned int len; const struct pipe_buf_operations *ops; unsigned int flags; unsigned long private; } ;
27 struct pipe_inode_info { struct mutex mutex; wait_queue_head_t wait; unsigned int nrbufs; unsigned int curbuf; unsigned int buffers; unsigned int readers; unsigned int writers; unsigned int files; unsigned int waiting_writers; unsigned int r_counter; unsigned int w_counter; struct page *tmp_page; struct fasync_struct *fasync_readers; struct fasync_struct *fasync_writers; struct pipe_buffer *bufs; struct user_struct *user; } ;
63 struct pipe_buf_operations { int can_merge; int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *); void (*release)(struct pipe_inode_info *, struct pipe_buffer *); int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); void (*get)(struct pipe_inode_info *, struct pipe_buffer *); } ;
265 struct napi_struct ;
266 struct nf_conntrack { atomic_t use; } ;
253 union __anonunion____missing_field_name_387 { __be32 ipv4_daddr; struct in6_addr ipv6_daddr; char neigh_header[8U]; } ;
253 struct nf_bridge_info { atomic_t use; unsigned char orig_proto; unsigned char pkt_otherhost; unsigned char in_prerouting; unsigned char bridged_dnat; __u16 frag_max_size; struct net_device *physindev; struct net_device *physoutdev; union __anonunion____missing_field_name_387 __annonCompField89; } ;
277 struct sk_buff_head { struct sk_buff *next; struct sk_buff *prev; __u32 qlen; spinlock_t lock; } ;
491 typedef unsigned int sk_buff_data_t;
492 struct __anonstruct____missing_field_name_390 { u32 stamp_us; u32 stamp_jiffies; } ;
492 union __anonunion____missing_field_name_389 { u64 v64; struct __anonstruct____missing_field_name_390 __annonCompField90; } ;
492 struct skb_mstamp { union __anonunion____missing_field_name_389 __annonCompField91; } ;
555 union __anonunion____missing_field_name_393 { ktime_t tstamp; struct skb_mstamp skb_mstamp; } ;
555 struct __anonstruct____missing_field_name_392 { struct sk_buff *next; struct sk_buff *prev; union __anonunion____missing_field_name_393 __annonCompField92; } ;
555 union __anonunion____missing_field_name_391 { struct __anonstruct____missing_field_name_392 __annonCompField93; struct rb_node rbnode; } ;
555 struct sec_path ;
555 struct __anonstruct____missing_field_name_395 { __u16 csum_start; __u16 csum_offset; } ;
555 union __anonunion____missing_field_name_394 { __wsum csum; struct __anonstruct____missing_field_name_395 __annonCompField95; } ;
555 union __anonunion____missing_field_name_396 { unsigned int napi_id; unsigned int sender_cpu; } ;
555 union __anonunion____missing_field_name_397 { __u32 secmark; __u32 offload_fwd_mark; } ;
555 union __anonunion____missing_field_name_398 { __u32 mark; __u32 reserved_tailroom; } ;
555 union __anonunion____missing_field_name_399 { __be16 inner_protocol; __u8 inner_ipproto; } ;
555 struct sk_buff { union __anonunion____missing_field_name_391 __annonCompField94; struct sock *sk; struct net_device *dev; char cb[48U]; unsigned long _skb_refdst; void (*destructor)(struct sk_buff *); struct sec_path *sp; struct nf_conntrack *nfct; struct nf_bridge_info *nf_bridge; unsigned int len; unsigned int data_len; __u16 mac_len; __u16 hdr_len; __u16 queue_mapping; unsigned char cloned; unsigned char nohdr; unsigned char fclone; unsigned char peeked; unsigned char head_frag; unsigned char xmit_more; __u32 headers_start[0U]; __u8 __pkt_type_offset[0U]; unsigned char pkt_type; unsigned char pfmemalloc; unsigned char ignore_df; unsigned char nfctinfo; unsigned char nf_trace; unsigned char ip_summed; unsigned char ooo_okay; unsigned char l4_hash; unsigned char sw_hash; unsigned char wifi_acked_valid; unsigned char wifi_acked; unsigned char no_fcs; unsigned char encapsulation; unsigned char encap_hdr_csum; unsigned char csum_valid; unsigned char csum_complete_sw; unsigned char csum_level; unsigned char csum_bad; unsigned char ndisc_nodetype; unsigned char ipvs_property; unsigned char inner_protocol_type; unsigned char remcsum_offload; __u16 tc_index; __u16 tc_verd; union __anonunion____missing_field_name_394 __annonCompField96; __u32 priority; int skb_iif; __u32 hash; __be16 vlan_proto; __u16 vlan_tci; union __anonunion____missing_field_name_396 __annonCompField97; union __anonunion____missing_field_name_397 __annonCompField98; union __anonunion____missing_field_name_398 __annonCompField99; union __anonunion____missing_field_name_399 __annonCompField100; __u16 inner_transport_header; __u16 inner_network_header; __u16 inner_mac_header; __be16 protocol; __u16 transport_header; __u16 network_header; __u16 mac_header; __u32 headers_end[0U]; sk_buff_data_t tail; sk_buff_data_t end; unsigned char *head; unsigned char *data; unsigned int truesize; atomic_t users; } ;
822 struct dst_entry ;
34 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]; } ;
125 struct ethtool_drvinfo { __u32 cmd; char driver[32U]; char version[32U]; char fw_version[32U]; char bus_info[32U]; char erom_version[32U]; char reserved2[12U]; __u32 n_priv_flags; __u32 n_stats; __u32 testinfo_len; __u32 eedump_len; __u32 regdump_len; } ;
189 struct ethtool_wolinfo { __u32 cmd; __u32 supported; __u32 wolopts; __u8 sopass[6U]; } ;
233 struct ethtool_tunable { __u32 cmd; __u32 id; __u32 type_id; __u32 len; void *data[0U]; } ;
245 struct ethtool_regs { __u32 cmd; __u32 version; __u32 len; __u8 data[0U]; } ;
267 struct ethtool_eeprom { __u32 cmd; __u32 magic; __u32 offset; __u32 len; __u8 data[0U]; } ;
293 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]; } ;
322 struct ethtool_modinfo { __u32 cmd; __u32 type; __u32 eeprom_len; __u32 reserved[8U]; } ;
339 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; } ;
438 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; } ;
475 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; } ;
503 struct ethtool_pauseparam { __u32 cmd; __u32 autoneg; __u32 rx_pause; __u32 tx_pause; } ;
607 struct ethtool_test { __u32 cmd; __u32 flags; __u32 reserved; __u32 len; __u64 data[0U]; } ;
639 struct ethtool_stats { __u32 cmd; __u32 n_stats; __u64 data[0U]; } ;
681 struct ethtool_tcpip4_spec { __be32 ip4src; __be32 ip4dst; __be16 psrc; __be16 pdst; __u8 tos; } ;
714 struct ethtool_ah_espip4_spec { __be32 ip4src; __be32 ip4dst; __be32 spi; __u8 tos; } ;
730 struct ethtool_usrip4_spec { __be32 ip4src; __be32 ip4dst; __be32 l4_4_bytes; __u8 tos; __u8 ip_ver; __u8 proto; } ;
750 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]; } ;
761 struct ethtool_flow_ext { __u8 padding[2U]; unsigned char h_dest[6U]; __be16 vlan_etype; __be16 vlan_tci; __be32 data[2U]; } ;
780 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; } ;
830 struct ethtool_rxnfc { __u32 cmd; __u32 flow_type; __u64 data; struct ethtool_rx_flow_spec fs; __u32 rule_cnt; __u32 rule_locs[0U]; } ;
1001 struct ethtool_flash { __u32 cmd; __u32 region; char data[128U]; } ;
1009 struct ethtool_dump { __u32 cmd; __u32 version; __u32 flag; __u32 len; __u8 data[0U]; } ;
1085 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]; } ;
44 enum ethtool_phys_id_state { ETHTOOL_ID_INACTIVE = 0, ETHTOOL_ID_ACTIVE = 1, ETHTOOL_ID_ON = 2, ETHTOOL_ID_OFF = 3 } ;
99 struct ethtool_ops { int (*get_settings)(struct net_device *, struct ethtool_cmd *); int (*set_settings)(struct net_device *, struct ethtool_cmd *); void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *); int (*get_regs_len)(struct net_device *); void (*get_regs)(struct net_device *, struct ethtool_regs *, void *); void (*get_wol)(struct net_device *, struct ethtool_wolinfo *); int (*set_wol)(struct net_device *, struct ethtool_wolinfo *); u32 (*get_msglevel)(struct net_device *); void (*set_msglevel)(struct net_device *, u32 ); int (*nway_reset)(struct net_device *); u32 (*get_link)(struct net_device *); int (*get_eeprom_len)(struct net_device *); int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *); int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *); void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam *); int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam *); void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); void (*get_strings)(struct net_device *, u32 , u8 *); int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state ); void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); int (*begin)(struct net_device *); void (*complete)(struct net_device *); u32 (*get_priv_flags)(struct net_device *); int (*set_priv_flags)(struct net_device *, u32 ); int (*get_sset_count)(struct net_device *, int); int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, u32 *); int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); int (*flash_device)(struct net_device *, struct ethtool_flash *); int (*reset)(struct net_device *, u32 *); u32 (*get_rxfh_key_size)(struct net_device *); u32 (*get_rxfh_indir_size)(struct net_device *); int (*get_rxfh)(struct net_device *, u32 *, u8 *, u8 *); int (*set_rxfh)(struct net_device *, const u32 *, const u8 *, const u8 ); void (*get_channels)(struct net_device *, struct ethtool_channels *); int (*set_channels)(struct net_device *, struct ethtool_channels *); int (*get_dump_flag)(struct net_device *, struct ethtool_dump *); int (*get_dump_data)(struct net_device *, struct ethtool_dump *, void *); int (*set_dump)(struct net_device *, struct ethtool_dump *); int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *); int (*get_module_info)(struct net_device *, struct ethtool_modinfo *); int (*get_module_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); int (*get_eee)(struct net_device *, struct ethtool_eee *); int (*set_eee)(struct net_device *, struct ethtool_eee *); int (*get_tunable)(struct net_device *, const struct ethtool_tunable *, void *); int (*set_tunable)(struct net_device *, const struct ethtool_tunable *, const void *); } ;
282 struct prot_inuse ;
283 struct netns_core { struct ctl_table_header *sysctl_hdr; int sysctl_somaxconn; struct prot_inuse *inuse; } ;
38 struct u64_stats_sync { } ;
146 struct ipstats_mib { u64 mibs[36U]; struct u64_stats_sync syncp; } ;
61 struct icmp_mib { unsigned long mibs[28U]; } ;
67 struct icmpmsg_mib { atomic_long_t mibs[512U]; } ;
72 struct icmpv6_mib { unsigned long mibs[6U]; } ;
83 struct icmpv6msg_mib { atomic_long_t mibs[512U]; } ;
93 struct tcp_mib { unsigned long mibs[16U]; } ;
100 struct udp_mib { unsigned long mibs[9U]; } ;
106 struct linux_mib { unsigned long mibs[117U]; } ;
112 struct linux_xfrm_mib { unsigned long mibs[29U]; } ;
118 struct netns_mib { struct tcp_mib *tcp_statistics; struct ipstats_mib *ip_statistics; struct linux_mib *net_statistics; struct udp_mib *udp_statistics; struct udp_mib *udplite_statistics; struct icmp_mib *icmp_statistics; struct icmpmsg_mib *icmpmsg_statistics; struct proc_dir_entry *proc_net_devsnmp6; struct udp_mib *udp_stats_in6; struct udp_mib *udplite_stats_in6; struct ipstats_mib *ipv6_statistics; struct icmpv6_mib *icmpv6_statistics; struct icmpv6msg_mib *icmpv6msg_statistics; struct linux_xfrm_mib *xfrm_statistics; } ;
26 struct netns_unix { int sysctl_max_dgram_qlen; struct ctl_table_header *ctl; } ;
12 struct netns_packet { struct mutex sklist_lock; struct hlist_head sklist; } ;
14 struct netns_frags { struct percpu_counter mem; int timeout; int high_thresh; int low_thresh; } ;
186 struct ipv4_devconf ;
187 struct fib_rules_ops ;
188 struct fib_table ;
189 struct local_ports { seqlock_t lock; int range[2U]; bool warned; } ;
24 struct ping_group_range { seqlock_t lock; kgid_t range[2U]; } ;
29 struct inet_peer_base ;
29 struct xt_table ;
29 struct netns_ipv4 { struct ctl_table_header *forw_hdr; struct ctl_table_header *frags_hdr; struct ctl_table_header *ipv4_hdr; struct ctl_table_header *route_hdr; struct ctl_table_header *xfrm4_hdr; struct ipv4_devconf *devconf_all; struct ipv4_devconf *devconf_dflt; struct fib_rules_ops *rules_ops; bool fib_has_custom_rules; struct fib_table *fib_local; struct fib_table *fib_main; struct fib_table *fib_default; int fib_num_tclassid_users; struct hlist_head *fib_table_hash; bool fib_offload_disabled; struct sock *fibnl; struct sock **icmp_sk; struct sock *mc_autojoin_sk; struct inet_peer_base *peers; struct sock **tcp_sk; struct netns_frags frags; struct xt_table *iptable_filter; struct xt_table *iptable_mangle; struct xt_table *iptable_raw; struct xt_table *arptable_filter; struct xt_table *iptable_security; struct xt_table *nat_table; int sysctl_icmp_echo_ignore_all; int sysctl_icmp_echo_ignore_broadcasts; int sysctl_icmp_ignore_bogus_error_responses; int sysctl_icmp_ratelimit; int sysctl_icmp_ratemask; int sysctl_icmp_errors_use_inbound_ifaddr; struct local_ports ip_local_ports; int sysctl_tcp_ecn; int sysctl_tcp_ecn_fallback; int sysctl_ip_no_pmtu_disc; int sysctl_ip_fwd_use_pmtu; int sysctl_ip_nonlocal_bind; int sysctl_fwmark_reflect; int sysctl_tcp_fwmark_accept; int sysctl_tcp_l3mdev_accept; int sysctl_tcp_mtu_probing; int sysctl_tcp_base_mss; int sysctl_tcp_probe_threshold; u32 sysctl_tcp_probe_interval; int sysctl_tcp_keepalive_time; int sysctl_tcp_keepalive_probes; int sysctl_tcp_keepalive_intvl; struct ping_group_range ping_group_range; atomic_t dev_addr_genid; unsigned long *sysctl_local_reserved_ports; struct list_head mr_tables; struct fib_rules_ops *mr_rules_ops; atomic_t rt_genid; } ;
120 struct neighbour ;
120 struct dst_ops { unsigned short family; unsigned int gc_thresh; int (*gc)(struct dst_ops *); struct dst_entry * (*check)(struct dst_entry *, __u32 ); unsigned int (*default_advmss)(const struct dst_entry *); unsigned int (*mtu)(const struct dst_entry *); 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 net *, struct sock *, struct sk_buff *); struct neighbour * (*neigh_lookup)(const struct dst_entry *, struct sk_buff *, const void *); struct kmem_cache *kmem_cachep; struct percpu_counter pcpuc_entries; } ;
73 struct netns_sysctl_ipv6 { struct ctl_table_header *hdr; struct ctl_table_header *route_hdr; struct ctl_table_header *icmp_hdr; struct ctl_table_header *frags_hdr; struct ctl_table_header *xfrm6_hdr; int bindv6only; int flush_delay; int ip6_rt_max_size; int ip6_rt_gc_min_interval; int ip6_rt_gc_timeout; int ip6_rt_gc_interval; int ip6_rt_gc_elasticity; int ip6_rt_mtu_expires; int ip6_rt_min_advmss; int flowlabel_consistency; int auto_flowlabels; int icmpv6_time; int anycast_src_echo_reply; int ip_nonlocal_bind; int fwmark_reflect; int idgen_retries; int idgen_delay; int flowlabel_state_ranges; } ;
40 struct ipv6_devconf ;
40 struct rt6_info ;
40 struct rt6_statistics ;
40 struct fib6_table ;
40 struct netns_ipv6 { struct netns_sysctl_ipv6 sysctl; struct ipv6_devconf *devconf_all; struct ipv6_devconf *devconf_dflt; struct inet_peer_base *peers; struct netns_frags frags; struct xt_table *ip6table_filter; struct xt_table *ip6table_mangle; struct xt_table *ip6table_raw; struct xt_table *ip6table_security; struct xt_table *ip6table_nat; struct rt6_info *ip6_null_entry; struct rt6_statistics *rt6_stats; struct timer_list ip6_fib_timer; struct hlist_head *fib_table_hash; struct fib6_table *fib6_main_tbl; struct dst_ops ip6_dst_ops; unsigned int ip6_rt_gc_expire; unsigned long ip6_rt_last_gc; struct rt6_info *ip6_prohibit_entry; struct rt6_info *ip6_blk_hole_entry; struct fib6_table *fib6_local_tbl; struct fib_rules_ops *fib6_rules_ops; struct sock **icmp_sk; struct sock *ndisc_sk; struct sock *tcp_sk; struct sock *igmp_sk; struct sock *mc_autojoin_sk; struct list_head mr6_tables; struct fib_rules_ops *mr6_rules_ops; atomic_t dev_addr_genid; atomic_t fib6_sernum; } ;
86 struct netns_nf_frag { struct netns_sysctl_ipv6 sysctl; struct netns_frags frags; } ;
92 struct netns_sysctl_lowpan { struct ctl_table_header *frags_hdr; } ;
14 struct netns_ieee802154_lowpan { struct netns_sysctl_lowpan sysctl; struct netns_frags frags; } ;
20 struct sctp_mib ;
21 struct netns_sctp { struct sctp_mib *sctp_statistics; struct proc_dir_entry *proc_net_sctp; struct ctl_table_header *sysctl_header; struct sock *ctl_sock; struct list_head local_addr_list; struct list_head addr_waitq; struct timer_list addr_wq_timer; struct list_head auto_asconf_splist; spinlock_t addr_wq_lock; spinlock_t local_addr_lock; unsigned int rto_initial; unsigned int rto_min; unsigned int rto_max; int rto_alpha; int rto_beta; int max_burst; int cookie_preserve_enable; char *sctp_hmac_alg; unsigned int valid_cookie_life; unsigned int sack_timeout; unsigned int hb_interval; int max_retrans_association; int max_retrans_path; int max_retrans_init; int pf_retrans; int pf_enable; 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; } ;
141 struct netns_dccp { struct sock *v4_ctl_sk; struct sock *v6_ctl_sk; } ;
79 struct nf_logger ;
80 struct netns_nf { struct proc_dir_entry *proc_netfilter; const struct nf_logger *nf_loggers[13U]; struct ctl_table_header *nf_log_dir_header; struct list_head hooks[13U][8U]; } ;
19 struct ebt_table ;
20 struct netns_xt { struct list_head tables[13U]; bool notrack_deprecated_warning; bool clusterip_deprecated_warning; struct ebt_table *broute_table; struct ebt_table *frame_filter; struct ebt_table *frame_nat; } ;
19 struct hlist_nulls_node ;
19 struct hlist_nulls_head { struct hlist_nulls_node *first; } ;
23 struct hlist_nulls_node { struct hlist_nulls_node *next; struct hlist_nulls_node **pprev; } ;
32 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; } ;
25 struct nf_generic_net { struct nf_proto_net pn; unsigned int timeout; } ;
30 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; } ;
44 struct nf_udp_net { struct nf_proto_net pn; unsigned int timeouts[2U]; } ;
49 struct nf_icmp_net { struct nf_proto_net pn; unsigned int timeout; } ;
54 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; } ;
65 struct ct_pcpu { spinlock_t lock; struct hlist_nulls_head unconfirmed; struct hlist_nulls_head dying; } ;
72 struct ip_conntrack_stat ;
72 struct nf_ct_event_notifier ;
72 struct nf_exp_event_notifier ;
72 struct netns_ct { atomic_t count; unsigned int expect_count; struct delayed_work ecache_dwork; bool ecache_dwork_pending; struct ctl_table_header *sysctl_header; struct ctl_table_header *acct_sysctl_header; struct ctl_table_header *tstamp_sysctl_header; struct ctl_table_header *event_sysctl_header; struct ctl_table_header *helper_sysctl_header; char *slabname; unsigned int sysctl_log_invalid; int sysctl_events; int sysctl_acct; int sysctl_auto_assign_helper; bool auto_assign_helper_warned; int sysctl_tstamp; int sysctl_checksum; unsigned int htable_size; seqcount_t generation; struct kmem_cache *nf_conntrack_cachep; struct hlist_nulls_head *hash; struct hlist_head *expect_hash; struct ct_pcpu *pcpu_lists; struct ip_conntrack_stat *stat; struct nf_ct_event_notifier *nf_conntrack_event_cb; struct nf_exp_event_notifier *nf_expect_event_cb; struct nf_ip_net nf_ct_proto; unsigned int labels_used; u8 label_words; struct hlist_head *nat_bysource; unsigned int nat_htable_size; } ;
114 struct nft_af_info ;
115 struct netns_nftables { struct list_head af_info; struct list_head commit_list; struct nft_af_info *ipv4; struct nft_af_info *ipv6; struct nft_af_info *inet; struct nft_af_info *arp; struct nft_af_info *bridge; struct nft_af_info *netdev; unsigned int base_seq; u8 gencursor; } ;
508 struct flow_cache_percpu { struct hlist_head *hash_table; int hash_count; u32 hash_rnd; int hash_rnd_recalc; struct tasklet_struct flush_tasklet; } ;
16 struct flow_cache { u32 hash_shift; struct flow_cache_percpu *percpu; struct notifier_block hotcpu_notifier; int low_watermark; int high_watermark; struct timer_list rnd_timer; } ;
25 struct xfrm_policy_hash { struct hlist_head *table; unsigned int hmask; u8 dbits4; u8 sbits4; u8 dbits6; u8 sbits6; } ;
21 struct xfrm_policy_hthresh { struct work_struct work; seqlock_t lock; u8 lbits4; u8 rbits4; u8 lbits6; u8 rbits6; } ;
30 struct netns_xfrm { struct list_head state_all; struct hlist_head *state_bydst; struct hlist_head *state_bysrc; struct hlist_head *state_byspi; unsigned int state_hmask; unsigned int state_num; struct work_struct state_hash_work; struct hlist_head state_gc_list; struct work_struct state_gc_work; struct list_head policy_all; struct hlist_head *policy_byidx; unsigned int policy_idx_hmask; struct hlist_head policy_inexact[3U]; struct xfrm_policy_hash policy_bydst[3U]; unsigned int policy_count[6U]; struct work_struct policy_hash_work; struct xfrm_policy_hthresh policy_hthresh; struct sock *nlsk; struct sock *nlsk_stash; u32 sysctl_aevent_etime; u32 sysctl_aevent_rseqth; int sysctl_larval_drop; u32 sysctl_acq_expires; struct ctl_table_header *sysctl_hdr; struct dst_ops xfrm4_dst_ops; struct dst_ops xfrm6_dst_ops; spinlock_t xfrm_state_lock; rwlock_t xfrm_policy_lock; struct mutex xfrm_cfg_mutex; struct flow_cache flow_cache_global; atomic_t flow_cache_genid; struct list_head flow_cache_gc_list; spinlock_t flow_cache_gc_lock; struct work_struct flow_cache_gc_work; struct work_struct flow_cache_flush_work; struct mutex flow_flush_sem; } ;
88 struct mpls_route ;
89 struct netns_mpls { size_t platform_labels; struct mpls_route **platform_label; struct ctl_table_header *ctl; } ;
16 struct net_generic ;
17 struct netns_ipvs ;
18 struct net { atomic_t passive; atomic_t count; spinlock_t rules_mod_lock; atomic64_t cookie_gen; struct list_head list; struct list_head cleanup_list; struct list_head exit_list; struct user_namespace *user_ns; spinlock_t nsid_lock; struct idr netns_ids; struct ns_common ns; struct proc_dir_entry *proc_net; struct proc_dir_entry *proc_net_stat; struct ctl_table_set sysctls; struct sock *rtnl; struct sock *genl_sock; struct list_head dev_base_head; struct hlist_head *dev_name_head; struct hlist_head *dev_index_head; unsigned int dev_base_seq; int ifindex; unsigned int dev_unreg_count; struct list_head rules_ops; struct net_device *loopback_dev; struct netns_core core; struct netns_mib mib; struct netns_packet packet; struct netns_unix unx; struct netns_ipv4 ipv4; struct netns_ipv6 ipv6; struct netns_ieee802154_lowpan ieee802154_lowpan; struct netns_sctp sctp; struct netns_dccp dccp; struct netns_nf nf; struct netns_xt xt; struct netns_ct ct; struct netns_nftables nft; struct netns_nf_frag nf_frag; struct sock *nfnl; struct sock *nfnl_stash; struct list_head nfnl_acct_list; struct list_head nfct_timeout_list; struct sk_buff_head wext_nlevents; struct net_generic *gen; struct netns_xfrm xfrm; struct netns_ipvs *ipvs; struct netns_mpls mpls; struct sock *diag_nlsk; atomic_t fnhe_genid; } ;
247 struct __anonstruct_possible_net_t_407 { struct net *net; } ;
247 typedef struct __anonstruct_possible_net_t_407 possible_net_t;
382 enum fwnode_type { FWNODE_INVALID = 0, FWNODE_OF = 1, FWNODE_ACPI = 2, FWNODE_ACPI_DATA = 3, FWNODE_PDATA = 4, FWNODE_IRQCHIP = 5 } ;
391 struct fwnode_handle { enum fwnode_type type; struct fwnode_handle *secondary; } ;
32 typedef u32 phandle;
34 struct property { char *name; int length; void *value; struct property *next; unsigned long _flags; unsigned int unique_id; struct bin_attribute attr; } ;
44 struct device_node { const char *name; const char *type; phandle phandle; const char *full_name; struct fwnode_handle fwnode; struct property *properties; struct property *deadprops; struct device_node *parent; struct device_node *child; struct device_node *sibling; struct kobject kobj; unsigned long _flags; void *data; } ;
51 struct irq_fwspec { struct fwnode_handle *fwnode; int param_count; u32 param[16U]; } ;
63 enum irq_domain_bus_token { DOMAIN_BUS_ANY = 0, DOMAIN_BUS_PCI_MSI = 1, DOMAIN_BUS_PLATFORM_MSI = 2, DOMAIN_BUS_NEXUS = 3 } ;
70 struct irq_domain_ops { int (*match)(struct irq_domain *, struct device_node *, enum irq_domain_bus_token ); int (*map)(struct irq_domain *, unsigned int, irq_hw_number_t ); void (*unmap)(struct irq_domain *, unsigned int); int (*xlate)(struct irq_domain *, struct device_node *, const u32 *, unsigned int, unsigned long *, unsigned int *); int (*alloc)(struct irq_domain *, unsigned int, unsigned int, void *); void (*free)(struct irq_domain *, unsigned int, unsigned int); void (*activate)(struct irq_domain *, struct irq_data *); void (*deactivate)(struct irq_domain *, struct irq_data *); int (*translate)(struct irq_domain *, struct irq_fwspec *, unsigned long *, unsigned int *); } ;
116 struct irq_domain { struct list_head link; const char *name; const struct irq_domain_ops *ops; void *host_data; unsigned int flags; struct fwnode_handle *fwnode; enum irq_domain_bus_token bus_token; struct irq_domain_chip_generic *gc; struct irq_domain *parent; irq_hw_number_t hwirq_max; unsigned int revmap_direct_max_irq; unsigned int revmap_size; struct radix_tree_root revmap_tree; unsigned int linear_revmap[]; } ;
178 struct gpio_desc ;
296 struct mii_bus ;
297 struct mdio_device { struct device dev; const struct dev_pm_ops *pm_ops; struct mii_bus *bus; int (*bus_match)(struct device *, struct device_driver *); void (*device_free)(struct mdio_device *); void (*device_remove)(struct mdio_device *); int addr; int flags; } ;
30 struct mdio_driver_common { struct device_driver driver; int flags; } ;
233 struct phy_device ;
234 enum ldv_30991 { PHY_INTERFACE_MODE_NA = 0, PHY_INTERFACE_MODE_MII = 1, PHY_INTERFACE_MODE_GMII = 2, PHY_INTERFACE_MODE_SGMII = 3, PHY_INTERFACE_MODE_TBI = 4, PHY_INTERFACE_MODE_REVMII = 5, PHY_INTERFACE_MODE_RMII = 6, PHY_INTERFACE_MODE_RGMII = 7, PHY_INTERFACE_MODE_RGMII_ID = 8, PHY_INTERFACE_MODE_RGMII_RXID = 9, PHY_INTERFACE_MODE_RGMII_TXID = 10, PHY_INTERFACE_MODE_RTBI = 11, PHY_INTERFACE_MODE_SMII = 12, PHY_INTERFACE_MODE_XGMII = 13, PHY_INTERFACE_MODE_MOCA = 14, PHY_INTERFACE_MODE_QSGMII = 15, PHY_INTERFACE_MODE_MAX = 16 } ;
84 typedef enum ldv_30991 phy_interface_t;
130 enum ldv_31042 { MDIOBUS_ALLOCATED = 1, MDIOBUS_REGISTERED = 2, MDIOBUS_UNREGISTERED = 3, MDIOBUS_RELEASED = 4 } ;
137 struct mii_bus { struct module *owner; const char *name; char id[17U]; void *priv; int (*read)(struct mii_bus *, int, int); int (*write)(struct mii_bus *, int, int, u16 ); int (*reset)(struct mii_bus *); struct mutex mdio_lock; struct device *parent; enum ldv_31042 state; struct device dev; struct mdio_device *mdio_map[32U]; u32 phy_mask; u32 phy_ignore_ta_mask; int irq[32U]; } ;
218 enum phy_state { PHY_DOWN = 0, PHY_STARTING = 1, PHY_READY = 2, PHY_PENDING = 3, PHY_UP = 4, PHY_AN = 5, PHY_RUNNING = 6, PHY_NOLINK = 7, PHY_FORCING = 8, PHY_CHANGELINK = 9, PHY_HALTED = 10, PHY_RESUMING = 11 } ;
233 struct phy_c45_device_ids { u32 devices_in_package; u32 device_ids[8U]; } ;
326 struct phy_driver ;
326 struct phy_device { struct mdio_device mdio; struct phy_driver *drv; u32 phy_id; struct phy_c45_device_ids c45_ids; bool is_c45; bool is_internal; bool is_pseudo_fixed_link; bool has_fixups; bool suspended; enum phy_state state; u32 dev_flags; phy_interface_t interface; int speed; int duplex; int pause; int asym_pause; int link; u32 interrupts; u32 supported; u32 advertising; u32 lp_advertising; int autoneg; int link_timeout; int irq; void *priv; struct work_struct phy_queue; struct delayed_work state_queue; atomic_t irq_disable; struct mutex lock; struct net_device *attached_dev; u8 mdix; void (*adjust_link)(struct net_device *); } ;
431 struct phy_driver { struct mdio_driver_common mdiodrv; u32 phy_id; char *name; unsigned int phy_id_mask; u32 features; u32 flags; const void *driver_data; int (*soft_reset)(struct phy_device *); int (*config_init)(struct phy_device *); int (*probe)(struct phy_device *); int (*suspend)(struct phy_device *); int (*resume)(struct phy_device *); int (*config_aneg)(struct phy_device *); int (*aneg_done)(struct phy_device *); int (*read_status)(struct phy_device *); int (*ack_interrupt)(struct phy_device *); int (*config_intr)(struct phy_device *); int (*did_interrupt)(struct phy_device *); void (*remove)(struct phy_device *); int (*match_phy_device)(struct phy_device *); int (*ts_info)(struct phy_device *, struct ethtool_ts_info *); int (*hwtstamp)(struct phy_device *, struct ifreq *); bool (*rxtstamp)(struct phy_device *, struct sk_buff *, int); void (*txtstamp)(struct phy_device *, struct sk_buff *, int); int (*set_wol)(struct phy_device *, struct ethtool_wolinfo *); void (*get_wol)(struct phy_device *, struct ethtool_wolinfo *); void (*link_change_notify)(struct phy_device *); int (*read_mmd_indirect)(struct phy_device *, int, int, int); void (*write_mmd_indirect)(struct phy_device *, int, int, int, u32 ); int (*module_info)(struct phy_device *, struct ethtool_modinfo *); int (*module_eeprom)(struct phy_device *, struct ethtool_eeprom *, u8 *); int (*get_sset_count)(struct phy_device *); void (*get_strings)(struct phy_device *, u8 *); void (*get_stats)(struct phy_device *, struct ethtool_stats *, u64 *); } ;
836 struct fixed_phy_status { int link; int speed; int duplex; int pause; int asym_pause; } ;
27 enum dsa_tag_protocol { DSA_TAG_PROTO_NONE = 0, DSA_TAG_PROTO_DSA = 1, DSA_TAG_PROTO_TRAILER = 2, DSA_TAG_PROTO_EDSA = 3, DSA_TAG_PROTO_BRCM = 4 } ;
35 struct dsa_chip_data { struct device *host_dev; int sw_addr; int eeprom_len; struct device_node *of_node; char *port_names[12U]; struct device_node *port_dn[12U]; s8 *rtable; struct gpio_desc *reset; } ;
76 struct dsa_platform_data { struct device *netdev; struct net_device *of_netdev; int nr_chips; struct dsa_chip_data *chip; } ;
92 struct packet_type ;
93 struct dsa_switch ;
93 struct dsa_switch_tree { struct dsa_platform_data *pd; struct net_device *master_netdev; int (*rcv)(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); enum dsa_tag_protocol tag_protocol; s8 cpu_switch; s8 cpu_port; struct dsa_switch *ds[4U]; } ;
124 struct dsa_switch_driver ;
124 struct dsa_switch { struct dsa_switch_tree *dst; int index; enum dsa_tag_protocol tag_protocol; struct dsa_chip_data *pd; struct dsa_switch_driver *drv; struct device *master_dev; char hwmon_name[24U]; struct device *hwmon_dev; u32 dsa_port_mask; u32 phys_port_mask; u32 phys_mii_mask; struct mii_bus *slave_mii_bus; struct net_device *ports[12U]; } ;
200 struct switchdev_trans ;
201 struct switchdev_obj ;
202 struct switchdev_obj_port_fdb ;
203 struct switchdev_obj_port_vlan ;
204 struct dsa_switch_driver { struct list_head list; enum dsa_tag_protocol tag_protocol; int priv_size; char * (*probe)(struct device *, int); int (*setup)(struct dsa_switch *); int (*set_addr)(struct dsa_switch *, u8 *); u32 (*get_phy_flags)(struct dsa_switch *, int); int (*phy_read)(struct dsa_switch *, int, int); int (*phy_write)(struct dsa_switch *, int, int, u16 ); void (*adjust_link)(struct dsa_switch *, int, struct phy_device *); void (*fixed_link_update)(struct dsa_switch *, int, struct fixed_phy_status *); void (*get_strings)(struct dsa_switch *, int, uint8_t *); void (*get_ethtool_stats)(struct dsa_switch *, int, uint64_t *); int (*get_sset_count)(struct dsa_switch *); void (*get_wol)(struct dsa_switch *, int, struct ethtool_wolinfo *); int (*set_wol)(struct dsa_switch *, int, struct ethtool_wolinfo *); int (*suspend)(struct dsa_switch *); int (*resume)(struct dsa_switch *); int (*port_enable)(struct dsa_switch *, int, struct phy_device *); void (*port_disable)(struct dsa_switch *, int, struct phy_device *); int (*set_eee)(struct dsa_switch *, int, struct phy_device *, struct ethtool_eee *); int (*get_eee)(struct dsa_switch *, int, struct ethtool_eee *); int (*get_temp)(struct dsa_switch *, int *); int (*get_temp_limit)(struct dsa_switch *, int *); int (*set_temp_limit)(struct dsa_switch *, int); int (*get_temp_alarm)(struct dsa_switch *, bool *); int (*get_eeprom_len)(struct dsa_switch *); int (*get_eeprom)(struct dsa_switch *, struct ethtool_eeprom *, u8 *); int (*set_eeprom)(struct dsa_switch *, struct ethtool_eeprom *, u8 *); int (*get_regs_len)(struct dsa_switch *, int); void (*get_regs)(struct dsa_switch *, int, struct ethtool_regs *, void *); int (*port_join_bridge)(struct dsa_switch *, int, u32 ); int (*port_leave_bridge)(struct dsa_switch *, int, u32 ); int (*port_stp_update)(struct dsa_switch *, int, u8 ); int (*port_vlan_prepare)(struct dsa_switch *, int, const struct switchdev_obj_port_vlan *, struct switchdev_trans *); int (*port_vlan_add)(struct dsa_switch *, int, const struct switchdev_obj_port_vlan *, struct switchdev_trans *); int (*port_vlan_del)(struct dsa_switch *, int, const struct switchdev_obj_port_vlan *); int (*port_pvid_get)(struct dsa_switch *, int, u16 *); int (*vlan_getnext)(struct dsa_switch *, u16 *, unsigned long *, unsigned long *); int (*port_fdb_prepare)(struct dsa_switch *, int, const struct switchdev_obj_port_fdb *, struct switchdev_trans *); int (*port_fdb_add)(struct dsa_switch *, int, const struct switchdev_obj_port_fdb *, struct switchdev_trans *); int (*port_fdb_del)(struct dsa_switch *, int, const struct switchdev_obj_port_fdb *); int (*port_fdb_dump)(struct dsa_switch *, int, struct switchdev_obj_port_fdb *, int (*)(struct switchdev_obj *)); } ;
350 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]; } ;
69 struct ieee_maxrate { __u64 tc_maxrate[8U]; } ;
87 struct ieee_qcn { __u8 rpg_enable[8U]; __u32 rppp_max_rps[8U]; __u32 rpg_time_reset[8U]; __u32 rpg_byte_reset[8U]; __u32 rpg_threshold[8U]; __u32 rpg_max_rate[8U]; __u32 rpg_ai_rate[8U]; __u32 rpg_hai_rate[8U]; __u32 rpg_gd[8U]; __u32 rpg_min_dec_fac[8U]; __u32 rpg_min_rate[8U]; __u32 cndd_state_machine[8U]; } ;
132 struct ieee_qcn_stats { __u64 rppp_rp_centiseconds[8U]; __u32 rppp_created_rps[8U]; } ;
144 struct ieee_pfc { __u8 pfc_cap; __u8 pfc_en; __u8 mbc; __u16 delay; __u64 requests[8U]; __u64 indications[8U]; } ;
164 struct cee_pg { __u8 willing; __u8 error; __u8 pg_en; __u8 tcs_supported; __u8 pg_bw[8U]; __u8 prio_pg[8U]; } ;
187 struct cee_pfc { __u8 willing; __u8 error; __u8 pfc_en; __u8 tcs_supported; } ;
202 struct dcb_app { __u8 selector; __u8 priority; __u16 protocol; } ;
236 struct dcb_peer_app_info { __u8 willing; __u8 error; } ;
40 struct dcbnl_rtnl_ops { int (*ieee_getets)(struct net_device *, struct ieee_ets *); int (*ieee_setets)(struct net_device *, struct ieee_ets *); int (*ieee_getmaxrate)(struct net_device *, struct ieee_maxrate *); int (*ieee_setmaxrate)(struct net_device *, struct ieee_maxrate *); int (*ieee_getqcn)(struct net_device *, struct ieee_qcn *); int (*ieee_setqcn)(struct net_device *, struct ieee_qcn *); int (*ieee_getqcnstats)(struct net_device *, struct ieee_qcn_stats *); int (*ieee_getpfc)(struct net_device *, struct ieee_pfc *); int (*ieee_setpfc)(struct net_device *, struct ieee_pfc *); int (*ieee_getapp)(struct net_device *, struct dcb_app *); int (*ieee_setapp)(struct net_device *, struct dcb_app *); int (*ieee_delapp)(struct net_device *, struct dcb_app *); int (*ieee_peer_getets)(struct net_device *, struct ieee_ets *); int (*ieee_peer_getpfc)(struct net_device *, struct ieee_pfc *); u8 (*getstate)(struct net_device *); u8 (*setstate)(struct net_device *, u8 ); void (*getpermhwaddr)(struct net_device *, u8 *); void (*setpgtccfgtx)(struct net_device *, int, u8 , u8 , u8 , u8 ); void (*setpgbwgcfgtx)(struct net_device *, int, u8 ); void (*setpgtccfgrx)(struct net_device *, int, u8 , u8 , u8 , u8 ); void (*setpgbwgcfgrx)(struct net_device *, int, u8 ); void (*getpgtccfgtx)(struct net_device *, int, u8 *, u8 *, u8 *, u8 *); void (*getpgbwgcfgtx)(struct net_device *, int, u8 *); void (*getpgtccfgrx)(struct net_device *, int, u8 *, u8 *, u8 *, u8 *); void (*getpgbwgcfgrx)(struct net_device *, int, u8 *); void (*setpfccfg)(struct net_device *, int, u8 ); void (*getpfccfg)(struct net_device *, int, u8 *); u8 (*setall)(struct net_device *); u8 (*getcap)(struct net_device *, int, u8 *); int (*getnumtcs)(struct net_device *, int, u8 *); int (*setnumtcs)(struct net_device *, int, u8 ); u8 (*getpfcstate)(struct net_device *); void (*setpfcstate)(struct net_device *, u8 ); void (*getbcncfg)(struct net_device *, int, u32 *); void (*setbcncfg)(struct net_device *, int, u32 ); void (*getbcnrp)(struct net_device *, int, u8 *); void (*setbcnrp)(struct net_device *, int, u8 ); int (*setapp)(struct net_device *, u8 , u16 , u8 ); int (*getapp)(struct net_device *, u8 , u16 ); u8 (*getfeatcfg)(struct net_device *, int, u8 *); u8 (*setfeatcfg)(struct net_device *, int, u8 ); u8 (*getdcbx)(struct net_device *); u8 (*setdcbx)(struct net_device *, u8 ); int (*peer_getappinfo)(struct net_device *, struct dcb_peer_app_info *, u16 *); int (*peer_getapptable)(struct net_device *, struct dcb_app *); int (*cee_peer_getpg)(struct net_device *, struct cee_pg *); int (*cee_peer_getpfc)(struct net_device *, struct cee_pfc *); } ;
105 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; } ;
603 struct netprio_map { struct callback_head rcu; u32 priomap_len; u32 priomap[]; } ;
41 struct nlmsghdr { __u32 nlmsg_len; __u16 nlmsg_type; __u16 nlmsg_flags; __u32 nlmsg_seq; __u32 nlmsg_pid; } ;
149 struct nlattr { __u16 nla_len; __u16 nla_type; } ;
115 struct netlink_callback { struct sk_buff *skb; const struct nlmsghdr *nlh; int (*start)(struct netlink_callback *); 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]; } ;
193 struct ndmsg { __u8 ndm_family; __u8 ndm_pad1; __u16 ndm_pad2; __s32 ndm_ifindex; __u16 ndm_state; __u8 ndm_flags; __u8 ndm_type; } ;
39 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; } ;
719 struct ifla_vf_stats { __u64 rx_packets; __u64 tx_packets; __u64 rx_bytes; __u64 tx_bytes; __u64 broadcast; __u64 multicast; } ;
16 struct ifla_vf_info { __u32 vf; __u8 mac[32U]; __u32 vlan; __u32 qos; __u32 spoofchk; __u32 linkstate; __u32 min_tx_rate; __u32 max_tx_rate; __u32 rss_query_en; __u32 trusted; } ;
118 struct netpoll_info ;
119 struct wireless_dev ;
120 struct wpan_dev ;
121 struct mpls_dev ;
65 enum netdev_tx { __NETDEV_TX_MIN = -2147483648, NETDEV_TX_OK = 0, NETDEV_TX_BUSY = 16, NETDEV_TX_LOCKED = 32 } ;
110 typedef enum netdev_tx netdev_tx_t;
129 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; } ;
192 struct neigh_parms ;
213 struct netdev_hw_addr_list { struct list_head list; int count; } ;
218 struct hh_cache { u16 hh_len; u16 __pad; seqlock_t hh_lock; unsigned long hh_data[16U]; } ;
247 struct header_ops { int (*create)(struct sk_buff *, struct net_device *, unsigned short, const void *, const void *, unsigned int); int (*parse)(const struct sk_buff *, unsigned char *); int (*cache)(const struct neighbour *, struct hh_cache *, __be16 ); void (*cache_update)(struct hh_cache *, const struct net_device *, const unsigned char *); } ;
297 struct napi_struct { struct list_head poll_list; unsigned long state; int weight; unsigned int gro_count; int (*poll)(struct napi_struct *, int); spinlock_t poll_lock; int poll_owner; struct net_device *dev; struct sk_buff *gro_list; struct sk_buff *skb; struct hrtimer timer; struct list_head dev_list; struct hlist_node napi_hash_node; unsigned int napi_id; } ;
343 enum rx_handler_result { RX_HANDLER_CONSUMED = 0, RX_HANDLER_ANOTHER = 1, RX_HANDLER_EXACT = 2, RX_HANDLER_PASS = 3 } ;
391 typedef enum rx_handler_result rx_handler_result_t;
392 typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **);
540 struct Qdisc ;
540 struct netdev_queue { struct net_device *dev; struct Qdisc *qdisc; struct Qdisc *qdisc_sleeping; struct kobject kobj; int numa_node; spinlock_t _xmit_lock; int xmit_lock_owner; unsigned long trans_start; unsigned long trans_timeout; unsigned long state; struct dql dql; unsigned long tx_maxrate; } ;
610 struct rps_map { unsigned int len; struct callback_head rcu; u16 cpus[0U]; } ;
622 struct rps_dev_flow { u16 cpu; u16 filter; unsigned int last_qtail; } ;
634 struct rps_dev_flow_table { unsigned int mask; struct callback_head rcu; struct rps_dev_flow flows[0U]; } ;
686 struct netdev_rx_queue { struct rps_map *rps_map; struct rps_dev_flow_table *rps_flow_table; struct kobject kobj; struct net_device *dev; } ;
709 struct xps_map { unsigned int len; unsigned int alloc_len; struct callback_head rcu; u16 queues[0U]; } ;
722 struct xps_dev_maps { struct callback_head rcu; struct xps_map *cpu_map[0U]; } ;
733 struct netdev_tc_txq { u16 count; u16 offset; } ;
744 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]; } ;
760 struct netdev_phys_item_id { unsigned char id[32U]; unsigned char id_len; } ;
780 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 *); netdev_features_t (*ndo_features_check)(struct sk_buff *, struct net_device *, netdev_features_t ); u16 (*ndo_select_queue)(struct net_device *, struct sk_buff *, void *, u16 (*)(struct net_device *, struct sk_buff *)); void (*ndo_change_rx_flags)(struct net_device *, int); void (*ndo_set_rx_mode)(struct net_device *); int (*ndo_set_mac_address)(struct net_device *, void *); int (*ndo_validate_addr)(struct net_device *); int (*ndo_do_ioctl)(struct net_device *, struct ifreq *, int); int (*ndo_set_config)(struct net_device *, struct ifmap *); int (*ndo_change_mtu)(struct net_device *, int); int (*ndo_neigh_setup)(struct net_device *, struct neigh_parms *); void (*ndo_tx_timeout)(struct net_device *); struct rtnl_link_stats64 * (*ndo_get_stats64)(struct net_device *, struct rtnl_link_stats64 *); struct net_device_stats * (*ndo_get_stats)(struct net_device *); int (*ndo_vlan_rx_add_vid)(struct net_device *, __be16 , u16 ); int (*ndo_vlan_rx_kill_vid)(struct net_device *, __be16 , u16 ); void (*ndo_poll_controller)(struct net_device *); int (*ndo_netpoll_setup)(struct net_device *, struct netpoll_info *); void (*ndo_netpoll_cleanup)(struct net_device *); int (*ndo_busy_poll)(struct napi_struct *); int (*ndo_set_vf_mac)(struct net_device *, int, u8 *); int (*ndo_set_vf_vlan)(struct net_device *, int, u16 , u8 ); int (*ndo_set_vf_rate)(struct net_device *, int, int, int); int (*ndo_set_vf_spoofchk)(struct net_device *, int, bool ); int (*ndo_set_vf_trust)(struct net_device *, int, bool ); int (*ndo_get_vf_config)(struct net_device *, int, struct ifla_vf_info *); int (*ndo_set_vf_link_state)(struct net_device *, int, int); int (*ndo_get_vf_stats)(struct net_device *, int, struct ifla_vf_stats *); int (*ndo_set_vf_port)(struct net_device *, int, struct nlattr **); int (*ndo_get_vf_port)(struct net_device *, int, struct sk_buff *); int (*ndo_set_vf_rss_query_en)(struct net_device *, int, bool ); int (*ndo_setup_tc)(struct net_device *, u8 ); int (*ndo_fcoe_enable)(struct net_device *); int (*ndo_fcoe_disable)(struct net_device *); int (*ndo_fcoe_ddp_setup)(struct net_device *, u16 , struct scatterlist *, unsigned int); int (*ndo_fcoe_ddp_done)(struct net_device *, u16 ); int (*ndo_fcoe_ddp_target)(struct net_device *, u16 , struct scatterlist *, unsigned int); int (*ndo_fcoe_get_hbainfo)(struct net_device *, struct netdev_fcoe_hbainfo *); int (*ndo_fcoe_get_wwn)(struct net_device *, u64 *, int); int (*ndo_rx_flow_steer)(struct net_device *, const struct sk_buff *, 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 *, const unsigned char *, u16 , u16 ); int (*ndo_fdb_del)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, u16 ); int (*ndo_fdb_dump)(struct sk_buff *, struct netlink_callback *, struct net_device *, struct net_device *, int); int (*ndo_bridge_setlink)(struct net_device *, struct nlmsghdr *, u16 ); int (*ndo_bridge_getlink)(struct sk_buff *, u32 , u32 , struct net_device *, u32 , int); int (*ndo_bridge_dellink)(struct net_device *, struct nlmsghdr *, u16 ); int (*ndo_change_carrier)(struct net_device *, bool ); int (*ndo_get_phys_port_id)(struct net_device *, struct netdev_phys_item_id *); int (*ndo_get_phys_port_name)(struct net_device *, char *, size_t ); void (*ndo_add_vxlan_port)(struct net_device *, sa_family_t , __be16 ); void (*ndo_del_vxlan_port)(struct net_device *, sa_family_t , __be16 ); void (*ndo_add_geneve_port)(struct net_device *, sa_family_t , __be16 ); void (*ndo_del_geneve_port)(struct net_device *, sa_family_t , __be16 ); void * (*ndo_dfwd_add_station)(struct net_device *, struct net_device *); void (*ndo_dfwd_del_station)(struct net_device *, void *); netdev_tx_t (*ndo_dfwd_start_xmit)(struct sk_buff *, struct net_device *, void *); int (*ndo_get_lock_subclass)(struct net_device *); int (*ndo_set_tx_maxrate)(struct net_device *, int, u32 ); int (*ndo_get_iflink)(const struct net_device *); int (*ndo_change_proto_down)(struct net_device *, bool ); int (*ndo_fill_metadata_dst)(struct net_device *, struct sk_buff *); } ;
1301 struct __anonstruct_adj_list_421 { struct list_head upper; struct list_head lower; } ;
1301 struct __anonstruct_all_adj_list_422 { struct list_head upper; struct list_head lower; } ;
1301 struct iw_handler_def ;
1301 struct iw_public_data ;
1301 struct switchdev_ops ;
1301 struct l3mdev_ops ;
1301 struct vlan_info ;
1301 struct tipc_bearer ;
1301 struct in_device ;
1301 struct dn_dev ;
1301 struct inet6_dev ;
1301 struct tcf_proto ;
1301 struct cpu_rmap ;
1301 struct pcpu_lstats ;
1301 struct pcpu_sw_netstats ;
1301 struct pcpu_dstats ;
1301 struct pcpu_vstats ;
1301 union __anonunion____missing_field_name_423 { void *ml_priv; struct pcpu_lstats *lstats; struct pcpu_sw_netstats *tstats; struct pcpu_dstats *dstats; struct pcpu_vstats *vstats; } ;
1301 struct garp_port ;
1301 struct mrp_port ;
1301 struct rtnl_link_ops ;
1301 struct net_device { char name[16U]; struct hlist_node name_hlist; char *ifalias; unsigned long mem_end; unsigned long mem_start; unsigned long base_addr; int irq; atomic_t carrier_changes; unsigned long state; struct list_head dev_list; struct list_head napi_list; struct list_head unreg_list; struct list_head close_list; struct list_head ptype_all; struct list_head ptype_specific; struct __anonstruct_adj_list_421 adj_list; struct __anonstruct_all_adj_list_422 all_adj_list; netdev_features_t features; netdev_features_t hw_features; netdev_features_t wanted_features; netdev_features_t vlan_features; netdev_features_t hw_enc_features; netdev_features_t mpls_features; int ifindex; int group; struct net_device_stats stats; atomic_long_t rx_dropped; atomic_long_t tx_dropped; const struct iw_handler_def *wireless_handlers; struct iw_public_data *wireless_data; const struct net_device_ops *netdev_ops; const struct ethtool_ops *ethtool_ops; const struct switchdev_ops *switchdev_ops; const struct l3mdev_ops *l3mdev_ops; const struct header_ops *header_ops; unsigned int flags; unsigned int priv_flags; unsigned short gflags; unsigned short padded; unsigned char operstate; unsigned char link_mode; unsigned char if_port; unsigned char dma; unsigned int mtu; unsigned short type; unsigned short hard_header_len; unsigned short needed_headroom; unsigned short needed_tailroom; unsigned char perm_addr[32U]; unsigned char addr_assign_type; unsigned char addr_len; unsigned short neigh_priv_len; unsigned short dev_id; unsigned short dev_port; spinlock_t addr_list_lock; unsigned char name_assign_type; bool uc_promisc; struct netdev_hw_addr_list uc; struct netdev_hw_addr_list mc; struct netdev_hw_addr_list dev_addrs; struct kset *queues_kset; unsigned int promiscuity; unsigned int allmulti; struct vlan_info *vlan_info; struct dsa_switch_tree *dsa_ptr; struct tipc_bearer *tipc_ptr; void *atalk_ptr; struct in_device *ip_ptr; struct dn_dev *dn_ptr; struct inet6_dev *ip6_ptr; void *ax25_ptr; struct wireless_dev *ieee80211_ptr; struct wpan_dev *ieee802154_ptr; struct mpls_dev *mpls_ptr; unsigned long last_rx; unsigned char *dev_addr; struct netdev_rx_queue *_rx; unsigned int num_rx_queues; unsigned int real_num_rx_queues; unsigned long gro_flush_timeout; rx_handler_func_t *rx_handler; void *rx_handler_data; struct tcf_proto *ingress_cl_list; struct netdev_queue *ingress_queue; struct list_head nf_hooks_ingress; unsigned char broadcast[32U]; struct cpu_rmap *rx_cpu_rmap; struct hlist_node index_hlist; struct netdev_queue *_tx; unsigned int num_tx_queues; unsigned int real_num_tx_queues; struct Qdisc *qdisc; unsigned long tx_queue_len; spinlock_t tx_global_lock; int watchdog_timeo; struct xps_dev_maps *xps_maps; struct tcf_proto *egress_cl_list; u32 offload_fwd_mark; unsigned long trans_start; struct timer_list watchdog_timer; int *pcpu_refcnt; struct list_head todo_list; struct list_head link_watch_list; unsigned char reg_state; bool dismantle; unsigned short rtnl_link_state; void (*destructor)(struct net_device *); struct netpoll_info *npinfo; possible_net_t nd_net; union __anonunion____missing_field_name_423 __annonCompField104; struct garp_port *garp_port; struct mrp_port *mrp_port; struct device dev; const struct attribute_group *sysfs_groups[4U]; const struct attribute_group *sysfs_rx_queue_group; const struct rtnl_link_ops *rtnl_link_ops; unsigned int gso_max_size; u16 gso_max_segs; u16 gso_min_segs; const struct dcbnl_rtnl_ops *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; bool proto_down; } ;
2060 struct packet_type { __be16 type; struct net_device *dev; int (*func)(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); bool (*id_match)(struct packet_type *, struct sock *); void *af_packet_priv; struct list_head list; } ;
2107 struct pcpu_sw_netstats { u64 rx_packets; u64 rx_bytes; u64 tx_packets; u64 tx_bytes; struct u64_stats_sync syncp; } ;
313 struct hdlc_proto { int (*open)(struct net_device *); void (*close)(struct net_device *); void (*start)(struct net_device *); void (*stop)(struct net_device *); void (*detach)(struct net_device *); int (*ioctl)(struct net_device *, struct ifreq *); __be16 (*type_trans)(struct sk_buff *, struct net_device *); int (*netif_rx)(struct sk_buff *); netdev_tx_t (*xmit)(struct sk_buff *, struct net_device *); struct module *module; struct hdlc_proto *next; } ;
35 struct hdlc_device { int (*attach)(struct net_device *, unsigned short, unsigned short); netdev_tx_t (*xmit)(struct sk_buff *, struct net_device *); const struct hdlc_proto *proto; int carrier; int open; spinlock_t state_lock; void *state; void *priv; } ;
53 typedef struct hdlc_device hdlc_device;
119 struct _MGSL_PARAMS { unsigned long mode; unsigned char loopback; unsigned short flags; unsigned char encoding; unsigned long clock_speed; unsigned char addr_filter; unsigned short crc_type; unsigned char preamble_length; unsigned char preamble; unsigned long data_rate; unsigned char data_bits; unsigned char stop_bits; unsigned char parity; } ;
169 typedef struct _MGSL_PARAMS MGSL_PARAMS;
170 struct mgsl_icount { __u32 cts; __u32 dsr; __u32 rng; __u32 dcd; __u32 tx; __u32 rx; __u32 frame; __u32 parity; __u32 overrun; __u32 brk; __u32 buf_overrun; __u32 txok; __u32 txunder; __u32 txabort; __u32 txtimeout; __u32 rxshort; __u32 rxlong; __u32 rxabort; __u32 rxover; __u32 rxcrc; __u32 rxok; __u32 exithunt; __u32 rxidle; } ;
229 struct gpio_desc { __u32 state; __u32 smask; __u32 dir; __u32 dmask; } ;
86 struct _SCADESC { u16 next; u16 buf_ptr; u8 buf_base; u8 pad1; u16 length; u8 status; u8 pad2; } ;
121 typedef struct _SCADESC SCADESC;
122 struct _SCADESC_EX { char *virt_addr; u16 phys_entry; } ;
128 typedef struct _SCADESC_EX SCADESC_EX;
129 struct _input_signal_events { int ri_up; int ri_down; int dsr_up; int dsr_down; int dcd_up; int dcd_down; int cts_up; int cts_down; } ;
148 struct _synclinkmp_info { void *if_ptr; int magic; struct tty_port port; int line; unsigned short close_delay; unsigned short closing_wait; struct mgsl_icount icount; int timeout; int x_char; u16 read_status_mask1; u16 read_status_mask2; unsigned char ignore_status_mask1; unsigned char ignore_status_mask2; unsigned char *tx_buf; int tx_put; int tx_get; int tx_count; wait_queue_head_t status_event_wait_q; wait_queue_head_t event_wait_q; struct timer_list tx_timer; struct _synclinkmp_info *next_device; struct timer_list status_timer; spinlock_t lock; struct work_struct task; u32 max_frame_size; u32 pending_bh; bool bh_running; int isr_overflow; bool bh_requested; int dcd_chkcount; int cts_chkcount; int dsr_chkcount; int ri_chkcount; char *buffer_list; unsigned long buffer_list_phys; unsigned int rx_buf_count; SCADESC *rx_buf_list; SCADESC_EX rx_buf_list_ex[128U]; unsigned int current_rx_buf; unsigned int tx_buf_count; SCADESC *tx_buf_list; SCADESC_EX tx_buf_list_ex[128U]; unsigned int last_tx_buf; unsigned char *tmp_rx_buf; unsigned int tmp_rx_buf_count; bool rx_enabled; bool rx_overflow; bool tx_enabled; bool tx_active; u32 idle_mode; unsigned char ie0_value; unsigned char ie1_value; unsigned char ie2_value; unsigned char ctrlreg_value; unsigned char old_signals; char device_name[25U]; int port_count; int adapter_num; int port_num; struct _synclinkmp_info *port_array[4U]; unsigned int bus_type; unsigned int irq_level; unsigned long irq_flags; bool irq_requested; MGSL_PARAMS params; unsigned char serial_signals; bool irq_occurred; unsigned int init_error; u32 last_mem_alloc; unsigned char *memory_base; u32 phys_memory_base; int shared_mem_requested; unsigned char *sca_base; u32 phys_sca_base; u32 sca_offset; bool sca_base_requested; unsigned char *lcr_base; u32 phys_lcr_base; u32 lcr_offset; int lcr_mem_requested; unsigned char *statctrl_base; u32 phys_statctrl_base; u32 statctrl_offset; bool sca_statctrl_requested; u32 misc_ctrl_value; char *flag_buf; bool drop_rts_on_tx_done; struct _input_signal_events input_signal_events; int netcount; spinlock_t netlock; struct net_device *netdev; } ;
279 typedef struct _synclinkmp_info SLMP_INFO;
41 typedef int ldv_func_ret_type;
1 void * __builtin_memcpy(void *, const void *, unsigned long);
1 unsigned long int __builtin_object_size(void *, int);
1 long int __builtin_expect(long, long);
216 void __read_once_size(const volatile void *p, void *res, int size);
241 void __write_once_size(volatile void *p, void *res, int size);
33 extern struct module __this_module;
72 void set_bit(long nr, volatile unsigned long *addr);
110 void clear_bit(long nr, volatile unsigned long *addr);
308 int constant_test_bit(long nr, const volatile unsigned long *addr);
314 int variable_test_bit(long nr, const volatile unsigned long *addr);
142 int printk(const char *, ...);
248 void __might_fault(const char *, int);
403 int sprintf(char *, const char *, ...);
3 bool ldv_is_err(const void *ptr);
25 void INIT_LIST_HEAD(struct list_head *list);
198 int list_empty(const struct list_head *head);
87 void __bad_percpu_size();
10 extern struct task_struct *current_task;
12 struct task_struct * get_current();
31 void * __memcpy(void *, const void *, size_t );
56 void * __memset(void *, int, size_t );
62 int memcmp(const void *, const void *, size_t );
65 char * strcat(char *, const char *);
11 void __xchg_wrong_size();
41 bool IS_ERR(const void *ptr);
90 int test_ti_thread_flag(struct thread_info *ti, int flag);
280 void lockdep_init_map(struct lockdep_map *, const char *, struct lock_class_key *, int);
93 void __raw_spin_lock_init(raw_spinlock_t *, const char *, struct lock_class_key *);
22 void _raw_spin_lock(raw_spinlock_t *);
34 unsigned long int _raw_spin_lock_irqsave(raw_spinlock_t *);
41 void _raw_spin_unlock(raw_spinlock_t *);
45 void _raw_spin_unlock_irqrestore(raw_spinlock_t *, unsigned long);
289 raw_spinlock_t * spinlock_check(spinlock_t *lock);
300 void spin_lock(spinlock_t *lock);
345 void spin_unlock(spinlock_t *lock);
360 void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags);
14 int default_wake_function(wait_queue_t *, unsigned int, int, void *);
72 void __init_waitqueue_head(wait_queue_head_t *, const char *, struct lock_class_key *);
135 int waitqueue_active(wait_queue_head_t *q);
161 void add_wait_queue(wait_queue_head_t *, wait_queue_t *);
163 void remove_wait_queue(wait_queue_head_t *, wait_queue_t *);
200 void __wake_up(wait_queue_head_t *, unsigned int, int, void *);
138 void mutex_lock_nested(struct mutex *, unsigned int);
174 void mutex_unlock(struct mutex *);
78 extern volatile unsigned long jiffies;
284 unsigned int jiffies_to_msecs(const unsigned long);
292 unsigned long int __msecs_to_jiffies(const unsigned int);
354 unsigned long int msecs_to_jiffies(const unsigned int m);
88 void init_timer_key(struct timer_list *, unsigned int, const char *, struct lock_class_key *);
169 int del_timer(struct timer_list *);
170 int mod_timer(struct timer_list *, unsigned long);
181 void __init_work(struct work_struct *, int);
352 extern struct workqueue_struct *system_wq;
429 bool queue_work_on(int, struct workqueue_struct *, struct work_struct *);
469 bool queue_work(struct workqueue_struct *wq, struct work_struct *work);
528 bool schedule_work(struct work_struct *work);
140 extern struct resource iomem_resource;
193 struct resource * __request_region(struct resource *, resource_size_t , resource_size_t , const char *, int);
202 void __release_region(struct resource *, resource_size_t , resource_size_t );
181 void * ioremap_nocache(resource_size_t , unsigned long);
197 void iounmap(volatile void *);
13 int ldv_register_netdev();
209 bool capable(int);
430 void schedule();
2889 int test_tsk_thread_flag(struct task_struct *tsk, int flag);
2915 int signal_pending(struct task_struct *p);
667 unsigned long int _copy_from_user(void *, const void *, unsigned int);
669 unsigned long int _copy_to_user(void *, const void *, unsigned int);
689 void __copy_from_user_overflow();
694 void __copy_to_user_overflow();
710 unsigned long int copy_from_user(void *to, const void *from, unsigned long n);
745 unsigned long int copy_to_user(void *to, const void *from, unsigned long n);
129 int request_threaded_irq(unsigned int, irqreturn_t (*)(int, void *), irqreturn_t (*)(int, void *), unsigned long, const char *, void *);
134 int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *), unsigned long flags, const char *name, void *dev);
148 void free_irq(unsigned int, void *);
114 ssize_t seq_read(struct file *, char *, size_t , loff_t *);
115 loff_t seq_lseek(struct file *, loff_t , int);
122 void seq_printf(struct seq_file *, const char *, ...);
140 int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
142 int single_release(struct inode *, struct file *);
148 void kfree(const void *);
312 void * __kmalloc(size_t , gfp_t );
451 void * kmalloc(size_t size, gfp_t flags);
605 void * kzalloc(size_t size, gfp_t flags);
974 int pci_enable_device(struct pci_dev *);
1182 int __pci_register_driver(struct pci_driver *, struct module *, const char *);
1191 void pci_unregister_driver(struct pci_driver *);
332 struct tty_driver * __tty_alloc_driver(unsigned int, struct module *, unsigned long);
334 void put_tty_driver(struct tty_driver *);
335 void tty_set_operations(struct tty_driver *, const struct tty_operations *);
349 struct tty_driver * alloc_tty_driver(unsigned int lines);
73 unsigned char * char_buf_ptr(struct tty_buffer *b, int ofs);
78 char * flag_buf_ptr(struct tty_buffer *b, int ofs);
396 extern struct ktermios tty_std_termios;
427 int tty_register_driver(struct tty_driver *);
428 int tty_unregister_driver(struct tty_driver *);
455 void tty_hangup(struct tty_struct *);
457 int tty_hung_up_p(struct file *);
458 void do_SAK(struct tty_struct *);
467 speed_t tty_termios_baud_rate(struct ktermios *);
484 speed_t tty_get_baud_rate(struct tty_struct *tty);
493 struct tty_ldisc * tty_ldisc_ref(struct tty_struct *);
494 void tty_ldisc_deref(struct tty_ldisc *);
499 void tty_wakeup(struct tty_struct *);
500 void tty_ldisc_flush(struct tty_struct *);
524 void tty_port_init(struct tty_port *);
536 void tty_port_destroy(struct tty_port *);
547 bool tty_port_cts_enabled(struct tty_port *port);
554 int tty_port_carrier_raised(struct tty_port *);
555 void tty_port_raise_dtr_rts(struct tty_port *);
562 int tty_port_close_start(struct tty_port *, struct tty_struct *, struct file *);
564 void tty_port_close_end(struct tty_port *, struct tty_struct *);
567 int tty_port_install(struct tty_port *, struct tty_driver *, struct tty_struct *);
651 void tty_lock(struct tty_struct *);
652 void tty_unlock(struct tty_struct *);
7 int tty_insert_flip_string_flags(struct tty_port *, const unsigned char *, const char *, size_t );
13 void tty_flip_buffer_push(struct tty_port *);
16 int tty_insert_flip_char(struct tty_port *port, unsigned char ch, char flag);
47 unsigned long int msleep_interruptible(unsigned int);
879 void consume_skb(struct sk_buff *);
1880 unsigned char * skb_put(struct sk_buff *, unsigned int);
2120 void skb_reset_mac_header(struct sk_buff *skb);
2337 struct sk_buff * __netdev_alloc_skb(struct net_device *, unsigned int, gfp_t );
2353 struct sk_buff * netdev_alloc_skb(struct net_device *dev, unsigned int length);
2367 struct sk_buff * dev_alloc_skb(unsigned int length);
1884 struct netdev_queue * netdev_get_tx_queue(const struct net_device *dev, unsigned int index);
1942 void * netdev_priv(const struct net_device *dev);
2317 void free_netdev(struct net_device *);
2715 void netif_tx_start_queue(struct netdev_queue *dev_queue);
2726 void netif_start_queue(struct net_device *dev);
2741 void netif_tx_wake_queue(struct netdev_queue *);
2750 void netif_wake_queue(struct net_device *dev);
2765 void netif_tx_stop_queue(struct netdev_queue *dev_queue);
2777 void netif_stop_queue(struct net_device *dev);
2784 bool netif_tx_queue_stopped(const struct netdev_queue *dev_queue);
2795 bool netif_queue_stopped(const struct net_device *dev);
3141 int netif_rx(struct sk_buff *);
3244 void netif_carrier_on(struct net_device *);
3246 void netif_carrier_off(struct net_device *);
3549 int register_netdev(struct net_device *);
3552 int ldv_register_netdev_5(struct net_device *ldv_func_arg1);
60 int hdlc_ioctl(struct net_device *, struct ifreq *, int);
64 void unregister_hdlc_device(struct net_device *);
70 struct net_device * alloc_hdlcdev(void *);
72 struct hdlc_device * dev_to_hdlc(struct net_device *dev);
93 int hdlc_open(struct net_device *);
95 void hdlc_close(struct net_device *);
97 int hdlc_change_mtu(struct net_device *, int);
99 netdev_tx_t hdlc_start_xmit(struct sk_buff *, struct net_device *);
106 __be16 hdlc_type_trans(struct sk_buff *skb, struct net_device *dev);
85 struct _MGSL_PARAMS default_params = { 2UL, 0U, 1U, 3U, 0UL, 255U, 1U, 0U, 0U, 9600UL, 8U, 1U, 0U };
449 SLMP_INFO *synclinkmp_device_list = (SLMP_INFO *)0;
450 int synclinkmp_adapter_count = -1;
451 int synclinkmp_device_count = 0;
458 _Bool break_on_load = 0;
464 int ttymajor = 0;
469 int debug_level = 0;
470 int maxframe[12U] = { 0 };
477 char *driver_name = (char *)"SyncLink MultiPort driver";
478 char *driver_version = (char *)"$Revision: 4.38 $";
480 int synclinkmp_init_one(struct pci_dev *dev, const struct pci_device_id *ent);
481 void synclinkmp_remove_one(struct pci_dev *dev);
483 struct pci_device_id synclinkmp_pci_tbl[2U] = { { 5056U, 48U, 4294967295U, 4294967295U, 0U, 0U, 0UL }, { 0U, 0U, 0U, 0U, 0U, 0U, 0UL } };
487 const struct pci_device_id __mod_pci__synclinkmp_pci_tbl_device_table[2U] = { };
491 struct pci_driver synclinkmp_pci_driver = { { 0, 0 }, "synclinkmp", (const struct pci_device_id *)(&synclinkmp_pci_tbl), &synclinkmp_init_one, &synclinkmp_remove_one, 0, 0, 0, 0, 0, 0, 0, { 0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { { { { { 0 } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } } };
499 struct tty_driver *serial_driver = 0;
507 int open(struct tty_struct *tty, struct file *filp);
508 void close(struct tty_struct *tty, struct file *filp);
509 void hangup(struct tty_struct *tty);
510 void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
512 int write(struct tty_struct *tty, const unsigned char *buf, int count);
513 int put_char(struct tty_struct *tty, unsigned char ch);
514 void send_xchar(struct tty_struct *tty, char ch);
515 void wait_until_sent(struct tty_struct *tty, int timeout);
516 int write_room(struct tty_struct *tty);
517 void flush_chars(struct tty_struct *tty);
518 void flush_buffer(struct tty_struct *tty);
519 void tx_hold(struct tty_struct *tty);
520 void tx_release(struct tty_struct *tty);
522 int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
523 int chars_in_buffer(struct tty_struct *tty);
524 void throttle(struct tty_struct *tty);
525 void unthrottle(struct tty_struct *tty);
526 int set_break(struct tty_struct *tty, int break_state);
530 void hdlcdev_tx_done(SLMP_INFO *info);
531 void hdlcdev_rx(SLMP_INFO *info, char *buf, int size);
532 int hdlcdev_init(SLMP_INFO *info);
533 void hdlcdev_exit(SLMP_INFO *info);
538 int get_stats(SLMP_INFO *info, struct mgsl_icount *user_icount);
539 int get_params(SLMP_INFO *info, MGSL_PARAMS *user_params);
540 int set_params(SLMP_INFO *info, MGSL_PARAMS *new_params);
541 int get_txidle(SLMP_INFO *info, int *idle_mode);
542 int set_txidle(SLMP_INFO *info, int idle_mode);
543 int tx_enable(SLMP_INFO *info, int enable);
544 int tx_abort(SLMP_INFO *info);
545 int rx_enable(SLMP_INFO *info, int enable);
546 int modem_input_wait(SLMP_INFO *info, int arg);
547 int wait_mgsl_event(SLMP_INFO *info, int *mask_ptr);
548 int tiocmget(struct tty_struct *tty);
549 int tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear);
553 void add_device(SLMP_INFO *info);
554 void device_init(int adapter_num, struct pci_dev *pdev);
555 int claim_resources(SLMP_INFO *info);
556 void release_resources(SLMP_INFO *info);
558 int startup(SLMP_INFO *info);
559 int block_til_ready(struct tty_struct *tty, struct file *filp, SLMP_INFO *info);
560 int carrier_raised(struct tty_port *port);
561 void shutdown(SLMP_INFO *info);
562 void program_hw(SLMP_INFO *info);
563 void change_params(SLMP_INFO *info);
565 bool init_adapter(SLMP_INFO *info);
566 bool register_test(SLMP_INFO *info);
567 bool irq_test(SLMP_INFO *info);
568 bool loopback_test(SLMP_INFO *info);
569 int adapter_test(SLMP_INFO *info);
570 bool memory_test(SLMP_INFO *info);
572 void reset_adapter(SLMP_INFO *info);
573 void reset_port(SLMP_INFO *info);
574 void async_mode(SLMP_INFO *info);
575 void hdlc_mode(SLMP_INFO *info);
577 void rx_stop(SLMP_INFO *info);
578 void rx_start(SLMP_INFO *info);
579 void rx_reset_buffers(SLMP_INFO *info);
580 void rx_free_frame_buffers(SLMP_INFO *info, unsigned int first, unsigned int last);
581 bool rx_get_frame(SLMP_INFO *info);
583 void tx_start(SLMP_INFO *info);
584 void tx_stop(SLMP_INFO *info);
585 void tx_load_fifo(SLMP_INFO *info);
586 void tx_set_idle(SLMP_INFO *info);
587 void tx_load_dma_buffer(SLMP_INFO *info, const char *buf, unsigned int count);
589 void get_signals(SLMP_INFO *info);
590 void set_signals(SLMP_INFO *info);
591 void enable_loopback(SLMP_INFO *info, int enable);
592 void set_rate(SLMP_INFO *info, u32 data_rate);
594 int bh_action(SLMP_INFO *info);
595 void bh_handler(struct work_struct *work);
596 void bh_receive(SLMP_INFO *info);
597 void bh_transmit(SLMP_INFO *info);
598 void bh_status(SLMP_INFO *info);
599 void isr_timer(SLMP_INFO *info);
600 void isr_rxint(SLMP_INFO *info);
601 void isr_rxrdy(SLMP_INFO *info);
602 void isr_txint(SLMP_INFO *info);
603 void isr_txrdy(SLMP_INFO *info);
604 void isr_rxdmaok(SLMP_INFO *info);
605 void isr_rxdmaerror(SLMP_INFO *info);
606 void isr_txdmaok(SLMP_INFO *info);
607 void isr_txdmaerror(SLMP_INFO *info);
608 void isr_io_pin(SLMP_INFO *info, u16 status);
610 int alloc_dma_bufs(SLMP_INFO *info);
611 void free_dma_bufs(SLMP_INFO *info);
612 int alloc_buf_list(SLMP_INFO *info);
613 int alloc_frame_bufs(SLMP_INFO *info, SCADESC *buf_list, SCADESC_EX *buf_list_ex, int count);
614 int alloc_tmp_rx_buf(SLMP_INFO *info);
615 void free_tmp_rx_buf(SLMP_INFO *info);
617 void load_pci_memory(SLMP_INFO *info, char *dest, const char *src, unsigned short count);
618 void trace_block(SLMP_INFO *info, const char *data, int count, int xmit);
619 void tx_timeout(unsigned long context);
620 void status_timeout(unsigned long context);
622 unsigned char read_reg(SLMP_INFO *info, unsigned char Addr);
623 void write_reg(SLMP_INFO *info, unsigned char Addr, unsigned char Value);
624 u16 read_reg16(SLMP_INFO *info, unsigned char Addr);
625 void write_reg16(SLMP_INFO *info, unsigned char Addr, u16 Value);
626 unsigned char read_status_reg(SLMP_INFO *info);
627 void write_control_reg(SLMP_INFO *info);
630 unsigned char rx_active_fifo_level = 16U;
631 unsigned char tx_active_fifo_level = 16U;
632 unsigned char tx_negate_fifo_level = 32U;
634 unsigned int misc_ctrl_value = 8273984U;
635 unsigned int lcr1_brdr_value = 8388648U;
637 unsigned int read_ahead_count = 8U;
650 unsigned char dma_priority = 4U;
654 unsigned int sca_pci_load_interval = 64U;
662 void * synclinkmp_get_text_ptr();
665 int sanity_check(SLMP_INFO *info, char *name, const char *routine);
698 void ldisc_receive_buf(struct tty_struct *tty, const __u8 *data, char *flags, int count);
714 int install(struct tty_driver *driver, struct tty_struct *tty);
1313 int get_icount(struct tty_struct *tty, struct serial_icounter_struct *icount);
1343 void line_info(struct seq_file *m, SLMP_INFO *info);
1416 int synclinkmp_proc_show(struct seq_file *m, void *v);
1430 int synclinkmp_proc_open(struct inode *inode, struct file *file);
1435 const struct file_operations synclinkmp_proc_fops = { &__this_module, &seq_lseek, &seq_read, 0, 0, 0, 0, 0, 0, 0, 0, &synclinkmp_proc_open, 0, &single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1552 int hdlcdev_attach(struct net_device *dev, unsigned short encoding, unsigned short parity);
1597 netdev_tx_t hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev);
1640 int hdlcdev_open(struct net_device *dev);
1699 int hdlcdev_close(struct net_device *dev);
1730 int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
1830 void hdlcdev_tx_timeout(struct net_device *dev);
1893 const struct net_device_ops hdlcdev_ops = { 0, 0, &hdlcdev_open, &hdlcdev_close, &hdlc_start_xmit, 0, 0, 0, 0, 0, 0, &hdlcdev_ioctl, 0, &hdlc_change_mtu, 0, &hdlcdev_tx_timeout, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
2223 void isr_txeom(SLMP_INFO *info, unsigned char status);
2521 irqreturn_t synclinkmp_interrupt(int dummy, void *dev_id);
3264 void dtr_rts(struct tty_port *port, int on);
3739 const struct tty_port_operations port_ops = { &carrier_raised, &dtr_rts, 0, 0, 0 };
3748 SLMP_INFO * alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev);
3881 const struct tty_operations ops = { 0, &install, 0, &open, &close, 0, 0, &write, &put_char, &flush_chars, &write_room, &chars_in_buffer, &ioctl, 0, &set_termios, &throttle, &unthrottle, &tx_hold, &tx_release, &hangup, &set_break, &flush_buffer, 0, &wait_until_sent, &send_xchar, &tiocmget, &tiocmset, 0, 0, &get_icount, 0, 0, 0, &synclinkmp_proc_fops };
3908 void synclinkmp_cleanup();
3956 int synclinkmp_init();
4012 void synclinkmp_exit();
5139 bool sca_init(SLMP_INFO *info);
5617 void ldv_check_final_state();
5620 void ldv_check_return_value(int);
5623 void ldv_check_return_value_probe(int retval);
5626 void ldv_initialize();
5629 void ldv_handler_precall();
5632 int nondet_int();
5635 int LDV_IN_INTERRUPT = 0;
5638 void ldv_main0_sequence_infinite_withcheck_stateful();
10 void ldv_error();
14 void * ldv_err_ptr(long error);
21 long int ldv_ptr_err(const void *ptr);
28 bool ldv_is_err_or_null(const void *ptr);
14 int ldv_probe_state = 0;
17 int ldv_usb_register();
return ;
}
-entry_point
{
5640 struct pci_dev *var_group1;
5641 const struct pci_device_id *var_synclinkmp_init_one_121_p1;
5642 int res_synclinkmp_init_one_121;
5643 struct inode *var_group2;
5644 struct file *var_group3;
5645 int res_synclinkmp_proc_open_21;
5646 struct net_device *var_group4;
5647 int res_hdlcdev_open_28;
5648 int res_hdlcdev_close_29;
5649 struct ifreq *var_group5;
5650 int var_hdlcdev_ioctl_30_p2;
5651 struct tty_port *var_group6;
5652 int var_dtr_rts_70_p1;
5653 struct tty_driver *var_group7;
5654 struct tty_struct *var_group8;
5655 int res_open_4;
5656 const unsigned char *var_write_8_p1;
5657 int var_write_8_p2;
5658 unsigned char var_put_char_9_p1;
5659 unsigned int var_ioctl_17_p1;
5660 unsigned long var_ioctl_17_p2;
5661 char var_send_xchar_10_p1;
5662 int var_set_break_25_p1;
5663 int var_wait_until_sent_11_p1;
5664 struct ktermios *var_group9;
5665 unsigned int var_tiocmset_68_p1;
5666 unsigned int var_tiocmset_68_p2;
5667 struct serial_icounter_struct *var_group10;
5668 int var_synclinkmp_interrupt_52_p0;
5669 void *var_synclinkmp_interrupt_52_p1;
5670 int ldv_s_synclinkmp_pci_driver_pci_driver;
5671 int ldv_s_synclinkmp_proc_fops_file_operations;
5672 int ldv_s_hdlcdev_ops_net_device_ops;
5673 int ldv_s_ops_tty_operations;
5674 int tmp;
5675 int tmp___0;
5676 int tmp___1;
12697 ldv_s_synclinkmp_pci_driver_pci_driver = 0;
12699 ldv_s_synclinkmp_proc_fops_file_operations = 0;
12701 ldv_s_hdlcdev_ops_net_device_ops = 0;
12706 ldv_s_ops_tty_operations = 0;
12470 LDV_IN_INTERRUPT = 1;
12479 ldv_initialize() { /* Function call is skipped due to function is undefined */}
12673 ldv_handler_precall() { /* Function call is skipped due to function is undefined */}
12674 -synclinkmp_init()
{
3958 int rc;
3960 assume(((int)break_on_load) == 0);
3965 printk("%s %s\n", driver_name, driver_version) { /* Function call is skipped due to function is undefined */}
3967 rc = __pci_register_driver(&synclinkmp_pci_driver, &__this_module, "synclinkmp") { /* Function call is skipped due to function is undefined */}
3967 assume(!(rc < 0));
3972 -alloc_tty_driver(128U)
{
351 struct tty_driver *ret;
352 struct tty_driver *tmp;
353 _Bool tmp___0;
351 tmp = __tty_alloc_driver(lines, &__this_module, 0UL) { /* Function call is skipped due to function is undefined */}
351 ret = tmp;
352 -IS_ERR((const void *)ret)
{
29 _Bool tmp;
30 -ldv_is_err(ptr)
{
10 return ((unsigned long)ptr) > 2012UL;;
}
30 return tmp;;
}
352 assume(((int)tmp___0) == 0);
354 return ret;;
}
3973 assume(!(((unsigned long)serial_driver) == ((unsigned long)((struct tty_driver *)0))));
3980 serial_driver->driver_name = "synclinkmp";
3981 serial_driver->name = "ttySLM";
3982 serial_driver->major = ttymajor;
3983 serial_driver->minor_start = 64;
3984 serial_driver->type = 3;
3985 serial_driver->subtype = 1;
3986 serial_driver->init_termios = tty_std_termios;
3987 serial_driver->init_termios.c_cflag = 3261U;
3989 serial_driver->init_termios.c_ispeed = 9600U;
3990 serial_driver->init_termios.c_ospeed = 9600U;
3991 serial_driver->flags = 4UL;
3992 tty_set_operations(serial_driver, &ops) { /* Function call is skipped due to function is undefined */}
3993 rc = tty_register_driver(serial_driver) { /* Function call is skipped due to function is undefined */}
3993 assume(!(rc < 0));
4001 printk("%s %s, tty major#%d\n", driver_name, driver_version, serial_driver->major) { /* Function call is skipped due to function is undefined */}
4005 return 0;;
}
12674 assume(!(tmp != 0));
12712 goto ldv_50633;
12712 tmp___1 = nondet_int() { /* Function call is skipped due to function is undefined */}
12712 assume(tmp___1 != 0);
12718 goto ldv_50632;
12713 ldv_50632:;
12719 tmp___0 = nondet_int() { /* Function call is skipped due to function is undefined */}
12719 switch (tmp___0);
12720 assume(tmp___0 == 0);
12724 assume(ldv_s_synclinkmp_pci_driver_pci_driver == 0);
12936 -synclinkmp_init_one(var_group1, var_synclinkmp_init_one_121_p1)
{
5588 int tmp;
5589 tmp = pci_enable_device(dev) { /* Function call is skipped due to function is undefined */}
5589 assume(!(tmp != 0));
5593 synclinkmp_adapter_count = synclinkmp_adapter_count + 1;
5593 -device_init(synclinkmp_adapter_count, dev)
{
3826 SLMP_INFO *port_array[4U];
3827 int port;
3828 struct lock_class_key __key;
3829 int tmp;
3830 int tmp___0;
3830 port = 0;
3830 goto ldv_50170;
3830 assume(port <= 3);
3832 goto ldv_50169;
3831 ldv_50169:;
3831 -alloc_dev(adapter_num, port, pdev)
{
3750 SLMP_INFO *info;
3751 void *tmp;
3752 struct lock_class_key __key;
3753 struct __anonstruct_atomic64_t_7 __constr_expr_0;
3754 struct lock_class_key __key___0;
3755 struct lock_class_key __key___1;
3756 struct lock_class_key __key___2;
3757 struct lock_class_key __key___3;
3758 struct lock_class_key __key___4;
3752 -kzalloc(6296UL, 37748928U)
{
607 void *tmp;
607 -kmalloc(size, flags | 32768U)
{
453 void *tmp___2;
468 tmp___2 = __kmalloc(size, flags) { /* Function call is skipped due to function is undefined */}
468 return tmp___2;;
}
607 return tmp;;
}
3752 info = (SLMP_INFO *)tmp;
3755 assume(!(((unsigned long)info) == ((unsigned long)((SLMP_INFO *)0))));
3759 tty_port_init(&(info->port)) { /* Function call is skipped due to function is undefined */}
3760 info->port.ops = &port_ops;
3761 info->magic = 21505;
3762 __init_work(&(info->task), 0) { /* Function call is skipped due to function is undefined */}
3762 __constr_expr_0.counter = 137438953408L;
3762 info->task.data = __constr_expr_0;
3762 lockdep_init_map(&(info->task.lockdep_map), "(&info->task)", &__key, 0) { /* Function call is skipped due to function is undefined */}
3762 -INIT_LIST_HEAD(&(info->task.entry))
{
27 union __anonunion___u_16 __u;
27 __u.__val = list;
27 -__write_once_size((volatile void *)(&(list->next)), (void *)(&(__u.__c)), 8)
{
243 switch (size);
244 assume(!(size == 1));
245 assume(!(size == 2));
246 assume(!(size == 4));
247 assume(size == 8);
247 *((volatile __u64 *)p) = *((__u64 *)res);
247 goto ldv_902;
254 return ;;
}
28 list->prev = list;
29 return ;;
}
3762 info->task.func = &bh_handler;
3763 info->max_frame_size = 4096U;
3764 info->port.close_delay = 125U;
3765 info->port.closing_wait = 7500U;
3766 __init_waitqueue_head(&(info->status_event_wait_q), "&info->status_event_wait_q", &__key___0) { /* Function call is skipped due to function is undefined */}
3767 __init_waitqueue_head(&(info->event_wait_q), "&info->event_wait_q", &__key___1) { /* Function call is skipped due to function is undefined */}
3768 -spinlock_check(&(info->netlock))
{
291 return &(lock->__annonCompField20.rlock);;
}
3768 __raw_spin_lock_init(&(info->netlock.__annonCompField20.rlock), "&(&info->netlock)->rlock", &__key___2) { /* Function call is skipped due to function is undefined */}
3769 __memcpy((void *)(&(info->params)), (const void *)(&default_params), 48UL) { /* Function call is skipped due to function is undefined */}
3770 info->idle_mode = 0U;
3771 info->adapter_num = adapter_num;
3772 info->port_num = port_num;
3775 info->irq_level = pdev->irq;
3776 info->phys_lcr_base = (u32 )(((pdev->resource)[0]).start);
3777 info->phys_sca_base = (u32 )(((pdev->resource)[2]).start);
3778 info->phys_memory_base = (u32 )(((pdev->resource)[3]).start);
3779 info->phys_statctrl_base = (u32 )(((pdev->resource)[4]).start);
3785 info->lcr_offset = (info->phys_lcr_base) & 4095U;
3786 info->phys_lcr_base = (info->phys_lcr_base) & 4294963200U;
3788 info->sca_offset = (info->phys_sca_base) & 4095U;
3789 info->phys_sca_base = (info->phys_sca_base) & 4294963200U;
3791 info->statctrl_offset = (info->phys_statctrl_base) & 4095U;
3792 info->phys_statctrl_base = (info->phys_statctrl_base) & 4294963200U;
3794 info->bus_type = 5U;
3795 info->irq_flags = 128UL;
3797 init_timer_key(&(info->tx_timer), 0U, "((&info->tx_timer))", &__key___3) { /* Function call is skipped due to function is undefined */}
3797 info->tx_timer.function = &tx_timeout;
3797 info->tx_timer.data = (unsigned long)info;
3798 init_timer_key(&(info->status_timer), 0U, "((&info->status_timer))", &__key___4) { /* Function call is skipped due to function is undefined */}
3798 info->status_timer.function = &status_timeout;
3798 info->status_timer.data = (unsigned long)info;
3810 info->misc_ctrl_value = 142492998U;
3818 info->init_error = 4294967295U;
3821 return info;;
}
3832 assume(!(((unsigned long)(port_array[port])) == ((unsigned long)((SLMP_INFO *)0))));
3830 port = port + 1;
3831 ldv_50170:;
3830 assume(port <= 3);
3832 goto ldv_50169;
3831 ldv_50169:;
3831 -alloc_dev(adapter_num, port, pdev)
{
3750 SLMP_INFO *info;
3751 void *tmp;
3752 struct lock_class_key __key;
3753 struct __anonstruct_atomic64_t_7 __constr_expr_0;
3754 struct lock_class_key __key___0;
3755 struct lock_class_key __key___1;
3756 struct lock_class_key __key___2;
3757 struct lock_class_key __key___3;
3758 struct lock_class_key __key___4;
3752 -kzalloc(6296UL, 37748928U)
{
607 void *tmp;
607 -kmalloc(size, flags | 32768U)
{
453 void *tmp___2;
468 tmp___2 = __kmalloc(size, flags) { /* Function call is skipped due to function is undefined */}
468 return tmp___2;;
}
607 return tmp;;
}
3752 info = (SLMP_INFO *)tmp;
3755 assume(!(((unsigned long)info) == ((unsigned long)((SLMP_INFO *)0))));
3759 tty_port_init(&(info->port)) { /* Function call is skipped due to function is undefined */}
3760 info->port.ops = &port_ops;
3761 info->magic = 21505;
3762 __init_work(&(info->task), 0) { /* Function call is skipped due to function is undefined */}
3762 __constr_expr_0.counter = 137438953408L;
3762 info->task.data = __constr_expr_0;
3762 lockdep_init_map(&(info->task.lockdep_map), "(&info->task)", &__key, 0) { /* Function call is skipped due to function is undefined */}
3762 -INIT_LIST_HEAD(&(info->task.entry))
{
27 union __anonunion___u_16 __u;
27 __u.__val = list;
27 -__write_once_size((volatile void *)(&(list->next)), (void *)(&(__u.__c)), 8)
{
243 switch (size);
244 assume(!(size == 1));
245 assume(!(size == 2));
246 assume(!(size == 4));
247 assume(size == 8);
247 *((volatile __u64 *)p) = *((__u64 *)res);
247 goto ldv_902;
254 return ;;
}
28 list->prev = list;
29 return ;;
}
3762 info->task.func = &bh_handler;
3763 info->max_frame_size = 4096U;
3764 info->port.close_delay = 125U;
3765 info->port.closing_wait = 7500U;
3766 __init_waitqueue_head(&(info->status_event_wait_q), "&info->status_event_wait_q", &__key___0) { /* Function call is skipped due to function is undefined */}
3767 __init_waitqueue_head(&(info->event_wait_q), "&info->event_wait_q", &__key___1) { /* Function call is skipped due to function is undefined */}
3768 -spinlock_check(&(info->netlock))
{
291 return &(lock->__annonCompField20.rlock);;
}
3768 __raw_spin_lock_init(&(info->netlock.__annonCompField20.rlock), "&(&info->netlock)->rlock", &__key___2) { /* Function call is skipped due to function is undefined */}
3769 __memcpy((void *)(&(info->params)), (const void *)(&default_params), 48UL) { /* Function call is skipped due to function is undefined */}
3770 info->idle_mode = 0U;
3771 info->adapter_num = adapter_num;
3772 info->port_num = port_num;
3775 info->irq_level = pdev->irq;
3776 info->phys_lcr_base = (u32 )(((pdev->resource)[0]).start);
3777 info->phys_sca_base = (u32 )(((pdev->resource)[2]).start);
3778 info->phys_memory_base = (u32 )(((pdev->resource)[3]).start);
3779 info->phys_statctrl_base = (u32 )(((pdev->resource)[4]).start);
3785 info->lcr_offset = (info->phys_lcr_base) & 4095U;
3786 info->phys_lcr_base = (info->phys_lcr_base) & 4294963200U;
3788 info->sca_offset = (info->phys_sca_base) & 4095U;
3789 info->phys_sca_base = (info->phys_sca_base) & 4294963200U;
3791 info->statctrl_offset = (info->phys_statctrl_base) & 4095U;
3792 info->phys_statctrl_base = (info->phys_statctrl_base) & 4294963200U;
3794 info->bus_type = 5U;
3795 info->irq_flags = 128UL;
3797 init_timer_key(&(info->tx_timer), 0U, "((&info->tx_timer))", &__key___3) { /* Function call is skipped due to function is undefined */}
3797 info->tx_timer.function = &tx_timeout;
3797 info->tx_timer.data = (unsigned long)info;
3798 init_timer_key(&(info->status_timer), 0U, "((&info->status_timer))", &__key___4) { /* Function call is skipped due to function is undefined */}
3798 info->status_timer.function = &status_timeout;
3798 info->status_timer.data = (unsigned long)info;
3810 info->misc_ctrl_value = 142492998U;
3818 info->init_error = 4294967295U;
3821 return info;;
}
3832 assume(!(((unsigned long)(port_array[port])) == ((unsigned long)((SLMP_INFO *)0))));
3830 port = port + 1;
3831 ldv_50170:;
3830 assume(port <= 3);
3832 goto ldv_50169;
3831 ldv_50169:;
3831 -alloc_dev(adapter_num, port, pdev)
{
3750 SLMP_INFO *info;
3751 void *tmp;
3752 struct lock_class_key __key;
3753 struct __anonstruct_atomic64_t_7 __constr_expr_0;
3754 struct lock_class_key __key___0;
3755 struct lock_class_key __key___1;
3756 struct lock_class_key __key___2;
3757 struct lock_class_key __key___3;
3758 struct lock_class_key __key___4;
3752 -kzalloc(6296UL, 37748928U)
{
607 void *tmp;
607 -kmalloc(size, flags | 32768U)
{
453 void *tmp___2;
468 tmp___2 = __kmalloc(size, flags) { /* Function call is skipped due to function is undefined */}
468 return tmp___2;;
}
607 return tmp;;
}
3752 info = (SLMP_INFO *)tmp;
3755 assume(!(((unsigned long)info) == ((unsigned long)((SLMP_INFO *)0))));
3759 tty_port_init(&(info->port)) { /* Function call is skipped due to function is undefined */}
3760 info->port.ops = &port_ops;
3761 info->magic = 21505;
3762 __init_work(&(info->task), 0) { /* Function call is skipped due to function is undefined */}
3762 __constr_expr_0.counter = 137438953408L;
3762 info->task.data = __constr_expr_0;
3762 lockdep_init_map(&(info->task.lockdep_map), "(&info->task)", &__key, 0) { /* Function call is skipped due to function is undefined */}
3762 -INIT_LIST_HEAD(&(info->task.entry))
{
27 union __anonunion___u_16 __u;
27 __u.__val = list;
27 -__write_once_size((volatile void *)(&(list->next)), (void *)(&(__u.__c)), 8)
{
243 switch (size);
244 assume(!(size == 1));
245 assume(!(size == 2));
246 assume(!(size == 4));
247 assume(size == 8);
247 *((volatile __u64 *)p) = *((__u64 *)res);
247 goto ldv_902;
254 return ;;
}
28 list->prev = list;
29 return ;;
}
3762 info->task.func = &bh_handler;
3763 info->max_frame_size = 4096U;
3764 info->port.close_delay = 125U;
3765 info->port.closing_wait = 7500U;
3766 __init_waitqueue_head(&(info->status_event_wait_q), "&info->status_event_wait_q", &__key___0) { /* Function call is skipped due to function is undefined */}
3767 __init_waitqueue_head(&(info->event_wait_q), "&info->event_wait_q", &__key___1) { /* Function call is skipped due to function is undefined */}
3768 -spinlock_check(&(info->netlock))
{
291 return &(lock->__annonCompField20.rlock);;
}
3768 __raw_spin_lock_init(&(info->netlock.__annonCompField20.rlock), "&(&info->netlock)->rlock", &__key___2) { /* Function call is skipped due to function is undefined */}
3769 __memcpy((void *)(&(info->params)), (const void *)(&default_params), 48UL) { /* Function call is skipped due to function is undefined */}
3770 info->idle_mode = 0U;
3771 info->adapter_num = adapter_num;
3772 info->port_num = port_num;
3775 info->irq_level = pdev->irq;
3776 info->phys_lcr_base = (u32 )(((pdev->resource)[0]).start);
3777 info->phys_sca_base = (u32 )(((pdev->resource)[2]).start);
3778 info->phys_memory_base = (u32 )(((pdev->resource)[3]).start);
3779 info->phys_statctrl_base = (u32 )(((pdev->resource)[4]).start);
3785 info->lcr_offset = (info->phys_lcr_base) & 4095U;
3786 info->phys_lcr_base = (info->phys_lcr_base) & 4294963200U;
3788 info->sca_offset = (info->phys_sca_base) & 4095U;
3789 info->phys_sca_base = (info->phys_sca_base) & 4294963200U;
3791 info->statctrl_offset = (info->phys_statctrl_base) & 4095U;
3792 info->phys_statctrl_base = (info->phys_statctrl_base) & 4294963200U;
3794 info->bus_type = 5U;
3795 info->irq_flags = 128UL;
3797 init_timer_key(&(info->tx_timer), 0U, "((&info->tx_timer))", &__key___3) { /* Function call is skipped due to function is undefined */}
3797 info->tx_timer.function = &tx_timeout;
3797 info->tx_timer.data = (unsigned long)info;
3798 init_timer_key(&(info->status_timer), 0U, "((&info->status_timer))", &__key___4) { /* Function call is skipped due to function is undefined */}
3798 info->status_timer.function = &status_timeout;
3798 info->status_timer.data = (unsigned long)info;
3810 info->misc_ctrl_value = 142492998U;
3818 info->init_error = 4294967295U;
3821 return info;;
}
3832 assume(!(((unsigned long)(port_array[port])) == ((unsigned long)((SLMP_INFO *)0))));
3830 port = port + 1;
3831 ldv_50170:;
3830 assume(port <= 3);
3832 goto ldv_50169;
3831 ldv_50169:;
3831 -alloc_dev(adapter_num, port, pdev)
{
3750 SLMP_INFO *info;
3751 void *tmp;
3752 struct lock_class_key __key;
3753 struct __anonstruct_atomic64_t_7 __constr_expr_0;
3754 struct lock_class_key __key___0;
3755 struct lock_class_key __key___1;
3756 struct lock_class_key __key___2;
3757 struct lock_class_key __key___3;
3758 struct lock_class_key __key___4;
3752 -kzalloc(6296UL, 37748928U)
{
607 void *tmp;
607 -kmalloc(size, flags | 32768U)
{
453 void *tmp___2;
468 tmp___2 = __kmalloc(size, flags) { /* Function call is skipped due to function is undefined */}
468 return tmp___2;;
}
607 return tmp;;
}
3752 info = (SLMP_INFO *)tmp;
3755 assume(!(((unsigned long)info) == ((unsigned long)((SLMP_INFO *)0))));
3759 tty_port_init(&(info->port)) { /* Function call is skipped due to function is undefined */}
3760 info->port.ops = &port_ops;
3761 info->magic = 21505;
3762 __init_work(&(info->task), 0) { /* Function call is skipped due to function is undefined */}
3762 __constr_expr_0.counter = 137438953408L;
3762 info->task.data = __constr_expr_0;
3762 lockdep_init_map(&(info->task.lockdep_map), "(&info->task)", &__key, 0) { /* Function call is skipped due to function is undefined */}
3762 -INIT_LIST_HEAD(&(info->task.entry))
{
27 union __anonunion___u_16 __u;
27 __u.__val = list;
27 -__write_once_size((volatile void *)(&(list->next)), (void *)(&(__u.__c)), 8)
{
243 switch (size);
244 assume(!(size == 1));
245 assume(!(size == 2));
246 assume(!(size == 4));
247 assume(size == 8);
247 *((volatile __u64 *)p) = *((__u64 *)res);
247 goto ldv_902;
254 return ;;
}
28 list->prev = list;
29 return ;;
}
3762 info->task.func = &bh_handler;
3763 info->max_frame_size = 4096U;
3764 info->port.close_delay = 125U;
3765 info->port.closing_wait = 7500U;
3766 __init_waitqueue_head(&(info->status_event_wait_q), "&info->status_event_wait_q", &__key___0) { /* Function call is skipped due to function is undefined */}
3767 __init_waitqueue_head(&(info->event_wait_q), "&info->event_wait_q", &__key___1) { /* Function call is skipped due to function is undefined */}
3768 -spinlock_check(&(info->netlock))
{
291 return &(lock->__annonCompField20.rlock);;
}
3768 __raw_spin_lock_init(&(info->netlock.__annonCompField20.rlock), "&(&info->netlock)->rlock", &__key___2) { /* Function call is skipped due to function is undefined */}
3769 __memcpy((void *)(&(info->params)), (const void *)(&default_params), 48UL) { /* Function call is skipped due to function is undefined */}
3770 info->idle_mode = 0U;
3771 info->adapter_num = adapter_num;
3772 info->port_num = port_num;
3775 info->irq_level = pdev->irq;
3776 info->phys_lcr_base = (u32 )(((pdev->resource)[0]).start);
3777 info->phys_sca_base = (u32 )(((pdev->resource)[2]).start);
3778 info->phys_memory_base = (u32 )(((pdev->resource)[3]).start);
3779 info->phys_statctrl_base = (u32 )(((pdev->resource)[4]).start);
3785 info->lcr_offset = (info->phys_lcr_base) & 4095U;
3786 info->phys_lcr_base = (info->phys_lcr_base) & 4294963200U;
3788 info->sca_offset = (info->phys_sca_base) & 4095U;
3789 info->phys_sca_base = (info->phys_sca_base) & 4294963200U;
3791 info->statctrl_offset = (info->phys_statctrl_base) & 4095U;
3792 info->phys_statctrl_base = (info->phys_statctrl_base) & 4294963200U;
3794 info->bus_type = 5U;
3795 info->irq_flags = 128UL;
3797 init_timer_key(&(info->tx_timer), 0U, "((&info->tx_timer))", &__key___3) { /* Function call is skipped due to function is undefined */}
3797 info->tx_timer.function = &tx_timeout;
3797 info->tx_timer.data = (unsigned long)info;
3798 init_timer_key(&(info->status_timer), 0U, "((&info->status_timer))", &__key___4) { /* Function call is skipped due to function is undefined */}
3798 info->status_timer.function = &status_timeout;
3798 info->status_timer.data = (unsigned long)info;
3810 info->misc_ctrl_value = 142492998U;
3818 info->init_error = 4294967295U;
3821 return info;;
}
3832 assume(!(((unsigned long)(port_array[port])) == ((unsigned long)((SLMP_INFO *)0))));
3830 port = port + 1;
3831 ldv_50170:;
3830 assume(!(port <= 3));
3842 port = 0;
3842 goto ldv_50174;
3842 assume(port <= 3);
3844 goto ldv_50173;
3843 ldv_50173:;
3843 __memcpy((void *)(&((port_array[port])->port_array)), (const void *)(&port_array), 32UL) { /* Function call is skipped due to function is undefined */}
3844 -add_device(port_array[port])
{
3699 SLMP_INFO *current_dev;
3699 info->next_device = (struct _synclinkmp_info *)0;
3700 info->line = synclinkmp_device_count;
3701 sprintf((char *)(&(info->device_name)), "ttySLM%dp%d", info->adapter_num, info->port_num) { /* Function call is skipped due to function is undefined */}
3703 assume((info->line) <= 11);
3704 assume(!((maxframe[info->line]) != 0));
3708 synclinkmp_device_count = synclinkmp_device_count + 1;
3710 assume(((unsigned long)synclinkmp_device_list) == ((unsigned long)((SLMP_INFO *)0)));
3711 synclinkmp_device_list = info;
3719 assume(!((info->max_frame_size) <= 4095U));
3721 assume(!((info->max_frame_size) > 65535U));
3724 printk("SyncLink MultiPort %s: Mem=(%08x %08X %08x %08X) IRQ=%d MaxFrameSize=%u\n", (char *)(&(info->device_name)), info->phys_sca_base, info->phys_memory_base, info->phys_statctrl_base, info->phys_lcr_base, info->irq_level, info->max_frame_size) { /* Function call is skipped due to function is undefined */}
3735 -hdlcdev_init(info)
{
1912 int rc;
1913 struct net_device *dev;
1914 hdlc_device *hdlc;
1915 struct hdlc_device *tmp;
1918 dev = alloc_hdlcdev((void *)info) { /* Function call is skipped due to function is undefined */}
1919 assume(!(((unsigned long)dev) == ((unsigned long)((struct net_device *)0))));
1925 unsigned long __CPAchecker_TMP_0 = (unsigned long)(info->phys_sca_base);
1925 dev->mem_start = __CPAchecker_TMP_0;
1926 dev->mem_end = (unsigned long)((info->phys_sca_base) + 511U);
1927 int __CPAchecker_TMP_1 = (int)(info->irq_level);
1927 dev->irq = __CPAchecker_TMP_1;
1930 dev->netdev_ops = &hdlcdev_ops;
1931 dev->watchdog_timeo = 2500;
1932 dev->tx_queue_len = 50UL;
1935 -dev_to_hdlc(dev)
{
74 void *tmp;
74 -netdev_priv((const struct net_device *)dev)
{
1944 return ((void *)dev) + 3072U;;
}
74 return (struct hdlc_device *)tmp;;
}
1935 hdlc = tmp;
1936 hdlc->attach = &hdlcdev_attach;
1937 hdlc->xmit = &hdlcdev_xmit;
1940 -ldv_register_netdev_5(dev)
{
41 int ldv_func_res;
42 int tmp;
43 int tmp___0;
43 tmp = register_netdev(ldv_func_arg1) { /* Function call is skipped due to function is undefined */}
43 ldv_func_res = tmp;
45 -ldv_register_netdev()
{
36 int nondet;
39 assume(!(nondet < 0));
44 assume(nondet >= 0);
46 return 0;;
}
45 return tmp___0;;
}
1941 assume(!(rc != 0));
1947 info->netdev = dev;
1948 return 0;;
}
3736 return ;;
}
3845 -spinlock_check(&((port_array[port])->lock))
{
291 return &(lock->__annonCompField20.rlock);;
}
3845 __raw_spin_lock_init(&((port_array[port])->lock.__annonCompField20.rlock), "&(&port_array[port]->lock)->rlock", &__key) { /* Function call is skipped due to function is undefined */}
3842 port = port + 1;
3843 ldv_50174:;
3842 assume(port <= 3);
3844 goto ldv_50173;
3843 ldv_50173:;
3843 __memcpy((void *)(&((port_array[port])->port_array)), (const void *)(&port_array), 32UL) { /* Function call is skipped due to function is undefined */}
3844 -add_device(port_array[port])
{
3699 SLMP_INFO *current_dev;
3699 info->next_device = (struct _synclinkmp_info *)0;
3700 info->line = synclinkmp_device_count;
3701 sprintf((char *)(&(info->device_name)), "ttySLM%dp%d", info->adapter_num, info->port_num) { /* Function call is skipped due to function is undefined */}
3703 assume((info->line) <= 11);
3704 assume(!((maxframe[info->line]) != 0));
3708 synclinkmp_device_count = synclinkmp_device_count + 1;
3710 assume(!(((unsigned long)synclinkmp_device_list) == ((unsigned long)((SLMP_INFO *)0))));
3713 current_dev = synclinkmp_device_list;
3714 goto ldv_50144;
3714 unsigned long __CPAchecker_TMP_0 = (unsigned long)(current_dev->next_device);
3714 assume(!(__CPAchecker_TMP_0 != ((unsigned long)((struct _synclinkmp_info *)0))));
3716 current_dev->next_device = info;
3719 assume(!((info->max_frame_size) <= 4095U));
3721 assume((info->max_frame_size) > 65535U);
3722 info->max_frame_size = 65535U;
3724 printk("SyncLink MultiPort %s: Mem=(%08x %08X %08x %08X) IRQ=%d MaxFrameSize=%u\n", (char *)(&(info->device_name)), info->phys_sca_base, info->phys_memory_base, info->phys_statctrl_base, info->phys_lcr_base, info->irq_level, info->max_frame_size) { /* Function call is skipped due to function is undefined */}
3735 -hdlcdev_init(info)
{
1912 int rc;
1913 struct net_device *dev;
1914 hdlc_device *hdlc;
1915 struct hdlc_device *tmp;
1918 dev = alloc_hdlcdev((void *)info) { /* Function call is skipped due to function is undefined */}
1919 assume(!(((unsigned long)dev) == ((unsigned long)((struct net_device *)0))));
1925 unsigned long __CPAchecker_TMP_0 = (unsigned long)(info->phys_sca_base);
1925 dev->mem_start = __CPAchecker_TMP_0;
1926 dev->mem_end = (unsigned long)((info->phys_sca_base) + 511U);
1927 int __CPAchecker_TMP_1 = (int)(info->irq_level);
1927 dev->irq = __CPAchecker_TMP_1;
1930 dev->netdev_ops = &hdlcdev_ops;
1931 dev->watchdog_timeo = 2500;
1932 dev->tx_queue_len = 50UL;
1935 -dev_to_hdlc(dev)
{
74 void *tmp;
74 -netdev_priv((const struct net_device *)dev)
{
1944 return ((void *)dev) + 3072U;;
}
74 return (struct hdlc_device *)tmp;;
}
1935 hdlc = tmp;
1936 hdlc->attach = &hdlcdev_attach;
1937 hdlc->xmit = &hdlcdev_xmit;
1940 -ldv_register_netdev_5(dev)
{
41 int ldv_func_res;
42 int tmp;
43 int tmp___0;
43 tmp = register_netdev(ldv_func_arg1) { /* Function call is skipped due to function is undefined */}
43 ldv_func_res = tmp;
45 -ldv_register_netdev()
{
36 int nondet;
39 assume(!(nondet < 0));
44 assume(nondet >= 0);
46 return 0;;
}
45 return tmp___0;;
}
1941 assume(!(rc != 0));
1947 info->netdev = dev;
1948 return 0;;
}
3736 return ;;
}
3845 -spinlock_check(&((port_array[port])->lock))
{
291 return &(lock->__annonCompField20.rlock);;
}
3845 __raw_spin_lock_init(&((port_array[port])->lock.__annonCompField20.rlock), "&(&port_array[port]->lock)->rlock", &__key) { /* Function call is skipped due to function is undefined */}
3842 port = port + 1;
3843 ldv_50174:;
3842 assume(port <= 3);
3844 goto ldv_50173;
3843 ldv_50173:;
3843 __memcpy((void *)(&((port_array[port])->port_array)), (const void *)(&port_array), 32UL) { /* Function call is skipped due to function is undefined */}
3844 -add_device(port_array[port])
{
3699 SLMP_INFO *current_dev;
3699 info->next_device = (struct _synclinkmp_info *)0;
3700 info->line = synclinkmp_device_count;
3701 sprintf((char *)(&(info->device_name)), "ttySLM%dp%d", info->adapter_num, info->port_num) { /* Function call is skipped due to function is undefined */}
3703 assume((info->line) <= 11);
3704 assume(!((maxframe[info->line]) != 0));
3708 synclinkmp_device_count = synclinkmp_device_count + 1;
3710 assume(!(((unsigned long)synclinkmp_device_list) == ((unsigned long)((SLMP_INFO *)0))));
3713 current_dev = synclinkmp_device_list;
3714 goto ldv_50144;
3714 unsigned long __CPAchecker_TMP_0 = (unsigned long)(current_dev->next_device);
3714 assume(!(__CPAchecker_TMP_0 != ((unsigned long)((struct _synclinkmp_info *)0))));
3716 current_dev->next_device = info;
3719 assume(!((info->max_frame_size) <= 4095U));
3721 assume((info->max_frame_size) > 65535U);
3722 info->max_frame_size = 65535U;
3724 printk("SyncLink MultiPort %s: Mem=(%08x %08X %08x %08X) IRQ=%d MaxFrameSize=%u\n", (char *)(&(info->device_name)), info->phys_sca_base, info->phys_memory_base, info->phys_statctrl_base, info->phys_lcr_base, info->irq_level, info->max_frame_size) { /* Function call is skipped due to function is undefined */}
3735 -hdlcdev_init(info)
{
1912 int rc;
1913 struct net_device *dev;
1914 hdlc_device *hdlc;
1915 struct hdlc_device *tmp;
1918 dev = alloc_hdlcdev((void *)info) { /* Function call is skipped due to function is undefined */}
1919 assume(!(((unsigned long)dev) == ((unsigned long)((struct net_device *)0))));
1925 unsigned long __CPAchecker_TMP_0 = (unsigned long)(info->phys_sca_base);
1925 dev->mem_start = __CPAchecker_TMP_0;
1926 dev->mem_end = (unsigned long)((info->phys_sca_base) + 511U);
1927 int __CPAchecker_TMP_1 = (int)(info->irq_level);
1927 dev->irq = __CPAchecker_TMP_1;
1930 dev->netdev_ops = &hdlcdev_ops;
1931 dev->watchdog_timeo = 2500;
1932 dev->tx_queue_len = 50UL;
1935 -dev_to_hdlc(dev)
{
74 void *tmp;
74 -netdev_priv((const struct net_device *)dev)
{
1944 return ((void *)dev) + 3072U;;
}
74 return (struct hdlc_device *)tmp;;
}
1935 hdlc = tmp;
1936 hdlc->attach = &hdlcdev_attach;
1937 hdlc->xmit = &hdlcdev_xmit;
1940 -ldv_register_netdev_5(dev)
{
41 int ldv_func_res;
42 int tmp;
43 int tmp___0;
43 tmp = register_netdev(ldv_func_arg1) { /* Function call is skipped due to function is undefined */}
43 ldv_func_res = tmp;
45 -ldv_register_netdev()
{
36 int nondet;
39 assume(!(nondet < 0));
44 assume(nondet >= 0);
46 return 0;;
}
45 return tmp___0;;
}
1941 assume(!(rc != 0));
1947 info->netdev = dev;
1948 return 0;;
}
3736 return ;;
}
3845 -spinlock_check(&((port_array[port])->lock))
{
291 return &(lock->__annonCompField20.rlock);;
}
3845 __raw_spin_lock_init(&((port_array[port])->lock.__annonCompField20.rlock), "&(&port_array[port]->lock)->rlock", &__key) { /* Function call is skipped due to function is undefined */}
3842 port = port + 1;
3843 ldv_50174:;
3842 assume(port <= 3);
3844 goto ldv_50173;
3843 ldv_50173:;
3843 __memcpy((void *)(&((port_array[port])->port_array)), (const void *)(&port_array), 32UL) { /* Function call is skipped due to function is undefined */}
3844 -add_device(port_array[port])
{
3699 SLMP_INFO *current_dev;
3699 info->next_device = (struct _synclinkmp_info *)0;
3700 info->line = synclinkmp_device_count;
3701 sprintf((char *)(&(info->device_name)), "ttySLM%dp%d", info->adapter_num, info->port_num) { /* Function call is skipped due to function is undefined */}
3703 assume((info->line) <= 11);
3704 assume((maxframe[info->line]) != 0);
3705 info->max_frame_size = (u32 )(maxframe[info->line]);
3708 synclinkmp_device_count = synclinkmp_device_count + 1;
3710 assume(!(((unsigned long)synclinkmp_device_list) == ((unsigned long)((SLMP_INFO *)0))));
3713 current_dev = synclinkmp_device_list;
3714 goto ldv_50144;
3714 unsigned long __CPAchecker_TMP_0 = (unsigned long)(current_dev->next_device);
3714 assume(!(__CPAchecker_TMP_0 != ((unsigned long)((struct _synclinkmp_info *)0))));
3716 current_dev->next_device = info;
3719 assume(!((info->max_frame_size) <= 4095U));
3721 assume((info->max_frame_size) > 65535U);
3722 info->max_frame_size = 65535U;
3724 printk("SyncLink MultiPort %s: Mem=(%08x %08X %08x %08X) IRQ=%d MaxFrameSize=%u\n", (char *)(&(info->device_name)), info->phys_sca_base, info->phys_memory_base, info->phys_statctrl_base, info->phys_lcr_base, info->irq_level, info->max_frame_size) { /* Function call is skipped due to function is undefined */}
3735 -hdlcdev_init(info)
{
1912 int rc;
1913 struct net_device *dev;
1914 hdlc_device *hdlc;
1915 struct hdlc_device *tmp;
1918 dev = alloc_hdlcdev((void *)info) { /* Function call is skipped due to function is undefined */}
1919 assume(!(((unsigned long)dev) == ((unsigned long)((struct net_device *)0))));
1925 unsigned long __CPAchecker_TMP_0 = (unsigned long)(info->phys_sca_base);
1925 dev->mem_start = __CPAchecker_TMP_0;
1926 dev->mem_end = (unsigned long)((info->phys_sca_base) + 511U);
1927 int __CPAchecker_TMP_1 = (int)(info->irq_level);
1927 dev->irq = __CPAchecker_TMP_1;
1930 dev->netdev_ops = &hdlcdev_ops;
1931 dev->watchdog_timeo = 2500;
1932 dev->tx_queue_len = 50UL;
1935 -dev_to_hdlc(dev)
{
74 void *tmp;
74 -netdev_priv((const struct net_device *)dev)
{
1944 return ((void *)dev) + 3072U;;
}
74 return (struct hdlc_device *)tmp;;
}
1935 hdlc = tmp;
1936 hdlc->attach = &hdlcdev_attach;
1937 hdlc->xmit = &hdlcdev_xmit;
1940 -ldv_register_netdev_5(dev)
{
41 int ldv_func_res;
42 int tmp;
43 int tmp___0;
43 tmp = register_netdev(ldv_func_arg1) { /* Function call is skipped due to function is undefined */}
43 ldv_func_res = tmp;
45 -ldv_register_netdev()
{
36 int nondet;
39 assume(nondet < 0);
41 ldv_probe_state = 1;
43 return nondet;;
}
45 return tmp___0;;
}
1941 assume(rc != 0);
1942 printk("\f%s:unable to register hdlc device\n", (char *)"/home/ldvuser/ref_launch/work/current--X--drivers--X--defaultlinux-4.5-rc1.tar.xz--X--134_1a--X--cpachecker/linux-4.5-rc1.tar.xz/csd_deg_dscv/8588/dscv_tempdir/dscv/ri/134_1a/drivers/tty/synclinkmp.c") { /* Function call is skipped due to function is undefined */}
1943 free_netdev(dev) { /* Function call is skipped due to function is undefined */}
1944 return rc;;
}
3736 return ;;
}
3845 -spinlock_check(&((port_array[port])->lock))
{
291 return &(lock->__annonCompField20.rlock);;
}
3845 __raw_spin_lock_init(&((port_array[port])->lock.__annonCompField20.rlock), "&(&port_array[port]->lock)->rlock", &__key) { /* Function call is skipped due to function is undefined */}
3842 port = port + 1;
3843 ldv_50174:;
3842 assume(!(port <= 3));
3849 -claim_resources(port_array[0])
{
3554 struct resource *tmp;
3555 struct resource *tmp___0;
3556 struct resource *tmp___1;
3557 struct resource *tmp___2;
3558 void *tmp___3;
3559 void *tmp___4;
3560 void *tmp___5;
3561 void *tmp___6;
3562 _Bool tmp___7;
3563 int tmp___8;
3554 resource_size_t __CPAchecker_TMP_0 = (resource_size_t )(info->phys_memory_base);
3554 tmp = __request_region(&iomem_resource, __CPAchecker_TMP_0, 262144ULL, "synclinkmp", 0) { /* Function call is skipped due to function is undefined */}
3554 assume(!(((unsigned long)tmp) == ((unsigned long)((struct resource *)0))));
3561 info->shared_mem_requested = 1;
3563 tmp___0 = __request_region(&iomem_resource, (resource_size_t )((info->phys_lcr_base) + (info->lcr_offset)), 128ULL, "synclinkmp", 0) { /* Function call is skipped due to function is undefined */}
3563 assume(((unsigned long)tmp___0) == ((unsigned long)((struct resource *)0)));
3564 printk("%s(%d):%s lcr mem addr conflict, Addr=%08X\n", (char *)"/home/ldvuser/ref_launch/work/current--X--drivers--X--defaultlinux-4.5-rc1.tar.xz--X--134_1a--X--cpachecker/linux-4.5-rc1.tar.xz/csd_deg_dscv/8588/dscv_tempdir/dscv/ri/134_1a/drivers/tty/synclinkmp.c", 3565, (char *)(&(info->device_name)), info->phys_lcr_base) { /* Function call is skipped due to function is undefined */}
3566 info->init_error = 2U;
3567 goto errout;
3635 errout:;
3637 -release_resources(info)
{
3643 assume(!(debug_level > 2));
3647 int __CPAchecker_TMP_0 = (int)(info->irq_requested);
3647 assume(!(__CPAchecker_TMP_0 == 0));
3648 free_irq(info->irq_level, (void *)info) { /* Function call is skipped due to function is undefined */}
3649 info->irq_requested = 0;
3652 assume((info->shared_mem_requested) != 0);
3653 resource_size_t __CPAchecker_TMP_1 = (resource_size_t )(info->phys_memory_base);
3653 __release_region(&iomem_resource, __CPAchecker_TMP_1, 262144ULL) { /* Function call is skipped due to function is undefined */}
3654 info->shared_mem_requested = 0;
3656 assume(!((info->lcr_mem_requested) != 0));
3660 int __CPAchecker_TMP_2 = (int)(info->sca_base_requested);
3660 assume(!(__CPAchecker_TMP_2 == 0));
3661 __release_region(&iomem_resource, (resource_size_t )((info->phys_sca_base) + (info->sca_offset)), 512ULL) { /* Function call is skipped due to function is undefined */}
3662 info->sca_base_requested = 0;
3664 int __CPAchecker_TMP_3 = (int)(info->sca_statctrl_requested);
3664 assume(!(__CPAchecker_TMP_3 == 0));
3665 __release_region(&iomem_resource, (resource_size_t )((info->phys_statctrl_base) + (info->statctrl_offset)), 16ULL) { /* Function call is skipped due to function is undefined */}
3666 info->sca_statctrl_requested = 0;
3669 unsigned long __CPAchecker_TMP_4 = (unsigned long)(info->memory_base);
3669 assume(__CPAchecker_TMP_4 != ((unsigned long)((unsigned char *)0U)));
3670 volatile void *__CPAchecker_TMP_5 = (volatile void *)(info->memory_base);
3670 iounmap(__CPAchecker_TMP_5) { /* Function call is skipped due to function is undefined */}
3671 info->memory_base = (unsigned char *)0U;
3674 unsigned long __CPAchecker_TMP_6 = (unsigned long)(info->sca_base);
3674 assume(!(__CPAchecker_TMP_6 != ((unsigned long)((unsigned char *)0U))));
3679 unsigned long __CPAchecker_TMP_8 = (unsigned long)(info->statctrl_base);
3679 assume(!(__CPAchecker_TMP_8 != ((unsigned long)((unsigned char *)0U))));
3684 unsigned long __CPAchecker_TMP_10 = (unsigned long)(info->lcr_base);
3684 assume(!(__CPAchecker_TMP_10 != ((unsigned long)((unsigned char *)0U))));
3689 assume(!(debug_level > 2));
3692 return ;;
}
3638 return -19;;
}
3849 assume(!(tmp___0 == 0));
3879 return ;;
}
5594 return 0;;
}
12937 ldv_check_return_value(res_synclinkmp_init_one_121) { /* Function call is skipped due to function is undefined */}
12938 -ldv_check_return_value_probe(res_synclinkmp_init_one_121)
{
53 assume(ldv_probe_state == 1);
54 assume(retval == 0);
54 -ldv_error()
{
15 LDV_ERROR:;
}
}
}
Source code
1 2 /* 3 * $Id: synclinkmp.c,v 4.38 2005/07/15 13:29:44 paulkf Exp $ 4 * 5 * Device driver for Microgate SyncLink Multiport 6 * high speed multiprotocol serial adapter. 7 * 8 * written by Paul Fulghum for Microgate Corporation 9 * paulkf@microgate.com 10 * 11 * Microgate and SyncLink are trademarks of Microgate Corporation 12 * 13 * Derived from serial.c written by Theodore Ts'o and Linus Torvalds 14 * This code is released under the GNU General Public License (GPL) 15 * 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 20 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 24 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 26 * OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 #define VERSION(ver,rel,seq) (((ver)<<16) | ((rel)<<8) | (seq)) 30 #if defined(__i386__) 31 # define BREAKPOINT() asm(" int $3"); 32 #else 33 # define BREAKPOINT() { } 34 #endif 35 36 #define MAX_DEVICES 12 37 38 #include <linux/module.h> 39 #include <linux/errno.h> 40 #include <linux/signal.h> 41 #include <linux/sched.h> 42 #include <linux/timer.h> 43 #include <linux/interrupt.h> 44 #include <linux/pci.h> 45 #include <linux/tty.h> 46 #include <linux/tty_flip.h> 47 #include <linux/serial.h> 48 #include <linux/major.h> 49 #include <linux/string.h> 50 #include <linux/fcntl.h> 51 #include <linux/ptrace.h> 52 #include <linux/ioport.h> 53 #include <linux/mm.h> 54 #include <linux/seq_file.h> 55 #include <linux/slab.h> 56 #include <linux/netdevice.h> 57 #include <linux/vmalloc.h> 58 #include <linux/init.h> 59 #include <linux/delay.h> 60 #include <linux/ioctl.h> 61 62 #include <asm/io.h> 63 #include <asm/irq.h> 64 #include <asm/dma.h> 65 #include <linux/bitops.h> 66 #include <asm/types.h> 67 #include <linux/termios.h> 68 #include <linux/workqueue.h> 69 #include <linux/hdlc.h> 70 #include <linux/synclink.h> 71 72 #if defined(CONFIG_HDLC) || (defined(CONFIG_HDLC_MODULE) && defined(CONFIG_SYNCLINKMP_MODULE)) 73 #define SYNCLINK_GENERIC_HDLC 1 74 #else 75 #define SYNCLINK_GENERIC_HDLC 0 76 #endif 77 78 #define GET_USER(error,value,addr) error = get_user(value,addr) 79 #define COPY_FROM_USER(error,dest,src,size) error = copy_from_user(dest,src,size) ? -EFAULT : 0 80 #define PUT_USER(error,value,addr) error = put_user(value,addr) 81 #define COPY_TO_USER(error,dest,src,size) error = copy_to_user(dest,src,size) ? -EFAULT : 0 82 83 #include <asm/uaccess.h> 84 85 static MGSL_PARAMS default_params = { 86 MGSL_MODE_HDLC, /* unsigned long mode */ 87 0, /* unsigned char loopback; */ 88 HDLC_FLAG_UNDERRUN_ABORT15, /* unsigned short flags; */ 89 HDLC_ENCODING_NRZI_SPACE, /* unsigned char encoding; */ 90 0, /* unsigned long clock_speed; */ 91 0xff, /* unsigned char addr_filter; */ 92 HDLC_CRC_16_CCITT, /* unsigned short crc_type; */ 93 HDLC_PREAMBLE_LENGTH_8BITS, /* unsigned char preamble_length; */ 94 HDLC_PREAMBLE_PATTERN_NONE, /* unsigned char preamble; */ 95 9600, /* unsigned long data_rate; */ 96 8, /* unsigned char data_bits; */ 97 1, /* unsigned char stop_bits; */ 98 ASYNC_PARITY_NONE /* unsigned char parity; */ 99 }; 100 101 /* size in bytes of DMA data buffers */ 102 #define SCABUFSIZE 1024 103 #define SCA_MEM_SIZE 0x40000 104 #define SCA_BASE_SIZE 512 105 #define SCA_REG_SIZE 16 106 #define SCA_MAX_PORTS 4 107 #define SCAMAXDESC 128 108 109 #define BUFFERLISTSIZE 4096 110 111 /* SCA-I style DMA buffer descriptor */ 112 typedef struct _SCADESC 113 { 114 u16 next; /* lower l6 bits of next descriptor addr */ 115 u16 buf_ptr; /* lower 16 bits of buffer addr */ 116 u8 buf_base; /* upper 8 bits of buffer addr */ 117 u8 pad1; 118 u16 length; /* length of buffer */ 119 u8 status; /* status of buffer */ 120 u8 pad2; 121 } SCADESC, *PSCADESC; 122 123 typedef struct _SCADESC_EX 124 { 125 /* device driver bookkeeping section */ 126 char *virt_addr; /* virtual address of data buffer */ 127 u16 phys_entry; /* lower 16-bits of physical address of this descriptor */ 128 } SCADESC_EX, *PSCADESC_EX; 129 130 /* The queue of BH actions to be performed */ 131 132 #define BH_RECEIVE 1 133 #define BH_TRANSMIT 2 134 #define BH_STATUS 4 135 136 #define IO_PIN_SHUTDOWN_LIMIT 100 137 138 struct _input_signal_events { 139 int ri_up; 140 int ri_down; 141 int dsr_up; 142 int dsr_down; 143 int dcd_up; 144 int dcd_down; 145 int cts_up; 146 int cts_down; 147 }; 148 149 /* 150 * Device instance data structure 151 */ 152 typedef struct _synclinkmp_info { 153 void *if_ptr; /* General purpose pointer (used by SPPP) */ 154 int magic; 155 struct tty_port port; 156 int line; 157 unsigned short close_delay; 158 unsigned short closing_wait; /* time to wait before closing */ 159 160 struct mgsl_icount icount; 161 162 int timeout; 163 int x_char; /* xon/xoff character */ 164 u16 read_status_mask1; /* break detection (SR1 indications) */ 165 u16 read_status_mask2; /* parity/framing/overun (SR2 indications) */ 166 unsigned char ignore_status_mask1; /* break detection (SR1 indications) */ 167 unsigned char ignore_status_mask2; /* parity/framing/overun (SR2 indications) */ 168 unsigned char *tx_buf; 169 int tx_put; 170 int tx_get; 171 int tx_count; 172 173 wait_queue_head_t status_event_wait_q; 174 wait_queue_head_t event_wait_q; 175 struct timer_list tx_timer; /* HDLC transmit timeout timer */ 176 struct _synclinkmp_info *next_device; /* device list link */ 177 struct timer_list status_timer; /* input signal status check timer */ 178 179 spinlock_t lock; /* spinlock for synchronizing with ISR */ 180 struct work_struct task; /* task structure for scheduling bh */ 181 182 u32 max_frame_size; /* as set by device config */ 183 184 u32 pending_bh; 185 186 bool bh_running; /* Protection from multiple */ 187 int isr_overflow; 188 bool bh_requested; 189 190 int dcd_chkcount; /* check counts to prevent */ 191 int cts_chkcount; /* too many IRQs if a signal */ 192 int dsr_chkcount; /* is floating */ 193 int ri_chkcount; 194 195 char *buffer_list; /* virtual address of Rx & Tx buffer lists */ 196 unsigned long buffer_list_phys; 197 198 unsigned int rx_buf_count; /* count of total allocated Rx buffers */ 199 SCADESC *rx_buf_list; /* list of receive buffer entries */ 200 SCADESC_EX rx_buf_list_ex[SCAMAXDESC]; /* list of receive buffer entries */ 201 unsigned int current_rx_buf; 202 203 unsigned int tx_buf_count; /* count of total allocated Tx buffers */ 204 SCADESC *tx_buf_list; /* list of transmit buffer entries */ 205 SCADESC_EX tx_buf_list_ex[SCAMAXDESC]; /* list of transmit buffer entries */ 206 unsigned int last_tx_buf; 207 208 unsigned char *tmp_rx_buf; 209 unsigned int tmp_rx_buf_count; 210 211 bool rx_enabled; 212 bool rx_overflow; 213 214 bool tx_enabled; 215 bool tx_active; 216 u32 idle_mode; 217 218 unsigned char ie0_value; 219 unsigned char ie1_value; 220 unsigned char ie2_value; 221 unsigned char ctrlreg_value; 222 unsigned char old_signals; 223 224 char device_name[25]; /* device instance name */ 225 226 int port_count; 227 int adapter_num; 228 int port_num; 229 230 struct _synclinkmp_info *port_array[SCA_MAX_PORTS]; 231 232 unsigned int bus_type; /* expansion bus type (ISA,EISA,PCI) */ 233 234 unsigned int irq_level; /* interrupt level */ 235 unsigned long irq_flags; 236 bool irq_requested; /* true if IRQ requested */ 237 238 MGSL_PARAMS params; /* communications parameters */ 239 240 unsigned char serial_signals; /* current serial signal states */ 241 242 bool irq_occurred; /* for diagnostics use */ 243 unsigned int init_error; /* Initialization startup error */ 244 245 u32 last_mem_alloc; 246 unsigned char* memory_base; /* shared memory address (PCI only) */ 247 u32 phys_memory_base; 248 int shared_mem_requested; 249 250 unsigned char* sca_base; /* HD64570 SCA Memory address */ 251 u32 phys_sca_base; 252 u32 sca_offset; 253 bool sca_base_requested; 254 255 unsigned char* lcr_base; /* local config registers (PCI only) */ 256 u32 phys_lcr_base; 257 u32 lcr_offset; 258 int lcr_mem_requested; 259 260 unsigned char* statctrl_base; /* status/control register memory */ 261 u32 phys_statctrl_base; 262 u32 statctrl_offset; 263 bool sca_statctrl_requested; 264 265 u32 misc_ctrl_value; 266 char *flag_buf; 267 bool drop_rts_on_tx_done; 268 269 struct _input_signal_events input_signal_events; 270 271 /* SPPP/Cisco HDLC device parts */ 272 int netcount; 273 spinlock_t netlock; 274 275 #if SYNCLINK_GENERIC_HDLC 276 struct net_device *netdev; 277 #endif 278 279 } SLMP_INFO; 280 281 #define MGSL_MAGIC 0x5401 282 283 /* 284 * define serial signal status change macros 285 */ 286 #define MISCSTATUS_DCD_LATCHED (SerialSignal_DCD<<8) /* indicates change in DCD */ 287 #define MISCSTATUS_RI_LATCHED (SerialSignal_RI<<8) /* indicates change in RI */ 288 #define MISCSTATUS_CTS_LATCHED (SerialSignal_CTS<<8) /* indicates change in CTS */ 289 #define MISCSTATUS_DSR_LATCHED (SerialSignal_DSR<<8) /* change in DSR */ 290 291 /* Common Register macros */ 292 #define LPR 0x00 293 #define PABR0 0x02 294 #define PABR1 0x03 295 #define WCRL 0x04 296 #define WCRM 0x05 297 #define WCRH 0x06 298 #define DPCR 0x08 299 #define DMER 0x09 300 #define ISR0 0x10 301 #define ISR1 0x11 302 #define ISR2 0x12 303 #define IER0 0x14 304 #define IER1 0x15 305 #define IER2 0x16 306 #define ITCR 0x18 307 #define INTVR 0x1a 308 #define IMVR 0x1c 309 310 /* MSCI Register macros */ 311 #define TRB 0x20 312 #define TRBL 0x20 313 #define TRBH 0x21 314 #define SR0 0x22 315 #define SR1 0x23 316 #define SR2 0x24 317 #define SR3 0x25 318 #define FST 0x26 319 #define IE0 0x28 320 #define IE1 0x29 321 #define IE2 0x2a 322 #define FIE 0x2b 323 #define CMD 0x2c 324 #define MD0 0x2e 325 #define MD1 0x2f 326 #define MD2 0x30 327 #define CTL 0x31 328 #define SA0 0x32 329 #define SA1 0x33 330 #define IDL 0x34 331 #define TMC 0x35 332 #define RXS 0x36 333 #define TXS 0x37 334 #define TRC0 0x38 335 #define TRC1 0x39 336 #define RRC 0x3a 337 #define CST0 0x3c 338 #define CST1 0x3d 339 340 /* Timer Register Macros */ 341 #define TCNT 0x60 342 #define TCNTL 0x60 343 #define TCNTH 0x61 344 #define TCONR 0x62 345 #define TCONRL 0x62 346 #define TCONRH 0x63 347 #define TMCS 0x64 348 #define TEPR 0x65 349 350 /* DMA Controller Register macros */ 351 #define DARL 0x80 352 #define DARH 0x81 353 #define DARB 0x82 354 #define BAR 0x80 355 #define BARL 0x80 356 #define BARH 0x81 357 #define BARB 0x82 358 #define SAR 0x84 359 #define SARL 0x84 360 #define SARH 0x85 361 #define SARB 0x86 362 #define CPB 0x86 363 #define CDA 0x88 364 #define CDAL 0x88 365 #define CDAH 0x89 366 #define EDA 0x8a 367 #define EDAL 0x8a 368 #define EDAH 0x8b 369 #define BFL 0x8c 370 #define BFLL 0x8c 371 #define BFLH 0x8d 372 #define BCR 0x8e 373 #define BCRL 0x8e 374 #define BCRH 0x8f 375 #define DSR 0x90 376 #define DMR 0x91 377 #define FCT 0x93 378 #define DIR 0x94 379 #define DCMD 0x95 380 381 /* combine with timer or DMA register address */ 382 #define TIMER0 0x00 383 #define TIMER1 0x08 384 #define TIMER2 0x10 385 #define TIMER3 0x18 386 #define RXDMA 0x00 387 #define TXDMA 0x20 388 389 /* SCA Command Codes */ 390 #define NOOP 0x00 391 #define TXRESET 0x01 392 #define TXENABLE 0x02 393 #define TXDISABLE 0x03 394 #define TXCRCINIT 0x04 395 #define TXCRCEXCL 0x05 396 #define TXEOM 0x06 397 #define TXABORT 0x07 398 #define MPON 0x08 399 #define TXBUFCLR 0x09 400 #define RXRESET 0x11 401 #define RXENABLE 0x12 402 #define RXDISABLE 0x13 403 #define RXCRCINIT 0x14 404 #define RXREJECT 0x15 405 #define SEARCHMP 0x16 406 #define RXCRCEXCL 0x17 407 #define RXCRCCALC 0x18 408 #define CHRESET 0x21 409 #define HUNT 0x31 410 411 /* DMA command codes */ 412 #define SWABORT 0x01 413 #define FEICLEAR 0x02 414 415 /* IE0 */ 416 #define TXINTE BIT7 417 #define RXINTE BIT6 418 #define TXRDYE BIT1 419 #define RXRDYE BIT0 420 421 /* IE1 & SR1 */ 422 #define UDRN BIT7 423 #define IDLE BIT6 424 #define SYNCD BIT4 425 #define FLGD BIT4 426 #define CCTS BIT3 427 #define CDCD BIT2 428 #define BRKD BIT1 429 #define ABTD BIT1 430 #define GAPD BIT1 431 #define BRKE BIT0 432 #define IDLD BIT0 433 434 /* IE2 & SR2 */ 435 #define EOM BIT7 436 #define PMP BIT6 437 #define SHRT BIT6 438 #define PE BIT5 439 #define ABT BIT5 440 #define FRME BIT4 441 #define RBIT BIT4 442 #define OVRN BIT3 443 #define CRCE BIT2 444 445 446 /* 447 * Global linked list of SyncLink devices 448 */ 449 static SLMP_INFO *synclinkmp_device_list = NULL; 450 static int synclinkmp_adapter_count = -1; 451 static int synclinkmp_device_count = 0; 452 453 /* 454 * Set this param to non-zero to load eax with the 455 * .text section address and breakpoint on module load. 456 * This is useful for use with gdb and add-symbol-file command. 457 */ 458 static bool break_on_load = 0; 459 460 /* 461 * Driver major number, defaults to zero to get auto 462 * assigned major number. May be forced as module parameter. 463 */ 464 static int ttymajor = 0; 465 466 /* 467 * Array of user specified options for ISA adapters. 468 */ 469 static int debug_level = 0; 470 static int maxframe[MAX_DEVICES] = {0,}; 471 472 module_param(break_on_load, bool, 0); 473 module_param(ttymajor, int, 0); 474 module_param(debug_level, int, 0); 475 module_param_array(maxframe, int, NULL, 0); 476 477 static char *driver_name = "SyncLink MultiPort driver"; 478 static char *driver_version = "$Revision: 4.38 $"; 479 480 static int synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent); 481 static void synclinkmp_remove_one(struct pci_dev *dev); 482 483 static struct pci_device_id synclinkmp_pci_tbl[] = { 484 { PCI_VENDOR_ID_MICROGATE, PCI_DEVICE_ID_MICROGATE_SCA, PCI_ANY_ID, PCI_ANY_ID, }, 485 { 0, }, /* terminate list */ 486 }; 487 MODULE_DEVICE_TABLE(pci, synclinkmp_pci_tbl); 488 489 MODULE_LICENSE("GPL"); 490 491 static struct pci_driver synclinkmp_pci_driver = { 492 .name = "synclinkmp", 493 .id_table = synclinkmp_pci_tbl, 494 .probe = synclinkmp_init_one, 495 .remove = synclinkmp_remove_one, 496 }; 497 498 499 static struct tty_driver *serial_driver; 500 501 /* number of characters left in xmit buffer before we ask for more */ 502 #define WAKEUP_CHARS 256 503 504 505 /* tty callbacks */ 506 507 static int open(struct tty_struct *tty, struct file * filp); 508 static void close(struct tty_struct *tty, struct file * filp); 509 static void hangup(struct tty_struct *tty); 510 static void set_termios(struct tty_struct *tty, struct ktermios *old_termios); 511 512 static int write(struct tty_struct *tty, const unsigned char *buf, int count); 513 static int put_char(struct tty_struct *tty, unsigned char ch); 514 static void send_xchar(struct tty_struct *tty, char ch); 515 static void wait_until_sent(struct tty_struct *tty, int timeout); 516 static int write_room(struct tty_struct *tty); 517 static void flush_chars(struct tty_struct *tty); 518 static void flush_buffer(struct tty_struct *tty); 519 static void tx_hold(struct tty_struct *tty); 520 static void tx_release(struct tty_struct *tty); 521 522 static int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg); 523 static int chars_in_buffer(struct tty_struct *tty); 524 static void throttle(struct tty_struct * tty); 525 static void unthrottle(struct tty_struct * tty); 526 static int set_break(struct tty_struct *tty, int break_state); 527 528 #if SYNCLINK_GENERIC_HDLC 529 #define dev_to_port(D) (dev_to_hdlc(D)->priv) 530 static void hdlcdev_tx_done(SLMP_INFO *info); 531 static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size); 532 static int hdlcdev_init(SLMP_INFO *info); 533 static void hdlcdev_exit(SLMP_INFO *info); 534 #endif 535 536 /* ioctl handlers */ 537 538 static int get_stats(SLMP_INFO *info, struct mgsl_icount __user *user_icount); 539 static int get_params(SLMP_INFO *info, MGSL_PARAMS __user *params); 540 static int set_params(SLMP_INFO *info, MGSL_PARAMS __user *params); 541 static int get_txidle(SLMP_INFO *info, int __user *idle_mode); 542 static int set_txidle(SLMP_INFO *info, int idle_mode); 543 static int tx_enable(SLMP_INFO *info, int enable); 544 static int tx_abort(SLMP_INFO *info); 545 static int rx_enable(SLMP_INFO *info, int enable); 546 static int modem_input_wait(SLMP_INFO *info,int arg); 547 static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr); 548 static int tiocmget(struct tty_struct *tty); 549 static int tiocmset(struct tty_struct *tty, 550 unsigned int set, unsigned int clear); 551 static int set_break(struct tty_struct *tty, int break_state); 552 553 static void add_device(SLMP_INFO *info); 554 static void device_init(int adapter_num, struct pci_dev *pdev); 555 static int claim_resources(SLMP_INFO *info); 556 static void release_resources(SLMP_INFO *info); 557 558 static int startup(SLMP_INFO *info); 559 static int block_til_ready(struct tty_struct *tty, struct file * filp,SLMP_INFO *info); 560 static int carrier_raised(struct tty_port *port); 561 static void shutdown(SLMP_INFO *info); 562 static void program_hw(SLMP_INFO *info); 563 static void change_params(SLMP_INFO *info); 564 565 static bool init_adapter(SLMP_INFO *info); 566 static bool register_test(SLMP_INFO *info); 567 static bool irq_test(SLMP_INFO *info); 568 static bool loopback_test(SLMP_INFO *info); 569 static int adapter_test(SLMP_INFO *info); 570 static bool memory_test(SLMP_INFO *info); 571 572 static void reset_adapter(SLMP_INFO *info); 573 static void reset_port(SLMP_INFO *info); 574 static void async_mode(SLMP_INFO *info); 575 static void hdlc_mode(SLMP_INFO *info); 576 577 static void rx_stop(SLMP_INFO *info); 578 static void rx_start(SLMP_INFO *info); 579 static void rx_reset_buffers(SLMP_INFO *info); 580 static void rx_free_frame_buffers(SLMP_INFO *info, unsigned int first, unsigned int last); 581 static bool rx_get_frame(SLMP_INFO *info); 582 583 static void tx_start(SLMP_INFO *info); 584 static void tx_stop(SLMP_INFO *info); 585 static void tx_load_fifo(SLMP_INFO *info); 586 static void tx_set_idle(SLMP_INFO *info); 587 static void tx_load_dma_buffer(SLMP_INFO *info, const char *buf, unsigned int count); 588 589 static void get_signals(SLMP_INFO *info); 590 static void set_signals(SLMP_INFO *info); 591 static void enable_loopback(SLMP_INFO *info, int enable); 592 static void set_rate(SLMP_INFO *info, u32 data_rate); 593 594 static int bh_action(SLMP_INFO *info); 595 static void bh_handler(struct work_struct *work); 596 static void bh_receive(SLMP_INFO *info); 597 static void bh_transmit(SLMP_INFO *info); 598 static void bh_status(SLMP_INFO *info); 599 static void isr_timer(SLMP_INFO *info); 600 static void isr_rxint(SLMP_INFO *info); 601 static void isr_rxrdy(SLMP_INFO *info); 602 static void isr_txint(SLMP_INFO *info); 603 static void isr_txrdy(SLMP_INFO *info); 604 static void isr_rxdmaok(SLMP_INFO *info); 605 static void isr_rxdmaerror(SLMP_INFO *info); 606 static void isr_txdmaok(SLMP_INFO *info); 607 static void isr_txdmaerror(SLMP_INFO *info); 608 static void isr_io_pin(SLMP_INFO *info, u16 status); 609 610 static int alloc_dma_bufs(SLMP_INFO *info); 611 static void free_dma_bufs(SLMP_INFO *info); 612 static int alloc_buf_list(SLMP_INFO *info); 613 static int alloc_frame_bufs(SLMP_INFO *info, SCADESC *list, SCADESC_EX *list_ex,int count); 614 static int alloc_tmp_rx_buf(SLMP_INFO *info); 615 static void free_tmp_rx_buf(SLMP_INFO *info); 616 617 static void load_pci_memory(SLMP_INFO *info, char* dest, const char* src, unsigned short count); 618 static void trace_block(SLMP_INFO *info, const char* data, int count, int xmit); 619 static void tx_timeout(unsigned long context); 620 static void status_timeout(unsigned long context); 621 622 static unsigned char read_reg(SLMP_INFO *info, unsigned char addr); 623 static void write_reg(SLMP_INFO *info, unsigned char addr, unsigned char val); 624 static u16 read_reg16(SLMP_INFO *info, unsigned char addr); 625 static void write_reg16(SLMP_INFO *info, unsigned char addr, u16 val); 626 static unsigned char read_status_reg(SLMP_INFO * info); 627 static void write_control_reg(SLMP_INFO * info); 628 629 630 static unsigned char rx_active_fifo_level = 16; // rx request FIFO activation level in bytes 631 static unsigned char tx_active_fifo_level = 16; // tx request FIFO activation level in bytes 632 static unsigned char tx_negate_fifo_level = 32; // tx request FIFO negation level in bytes 633 634 static u32 misc_ctrl_value = 0x007e4040; 635 static u32 lcr1_brdr_value = 0x00800028; 636 637 static u32 read_ahead_count = 8; 638 639 /* DPCR, DMA Priority Control 640 * 641 * 07..05 Not used, must be 0 642 * 04 BRC, bus release condition: 0=all transfers complete 643 * 1=release after 1 xfer on all channels 644 * 03 CCC, channel change condition: 0=every cycle 645 * 1=after each channel completes all xfers 646 * 02..00 PR<2..0>, priority 100=round robin 647 * 648 * 00000100 = 0x00 649 */ 650 static unsigned char dma_priority = 0x04; 651 652 // Number of bytes that can be written to shared RAM 653 // in a single write operation 654 static u32 sca_pci_load_interval = 64; 655 656 /* 657 * 1st function defined in .text section. Calling this function in 658 * init_module() followed by a breakpoint allows a remote debugger 659 * (gdb) to get the .text address for the add-symbol-file command. 660 * This allows remote debugging of dynamically loadable modules. 661 */ 662 static void* synclinkmp_get_text_ptr(void); 663 static void* synclinkmp_get_text_ptr(void) {return synclinkmp_get_text_ptr;} 664 665 static inline int sanity_check(SLMP_INFO *info, 666 char *name, const char *routine) 667 { 668 #ifdef SANITY_CHECK 669 static const char *badmagic = 670 "Warning: bad magic number for synclinkmp_struct (%s) in %s\n"; 671 static const char *badinfo = 672 "Warning: null synclinkmp_struct for (%s) in %s\n"; 673 674 if (!info) { 675 printk(badinfo, name, routine); 676 return 1; 677 } 678 if (info->magic != MGSL_MAGIC) { 679 printk(badmagic, name, routine); 680 return 1; 681 } 682 #else 683 if (!info) 684 return 1; 685 #endif 686 return 0; 687 } 688 689 /** 690 * line discipline callback wrappers 691 * 692 * The wrappers maintain line discipline references 693 * while calling into the line discipline. 694 * 695 * ldisc_receive_buf - pass receive data to line discipline 696 */ 697 698 static void ldisc_receive_buf(struct tty_struct *tty, 699 const __u8 *data, char *flags, int count) 700 { 701 struct tty_ldisc *ld; 702 if (!tty) 703 return; 704 ld = tty_ldisc_ref(tty); 705 if (ld) { 706 if (ld->ops->receive_buf) 707 ld->ops->receive_buf(tty, data, flags, count); 708 tty_ldisc_deref(ld); 709 } 710 } 711 712 /* tty callbacks */ 713 714 static int install(struct tty_driver *driver, struct tty_struct *tty) 715 { 716 SLMP_INFO *info; 717 int line = tty->index; 718 719 if (line >= synclinkmp_device_count) { 720 printk("%s(%d): open with invalid line #%d.\n", 721 __FILE__,__LINE__,line); 722 return -ENODEV; 723 } 724 725 info = synclinkmp_device_list; 726 while (info && info->line != line) 727 info = info->next_device; 728 if (sanity_check(info, tty->name, "open")) 729 return -ENODEV; 730 if (info->init_error) { 731 printk("%s(%d):%s device is not allocated, init error=%d\n", 732 __FILE__, __LINE__, info->device_name, 733 info->init_error); 734 return -ENODEV; 735 } 736 737 tty->driver_data = info; 738 739 return tty_port_install(&info->port, driver, tty); 740 } 741 742 /* Called when a port is opened. Init and enable port. 743 */ 744 static int open(struct tty_struct *tty, struct file *filp) 745 { 746 SLMP_INFO *info = tty->driver_data; 747 unsigned long flags; 748 int retval; 749 750 info->port.tty = tty; 751 752 if (debug_level >= DEBUG_LEVEL_INFO) 753 printk("%s(%d):%s open(), old ref count = %d\n", 754 __FILE__,__LINE__,tty->driver->name, info->port.count); 755 756 info->port.low_latency = (info->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; 757 758 spin_lock_irqsave(&info->netlock, flags); 759 if (info->netcount) { 760 retval = -EBUSY; 761 spin_unlock_irqrestore(&info->netlock, flags); 762 goto cleanup; 763 } 764 info->port.count++; 765 spin_unlock_irqrestore(&info->netlock, flags); 766 767 if (info->port.count == 1) { 768 /* 1st open on this device, init hardware */ 769 retval = startup(info); 770 if (retval < 0) 771 goto cleanup; 772 } 773 774 retval = block_til_ready(tty, filp, info); 775 if (retval) { 776 if (debug_level >= DEBUG_LEVEL_INFO) 777 printk("%s(%d):%s block_til_ready() returned %d\n", 778 __FILE__,__LINE__, info->device_name, retval); 779 goto cleanup; 780 } 781 782 if (debug_level >= DEBUG_LEVEL_INFO) 783 printk("%s(%d):%s open() success\n", 784 __FILE__,__LINE__, info->device_name); 785 retval = 0; 786 787 cleanup: 788 if (retval) { 789 if (tty->count == 1) 790 info->port.tty = NULL; /* tty layer will release tty struct */ 791 if(info->port.count) 792 info->port.count--; 793 } 794 795 return retval; 796 } 797 798 /* Called when port is closed. Wait for remaining data to be 799 * sent. Disable port and free resources. 800 */ 801 static void close(struct tty_struct *tty, struct file *filp) 802 { 803 SLMP_INFO * info = tty->driver_data; 804 805 if (sanity_check(info, tty->name, "close")) 806 return; 807 808 if (debug_level >= DEBUG_LEVEL_INFO) 809 printk("%s(%d):%s close() entry, count=%d\n", 810 __FILE__,__LINE__, info->device_name, info->port.count); 811 812 if (tty_port_close_start(&info->port, tty, filp) == 0) 813 goto cleanup; 814 815 mutex_lock(&info->port.mutex); 816 if (info->port.flags & ASYNC_INITIALIZED) 817 wait_until_sent(tty, info->timeout); 818 819 flush_buffer(tty); 820 tty_ldisc_flush(tty); 821 shutdown(info); 822 mutex_unlock(&info->port.mutex); 823 824 tty_port_close_end(&info->port, tty); 825 info->port.tty = NULL; 826 cleanup: 827 if (debug_level >= DEBUG_LEVEL_INFO) 828 printk("%s(%d):%s close() exit, count=%d\n", __FILE__,__LINE__, 829 tty->driver->name, info->port.count); 830 } 831 832 /* Called by tty_hangup() when a hangup is signaled. 833 * This is the same as closing all open descriptors for the port. 834 */ 835 static void hangup(struct tty_struct *tty) 836 { 837 SLMP_INFO *info = tty->driver_data; 838 unsigned long flags; 839 840 if (debug_level >= DEBUG_LEVEL_INFO) 841 printk("%s(%d):%s hangup()\n", 842 __FILE__,__LINE__, info->device_name ); 843 844 if (sanity_check(info, tty->name, "hangup")) 845 return; 846 847 mutex_lock(&info->port.mutex); 848 flush_buffer(tty); 849 shutdown(info); 850 851 spin_lock_irqsave(&info->port.lock, flags); 852 info->port.count = 0; 853 info->port.flags &= ~ASYNC_NORMAL_ACTIVE; 854 info->port.tty = NULL; 855 spin_unlock_irqrestore(&info->port.lock, flags); 856 mutex_unlock(&info->port.mutex); 857 858 wake_up_interruptible(&info->port.open_wait); 859 } 860 861 /* Set new termios settings 862 */ 863 static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) 864 { 865 SLMP_INFO *info = tty->driver_data; 866 unsigned long flags; 867 868 if (debug_level >= DEBUG_LEVEL_INFO) 869 printk("%s(%d):%s set_termios()\n", __FILE__,__LINE__, 870 tty->driver->name ); 871 872 change_params(info); 873 874 /* Handle transition to B0 status */ 875 if (old_termios->c_cflag & CBAUD && 876 !(tty->termios.c_cflag & CBAUD)) { 877 info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); 878 spin_lock_irqsave(&info->lock,flags); 879 set_signals(info); 880 spin_unlock_irqrestore(&info->lock,flags); 881 } 882 883 /* Handle transition away from B0 status */ 884 if (!(old_termios->c_cflag & CBAUD) && 885 tty->termios.c_cflag & CBAUD) { 886 info->serial_signals |= SerialSignal_DTR; 887 if (!(tty->termios.c_cflag & CRTSCTS) || 888 !test_bit(TTY_THROTTLED, &tty->flags)) { 889 info->serial_signals |= SerialSignal_RTS; 890 } 891 spin_lock_irqsave(&info->lock,flags); 892 set_signals(info); 893 spin_unlock_irqrestore(&info->lock,flags); 894 } 895 896 /* Handle turning off CRTSCTS */ 897 if (old_termios->c_cflag & CRTSCTS && 898 !(tty->termios.c_cflag & CRTSCTS)) { 899 tty->hw_stopped = 0; 900 tx_release(tty); 901 } 902 } 903 904 /* Send a block of data 905 * 906 * Arguments: 907 * 908 * tty pointer to tty information structure 909 * buf pointer to buffer containing send data 910 * count size of send data in bytes 911 * 912 * Return Value: number of characters written 913 */ 914 static int write(struct tty_struct *tty, 915 const unsigned char *buf, int count) 916 { 917 int c, ret = 0; 918 SLMP_INFO *info = tty->driver_data; 919 unsigned long flags; 920 921 if (debug_level >= DEBUG_LEVEL_INFO) 922 printk("%s(%d):%s write() count=%d\n", 923 __FILE__,__LINE__,info->device_name,count); 924 925 if (sanity_check(info, tty->name, "write")) 926 goto cleanup; 927 928 if (!info->tx_buf) 929 goto cleanup; 930 931 if (info->params.mode == MGSL_MODE_HDLC) { 932 if (count > info->max_frame_size) { 933 ret = -EIO; 934 goto cleanup; 935 } 936 if (info->tx_active) 937 goto cleanup; 938 if (info->tx_count) { 939 /* send accumulated data from send_char() calls */ 940 /* as frame and wait before accepting more data. */ 941 tx_load_dma_buffer(info, info->tx_buf, info->tx_count); 942 goto start; 943 } 944 ret = info->tx_count = count; 945 tx_load_dma_buffer(info, buf, count); 946 goto start; 947 } 948 949 for (;;) { 950 c = min_t(int, count, 951 min(info->max_frame_size - info->tx_count - 1, 952 info->max_frame_size - info->tx_put)); 953 if (c <= 0) 954 break; 955 956 memcpy(info->tx_buf + info->tx_put, buf, c); 957 958 spin_lock_irqsave(&info->lock,flags); 959 info->tx_put += c; 960 if (info->tx_put >= info->max_frame_size) 961 info->tx_put -= info->max_frame_size; 962 info->tx_count += c; 963 spin_unlock_irqrestore(&info->lock,flags); 964 965 buf += c; 966 count -= c; 967 ret += c; 968 } 969 970 if (info->params.mode == MGSL_MODE_HDLC) { 971 if (count) { 972 ret = info->tx_count = 0; 973 goto cleanup; 974 } 975 tx_load_dma_buffer(info, info->tx_buf, info->tx_count); 976 } 977 start: 978 if (info->tx_count && !tty->stopped && !tty->hw_stopped) { 979 spin_lock_irqsave(&info->lock,flags); 980 if (!info->tx_active) 981 tx_start(info); 982 spin_unlock_irqrestore(&info->lock,flags); 983 } 984 985 cleanup: 986 if (debug_level >= DEBUG_LEVEL_INFO) 987 printk( "%s(%d):%s write() returning=%d\n", 988 __FILE__,__LINE__,info->device_name,ret); 989 return ret; 990 } 991 992 /* Add a character to the transmit buffer. 993 */ 994 static int put_char(struct tty_struct *tty, unsigned char ch) 995 { 996 SLMP_INFO *info = tty->driver_data; 997 unsigned long flags; 998 int ret = 0; 999 1000 if ( debug_level >= DEBUG_LEVEL_INFO ) { 1001 printk( "%s(%d):%s put_char(%d)\n", 1002 __FILE__,__LINE__,info->device_name,ch); 1003 } 1004 1005 if (sanity_check(info, tty->name, "put_char")) 1006 return 0; 1007 1008 if (!info->tx_buf) 1009 return 0; 1010 1011 spin_lock_irqsave(&info->lock,flags); 1012 1013 if ( (info->params.mode != MGSL_MODE_HDLC) || 1014 !info->tx_active ) { 1015 1016 if (info->tx_count < info->max_frame_size - 1) { 1017 info->tx_buf[info->tx_put++] = ch; 1018 if (info->tx_put >= info->max_frame_size) 1019 info->tx_put -= info->max_frame_size; 1020 info->tx_count++; 1021 ret = 1; 1022 } 1023 } 1024 1025 spin_unlock_irqrestore(&info->lock,flags); 1026 return ret; 1027 } 1028 1029 /* Send a high-priority XON/XOFF character 1030 */ 1031 static void send_xchar(struct tty_struct *tty, char ch) 1032 { 1033 SLMP_INFO *info = tty->driver_data; 1034 unsigned long flags; 1035 1036 if (debug_level >= DEBUG_LEVEL_INFO) 1037 printk("%s(%d):%s send_xchar(%d)\n", 1038 __FILE__,__LINE__, info->device_name, ch ); 1039 1040 if (sanity_check(info, tty->name, "send_xchar")) 1041 return; 1042 1043 info->x_char = ch; 1044 if (ch) { 1045 /* Make sure transmit interrupts are on */ 1046 spin_lock_irqsave(&info->lock,flags); 1047 if (!info->tx_enabled) 1048 tx_start(info); 1049 spin_unlock_irqrestore(&info->lock,flags); 1050 } 1051 } 1052 1053 /* Wait until the transmitter is empty. 1054 */ 1055 static void wait_until_sent(struct tty_struct *tty, int timeout) 1056 { 1057 SLMP_INFO * info = tty->driver_data; 1058 unsigned long orig_jiffies, char_time; 1059 1060 if (!info ) 1061 return; 1062 1063 if (debug_level >= DEBUG_LEVEL_INFO) 1064 printk("%s(%d):%s wait_until_sent() entry\n", 1065 __FILE__,__LINE__, info->device_name ); 1066 1067 if (sanity_check(info, tty->name, "wait_until_sent")) 1068 return; 1069 1070 if (!test_bit(ASYNCB_INITIALIZED, &info->port.flags)) 1071 goto exit; 1072 1073 orig_jiffies = jiffies; 1074 1075 /* Set check interval to 1/5 of estimated time to 1076 * send a character, and make it at least 1. The check 1077 * interval should also be less than the timeout. 1078 * Note: use tight timings here to satisfy the NIST-PCTS. 1079 */ 1080 1081 if ( info->params.data_rate ) { 1082 char_time = info->timeout/(32 * 5); 1083 if (!char_time) 1084 char_time++; 1085 } else 1086 char_time = 1; 1087 1088 if (timeout) 1089 char_time = min_t(unsigned long, char_time, timeout); 1090 1091 if ( info->params.mode == MGSL_MODE_HDLC ) { 1092 while (info->tx_active) { 1093 msleep_interruptible(jiffies_to_msecs(char_time)); 1094 if (signal_pending(current)) 1095 break; 1096 if (timeout && time_after(jiffies, orig_jiffies + timeout)) 1097 break; 1098 } 1099 } else { 1100 /* 1101 * TODO: determine if there is something similar to USC16C32 1102 * TXSTATUS_ALL_SENT status 1103 */ 1104 while ( info->tx_active && info->tx_enabled) { 1105 msleep_interruptible(jiffies_to_msecs(char_time)); 1106 if (signal_pending(current)) 1107 break; 1108 if (timeout && time_after(jiffies, orig_jiffies + timeout)) 1109 break; 1110 } 1111 } 1112 1113 exit: 1114 if (debug_level >= DEBUG_LEVEL_INFO) 1115 printk("%s(%d):%s wait_until_sent() exit\n", 1116 __FILE__,__LINE__, info->device_name ); 1117 } 1118 1119 /* Return the count of free bytes in transmit buffer 1120 */ 1121 static int write_room(struct tty_struct *tty) 1122 { 1123 SLMP_INFO *info = tty->driver_data; 1124 int ret; 1125 1126 if (sanity_check(info, tty->name, "write_room")) 1127 return 0; 1128 1129 if (info->params.mode == MGSL_MODE_HDLC) { 1130 ret = (info->tx_active) ? 0 : HDLC_MAX_FRAME_SIZE; 1131 } else { 1132 ret = info->max_frame_size - info->tx_count - 1; 1133 if (ret < 0) 1134 ret = 0; 1135 } 1136 1137 if (debug_level >= DEBUG_LEVEL_INFO) 1138 printk("%s(%d):%s write_room()=%d\n", 1139 __FILE__, __LINE__, info->device_name, ret); 1140 1141 return ret; 1142 } 1143 1144 /* enable transmitter and send remaining buffered characters 1145 */ 1146 static void flush_chars(struct tty_struct *tty) 1147 { 1148 SLMP_INFO *info = tty->driver_data; 1149 unsigned long flags; 1150 1151 if ( debug_level >= DEBUG_LEVEL_INFO ) 1152 printk( "%s(%d):%s flush_chars() entry tx_count=%d\n", 1153 __FILE__,__LINE__,info->device_name,info->tx_count); 1154 1155 if (sanity_check(info, tty->name, "flush_chars")) 1156 return; 1157 1158 if (info->tx_count <= 0 || tty->stopped || tty->hw_stopped || 1159 !info->tx_buf) 1160 return; 1161 1162 if ( debug_level >= DEBUG_LEVEL_INFO ) 1163 printk( "%s(%d):%s flush_chars() entry, starting transmitter\n", 1164 __FILE__,__LINE__,info->device_name ); 1165 1166 spin_lock_irqsave(&info->lock,flags); 1167 1168 if (!info->tx_active) { 1169 if ( (info->params.mode == MGSL_MODE_HDLC) && 1170 info->tx_count ) { 1171 /* operating in synchronous (frame oriented) mode */ 1172 /* copy data from circular tx_buf to */ 1173 /* transmit DMA buffer. */ 1174 tx_load_dma_buffer(info, 1175 info->tx_buf,info->tx_count); 1176 } 1177 tx_start(info); 1178 } 1179 1180 spin_unlock_irqrestore(&info->lock,flags); 1181 } 1182 1183 /* Discard all data in the send buffer 1184 */ 1185 static void flush_buffer(struct tty_struct *tty) 1186 { 1187 SLMP_INFO *info = tty->driver_data; 1188 unsigned long flags; 1189 1190 if (debug_level >= DEBUG_LEVEL_INFO) 1191 printk("%s(%d):%s flush_buffer() entry\n", 1192 __FILE__,__LINE__, info->device_name ); 1193 1194 if (sanity_check(info, tty->name, "flush_buffer")) 1195 return; 1196 1197 spin_lock_irqsave(&info->lock,flags); 1198 info->tx_count = info->tx_put = info->tx_get = 0; 1199 del_timer(&info->tx_timer); 1200 spin_unlock_irqrestore(&info->lock,flags); 1201 1202 tty_wakeup(tty); 1203 } 1204 1205 /* throttle (stop) transmitter 1206 */ 1207 static void tx_hold(struct tty_struct *tty) 1208 { 1209 SLMP_INFO *info = tty->driver_data; 1210 unsigned long flags; 1211 1212 if (sanity_check(info, tty->name, "tx_hold")) 1213 return; 1214 1215 if ( debug_level >= DEBUG_LEVEL_INFO ) 1216 printk("%s(%d):%s tx_hold()\n", 1217 __FILE__,__LINE__,info->device_name); 1218 1219 spin_lock_irqsave(&info->lock,flags); 1220 if (info->tx_enabled) 1221 tx_stop(info); 1222 spin_unlock_irqrestore(&info->lock,flags); 1223 } 1224 1225 /* release (start) transmitter 1226 */ 1227 static void tx_release(struct tty_struct *tty) 1228 { 1229 SLMP_INFO *info = tty->driver_data; 1230 unsigned long flags; 1231 1232 if (sanity_check(info, tty->name, "tx_release")) 1233 return; 1234 1235 if ( debug_level >= DEBUG_LEVEL_INFO ) 1236 printk("%s(%d):%s tx_release()\n", 1237 __FILE__,__LINE__,info->device_name); 1238 1239 spin_lock_irqsave(&info->lock,flags); 1240 if (!info->tx_enabled) 1241 tx_start(info); 1242 spin_unlock_irqrestore(&info->lock,flags); 1243 } 1244 1245 /* Service an IOCTL request 1246 * 1247 * Arguments: 1248 * 1249 * tty pointer to tty instance data 1250 * cmd IOCTL command code 1251 * arg command argument/context 1252 * 1253 * Return Value: 0 if success, otherwise error code 1254 */ 1255 static int ioctl(struct tty_struct *tty, 1256 unsigned int cmd, unsigned long arg) 1257 { 1258 SLMP_INFO *info = tty->driver_data; 1259 void __user *argp = (void __user *)arg; 1260 1261 if (debug_level >= DEBUG_LEVEL_INFO) 1262 printk("%s(%d):%s ioctl() cmd=%08X\n", __FILE__,__LINE__, 1263 info->device_name, cmd ); 1264 1265 if (sanity_check(info, tty->name, "ioctl")) 1266 return -ENODEV; 1267 1268 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 1269 (cmd != TIOCMIWAIT)) { 1270 if (tty->flags & (1 << TTY_IO_ERROR)) 1271 return -EIO; 1272 } 1273 1274 switch (cmd) { 1275 case MGSL_IOCGPARAMS: 1276 return get_params(info, argp); 1277 case MGSL_IOCSPARAMS: 1278 return set_params(info, argp); 1279 case MGSL_IOCGTXIDLE: 1280 return get_txidle(info, argp); 1281 case MGSL_IOCSTXIDLE: 1282 return set_txidle(info, (int)arg); 1283 case MGSL_IOCTXENABLE: 1284 return tx_enable(info, (int)arg); 1285 case MGSL_IOCRXENABLE: 1286 return rx_enable(info, (int)arg); 1287 case MGSL_IOCTXABORT: 1288 return tx_abort(info); 1289 case MGSL_IOCGSTATS: 1290 return get_stats(info, argp); 1291 case MGSL_IOCWAITEVENT: 1292 return wait_mgsl_event(info, argp); 1293 case MGSL_IOCLOOPTXDONE: 1294 return 0; // TODO: Not supported, need to document 1295 /* Wait for modem input (DCD,RI,DSR,CTS) change 1296 * as specified by mask in arg (TIOCM_RNG/DSR/CD/CTS) 1297 */ 1298 case TIOCMIWAIT: 1299 return modem_input_wait(info,(int)arg); 1300 1301 /* 1302 * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) 1303 * Return: write counters to the user passed counter struct 1304 * NB: both 1->0 and 0->1 transitions are counted except for 1305 * RI where only 0->1 is counted. 1306 */ 1307 default: 1308 return -ENOIOCTLCMD; 1309 } 1310 return 0; 1311 } 1312 1313 static int get_icount(struct tty_struct *tty, 1314 struct serial_icounter_struct *icount) 1315 { 1316 SLMP_INFO *info = tty->driver_data; 1317 struct mgsl_icount cnow; /* kernel counter temps */ 1318 unsigned long flags; 1319 1320 spin_lock_irqsave(&info->lock,flags); 1321 cnow = info->icount; 1322 spin_unlock_irqrestore(&info->lock,flags); 1323 1324 icount->cts = cnow.cts; 1325 icount->dsr = cnow.dsr; 1326 icount->rng = cnow.rng; 1327 icount->dcd = cnow.dcd; 1328 icount->rx = cnow.rx; 1329 icount->tx = cnow.tx; 1330 icount->frame = cnow.frame; 1331 icount->overrun = cnow.overrun; 1332 icount->parity = cnow.parity; 1333 icount->brk = cnow.brk; 1334 icount->buf_overrun = cnow.buf_overrun; 1335 1336 return 0; 1337 } 1338 1339 /* 1340 * /proc fs routines.... 1341 */ 1342 1343 static inline void line_info(struct seq_file *m, SLMP_INFO *info) 1344 { 1345 char stat_buf[30]; 1346 unsigned long flags; 1347 1348 seq_printf(m, "%s: SCABase=%08x Mem=%08X StatusControl=%08x LCR=%08X\n" 1349 "\tIRQ=%d MaxFrameSize=%u\n", 1350 info->device_name, 1351 info->phys_sca_base, 1352 info->phys_memory_base, 1353 info->phys_statctrl_base, 1354 info->phys_lcr_base, 1355 info->irq_level, 1356 info->max_frame_size ); 1357 1358 /* output current serial signal states */ 1359 spin_lock_irqsave(&info->lock,flags); 1360 get_signals(info); 1361 spin_unlock_irqrestore(&info->lock,flags); 1362 1363 stat_buf[0] = 0; 1364 stat_buf[1] = 0; 1365 if (info->serial_signals & SerialSignal_RTS) 1366 strcat(stat_buf, "|RTS"); 1367 if (info->serial_signals & SerialSignal_CTS) 1368 strcat(stat_buf, "|CTS"); 1369 if (info->serial_signals & SerialSignal_DTR) 1370 strcat(stat_buf, "|DTR"); 1371 if (info->serial_signals & SerialSignal_DSR) 1372 strcat(stat_buf, "|DSR"); 1373 if (info->serial_signals & SerialSignal_DCD) 1374 strcat(stat_buf, "|CD"); 1375 if (info->serial_signals & SerialSignal_RI) 1376 strcat(stat_buf, "|RI"); 1377 1378 if (info->params.mode == MGSL_MODE_HDLC) { 1379 seq_printf(m, "\tHDLC txok:%d rxok:%d", 1380 info->icount.txok, info->icount.rxok); 1381 if (info->icount.txunder) 1382 seq_printf(m, " txunder:%d", info->icount.txunder); 1383 if (info->icount.txabort) 1384 seq_printf(m, " txabort:%d", info->icount.txabort); 1385 if (info->icount.rxshort) 1386 seq_printf(m, " rxshort:%d", info->icount.rxshort); 1387 if (info->icount.rxlong) 1388 seq_printf(m, " rxlong:%d", info->icount.rxlong); 1389 if (info->icount.rxover) 1390 seq_printf(m, " rxover:%d", info->icount.rxover); 1391 if (info->icount.rxcrc) 1392 seq_printf(m, " rxlong:%d", info->icount.rxcrc); 1393 } else { 1394 seq_printf(m, "\tASYNC tx:%d rx:%d", 1395 info->icount.tx, info->icount.rx); 1396 if (info->icount.frame) 1397 seq_printf(m, " fe:%d", info->icount.frame); 1398 if (info->icount.parity) 1399 seq_printf(m, " pe:%d", info->icount.parity); 1400 if (info->icount.brk) 1401 seq_printf(m, " brk:%d", info->icount.brk); 1402 if (info->icount.overrun) 1403 seq_printf(m, " oe:%d", info->icount.overrun); 1404 } 1405 1406 /* Append serial signal status to end */ 1407 seq_printf(m, " %s\n", stat_buf+1); 1408 1409 seq_printf(m, "\ttxactive=%d bh_req=%d bh_run=%d pending_bh=%x\n", 1410 info->tx_active,info->bh_requested,info->bh_running, 1411 info->pending_bh); 1412 } 1413 1414 /* Called to print information about devices 1415 */ 1416 static int synclinkmp_proc_show(struct seq_file *m, void *v) 1417 { 1418 SLMP_INFO *info; 1419 1420 seq_printf(m, "synclinkmp driver:%s\n", driver_version); 1421 1422 info = synclinkmp_device_list; 1423 while( info ) { 1424 line_info(m, info); 1425 info = info->next_device; 1426 } 1427 return 0; 1428 } 1429 1430 static int synclinkmp_proc_open(struct inode *inode, struct file *file) 1431 { 1432 return single_open(file, synclinkmp_proc_show, NULL); 1433 } 1434 1435 static const struct file_operations synclinkmp_proc_fops = { 1436 .owner = THIS_MODULE, 1437 .open = synclinkmp_proc_open, 1438 .read = seq_read, 1439 .llseek = seq_lseek, 1440 .release = single_release, 1441 }; 1442 1443 /* Return the count of bytes in transmit buffer 1444 */ 1445 static int chars_in_buffer(struct tty_struct *tty) 1446 { 1447 SLMP_INFO *info = tty->driver_data; 1448 1449 if (sanity_check(info, tty->name, "chars_in_buffer")) 1450 return 0; 1451 1452 if (debug_level >= DEBUG_LEVEL_INFO) 1453 printk("%s(%d):%s chars_in_buffer()=%d\n", 1454 __FILE__, __LINE__, info->device_name, info->tx_count); 1455 1456 return info->tx_count; 1457 } 1458 1459 /* Signal remote device to throttle send data (our receive data) 1460 */ 1461 static void throttle(struct tty_struct * tty) 1462 { 1463 SLMP_INFO *info = tty->driver_data; 1464 unsigned long flags; 1465 1466 if (debug_level >= DEBUG_LEVEL_INFO) 1467 printk("%s(%d):%s throttle() entry\n", 1468 __FILE__,__LINE__, info->device_name ); 1469 1470 if (sanity_check(info, tty->name, "throttle")) 1471 return; 1472 1473 if (I_IXOFF(tty)) 1474 send_xchar(tty, STOP_CHAR(tty)); 1475 1476 if (tty->termios.c_cflag & CRTSCTS) { 1477 spin_lock_irqsave(&info->lock,flags); 1478 info->serial_signals &= ~SerialSignal_RTS; 1479 set_signals(info); 1480 spin_unlock_irqrestore(&info->lock,flags); 1481 } 1482 } 1483 1484 /* Signal remote device to stop throttling send data (our receive data) 1485 */ 1486 static void unthrottle(struct tty_struct * tty) 1487 { 1488 SLMP_INFO *info = tty->driver_data; 1489 unsigned long flags; 1490 1491 if (debug_level >= DEBUG_LEVEL_INFO) 1492 printk("%s(%d):%s unthrottle() entry\n", 1493 __FILE__,__LINE__, info->device_name ); 1494 1495 if (sanity_check(info, tty->name, "unthrottle")) 1496 return; 1497 1498 if (I_IXOFF(tty)) { 1499 if (info->x_char) 1500 info->x_char = 0; 1501 else 1502 send_xchar(tty, START_CHAR(tty)); 1503 } 1504 1505 if (tty->termios.c_cflag & CRTSCTS) { 1506 spin_lock_irqsave(&info->lock,flags); 1507 info->serial_signals |= SerialSignal_RTS; 1508 set_signals(info); 1509 spin_unlock_irqrestore(&info->lock,flags); 1510 } 1511 } 1512 1513 /* set or clear transmit break condition 1514 * break_state -1=set break condition, 0=clear 1515 */ 1516 static int set_break(struct tty_struct *tty, int break_state) 1517 { 1518 unsigned char RegValue; 1519 SLMP_INFO * info = tty->driver_data; 1520 unsigned long flags; 1521 1522 if (debug_level >= DEBUG_LEVEL_INFO) 1523 printk("%s(%d):%s set_break(%d)\n", 1524 __FILE__,__LINE__, info->device_name, break_state); 1525 1526 if (sanity_check(info, tty->name, "set_break")) 1527 return -EINVAL; 1528 1529 spin_lock_irqsave(&info->lock,flags); 1530 RegValue = read_reg(info, CTL); 1531 if (break_state == -1) 1532 RegValue |= BIT3; 1533 else 1534 RegValue &= ~BIT3; 1535 write_reg(info, CTL, RegValue); 1536 spin_unlock_irqrestore(&info->lock,flags); 1537 return 0; 1538 } 1539 1540 #if SYNCLINK_GENERIC_HDLC 1541 1542 /** 1543 * called by generic HDLC layer when protocol selected (PPP, frame relay, etc.) 1544 * set encoding and frame check sequence (FCS) options 1545 * 1546 * dev pointer to network device structure 1547 * encoding serial encoding setting 1548 * parity FCS setting 1549 * 1550 * returns 0 if success, otherwise error code 1551 */ 1552 static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, 1553 unsigned short parity) 1554 { 1555 SLMP_INFO *info = dev_to_port(dev); 1556 unsigned char new_encoding; 1557 unsigned short new_crctype; 1558 1559 /* return error if TTY interface open */ 1560 if (info->port.count) 1561 return -EBUSY; 1562 1563 switch (encoding) 1564 { 1565 case ENCODING_NRZ: new_encoding = HDLC_ENCODING_NRZ; break; 1566 case ENCODING_NRZI: new_encoding = HDLC_ENCODING_NRZI_SPACE; break; 1567 case ENCODING_FM_MARK: new_encoding = HDLC_ENCODING_BIPHASE_MARK; break; 1568 case ENCODING_FM_SPACE: new_encoding = HDLC_ENCODING_BIPHASE_SPACE; break; 1569 case ENCODING_MANCHESTER: new_encoding = HDLC_ENCODING_BIPHASE_LEVEL; break; 1570 default: return -EINVAL; 1571 } 1572 1573 switch (parity) 1574 { 1575 case PARITY_NONE: new_crctype = HDLC_CRC_NONE; break; 1576 case PARITY_CRC16_PR1_CCITT: new_crctype = HDLC_CRC_16_CCITT; break; 1577 case PARITY_CRC32_PR1_CCITT: new_crctype = HDLC_CRC_32_CCITT; break; 1578 default: return -EINVAL; 1579 } 1580 1581 info->params.encoding = new_encoding; 1582 info->params.crc_type = new_crctype; 1583 1584 /* if network interface up, reprogram hardware */ 1585 if (info->netcount) 1586 program_hw(info); 1587 1588 return 0; 1589 } 1590 1591 /** 1592 * called by generic HDLC layer to send frame 1593 * 1594 * skb socket buffer containing HDLC frame 1595 * dev pointer to network device structure 1596 */ 1597 static netdev_tx_t hdlcdev_xmit(struct sk_buff *skb, 1598 struct net_device *dev) 1599 { 1600 SLMP_INFO *info = dev_to_port(dev); 1601 unsigned long flags; 1602 1603 if (debug_level >= DEBUG_LEVEL_INFO) 1604 printk(KERN_INFO "%s:hdlc_xmit(%s)\n",__FILE__,dev->name); 1605 1606 /* stop sending until this frame completes */ 1607 netif_stop_queue(dev); 1608 1609 /* copy data to device buffers */ 1610 info->tx_count = skb->len; 1611 tx_load_dma_buffer(info, skb->data, skb->len); 1612 1613 /* update network statistics */ 1614 dev->stats.tx_packets++; 1615 dev->stats.tx_bytes += skb->len; 1616 1617 /* done with socket buffer, so free it */ 1618 dev_kfree_skb(skb); 1619 1620 /* save start time for transmit timeout detection */ 1621 dev->trans_start = jiffies; 1622 1623 /* start hardware transmitter if necessary */ 1624 spin_lock_irqsave(&info->lock,flags); 1625 if (!info->tx_active) 1626 tx_start(info); 1627 spin_unlock_irqrestore(&info->lock,flags); 1628 1629 return NETDEV_TX_OK; 1630 } 1631 1632 /** 1633 * called by network layer when interface enabled 1634 * claim resources and initialize hardware 1635 * 1636 * dev pointer to network device structure 1637 * 1638 * returns 0 if success, otherwise error code 1639 */ 1640 static int hdlcdev_open(struct net_device *dev) 1641 { 1642 SLMP_INFO *info = dev_to_port(dev); 1643 int rc; 1644 unsigned long flags; 1645 1646 if (debug_level >= DEBUG_LEVEL_INFO) 1647 printk("%s:hdlcdev_open(%s)\n",__FILE__,dev->name); 1648 1649 /* generic HDLC layer open processing */ 1650 rc = hdlc_open(dev); 1651 if (rc) 1652 return rc; 1653 1654 /* arbitrate between network and tty opens */ 1655 spin_lock_irqsave(&info->netlock, flags); 1656 if (info->port.count != 0 || info->netcount != 0) { 1657 printk(KERN_WARNING "%s: hdlc_open returning busy\n", dev->name); 1658 spin_unlock_irqrestore(&info->netlock, flags); 1659 return -EBUSY; 1660 } 1661 info->netcount=1; 1662 spin_unlock_irqrestore(&info->netlock, flags); 1663 1664 /* claim resources and init adapter */ 1665 if ((rc = startup(info)) != 0) { 1666 spin_lock_irqsave(&info->netlock, flags); 1667 info->netcount=0; 1668 spin_unlock_irqrestore(&info->netlock, flags); 1669 return rc; 1670 } 1671 1672 /* assert RTS and DTR, apply hardware settings */ 1673 info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; 1674 program_hw(info); 1675 1676 /* enable network layer transmit */ 1677 dev->trans_start = jiffies; 1678 netif_start_queue(dev); 1679 1680 /* inform generic HDLC layer of current DCD status */ 1681 spin_lock_irqsave(&info->lock, flags); 1682 get_signals(info); 1683 spin_unlock_irqrestore(&info->lock, flags); 1684 if (info->serial_signals & SerialSignal_DCD) 1685 netif_carrier_on(dev); 1686 else 1687 netif_carrier_off(dev); 1688 return 0; 1689 } 1690 1691 /** 1692 * called by network layer when interface is disabled 1693 * shutdown hardware and release resources 1694 * 1695 * dev pointer to network device structure 1696 * 1697 * returns 0 if success, otherwise error code 1698 */ 1699 static int hdlcdev_close(struct net_device *dev) 1700 { 1701 SLMP_INFO *info = dev_to_port(dev); 1702 unsigned long flags; 1703 1704 if (debug_level >= DEBUG_LEVEL_INFO) 1705 printk("%s:hdlcdev_close(%s)\n",__FILE__,dev->name); 1706 1707 netif_stop_queue(dev); 1708 1709 /* shutdown adapter and release resources */ 1710 shutdown(info); 1711 1712 hdlc_close(dev); 1713 1714 spin_lock_irqsave(&info->netlock, flags); 1715 info->netcount=0; 1716 spin_unlock_irqrestore(&info->netlock, flags); 1717 1718 return 0; 1719 } 1720 1721 /** 1722 * called by network layer to process IOCTL call to network device 1723 * 1724 * dev pointer to network device structure 1725 * ifr pointer to network interface request structure 1726 * cmd IOCTL command code 1727 * 1728 * returns 0 if success, otherwise error code 1729 */ 1730 static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 1731 { 1732 const size_t size = sizeof(sync_serial_settings); 1733 sync_serial_settings new_line; 1734 sync_serial_settings __user *line = ifr->ifr_settings.ifs_ifsu.sync; 1735 SLMP_INFO *info = dev_to_port(dev); 1736 unsigned int flags; 1737 1738 if (debug_level >= DEBUG_LEVEL_INFO) 1739 printk("%s:hdlcdev_ioctl(%s)\n",__FILE__,dev->name); 1740 1741 /* return error if TTY interface open */ 1742 if (info->port.count) 1743 return -EBUSY; 1744 1745 if (cmd != SIOCWANDEV) 1746 return hdlc_ioctl(dev, ifr, cmd); 1747 1748 switch(ifr->ifr_settings.type) { 1749 case IF_GET_IFACE: /* return current sync_serial_settings */ 1750 1751 ifr->ifr_settings.type = IF_IFACE_SYNC_SERIAL; 1752 if (ifr->ifr_settings.size < size) { 1753 ifr->ifr_settings.size = size; /* data size wanted */ 1754 return -ENOBUFS; 1755 } 1756 1757 flags = info->params.flags & (HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_RXC_DPLL | 1758 HDLC_FLAG_RXC_BRG | HDLC_FLAG_RXC_TXCPIN | 1759 HDLC_FLAG_TXC_TXCPIN | HDLC_FLAG_TXC_DPLL | 1760 HDLC_FLAG_TXC_BRG | HDLC_FLAG_TXC_RXCPIN); 1761 1762 memset(&new_line, 0, sizeof(new_line)); 1763 switch (flags){ 1764 case (HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_TXC_TXCPIN): new_line.clock_type = CLOCK_EXT; break; 1765 case (HDLC_FLAG_RXC_BRG | HDLC_FLAG_TXC_BRG): new_line.clock_type = CLOCK_INT; break; 1766 case (HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_TXC_BRG): new_line.clock_type = CLOCK_TXINT; break; 1767 case (HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_TXC_RXCPIN): new_line.clock_type = CLOCK_TXFROMRX; break; 1768 default: new_line.clock_type = CLOCK_DEFAULT; 1769 } 1770 1771 new_line.clock_rate = info->params.clock_speed; 1772 new_line.loopback = info->params.loopback ? 1:0; 1773 1774 if (copy_to_user(line, &new_line, size)) 1775 return -EFAULT; 1776 return 0; 1777 1778 case IF_IFACE_SYNC_SERIAL: /* set sync_serial_settings */ 1779 1780 if(!capable(CAP_NET_ADMIN)) 1781 return -EPERM; 1782 if (copy_from_user(&new_line, line, size)) 1783 return -EFAULT; 1784 1785 switch (new_line.clock_type) 1786 { 1787 case CLOCK_EXT: flags = HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_TXC_TXCPIN; break; 1788 case CLOCK_TXFROMRX: flags = HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_TXC_RXCPIN; break; 1789 case CLOCK_INT: flags = HDLC_FLAG_RXC_BRG | HDLC_FLAG_TXC_BRG; break; 1790 case CLOCK_TXINT: flags = HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_TXC_BRG; break; 1791 case CLOCK_DEFAULT: flags = info->params.flags & 1792 (HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_RXC_DPLL | 1793 HDLC_FLAG_RXC_BRG | HDLC_FLAG_RXC_TXCPIN | 1794 HDLC_FLAG_TXC_TXCPIN | HDLC_FLAG_TXC_DPLL | 1795 HDLC_FLAG_TXC_BRG | HDLC_FLAG_TXC_RXCPIN); break; 1796 default: return -EINVAL; 1797 } 1798 1799 if (new_line.loopback != 0 && new_line.loopback != 1) 1800 return -EINVAL; 1801 1802 info->params.flags &= ~(HDLC_FLAG_RXC_RXCPIN | HDLC_FLAG_RXC_DPLL | 1803 HDLC_FLAG_RXC_BRG | HDLC_FLAG_RXC_TXCPIN | 1804 HDLC_FLAG_TXC_TXCPIN | HDLC_FLAG_TXC_DPLL | 1805 HDLC_FLAG_TXC_BRG | HDLC_FLAG_TXC_RXCPIN); 1806 info->params.flags |= flags; 1807 1808 info->params.loopback = new_line.loopback; 1809 1810 if (flags & (HDLC_FLAG_RXC_BRG | HDLC_FLAG_TXC_BRG)) 1811 info->params.clock_speed = new_line.clock_rate; 1812 else 1813 info->params.clock_speed = 0; 1814 1815 /* if network interface up, reprogram hardware */ 1816 if (info->netcount) 1817 program_hw(info); 1818 return 0; 1819 1820 default: 1821 return hdlc_ioctl(dev, ifr, cmd); 1822 } 1823 } 1824 1825 /** 1826 * called by network layer when transmit timeout is detected 1827 * 1828 * dev pointer to network device structure 1829 */ 1830 static void hdlcdev_tx_timeout(struct net_device *dev) 1831 { 1832 SLMP_INFO *info = dev_to_port(dev); 1833 unsigned long flags; 1834 1835 if (debug_level >= DEBUG_LEVEL_INFO) 1836 printk("hdlcdev_tx_timeout(%s)\n",dev->name); 1837 1838 dev->stats.tx_errors++; 1839 dev->stats.tx_aborted_errors++; 1840 1841 spin_lock_irqsave(&info->lock,flags); 1842 tx_stop(info); 1843 spin_unlock_irqrestore(&info->lock,flags); 1844 1845 netif_wake_queue(dev); 1846 } 1847 1848 /** 1849 * called by device driver when transmit completes 1850 * reenable network layer transmit if stopped 1851 * 1852 * info pointer to device instance information 1853 */ 1854 static void hdlcdev_tx_done(SLMP_INFO *info) 1855 { 1856 if (netif_queue_stopped(info->netdev)) 1857 netif_wake_queue(info->netdev); 1858 } 1859 1860 /** 1861 * called by device driver when frame received 1862 * pass frame to network layer 1863 * 1864 * info pointer to device instance information 1865 * buf pointer to buffer contianing frame data 1866 * size count of data bytes in buf 1867 */ 1868 static void hdlcdev_rx(SLMP_INFO *info, char *buf, int size) 1869 { 1870 struct sk_buff *skb = dev_alloc_skb(size); 1871 struct net_device *dev = info->netdev; 1872 1873 if (debug_level >= DEBUG_LEVEL_INFO) 1874 printk("hdlcdev_rx(%s)\n",dev->name); 1875 1876 if (skb == NULL) { 1877 printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", 1878 dev->name); 1879 dev->stats.rx_dropped++; 1880 return; 1881 } 1882 1883 memcpy(skb_put(skb, size), buf, size); 1884 1885 skb->protocol = hdlc_type_trans(skb, dev); 1886 1887 dev->stats.rx_packets++; 1888 dev->stats.rx_bytes += size; 1889 1890 netif_rx(skb); 1891 } 1892 1893 static const struct net_device_ops hdlcdev_ops = { 1894 .ndo_open = hdlcdev_open, 1895 .ndo_stop = hdlcdev_close, 1896 .ndo_change_mtu = hdlc_change_mtu, 1897 .ndo_start_xmit = hdlc_start_xmit, 1898 .ndo_do_ioctl = hdlcdev_ioctl, 1899 .ndo_tx_timeout = hdlcdev_tx_timeout, 1900 }; 1901 1902 /** 1903 * called by device driver when adding device instance 1904 * do generic HDLC initialization 1905 * 1906 * info pointer to device instance information 1907 * 1908 * returns 0 if success, otherwise error code 1909 */ 1910 static int hdlcdev_init(SLMP_INFO *info) 1911 { 1912 int rc; 1913 struct net_device *dev; 1914 hdlc_device *hdlc; 1915 1916 /* allocate and initialize network and HDLC layer objects */ 1917 1918 dev = alloc_hdlcdev(info); 1919 if (!dev) { 1920 printk(KERN_ERR "%s:hdlc device allocation failure\n",__FILE__); 1921 return -ENOMEM; 1922 } 1923 1924 /* for network layer reporting purposes only */ 1925 dev->mem_start = info->phys_sca_base; 1926 dev->mem_end = info->phys_sca_base + SCA_BASE_SIZE - 1; 1927 dev->irq = info->irq_level; 1928 1929 /* network layer callbacks and settings */ 1930 dev->netdev_ops = &hdlcdev_ops; 1931 dev->watchdog_timeo = 10 * HZ; 1932 dev->tx_queue_len = 50; 1933 1934 /* generic HDLC layer callbacks and settings */ 1935 hdlc = dev_to_hdlc(dev); 1936 hdlc->attach = hdlcdev_attach; 1937 hdlc->xmit = hdlcdev_xmit; 1938 1939 /* register objects with HDLC layer */ 1940 rc = register_hdlc_device(dev); 1941 if (rc) { 1942 printk(KERN_WARNING "%s:unable to register hdlc device\n",__FILE__); 1943 free_netdev(dev); 1944 return rc; 1945 } 1946 1947 info->netdev = dev; 1948 return 0; 1949 } 1950 1951 /** 1952 * called by device driver when removing device instance 1953 * do generic HDLC cleanup 1954 * 1955 * info pointer to device instance information 1956 */ 1957 static void hdlcdev_exit(SLMP_INFO *info) 1958 { 1959 unregister_hdlc_device(info->netdev); 1960 free_netdev(info->netdev); 1961 info->netdev = NULL; 1962 } 1963 1964 #endif /* CONFIG_HDLC */ 1965 1966 1967 /* Return next bottom half action to perform. 1968 * Return Value: BH action code or 0 if nothing to do. 1969 */ 1970 static int bh_action(SLMP_INFO *info) 1971 { 1972 unsigned long flags; 1973 int rc = 0; 1974 1975 spin_lock_irqsave(&info->lock,flags); 1976 1977 if (info->pending_bh & BH_RECEIVE) { 1978 info->pending_bh &= ~BH_RECEIVE; 1979 rc = BH_RECEIVE; 1980 } else if (info->pending_bh & BH_TRANSMIT) { 1981 info->pending_bh &= ~BH_TRANSMIT; 1982 rc = BH_TRANSMIT; 1983 } else if (info->pending_bh & BH_STATUS) { 1984 info->pending_bh &= ~BH_STATUS; 1985 rc = BH_STATUS; 1986 } 1987 1988 if (!rc) { 1989 /* Mark BH routine as complete */ 1990 info->bh_running = false; 1991 info->bh_requested = false; 1992 } 1993 1994 spin_unlock_irqrestore(&info->lock,flags); 1995 1996 return rc; 1997 } 1998 1999 /* Perform bottom half processing of work items queued by ISR. 2000 */ 2001 static void bh_handler(struct work_struct *work) 2002 { 2003 SLMP_INFO *info = container_of(work, SLMP_INFO, task); 2004 int action; 2005 2006 if ( debug_level >= DEBUG_LEVEL_BH ) 2007 printk( "%s(%d):%s bh_handler() entry\n", 2008 __FILE__,__LINE__,info->device_name); 2009 2010 info->bh_running = true; 2011 2012 while((action = bh_action(info)) != 0) { 2013 2014 /* Process work item */ 2015 if ( debug_level >= DEBUG_LEVEL_BH ) 2016 printk( "%s(%d):%s bh_handler() work item action=%d\n", 2017 __FILE__,__LINE__,info->device_name, action); 2018 2019 switch (action) { 2020 2021 case BH_RECEIVE: 2022 bh_receive(info); 2023 break; 2024 case BH_TRANSMIT: 2025 bh_transmit(info); 2026 break; 2027 case BH_STATUS: 2028 bh_status(info); 2029 break; 2030 default: 2031 /* unknown work item ID */ 2032 printk("%s(%d):%s Unknown work item ID=%08X!\n", 2033 __FILE__,__LINE__,info->device_name,action); 2034 break; 2035 } 2036 } 2037 2038 if ( debug_level >= DEBUG_LEVEL_BH ) 2039 printk( "%s(%d):%s bh_handler() exit\n", 2040 __FILE__,__LINE__,info->device_name); 2041 } 2042 2043 static void bh_receive(SLMP_INFO *info) 2044 { 2045 if ( debug_level >= DEBUG_LEVEL_BH ) 2046 printk( "%s(%d):%s bh_receive()\n", 2047 __FILE__,__LINE__,info->device_name); 2048 2049 while( rx_get_frame(info) ); 2050 } 2051 2052 static void bh_transmit(SLMP_INFO *info) 2053 { 2054 struct tty_struct *tty = info->port.tty; 2055 2056 if ( debug_level >= DEBUG_LEVEL_BH ) 2057 printk( "%s(%d):%s bh_transmit() entry\n", 2058 __FILE__,__LINE__,info->device_name); 2059 2060 if (tty) 2061 tty_wakeup(tty); 2062 } 2063 2064 static void bh_status(SLMP_INFO *info) 2065 { 2066 if ( debug_level >= DEBUG_LEVEL_BH ) 2067 printk( "%s(%d):%s bh_status() entry\n", 2068 __FILE__,__LINE__,info->device_name); 2069 2070 info->ri_chkcount = 0; 2071 info->dsr_chkcount = 0; 2072 info->dcd_chkcount = 0; 2073 info->cts_chkcount = 0; 2074 } 2075 2076 static void isr_timer(SLMP_INFO * info) 2077 { 2078 unsigned char timer = (info->port_num & 1) ? TIMER2 : TIMER0; 2079 2080 /* IER2<7..4> = timer<3..0> interrupt enables (0=disabled) */ 2081 write_reg(info, IER2, 0); 2082 2083 /* TMCS, Timer Control/Status Register 2084 * 2085 * 07 CMF, Compare match flag (read only) 1=match 2086 * 06 ECMI, CMF Interrupt Enable: 0=disabled 2087 * 05 Reserved, must be 0 2088 * 04 TME, Timer Enable 2089 * 03..00 Reserved, must be 0 2090 * 2091 * 0000 0000 2092 */ 2093 write_reg(info, (unsigned char)(timer + TMCS), 0); 2094 2095 info->irq_occurred = true; 2096 2097 if ( debug_level >= DEBUG_LEVEL_ISR ) 2098 printk("%s(%d):%s isr_timer()\n", 2099 __FILE__,__LINE__,info->device_name); 2100 } 2101 2102 static void isr_rxint(SLMP_INFO * info) 2103 { 2104 struct tty_struct *tty = info->port.tty; 2105 struct mgsl_icount *icount = &info->icount; 2106 unsigned char status = read_reg(info, SR1) & info->ie1_value & (FLGD + IDLD + CDCD + BRKD); 2107 unsigned char status2 = read_reg(info, SR2) & info->ie2_value & OVRN; 2108 2109 /* clear status bits */ 2110 if (status) 2111 write_reg(info, SR1, status); 2112 2113 if (status2) 2114 write_reg(info, SR2, status2); 2115 2116 if ( debug_level >= DEBUG_LEVEL_ISR ) 2117 printk("%s(%d):%s isr_rxint status=%02X %02x\n", 2118 __FILE__,__LINE__,info->device_name,status,status2); 2119 2120 if (info->params.mode == MGSL_MODE_ASYNC) { 2121 if (status & BRKD) { 2122 icount->brk++; 2123 2124 /* process break detection if tty control 2125 * is not set to ignore it 2126 */ 2127 if (!(status & info->ignore_status_mask1)) { 2128 if (info->read_status_mask1 & BRKD) { 2129 tty_insert_flip_char(&info->port, 0, TTY_BREAK); 2130 if (tty && (info->port.flags & ASYNC_SAK)) 2131 do_SAK(tty); 2132 } 2133 } 2134 } 2135 } 2136 else { 2137 if (status & (FLGD|IDLD)) { 2138 if (status & FLGD) 2139 info->icount.exithunt++; 2140 else if (status & IDLD) 2141 info->icount.rxidle++; 2142 wake_up_interruptible(&info->event_wait_q); 2143 } 2144 } 2145 2146 if (status & CDCD) { 2147 /* simulate a common modem status change interrupt 2148 * for our handler 2149 */ 2150 get_signals( info ); 2151 isr_io_pin(info, 2152 MISCSTATUS_DCD_LATCHED|(info->serial_signals&SerialSignal_DCD)); 2153 } 2154 } 2155 2156 /* 2157 * handle async rx data interrupts 2158 */ 2159 static void isr_rxrdy(SLMP_INFO * info) 2160 { 2161 u16 status; 2162 unsigned char DataByte; 2163 struct mgsl_icount *icount = &info->icount; 2164 2165 if ( debug_level >= DEBUG_LEVEL_ISR ) 2166 printk("%s(%d):%s isr_rxrdy\n", 2167 __FILE__,__LINE__,info->device_name); 2168 2169 while((status = read_reg(info,CST0)) & BIT0) 2170 { 2171 int flag = 0; 2172 bool over = false; 2173 DataByte = read_reg(info,TRB); 2174 2175 icount->rx++; 2176 2177 if ( status & (PE + FRME + OVRN) ) { 2178 printk("%s(%d):%s rxerr=%04X\n", 2179 __FILE__,__LINE__,info->device_name,status); 2180 2181 /* update error statistics */ 2182 if (status & PE) 2183 icount->parity++; 2184 else if (status & FRME) 2185 icount->frame++; 2186 else if (status & OVRN) 2187 icount->overrun++; 2188 2189 /* discard char if tty control flags say so */ 2190 if (status & info->ignore_status_mask2) 2191 continue; 2192 2193 status &= info->read_status_mask2; 2194 2195 if (status & PE) 2196 flag = TTY_PARITY; 2197 else if (status & FRME) 2198 flag = TTY_FRAME; 2199 if (status & OVRN) { 2200 /* Overrun is special, since it's 2201 * reported immediately, and doesn't 2202 * affect the current character 2203 */ 2204 over = true; 2205 } 2206 } /* end of if (error) */ 2207 2208 tty_insert_flip_char(&info->port, DataByte, flag); 2209 if (over) 2210 tty_insert_flip_char(&info->port, 0, TTY_OVERRUN); 2211 } 2212 2213 if ( debug_level >= DEBUG_LEVEL_ISR ) { 2214 printk("%s(%d):%s rx=%d brk=%d parity=%d frame=%d overrun=%d\n", 2215 __FILE__,__LINE__,info->device_name, 2216 icount->rx,icount->brk,icount->parity, 2217 icount->frame,icount->overrun); 2218 } 2219 2220 tty_flip_buffer_push(&info->port); 2221 } 2222 2223 static void isr_txeom(SLMP_INFO * info, unsigned char status) 2224 { 2225 if ( debug_level >= DEBUG_LEVEL_ISR ) 2226 printk("%s(%d):%s isr_txeom status=%02x\n", 2227 __FILE__,__LINE__,info->device_name,status); 2228 2229 write_reg(info, TXDMA + DIR, 0x00); /* disable Tx DMA IRQs */ 2230 write_reg(info, TXDMA + DSR, 0xc0); /* clear IRQs and disable DMA */ 2231 write_reg(info, TXDMA + DCMD, SWABORT); /* reset/init DMA channel */ 2232 2233 if (status & UDRN) { 2234 write_reg(info, CMD, TXRESET); 2235 write_reg(info, CMD, TXENABLE); 2236 } else 2237 write_reg(info, CMD, TXBUFCLR); 2238 2239 /* disable and clear tx interrupts */ 2240 info->ie0_value &= ~TXRDYE; 2241 info->ie1_value &= ~(IDLE + UDRN); 2242 write_reg16(info, IE0, (unsigned short)((info->ie1_value << 8) + info->ie0_value)); 2243 write_reg(info, SR1, (unsigned char)(UDRN + IDLE)); 2244 2245 if ( info->tx_active ) { 2246 if (info->params.mode != MGSL_MODE_ASYNC) { 2247 if (status & UDRN) 2248 info->icount.txunder++; 2249 else if (status & IDLE) 2250 info->icount.txok++; 2251 } 2252 2253 info->tx_active = false; 2254 info->tx_count = info->tx_put = info->tx_get = 0; 2255 2256 del_timer(&info->tx_timer); 2257 2258 if (info->params.mode != MGSL_MODE_ASYNC && info->drop_rts_on_tx_done ) { 2259 info->serial_signals &= ~SerialSignal_RTS; 2260 info->drop_rts_on_tx_done = false; 2261 set_signals(info); 2262 } 2263 2264 #if SYNCLINK_GENERIC_HDLC 2265 if (info->netcount) 2266 hdlcdev_tx_done(info); 2267 else 2268 #endif 2269 { 2270 if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { 2271 tx_stop(info); 2272 return; 2273 } 2274 info->pending_bh |= BH_TRANSMIT; 2275 } 2276 } 2277 } 2278 2279 2280 /* 2281 * handle tx status interrupts 2282 */ 2283 static void isr_txint(SLMP_INFO * info) 2284 { 2285 unsigned char status = read_reg(info, SR1) & info->ie1_value & (UDRN + IDLE + CCTS); 2286 2287 /* clear status bits */ 2288 write_reg(info, SR1, status); 2289 2290 if ( debug_level >= DEBUG_LEVEL_ISR ) 2291 printk("%s(%d):%s isr_txint status=%02x\n", 2292 __FILE__,__LINE__,info->device_name,status); 2293 2294 if (status & (UDRN + IDLE)) 2295 isr_txeom(info, status); 2296 2297 if (status & CCTS) { 2298 /* simulate a common modem status change interrupt 2299 * for our handler 2300 */ 2301 get_signals( info ); 2302 isr_io_pin(info, 2303 MISCSTATUS_CTS_LATCHED|(info->serial_signals&SerialSignal_CTS)); 2304 2305 } 2306 } 2307 2308 /* 2309 * handle async tx data interrupts 2310 */ 2311 static void isr_txrdy(SLMP_INFO * info) 2312 { 2313 if ( debug_level >= DEBUG_LEVEL_ISR ) 2314 printk("%s(%d):%s isr_txrdy() tx_count=%d\n", 2315 __FILE__,__LINE__,info->device_name,info->tx_count); 2316 2317 if (info->params.mode != MGSL_MODE_ASYNC) { 2318 /* disable TXRDY IRQ, enable IDLE IRQ */ 2319 info->ie0_value &= ~TXRDYE; 2320 info->ie1_value |= IDLE; 2321 write_reg16(info, IE0, (unsigned short)((info->ie1_value << 8) + info->ie0_value)); 2322 return; 2323 } 2324 2325 if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { 2326 tx_stop(info); 2327 return; 2328 } 2329 2330 if ( info->tx_count ) 2331 tx_load_fifo( info ); 2332 else { 2333 info->tx_active = false; 2334 info->ie0_value &= ~TXRDYE; 2335 write_reg(info, IE0, info->ie0_value); 2336 } 2337 2338 if (info->tx_count < WAKEUP_CHARS) 2339 info->pending_bh |= BH_TRANSMIT; 2340 } 2341 2342 static void isr_rxdmaok(SLMP_INFO * info) 2343 { 2344 /* BIT7 = EOT (end of transfer) 2345 * BIT6 = EOM (end of message/frame) 2346 */ 2347 unsigned char status = read_reg(info,RXDMA + DSR) & 0xc0; 2348 2349 /* clear IRQ (BIT0 must be 1 to prevent clearing DE bit) */ 2350 write_reg(info, RXDMA + DSR, (unsigned char)(status | 1)); 2351 2352 if ( debug_level >= DEBUG_LEVEL_ISR ) 2353 printk("%s(%d):%s isr_rxdmaok(), status=%02x\n", 2354 __FILE__,__LINE__,info->device_name,status); 2355 2356 info->pending_bh |= BH_RECEIVE; 2357 } 2358 2359 static void isr_rxdmaerror(SLMP_INFO * info) 2360 { 2361 /* BIT5 = BOF (buffer overflow) 2362 * BIT4 = COF (counter overflow) 2363 */ 2364 unsigned char status = read_reg(info,RXDMA + DSR) & 0x30; 2365 2366 /* clear IRQ (BIT0 must be 1 to prevent clearing DE bit) */ 2367 write_reg(info, RXDMA + DSR, (unsigned char)(status | 1)); 2368 2369 if ( debug_level >= DEBUG_LEVEL_ISR ) 2370 printk("%s(%d):%s isr_rxdmaerror(), status=%02x\n", 2371 __FILE__,__LINE__,info->device_name,status); 2372 2373 info->rx_overflow = true; 2374 info->pending_bh |= BH_RECEIVE; 2375 } 2376 2377 static void isr_txdmaok(SLMP_INFO * info) 2378 { 2379 unsigned char status_reg1 = read_reg(info, SR1); 2380 2381 write_reg(info, TXDMA + DIR, 0x00); /* disable Tx DMA IRQs */ 2382 write_reg(info, TXDMA + DSR, 0xc0); /* clear IRQs and disable DMA */ 2383 write_reg(info, TXDMA + DCMD, SWABORT); /* reset/init DMA channel */ 2384 2385 if ( debug_level >= DEBUG_LEVEL_ISR ) 2386 printk("%s(%d):%s isr_txdmaok(), status=%02x\n", 2387 __FILE__,__LINE__,info->device_name,status_reg1); 2388 2389 /* program TXRDY as FIFO empty flag, enable TXRDY IRQ */ 2390 write_reg16(info, TRC0, 0); 2391 info->ie0_value |= TXRDYE; 2392 write_reg(info, IE0, info->ie0_value); 2393 } 2394 2395 static void isr_txdmaerror(SLMP_INFO * info) 2396 { 2397 /* BIT5 = BOF (buffer overflow) 2398 * BIT4 = COF (counter overflow) 2399 */ 2400 unsigned char status = read_reg(info,TXDMA + DSR) & 0x30; 2401 2402 /* clear IRQ (BIT0 must be 1 to prevent clearing DE bit) */ 2403 write_reg(info, TXDMA + DSR, (unsigned char)(status | 1)); 2404 2405 if ( debug_level >= DEBUG_LEVEL_ISR ) 2406 printk("%s(%d):%s isr_txdmaerror(), status=%02x\n", 2407 __FILE__,__LINE__,info->device_name,status); 2408 } 2409 2410 /* handle input serial signal changes 2411 */ 2412 static void isr_io_pin( SLMP_INFO *info, u16 status ) 2413 { 2414 struct mgsl_icount *icount; 2415 2416 if ( debug_level >= DEBUG_LEVEL_ISR ) 2417 printk("%s(%d):isr_io_pin status=%04X\n", 2418 __FILE__,__LINE__,status); 2419 2420 if (status & (MISCSTATUS_CTS_LATCHED | MISCSTATUS_DCD_LATCHED | 2421 MISCSTATUS_DSR_LATCHED | MISCSTATUS_RI_LATCHED) ) { 2422 icount = &info->icount; 2423 /* update input line counters */ 2424 if (status & MISCSTATUS_RI_LATCHED) { 2425 icount->rng++; 2426 if ( status & SerialSignal_RI ) 2427 info->input_signal_events.ri_up++; 2428 else 2429 info->input_signal_events.ri_down++; 2430 } 2431 if (status & MISCSTATUS_DSR_LATCHED) { 2432 icount->dsr++; 2433 if ( status & SerialSignal_DSR ) 2434 info->input_signal_events.dsr_up++; 2435 else 2436 info->input_signal_events.dsr_down++; 2437 } 2438 if (status & MISCSTATUS_DCD_LATCHED) { 2439 if ((info->dcd_chkcount)++ >= IO_PIN_SHUTDOWN_LIMIT) { 2440 info->ie1_value &= ~CDCD; 2441 write_reg(info, IE1, info->ie1_value); 2442 } 2443 icount->dcd++; 2444 if (status & SerialSignal_DCD) { 2445 info->input_signal_events.dcd_up++; 2446 } else 2447 info->input_signal_events.dcd_down++; 2448 #if SYNCLINK_GENERIC_HDLC 2449 if (info->netcount) { 2450 if (status & SerialSignal_DCD) 2451 netif_carrier_on(info->netdev); 2452 else 2453 netif_carrier_off(info->netdev); 2454 } 2455 #endif 2456 } 2457 if (status & MISCSTATUS_CTS_LATCHED) 2458 { 2459 if ((info->cts_chkcount)++ >= IO_PIN_SHUTDOWN_LIMIT) { 2460 info->ie1_value &= ~CCTS; 2461 write_reg(info, IE1, info->ie1_value); 2462 } 2463 icount->cts++; 2464 if ( status & SerialSignal_CTS ) 2465 info->input_signal_events.cts_up++; 2466 else 2467 info->input_signal_events.cts_down++; 2468 } 2469 wake_up_interruptible(&info->status_event_wait_q); 2470 wake_up_interruptible(&info->event_wait_q); 2471 2472 if ( (info->port.flags & ASYNC_CHECK_CD) && 2473 (status & MISCSTATUS_DCD_LATCHED) ) { 2474 if ( debug_level >= DEBUG_LEVEL_ISR ) 2475 printk("%s CD now %s...", info->device_name, 2476 (status & SerialSignal_DCD) ? "on" : "off"); 2477 if (status & SerialSignal_DCD) 2478 wake_up_interruptible(&info->port.open_wait); 2479 else { 2480 if ( debug_level >= DEBUG_LEVEL_ISR ) 2481 printk("doing serial hangup..."); 2482 if (info->port.tty) 2483 tty_hangup(info->port.tty); 2484 } 2485 } 2486 2487 if (tty_port_cts_enabled(&info->port) && 2488 (status & MISCSTATUS_CTS_LATCHED) ) { 2489 if ( info->port.tty ) { 2490 if (info->port.tty->hw_stopped) { 2491 if (status & SerialSignal_CTS) { 2492 if ( debug_level >= DEBUG_LEVEL_ISR ) 2493 printk("CTS tx start..."); 2494 info->port.tty->hw_stopped = 0; 2495 tx_start(info); 2496 info->pending_bh |= BH_TRANSMIT; 2497 return; 2498 } 2499 } else { 2500 if (!(status & SerialSignal_CTS)) { 2501 if ( debug_level >= DEBUG_LEVEL_ISR ) 2502 printk("CTS tx stop..."); 2503 info->port.tty->hw_stopped = 1; 2504 tx_stop(info); 2505 } 2506 } 2507 } 2508 } 2509 } 2510 2511 info->pending_bh |= BH_STATUS; 2512 } 2513 2514 /* Interrupt service routine entry point. 2515 * 2516 * Arguments: 2517 * irq interrupt number that caused interrupt 2518 * dev_id device ID supplied during interrupt registration 2519 * regs interrupted processor context 2520 */ 2521 static irqreturn_t synclinkmp_interrupt(int dummy, void *dev_id) 2522 { 2523 SLMP_INFO *info = dev_id; 2524 unsigned char status, status0, status1=0; 2525 unsigned char dmastatus, dmastatus0, dmastatus1=0; 2526 unsigned char timerstatus0, timerstatus1=0; 2527 unsigned char shift; 2528 unsigned int i; 2529 unsigned short tmp; 2530 2531 if ( debug_level >= DEBUG_LEVEL_ISR ) 2532 printk(KERN_DEBUG "%s(%d): synclinkmp_interrupt(%d)entry.\n", 2533 __FILE__, __LINE__, info->irq_level); 2534 2535 spin_lock(&info->lock); 2536 2537 for(;;) { 2538 2539 /* get status for SCA0 (ports 0-1) */ 2540 tmp = read_reg16(info, ISR0); /* get ISR0 and ISR1 in one read */ 2541 status0 = (unsigned char)tmp; 2542 dmastatus0 = (unsigned char)(tmp>>8); 2543 timerstatus0 = read_reg(info, ISR2); 2544 2545 if ( debug_level >= DEBUG_LEVEL_ISR ) 2546 printk(KERN_DEBUG "%s(%d):%s status0=%02x, dmastatus0=%02x, timerstatus0=%02x\n", 2547 __FILE__, __LINE__, info->device_name, 2548 status0, dmastatus0, timerstatus0); 2549 2550 if (info->port_count == 4) { 2551 /* get status for SCA1 (ports 2-3) */ 2552 tmp = read_reg16(info->port_array[2], ISR0); 2553 status1 = (unsigned char)tmp; 2554 dmastatus1 = (unsigned char)(tmp>>8); 2555 timerstatus1 = read_reg(info->port_array[2], ISR2); 2556 2557 if ( debug_level >= DEBUG_LEVEL_ISR ) 2558 printk("%s(%d):%s status1=%02x, dmastatus1=%02x, timerstatus1=%02x\n", 2559 __FILE__,__LINE__,info->device_name, 2560 status1,dmastatus1,timerstatus1); 2561 } 2562 2563 if (!status0 && !dmastatus0 && !timerstatus0 && 2564 !status1 && !dmastatus1 && !timerstatus1) 2565 break; 2566 2567 for(i=0; i < info->port_count ; i++) { 2568 if (info->port_array[i] == NULL) 2569 continue; 2570 if (i < 2) { 2571 status = status0; 2572 dmastatus = dmastatus0; 2573 } else { 2574 status = status1; 2575 dmastatus = dmastatus1; 2576 } 2577 2578 shift = i & 1 ? 4 :0; 2579 2580 if (status & BIT0 << shift) 2581 isr_rxrdy(info->port_array[i]); 2582 if (status & BIT1 << shift) 2583 isr_txrdy(info->port_array[i]); 2584 if (status & BIT2 << shift) 2585 isr_rxint(info->port_array[i]); 2586 if (status & BIT3 << shift) 2587 isr_txint(info->port_array[i]); 2588 2589 if (dmastatus & BIT0 << shift) 2590 isr_rxdmaerror(info->port_array[i]); 2591 if (dmastatus & BIT1 << shift) 2592 isr_rxdmaok(info->port_array[i]); 2593 if (dmastatus & BIT2 << shift) 2594 isr_txdmaerror(info->port_array[i]); 2595 if (dmastatus & BIT3 << shift) 2596 isr_txdmaok(info->port_array[i]); 2597 } 2598 2599 if (timerstatus0 & (BIT5 | BIT4)) 2600 isr_timer(info->port_array[0]); 2601 if (timerstatus0 & (BIT7 | BIT6)) 2602 isr_timer(info->port_array[1]); 2603 if (timerstatus1 & (BIT5 | BIT4)) 2604 isr_timer(info->port_array[2]); 2605 if (timerstatus1 & (BIT7 | BIT6)) 2606 isr_timer(info->port_array[3]); 2607 } 2608 2609 for(i=0; i < info->port_count ; i++) { 2610 SLMP_INFO * port = info->port_array[i]; 2611 2612 /* Request bottom half processing if there's something 2613 * for it to do and the bh is not already running. 2614 * 2615 * Note: startup adapter diags require interrupts. 2616 * do not request bottom half processing if the 2617 * device is not open in a normal mode. 2618 */ 2619 if ( port && (port->port.count || port->netcount) && 2620 port->pending_bh && !port->bh_running && 2621 !port->bh_requested ) { 2622 if ( debug_level >= DEBUG_LEVEL_ISR ) 2623 printk("%s(%d):%s queueing bh task.\n", 2624 __FILE__,__LINE__,port->device_name); 2625 schedule_work(&port->task); 2626 port->bh_requested = true; 2627 } 2628 } 2629 2630 spin_unlock(&info->lock); 2631 2632 if ( debug_level >= DEBUG_LEVEL_ISR ) 2633 printk(KERN_DEBUG "%s(%d):synclinkmp_interrupt(%d)exit.\n", 2634 __FILE__, __LINE__, info->irq_level); 2635 return IRQ_HANDLED; 2636 } 2637 2638 /* Initialize and start device. 2639 */ 2640 static int startup(SLMP_INFO * info) 2641 { 2642 if ( debug_level >= DEBUG_LEVEL_INFO ) 2643 printk("%s(%d):%s tx_releaseup()\n",__FILE__,__LINE__,info->device_name); 2644 2645 if (info->port.flags & ASYNC_INITIALIZED) 2646 return 0; 2647 2648 if (!info->tx_buf) { 2649 info->tx_buf = kmalloc(info->max_frame_size, GFP_KERNEL); 2650 if (!info->tx_buf) { 2651 printk(KERN_ERR"%s(%d):%s can't allocate transmit buffer\n", 2652 __FILE__,__LINE__,info->device_name); 2653 return -ENOMEM; 2654 } 2655 } 2656 2657 info->pending_bh = 0; 2658 2659 memset(&info->icount, 0, sizeof(info->icount)); 2660 2661 /* program hardware for current parameters */ 2662 reset_port(info); 2663 2664 change_params(info); 2665 2666 mod_timer(&info->status_timer, jiffies + msecs_to_jiffies(10)); 2667 2668 if (info->port.tty) 2669 clear_bit(TTY_IO_ERROR, &info->port.tty->flags); 2670 2671 info->port.flags |= ASYNC_INITIALIZED; 2672 2673 return 0; 2674 } 2675 2676 /* Called by close() and hangup() to shutdown hardware 2677 */ 2678 static void shutdown(SLMP_INFO * info) 2679 { 2680 unsigned long flags; 2681 2682 if (!(info->port.flags & ASYNC_INITIALIZED)) 2683 return; 2684 2685 if (debug_level >= DEBUG_LEVEL_INFO) 2686 printk("%s(%d):%s synclinkmp_shutdown()\n", 2687 __FILE__,__LINE__, info->device_name ); 2688 2689 /* clear status wait queue because status changes */ 2690 /* can't happen after shutting down the hardware */ 2691 wake_up_interruptible(&info->status_event_wait_q); 2692 wake_up_interruptible(&info->event_wait_q); 2693 2694 del_timer(&info->tx_timer); 2695 del_timer(&info->status_timer); 2696 2697 kfree(info->tx_buf); 2698 info->tx_buf = NULL; 2699 2700 spin_lock_irqsave(&info->lock,flags); 2701 2702 reset_port(info); 2703 2704 if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { 2705 info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); 2706 set_signals(info); 2707 } 2708 2709 spin_unlock_irqrestore(&info->lock,flags); 2710 2711 if (info->port.tty) 2712 set_bit(TTY_IO_ERROR, &info->port.tty->flags); 2713 2714 info->port.flags &= ~ASYNC_INITIALIZED; 2715 } 2716 2717 static void program_hw(SLMP_INFO *info) 2718 { 2719 unsigned long flags; 2720 2721 spin_lock_irqsave(&info->lock,flags); 2722 2723 rx_stop(info); 2724 tx_stop(info); 2725 2726 info->tx_count = info->tx_put = info->tx_get = 0; 2727 2728 if (info->params.mode == MGSL_MODE_HDLC || info->netcount) 2729 hdlc_mode(info); 2730 else 2731 async_mode(info); 2732 2733 set_signals(info); 2734 2735 info->dcd_chkcount = 0; 2736 info->cts_chkcount = 0; 2737 info->ri_chkcount = 0; 2738 info->dsr_chkcount = 0; 2739 2740 info->ie1_value |= (CDCD|CCTS); 2741 write_reg(info, IE1, info->ie1_value); 2742 2743 get_signals(info); 2744 2745 if (info->netcount || (info->port.tty && info->port.tty->termios.c_cflag & CREAD) ) 2746 rx_start(info); 2747 2748 spin_unlock_irqrestore(&info->lock,flags); 2749 } 2750 2751 /* Reconfigure adapter based on new parameters 2752 */ 2753 static void change_params(SLMP_INFO *info) 2754 { 2755 unsigned cflag; 2756 int bits_per_char; 2757 2758 if (!info->port.tty) 2759 return; 2760 2761 if (debug_level >= DEBUG_LEVEL_INFO) 2762 printk("%s(%d):%s change_params()\n", 2763 __FILE__,__LINE__, info->device_name ); 2764 2765 cflag = info->port.tty->termios.c_cflag; 2766 2767 /* if B0 rate (hangup) specified then negate RTS and DTR */ 2768 /* otherwise assert RTS and DTR */ 2769 if (cflag & CBAUD) 2770 info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; 2771 else 2772 info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); 2773 2774 /* byte size and parity */ 2775 2776 switch (cflag & CSIZE) { 2777 case CS5: info->params.data_bits = 5; break; 2778 case CS6: info->params.data_bits = 6; break; 2779 case CS7: info->params.data_bits = 7; break; 2780 case CS8: info->params.data_bits = 8; break; 2781 /* Never happens, but GCC is too dumb to figure it out */ 2782 default: info->params.data_bits = 7; break; 2783 } 2784 2785 if (cflag & CSTOPB) 2786 info->params.stop_bits = 2; 2787 else 2788 info->params.stop_bits = 1; 2789 2790 info->params.parity = ASYNC_PARITY_NONE; 2791 if (cflag & PARENB) { 2792 if (cflag & PARODD) 2793 info->params.parity = ASYNC_PARITY_ODD; 2794 else 2795 info->params.parity = ASYNC_PARITY_EVEN; 2796 #ifdef CMSPAR 2797 if (cflag & CMSPAR) 2798 info->params.parity = ASYNC_PARITY_SPACE; 2799 #endif 2800 } 2801 2802 /* calculate number of jiffies to transmit a full 2803 * FIFO (32 bytes) at specified data rate 2804 */ 2805 bits_per_char = info->params.data_bits + 2806 info->params.stop_bits + 1; 2807 2808 /* if port data rate is set to 460800 or less then 2809 * allow tty settings to override, otherwise keep the 2810 * current data rate. 2811 */ 2812 if (info->params.data_rate <= 460800) { 2813 info->params.data_rate = tty_get_baud_rate(info->port.tty); 2814 } 2815 2816 if ( info->params.data_rate ) { 2817 info->timeout = (32*HZ*bits_per_char) / 2818 info->params.data_rate; 2819 } 2820 info->timeout += HZ/50; /* Add .02 seconds of slop */ 2821 2822 if (cflag & CRTSCTS) 2823 info->port.flags |= ASYNC_CTS_FLOW; 2824 else 2825 info->port.flags &= ~ASYNC_CTS_FLOW; 2826 2827 if (cflag & CLOCAL) 2828 info->port.flags &= ~ASYNC_CHECK_CD; 2829 else 2830 info->port.flags |= ASYNC_CHECK_CD; 2831 2832 /* process tty input control flags */ 2833 2834 info->read_status_mask2 = OVRN; 2835 if (I_INPCK(info->port.tty)) 2836 info->read_status_mask2 |= PE | FRME; 2837 if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty)) 2838 info->read_status_mask1 |= BRKD; 2839 if (I_IGNPAR(info->port.tty)) 2840 info->ignore_status_mask2 |= PE | FRME; 2841 if (I_IGNBRK(info->port.tty)) { 2842 info->ignore_status_mask1 |= BRKD; 2843 /* If ignoring parity and break indicators, ignore 2844 * overruns too. (For real raw support). 2845 */ 2846 if (I_IGNPAR(info->port.tty)) 2847 info->ignore_status_mask2 |= OVRN; 2848 } 2849 2850 program_hw(info); 2851 } 2852 2853 static int get_stats(SLMP_INFO * info, struct mgsl_icount __user *user_icount) 2854 { 2855 int err; 2856 2857 if (debug_level >= DEBUG_LEVEL_INFO) 2858 printk("%s(%d):%s get_params()\n", 2859 __FILE__,__LINE__, info->device_name); 2860 2861 if (!user_icount) { 2862 memset(&info->icount, 0, sizeof(info->icount)); 2863 } else { 2864 mutex_lock(&info->port.mutex); 2865 COPY_TO_USER(err, user_icount, &info->icount, sizeof(struct mgsl_icount)); 2866 mutex_unlock(&info->port.mutex); 2867 if (err) 2868 return -EFAULT; 2869 } 2870 2871 return 0; 2872 } 2873 2874 static int get_params(SLMP_INFO * info, MGSL_PARAMS __user *user_params) 2875 { 2876 int err; 2877 if (debug_level >= DEBUG_LEVEL_INFO) 2878 printk("%s(%d):%s get_params()\n", 2879 __FILE__,__LINE__, info->device_name); 2880 2881 mutex_lock(&info->port.mutex); 2882 COPY_TO_USER(err,user_params, &info->params, sizeof(MGSL_PARAMS)); 2883 mutex_unlock(&info->port.mutex); 2884 if (err) { 2885 if ( debug_level >= DEBUG_LEVEL_INFO ) 2886 printk( "%s(%d):%s get_params() user buffer copy failed\n", 2887 __FILE__,__LINE__,info->device_name); 2888 return -EFAULT; 2889 } 2890 2891 return 0; 2892 } 2893 2894 static int set_params(SLMP_INFO * info, MGSL_PARAMS __user *new_params) 2895 { 2896 unsigned long flags; 2897 MGSL_PARAMS tmp_params; 2898 int err; 2899 2900 if (debug_level >= DEBUG_LEVEL_INFO) 2901 printk("%s(%d):%s set_params\n", 2902 __FILE__,__LINE__,info->device_name ); 2903 COPY_FROM_USER(err,&tmp_params, new_params, sizeof(MGSL_PARAMS)); 2904 if (err) { 2905 if ( debug_level >= DEBUG_LEVEL_INFO ) 2906 printk( "%s(%d):%s set_params() user buffer copy failed\n", 2907 __FILE__,__LINE__,info->device_name); 2908 return -EFAULT; 2909 } 2910 2911 mutex_lock(&info->port.mutex); 2912 spin_lock_irqsave(&info->lock,flags); 2913 memcpy(&info->params,&tmp_params,sizeof(MGSL_PARAMS)); 2914 spin_unlock_irqrestore(&info->lock,flags); 2915 2916 change_params(info); 2917 mutex_unlock(&info->port.mutex); 2918 2919 return 0; 2920 } 2921 2922 static int get_txidle(SLMP_INFO * info, int __user *idle_mode) 2923 { 2924 int err; 2925 2926 if (debug_level >= DEBUG_LEVEL_INFO) 2927 printk("%s(%d):%s get_txidle()=%d\n", 2928 __FILE__,__LINE__, info->device_name, info->idle_mode); 2929 2930 COPY_TO_USER(err,idle_mode, &info->idle_mode, sizeof(int)); 2931 if (err) { 2932 if ( debug_level >= DEBUG_LEVEL_INFO ) 2933 printk( "%s(%d):%s get_txidle() user buffer copy failed\n", 2934 __FILE__,__LINE__,info->device_name); 2935 return -EFAULT; 2936 } 2937 2938 return 0; 2939 } 2940 2941 static int set_txidle(SLMP_INFO * info, int idle_mode) 2942 { 2943 unsigned long flags; 2944 2945 if (debug_level >= DEBUG_LEVEL_INFO) 2946 printk("%s(%d):%s set_txidle(%d)\n", 2947 __FILE__,__LINE__,info->device_name, idle_mode ); 2948 2949 spin_lock_irqsave(&info->lock,flags); 2950 info->idle_mode = idle_mode; 2951 tx_set_idle( info ); 2952 spin_unlock_irqrestore(&info->lock,flags); 2953 return 0; 2954 } 2955 2956 static int tx_enable(SLMP_INFO * info, int enable) 2957 { 2958 unsigned long flags; 2959 2960 if (debug_level >= DEBUG_LEVEL_INFO) 2961 printk("%s(%d):%s tx_enable(%d)\n", 2962 __FILE__,__LINE__,info->device_name, enable); 2963 2964 spin_lock_irqsave(&info->lock,flags); 2965 if ( enable ) { 2966 if ( !info->tx_enabled ) { 2967 tx_start(info); 2968 } 2969 } else { 2970 if ( info->tx_enabled ) 2971 tx_stop(info); 2972 } 2973 spin_unlock_irqrestore(&info->lock,flags); 2974 return 0; 2975 } 2976 2977 /* abort send HDLC frame 2978 */ 2979 static int tx_abort(SLMP_INFO * info) 2980 { 2981 unsigned long flags; 2982 2983 if (debug_level >= DEBUG_LEVEL_INFO) 2984 printk("%s(%d):%s tx_abort()\n", 2985 __FILE__,__LINE__,info->device_name); 2986 2987 spin_lock_irqsave(&info->lock,flags); 2988 if ( info->tx_active && info->params.mode == MGSL_MODE_HDLC ) { 2989 info->ie1_value &= ~UDRN; 2990 info->ie1_value |= IDLE; 2991 write_reg(info, IE1, info->ie1_value); /* disable tx status interrupts */ 2992 write_reg(info, SR1, (unsigned char)(IDLE + UDRN)); /* clear pending */ 2993 2994 write_reg(info, TXDMA + DSR, 0); /* disable DMA channel */ 2995 write_reg(info, TXDMA + DCMD, SWABORT); /* reset/init DMA channel */ 2996 2997 write_reg(info, CMD, TXABORT); 2998 } 2999 spin_unlock_irqrestore(&info->lock,flags); 3000 return 0; 3001 } 3002 3003 static int rx_enable(SLMP_INFO * info, int enable) 3004 { 3005 unsigned long flags; 3006 3007 if (debug_level >= DEBUG_LEVEL_INFO) 3008 printk("%s(%d):%s rx_enable(%d)\n", 3009 __FILE__,__LINE__,info->device_name,enable); 3010 3011 spin_lock_irqsave(&info->lock,flags); 3012 if ( enable ) { 3013 if ( !info->rx_enabled ) 3014 rx_start(info); 3015 } else { 3016 if ( info->rx_enabled ) 3017 rx_stop(info); 3018 } 3019 spin_unlock_irqrestore(&info->lock,flags); 3020 return 0; 3021 } 3022 3023 /* wait for specified event to occur 3024 */ 3025 static int wait_mgsl_event(SLMP_INFO * info, int __user *mask_ptr) 3026 { 3027 unsigned long flags; 3028 int s; 3029 int rc=0; 3030 struct mgsl_icount cprev, cnow; 3031 int events; 3032 int mask; 3033 struct _input_signal_events oldsigs, newsigs; 3034 DECLARE_WAITQUEUE(wait, current); 3035 3036 COPY_FROM_USER(rc,&mask, mask_ptr, sizeof(int)); 3037 if (rc) { 3038 return -EFAULT; 3039 } 3040 3041 if (debug_level >= DEBUG_LEVEL_INFO) 3042 printk("%s(%d):%s wait_mgsl_event(%d)\n", 3043 __FILE__,__LINE__,info->device_name,mask); 3044 3045 spin_lock_irqsave(&info->lock,flags); 3046 3047 /* return immediately if state matches requested events */ 3048 get_signals(info); 3049 s = info->serial_signals; 3050 3051 events = mask & 3052 ( ((s & SerialSignal_DSR) ? MgslEvent_DsrActive:MgslEvent_DsrInactive) + 3053 ((s & SerialSignal_DCD) ? MgslEvent_DcdActive:MgslEvent_DcdInactive) + 3054 ((s & SerialSignal_CTS) ? MgslEvent_CtsActive:MgslEvent_CtsInactive) + 3055 ((s & SerialSignal_RI) ? MgslEvent_RiActive :MgslEvent_RiInactive) ); 3056 if (events) { 3057 spin_unlock_irqrestore(&info->lock,flags); 3058 goto exit; 3059 } 3060 3061 /* save current irq counts */ 3062 cprev = info->icount; 3063 oldsigs = info->input_signal_events; 3064 3065 /* enable hunt and idle irqs if needed */ 3066 if (mask & (MgslEvent_ExitHuntMode+MgslEvent_IdleReceived)) { 3067 unsigned char oldval = info->ie1_value; 3068 unsigned char newval = oldval + 3069 (mask & MgslEvent_ExitHuntMode ? FLGD:0) + 3070 (mask & MgslEvent_IdleReceived ? IDLD:0); 3071 if ( oldval != newval ) { 3072 info->ie1_value = newval; 3073 write_reg(info, IE1, info->ie1_value); 3074 } 3075 } 3076 3077 set_current_state(TASK_INTERRUPTIBLE); 3078 add_wait_queue(&info->event_wait_q, &wait); 3079 3080 spin_unlock_irqrestore(&info->lock,flags); 3081 3082 for(;;) { 3083 schedule(); 3084 if (signal_pending(current)) { 3085 rc = -ERESTARTSYS; 3086 break; 3087 } 3088 3089 /* get current irq counts */ 3090 spin_lock_irqsave(&info->lock,flags); 3091 cnow = info->icount; 3092 newsigs = info->input_signal_events; 3093 set_current_state(TASK_INTERRUPTIBLE); 3094 spin_unlock_irqrestore(&info->lock,flags); 3095 3096 /* if no change, wait aborted for some reason */ 3097 if (newsigs.dsr_up == oldsigs.dsr_up && 3098 newsigs.dsr_down == oldsigs.dsr_down && 3099 newsigs.dcd_up == oldsigs.dcd_up && 3100 newsigs.dcd_down == oldsigs.dcd_down && 3101 newsigs.cts_up == oldsigs.cts_up && 3102 newsigs.cts_down == oldsigs.cts_down && 3103 newsigs.ri_up == oldsigs.ri_up && 3104 newsigs.ri_down == oldsigs.ri_down && 3105 cnow.exithunt == cprev.exithunt && 3106 cnow.rxidle == cprev.rxidle) { 3107 rc = -EIO; 3108 break; 3109 } 3110 3111 events = mask & 3112 ( (newsigs.dsr_up != oldsigs.dsr_up ? MgslEvent_DsrActive:0) + 3113 (newsigs.dsr_down != oldsigs.dsr_down ? MgslEvent_DsrInactive:0) + 3114 (newsigs.dcd_up != oldsigs.dcd_up ? MgslEvent_DcdActive:0) + 3115 (newsigs.dcd_down != oldsigs.dcd_down ? MgslEvent_DcdInactive:0) + 3116 (newsigs.cts_up != oldsigs.cts_up ? MgslEvent_CtsActive:0) + 3117 (newsigs.cts_down != oldsigs.cts_down ? MgslEvent_CtsInactive:0) + 3118 (newsigs.ri_up != oldsigs.ri_up ? MgslEvent_RiActive:0) + 3119 (newsigs.ri_down != oldsigs.ri_down ? MgslEvent_RiInactive:0) + 3120 (cnow.exithunt != cprev.exithunt ? MgslEvent_ExitHuntMode:0) + 3121 (cnow.rxidle != cprev.rxidle ? MgslEvent_IdleReceived:0) ); 3122 if (events) 3123 break; 3124 3125 cprev = cnow; 3126 oldsigs = newsigs; 3127 } 3128 3129 remove_wait_queue(&info->event_wait_q, &wait); 3130 set_current_state(TASK_RUNNING); 3131 3132 3133 if (mask & (MgslEvent_ExitHuntMode + MgslEvent_IdleReceived)) { 3134 spin_lock_irqsave(&info->lock,flags); 3135 if (!waitqueue_active(&info->event_wait_q)) { 3136 /* disable enable exit hunt mode/idle rcvd IRQs */ 3137 info->ie1_value &= ~(FLGD|IDLD); 3138 write_reg(info, IE1, info->ie1_value); 3139 } 3140 spin_unlock_irqrestore(&info->lock,flags); 3141 } 3142 exit: 3143 if ( rc == 0 ) 3144 PUT_USER(rc, events, mask_ptr); 3145 3146 return rc; 3147 } 3148 3149 static int modem_input_wait(SLMP_INFO *info,int arg) 3150 { 3151 unsigned long flags; 3152 int rc; 3153 struct mgsl_icount cprev, cnow; 3154 DECLARE_WAITQUEUE(wait, current); 3155 3156 /* save current irq counts */ 3157 spin_lock_irqsave(&info->lock,flags); 3158 cprev = info->icount; 3159 add_wait_queue(&info->status_event_wait_q, &wait); 3160 set_current_state(TASK_INTERRUPTIBLE); 3161 spin_unlock_irqrestore(&info->lock,flags); 3162 3163 for(;;) { 3164 schedule(); 3165 if (signal_pending(current)) { 3166 rc = -ERESTARTSYS; 3167 break; 3168 } 3169 3170 /* get new irq counts */ 3171 spin_lock_irqsave(&info->lock,flags); 3172 cnow = info->icount; 3173 set_current_state(TASK_INTERRUPTIBLE); 3174 spin_unlock_irqrestore(&info->lock,flags); 3175 3176 /* if no change, wait aborted for some reason */ 3177 if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && 3178 cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { 3179 rc = -EIO; 3180 break; 3181 } 3182 3183 /* check for change in caller specified modem input */ 3184 if ((arg & TIOCM_RNG && cnow.rng != cprev.rng) || 3185 (arg & TIOCM_DSR && cnow.dsr != cprev.dsr) || 3186 (arg & TIOCM_CD && cnow.dcd != cprev.dcd) || 3187 (arg & TIOCM_CTS && cnow.cts != cprev.cts)) { 3188 rc = 0; 3189 break; 3190 } 3191 3192 cprev = cnow; 3193 } 3194 remove_wait_queue(&info->status_event_wait_q, &wait); 3195 set_current_state(TASK_RUNNING); 3196 return rc; 3197 } 3198 3199 /* return the state of the serial control and status signals 3200 */ 3201 static int tiocmget(struct tty_struct *tty) 3202 { 3203 SLMP_INFO *info = tty->driver_data; 3204 unsigned int result; 3205 unsigned long flags; 3206 3207 spin_lock_irqsave(&info->lock,flags); 3208 get_signals(info); 3209 spin_unlock_irqrestore(&info->lock,flags); 3210 3211 result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS : 0) | 3212 ((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR : 0) | 3213 ((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR : 0) | 3214 ((info->serial_signals & SerialSignal_RI) ? TIOCM_RNG : 0) | 3215 ((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR : 0) | 3216 ((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS : 0); 3217 3218 if (debug_level >= DEBUG_LEVEL_INFO) 3219 printk("%s(%d):%s tiocmget() value=%08X\n", 3220 __FILE__,__LINE__, info->device_name, result ); 3221 return result; 3222 } 3223 3224 /* set modem control signals (DTR/RTS) 3225 */ 3226 static int tiocmset(struct tty_struct *tty, 3227 unsigned int set, unsigned int clear) 3228 { 3229 SLMP_INFO *info = tty->driver_data; 3230 unsigned long flags; 3231 3232 if (debug_level >= DEBUG_LEVEL_INFO) 3233 printk("%s(%d):%s tiocmset(%x,%x)\n", 3234 __FILE__,__LINE__,info->device_name, set, clear); 3235 3236 if (set & TIOCM_RTS) 3237 info->serial_signals |= SerialSignal_RTS; 3238 if (set & TIOCM_DTR) 3239 info->serial_signals |= SerialSignal_DTR; 3240 if (clear & TIOCM_RTS) 3241 info->serial_signals &= ~SerialSignal_RTS; 3242 if (clear & TIOCM_DTR) 3243 info->serial_signals &= ~SerialSignal_DTR; 3244 3245 spin_lock_irqsave(&info->lock,flags); 3246 set_signals(info); 3247 spin_unlock_irqrestore(&info->lock,flags); 3248 3249 return 0; 3250 } 3251 3252 static int carrier_raised(struct tty_port *port) 3253 { 3254 SLMP_INFO *info = container_of(port, SLMP_INFO, port); 3255 unsigned long flags; 3256 3257 spin_lock_irqsave(&info->lock,flags); 3258 get_signals(info); 3259 spin_unlock_irqrestore(&info->lock,flags); 3260 3261 return (info->serial_signals & SerialSignal_DCD) ? 1 : 0; 3262 } 3263 3264 static void dtr_rts(struct tty_port *port, int on) 3265 { 3266 SLMP_INFO *info = container_of(port, SLMP_INFO, port); 3267 unsigned long flags; 3268 3269 spin_lock_irqsave(&info->lock,flags); 3270 if (on) 3271 info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; 3272 else 3273 info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); 3274 set_signals(info); 3275 spin_unlock_irqrestore(&info->lock,flags); 3276 } 3277 3278 /* Block the current process until the specified port is ready to open. 3279 */ 3280 static int block_til_ready(struct tty_struct *tty, struct file *filp, 3281 SLMP_INFO *info) 3282 { 3283 DECLARE_WAITQUEUE(wait, current); 3284 int retval; 3285 bool do_clocal = false; 3286 unsigned long flags; 3287 int cd; 3288 struct tty_port *port = &info->port; 3289 3290 if (debug_level >= DEBUG_LEVEL_INFO) 3291 printk("%s(%d):%s block_til_ready()\n", 3292 __FILE__,__LINE__, tty->driver->name ); 3293 3294 if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ 3295 /* nonblock mode is set or port is not enabled */ 3296 /* just verify that callout device is not active */ 3297 port->flags |= ASYNC_NORMAL_ACTIVE; 3298 return 0; 3299 } 3300 3301 if (tty->termios.c_cflag & CLOCAL) 3302 do_clocal = true; 3303 3304 /* Wait for carrier detect and the line to become 3305 * free (i.e., not in use by the callout). While we are in 3306 * this loop, port->count is dropped by one, so that 3307 * close() knows when to free things. We restore it upon 3308 * exit, either normal or abnormal. 3309 */ 3310 3311 retval = 0; 3312 add_wait_queue(&port->open_wait, &wait); 3313 3314 if (debug_level >= DEBUG_LEVEL_INFO) 3315 printk("%s(%d):%s block_til_ready() before block, count=%d\n", 3316 __FILE__,__LINE__, tty->driver->name, port->count ); 3317 3318 spin_lock_irqsave(&info->lock, flags); 3319 port->count--; 3320 spin_unlock_irqrestore(&info->lock, flags); 3321 port->blocked_open++; 3322 3323 while (1) { 3324 if (C_BAUD(tty) && test_bit(ASYNCB_INITIALIZED, &port->flags)) 3325 tty_port_raise_dtr_rts(port); 3326 3327 set_current_state(TASK_INTERRUPTIBLE); 3328 3329 if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)){ 3330 retval = (port->flags & ASYNC_HUP_NOTIFY) ? 3331 -EAGAIN : -ERESTARTSYS; 3332 break; 3333 } 3334 3335 cd = tty_port_carrier_raised(port); 3336 if (do_clocal || cd) 3337 break; 3338 3339 if (signal_pending(current)) { 3340 retval = -ERESTARTSYS; 3341 break; 3342 } 3343 3344 if (debug_level >= DEBUG_LEVEL_INFO) 3345 printk("%s(%d):%s block_til_ready() count=%d\n", 3346 __FILE__,__LINE__, tty->driver->name, port->count ); 3347 3348 tty_unlock(tty); 3349 schedule(); 3350 tty_lock(tty); 3351 } 3352 3353 set_current_state(TASK_RUNNING); 3354 remove_wait_queue(&port->open_wait, &wait); 3355 if (!tty_hung_up_p(filp)) 3356 port->count++; 3357 port->blocked_open--; 3358 3359 if (debug_level >= DEBUG_LEVEL_INFO) 3360 printk("%s(%d):%s block_til_ready() after, count=%d\n", 3361 __FILE__,__LINE__, tty->driver->name, port->count ); 3362 3363 if (!retval) 3364 port->flags |= ASYNC_NORMAL_ACTIVE; 3365 3366 return retval; 3367 } 3368 3369 static int alloc_dma_bufs(SLMP_INFO *info) 3370 { 3371 unsigned short BuffersPerFrame; 3372 unsigned short BufferCount; 3373 3374 // Force allocation to start at 64K boundary for each port. 3375 // This is necessary because *all* buffer descriptors for a port 3376 // *must* be in the same 64K block. All descriptors on a port 3377 // share a common 'base' address (upper 8 bits of 24 bits) programmed 3378 // into the CBP register. 3379 info->port_array[0]->last_mem_alloc = (SCA_MEM_SIZE/4) * info->port_num; 3380 3381 /* Calculate the number of DMA buffers necessary to hold the */ 3382 /* largest allowable frame size. Note: If the max frame size is */ 3383 /* not an even multiple of the DMA buffer size then we need to */ 3384 /* round the buffer count per frame up one. */ 3385 3386 BuffersPerFrame = (unsigned short)(info->max_frame_size/SCABUFSIZE); 3387 if ( info->max_frame_size % SCABUFSIZE ) 3388 BuffersPerFrame++; 3389 3390 /* calculate total number of data buffers (SCABUFSIZE) possible 3391 * in one ports memory (SCA_MEM_SIZE/4) after allocating memory 3392 * for the descriptor list (BUFFERLISTSIZE). 3393 */ 3394 BufferCount = (SCA_MEM_SIZE/4 - BUFFERLISTSIZE)/SCABUFSIZE; 3395 3396 /* limit number of buffers to maximum amount of descriptors */ 3397 if (BufferCount > BUFFERLISTSIZE/sizeof(SCADESC)) 3398 BufferCount = BUFFERLISTSIZE/sizeof(SCADESC); 3399 3400 /* use enough buffers to transmit one max size frame */ 3401 info->tx_buf_count = BuffersPerFrame + 1; 3402 3403 /* never use more than half the available buffers for transmit */ 3404 if (info->tx_buf_count > (BufferCount/2)) 3405 info->tx_buf_count = BufferCount/2; 3406 3407 if (info->tx_buf_count > SCAMAXDESC) 3408 info->tx_buf_count = SCAMAXDESC; 3409 3410 /* use remaining buffers for receive */ 3411 info->rx_buf_count = BufferCount - info->tx_buf_count; 3412 3413 if (info->rx_buf_count > SCAMAXDESC) 3414 info->rx_buf_count = SCAMAXDESC; 3415 3416 if ( debug_level >= DEBUG_LEVEL_INFO ) 3417 printk("%s(%d):%s Allocating %d TX and %d RX DMA buffers.\n", 3418 __FILE__,__LINE__, info->device_name, 3419 info->tx_buf_count,info->rx_buf_count); 3420 3421 if ( alloc_buf_list( info ) < 0 || 3422 alloc_frame_bufs(info, 3423 info->rx_buf_list, 3424 info->rx_buf_list_ex, 3425 info->rx_buf_count) < 0 || 3426 alloc_frame_bufs(info, 3427 info->tx_buf_list, 3428 info->tx_buf_list_ex, 3429 info->tx_buf_count) < 0 || 3430 alloc_tmp_rx_buf(info) < 0 ) { 3431 printk("%s(%d):%s Can't allocate DMA buffer memory\n", 3432 __FILE__,__LINE__, info->device_name); 3433 return -ENOMEM; 3434 } 3435 3436 rx_reset_buffers( info ); 3437 3438 return 0; 3439 } 3440 3441 /* Allocate DMA buffers for the transmit and receive descriptor lists. 3442 */ 3443 static int alloc_buf_list(SLMP_INFO *info) 3444 { 3445 unsigned int i; 3446 3447 /* build list in adapter shared memory */ 3448 info->buffer_list = info->memory_base + info->port_array[0]->last_mem_alloc; 3449 info->buffer_list_phys = info->port_array[0]->last_mem_alloc; 3450 info->port_array[0]->last_mem_alloc += BUFFERLISTSIZE; 3451 3452 memset(info->buffer_list, 0, BUFFERLISTSIZE); 3453 3454 /* Save virtual address pointers to the receive and */ 3455 /* transmit buffer lists. (Receive 1st). These pointers will */ 3456 /* be used by the processor to access the lists. */ 3457 info->rx_buf_list = (SCADESC *)info->buffer_list; 3458 3459 info->tx_buf_list = (SCADESC *)info->buffer_list; 3460 info->tx_buf_list += info->rx_buf_count; 3461 3462 /* Build links for circular buffer entry lists (tx and rx) 3463 * 3464 * Note: links are physical addresses read by the SCA device 3465 * to determine the next buffer entry to use. 3466 */ 3467 3468 for ( i = 0; i < info->rx_buf_count; i++ ) { 3469 /* calculate and store physical address of this buffer entry */ 3470 info->rx_buf_list_ex[i].phys_entry = 3471 info->buffer_list_phys + (i * SCABUFSIZE); 3472 3473 /* calculate and store physical address of */ 3474 /* next entry in cirular list of entries */ 3475 info->rx_buf_list[i].next = info->buffer_list_phys; 3476 if ( i < info->rx_buf_count - 1 ) 3477 info->rx_buf_list[i].next += (i + 1) * sizeof(SCADESC); 3478 3479 info->rx_buf_list[i].length = SCABUFSIZE; 3480 } 3481 3482 for ( i = 0; i < info->tx_buf_count; i++ ) { 3483 /* calculate and store physical address of this buffer entry */ 3484 info->tx_buf_list_ex[i].phys_entry = info->buffer_list_phys + 3485 ((info->rx_buf_count + i) * sizeof(SCADESC)); 3486 3487 /* calculate and store physical address of */ 3488 /* next entry in cirular list of entries */ 3489 3490 info->tx_buf_list[i].next = info->buffer_list_phys + 3491 info->rx_buf_count * sizeof(SCADESC); 3492 3493 if ( i < info->tx_buf_count - 1 ) 3494 info->tx_buf_list[i].next += (i + 1) * sizeof(SCADESC); 3495 } 3496 3497 return 0; 3498 } 3499 3500 /* Allocate the frame DMA buffers used by the specified buffer list. 3501 */ 3502 static int alloc_frame_bufs(SLMP_INFO *info, SCADESC *buf_list,SCADESC_EX *buf_list_ex,int count) 3503 { 3504 int i; 3505 unsigned long phys_addr; 3506 3507 for ( i = 0; i < count; i++ ) { 3508 buf_list_ex[i].virt_addr = info->memory_base + info->port_array[0]->last_mem_alloc; 3509 phys_addr = info->port_array[0]->last_mem_alloc; 3510 info->port_array[0]->last_mem_alloc += SCABUFSIZE; 3511 3512 buf_list[i].buf_ptr = (unsigned short)phys_addr; 3513 buf_list[i].buf_base = (unsigned char)(phys_addr >> 16); 3514 } 3515 3516 return 0; 3517 } 3518 3519 static void free_dma_bufs(SLMP_INFO *info) 3520 { 3521 info->buffer_list = NULL; 3522 info->rx_buf_list = NULL; 3523 info->tx_buf_list = NULL; 3524 } 3525 3526 /* allocate buffer large enough to hold max_frame_size. 3527 * This buffer is used to pass an assembled frame to the line discipline. 3528 */ 3529 static int alloc_tmp_rx_buf(SLMP_INFO *info) 3530 { 3531 info->tmp_rx_buf = kmalloc(info->max_frame_size, GFP_KERNEL); 3532 if (info->tmp_rx_buf == NULL) 3533 return -ENOMEM; 3534 /* unused flag buffer to satisfy receive_buf calling interface */ 3535 info->flag_buf = kzalloc(info->max_frame_size, GFP_KERNEL); 3536 if (!info->flag_buf) { 3537 kfree(info->tmp_rx_buf); 3538 info->tmp_rx_buf = NULL; 3539 return -ENOMEM; 3540 } 3541 return 0; 3542 } 3543 3544 static void free_tmp_rx_buf(SLMP_INFO *info) 3545 { 3546 kfree(info->tmp_rx_buf); 3547 info->tmp_rx_buf = NULL; 3548 kfree(info->flag_buf); 3549 info->flag_buf = NULL; 3550 } 3551 3552 static int claim_resources(SLMP_INFO *info) 3553 { 3554 if (request_mem_region(info->phys_memory_base,SCA_MEM_SIZE,"synclinkmp") == NULL) { 3555 printk( "%s(%d):%s mem addr conflict, Addr=%08X\n", 3556 __FILE__,__LINE__,info->device_name, info->phys_memory_base); 3557 info->init_error = DiagStatus_AddressConflict; 3558 goto errout; 3559 } 3560 else 3561 info->shared_mem_requested = true; 3562 3563 if (request_mem_region(info->phys_lcr_base + info->lcr_offset,128,"synclinkmp") == NULL) { 3564 printk( "%s(%d):%s lcr mem addr conflict, Addr=%08X\n", 3565 __FILE__,__LINE__,info->device_name, info->phys_lcr_base); 3566 info->init_error = DiagStatus_AddressConflict; 3567 goto errout; 3568 } 3569 else 3570 info->lcr_mem_requested = true; 3571 3572 if (request_mem_region(info->phys_sca_base + info->sca_offset,SCA_BASE_SIZE,"synclinkmp") == NULL) { 3573 printk( "%s(%d):%s sca mem addr conflict, Addr=%08X\n", 3574 __FILE__,__LINE__,info->device_name, info->phys_sca_base); 3575 info->init_error = DiagStatus_AddressConflict; 3576 goto errout; 3577 } 3578 else 3579 info->sca_base_requested = true; 3580 3581 if (request_mem_region(info->phys_statctrl_base + info->statctrl_offset,SCA_REG_SIZE,"synclinkmp") == NULL) { 3582 printk( "%s(%d):%s stat/ctrl mem addr conflict, Addr=%08X\n", 3583 __FILE__,__LINE__,info->device_name, info->phys_statctrl_base); 3584 info->init_error = DiagStatus_AddressConflict; 3585 goto errout; 3586 } 3587 else 3588 info->sca_statctrl_requested = true; 3589 3590 info->memory_base = ioremap_nocache(info->phys_memory_base, 3591 SCA_MEM_SIZE); 3592 if (!info->memory_base) { 3593 printk( "%s(%d):%s Can't map shared memory, MemAddr=%08X\n", 3594 __FILE__,__LINE__,info->device_name, info->phys_memory_base ); 3595 info->init_error = DiagStatus_CantAssignPciResources; 3596 goto errout; 3597 } 3598 3599 info->lcr_base = ioremap_nocache(info->phys_lcr_base, PAGE_SIZE); 3600 if (!info->lcr_base) { 3601 printk( "%s(%d):%s Can't map LCR memory, MemAddr=%08X\n", 3602 __FILE__,__LINE__,info->device_name, info->phys_lcr_base ); 3603 info->init_error = DiagStatus_CantAssignPciResources; 3604 goto errout; 3605 } 3606 info->lcr_base += info->lcr_offset; 3607 3608 info->sca_base = ioremap_nocache(info->phys_sca_base, PAGE_SIZE); 3609 if (!info->sca_base) { 3610 printk( "%s(%d):%s Can't map SCA memory, MemAddr=%08X\n", 3611 __FILE__,__LINE__,info->device_name, info->phys_sca_base ); 3612 info->init_error = DiagStatus_CantAssignPciResources; 3613 goto errout; 3614 } 3615 info->sca_base += info->sca_offset; 3616 3617 info->statctrl_base = ioremap_nocache(info->phys_statctrl_base, 3618 PAGE_SIZE); 3619 if (!info->statctrl_base) { 3620 printk( "%s(%d):%s Can't map SCA Status/Control memory, MemAddr=%08X\n", 3621 __FILE__,__LINE__,info->device_name, info->phys_statctrl_base ); 3622 info->init_error = DiagStatus_CantAssignPciResources; 3623 goto errout; 3624 } 3625 info->statctrl_base += info->statctrl_offset; 3626 3627 if ( !memory_test(info) ) { 3628 printk( "%s(%d):Shared Memory Test failed for device %s MemAddr=%08X\n", 3629 __FILE__,__LINE__,info->device_name, info->phys_memory_base ); 3630 info->init_error = DiagStatus_MemoryError; 3631 goto errout; 3632 } 3633 3634 return 0; 3635 3636 errout: 3637 release_resources( info ); 3638 return -ENODEV; 3639 } 3640 3641 static void release_resources(SLMP_INFO *info) 3642 { 3643 if ( debug_level >= DEBUG_LEVEL_INFO ) 3644 printk( "%s(%d):%s release_resources() entry\n", 3645 __FILE__,__LINE__,info->device_name ); 3646 3647 if ( info->irq_requested ) { 3648 free_irq(info->irq_level, info); 3649 info->irq_requested = false; 3650 } 3651 3652 if ( info->shared_mem_requested ) {