diff options
author | julian <julian@FreeBSD.org> | 2001-01-08 05:34:06 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2001-01-08 05:34:06 +0000 |
commit | ff86256bf7f74eac72c4bd8a23d667579c672873 (patch) | |
tree | cf83301911bb4085e13cb3bf982901253e5919e5 /sys/i386/isa/if_ar.c | |
parent | 6b827cac3b001e32ed3dd87c8875590ebebda375 (diff) | |
download | FreeBSD-src-ff86256bf7f74eac72c4bd8a23d667579c672873.zip FreeBSD-src-ff86256bf7f74eac72c4bd8a23d667579c672873.tar.gz |
Part 2 of the netgraph rewrite.
This is mostly cosmetic changes, (though I caught a bug or two while
makeing them)
Reviewed by: archie@freebsd.org
Diffstat (limited to 'sys/i386/isa/if_ar.c')
-rw-r--r-- | sys/i386/isa/if_ar.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/i386/isa/if_ar.c b/sys/i386/isa/if_ar.c index 722a133..942b021 100644 --- a/sys/i386/isa/if_ar.c +++ b/sys/i386/isa/if_ar.c @@ -511,10 +511,10 @@ arattach(struct ar_hardc *hc) return (0); sprintf(sc->nodename, "%s%d", NG_AR_NODE_TYPE, sc->unit); if (ng_name_node(sc->node, sc->nodename)) { - ng_unref(sc->node); /* drop it again */ + NG_NODE_UNREF(sc->node); /* drop it again */ return (0); } - sc->node->private = sc; + NG_NODE_SET_PRIVATE(sc->node, sc); callout_handle_init(&sc->handle); sc->xmitq.ifq_maxlen = IFQ_MAXLEN; sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; @@ -2186,13 +2186,13 @@ ngar_constructor(node_p node) static int ngar_newhook(node_p node, hook_p hook, const char *name) { - struct ar_softc * sc = node->private; + struct ar_softc * sc = NG_NODE_PRIVATE(node); /* * check if it's our friend the debug hook */ if (strcmp(name, NG_AR_HOOK_DEBUG) == 0) { - hook->private = NULL; /* paranoid */ + NG_HOOK_SET_PRIVATE(hook, NULL); /* paranoid */ sc->debug_hook = hook; return (0); } @@ -2203,7 +2203,7 @@ ngar_newhook(node_p node, hook_p hook, const char *name) if (strcmp(name, NG_AR_HOOK_RAW) != 0) { return (EINVAL); } - hook->private = sc; + NG_HOOK_SET_PRIVATE(hook, sc); sc->hook = hook; sc->datahooks++; ar_up(sc); @@ -2223,7 +2223,7 @@ ngar_rcvmsg(node_p node, item_p item, hook_p lasthook) struct ng_mesg *msg; NGI_GET_MSG(item, msg); - sc = node->private; + sc = NG_NODE_PRIVATE(node); switch (msg->header.typecookie) { case NG_AR_COOKIE: error = EINVAL; @@ -2281,7 +2281,7 @@ ngar_rcvdata(hook_p hook, item_p item) { int s; int error = 0; - struct ar_softc * sc = hook->node->private; + struct ar_softc * sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); struct ifqueue *xmitq_p; struct mbuf *m; meta_p meta; @@ -2292,7 +2292,7 @@ ngar_rcvdata(hook_p hook, item_p item) /* * data doesn't come in from just anywhere (e.g control hook) */ - if ( hook->private == NULL) { + if ( NG_HOOK_PRIVATE(hook) == NULL) { error = ENETDOWN; goto bad; } @@ -2338,10 +2338,10 @@ bad: static int ngar_shutdown(node_p node) { - struct ar_softc * sc = node->private; + struct ar_softc * sc = NG_NODE_PRIVATE(node); ar_down(sc); - ng_unref(node); + NG_NODE_UNREF(node); /* XXX need to drain the output queues! */ /* The node is dead, long live the node! */ @@ -2352,10 +2352,10 @@ ngar_shutdown(node_p node) if (ng_name_node(sc->node, sc->nodename)) { sc->node = NULL; printf("node naming failed\n"); - ng_unref(sc->node); /* node dissappears */ + NG_NODE_UNREF(sc->node); /* node dissappears */ return (0); } - sc->node->private = sc; + NG_NODE_SET_PRIVATE(sc->node, sc); sc->running = 0; return (0); } @@ -2365,7 +2365,7 @@ static int ngar_connect(hook_p hook) { /* probably not at splnet, force outward queueing */ - hook->peer->flags |= HK_QUEUE; + NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook)); /* be really amiable and just say "YUP that's OK by me! " */ return (0); } @@ -2384,12 +2384,12 @@ ngar_connect(hook_p hook) static int ngar_disconnect(hook_p hook) { - struct ar_softc * sc = hook->node->private; + struct ar_softc * sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); int s; /* * If it's the data hook, then free resources etc. */ - if (hook->private) { + if (NG_HOOK_PRIVATE(hook)) { s = splimp(); sc->datahooks--; if (sc->datahooks == 0) |