Deleted Added
full compact
if_vr.c (109058) if_vr.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/dev/vr/if_vr.c 109058 2003-01-10 08:09:58Z mbr $
32 * $FreeBSD: head/sys/dev/vr/if_vr.c 109623 2003-01-21 08:56:16Z alfred $
33 */
34
35/*
36 * VIA Rhine fast ethernet PCI NIC driver
37 *
38 * Supports various network adapters based on the VIA Rhine
39 * and Rhine II PCI controllers, including the D-Link DFE530TX.
40 * Datasheets are available at http://www.via.com.tw.

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

96
97MODULE_DEPEND(vr, miibus, 1, 1, 1);
98
99/* "controller miibus0" required. See GENERIC if you get errors here. */
100#include "miibus_if.h"
101
102#ifndef lint
103static const char rcsid[] =
33 */
34
35/*
36 * VIA Rhine fast ethernet PCI NIC driver
37 *
38 * Supports various network adapters based on the VIA Rhine
39 * and Rhine II PCI controllers, including the D-Link DFE530TX.
40 * Datasheets are available at http://www.via.com.tw.

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

96
97MODULE_DEPEND(vr, miibus, 1, 1, 1);
98
99/* "controller miibus0" required. See GENERIC if you get errors here. */
100#include "miibus_if.h"
101
102#ifndef lint
103static const char rcsid[] =
104 "$FreeBSD: head/sys/dev/vr/if_vr.c 109058 2003-01-10 08:09:58Z mbr $";
104 "$FreeBSD: head/sys/dev/vr/if_vr.c 109623 2003-01-21 08:56:16Z alfred $";
105#endif
106
107/*
108 * Various supported device vendors/types and their names.
109 */
110static struct vr_type vr_devs[] = {
111 { VIA_VENDORID, VIA_DEVICEID_RHINE,
112 "VIA VT3043 Rhine I 10/100BaseTX" },

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

943vr_newbuf(sc, c, m)
944 struct vr_softc *sc;
945 struct vr_chain_onefrag *c;
946 struct mbuf *m;
947{
948 struct mbuf *m_new = NULL;
949
950 if (m == NULL) {
105#endif
106
107/*
108 * Various supported device vendors/types and their names.
109 */
110static struct vr_type vr_devs[] = {
111 { VIA_VENDORID, VIA_DEVICEID_RHINE,
112 "VIA VT3043 Rhine I 10/100BaseTX" },

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

943vr_newbuf(sc, c, m)
944 struct vr_softc *sc;
945 struct vr_chain_onefrag *c;
946 struct mbuf *m;
947{
948 struct mbuf *m_new = NULL;
949
950 if (m == NULL) {
951 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
951 MGETHDR(m_new, M_NOWAIT, MT_DATA);
952 if (m_new == NULL)
953 return(ENOBUFS);
954
952 if (m_new == NULL)
953 return(ENOBUFS);
954
955 MCLGET(m_new, M_DONTWAIT);
955 MCLGET(m_new, M_NOWAIT);
956 if (!(m_new->m_flags & M_EXT)) {
957 m_freem(m_new);
958 return(ENOBUFS);
959 }
960 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
961 } else {
962 m_new = m;
963 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;

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

1287 * The VIA Rhine wants packet buffers to be longword
1288 * aligned, but very often our mbufs aren't. Rather than
1289 * waste time trying to decide when to copy and when not
1290 * to copy, just do it all the time.
1291 */
1292 if (m != NULL) {
1293 struct mbuf *m_new = NULL;
1294
956 if (!(m_new->m_flags & M_EXT)) {
957 m_freem(m_new);
958 return(ENOBUFS);
959 }
960 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
961 } else {
962 m_new = m;
963 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;

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

1287 * The VIA Rhine wants packet buffers to be longword
1288 * aligned, but very often our mbufs aren't. Rather than
1289 * waste time trying to decide when to copy and when not
1290 * to copy, just do it all the time.
1291 */
1292 if (m != NULL) {
1293 struct mbuf *m_new = NULL;
1294
1295 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1295 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1296 if (m_new == NULL) {
1297 printf("vr%d: no memory for tx list\n", sc->vr_unit);
1298 return(1);
1299 }
1300 if (m_head->m_pkthdr.len > MHLEN) {
1296 if (m_new == NULL) {
1297 printf("vr%d: no memory for tx list\n", sc->vr_unit);
1298 return(1);
1299 }
1300 if (m_head->m_pkthdr.len > MHLEN) {
1301 MCLGET(m_new, M_DONTWAIT);
1301 MCLGET(m_new, M_NOWAIT);
1302 if (!(m_new->m_flags & M_EXT)) {
1303 m_freem(m_new);
1304 printf("vr%d: no memory for tx list\n",
1305 sc->vr_unit);
1306 return(1);
1307 }
1308 }
1309 m_copydata(m_head, 0, m_head->m_pkthdr.len,

--- 395 unchanged lines hidden ---
1302 if (!(m_new->m_flags & M_EXT)) {
1303 m_freem(m_new);
1304 printf("vr%d: no memory for tx list\n",
1305 sc->vr_unit);
1306 return(1);
1307 }
1308 }
1309 m_copydata(m_head, 0, m_head->m_pkthdr.len,

--- 395 unchanged lines hidden ---