if_wb.c (72813) | if_wb.c (78508) |
---|---|
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 72813 2001-02-21 20:54:22Z wpaul $ | 32 * $FreeBSD: head/sys/pci/if_wb.c 78508 2001-06-20 19:48:35Z bmilekic $ |
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 72813 2001-02-21 20:54:22Z wpaul $"; | 131 "$FreeBSD: head/sys/pci/if_wb.c 78508 2001-06-20 19:48:35Z bmilekic $"; |
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" }, --- 1030 unchanged lines hidden (view full) --- 1170 * XXX The Winbond chip includes the CRC with every 1171 * received frame, and there's no way to turn this 1172 * behavior off (at least, I can't find anything in 1173 * the manual that explains how to do it) so we have 1174 * to trim off the CRC manually. 1175 */ 1176 total_len -= ETHER_CRC_LEN; 1177 | 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" }, --- 1030 unchanged lines hidden (view full) --- 1170 * XXX The Winbond chip includes the CRC with every 1171 * received frame, and there's no way to turn this 1172 * behavior off (at least, I can't find anything in 1173 * the manual that explains how to do it) so we have 1174 * to trim off the CRC manually. 1175 */ 1176 total_len -= ETHER_CRC_LEN; 1177 |
1178 m0 = m_devget(mtod(m, char *) - ETHER_ALIGN, 1179 total_len + ETHER_ALIGN, 0, ifp, NULL); | 1178 m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, ifp, 1179 NULL); |
1180 wb_newbuf(sc, cur_rx, m); 1181 if (m0 == NULL) { 1182 ifp->if_ierrors++; 1183 break; 1184 } | 1180 wb_newbuf(sc, cur_rx, m); 1181 if (m0 == NULL) { 1182 ifp->if_ierrors++; 1183 break; 1184 } |
1185 m_adj(m0, ETHER_ALIGN); | |
1186 m = m0; 1187 1188 ifp->if_ipackets++; 1189 eh = mtod(m, struct ether_header *); 1190 1191 /* Remove header from mbuf and pass it on. */ 1192 m_adj(m, sizeof(struct ether_header)); 1193 ether_input(ifp, eh, m); --- 695 unchanged lines hidden --- | 1185 m = m0; 1186 1187 ifp->if_ipackets++; 1188 eh = mtod(m, struct ether_header *); 1189 1190 /* Remove header from mbuf and pass it on. */ 1191 m_adj(m, sizeof(struct ether_header)); 1192 ether_input(ifp, eh, m); --- 695 unchanged lines hidden --- |