Deleted Added
full compact
if_ti.c (106936) if_ti.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/ti/if_ti.c 106936 2002-11-14 23:49:09Z sam $
32 * $FreeBSD: head/sys/dev/ti/if_ti.c 109623 2003-01-21 08:56:16Z alfred $
33 */
34
35/*
36 * Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD.
37 * Manuals, sample driver and firmware source kits are available
38 * from http://www.alteon.com/support/openkits.
39 *
40 * Written by Bill Paul <wpaul@ctr.columbia.edu>

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

147 * BDs.
148 */
149#if defined(TI_JUMBO_HDRSPLIT) && defined(TI_PRIVATE_JUMBOS)
150#error "options TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS are mutually exclusive"
151#endif /* TI_JUMBO_HDRSPLIT && TI_JUMBO_HDRSPLIT */
152
153#if !defined(lint)
154static const char rcsid[] =
33 */
34
35/*
36 * Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD.
37 * Manuals, sample driver and firmware source kits are available
38 * from http://www.alteon.com/support/openkits.
39 *
40 * Written by Bill Paul <wpaul@ctr.columbia.edu>

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

147 * BDs.
148 */
149#if defined(TI_JUMBO_HDRSPLIT) && defined(TI_PRIVATE_JUMBOS)
150#error "options TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS are mutually exclusive"
151#endif /* TI_JUMBO_HDRSPLIT && TI_JUMBO_HDRSPLIT */
152
153#if !defined(lint)
154static const char rcsid[] =
155 "$FreeBSD: head/sys/dev/ti/if_ti.c 106936 2002-11-14 23:49:09Z sam $";
155 "$FreeBSD: head/sys/dev/ti/if_ti.c 109623 2003-01-21 08:56:16Z alfred $";
156#endif
157
158struct ti_softc *tis[8];
159
160typedef enum {
161 TI_SWAP_HTON,
162 TI_SWAP_NTOH
163} ti_swap_type;

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

1125 struct ti_softc *sc;
1126 int i;
1127 struct mbuf *m;
1128{
1129 struct mbuf *m_new = NULL;
1130 struct ti_rx_desc *r;
1131
1132 if (m == NULL) {
156#endif
157
158struct ti_softc *tis[8];
159
160typedef enum {
161 TI_SWAP_HTON,
162 TI_SWAP_NTOH
163} ti_swap_type;

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

1125 struct ti_softc *sc;
1126 int i;
1127 struct mbuf *m;
1128{
1129 struct mbuf *m_new = NULL;
1130 struct ti_rx_desc *r;
1131
1132 if (m == NULL) {
1133 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1133 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1134 if (m_new == NULL)
1135 return(ENOBUFS);
1136
1134 if (m_new == NULL)
1135 return(ENOBUFS);
1136
1137 MCLGET(m_new, M_DONTWAIT);
1137 MCLGET(m_new, M_NOWAIT);
1138 if (!(m_new->m_flags & M_EXT)) {
1139 m_freem(m_new);
1140 return(ENOBUFS);
1141 }
1142 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
1143 } else {
1144 m_new = m;
1145 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;

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

1169 struct ti_softc *sc;
1170 int i;
1171 struct mbuf *m;
1172{
1173 struct mbuf *m_new = NULL;
1174 struct ti_rx_desc *r;
1175
1176 if (m == NULL) {
1138 if (!(m_new->m_flags & M_EXT)) {
1139 m_freem(m_new);
1140 return(ENOBUFS);
1141 }
1142 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
1143 } else {
1144 m_new = m;
1145 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;

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

1169 struct ti_softc *sc;
1170 int i;
1171 struct mbuf *m;
1172{
1173 struct mbuf *m_new = NULL;
1174 struct ti_rx_desc *r;
1175
1176 if (m == NULL) {
1177 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1177 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1178 if (m_new == NULL) {
1179 return(ENOBUFS);
1180 }
1181 m_new->m_len = m_new->m_pkthdr.len = MHLEN;
1182 } else {
1183 m_new = m;
1184 m_new->m_data = m_new->m_pktdat;
1185 m_new->m_len = m_new->m_pkthdr.len = MHLEN;

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

1213{
1214 struct mbuf *m_new = NULL;
1215 struct ti_rx_desc *r;
1216
1217 if (m == NULL) {
1218 caddr_t *buf = NULL;
1219
1220 /* Allocate the mbuf. */
1178 if (m_new == NULL) {
1179 return(ENOBUFS);
1180 }
1181 m_new->m_len = m_new->m_pkthdr.len = MHLEN;
1182 } else {
1183 m_new = m;
1184 m_new->m_data = m_new->m_pktdat;
1185 m_new->m_len = m_new->m_pkthdr.len = MHLEN;

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

1213{
1214 struct mbuf *m_new = NULL;
1215 struct ti_rx_desc *r;
1216
1217 if (m == NULL) {
1218 caddr_t *buf = NULL;
1219
1220 /* Allocate the mbuf. */
1221 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1221 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1222 if (m_new == NULL) {
1223 return(ENOBUFS);
1224 }
1225
1226 /* Allocate the jumbo buffer */
1227 buf = ti_jalloc(sc);
1228 if (buf == NULL) {
1229 m_freem(m_new);

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

1295 m_new = m_old;
1296 cur = m_old->m_next;
1297 for (i = 0; i <= NPAYLOAD; i++){
1298 m[i] = cur;
1299 cur = cur->m_next;
1300 }
1301 } else {
1302 /* Allocate the mbufs. */
1222 if (m_new == NULL) {
1223 return(ENOBUFS);
1224 }
1225
1226 /* Allocate the jumbo buffer */
1227 buf = ti_jalloc(sc);
1228 if (buf == NULL) {
1229 m_freem(m_new);

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

1295 m_new = m_old;
1296 cur = m_old->m_next;
1297 for (i = 0; i <= NPAYLOAD; i++){
1298 m[i] = cur;
1299 cur = cur->m_next;
1300 }
1301 } else {
1302 /* Allocate the mbufs. */
1303 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1303 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1304 if (m_new == NULL) {
1305 printf("ti%d: mbuf allocation failed "
1306 "-- packet dropped!\n", sc->ti_unit);
1307 goto nobufs;
1308 }
1304 if (m_new == NULL) {
1305 printf("ti%d: mbuf allocation failed "
1306 "-- packet dropped!\n", sc->ti_unit);
1307 goto nobufs;
1308 }
1309 MGET(m[NPAYLOAD], M_DONTWAIT, MT_DATA);
1309 MGET(m[NPAYLOAD], M_NOWAIT, MT_DATA);
1310 if (m[NPAYLOAD] == NULL) {
1311 printf("ti%d: cluster mbuf allocation failed "
1312 "-- packet dropped!\n", sc->ti_unit);
1313 goto nobufs;
1314 }
1310 if (m[NPAYLOAD] == NULL) {
1311 printf("ti%d: cluster mbuf allocation failed "
1312 "-- packet dropped!\n", sc->ti_unit);
1313 goto nobufs;
1314 }
1315 MCLGET(m[NPAYLOAD], M_DONTWAIT);
1315 MCLGET(m[NPAYLOAD], M_NOWAIT);
1316 if ((m[NPAYLOAD]->m_flags & M_EXT) == 0) {
1317 printf("ti%d: mbuf allocation failed "
1318 "-- packet dropped!\n", sc->ti_unit);
1319 goto nobufs;
1320 }
1321 m[NPAYLOAD]->m_len = MCLBYTES;
1322
1323 for (i = 0; i < NPAYLOAD; i++){
1316 if ((m[NPAYLOAD]->m_flags & M_EXT) == 0) {
1317 printf("ti%d: mbuf allocation failed "
1318 "-- packet dropped!\n", sc->ti_unit);
1319 goto nobufs;
1320 }
1321 m[NPAYLOAD]->m_len = MCLBYTES;
1322
1323 for (i = 0; i < NPAYLOAD; i++){
1324 MGET(m[i], M_DONTWAIT, MT_DATA);
1324 MGET(m[i], M_NOWAIT, MT_DATA);
1325 if (m[i] == NULL) {
1326 printf("ti%d: mbuf allocation failed "
1327 "-- packet dropped!\n", sc->ti_unit);
1328 goto nobufs;
1329 }
1330 if (!(frame = jumbo_pg_alloc())){
1331 printf("ti%d: buffer allocation failed "
1332 "-- packet dropped!\n", sc->ti_unit);

--- 2323 unchanged lines hidden ---
1325 if (m[i] == NULL) {
1326 printf("ti%d: mbuf allocation failed "
1327 "-- packet dropped!\n", sc->ti_unit);
1328 goto nobufs;
1329 }
1330 if (!(frame = jumbo_pg_alloc())){
1331 printf("ti%d: buffer allocation failed "
1332 "-- packet dropped!\n", sc->ti_unit);

--- 2323 unchanged lines hidden ---