if_vx.c (43295) | if_vx.c (48645) |
---|---|
1/* 2 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * | 1/* 2 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * |
30 * $Id: if_vx.c,v 1.19 1999/01/12 02:09:31 eivind Exp $ | 30 * $Id: if_vx.c,v 1.20 1999/01/27 20:09:20 dillon Exp $ |
31 * 32 */ 33 34/* 35 * Created from if_ep.c driver by Fred Gray (fgray@rice.edu) to support 36 * the 3c590 family. 37 */ 38 --- 18 unchanged lines hidden (view full) --- 57#include "vx.h" 58#if NVX > 0 59 60#if NVX < 4 /* These cost 4 bytes apiece, so give us 4 */ 61#undef NVX 62#define NVX 4 63#endif 64 | 31 * 32 */ 33 34/* 35 * Created from if_ep.c driver by Fred Gray (fgray@rice.edu) to support 36 * the 3c590 family. 37 */ 38 --- 18 unchanged lines hidden (view full) --- 57#include "vx.h" 58#if NVX > 0 59 60#if NVX < 4 /* These cost 4 bytes apiece, so give us 4 */ 61#undef NVX 62#define NVX 4 63#endif 64 |
65#include "bpfilter.h" | 65#include "bpf.h" |
66 67#include <sys/param.h> 68#include <sys/systm.h> 69#include <sys/sockio.h> 70#include <sys/malloc.h> 71#include <sys/mbuf.h> 72#include <sys/socket.h> 73 74#include <net/if.h> 75 76#include <net/ethernet.h> 77#include <net/if_arp.h> 78 | 66 67#include <sys/param.h> 68#include <sys/systm.h> 69#include <sys/sockio.h> 70#include <sys/malloc.h> 71#include <sys/mbuf.h> 72#include <sys/socket.h> 73 74#include <net/if.h> 75 76#include <net/ethernet.h> 77#include <net/if_arp.h> 78 |
79#if NBPFILTER > 0 | 79#if NBPF > 0 |
80#include <net/bpf.h> 81#endif 82 83#include <machine/clock.h> 84 85#include <dev/vx/if_vxreg.h> 86 87#define ETHER_MAX_LEN 1518 --- 123 unchanged lines hidden (view full) --- 211 ifp->if_ioctl = vxioctl; 212 ifp->if_init = vxinit; 213 ifp->if_watchdog = vxwatchdog; 214 ifp->if_softc = sc; 215 216 if_attach(ifp); 217 ether_ifattach(ifp); 218 | 80#include <net/bpf.h> 81#endif 82 83#include <machine/clock.h> 84 85#include <dev/vx/if_vxreg.h> 86 87#define ETHER_MAX_LEN 1518 --- 123 unchanged lines hidden (view full) --- 211 ifp->if_ioctl = vxioctl; 212 ifp->if_init = vxinit; 213 ifp->if_watchdog = vxwatchdog; 214 ifp->if_softc = sc; 215 216 if_attach(ifp); 217 ether_ifattach(ifp); 218 |
219#if NBPFILTER > 0 | 219#if NBPF > 0 |
220 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 221#endif 222 223 sc->tx_start_thresh = 20; /* probably a good starting point. */ 224 225 vxstop(sc); 226 227 return 1; --- 263 unchanged lines hidden (view full) --- 491 if (m0 == 0) { /* not really needed */ 492 return; 493 } 494 495 VX_BUSY_WAIT; 496 outw(BASE + VX_COMMAND, SET_TX_START_THRESH | 497 ((len / 4 + sc->tx_start_thresh) >> 2)); 498 | 220 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 221#endif 222 223 sc->tx_start_thresh = 20; /* probably a good starting point. */ 224 225 vxstop(sc); 226 227 return 1; --- 263 unchanged lines hidden (view full) --- 491 if (m0 == 0) { /* not really needed */ 492 return; 493 } 494 495 VX_BUSY_WAIT; 496 outw(BASE + VX_COMMAND, SET_TX_START_THRESH | 497 ((len / 4 + sc->tx_start_thresh) >> 2)); 498 |
499#if NBPFILTER > 0 | 499#if NBPF > 0 |
500 if (sc->arpcom.ac_if.if_bpf) { 501 bpf_mtap(&sc->arpcom.ac_if, m0); 502 } 503#endif 504 505 /* 506 * Do the output at splhigh() so that an interrupt from another device 507 * won't cause a FIFO underrun. --- 232 unchanged lines hidden (view full) --- 740 goto abort; 741 } 742 743 ++ifp->if_ipackets; 744 745 /* We assume the header fit entirely in one mbuf. */ 746 eh = mtod(m, struct ether_header *); 747 | 500 if (sc->arpcom.ac_if.if_bpf) { 501 bpf_mtap(&sc->arpcom.ac_if, m0); 502 } 503#endif 504 505 /* 506 * Do the output at splhigh() so that an interrupt from another device 507 * won't cause a FIFO underrun. --- 232 unchanged lines hidden (view full) --- 740 goto abort; 741 } 742 743 ++ifp->if_ipackets; 744 745 /* We assume the header fit entirely in one mbuf. */ 746 eh = mtod(m, struct ether_header *); 747 |
748#if NBPFILTER > 0 | 748#if NBPF > 0 |
749 /* 750 * Check if there's a BPF listener on this interface. 751 * If so, hand off the raw packet to BPF. 752 */ 753 if (sc->arpcom.ac_if.if_bpf) { 754 bpf_mtap(&sc->arpcom.ac_if, m); 755 } 756#endif --- 333 unchanged lines hidden --- | 749 /* 750 * Check if there's a BPF listener on this interface. 751 * If so, hand off the raw packet to BPF. 752 */ 753 if (sc->arpcom.ac_if.if_bpf) { 754 bpf_mtap(&sc->arpcom.ac_if, m); 755 } 756#endif --- 333 unchanged lines hidden --- |