Deleted Added
full compact
if_sf.c (257176) if_sf.c (267363)
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

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

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
33#include <sys/cdefs.h>
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

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

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
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/sf/if_sf.c 257176 2013-10-26 17:58:36Z glebius $");
34__FBSDID("$FreeBSD: head/sys/dev/sf/if_sf.c 267363 2014-06-11 14:53:58Z jhb $");
35
36/*
37 * Adaptec AIC-6915 "Starfire" PCI fast ethernet driver for FreeBSD.
38 * Programming manual is available from:
39 * http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf.
40 *
41 * Written by Bill Paul <wpaul@ctr.columbia.edu>
42 * Department of Electical Engineering

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

1287sf_dma_free(struct sf_softc *sc)
1288{
1289 struct sf_txdesc *txd;
1290 struct sf_rxdesc *rxd;
1291 int i;
1292
1293 /* Tx ring. */
1294 if (sc->sf_cdata.sf_tx_ring_tag) {
35
36/*
37 * Adaptec AIC-6915 "Starfire" PCI fast ethernet driver for FreeBSD.
38 * Programming manual is available from:
39 * http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf.
40 *
41 * Written by Bill Paul <wpaul@ctr.columbia.edu>
42 * Department of Electical Engineering

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

1287sf_dma_free(struct sf_softc *sc)
1288{
1289 struct sf_txdesc *txd;
1290 struct sf_rxdesc *rxd;
1291 int i;
1292
1293 /* Tx ring. */
1294 if (sc->sf_cdata.sf_tx_ring_tag) {
1295 if (sc->sf_cdata.sf_tx_ring_map)
1295 if (sc->sf_rdata.sf_tx_ring_paddr)
1296 bus_dmamap_unload(sc->sf_cdata.sf_tx_ring_tag,
1297 sc->sf_cdata.sf_tx_ring_map);
1296 bus_dmamap_unload(sc->sf_cdata.sf_tx_ring_tag,
1297 sc->sf_cdata.sf_tx_ring_map);
1298 if (sc->sf_cdata.sf_tx_ring_map &&
1299 sc->sf_rdata.sf_tx_ring)
1298 if (sc->sf_rdata.sf_tx_ring)
1300 bus_dmamem_free(sc->sf_cdata.sf_tx_ring_tag,
1301 sc->sf_rdata.sf_tx_ring,
1302 sc->sf_cdata.sf_tx_ring_map);
1303 sc->sf_rdata.sf_tx_ring = NULL;
1299 bus_dmamem_free(sc->sf_cdata.sf_tx_ring_tag,
1300 sc->sf_rdata.sf_tx_ring,
1301 sc->sf_cdata.sf_tx_ring_map);
1302 sc->sf_rdata.sf_tx_ring = NULL;
1304 sc->sf_cdata.sf_tx_ring_map = NULL;
1303 sc->sf_rdata.sf_tx_ring_paddr = 0;
1305 bus_dma_tag_destroy(sc->sf_cdata.sf_tx_ring_tag);
1306 sc->sf_cdata.sf_tx_ring_tag = NULL;
1307 }
1308 /* Tx completion ring. */
1309 if (sc->sf_cdata.sf_tx_cring_tag) {
1304 bus_dma_tag_destroy(sc->sf_cdata.sf_tx_ring_tag);
1305 sc->sf_cdata.sf_tx_ring_tag = NULL;
1306 }
1307 /* Tx completion ring. */
1308 if (sc->sf_cdata.sf_tx_cring_tag) {
1310 if (sc->sf_cdata.sf_tx_cring_map)
1309 if (sc->sf_rdata.sf_tx_cring_paddr)
1311 bus_dmamap_unload(sc->sf_cdata.sf_tx_cring_tag,
1312 sc->sf_cdata.sf_tx_cring_map);
1310 bus_dmamap_unload(sc->sf_cdata.sf_tx_cring_tag,
1311 sc->sf_cdata.sf_tx_cring_map);
1313 if (sc->sf_cdata.sf_tx_cring_map &&
1314 sc->sf_rdata.sf_tx_cring)
1312 if (sc->sf_rdata.sf_tx_cring)
1315 bus_dmamem_free(sc->sf_cdata.sf_tx_cring_tag,
1316 sc->sf_rdata.sf_tx_cring,
1317 sc->sf_cdata.sf_tx_cring_map);
1318 sc->sf_rdata.sf_tx_cring = NULL;
1313 bus_dmamem_free(sc->sf_cdata.sf_tx_cring_tag,
1314 sc->sf_rdata.sf_tx_cring,
1315 sc->sf_cdata.sf_tx_cring_map);
1316 sc->sf_rdata.sf_tx_cring = NULL;
1319 sc->sf_cdata.sf_tx_cring_map = NULL;
1317 sc->sf_rdata.sf_tx_cring_paddr = 0;
1320 bus_dma_tag_destroy(sc->sf_cdata.sf_tx_cring_tag);
1321 sc->sf_cdata.sf_tx_cring_tag = NULL;
1322 }
1323 /* Rx ring. */
1324 if (sc->sf_cdata.sf_rx_ring_tag) {
1318 bus_dma_tag_destroy(sc->sf_cdata.sf_tx_cring_tag);
1319 sc->sf_cdata.sf_tx_cring_tag = NULL;
1320 }
1321 /* Rx ring. */
1322 if (sc->sf_cdata.sf_rx_ring_tag) {
1325 if (sc->sf_cdata.sf_rx_ring_map)
1323 if (sc->sf_rdata.sf_rx_ring_paddr)
1326 bus_dmamap_unload(sc->sf_cdata.sf_rx_ring_tag,
1327 sc->sf_cdata.sf_rx_ring_map);
1324 bus_dmamap_unload(sc->sf_cdata.sf_rx_ring_tag,
1325 sc->sf_cdata.sf_rx_ring_map);
1328 if (sc->sf_cdata.sf_rx_ring_map &&
1329 sc->sf_rdata.sf_rx_ring)
1326 if (sc->sf_rdata.sf_rx_ring)
1330 bus_dmamem_free(sc->sf_cdata.sf_rx_ring_tag,
1331 sc->sf_rdata.sf_rx_ring,
1332 sc->sf_cdata.sf_rx_ring_map);
1333 sc->sf_rdata.sf_rx_ring = NULL;
1327 bus_dmamem_free(sc->sf_cdata.sf_rx_ring_tag,
1328 sc->sf_rdata.sf_rx_ring,
1329 sc->sf_cdata.sf_rx_ring_map);
1330 sc->sf_rdata.sf_rx_ring = NULL;
1334 sc->sf_cdata.sf_rx_ring_map = NULL;
1331 sc->sf_rdata.sf_rx_ring_paddr = 0;
1335 bus_dma_tag_destroy(sc->sf_cdata.sf_rx_ring_tag);
1336 sc->sf_cdata.sf_rx_ring_tag = NULL;
1337 }
1338 /* Rx completion ring. */
1339 if (sc->sf_cdata.sf_rx_cring_tag) {
1332 bus_dma_tag_destroy(sc->sf_cdata.sf_rx_ring_tag);
1333 sc->sf_cdata.sf_rx_ring_tag = NULL;
1334 }
1335 /* Rx completion ring. */
1336 if (sc->sf_cdata.sf_rx_cring_tag) {
1340 if (sc->sf_cdata.sf_rx_cring_map)
1337 if (sc->sf_rdata.sf_rx_cring_paddr)
1341 bus_dmamap_unload(sc->sf_cdata.sf_rx_cring_tag,
1342 sc->sf_cdata.sf_rx_cring_map);
1338 bus_dmamap_unload(sc->sf_cdata.sf_rx_cring_tag,
1339 sc->sf_cdata.sf_rx_cring_map);
1343 if (sc->sf_cdata.sf_rx_cring_map &&
1344 sc->sf_rdata.sf_rx_cring)
1340 if (sc->sf_rdata.sf_rx_cring)
1345 bus_dmamem_free(sc->sf_cdata.sf_rx_cring_tag,
1346 sc->sf_rdata.sf_rx_cring,
1347 sc->sf_cdata.sf_rx_cring_map);
1348 sc->sf_rdata.sf_rx_cring = NULL;
1341 bus_dmamem_free(sc->sf_cdata.sf_rx_cring_tag,
1342 sc->sf_rdata.sf_rx_cring,
1343 sc->sf_cdata.sf_rx_cring_map);
1344 sc->sf_rdata.sf_rx_cring = NULL;
1349 sc->sf_cdata.sf_rx_cring_map = NULL;
1345 sc->sf_rdata.sf_rx_cring_paddr = 0;
1350 bus_dma_tag_destroy(sc->sf_cdata.sf_rx_cring_tag);
1351 sc->sf_cdata.sf_rx_cring_tag = NULL;
1352 }
1353 /* Tx buffers. */
1354 if (sc->sf_cdata.sf_tx_tag) {
1355 for (i = 0; i < SF_TX_DLIST_CNT; i++) {
1356 txd = &sc->sf_cdata.sf_txdesc[i];
1357 if (txd->tx_dmamap) {

--- 1378 unchanged lines hidden ---
1346 bus_dma_tag_destroy(sc->sf_cdata.sf_rx_cring_tag);
1347 sc->sf_cdata.sf_rx_cring_tag = NULL;
1348 }
1349 /* Tx buffers. */
1350 if (sc->sf_cdata.sf_tx_tag) {
1351 for (i = 0; i < SF_TX_DLIST_CNT; i++) {
1352 txd = &sc->sf_cdata.sf_txdesc[i];
1353 if (txd->tx_dmamap) {

--- 1378 unchanged lines hidden ---