Deleted Added
full compact
if_fxp.c (164792) if_fxp.c (166165)
1/*-
2 * Copyright (c) 1995, David Greenman
3 * Copyright (c) 2001 Jonathan Lemon <jlemon@freebsd.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1995, David Greenman
3 * Copyright (c) 2001 Jonathan Lemon <jlemon@freebsd.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/fxp/if_fxp.c 164792 2006-12-01 13:07:52Z ru $");
31__FBSDID("$FreeBSD: head/sys/dev/fxp/if_fxp.c 166165 2007-01-21 19:32:51Z marius $");
32
33/*
34 * Intel EtherExpress Pro/100B PCI Fast Ethernet driver
35 */
36
37#ifdef HAVE_KERNEL_OPTION_HEADERS
38#include "opt_device_polling.h"
39#endif

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

607 }
608
609 /*
610 * Allocate DMA tags and DMA safe memory.
611 */
612 sc->maxtxseg = FXP_NTXSEG;
613 if (sc->flags & FXP_FLAG_EXT_RFA)
614 sc->maxtxseg--;
32
33/*
34 * Intel EtherExpress Pro/100B PCI Fast Ethernet driver
35 */
36
37#ifdef HAVE_KERNEL_OPTION_HEADERS
38#include "opt_device_polling.h"
39#endif

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

607 }
608
609 /*
610 * Allocate DMA tags and DMA safe memory.
611 */
612 sc->maxtxseg = FXP_NTXSEG;
613 if (sc->flags & FXP_FLAG_EXT_RFA)
614 sc->maxtxseg--;
615 error = bus_dma_tag_create(NULL, 2, 0, BUS_SPACE_MAXADDR_32BIT,
616 BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * sc->maxtxseg,
617 sc->maxtxseg, MCLBYTES, 0, busdma_lock_mutex, &Giant,
618 &sc->fxp_mtag);
615 error = bus_dma_tag_create(bus_get_dma_tag(dev), 2, 0,
616 BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
617 MCLBYTES * sc->maxtxseg, sc->maxtxseg, MCLBYTES, 0,
618 busdma_lock_mutex, &Giant, &sc->fxp_mtag);
619 if (error) {
620 device_printf(dev, "could not allocate dma tag\n");
621 goto fail;
622 }
623
619 if (error) {
620 device_printf(dev, "could not allocate dma tag\n");
621 goto fail;
622 }
623
624 error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
625 BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct fxp_stats), 1,
626 sizeof(struct fxp_stats), 0, busdma_lock_mutex, &Giant,
627 &sc->fxp_stag);
624 error = bus_dma_tag_create(bus_get_dma_tag(dev), 4, 0,
625 BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
626 sizeof(struct fxp_stats), 1, sizeof(struct fxp_stats), 0,
627 busdma_lock_mutex, &Giant, &sc->fxp_stag);
628 if (error) {
629 device_printf(dev, "could not allocate dma tag\n");
630 goto fail;
631 }
632
633 error = bus_dmamem_alloc(sc->fxp_stag, (void **)&sc->fxp_stats,
634 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->fxp_smap);
635 if (error)
636 goto fail;
637 error = bus_dmamap_load(sc->fxp_stag, sc->fxp_smap, sc->fxp_stats,
638 sizeof(struct fxp_stats), fxp_dma_map_addr, &sc->stats_addr, 0);
639 if (error) {
640 device_printf(dev, "could not map the stats buffer\n");
641 goto fail;
642 }
643
628 if (error) {
629 device_printf(dev, "could not allocate dma tag\n");
630 goto fail;
631 }
632
633 error = bus_dmamem_alloc(sc->fxp_stag, (void **)&sc->fxp_stats,
634 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->fxp_smap);
635 if (error)
636 goto fail;
637 error = bus_dmamap_load(sc->fxp_stag, sc->fxp_smap, sc->fxp_stats,
638 sizeof(struct fxp_stats), fxp_dma_map_addr, &sc->stats_addr, 0);
639 if (error) {
640 device_printf(dev, "could not map the stats buffer\n");
641 goto fail;
642 }
643
644 error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
645 BUS_SPACE_MAXADDR, NULL, NULL, FXP_TXCB_SZ, 1,
646 FXP_TXCB_SZ, 0, busdma_lock_mutex, &Giant, &sc->cbl_tag);
644 error = bus_dma_tag_create(bus_get_dma_tag(dev), 4, 0,
645 BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
646 FXP_TXCB_SZ, 1, FXP_TXCB_SZ, 0,
647 busdma_lock_mutex, &Giant, &sc->cbl_tag);
647 if (error) {
648 device_printf(dev, "could not allocate dma tag\n");
649 goto fail;
650 }
651
652 error = bus_dmamem_alloc(sc->cbl_tag, (void **)&sc->fxp_desc.cbl_list,
653 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->cbl_map);
654 if (error)
655 goto fail;
656
657 error = bus_dmamap_load(sc->cbl_tag, sc->cbl_map,
658 sc->fxp_desc.cbl_list, FXP_TXCB_SZ, fxp_dma_map_addr,
659 &sc->fxp_desc.cbl_addr, 0);
660 if (error) {
661 device_printf(dev, "could not map DMA memory\n");
662 goto fail;
663 }
664
648 if (error) {
649 device_printf(dev, "could not allocate dma tag\n");
650 goto fail;
651 }
652
653 error = bus_dmamem_alloc(sc->cbl_tag, (void **)&sc->fxp_desc.cbl_list,
654 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->cbl_map);
655 if (error)
656 goto fail;
657
658 error = bus_dmamap_load(sc->cbl_tag, sc->cbl_map,
659 sc->fxp_desc.cbl_list, FXP_TXCB_SZ, fxp_dma_map_addr,
660 &sc->fxp_desc.cbl_addr, 0);
661 if (error) {
662 device_printf(dev, "could not map DMA memory\n");
663 goto fail;
664 }
665
665 error = bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT,
666 BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct fxp_cb_mcs), 1,
667 sizeof(struct fxp_cb_mcs), 0, busdma_lock_mutex, &Giant,
668 &sc->mcs_tag);
666 error = bus_dma_tag_create(bus_get_dma_tag(dev), 4, 0,
667 BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
668 sizeof(struct fxp_cb_mcs), 1, sizeof(struct fxp_cb_mcs), 0,
669 busdma_lock_mutex, &Giant, &sc->mcs_tag);
669 if (error) {
670 device_printf(dev, "could not allocate dma tag\n");
671 goto fail;
672 }
673
674 error = bus_dmamem_alloc(sc->mcs_tag, (void **)&sc->mcsp,
675 BUS_DMA_NOWAIT, &sc->mcs_map);
676 if (error)

--- 2038 unchanged lines hidden ---
670 if (error) {
671 device_printf(dev, "could not allocate dma tag\n");
672 goto fail;
673 }
674
675 error = bus_dmamem_alloc(sc->mcs_tag, (void **)&sc->mcsp,
676 BUS_DMA_NOWAIT, &sc->mcs_map);
677 if (error)

--- 2038 unchanged lines hidden ---