pktgen.c (fed8bf19ec20efc0641740b2d10aa589dbd6d1ab) pktgen.c (69549ddd2f894c4cead50ee2b60cc02990c389ad)
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>

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

468
469
470/* old include end */
471
472static char version[] __initdata = VERSION;
473
474static int pktgen_remove_device(struct pktgen_thread* t, struct pktgen_dev *i);
475static int pktgen_add_device(struct pktgen_thread* t, const char* ifname);
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>

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

468
469
470/* old include end */
471
472static char version[] __initdata = VERSION;
473
474static int pktgen_remove_device(struct pktgen_thread* t, struct pktgen_dev *i);
475static int pktgen_add_device(struct pktgen_thread* t, const char* ifname);
476static struct pktgen_thread* pktgen_find_thread(const char* name);
477static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread* t, const char* ifname);
478static int pktgen_device_event(struct notifier_block *, unsigned long, void *);
479static void pktgen_run_all_threads(void);
480static void pktgen_stop_all_threads_ifs(void);
481static int pktgen_stop_device(struct pktgen_dev *pkt_dev);
482static void pktgen_stop(struct pktgen_thread* t);
483static void pktgen_clear_counters(struct pktgen_dev *pkt_dev);
484static struct pktgen_dev *pktgen_NN_threads(const char* dev_name, int remove);

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

2878 return -EINVAL;
2879 }
2880 pe->proc_fops = &pktgen_if_fops;
2881 pe->data = pkt_dev;
2882
2883 return add_dev_to_thread(t, pkt_dev);
2884}
2885
476static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread* t, const char* ifname);
477static int pktgen_device_event(struct notifier_block *, unsigned long, void *);
478static void pktgen_run_all_threads(void);
479static void pktgen_stop_all_threads_ifs(void);
480static int pktgen_stop_device(struct pktgen_dev *pkt_dev);
481static void pktgen_stop(struct pktgen_thread* t);
482static void pktgen_clear_counters(struct pktgen_dev *pkt_dev);
483static struct pktgen_dev *pktgen_NN_threads(const char* dev_name, int remove);

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

2877 return -EINVAL;
2878 }
2879 pe->proc_fops = &pktgen_if_fops;
2880 pe->data = pkt_dev;
2881
2882 return add_dev_to_thread(t, pkt_dev);
2883}
2884
2886static struct pktgen_thread *pktgen_find_thread(const char* name)
2885static struct pktgen_thread * __init pktgen_find_thread(const char* name)
2887{
2888 struct pktgen_thread *t = NULL;
2889
2890 thread_lock();
2891
2892 t = pktgen_threads;
2893 while (t) {
2894 if (strcmp(t->name, name) == 0)
2895 break;
2896
2897 t = t->next;
2898 }
2899 thread_unlock();
2900 return t;
2901}
2902
2886{
2887 struct pktgen_thread *t = NULL;
2888
2889 thread_lock();
2890
2891 t = pktgen_threads;
2892 while (t) {
2893 if (strcmp(t->name, name) == 0)
2894 break;
2895
2896 t = t->next;
2897 }
2898 thread_unlock();
2899 return t;
2900}
2901
2903static int pktgen_create_thread(const char* name, int cpu)
2902static int __init pktgen_create_thread(const char* name, int cpu)
2904{
2905 struct pktgen_thread *t = NULL;
2906 struct proc_dir_entry *pe;
2907
2908 if (strlen(name) > 31) {
2909 printk("pktgen: ERROR: Thread name cannot be more than 31 characters.\n");
2910 return -EINVAL;
2911 }

--- 155 unchanged lines hidden ---
2903{
2904 struct pktgen_thread *t = NULL;
2905 struct proc_dir_entry *pe;
2906
2907 if (strlen(name) > 31) {
2908 printk("pktgen: ERROR: Thread name cannot be more than 31 characters.\n");
2909 return -EINVAL;
2910 }

--- 155 unchanged lines hidden ---