MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tunstart

Function tunstart

freebsd/net/if_tuntap.c:835–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

833}
834
835static void
836tunstart(struct ifnet *ifp)
837{
838 struct tuntap_softc *tp = ifp->if_softc;
839 struct mbuf *m;
840
841 TUNDEBUG(ifp, "starting\n");
842 if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
843 IFQ_LOCK(&ifp->if_snd);
844 IFQ_POLL_NOLOCK(&ifp->if_snd, m);
845 if (m == NULL) {
846 IFQ_UNLOCK(&ifp->if_snd);
847 return;
848 }
849 IFQ_UNLOCK(&ifp->if_snd);
850 }
851
852 TUN_LOCK(tp);
853 if (tp->tun_flags & TUN_RWAIT) {
854 tp->tun_flags &= ~TUN_RWAIT;
855 wakeup(tp);
856 }
857 selwakeuppri(&tp->tun_rsel, PZERO + 1);
858 KNOTE_LOCKED(&tp->tun_rsel.si_note, 0);
859 if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio) {
860 TUN_UNLOCK(tp);
861 pgsigio(&tp->tun_sigio, SIGIO, 0);
862 } else
863 TUN_UNLOCK(tp);
864}
865
866/*
867 * tunstart_l2

Callers

nothing calls this directly

Calls 3

selwakeuppriFunction · 0.85
wakeupFunction · 0.50
pgsigioFunction · 0.50

Tested by

no test coverage detected