From 2d1192e61200eb8fc54319899e014acefd14ae74 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 12 Dec 2000 18:52:14 +0000 Subject: Reviewed by: Archie@freebsd.org This clears out my outstanding netgraph changes. There is a netgraph change of design in the offing and this is to some extent a superset of soem of the new functionality and some of the old functionality that may be removed. This code works as before, but allows some new features that I want to work with and evaluate. It is the basis for a version of netgraph with integral locking for SMP use. This is running on my test machine with no new problems :-) --- sys/dev/ar/if_ar.c | 10 +++++++--- sys/dev/ar/if_ar_isa.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'sys/dev/ar') diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c index 9acc402..ad5aac9 100644 --- a/sys/dev/ar/if_ar.c +++ b/sys/dev/ar/if_ar.c @@ -285,7 +285,6 @@ static struct ng_type typestruct = { NULL, ngar_connect, ngar_rcvdata, - ngar_rcvdata, ngar_disconnect, NULL }; @@ -1732,6 +1731,9 @@ ar_get_packets(struct ar_softc *sc) int i; int len; u_char rxstat; +#ifdef NETGRAPH + int error; +#endif while(ar_packet_avail(sc, &len, &rxstat)) { TRC(printf("apa: len %d, rxstat %x\n", len, rxstat)); @@ -1765,7 +1767,7 @@ ar_get_packets(struct ar_softc *sc) sppp_input(&sc->ifsppp.pp_if, m); sc->ifsppp.pp_if.if_ipackets++; #else /* NETGRAPH */ - ng_queue_data(sc->hook, m, NULL); + NG_SEND_DATA_ONLY(error, sc->hook, m); sc->ipackets++; #endif /* NETGRAPH */ @@ -2283,7 +2285,7 @@ ngar_rcvmsg(node_p node, struct ng_mesg *msg, */ static int ngar_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, - struct mbuf **ret_m, meta_p *ret_meta) + struct mbuf **ret_m, meta_p *ret_meta, struct ng_mesg **resp) { int s; int error = 0; @@ -2350,6 +2352,8 @@ ngar_rmnode(node_p node) static int ngar_connect(hook_p hook) { + /* probably not at splnet, force outward queueing */ + hook->peer->flags |= HK_QUEUE; /* be really amiable and just say "YUP that's OK by me! " */ return (0); } diff --git a/sys/dev/ar/if_ar_isa.c b/sys/dev/ar/if_ar_isa.c index 9acc402..ad5aac9 100644 --- a/sys/dev/ar/if_ar_isa.c +++ b/sys/dev/ar/if_ar_isa.c @@ -285,7 +285,6 @@ static struct ng_type typestruct = { NULL, ngar_connect, ngar_rcvdata, - ngar_rcvdata, ngar_disconnect, NULL }; @@ -1732,6 +1731,9 @@ ar_get_packets(struct ar_softc *sc) int i; int len; u_char rxstat; +#ifdef NETGRAPH + int error; +#endif while(ar_packet_avail(sc, &len, &rxstat)) { TRC(printf("apa: len %d, rxstat %x\n", len, rxstat)); @@ -1765,7 +1767,7 @@ ar_get_packets(struct ar_softc *sc) sppp_input(&sc->ifsppp.pp_if, m); sc->ifsppp.pp_if.if_ipackets++; #else /* NETGRAPH */ - ng_queue_data(sc->hook, m, NULL); + NG_SEND_DATA_ONLY(error, sc->hook, m); sc->ipackets++; #endif /* NETGRAPH */ @@ -2283,7 +2285,7 @@ ngar_rcvmsg(node_p node, struct ng_mesg *msg, */ static int ngar_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, - struct mbuf **ret_m, meta_p *ret_meta) + struct mbuf **ret_m, meta_p *ret_meta, struct ng_mesg **resp) { int s; int error = 0; @@ -2350,6 +2352,8 @@ ngar_rmnode(node_p node) static int ngar_connect(hook_p hook) { + /* probably not at splnet, force outward queueing */ + hook->peer->flags |= HK_QUEUE; /* be really amiable and just say "YUP that's OK by me! " */ return (0); } -- cgit v1.1