pktgen.c (670c02c2bfd2c8a305a90f5285409a7b0a8fd630) pktgen.c (b7c8921bf1a8a9c1907b1eeb029d3f167be226f3)
1/*
2 * Authors:
3 * Copyright 2001, 2002 by Robert Olsson <robert.olsson@its.uu.se>
4 * Uppsala University and
5 * Swedish University of Agricultural Sciences
6 *
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 * Ben Greear <greearb@candelatech.com>

--- 163 unchanged lines hidden (view full) ---

172
173/* Thread control flag bits */
174#define T_TERMINATE (1<<0)
175#define T_STOP (1<<1) /* Stop run */
176#define T_RUN (1<<2) /* Start run */
177#define T_REMDEV (1<<3) /* Remove all devs */
178
179/* Locks */
1/*
2 * Authors:
3 * Copyright 2001, 2002 by Robert Olsson <robert.olsson@its.uu.se>
4 * Uppsala University and
5 * Swedish University of Agricultural Sciences
6 *
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 * Ben Greear <greearb@candelatech.com>

--- 163 unchanged lines hidden (view full) ---

172
173/* Thread control flag bits */
174#define T_TERMINATE (1<<0)
175#define T_STOP (1<<1) /* Stop run */
176#define T_RUN (1<<2) /* Start run */
177#define T_REMDEV (1<<3) /* Remove all devs */
178
179/* Locks */
180#define thread_lock() spin_lock(&_thread_lock)
181#define thread_unlock() spin_unlock(&_thread_lock)
180#define thread_lock() down(&pktgen_sem)
181#define thread_unlock() up(&pktgen_sem)
182
183/* If lock -- can be removed after some work */
184#define if_lock(t) spin_lock(&(t->if_lock));
185#define if_unlock(t) spin_unlock(&(t->if_lock));
186
187/* Used to help with determining the pkts on receive */
188#define PKTGEN_MAGIC 0xbe9be955
189#define PG_PROC_DIR "net/pktgen"

--- 308 unchanged lines hidden (view full) ---

498static unsigned int fmt_ip6(char *s,const char ip[16]);
499
500/* Module parameters, defaults. */
501static int pg_count_d = 1000; /* 1000 pkts by default */
502static int pg_delay_d = 0;
503static int pg_clone_skb_d = 0;
504static int debug = 0;
505
182
183/* If lock -- can be removed after some work */
184#define if_lock(t) spin_lock(&(t->if_lock));
185#define if_unlock(t) spin_unlock(&(t->if_lock));
186
187/* Used to help with determining the pkts on receive */
188#define PKTGEN_MAGIC 0xbe9be955
189#define PG_PROC_DIR "net/pktgen"

--- 308 unchanged lines hidden (view full) ---

498static unsigned int fmt_ip6(char *s,const char ip[16]);
499
500/* Module parameters, defaults. */
501static int pg_count_d = 1000; /* 1000 pkts by default */
502static int pg_delay_d = 0;
503static int pg_clone_skb_d = 0;
504static int debug = 0;
505
506static DEFINE_SPINLOCK(_thread_lock);
506static DECLARE_MUTEX(pktgen_sem);
507static struct pktgen_thread *pktgen_threads = NULL;
508
509static char module_fname[128];
510static struct proc_dir_entry *module_proc_ent = NULL;
511
512static struct notifier_block pktgen_notifier_block = {
513 .notifier_call = pktgen_device_event,
514};

--- 2597 unchanged lines hidden ---
507static struct pktgen_thread *pktgen_threads = NULL;
508
509static char module_fname[128];
510static struct proc_dir_entry *module_proc_ent = NULL;
511
512static struct notifier_block pktgen_notifier_block = {
513 .notifier_call = pktgen_device_event,
514};

--- 2597 unchanged lines hidden ---