summaryrefslogtreecommitdiffstats
path: root/sys/net/if_sl.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-01-31 07:58:58 +0000
committerpeter <peter@FreeBSD.org>2001-01-31 07:58:58 +0000
commit6be84866ea66a3d9041f0400dda21d05913d219d (patch)
tree126edfdf3ed82891788fa9edc2df5bada88d2592 /sys/net/if_sl.c
parent2c2377c37d343b47ad9d996ea324576e1977647d (diff)
downloadFreeBSD-src-6be84866ea66a3d9041f0400dda21d05913d219d.zip
FreeBSD-src-6be84866ea66a3d9041f0400dda21d05913d219d.tar.gz
Exterminate the use of PSEUDO_SET() with extreme prejudice.
Diffstat (limited to 'sys/net/if_sl.c')
-rw-r--r--sys/net/if_sl.c45
1 files changed, 29 insertions, 16 deletions
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index d3f8085..8871bfd 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -81,6 +81,7 @@
#include <sys/clist.h>
#include <sys/kernel.h>
#include <sys/conf.h>
+#include <sys/module.h>
#include <net/if.h>
#include <net/if_types.h>
@@ -103,9 +104,6 @@
static MALLOC_DEFINE(M_SL, "sl", "SLIP Interface");
-static void slattach __P((void *));
-PSEUDO_SET(slattach, if_sl);
-
/*
* SLRMAX is a hard limit on input packet size. To simplify the code
* and improve performance, we require that packets fit in an mbuf
@@ -198,20 +196,34 @@ static struct linesw slipdisc = {
/*
* Called from boot code to establish sl interfaces.
*/
-static void
-slattach(dummy)
- void *dummy;
-{
- linesw[SLIPDISC] = slipdisc;
-
- LIST_INIT(&sl_list);
-}
+static int
+sl_modevent(module_t mod, int type, void *data)
+{
+ switch (type) {
+ case MOD_LOAD:
+ linesw[SLIPDISC] = slipdisc;
+ LIST_INIT(&sl_list);
+ break;
+ case MOD_UNLOAD:
+ printf("if_sl module unload - not possible for this module type\n");
+ return EINVAL;
+ }
+ return 0;
+}
+
+static moduledata_t sl_mod = {
+ "if_sl",
+ sl_modevent,
+ 0
+};
+
+DECLARE_MODULE(if_sl, sl_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
static int *st_unit_list;
static size_t st_unit_max = 0;
-static
-int slisstatic(unit)
+static int
+slisstatic(unit)
int unit;
{
size_t i;
@@ -222,8 +234,8 @@ int slisstatic(unit)
return 0;
}
-static
-void slmarkstatic(unit)
+static void
+slmarkstatic(unit)
int unit;
{
int *t;
@@ -367,7 +379,8 @@ slopen(dev, tp)
}
void
-sldestroy(struct sl_softc *sc) {
+sldestroy(struct sl_softc *sc)
+{
bpfdetach(&sc->sc_if);
if_detach(&sc->sc_if);
LIST_REMOVE(sc, sl_next);
OpenPOWER on IntegriCloud