Deleted Added
full compact
bpf.c (111742) bpf.c (111748)
1/*
2 * Copyright (c) 1990, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from the Stanford/CMU enet packet filter,
6 * (net/enet.c) distributed as part of 4.3BSD, and code contributed
7 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
8 * Berkeley Laboratory.

--- 23 unchanged lines hidden (view full) ---

32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)bpf.c 8.4 (Berkeley) 1/9/95
39 *
1/*
2 * Copyright (c) 1990, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from the Stanford/CMU enet packet filter,
6 * (net/enet.c) distributed as part of 4.3BSD, and code contributed
7 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
8 * Berkeley Laboratory.

--- 23 unchanged lines hidden (view full) ---

32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)bpf.c 8.4 (Berkeley) 1/9/95
39 *
40 * $FreeBSD: head/sys/net/bpf.c 111742 2003-03-02 15:56:49Z des $
40 * $FreeBSD: head/sys/net/bpf.c 111748 2003-03-02 16:54:40Z des $
41 */
42
43#include "opt_bpf.h"
44#include "opt_mac.h"
45#include "opt_netgraph.h"
46
47#include <sys/param.h>
48#include <sys/systm.h>

--- 403 unchanged lines hidden (view full) ---

452 BPFD_UNLOCK(d);
453 return (ENXIO);
454 }
455
456 if (ioflag & IO_NDELAY) {
457 BPFD_UNLOCK(d);
458 return (EWOULDBLOCK);
459 }
41 */
42
43#include "opt_bpf.h"
44#include "opt_mac.h"
45#include "opt_netgraph.h"
46
47#include <sys/param.h>
48#include <sys/systm.h>

--- 403 unchanged lines hidden (view full) ---

452 BPFD_UNLOCK(d);
453 return (ENXIO);
454 }
455
456 if (ioflag & IO_NDELAY) {
457 BPFD_UNLOCK(d);
458 return (EWOULDBLOCK);
459 }
460 error = msleep((caddr_t)d, &d->bd_mtx, PRINET|PCATCH,
460 error = msleep(d, &d->bd_mtx, PRINET|PCATCH,
461 "bpf", d->bd_rtout);
462 if (error == EINTR || error == ERESTART) {
463 BPFD_UNLOCK(d);
464 return (error);
465 }
466 if (error == EWOULDBLOCK) {
467 /*
468 * On a timeout, return what's in the buffer,

--- 44 unchanged lines hidden (view full) ---

513static __inline void
514bpf_wakeup(d)
515 struct bpf_d *d;
516{
517 if (d->bd_state == BPF_WAITING) {
518 callout_stop(&d->bd_callout);
519 d->bd_state = BPF_IDLE;
520 }
461 "bpf", d->bd_rtout);
462 if (error == EINTR || error == ERESTART) {
463 BPFD_UNLOCK(d);
464 return (error);
465 }
466 if (error == EWOULDBLOCK) {
467 /*
468 * On a timeout, return what's in the buffer,

--- 44 unchanged lines hidden (view full) ---

513static __inline void
514bpf_wakeup(d)
515 struct bpf_d *d;
516{
517 if (d->bd_state == BPF_WAITING) {
518 callout_stop(&d->bd_callout);
519 d->bd_state = BPF_IDLE;
520 }
521 wakeup((caddr_t)d);
521 wakeup(d);
522 if (d->bd_async && d->bd_sig && d->bd_sigio)
523 pgsigio(&d->bd_sigio, d->bd_sig, 0);
524
525 selwakeup(&d->bd_sel);
526}
527
528static void
529bpf_timed_out(arg)

--- 1027 unchanged lines hidden ---
522 if (d->bd_async && d->bd_sig && d->bd_sigio)
523 pgsigio(&d->bd_sigio, d->bd_sig, 0);
524
525 selwakeup(&d->bd_sel);
526}
527
528static void
529bpf_timed_out(arg)

--- 1027 unchanged lines hidden ---