diff options
author | ru <ru@FreeBSD.org> | 2005-02-12 12:04:10 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-02-12 12:04:10 +0000 |
commit | 7bd12fe3ee76ea39a086c73aca00b09e6f9c0ec5 (patch) | |
tree | 8ac9d72a0d143fef049a3a008e50287ce26b8672 /sys/dev/ar | |
parent | 3fbcda2e525db1b507832e69c86fa892de860d91 (diff) | |
download | FreeBSD-src-7bd12fe3ee76ea39a086c73aca00b09e6f9c0ec5.zip FreeBSD-src-7bd12fe3ee76ea39a086c73aca00b09e6f9c0ec5.tar.gz |
Two problems here:
1. Dependency on netgraph module was broken (wrong version).
2. Netgraph node type was never destroyed on unload. This
was masked by problem #1.
Fixed both by using NETGRAPH_INIT(). Now netgraph node type
is created on module load, as in the rest of netgraph modules.
Diffstat (limited to 'sys/dev/ar')
-rw-r--r-- | sys/dev/ar/if_ar.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c index 70abc1d..14c4a79 100644 --- a/sys/dev/ar/if_ar.c +++ b/sys/dev/ar/if_ar.c @@ -182,8 +182,6 @@ static int irqtable[16] = { #ifndef NETGRAPH MODULE_DEPEND(if_ar, sppp, 1, 1, 1); -#else -MODULE_DEPEND(ng_sync_ar, netgraph, 1, 1, 1); #endif static void arintr(void *arg); @@ -215,7 +213,6 @@ static void ar_timer_intr(struct ar_hardc *hc, int scano, u_char isr); #ifdef NETGRAPH static void ngar_watchdog_frame(void * arg); -static void ngar_init(void* ignored); static ng_constructor_t ngar_constructor; static ng_rcvmsg_t ngar_rcvmsg; @@ -237,8 +234,7 @@ static struct ng_type typestruct = { .rcvdata = ngar_rcvdata, .disconnect = ngar_disconnect, }; - -static int ngar_done_init = 0; +NETGRAPH_INIT(sync_ar, &typestruct); #endif /* NETGRAPH */ int @@ -321,10 +317,6 @@ ar_attach(device_t device) bpfattach(ifp, DLT_PPP, PPP_HEADER_LEN); #else /* NETGRAPH */ - /* - * we have found a node, make sure our 'type' is availabe. - */ - if (ngar_done_init == 0) ngar_init(NULL); if (ng_make_node_common(&typestruct, &sc->node) != 0) return (1); sprintf(sc->nodename, "%s%d", NG_AR_NODE_TYPE, sc->unit); @@ -2344,18 +2336,6 @@ ngar_disconnect(hook_p hook) } return (0); } - -/* - * called during bootup - * or LKM loading to put this type into the list of known modules - */ -static void -ngar_init(void *ignored) -{ - if (ng_newtype(&typestruct)) - printf("ngar install failed\n"); - ngar_done_init = 1; -} #endif /* NETGRAPH */ /* |