diff options
author | phk <phk@FreeBSD.org> | 2000-03-27 20:05:04 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-03-27 20:05:04 +0000 |
commit | c0e09df016e1c742635bf5439eda43e93cf6f171 (patch) | |
tree | e2776449051182b1e5fc837fa92affdd530ec1a4 /sys/pci/if_mn.c | |
parent | eb0a2e03e4b1238f9334b04c8a2ad2c7008590db (diff) | |
download | FreeBSD-src-c0e09df016e1c742635bf5439eda43e93cf6f171.zip FreeBSD-src-c0e09df016e1c742635bf5439eda43e93cf6f171.tar.gz |
Allow reuse of hooks.
Remove debugging printfs.
Now compatible with ports/net/mpd-netgraph
Diffstat (limited to 'sys/pci/if_mn.c')
-rw-r--r-- | sys/pci/if_mn.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/pci/if_mn.c b/sys/pci/if_mn.c index 5796eb3..cc11fd5 100644 --- a/sys/pci/if_mn.c +++ b/sys/pci/if_mn.c @@ -395,9 +395,10 @@ ngmn_newhook(node_p node, hook_p hook, const char *name) if (ts == 0) return (EINVAL); chan = ffs(ts) - 1; - if (sc->ch[chan]) + if (!sc->ch[chan]) + mn_create_channel(sc, chan); + else if (sc->ch[chan]->state == UP) return (EBUSY); - mn_create_channel(sc, chan); sc->ch[chan]->ts = ts; sc->ch[chan]->hook = hook; sc->ch[chan]->tx_limit = nbit * 8; @@ -511,12 +512,10 @@ ngmn_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) if (sch->state != UP) { NG_FREE_DATA(m, meta); - printf("D1\n"); return (0); } if (sch->tx_pending + m->m_pkthdr.len > sch->tx_limit * mn_maxlatency) { NG_FREE_DATA(m, meta); - printf("D2\n"); return (0); } NG_FREE_META(meta); |