summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pfinet/ChangeLog14
-rw-r--r--pfinet/devices.c25
-rw-r--r--pfinet/ethernet.c17
-rw-r--r--pfinet/main.c2
-rw-r--r--pfinet/pfinet.h3
5 files changed, 32 insertions, 29 deletions
diff --git a/pfinet/ChangeLog b/pfinet/ChangeLog
index d08e9b32..05606bc2 100644
--- a/pfinet/ChangeLog
+++ b/pfinet/ChangeLog
@@ -1,3 +1,17 @@
+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.
+
1999-09-07 Thomas Bushnell, BSG <tb@mit.edu>
* io-ops.c (S_io_map_segment): New function.
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);
+ }
+}
diff --git a/pfinet/ethernet.c b/pfinet/ethernet.c
index b79563ab..85162fd8 100644
--- a/pfinet/ethernet.c
+++ b/pfinet/ethernet.c
@@ -38,7 +38,6 @@ struct device ether_dev;
struct enet_statistics retbuf;
-static struct condition more_packets = CONDITION_INITIALIZER;
/* Mach doesn't provide this. DAMN. */
struct enet_statistics *
@@ -68,11 +67,6 @@ static int ether_filter_len = sizeof (ether_filter) / sizeof (short);
static struct port_bucket *etherport_bucket;
-void
-mark_bh (int arg)
-{
- condition_broadcast (&more_packets);
-}
any_t
ethernet_thread (any_t arg)
@@ -122,16 +116,6 @@ ethernet_demuxer (mach_msg_header_t *inp,
return 1;
}
-any_t
-input_work_thread (any_t arg)
-{
- mutex_lock (&global_lock);
- for (;;)
- {
- condition_wait (&more_packets, &global_lock);
- net_bh (0);
- }
-}
int
ethernet_open (struct device *dev)
@@ -161,7 +145,6 @@ ethernet_open (struct device *dev)
if (err)
error (2, err, "%s", dev->name);
cthread_detach (cthread_fork (ethernet_thread, 0));
- cthread_detach (cthread_fork (input_work_thread, 0));
return 0;
}
diff --git a/pfinet/main.c b/pfinet/main.c
index a0e149b3..0232dd66 100644
--- a/pfinet/main.c
+++ b/pfinet/main.c
@@ -188,7 +188,7 @@ main (int argc,
init_devices ();
init_time ();
-
+ cthread_detach (cthread_fork (input_work_thread, 0));
inet_proto_init (0);
arrange_shutdown_notification ();
diff --git a/pfinet/pfinet.h b/pfinet/pfinet.h
index 368c6b54..36756615 100644
--- a/pfinet/pfinet.h
+++ b/pfinet/pfinet.h
@@ -29,8 +29,6 @@
extern device_t master_device;
-void incoming_net_packet (void);
-
extern struct proto_ops *proto_ops;
struct mutex global_lock;
@@ -71,6 +69,7 @@ struct sock_user *make_sock_user (struct socket *, int, int);
error_t make_sockaddr_port (struct socket *, int,
mach_port_t *, mach_msg_type_name_t *);
void init_devices (void);
+any_t input_work_thread (any_t);
void init_time (void);
void inet_proto_init (struct net_proto *);
void ip_rt_add (short, u_long, u_long, u_long, struct device *,