if_tun.c (46112) | if_tun.c (46568) |
---|---|
1/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */ 2 3/* 4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> 5 * Nottingham University 1987. 6 * 7 * This source may be freely distributed, however I would be interested 8 * in any changes that are made. --- 643 unchanged lines hidden (view full) --- 652 int unit = dev_val(minor(dev)), s; 653 struct tun_softc *tp = &tunctl[unit]; 654 struct ifnet *ifp = &tp->tun_if; 655 int revents = 0; 656 657 s = splimp(); 658 TUNDEBUG("%s%d: tunpoll\n", ifp->if_name, ifp->if_unit); 659 | 1/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */ 2 3/* 4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> 5 * Nottingham University 1987. 6 * 7 * This source may be freely distributed, however I would be interested 8 * in any changes that are made. --- 643 unchanged lines hidden (view full) --- 652 int unit = dev_val(minor(dev)), s; 653 struct tun_softc *tp = &tunctl[unit]; 654 struct ifnet *ifp = &tp->tun_if; 655 int revents = 0; 656 657 s = splimp(); 658 TUNDEBUG("%s%d: tunpoll\n", ifp->if_name, ifp->if_unit); 659 |
660 if (events & (POLLIN | POLLRDNORM)) | 660 if (events & (POLLIN | POLLRDNORM)) { |
661 if (ifp->if_snd.ifq_len > 0) { 662 TUNDEBUG("%s%d: tunpoll q=%d\n", ifp->if_name, 663 ifp->if_unit, ifp->if_snd.ifq_len); 664 revents |= events & (POLLIN | POLLRDNORM); 665 } else { 666 TUNDEBUG("%s%d: tunpoll waiting\n", ifp->if_name, 667 ifp->if_unit); 668 selrecord(p, &tp->tun_rsel); 669 } | 661 if (ifp->if_snd.ifq_len > 0) { 662 TUNDEBUG("%s%d: tunpoll q=%d\n", ifp->if_name, 663 ifp->if_unit, ifp->if_snd.ifq_len); 664 revents |= events & (POLLIN | POLLRDNORM); 665 } else { 666 TUNDEBUG("%s%d: tunpoll waiting\n", ifp->if_name, 667 ifp->if_unit); 668 selrecord(p, &tp->tun_rsel); 669 } |
670 | 670 } |
671 if (events & (POLLOUT | POLLWRNORM)) 672 revents |= events & (POLLOUT | POLLWRNORM); 673 674 splx(s); 675 return (revents); 676} 677 678 679#endif /* NTUN */ | 671 if (events & (POLLOUT | POLLWRNORM)) 672 revents |= events & (POLLOUT | POLLWRNORM); 673 674 splx(s); 675 return (revents); 676} 677 678 679#endif /* NTUN */ |