Deleted Added
sdiff udiff text old ( 111119 ) new ( 111888 )
full compact
1/* $NetBSD: natm.c,v 1.5 1996/11/09 03:26:26 chuck Exp $ */
2/* $FreeBSD: head/sys/netnatm/natm.c 111888 2003-03-04 23:19:55Z jlemon $ */
3
4/*
5 *
6 * Copyright (c) 1996 Charles D. Cranor and Washington University.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions

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

693 * natmintr: splsoftnet interrupt
694 *
695 * note: we expect a socket pointer in rcvif rather than an interface
696 * pointer. we can get the interface pointer from the so's PCB if
697 * we really need it.
698 */
699
700void
701natmintr(struct mbuf *m)
702{
703 int s;
704 struct socket *so;
705 struct natmpcb *npcb;
706
707#ifdef DIAGNOSTIC
708 if ((m->m_flags & M_PKTHDR) == 0)
709 panic("natmintr no HDR");
710#endif
711
712 npcb = (struct natmpcb *) m->m_pkthdr.rcvif; /* XXX: overloaded */
713 so = npcb->npcb_socket;
714
715 s = splimp(); /* could have atm devs @ different levels */
716 npcb->npcb_inq--;
717 splx(s);
718
719 if (npcb->npcb_flags & NPCB_DRAIN) {
720 m_freem(m);
721 if (npcb->npcb_inq == 0)
722 FREE(npcb, M_PCB); /* done! */
723 return;
724 }
725
726 if (npcb->npcb_flags & NPCB_FREE) {
727 m_freem(m); /* drop */
728 return;
729 }
730
731#ifdef NEED_TO_RESTORE_IFP
732 m->m_pkthdr.rcvif = npcb->npcb_ifp;
733#else
734#ifdef DIAGNOSTIC
735m->m_pkthdr.rcvif = NULL; /* null it out to be safe */
736#endif

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

746 sorwakeup(so);
747 } else {
748#ifdef NATM_STAT
749 natm_sodropcnt++;
750 natm_sodropbytes += m->m_pkthdr.len;
751#endif
752 m_freem(m);
753 }
754}
755
756/*
757 * natm0_sysctl: not used, but here in case we want to add something
758 * later...
759 */
760
761int natm0_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
762
763int *name;

--- 33 unchanged lines hidden ---