diff options
Diffstat (limited to 'sys/dev/amr/amr_pci.c')
-rw-r--r-- | sys/dev/amr/amr_pci.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c index 8c7995e..18141bd 100644 --- a/sys/dev/amr/amr_pci.c +++ b/sys/dev/amr/amr_pci.c @@ -24,12 +24,34 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * Copyright (c) 2002 Eric Moore + * Copyright (c) 2002 LSI Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * 3. The party using or redistributing the source code and binary forms - * agrees to the above disclaimer and the terms and conditions set forth + * agrees to the disclaimer below and the terms and conditions set forth * herein. * - * Additional Copyright (c) 2002 by Eric Moore under same license. - * Additional Copyright (c) 2002 LSI Logic Corporation + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * * $FreeBSD$ */ @@ -408,10 +430,10 @@ amr_pci_free(struct amr_softc *sc) /* free and destroy DMA memory and tag for mailbox */ if (sc->amr_mailbox) { p = (u_int8_t *)(uintptr_t)(volatile void *)sc->amr_mailbox; - bus_dmamem_free(sc->amr_sg_dmat, p - 16, sc->amr_sg_dmamap); + bus_dmamem_free(sc->amr_mailbox_dmat, p - 16, sc->amr_mailbox_dmamap); } - if (sc->amr_sg_dmat) - bus_dma_tag_destroy(sc->amr_sg_dmat); + if (sc->amr_mailbox_dmat) + bus_dma_tag_destroy(sc->amr_mailbox_dmat); /* disconnect the interrupt handler */ if (sc->amr_intr) @@ -547,13 +569,13 @@ amr_setup_mbox(struct amr_softc *sc) * Allocate the mailbox structure and permanently map it into * controller-visible space. */ - error = bus_dmamem_alloc(sc->amr_mailbox_dmat, (void **)&p, BUS_DMA_NOWAIT, + error = bus_dmamem_alloc(sc->amr_mailbox_dmat, (void **)&p, BUS_DMA_NOWAIT, &sc->amr_mailbox_dmamap); if (error) { device_printf(sc->amr_dev, "can't allocate mailbox memory\n"); return(ENOMEM); } - bus_dmamap_load(sc->amr_mailbox_dmat, sc->amr_mailbox_dmamap, p, + bus_dmamap_load(sc->amr_mailbox_dmat, sc->amr_mailbox_dmamap, p, sizeof(struct amr_mailbox64), amr_setup_mbox_helper, sc, 0); /* * Conventional mailbox is inside the mailbox64 region. |