if_atmsubr.c (111774) | if_atmsubr.c (111888) |
---|---|
1/* $NetBSD: if_atmsubr.c,v 1.10 1997/03/11 23:19:51 chuck Exp $ */ 2 3/* 4 * 5 * Copyright (c) 1996 Charles D. Cranor and Washington University. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 17 unchanged lines hidden (view full) --- 26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * | 1/* $NetBSD: if_atmsubr.c,v 1.10 1997/03/11 23:19:51 chuck Exp $ */ 2 3/* 4 * 5 * Copyright (c) 1996 Charles D. Cranor and Washington University. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 17 unchanged lines hidden (view full) --- 26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/sys/net/if_atmsubr.c 111774 2003-03-03 00:21:52Z mdodd $ | 34 * $FreeBSD: head/sys/net/if_atmsubr.c 111888 2003-03-04 23:19:55Z jlemon $ |
35 */ 36 37/* 38 * if_atmsubr.c 39 */ 40 41#include "opt_inet.h" 42#include "opt_inet6.h" --- 164 unchanged lines hidden (view full) --- 207 */ 208void 209atm_input(ifp, ah, m, rxhand) 210 struct ifnet *ifp; 211 struct atm_pseudohdr *ah; 212 struct mbuf *m; 213 void *rxhand; 214{ | 35 */ 36 37/* 38 * if_atmsubr.c 39 */ 40 41#include "opt_inet.h" 42#include "opt_inet6.h" --- 164 unchanged lines hidden (view full) --- 207 */ 208void 209atm_input(ifp, ah, m, rxhand) 210 struct ifnet *ifp; 211 struct atm_pseudohdr *ah; 212 struct mbuf *m; 213 void *rxhand; 214{ |
215 struct ifqueue *inq; | 215 int isr; |
216 u_int16_t etype = ETHERTYPE_IP; /* default */ 217 int s; 218 219 if ((ifp->if_flags & IFF_UP) == 0) { 220 m_freem(m); 221 return; 222 } 223#ifdef MAC 224 mac_create_mbuf_from_ifnet(ifp, m); 225#endif 226 ifp->if_ibytes += m->m_pkthdr.len; 227 228 if (rxhand) { 229#ifdef NATM 230 struct natmpcb *npcb = rxhand; 231 s = splimp(); /* in case 2 atm cards @ diff lvls */ 232 npcb->npcb_inq++; /* count # in queue */ 233 splx(s); | 216 u_int16_t etype = ETHERTYPE_IP; /* default */ 217 int s; 218 219 if ((ifp->if_flags & IFF_UP) == 0) { 220 m_freem(m); 221 return; 222 } 223#ifdef MAC 224 mac_create_mbuf_from_ifnet(ifp, m); 225#endif 226 ifp->if_ibytes += m->m_pkthdr.len; 227 228 if (rxhand) { 229#ifdef NATM 230 struct natmpcb *npcb = rxhand; 231 s = splimp(); /* in case 2 atm cards @ diff lvls */ 232 npcb->npcb_inq++; /* count # in queue */ 233 splx(s); |
234 schednetisr(NETISR_NATM); 235 inq = &natmintrq; | 234 isr = NETISR_NATM; |
236 m->m_pkthdr.rcvif = rxhand; /* XXX: overload */ 237#else 238 printf("atm_input: NATM detected but not configured in kernel\n"); 239 m_freem(m); 240 return; 241#endif 242 } else { 243 /* --- 18 unchanged lines hidden (view full) --- 262 } 263 etype = ATM_LLC_TYPE(alc); 264 m_adj(m, sizeof(*alc)); 265 } 266 267 switch (etype) { 268#ifdef INET 269 case ETHERTYPE_IP: | 235 m->m_pkthdr.rcvif = rxhand; /* XXX: overload */ 236#else 237 printf("atm_input: NATM detected but not configured in kernel\n"); 238 m_freem(m); 239 return; 240#endif 241 } else { 242 /* --- 18 unchanged lines hidden (view full) --- 261 } 262 etype = ATM_LLC_TYPE(alc); 263 m_adj(m, sizeof(*alc)); 264 } 265 266 switch (etype) { 267#ifdef INET 268 case ETHERTYPE_IP: |
270 schednetisr(NETISR_IP); 271 inq = &ipintrq; | 269 isr = NETISR_IP; |
272 break; 273#endif 274#ifdef INET6 275 case ETHERTYPE_IPV6: | 270 break; 271#endif 272#ifdef INET6 273 case ETHERTYPE_IPV6: |
276 schednetisr(NETISR_IPV6); 277 inq = &ip6intrq; | 274 isr = NETISR_IPV6; |
278 break; 279#endif 280 default: 281 m_freem(m); 282 return; 283 } 284 } | 275 break; 276#endif 277 default: 278 m_freem(m); 279 return; 280 } 281 } |
285 286 (void) IF_HANDOFF(inq, m, NULL); | 282 netisr_dispatch(isr, m); |
287} 288 289/* 290 * Perform common duties while attaching to interface list 291 */ 292void 293atm_ifattach(ifp) 294 struct ifnet *ifp; --- 33 unchanged lines hidden --- | 283} 284 285/* 286 * Perform common duties while attaching to interface list 287 */ 288void 289atm_ifattach(ifp) 290 struct ifnet *ifp; --- 33 unchanged lines hidden --- |