Deleted Added
sdiff udiff text old ( 257176 ) new ( 267363 )
full compact
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 $");
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)
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)
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;
1304 sc->sf_cdata.sf_tx_ring_map = NULL;
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) {
1310 if (sc->sf_cdata.sf_tx_cring_map)
1311 bus_dmamap_unload(sc->sf_cdata.sf_tx_cring_tag,
1312 sc->sf_cdata.sf_tx_cring_map);
1313 if (sc->sf_cdata.sf_tx_cring_map &&
1314 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;
1319 sc->sf_cdata.sf_tx_cring_map = NULL;
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) {
1325 if (sc->sf_cdata.sf_rx_ring_map)
1326 bus_dmamap_unload(sc->sf_cdata.sf_rx_ring_tag,
1327 sc->sf_cdata.sf_rx_ring_map);
1328 if (sc->sf_cdata.sf_rx_ring_map &&
1329 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;
1334 sc->sf_cdata.sf_rx_ring_map = NULL;
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) {
1340 if (sc->sf_cdata.sf_rx_cring_map)
1341 bus_dmamap_unload(sc->sf_cdata.sf_rx_cring_tag,
1342 sc->sf_cdata.sf_rx_cring_map);
1343 if (sc->sf_cdata.sf_rx_cring_map &&
1344 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;
1349 sc->sf_cdata.sf_rx_cring_map = NULL;
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 ---