if_sf.c (106936) | if_sf.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/dev/sf/if_sf.c 106936 2002-11-14 23:49:09Z sam $ | 32 * $FreeBSD: head/sys/dev/sf/if_sf.c 109623 2003-01-21 08:56:16Z alfred $ |
33 */ 34 35/* 36 * Adaptec AIC-6915 "Starfire" PCI fast ethernet driver for FreeBSD. 37 * Programming manual is available from: 38 * ftp.adaptec.com:/pub/BBS/userguides/aic6915_pg.pdf. 39 * 40 * Written by Bill Paul <wpaul@ctr.columbia.edu> --- 75 unchanged lines hidden (view full) --- 116#define SF_USEIOSPACE 117 118#include <pci/if_sfreg.h> 119 120MODULE_DEPEND(sf, miibus, 1, 1, 1); 121 122#ifndef lint 123static const char rcsid[] = | 33 */ 34 35/* 36 * Adaptec AIC-6915 "Starfire" PCI fast ethernet driver for FreeBSD. 37 * Programming manual is available from: 38 * ftp.adaptec.com:/pub/BBS/userguides/aic6915_pg.pdf. 39 * 40 * Written by Bill Paul <wpaul@ctr.columbia.edu> --- 75 unchanged lines hidden (view full) --- 116#define SF_USEIOSPACE 117 118#include <pci/if_sfreg.h> 119 120MODULE_DEPEND(sf, miibus, 1, 1, 1); 121 122#ifndef lint 123static const char rcsid[] = |
124 "$FreeBSD: head/sys/dev/sf/if_sf.c 106936 2002-11-14 23:49:09Z sam $"; | 124 "$FreeBSD: head/sys/dev/sf/if_sf.c 109623 2003-01-21 08:56:16Z alfred $"; |
125#endif 126 127static struct sf_type sf_devs[] = { 128 { AD_VENDORID, AD_DEVICEID_STARFIRE, 129 "Adaptec AIC-6915 10/100BaseTX" }, 130 { 0, 0, NULL } 131}; 132 --- 786 unchanged lines hidden (view full) --- 919sf_newbuf(sc, c, m) 920 struct sf_softc *sc; 921 struct sf_rx_bufdesc_type0 *c; 922 struct mbuf *m; 923{ 924 struct mbuf *m_new = NULL; 925 926 if (m == NULL) { | 125#endif 126 127static struct sf_type sf_devs[] = { 128 { AD_VENDORID, AD_DEVICEID_STARFIRE, 129 "Adaptec AIC-6915 10/100BaseTX" }, 130 { 0, 0, NULL } 131}; 132 --- 786 unchanged lines hidden (view full) --- 919sf_newbuf(sc, c, m) 920 struct sf_softc *sc; 921 struct sf_rx_bufdesc_type0 *c; 922 struct mbuf *m; 923{ 924 struct mbuf *m_new = NULL; 925 926 if (m == NULL) { |
927 MGETHDR(m_new, M_DONTWAIT, MT_DATA); | 927 MGETHDR(m_new, M_NOWAIT, MT_DATA); |
928 if (m_new == NULL) 929 return(ENOBUFS); 930 | 928 if (m_new == NULL) 929 return(ENOBUFS); 930 |
931 MCLGET(m_new, M_DONTWAIT); | 931 MCLGET(m_new, M_NOWAIT); |
932 if (!(m_new->m_flags & M_EXT)) { 933 m_freem(m_new); 934 return(ENOBUFS); 935 } 936 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; 937 } else { 938 m_new = m; 939 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; --- 359 unchanged lines hidden (view full) --- 1299 f->sf_addr = vtophys(mtod(m, vm_offset_t)); 1300 frag++; 1301 } 1302 } 1303 1304 if (m != NULL) { 1305 struct mbuf *m_new = NULL; 1306 | 932 if (!(m_new->m_flags & M_EXT)) { 933 m_freem(m_new); 934 return(ENOBUFS); 935 } 936 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; 937 } else { 938 m_new = m; 939 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; --- 359 unchanged lines hidden (view full) --- 1299 f->sf_addr = vtophys(mtod(m, vm_offset_t)); 1300 frag++; 1301 } 1302 } 1303 1304 if (m != NULL) { 1305 struct mbuf *m_new = NULL; 1306 |
1307 MGETHDR(m_new, M_DONTWAIT, MT_DATA); | 1307 MGETHDR(m_new, M_NOWAIT, MT_DATA); |
1308 if (m_new == NULL) { 1309 printf("sf%d: no memory for tx list\n", sc->sf_unit); 1310 return(1); 1311 } 1312 1313 if (m_head->m_pkthdr.len > MHLEN) { | 1308 if (m_new == NULL) { 1309 printf("sf%d: no memory for tx list\n", sc->sf_unit); 1310 return(1); 1311 } 1312 1313 if (m_head->m_pkthdr.len > MHLEN) { |
1314 MCLGET(m_new, M_DONTWAIT); | 1314 MCLGET(m_new, M_NOWAIT); |
1315 if (!(m_new->m_flags & M_EXT)) { 1316 m_freem(m_new); 1317 printf("sf%d: no memory for tx list\n", 1318 sc->sf_unit); 1319 return(1); 1320 } 1321 } 1322 m_copydata(m_head, 0, m_head->m_pkthdr.len, --- 236 unchanged lines hidden --- | 1315 if (!(m_new->m_flags & M_EXT)) { 1316 m_freem(m_new); 1317 printf("sf%d: no memory for tx list\n", 1318 sc->sf_unit); 1319 return(1); 1320 } 1321 } 1322 m_copydata(m_head, 0, m_head->m_pkthdr.len, --- 236 unchanged lines hidden --- |