if_ep.c (43487) | if_ep.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 --- 24 unchanged lines hidden (view full) --- 33/* 34 * Modified from the FreeBSD 1.1.5.1 version by: 35 * Andres Vega Garcia 36 * INRIA - Sophia Antipolis, France 37 * avega@sophia.inria.fr 38 */ 39 40/* | 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 --- 24 unchanged lines hidden (view full) --- 33/* 34 * Modified from the FreeBSD 1.1.5.1 version by: 35 * Andres Vega Garcia 36 * INRIA - Sophia Antipolis, France 37 * avega@sophia.inria.fr 38 */ 39 40/* |
41 * $Id: if_ep.c,v 1.78 1999/01/19 00:21:39 peter Exp $ | 41 * $Id: if_ep.c,v 1.79 1999/01/31 22:41:51 dufault Exp $ |
42 * 43 * Promiscuous mode added and interrupt logic slightly changed 44 * to reduce the number of adapter failures. Transceiver select 45 * logic changed to use value from EEPROM. Autoconfiguration 46 * features added. 47 * Done by: 48 * Serge Babkin 49 * Chelindbank (Chelyabinsk, Russia) --- 4 unchanged lines hidden (view full) --- 54 * Pccard support for 3C589 by: 55 * HAMADA Naoki 56 * nao@tom-yam.or.jp 57 */ 58 59#include "ep.h" 60#if NEP > 0 61 | 42 * 43 * Promiscuous mode added and interrupt logic slightly changed 44 * to reduce the number of adapter failures. Transceiver select 45 * logic changed to use value from EEPROM. Autoconfiguration 46 * features added. 47 * Done by: 48 * Serge Babkin 49 * Chelindbank (Chelyabinsk, Russia) --- 4 unchanged lines hidden (view full) --- 54 * Pccard support for 3C589 by: 55 * HAMADA Naoki 56 * nao@tom-yam.or.jp 57 */ 58 59#include "ep.h" 60#if NEP > 0 61 |
62#include "bpfilter.h" | 62#include "bpf.h" |
63#include "opt_inet.h" 64#include "opt_ipx.h" 65 66#include <sys/param.h> 67#if defined(__FreeBSD__) 68#include <sys/kernel.h> 69#include <sys/systm.h> 70#endif --- 17 unchanged lines hidden (view full) --- 88#include <netipx/ipx_if.h> 89#endif 90 91#ifdef NS 92#include <netns/ns.h> 93#include <netns/ns_if.h> 94#endif 95 | 63#include "opt_inet.h" 64#include "opt_ipx.h" 65 66#include <sys/param.h> 67#if defined(__FreeBSD__) 68#include <sys/kernel.h> 69#include <sys/systm.h> 70#endif --- 17 unchanged lines hidden (view full) --- 88#include <netipx/ipx_if.h> 89#endif 90 91#ifdef NS 92#include <netns/ns.h> 93#include <netns/ns_if.h> 94#endif 95 |
96#if NBPFILTER > 0 | 96#if NBPF > 0 |
97#include <net/bpf.h> 98#endif 99 100#if defined(__FreeBSD__) 101#include <machine/clock.h> 102#endif 103 104#include <i386/isa/isa_device.h> --- 525 unchanged lines hidden (view full) --- 630#ifdef EP_LOCAL_STATS 631 sc->rx_no_first = sc->rx_no_mbuf = 632 sc->rx_bpf_disc = sc->rx_overrunf = sc->rx_overrunl = 633 sc->tx_underrun = 0; 634#endif 635 ep_fset(F_RX_FIRST); 636 sc->top = sc->mcur = 0; 637 | 97#include <net/bpf.h> 98#endif 99 100#if defined(__FreeBSD__) 101#include <machine/clock.h> 102#endif 103 104#include <i386/isa/isa_device.h> --- 525 unchanged lines hidden (view full) --- 630#ifdef EP_LOCAL_STATS 631 sc->rx_no_first = sc->rx_no_mbuf = 632 sc->rx_bpf_disc = sc->rx_overrunf = sc->rx_overrunl = 633 sc->tx_underrun = 0; 634#endif 635 ep_fset(F_RX_FIRST); 636 sc->top = sc->mcur = 0; 637 |
638#if NBPFILTER > 0 | 638#if NBPF > 0 |
639 if (!attached) { 640 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 641 } 642#endif 643 return 0; 644} 645 646 --- 219 unchanged lines hidden (view full) --- 866 if (m->m_len & 1) 867 outb(BASE + EP_W1_TX_PIO_WR_1, 868 *(mtod(m, caddr_t) + m->m_len - 1)); 869 } 870 871 while (pad--) 872 outb(BASE + EP_W1_TX_PIO_WR_1, 0); /* Padding */ 873 | 639 if (!attached) { 640 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 641 } 642#endif 643 return 0; 644} 645 646 --- 219 unchanged lines hidden (view full) --- 866 if (m->m_len & 1) 867 outb(BASE + EP_W1_TX_PIO_WR_1, 868 *(mtod(m, caddr_t) + m->m_len - 1)); 869 } 870 871 while (pad--) 872 outb(BASE + EP_W1_TX_PIO_WR_1, 0); /* Padding */ 873 |
874#if NBPFILTER > 0 | 874#if NBPF > 0 |
875 if (ifp->if_bpf) { 876 bpf_mtap(ifp, top); 877 } 878#endif 879 880 ifp->if_timer = 2; 881 ifp->if_opackets++; 882 m_freem(top); --- 249 unchanged lines hidden (view full) --- 1132 return; 1133 } 1134 outw(BASE + EP_COMMAND, RX_DISCARD_TOP_PACK); 1135 ++ifp->if_ipackets; 1136 ep_fset(F_RX_FIRST); 1137 top->m_pkthdr.rcvif = &sc->arpcom.ac_if; 1138 top->m_pkthdr.len = sc->cur_len; 1139 | 875 if (ifp->if_bpf) { 876 bpf_mtap(ifp, top); 877 } 878#endif 879 880 ifp->if_timer = 2; 881 ifp->if_opackets++; 882 m_freem(top); --- 249 unchanged lines hidden (view full) --- 1132 return; 1133 } 1134 outw(BASE + EP_COMMAND, RX_DISCARD_TOP_PACK); 1135 ++ifp->if_ipackets; 1136 ep_fset(F_RX_FIRST); 1137 top->m_pkthdr.rcvif = &sc->arpcom.ac_if; 1138 top->m_pkthdr.len = sc->cur_len; 1139 |
1140#if NBPFILTER > 0 | 1140#if NBPF > 0 |
1141 if (ifp->if_bpf) { 1142 bpf_mtap(ifp, top); 1143 1144 /* 1145 * Note that the interface cannot be in promiscuous mode if there are 1146 * no BPF listeners. And if we are in promiscuous mode, we have to 1147 * check if this packet is really ours. 1148 */ --- 265 unchanged lines hidden --- | 1141 if (ifp->if_bpf) { 1142 bpf_mtap(ifp, top); 1143 1144 /* 1145 * Note that the interface cannot be in promiscuous mode if there are 1146 * no BPF listeners. And if we are in promiscuous mode, we have to 1147 * check if this packet is really ours. 1148 */ --- 265 unchanged lines hidden --- |