Deleted Added
full compact
if_fe.c (46410) if_fe.c (48645)
1/*
2 * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
3 *
4 * This software may be used, modified, copied, distributed, and sold, in
5 * both source and binary form provided that the above copyright, these
6 * terms and the following disclaimer are retained. The name of the author
7 * and/or the contributor may not be used to endorse or promote products
8 * derived from this software without specific prior written permission.

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

16 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION.
17 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
19 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
20 * SUCH DAMAGE.
21 */
22
23/*
1/*
2 * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
3 *
4 * This software may be used, modified, copied, distributed, and sold, in
5 * both source and binary form provided that the above copyright, these
6 * terms and the following disclaimer are retained. The name of the author
7 * and/or the contributor may not be used to endorse or promote products
8 * derived from this software without specific prior written permission.

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

16 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION.
17 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
19 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
20 * SUCH DAMAGE.
21 */
22
23/*
24 * $Id: if_fe.c,v 1.49 1999/03/03 10:40:26 kato Exp $
24 * $Id: if_fe.c,v 1.50 1999/05/04 12:59:59 kato Exp $
25 *
26 * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
27 * To be used with FreeBSD 3.x
28 * Contributed by M. Sekiguchi. <seki@sysrap.cs.fujitsu.co.jp>
29 *
30 * This version is intended to be a generic template for various
31 * MB86960A/MB86965A based Ethernet cards. It currently supports
32 * Fujitsu FMV-180 series for ISA and Allied-Telesis AT1700/RE2000

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

65 * transmission buffer size (currently 4KB x 2) and pros-and-
66 * cons of multiple frame transmission.
67 * o To test IPX codes.
68 * o To test FreeBSD3.0-current.
69 * o To test BRIDGE codes.
70 */
71
72#include "fe.h"
25 *
26 * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
27 * To be used with FreeBSD 3.x
28 * Contributed by M. Sekiguchi. <seki@sysrap.cs.fujitsu.co.jp>
29 *
30 * This version is intended to be a generic template for various
31 * MB86960A/MB86965A based Ethernet cards. It currently supports
32 * Fujitsu FMV-180 series for ISA and Allied-Telesis AT1700/RE2000

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

65 * transmission buffer size (currently 4KB x 2) and pros-and-
66 * cons of multiple frame transmission.
67 * o To test IPX codes.
68 * o To test FreeBSD3.0-current.
69 * o To test BRIDGE codes.
70 */
71
72#include "fe.h"
73#include "bpfilter.h"
73#include "bpf.h"
74#include "opt_fe.h"
75#include "opt_inet.h"
76#include "opt_ipx.h"
77
78#include <sys/param.h>
79#include <sys/systm.h>
80#include <sys/sockio.h>
81#include <sys/mbuf.h>

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

105#endif
106
107/* XNS code is not tested. FIXME. */
108#ifdef NS
109#include <netns/ns.h>
110#include <netns/ns_if.h>
111#endif
112
74#include "opt_fe.h"
75#include "opt_inet.h"
76#include "opt_ipx.h"
77
78#include <sys/param.h>
79#include <sys/systm.h>
80#include <sys/sockio.h>
81#include <sys/mbuf.h>

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

105#endif
106
107/* XNS code is not tested. FIXME. */
108#ifdef NS
109#include <netns/ns.h>
110#include <netns/ns_if.h>
111#endif
112
113#if NBPFILTER > 0
113#if NBPF > 0
114#include <net/bpf.h>
115#endif
116
117#ifdef BRIDGE
118#include <net/bridge.h>
119#endif
120
121#include <machine/clock.h>

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

2758 printf("fe%d: warning: above MAC address may be incorrect\n",
2759 sc->sc_unit);
2760 }
2761 if (sc->stability & UNSTABLE_TYPE) {
2762 printf("fe%d: warning: hardware type was not validated\n",
2763 sc->sc_unit);
2764 }
2765
114#include <net/bpf.h>
115#endif
116
117#ifdef BRIDGE
118#include <net/bridge.h>
119#endif
120
121#include <machine/clock.h>

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

2758 printf("fe%d: warning: above MAC address may be incorrect\n",
2759 sc->sc_unit);
2760 }
2761 if (sc->stability & UNSTABLE_TYPE) {
2762 printf("fe%d: warning: hardware type was not validated\n",
2763 sc->sc_unit);
2764 }
2765
2766#if NBPFILTER > 0
2766#if NBPF > 0
2767 /* If BPF is in the kernel, call the attach for it. */
2768 bpfattach(&sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
2769#endif
2770 return 1;
2771}
2772
2773/*
2774 * Reset interface, after some (hardware) trouble is deteced.

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

3127
3128 /*
3129 * Tap off here if there is a bpf listener,
3130 * and the device is *not* in promiscuous mode.
3131 * (86960 receives self-generated packets if
3132 * and only if it is in "receive everything"
3133 * mode.)
3134 */
2767 /* If BPF is in the kernel, call the attach for it. */
2768 bpfattach(&sc->sc_if, DLT_EN10MB, sizeof(struct ether_header));
2769#endif
2770 return 1;
2771}
2772
2773/*
2774 * Reset interface, after some (hardware) trouble is deteced.

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

3127
3128 /*
3129 * Tap off here if there is a bpf listener,
3130 * and the device is *not* in promiscuous mode.
3131 * (86960 receives self-generated packets if
3132 * and only if it is in "receive everything"
3133 * mode.)
3134 */
3135#if NBPFILTER > 0
3135#if NBPF > 0
3136 if ( sc->sc_if.if_bpf
3137 && !( sc->sc_if.if_flags & IFF_PROMISC ) ) {
3138 bpf_mtap( &sc->sc_if, m );
3139 }
3140#endif
3141
3142 m_freem( m );
3143 }

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

3759 else
3760#endif
3761 {
3762 insw( sc->ioaddr[ FE_BMPR8 ], eh, ( len + 1 ) >> 1 );
3763 }
3764
3765#define ETHER_ADDR_IS_MULTICAST(A) (*(char *)(A) & 1)
3766
3136 if ( sc->sc_if.if_bpf
3137 && !( sc->sc_if.if_flags & IFF_PROMISC ) ) {
3138 bpf_mtap( &sc->sc_if, m );
3139 }
3140#endif
3141
3142 m_freem( m );
3143 }

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

3759 else
3760#endif
3761 {
3762 insw( sc->ioaddr[ FE_BMPR8 ], eh, ( len + 1 ) >> 1 );
3763 }
3764
3765#define ETHER_ADDR_IS_MULTICAST(A) (*(char *)(A) & 1)
3766
3767#if NBPFILTER > 0
3767#if NBPF > 0
3768 /*
3769 * Check if there's a BPF listener on this interface.
3770 * If it is, hand off the raw packet to bpf.
3771 */
3772 if ( sc->sc_if.if_bpf ) {
3773 bpf_mtap( &sc->sc_if, m );
3774 }
3775#endif

--- 427 unchanged lines hidden ---
3768 /*
3769 * Check if there's a BPF listener on this interface.
3770 * If it is, hand off the raw packet to bpf.
3771 */
3772 if ( sc->sc_if.if_bpf ) {
3773 bpf_mtap( &sc->sc_if, m );
3774 }
3775#endif

--- 427 unchanged lines hidden ---