Deleted Added
full compact
if_sbni.c (106937) if_sbni.c (109623)
1/*
2 * Copyright (c) 1997-2001 Granch, Ltd. All rights reserved.
3 * Author: Denis I.Timofeev <timofeev@granch.ru>
4 *
5 * Redistributon 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 NEIGENCE 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) 1997-2001 Granch, Ltd. All rights reserved.
3 * Author: Denis I.Timofeev <timofeev@granch.ru>
4 *
5 * Redistributon 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 NEIGENCE 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/sbni/if_sbni.c 106937 2002-11-14 23:54:55Z sam $
27 * $FreeBSD: head/sys/dev/sbni/if_sbni.c 109623 2003-01-21 08:56:16Z alfred $
28 */
29
30/*
31 * Device driver for Granch SBNI12 leased line adapters
32 *
33 * Revision 2.0.0 1997/08/06
34 * Initial revision by Alexey Zverev
35 *

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

809}
810
811
812static int
813get_rx_buf(struct sbni_softc *sc)
814{
815 struct mbuf *m;
816
28 */
29
30/*
31 * Device driver for Granch SBNI12 leased line adapters
32 *
33 * Revision 2.0.0 1997/08/06
34 * Initial revision by Alexey Zverev
35 *

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

809}
810
811
812static int
813get_rx_buf(struct sbni_softc *sc)
814{
815 struct mbuf *m;
816
817 MGETHDR(m, M_DONTWAIT, MT_DATA);
817 MGETHDR(m, M_NOWAIT, MT_DATA);
818 if (m == NULL) {
819 if_printf(&sc->arpcom.ac_if, "cannot allocate header mbuf\n");
820 return (0);
821 }
822
823 /*
824 * We always put the received packet in a single buffer -
825 * either with just an mbuf header or in a cluster attached
826 * to the header. The +2 is to compensate for the alignment
827 * fixup below.
828 */
829 if (ETHER_MAX_LEN + 2 > MHLEN) {
830 /* Attach an mbuf cluster */
818 if (m == NULL) {
819 if_printf(&sc->arpcom.ac_if, "cannot allocate header mbuf\n");
820 return (0);
821 }
822
823 /*
824 * We always put the received packet in a single buffer -
825 * either with just an mbuf header or in a cluster attached
826 * to the header. The +2 is to compensate for the alignment
827 * fixup below.
828 */
829 if (ETHER_MAX_LEN + 2 > MHLEN) {
830 /* Attach an mbuf cluster */
831 MCLGET(m, M_DONTWAIT);
831 MCLGET(m, M_NOWAIT);
832 if ((m->m_flags & M_EXT) == 0) {
833 m_freem(m);
834 return (0);
835 }
836 }
837 m->m_pkthdr.len = m->m_len = ETHER_MAX_LEN + 2;
838
839 /*

--- 473 unchanged lines hidden ---
832 if ((m->m_flags & M_EXT) == 0) {
833 m_freem(m);
834 return (0);
835 }
836 }
837 m->m_pkthdr.len = m->m_len = ETHER_MAX_LEN + 2;
838
839 /*

--- 473 unchanged lines hidden ---