if_cs.c (45720) | if_cs.c (48645) |
---|---|
1/* 2 * Copyright (c) 1997,1998 Maxim Bolotin and Oleg Sharoiko. 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 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28 29/* | 1/* 2 * Copyright (c) 1997,1998 Maxim Bolotin and Oleg Sharoiko. 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 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28 29/* |
30 * $Id: if_cs.c,v 1.9 1999/01/28 01:59:53 dillon Exp $ | 30 * $Id: if_cs.c,v 1.10 1999/04/16 21:22:20 peter Exp $ |
31 * 32 * Device driver for Crystal Semiconductor CS8920 based ethernet 33 * adapters. By Maxim Bolotin and Oleg Sharoiko, 27-April-1997 34 */ 35 36/* #define CS_DEBUG */ 37#include "cs.h" | 31 * 32 * Device driver for Crystal Semiconductor CS8920 based ethernet 33 * adapters. By Maxim Bolotin and Oleg Sharoiko, 27-April-1997 34 */ 35 36/* #define CS_DEBUG */ 37#include "cs.h" |
38#include "bpfilter.h" | 38#include "bpf.h" |
39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/malloc.h> 43#include <sys/sockio.h> 44#include <sys/kernel.h> 45#include <sys/mbuf.h> 46#include <sys/socket.h> 47#include <sys/sysctl.h> 48#include <sys/syslog.h> 49 50#include <net/if.h> 51#include <net/if_arp.h> 52#include <net/if_media.h> 53#include <net/ethernet.h> 54 | 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/malloc.h> 43#include <sys/sockio.h> 44#include <sys/kernel.h> 45#include <sys/mbuf.h> 46#include <sys/socket.h> 47#include <sys/sysctl.h> 48#include <sys/syslog.h> 49 50#include <net/if.h> 51#include <net/if_arp.h> 52#include <net/if_media.h> 53#include <net/ethernet.h> 54 |
55#if NBPFILTER > 0 | 55#if NBPF > 0 |
56#include <net/bpf.h> 57#endif 58 59#include <machine/clock.h> 60 61#include <i386/isa/isa_device.h> 62#include <i386/isa/if_csreg.h> 63 --- 551 unchanged lines hidden (view full) --- 615 cs_stop( sc ); 616 ether_ifattach(ifp); 617 } 618 619 if (bootverbose) 620 printf(CS_NAME"%d: ethernet address %6D\n", 621 ifp->if_unit, sc->arpcom.ac_enaddr, ":"); 622 | 56#include <net/bpf.h> 57#endif 58 59#include <machine/clock.h> 60 61#include <i386/isa/isa_device.h> 62#include <i386/isa/if_csreg.h> 63 --- 551 unchanged lines hidden (view full) --- 615 cs_stop( sc ); 616 ether_ifattach(ifp); 617 } 618 619 if (bootverbose) 620 printf(CS_NAME"%d: ethernet address %6D\n", 621 ifp->if_unit, sc->arpcom.ac_enaddr, ":"); 622 |
623#if NBPFILTER > 0 | 623#if NBPF > 0 |
624 bpfattach(ifp, DLT_EN10MB, sizeof (struct ether_header)); 625#endif 626 return 1; 627} 628 629static int 630cs_attach_isa(struct isa_device *dev) 631{ --- 140 unchanged lines hidden (view full) --- 772 m->m_pkthdr.len = length; 773 m->m_len = length; 774 775 /* Get the data */ 776 insw(iobase + RX_FRAME_PORT, m->m_data, (length+1)>>1); 777 778 eh = mtod(m, struct ether_header *); 779 | 624 bpfattach(ifp, DLT_EN10MB, sizeof (struct ether_header)); 625#endif 626 return 1; 627} 628 629static int 630cs_attach_isa(struct isa_device *dev) 631{ --- 140 unchanged lines hidden (view full) --- 772 m->m_pkthdr.len = length; 773 m->m_len = length; 774 775 /* Get the data */ 776 insw(iobase + RX_FRAME_PORT, m->m_data, (length+1)>>1); 777 778 eh = mtod(m, struct ether_header *); 779 |
780#if NBPFILTER > 0 | 780#if NBPF > 0 |
781 if (ifp->if_bpf) 782 bpf_mtap(ifp, m); 783#endif 784 785#ifdef CS_DEBUG 786 for (i=0;i<length;i++) 787 printf(" %02x",(unsigned char)*((char *)(m->m_data+i))); 788 printf( "\n" ); --- 156 unchanged lines hidden (view full) --- 945 /* Skip zero-length packets */ 946 if (length == 0) { 947 m_freem(m); 948 continue; 949 } 950 951 cs_write_mbufs(sc, m); 952 | 781 if (ifp->if_bpf) 782 bpf_mtap(ifp, m); 783#endif 784 785#ifdef CS_DEBUG 786 for (i=0;i<length;i++) 787 printf(" %02x",(unsigned char)*((char *)(m->m_data+i))); 788 printf( "\n" ); --- 156 unchanged lines hidden (view full) --- 945 /* Skip zero-length packets */ 946 if (length == 0) { 947 m_freem(m); 948 continue; 949 } 950 951 cs_write_mbufs(sc, m); 952 |
953#if NBPFILTER > 0 | 953#if NBPF > 0 |
954 if (ifp->if_bpf) { 955 bpf_mtap(ifp, m); 956 } 957#endif 958 959 m_freem(m); 960 } 961 --- 435 unchanged lines hidden --- | 954 if (ifp->if_bpf) { 955 bpf_mtap(ifp, m); 956 } 957#endif 958 959 m_freem(m); 960 } 961 --- 435 unchanged lines hidden --- |