if_tl.c (48443) | if_tl.c (48645) |
---|---|
1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $Id: if_tl.c,v 1.32 1999/05/09 17:07:01 peter Exp $ | 32 * $Id: if_tl.c,v 1.33 1999/07/02 04:17:15 peter Exp $ |
33 */ 34 35/* 36 * Texas Instruments ThunderLAN driver for FreeBSD 2.2.6 and 3.x. 37 * Supports many Compaq PCI NICs based on the ThunderLAN ethernet controller, 38 * the National Semiconductor DP83840A physical interface and the 39 * Microchip Technology 24Cxx series serial EEPROM. 40 * --- 132 unchanged lines hidden (view full) --- 173 * 174 * Using these techniques, this driver achieves very high performance 175 * by minimizing the amount of interrupts generated during large 176 * transfers and by completely avoiding buffer copies. Frame transfer 177 * to and from the ThunderLAN chip is performed entirely by the chip 178 * itself thereby reducing the load on the host CPU. 179 */ 180 | 33 */ 34 35/* 36 * Texas Instruments ThunderLAN driver for FreeBSD 2.2.6 and 3.x. 37 * Supports many Compaq PCI NICs based on the ThunderLAN ethernet controller, 38 * the National Semiconductor DP83840A physical interface and the 39 * Microchip Technology 24Cxx series serial EEPROM. 40 * --- 132 unchanged lines hidden (view full) --- 173 * 174 * Using these techniques, this driver achieves very high performance 175 * by minimizing the amount of interrupts generated during large 176 * transfers and by completely avoiding buffer copies. Frame transfer 177 * to and from the ThunderLAN chip is performed entirely by the chip 178 * itself thereby reducing the load on the host CPU. 179 */ 180 |
181#include "bpfilter.h" | 181#include "bpf.h" |
182 183#include <sys/param.h> 184#include <sys/systm.h> 185#include <sys/sockio.h> 186#include <sys/mbuf.h> 187#include <sys/malloc.h> 188#include <sys/kernel.h> 189#include <sys/socket.h> 190 191#include <net/if.h> 192#include <net/if_arp.h> 193#include <net/ethernet.h> 194#include <net/if_dl.h> 195#include <net/if_media.h> 196 | 182 183#include <sys/param.h> 184#include <sys/systm.h> 185#include <sys/sockio.h> 186#include <sys/mbuf.h> 187#include <sys/malloc.h> 188#include <sys/kernel.h> 189#include <sys/socket.h> 190 191#include <net/if.h> 192#include <net/if_arp.h> 193#include <net/ethernet.h> 194#include <net/if_dl.h> 195#include <net/if_media.h> 196 |
197#if NBPFILTER > 0 | 197#if NBPF > 0 |
198#include <net/bpf.h> 199#endif 200 201#include <vm/vm.h> /* for vtophys */ 202#include <vm/pmap.h> /* for vtophys */ 203#include <machine/clock.h> /* for DELAY */ 204#include <machine/bus_memio.h> 205#include <machine/bus_pio.h> --- 10 unchanged lines hidden (view full) --- 216#define TL_USEIOSPACE 217 218/* #define TL_BACKGROUND_AUTONEG */ 219 220#include <pci/if_tlreg.h> 221 222#if !defined(lint) 223static const char rcsid[] = | 198#include <net/bpf.h> 199#endif 200 201#include <vm/vm.h> /* for vtophys */ 202#include <vm/pmap.h> /* for vtophys */ 203#include <machine/clock.h> /* for DELAY */ 204#include <machine/bus_memio.h> 205#include <machine/bus_pio.h> --- 10 unchanged lines hidden (view full) --- 216#define TL_USEIOSPACE 217 218/* #define TL_BACKGROUND_AUTONEG */ 219 220#include <pci/if_tlreg.h> 221 222#if !defined(lint) 223static const char rcsid[] = |
224 "$Id: if_tl.c,v 1.32 1999/05/09 17:07:01 peter Exp $"; | 224 "$Id: if_tl.c,v 1.33 1999/07/02 04:17:15 peter Exp $"; |
225#endif 226 227/* 228 * Various supported device vendors/types and their names. 229 */ 230 231static struct tl_type tl_devs[] = { 232 { TI_VENDORID, TI_DEVICEID_THUNDERLAN, --- 1548 unchanged lines hidden (view full) --- 1781 tl_intr((void *)sc); 1782 1783 /* 1784 * Call MI attach routines. 1785 */ 1786 if_attach(ifp); 1787 ether_ifattach(ifp); 1788 | 225#endif 226 227/* 228 * Various supported device vendors/types and their names. 229 */ 230 231static struct tl_type tl_devs[] = { 232 { TI_VENDORID, TI_DEVICEID_THUNDERLAN, --- 1548 unchanged lines hidden (view full) --- 1781 tl_intr((void *)sc); 1782 1783 /* 1784 * Call MI attach routines. 1785 */ 1786 if_attach(ifp); 1787 ether_ifattach(ifp); 1788 |
1789#if NBPFILTER > 0 | 1789#if NBPF > 0 |
1790 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 1791#endif 1792 1793 at_shutdown(tl_shutdown, sc, SHUTDOWN_POST_SYNC); 1794 1795fail: 1796 splx(s); 1797 return; --- 163 unchanged lines hidden (view full) --- 1961 */ 1962 /*if (ifp->if_flags & IFF_PROMISC && */ 1963 if (!bcmp(eh->ether_shost, sc->arpcom.ac_enaddr, 1964 ETHER_ADDR_LEN)) { 1965 m_freem(m); 1966 continue; 1967 } 1968 | 1790 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 1791#endif 1792 1793 at_shutdown(tl_shutdown, sc, SHUTDOWN_POST_SYNC); 1794 1795fail: 1796 splx(s); 1797 return; --- 163 unchanged lines hidden (view full) --- 1961 */ 1962 /*if (ifp->if_flags & IFF_PROMISC && */ 1963 if (!bcmp(eh->ether_shost, sc->arpcom.ac_enaddr, 1964 ETHER_ADDR_LEN)) { 1965 m_freem(m); 1966 continue; 1967 } 1968 |
1969#if NBPFILTER > 0 | 1969#if NBPF > 0 |
1970 /* 1971 * Handle BPF listeners. Let the BPF user see the packet, but 1972 * don't pass it up to the ether_input() layer unless it's 1973 * a broadcast packet, multicast packet, matches our ethernet 1974 * address or the interface is in promiscuous mode. If we don't 1975 * want the packet, just forget it. We leave the mbuf in place 1976 * since it can be used again later. 1977 */ --- 451 unchanged lines hidden (view full) --- 2429 prev->tl_ptr->tlist_fptr = vtophys(cur_tx->tl_ptr); 2430 } 2431 prev = cur_tx; 2432 2433 /* 2434 * If there's a BPF listener, bounce a copy of this frame 2435 * to him. 2436 */ | 1970 /* 1971 * Handle BPF listeners. Let the BPF user see the packet, but 1972 * don't pass it up to the ether_input() layer unless it's 1973 * a broadcast packet, multicast packet, matches our ethernet 1974 * address or the interface is in promiscuous mode. If we don't 1975 * want the packet, just forget it. We leave the mbuf in place 1976 * since it can be used again later. 1977 */ --- 451 unchanged lines hidden (view full) --- 2429 prev->tl_ptr->tlist_fptr = vtophys(cur_tx->tl_ptr); 2430 } 2431 prev = cur_tx; 2432 2433 /* 2434 * If there's a BPF listener, bounce a copy of this frame 2435 * to him. 2436 */ |
2437#if NBPFILTER > 0 | 2437#if NBPF > 0 |
2438 if (ifp->if_bpf) 2439 bpf_mtap(ifp, cur_tx->tl_mbuf); 2440#endif 2441 } 2442 2443 /* 2444 * If there are no packets queued, bail. 2445 */ --- 388 unchanged lines hidden --- | 2438 if (ifp->if_bpf) 2439 bpf_mtap(ifp, cur_tx->tl_mbuf); 2440#endif 2441 } 2442 2443 /* 2444 * If there are no packets queued, bail. 2445 */ --- 388 unchanged lines hidden --- |