if_tun.c (111742) | if_tun.c (111748) |
---|---|
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. 9 * 10 * This driver takes packets off the IP i/f and hands them up to a 11 * user process to have its wicked way with. This driver has it's 12 * roots in a similar driver written by Phil Cockcroft (formerly) at 13 * UCL. This driver is based much more on read/write/poll mode of 14 * operation though. 15 * | 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. 9 * 10 * This driver takes packets off the IP i/f and hands them up to a 11 * user process to have its wicked way with. This driver has it's 12 * roots in a similar driver written by Phil Cockcroft (formerly) at 13 * UCL. This driver is based much more on read/write/poll mode of 14 * operation though. 15 * |
16 * $FreeBSD: head/sys/net/if_tun.c 111742 2003-03-02 15:56:49Z des $ | 16 * $FreeBSD: head/sys/net/if_tun.c 111748 2003-03-02 16:54:40Z des $ |
17 */ 18 19#include "opt_inet.h" 20#include "opt_mac.h" 21 22#include <sys/param.h> 23#include <sys/proc.h> 24#include <sys/systm.h> --- 181 unchanged lines hidden (view full) --- 206 207static void 208tunstart(struct ifnet *ifp) 209{ 210 struct tun_softc *tp = ifp->if_softc; 211 212 if (tp->tun_flags & TUN_RWAIT) { 213 tp->tun_flags &= ~TUN_RWAIT; | 17 */ 18 19#include "opt_inet.h" 20#include "opt_mac.h" 21 22#include <sys/param.h> 23#include <sys/proc.h> 24#include <sys/systm.h> --- 181 unchanged lines hidden (view full) --- 206 207static void 208tunstart(struct ifnet *ifp) 209{ 210 struct tun_softc *tp = ifp->if_softc; 211 212 if (tp->tun_flags & TUN_RWAIT) { 213 tp->tun_flags &= ~TUN_RWAIT; |
214 wakeup((caddr_t)tp); | 214 wakeup(tp); |
215 } 216 if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio) 217 pgsigio(&tp->tun_sigio, SIGIO, 0); 218 selwakeup(&tp->tun_rsel); 219} 220 221static void 222tuncreate(dev_t dev) --- 436 unchanged lines hidden (view full) --- 659 do { 660 IF_DEQUEUE(&ifp->if_snd, m); 661 if (m == NULL) { 662 if (flag & IO_NDELAY) { 663 splx(s); 664 return (EWOULDBLOCK); 665 } 666 tp->tun_flags |= TUN_RWAIT; | 215 } 216 if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio) 217 pgsigio(&tp->tun_sigio, SIGIO, 0); 218 selwakeup(&tp->tun_rsel); 219} 220 221static void 222tuncreate(dev_t dev) --- 436 unchanged lines hidden (view full) --- 659 do { 660 IF_DEQUEUE(&ifp->if_snd, m); 661 if (m == NULL) { 662 if (flag & IO_NDELAY) { 663 splx(s); 664 return (EWOULDBLOCK); 665 } 666 tp->tun_flags |= TUN_RWAIT; |
667 if((error = tsleep((caddr_t)tp, PCATCH | (PZERO + 1), | 667 if((error = tsleep(tp, PCATCH | (PZERO + 1), |
668 "tunread", 0)) != 0) { 669 splx(s); 670 return (error); 671 } 672 } 673 } while (m == NULL); 674 splx(s); 675 --- 158 unchanged lines hidden --- | 668 "tunread", 0)) != 0) { 669 splx(s); 670 return (error); 671 } 672 } 673 } while (m == NULL); 674 splx(s); 675 --- 158 unchanged lines hidden --- |