| 833 | } |
| 834 | |
| 835 | static void |
| 836 | tunstart(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 |
nothing calls this directly
no test coverage detected