if_ic.c (46743) | if_ic.c (48645) |
---|---|
1/*- 2 * Copyright (c) 1998 Nicolas Souchu 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Nicolas Souchu 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: if_ic.c,v 1.3 1998/12/07 21:58:16 archie Exp $ | 26 * $Id: if_ic.c,v 1.4 1999/05/08 21:59:03 dfr Exp $ |
27 */ 28 29/* 30 * I2C bus IP driver 31 */ 32 33#ifdef KERNEL 34#include <sys/param.h> --- 19 unchanged lines hidden (view full) --- 54#include <net/netisr.h> 55#include <net/route.h> 56#include <netinet/in.h> 57#include <netinet/in_systm.h> 58#include <netinet/in_var.h> 59#include <netinet/ip.h> 60#include <netinet/if_ether.h> 61 | 27 */ 28 29/* 30 * I2C bus IP driver 31 */ 32 33#ifdef KERNEL 34#include <sys/param.h> --- 19 unchanged lines hidden (view full) --- 54#include <net/netisr.h> 55#include <net/route.h> 56#include <netinet/in.h> 57#include <netinet/in_systm.h> 58#include <netinet/in_var.h> 59#include <netinet/ip.h> 60#include <netinet/if_ether.h> 61 |
62#include "bpfilter.h" | 62#include "bpf.h" |
63 | 63 |
64#if NBPFILTER > 0 | 64#if NBPF > 0 |
65#include <net/bpf.h> 66#endif 67 68#include <dev/iicbus/iiconf.h> 69#include <dev/iicbus/iicbus.h> 70 71#include "iicbus_if.h" 72 --- 73 unchanged lines hidden (view full) --- 146 ifp->if_output = icoutput; 147 ifp->if_type = IFT_PARA; 148 ifp->if_hdrlen = 0; 149 ifp->if_addrlen = 0; 150 ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; 151 152 if_attach(ifp); 153 | 65#include <net/bpf.h> 66#endif 67 68#include <dev/iicbus/iiconf.h> 69#include <dev/iicbus/iicbus.h> 70 71#include "iicbus_if.h" 72 --- 73 unchanged lines hidden (view full) --- 146 ifp->if_output = icoutput; 147 ifp->if_type = IFT_PARA; 148 ifp->if_hdrlen = 0; 149 ifp->if_addrlen = 0; 150 ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; 151 152 if_attach(ifp); 153 |
154#if NBPFILTER > 0 | 154#if NBPF > 0 |
155 bpfattach(ifp, DLT_NULL, ICHDRLEN); 156#endif 157 158 return (0); 159} 160 161/* 162 * iciotcl() --- 154 unchanged lines hidden (view full) --- 317 IF_DROP(&ipintrq); 318 break; 319 } 320 321 len -= ICHDRLEN; 322 sc->ic_if.if_ipackets ++; 323 sc->ic_if.if_ibytes += len; 324 | 155 bpfattach(ifp, DLT_NULL, ICHDRLEN); 156#endif 157 158 return (0); 159} 160 161/* 162 * iciotcl() --- 154 unchanged lines hidden (view full) --- 317 IF_DROP(&ipintrq); 318 break; 319 } 320 321 len -= ICHDRLEN; 322 sc->ic_if.if_ipackets ++; 323 sc->ic_if.if_ibytes += len; 324 |
325#if NBPFILTER > 0 | 325#if NBPF > 0 |
326 if (sc->ic_if.if_bpf) 327 bpf_tap(&sc->ic_if, sc->ic_ifbuf, len + ICHDRLEN); 328#endif 329 330 top = m_devget(sc->ic_ifbuf + ICHDRLEN, len, 0, &sc->ic_if, 0); 331 332 if (top) { 333 IF_ENQUEUE(&ipintrq, top); --- 78 unchanged lines hidden (view full) --- 412 } 413 414 bcopy(mtod(mm,char *), cp, mm->m_len); 415 cp += mm->m_len; 416 len += mm->m_len; 417 418 } while ((mm = mm->m_next)); 419 | 326 if (sc->ic_if.if_bpf) 327 bpf_tap(&sc->ic_if, sc->ic_ifbuf, len + ICHDRLEN); 328#endif 329 330 top = m_devget(sc->ic_ifbuf + ICHDRLEN, len, 0, &sc->ic_if, 0); 331 332 if (top) { 333 IF_ENQUEUE(&ipintrq, top); --- 78 unchanged lines hidden (view full) --- 412 } 413 414 bcopy(mtod(mm,char *), cp, mm->m_len); 415 cp += mm->m_len; 416 len += mm->m_len; 417 418 } while ((mm = mm->m_next)); 419 |
420#if NBPFILTER > 0 | 420#if NBPF > 0 |
421 if (ifp->if_bpf) { 422 struct mbuf m0, *n = m; 423 424 /* 425 * We need to prepend the address family as 426 * a four byte field. Cons up a dummy header 427 * to pacify bpf. This is safe because bpf 428 * will only read from the mbuf (i.e., it won't --- 38 unchanged lines hidden --- | 421 if (ifp->if_bpf) { 422 struct mbuf m0, *n = m; 423 424 /* 425 * We need to prepend the address family as 426 * a four byte field. Cons up a dummy header 427 * to pacify bpf. This is safe because bpf 428 * will only read from the mbuf (i.e., it won't --- 38 unchanged lines hidden --- |