int faith_clone_destroy(struct ifnet *ifp) { bpf_detach(ifp); if_detach(ifp); if_free(ifp); return (0); }
static int mpls_clone_destroy(struct ifnet *ifp) { int s; bpf_detach(ifp); s = splnet(); if_detach(ifp); splx(s); free(ifp->if_softc, M_DEVBUF); return 0; }
int pflog_clone_destroy(struct ifnet *ifp) { struct pflog_softc *pflogif = ifp->if_softc; int s; s = splnet(); pflogifs[pflogif->sc_unit] = NULL; LIST_REMOVE(pflogif, sc_list); splx(s); bpf_detach(ifp); if_detach(ifp); free(pflogif, M_DEVBUF); return (0); }
static int tun_clone_destroy(struct ifnet *ifp) { struct tun_softc *tp = (void *)ifp; int s, zombie = 0; IF_PURGE(&ifp->if_snd); ifp->if_flags &= ~IFF_RUNNING; s = splnet(); simple_lock(&tun_softc_lock); mutex_enter(&tp->tun_lock); LIST_REMOVE(tp, tun_list); if (tp->tun_flags & TUN_OPEN) { /* Hang on to storage until last close */ zombie = 1; tp->tun_flags &= ~TUN_INITED; LIST_INSERT_HEAD(&tunz_softc_list, tp, tun_list); } simple_unlock(&tun_softc_lock); if (tp->tun_flags & TUN_RWAIT) { tp->tun_flags &= ~TUN_RWAIT; wakeup((void *)tp); } selnotify(&tp->tun_rsel, 0, 0); mutex_exit(&tp->tun_lock); splx(s); if (tp->tun_flags & TUN_ASYNC && tp->tun_pgid) fownsignal(tp->tun_pgid, SIGIO, POLL_HUP, 0, NULL); bpf_detach(ifp); if_detach(ifp); if (!zombie) { seldestroy(&tp->tun_rsel); seldestroy(&tp->tun_wsel); softint_disestablish(tp->tun_osih); softint_disestablish(tp->tun_isih); mutex_destroy(&tp->tun_lock); free(tp, M_DEVBUF); } return (0); }
static int loop_clone_destroy(struct ifnet *ifp) { if (ifp == lo0ifp) return (EPERM); #ifdef MBUFTRACE MOWNER_DETACH(ifp->if_mowner); free(ifp->if_mowner, M_DEVBUF); #endif bpf_detach(ifp); if_detach(ifp); if_free(ifp); return (0); }
void ieee80211_ifdetach(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; ieee80211_remove_vap(ic); ieee80211_sysctl_detach(ic); ieee80211_proto_detach(ic); ieee80211_crypto_detach(ic); ieee80211_node_detach(ic); LIST_REMOVE(ic, ic_list); ifmedia_delete_instance(&ic->ic_media, IFM_INST_ANY); IEEE80211_BEACON_LOCK_DESTROY(ic); bpf_detach(ifp); ether_ifdetach(ifp); }
static int gif_clone_destroy(struct ifnet *ifp) { struct gif_softc *sc = (void *) ifp; gif_delete_tunnel(&sc->gif_if); LIST_REMOVE(sc, gif_list); #ifdef INET6 encap_detach(sc->encap_cookie6); #endif #ifdef INET encap_detach(sc->encap_cookie4); #endif bpf_detach(ifp); if_detach(ifp); rtcache_free(&sc->gif_ro); free(sc, M_DEVBUF); return (0); }