Deleted Added
full compact
if_wb.c (109058) if_wb.c (109623)
1/*
2 * Copyright (c) 1997, 1998
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
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_wb.c 109058 2003-01-10 08:09:58Z mbr $
32 * $FreeBSD: head/sys/pci/if_wb.c 109623 2003-01-21 08:56:16Z alfred $
33 */
34
35/*
36 * Winbond fast ethernet PCI NIC driver
37 *
38 * Supports various cheap network adapters based on the Winbond W89C840F
39 * fast ethernet controller chip. This includes adapters manufactured by
40 * Winbond itself and some made by Linksys.

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

123#define WB_USEIOSPACE
124
125#include <pci/if_wbreg.h>
126
127MODULE_DEPEND(wb, miibus, 1, 1, 1);
128
129#ifndef lint
130static const char rcsid[] =
33 */
34
35/*
36 * Winbond fast ethernet PCI NIC driver
37 *
38 * Supports various cheap network adapters based on the Winbond W89C840F
39 * fast ethernet controller chip. This includes adapters manufactured by
40 * Winbond itself and some made by Linksys.

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

123#define WB_USEIOSPACE
124
125#include <pci/if_wbreg.h>
126
127MODULE_DEPEND(wb, miibus, 1, 1, 1);
128
129#ifndef lint
130static const char rcsid[] =
131 "$FreeBSD: head/sys/pci/if_wb.c 109058 2003-01-10 08:09:58Z mbr $";
131 "$FreeBSD: head/sys/pci/if_wb.c 109623 2003-01-21 08:56:16Z alfred $";
132#endif
133
134/*
135 * Various supported device vendors/types and their names.
136 */
137static struct wb_type wb_devs[] = {
138 { WB_VENDORID, WB_DEVICEID_840F,
139 "Winbond W89C840F 10/100BaseTX" },

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

1107wb_newbuf(sc, c, m)
1108 struct wb_softc *sc;
1109 struct wb_chain_onefrag *c;
1110 struct mbuf *m;
1111{
1112 struct mbuf *m_new = NULL;
1113
1114 if (m == NULL) {
132#endif
133
134/*
135 * Various supported device vendors/types and their names.
136 */
137static struct wb_type wb_devs[] = {
138 { WB_VENDORID, WB_DEVICEID_840F,
139 "Winbond W89C840F 10/100BaseTX" },

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

1107wb_newbuf(sc, c, m)
1108 struct wb_softc *sc;
1109 struct wb_chain_onefrag *c;
1110 struct mbuf *m;
1111{
1112 struct mbuf *m_new = NULL;
1113
1114 if (m == NULL) {
1115 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1115 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1116 if (m_new == NULL)
1117 return(ENOBUFS);
1118 m_new->m_data = c->wb_buf;
1119 m_new->m_pkthdr.len = m_new->m_len = WB_BUFBYTES;
1120 MEXTADD(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, NULL, 0,
1121 EXT_NET_DRV);
1122 } else {
1123 m_new = m;

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

1462 * data into an mbuf cluster. Note that we don't
1463 * bother clearing the values in the other fragment
1464 * pointers/counters; it wouldn't gain us anything,
1465 * and would waste cycles.
1466 */
1467 if (m != NULL) {
1468 struct mbuf *m_new = NULL;
1469
1116 if (m_new == NULL)
1117 return(ENOBUFS);
1118 m_new->m_data = c->wb_buf;
1119 m_new->m_pkthdr.len = m_new->m_len = WB_BUFBYTES;
1120 MEXTADD(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, NULL, 0,
1121 EXT_NET_DRV);
1122 } else {
1123 m_new = m;

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

1462 * data into an mbuf cluster. Note that we don't
1463 * bother clearing the values in the other fragment
1464 * pointers/counters; it wouldn't gain us anything,
1465 * and would waste cycles.
1466 */
1467 if (m != NULL) {
1468 struct mbuf *m_new = NULL;
1469
1470 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1470 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1471 if (m_new == NULL)
1472 return(1);
1473 if (m_head->m_pkthdr.len > MHLEN) {
1471 if (m_new == NULL)
1472 return(1);
1473 if (m_head->m_pkthdr.len > MHLEN) {
1474 MCLGET(m_new, M_DONTWAIT);
1474 MCLGET(m_new, M_NOWAIT);
1475 if (!(m_new->m_flags & M_EXT)) {
1476 m_freem(m_new);
1477 return(1);
1478 }
1479 }
1480 m_copydata(m_head, 0, m_head->m_pkthdr.len,
1481 mtod(m_new, caddr_t));
1482 m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;

--- 423 unchanged lines hidden ---
1475 if (!(m_new->m_flags & M_EXT)) {
1476 m_freem(m_new);
1477 return(1);
1478 }
1479 }
1480 m_copydata(m_head, 0, m_head->m_pkthdr.len,
1481 mtod(m_new, caddr_t));
1482 m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;

--- 423 unchanged lines hidden ---