Deleted Added
full compact
if_wb.c (63090) if_wb.c (64837)
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 63090 2000-07-13 22:54:34Z archie $
32 * $FreeBSD: head/sys/pci/if_wb.c 64837 2000-08-19 08:32:59Z dwmalone $
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.

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

124#define WB_USEIOSPACE
125
126#include <pci/if_wbreg.h>
127
128MODULE_DEPEND(wb, miibus, 1, 1, 1);
129
130#ifndef lint
131static 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.

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

124#define WB_USEIOSPACE
125
126#include <pci/if_wbreg.h>
127
128MODULE_DEPEND(wb, miibus, 1, 1, 1);
129
130#ifndef lint
131static const char rcsid[] =
132 "$FreeBSD: head/sys/pci/if_wb.c 63090 2000-07-13 22:54:34Z archie $";
132 "$FreeBSD: head/sys/pci/if_wb.c 64837 2000-08-19 08:32:59Z dwmalone $";
133#endif
134
135/*
136 * Various supported device vendors/types and their names.
137 */
138static struct wb_type wb_devs[] = {
139 { WB_VENDORID, WB_DEVICEID_840F,
140 "Winbond W89C840F 10/100BaseTX" },
141 { CP_VENDORID, CP_DEVICEID_RL100,
142 "Compex RL100-ATX 10/100baseTX" },
143 { 0, 0, NULL }
144};
145
146static int wb_probe __P((device_t));
147static int wb_attach __P((device_t));
148static int wb_detach __P((device_t));
149
133#endif
134
135/*
136 * Various supported device vendors/types and their names.
137 */
138static struct wb_type wb_devs[] = {
139 { WB_VENDORID, WB_DEVICEID_840F,
140 "Winbond W89C840F 10/100BaseTX" },
141 { CP_VENDORID, CP_DEVICEID_RL100,
142 "Compex RL100-ATX 10/100baseTX" },
143 { 0, 0, NULL }
144};
145
146static int wb_probe __P((device_t));
147static int wb_attach __P((device_t));
148static int wb_detach __P((device_t));
149
150static void wb_bfree __P((caddr_t, u_int));
150static void wb_bfree __P((caddr_t, void *args));
151static int wb_newbuf __P((struct wb_softc *,
152 struct wb_chain_onefrag *,
153 struct mbuf *));
154static int wb_encap __P((struct wb_softc *, struct wb_chain *,
155 struct mbuf *));
156
157static void wb_rxeof __P((struct wb_softc *));
158static void wb_rxeoc __P((struct wb_softc *));

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

1073 }
1074 }
1075
1076 cd->wb_rx_head = &cd->wb_rx_chain[0];
1077
1078 return(0);
1079}
1080
151static int wb_newbuf __P((struct wb_softc *,
152 struct wb_chain_onefrag *,
153 struct mbuf *));
154static int wb_encap __P((struct wb_softc *, struct wb_chain *,
155 struct mbuf *));
156
157static void wb_rxeof __P((struct wb_softc *));
158static void wb_rxeoc __P((struct wb_softc *));

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

1073 }
1074 }
1075
1076 cd->wb_rx_head = &cd->wb_rx_chain[0];
1077
1078 return(0);
1079}
1080
1081static void wb_bfree(buf, size)
1081static void wb_bfree(buf, args)
1082 caddr_t buf;
1082 caddr_t buf;
1083 u_int size;
1083 void *args;
1084{
1085 return;
1086}
1087
1088/*
1089 * Initialize an RX descriptor and attach an MBUF cluster.
1090 */
1091static int wb_newbuf(sc, c, m)

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

1097
1098 if (m == NULL) {
1099 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1100 if (m_new == NULL) {
1101 printf("wb%d: no memory for rx "
1102 "list -- packet dropped!\n", sc->wb_unit);
1103 return(ENOBUFS);
1104 }
1084{
1085 return;
1086}
1087
1088/*
1089 * Initialize an RX descriptor and attach an MBUF cluster.
1090 */
1091static int wb_newbuf(sc, c, m)

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

1097
1098 if (m == NULL) {
1099 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1100 if (m_new == NULL) {
1101 printf("wb%d: no memory for rx "
1102 "list -- packet dropped!\n", sc->wb_unit);
1103 return(ENOBUFS);
1104 }
1105
1106 m_new->m_data = m_new->m_ext.ext_buf = c->wb_buf;
1107 m_new->m_flags |= M_EXT;
1108 m_new->m_ext.ext_size = m_new->m_pkthdr.len =
1109 m_new->m_len = WB_BUFBYTES;
1110 m_new->m_ext.ext_free = wb_bfree;
1111 m_new->m_ext.ext_ref = wb_bfree;
1105 m_new->m_data = c->wb_buf;
1106 m_new->m_pkthdr.len = m_new->m_len = WB_BUFBYTES;
1107 MEXTADD(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, NULL);
1112 } else {
1113 m_new = m;
1114 m_new->m_len = m_new->m_pkthdr.len = WB_BUFBYTES;
1115 m_new->m_data = m_new->m_ext.ext_buf;
1116 }
1117
1118 m_adj(m_new, sizeof(u_int64_t));
1119

--- 767 unchanged lines hidden ---
1108 } else {
1109 m_new = m;
1110 m_new->m_len = m_new->m_pkthdr.len = WB_BUFBYTES;
1111 m_new->m_data = m_new->m_ext.ext_buf;
1112 }
1113
1114 m_adj(m_new, sizeof(u_int64_t));
1115

--- 767 unchanged lines hidden ---