if_ed.c (108533) | if_ed.c (109623) |
---|---|
1/* 2 * Copyright (c) 1995, David Greenman 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 --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 * | 1/* 2 * Copyright (c) 1995, David Greenman 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 --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 * $FreeBSD: head/sys/dev/ed/if_ed.c 108533 2003-01-01 18:49:04Z schweikh $ | 27 * $FreeBSD: head/sys/dev/ed/if_ed.c 109623 2003-01-21 08:56:16Z alfred $ |
28 */ 29 30/* 31 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet 32 * adapters. By David Greenman, 29-April-1993 33 * 34 * Currently supports the Western Digital/SMC 8003 and 8013 series, 35 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, --- 2638 unchanged lines hidden (view full) --- 2674 char *buf; 2675 u_short len; 2676{ 2677 struct ifnet *ifp = &sc->arpcom.ac_if; 2678 struct ether_header *eh; 2679 struct mbuf *m; 2680 2681 /* Allocate a header mbuf */ | 28 */ 29 30/* 31 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet 32 * adapters. By David Greenman, 29-April-1993 33 * 34 * Currently supports the Western Digital/SMC 8003 and 8013 series, 35 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, --- 2638 unchanged lines hidden (view full) --- 2674 char *buf; 2675 u_short len; 2676{ 2677 struct ifnet *ifp = &sc->arpcom.ac_if; 2678 struct ether_header *eh; 2679 struct mbuf *m; 2680 2681 /* Allocate a header mbuf */ |
2682 MGETHDR(m, M_DONTWAIT, MT_DATA); | 2682 MGETHDR(m, M_NOWAIT, MT_DATA); |
2683 if (m == NULL) 2684 return; 2685 m->m_pkthdr.rcvif = ifp; 2686 m->m_pkthdr.len = m->m_len = len; 2687 2688 /* 2689 * We always put the received packet in a single buffer - 2690 * either with just an mbuf header or in a cluster attached 2691 * to the header. The +2 is to compensate for the alignment 2692 * fixup below. 2693 */ 2694 if ((len + 2) > MHLEN) { 2695 /* Attach an mbuf cluster */ | 2683 if (m == NULL) 2684 return; 2685 m->m_pkthdr.rcvif = ifp; 2686 m->m_pkthdr.len = m->m_len = len; 2687 2688 /* 2689 * We always put the received packet in a single buffer - 2690 * either with just an mbuf header or in a cluster attached 2691 * to the header. The +2 is to compensate for the alignment 2692 * fixup below. 2693 */ 2694 if ((len + 2) > MHLEN) { 2695 /* Attach an mbuf cluster */ |
2696 MCLGET(m, M_DONTWAIT); | 2696 MCLGET(m, M_NOWAIT); |
2697 2698 /* Insist on getting a cluster */ 2699 if ((m->m_flags & M_EXT) == 0) { 2700 m_freem(m); 2701 return; 2702 } 2703 } 2704 --- 765 unchanged lines hidden --- | 2697 2698 /* Insist on getting a cluster */ 2699 if ((m->m_flags & M_EXT) == 0) { 2700 m_freem(m); 2701 return; 2702 } 2703 } 2704 --- 765 unchanged lines hidden --- |