midway.c (46695) | midway.c (48645) |
---|---|
1/* $NetBSD: midway.c,v 1.30 1997/09/29 17:40:38 chuck Exp $ */ 2/* (sync'd to midway.c 1.68) */ 3 4/* 5 * 6 * Copyright (c) 1996 Charles D. Cranor and Washington University. 7 * All rights reserved. 8 * --- 155 unchanged lines hidden (view full) --- 164#include <vm/pmap.h> /* for vtophys proto */ 165 166#ifndef IFF_NOTRAILERS 167#define IFF_NOTRAILERS 0 168#endif 169 170#endif /* __FreeBSD__ */ 171 | 1/* $NetBSD: midway.c,v 1.30 1997/09/29 17:40:38 chuck Exp $ */ 2/* (sync'd to midway.c 1.68) */ 3 4/* 5 * 6 * Copyright (c) 1996 Charles D. Cranor and Washington University. 7 * All rights reserved. 8 * --- 155 unchanged lines hidden (view full) --- 164#include <vm/pmap.h> /* for vtophys proto */ 165 166#ifndef IFF_NOTRAILERS 167#define IFF_NOTRAILERS 0 168#endif 169 170#endif /* __FreeBSD__ */ 171 |
172#include "bpfilter.h" 173#if NBPFILTER > 0 | 172#include "bpf.h" 173#if NBPF > 0 |
174#include <net/bpf.h> 175#ifdef __FreeBSD__ 176#define BPFATTACH(ifp, dlt, hlen) bpfattach((ifp), (dlt), (hlen)) 177#define BPF_MTAP(ifp, m) bpf_mtap((ifp), (m)) 178#else 179#define BPFATTACH(ifp, dlt, hlen) bpfattach(&(ifp)->if_bpf, (ifp), (dlt), (hlen)) 180#define BPF_MTAP(ifp, m) bpf_mtap((ifp)->if_bpf, (m)) 181#endif | 174#include <net/bpf.h> 175#ifdef __FreeBSD__ 176#define BPFATTACH(ifp, dlt, hlen) bpfattach((ifp), (dlt), (hlen)) 177#define BPF_MTAP(ifp, m) bpf_mtap((ifp), (m)) 178#else 179#define BPFATTACH(ifp, dlt, hlen) bpfattach(&(ifp)->if_bpf, (ifp), (dlt), (hlen)) 180#define BPF_MTAP(ifp, m) bpf_mtap((ifp)->if_bpf, (m)) 181#endif |
182#endif /* NBPFILTER > 0 */ | 182#endif /* NBPF > 0 */ |
183 184/* 185 * params 186 */ 187 188#ifndef EN_TXHIWAT 189#define EN_TXHIWAT (64*1024) /* max 64 KB waiting to be DMAd out */ 190#endif --- 624 unchanged lines hidden (view full) --- 815 816 /* 817 * final commit 818 */ 819 820 if_attach(ifp); 821 atm_ifattach(ifp); 822 | 183 184/* 185 * params 186 */ 187 188#ifndef EN_TXHIWAT 189#define EN_TXHIWAT (64*1024) /* max 64 KB waiting to be DMAd out */ 190#endif --- 624 unchanged lines hidden (view full) --- 815 816 /* 817 * final commit 818 */ 819 820 if_attach(ifp); 821 atm_ifattach(ifp); 822 |
823#if NBPFILTER > 0 | 823#if NBPF > 0 |
824 BPFATTACH(ifp, DLT_ATM_RFC1483, sizeof(struct atmllc)); 825#endif 826} 827 828 829/* 830 * en_dmaprobe: helper function for en_attach. 831 * --- 1283 unchanged lines hidden (view full) --- 2115 } 2116 if ((launch.atm_flags & EN_OBTRL) == 0 && launch.aal == MID_TBD_AAL5) { 2117 EN_COUNT(sc->ltail); 2118 launch.pdu1 = MID_PDU_MK1(0, 0, datalen); /* host byte order */ 2119 } 2120 2121 en_txlaunch(sc, chan, &launch); 2122 | 824 BPFATTACH(ifp, DLT_ATM_RFC1483, sizeof(struct atmllc)); 825#endif 826} 827 828 829/* 830 * en_dmaprobe: helper function for en_attach. 831 * --- 1283 unchanged lines hidden (view full) --- 2115 } 2116 if ((launch.atm_flags & EN_OBTRL) == 0 && launch.aal == MID_TBD_AAL5) { 2117 EN_COUNT(sc->ltail); 2118 launch.pdu1 = MID_PDU_MK1(0, 0, datalen); /* host byte order */ 2119 } 2120 2121 en_txlaunch(sc, chan, &launch); 2122 |
2123#if NBPFILTER > 0 | 2123#if NBPF > 0 |
2124 if (ifp->if_bpf) { 2125 /* 2126 * adjust the top of the mbuf to skip the pseudo atm header 2127 * (and TBD, if present) before passing the packet to bpf, 2128 * restore it afterwards. 2129 */ 2130 int size = sizeof(struct atm_pseudohdr); 2131 if (launch.atm_flags & EN_OBHDR) 2132 size += MID_TBD_SIZE; 2133 2134 launch.t->m_data += size; 2135 launch.t->m_len -= size; 2136 2137 BPF_MTAP(ifp, launch.t); 2138 2139 launch.t->m_data -= size; 2140 launch.t->m_len += size; 2141 } | 2124 if (ifp->if_bpf) { 2125 /* 2126 * adjust the top of the mbuf to skip the pseudo atm header 2127 * (and TBD, if present) before passing the packet to bpf, 2128 * restore it afterwards. 2129 */ 2130 int size = sizeof(struct atm_pseudohdr); 2131 if (launch.atm_flags & EN_OBHDR) 2132 size += MID_TBD_SIZE; 2133 2134 launch.t->m_data += size; 2135 launch.t->m_len -= size; 2136 2137 BPF_MTAP(ifp, launch.t); 2138 2139 launch.t->m_data -= size; 2140 launch.t->m_len += size; 2141 } |
2142#endif /* NBPFILTER > 0 */ | 2142#endif /* NBPF > 0 */ |
2143 /* 2144 * do some housekeeping and get the next packet 2145 */ 2146 2147 sc->txslot[chan].bfree -= launch.need; 2148 IF_ENQUEUE(&sc->txslot[chan].indma, launch.t); 2149 goto again; 2150 --- 553 unchanged lines hidden (view full) --- 2704 printf("%s: rx%d: rxvci%d: atm_input, mbuf %p, len %d, hand %p\n", 2705 sc->sc_dev.dv_xname, slot, sc->rxslot[slot].atm_vci, m, 2706 EN_DQ_LEN(drq), sc->rxslot[slot].rxhand); 2707#endif 2708 2709 ifp = &sc->enif; 2710 ifp->if_ipackets++; 2711 | 2143 /* 2144 * do some housekeeping and get the next packet 2145 */ 2146 2147 sc->txslot[chan].bfree -= launch.need; 2148 IF_ENQUEUE(&sc->txslot[chan].indma, launch.t); 2149 goto again; 2150 --- 553 unchanged lines hidden (view full) --- 2704 printf("%s: rx%d: rxvci%d: atm_input, mbuf %p, len %d, hand %p\n", 2705 sc->sc_dev.dv_xname, slot, sc->rxslot[slot].atm_vci, m, 2706 EN_DQ_LEN(drq), sc->rxslot[slot].rxhand); 2707#endif 2708 2709 ifp = &sc->enif; 2710 ifp->if_ipackets++; 2711 |
2712#if NBPFILTER > 0 | 2712#if NBPF > 0 |
2713 if (ifp->if_bpf) 2714 BPF_MTAP(ifp, m); 2715#endif 2716 2717 atm_input(ifp, &ah, m, sc->rxslot[slot].rxhand); 2718 } 2719 2720 } --- 729 unchanged lines hidden --- | 2713 if (ifp->if_bpf) 2714 BPF_MTAP(ifp, m); 2715#endif 2716 2717 atm_input(ifp, &ah, m, sc->rxslot[slot].rxhand); 2718 } 2719 2720 } --- 729 unchanged lines hidden --- |