diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-09-09 05:05:04 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-09-09 05:05:04 +0000 |
commit | a954869b1da55349ce3de83df3f8a8ec0334b767 (patch) | |
tree | 1d2fe2f1d4dc617e0833a6180b127e4eeb8892bc /pfinet/devices.c | |
parent | 45a569132f7b3d9c5ae0080908491baf525fa511 (diff) | |
download | hurd-a954869b1da55349ce3de83df3f8a8ec0334b767.tar.gz hurd-a954869b1da55349ce3de83df3f8a8ec0334b767.tar.bz2 hurd-a954869b1da55349ce3de83df3f8a8ec0334b767.zip |
1999-09-09 Thomas Bushnell, BSG <tb@mit.edu>
* ethernet.c (ethernet_open): Don't start the input work thread
here.
(more_packets, mark_bh, input_work_thread): Move
these to ...
* devices.c: ... here.
Also include "pfinet.h" instead of list of <> includes.
* main.c (main): Launch input work thread here.
* pfinet.h (input_work_thread): Declare function.
* devices.c (add_device): Remove unused function.
* pfinet.h (incoming_net_packet): Remove unused declaration.
Diffstat (limited to 'pfinet/devices.c')
-rw-r--r-- | pfinet/devices.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/pfinet/devices.c b/pfinet/devices.c index ac37cc03..34d865a6 100644 --- a/pfinet/devices.c +++ b/pfinet/devices.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -18,15 +18,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ -#include <linux/netdevice.h> -#include <device/device.h> -#include <hurd.h> +#include "pfinet.h" struct device *dev_base; struct device loopback_dev; device_t master_device; +static struct condition more_packets = CONDITION_INITIALIZER; + void init_devices (void) { @@ -43,11 +43,18 @@ init_devices (void) } void -add_device (struct device *dev) +mark_bh (int arg) { - dev->next = dev_base; - dev_base = dev; + condition_broadcast (&more_packets); } - - +any_t +input_work_thread (any_t arg) +{ + mutex_lock (&global_lock); + for (;;) + { + condition_wait (&more_packets, &global_lock); + net_bh (0); + } +} |