Deleted Added
full compact
if_ste.c (109058) if_ste.c (109623)
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. 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

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

24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. 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

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

24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/pci/if_ste.c 109058 2003-01-10 08:09:58Z mbr $
32 * $FreeBSD: head/sys/pci/if_ste.c 109623 2003-01-21 08:56:16Z alfred $
33 */
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/sockio.h>
38#include <sys/mbuf.h>
39#include <sys/malloc.h>
40#include <sys/kernel.h>

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

70#define STE_USEIOSPACE
71
72#include <pci/if_stereg.h>
73
74MODULE_DEPEND(ste, miibus, 1, 1, 1);
75
76#if !defined(lint)
77static const char rcsid[] =
33 */
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/sockio.h>
38#include <sys/mbuf.h>
39#include <sys/malloc.h>
40#include <sys/kernel.h>

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

70#define STE_USEIOSPACE
71
72#include <pci/if_stereg.h>
73
74MODULE_DEPEND(ste, miibus, 1, 1, 1);
75
76#if !defined(lint)
77static const char rcsid[] =
78 "$FreeBSD: head/sys/pci/if_ste.c 109058 2003-01-10 08:09:58Z mbr $";
78 "$FreeBSD: head/sys/pci/if_ste.c 109623 2003-01-21 08:56:16Z alfred $";
79#endif
80
81/*
82 * Various supported device vendors/types and their names.
83 */
84static struct ste_type ste_devs[] = {
85 { ST_VENDORID, ST_DEVICEID_ST201, "Sundance ST201 10/100BaseTX" },
86 { DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" },

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

1137ste_newbuf(sc, c, m)
1138 struct ste_softc *sc;
1139 struct ste_chain_onefrag *c;
1140 struct mbuf *m;
1141{
1142 struct mbuf *m_new = NULL;
1143
1144 if (m == NULL) {
79#endif
80
81/*
82 * Various supported device vendors/types and their names.
83 */
84static struct ste_type ste_devs[] = {
85 { ST_VENDORID, ST_DEVICEID_ST201, "Sundance ST201 10/100BaseTX" },
86 { DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" },

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

1137ste_newbuf(sc, c, m)
1138 struct ste_softc *sc;
1139 struct ste_chain_onefrag *c;
1140 struct mbuf *m;
1141{
1142 struct mbuf *m_new = NULL;
1143
1144 if (m == NULL) {
1145 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1145 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1146 if (m_new == NULL)
1147 return(ENOBUFS);
1146 if (m_new == NULL)
1147 return(ENOBUFS);
1148 MCLGET(m_new, M_DONTWAIT);
1148 MCLGET(m_new, M_NOWAIT);
1149 if (!(m_new->m_flags & M_EXT)) {
1150 m_freem(m_new);
1151 return(ENOBUFS);
1152 }
1153 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
1154 } else {
1155 m_new = m;
1156 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;

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

1514 if (m != NULL) {
1515 struct mbuf *mn;
1516
1517 /*
1518 * We ran out of segments. We have to recopy this
1519 * mbuf chain first. Bail out if we can't get the
1520 * new buffers. Code borrowed from if_fxp.c
1521 */
1149 if (!(m_new->m_flags & M_EXT)) {
1150 m_freem(m_new);
1151 return(ENOBUFS);
1152 }
1153 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
1154 } else {
1155 m_new = m;
1156 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;

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

1514 if (m != NULL) {
1515 struct mbuf *mn;
1516
1517 /*
1518 * We ran out of segments. We have to recopy this
1519 * mbuf chain first. Bail out if we can't get the
1520 * new buffers. Code borrowed from if_fxp.c
1521 */
1522 MGETHDR(mn, M_DONTWAIT, MT_DATA);
1522 MGETHDR(mn, M_NOWAIT, MT_DATA);
1523 if (mn == NULL) {
1524 m_freem(m_head);
1525 return ENOMEM;
1526 }
1527 if (m_head->m_pkthdr.len > MHLEN) {
1523 if (mn == NULL) {
1524 m_freem(m_head);
1525 return ENOMEM;
1526 }
1527 if (m_head->m_pkthdr.len > MHLEN) {
1528 MCLGET(mn, M_DONTWAIT);
1528 MCLGET(mn, M_NOWAIT);
1529 if ((mn->m_flags & M_EXT) == 0) {
1530 m_freem(mn);
1531 m_freem(m_head);
1532 return ENOMEM;
1533 }
1534 }
1535 m_copydata(m_head, 0, m_head->m_pkthdr.len,
1536 mtod(mn, caddr_t));

--- 132 unchanged lines hidden ---
1529 if ((mn->m_flags & M_EXT) == 0) {
1530 m_freem(mn);
1531 m_freem(m_head);
1532 return ENOMEM;
1533 }
1534 }
1535 m_copydata(m_head, 0, m_head->m_pkthdr.len,
1536 mtod(mn, caddr_t));

--- 132 unchanged lines hidden ---