From 3f0a670dfadb774662f4d1cefa85f9cfd8276337 Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 27 Jan 2000 23:37:39 +0000 Subject: Redo the intrq.c idea as int family_enqueue(sa_family_t, struct mbuf *); --- sys/net/if_tun.c | 117 +------------------------------------------------------ 1 file changed, 2 insertions(+), 115 deletions(-) (limited to 'sys/net/if_tun.c') diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 9db0048..6a59859 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -46,42 +46,11 @@ #include #include -#ifdef ATM_CORE -#include -#include -#include -#endif - #ifdef INET #include #include #endif -#ifdef INET6 -#include -#include -#endif - -#ifdef IPX -#include -#include -#endif - -#ifdef NATM -#include -#endif - -#ifdef NETATALK -#include -#include -#endif - -#ifdef NS -/* This will never be defined by config(8), or for the if_tun module ! */ -#include -#include -#endif - #include #include @@ -631,9 +600,8 @@ tunwrite(dev, uio, flag) struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = &tp->tun_if; struct mbuf *top, **mp, *m; - int error=0, s, tlen, mlen, isr; + int error=0, tlen, mlen; u_int32_t family; - struct ifqueue *q; TUNDEBUG("%s%d: tunwrite\n", ifp->if_name, ifp->if_unit); @@ -713,88 +681,7 @@ tunwrite(dev, uio, flag) } else family = AF_INET; - q = NULL; - isr = 0; - - switch (family) { -#ifdef ATM_CORE - case AF_ATM: - if (atmintrq_present) { - q = &atm_intrq; - isr = NETISR_ATM; - } - break; -#endif -#ifdef INET - case AF_INET: - if (ipintrq_present) { - q = &ipintrq; - isr = NETISR_IP; - } - break; -#endif -#ifdef INET6 - case AF_INET6: - if (ip6intrq_present) { - q = &ip6intrq; - isr = NETISR_IPV6; - } - break; -#endif -#ifdef IPX - case AF_IPX: - if (ipxintrq_present) { - q = &ipxintrq; - isr = NETISR_IPX; - } - break; -#endif -#ifdef NATM - case AF_NATM: - if (natmintrq_present) { - q = &natmintrq; - isr = NETISR_NATM; - } - break; -#endif -#ifdef NETATALK - case AF_APPLETALK: - if (atintrq2_present) { - q = &atintrq2; - isr = NETISR_ATALK; - } - break; -#endif -#ifdef NS - case AF_NS: - if (nsintrq_present) { - q = &nsintrq; - isr = NETISR_NS; - } - break; -#endif - } - - if (!q) { - m_freem(top); - return EAFNOSUPPORT; - } - - s = splimp(); - if (IF_QFULL (q)) { - IF_DROP(q); - splx(s); - ifp->if_collisions++; - m_freem(top); - return ENOBUFS; - } - IF_ENQUEUE(q, top); - splx(s); - ifp->if_ibytes += tlen; - ifp->if_ipackets++; - schednetisr(isr); - - return error; + return family_enqueue(family, top); } /* -- cgit v1.1