1b7382e09SNathan Whitehorn /*- 2*71e3c308SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 3*71e3c308SPedro F. Giffuni * 4b7382e09SNathan Whitehorn * Copyright 2008 by Nathan Whitehorn. All rights reserved. 5b7382e09SNathan Whitehorn * 6b7382e09SNathan Whitehorn * Redistribution and use in source and binary forms, with or without 7b7382e09SNathan Whitehorn * modification, are permitted provided that the following conditions 8b7382e09SNathan Whitehorn * are met: 9b7382e09SNathan Whitehorn * 1. Redistributions of source code must retain the above copyright 10b7382e09SNathan Whitehorn * notice, this list of conditions and the following disclaimer. 11b7382e09SNathan Whitehorn * 2. Redistributions in binary form must reproduce the above copyright 12b7382e09SNathan Whitehorn * notice, this list of conditions and the following disclaimer in the 13b7382e09SNathan Whitehorn * documentation and/or other materials provided with the distribution. 14b7382e09SNathan Whitehorn * 3. The name of the author may not be used to endorse or promote products 15b7382e09SNathan Whitehorn * derived from this software without specific prior written permission. 16b7382e09SNathan Whitehorn * 17b7382e09SNathan Whitehorn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18b7382e09SNathan Whitehorn * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19b7382e09SNathan Whitehorn * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20b7382e09SNathan Whitehorn * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21b7382e09SNathan Whitehorn * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22b7382e09SNathan Whitehorn * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23b7382e09SNathan Whitehorn * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 24b7382e09SNathan Whitehorn * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25b7382e09SNathan Whitehorn * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26b7382e09SNathan Whitehorn * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27b7382e09SNathan Whitehorn * SUCH DAMAGE. 28b7382e09SNathan Whitehorn */ 29b7382e09SNathan Whitehorn 30b7382e09SNathan Whitehorn #ifndef ATA_DBDMA_H 31b7382e09SNathan Whitehorn #define ATA_DBDMA_H 32b7382e09SNathan Whitehorn 33b7382e09SNathan Whitehorn #include <sys/param.h> 34b7382e09SNathan Whitehorn #include <sys/lock.h> 35b7382e09SNathan Whitehorn #include <sys/mutex.h> 36b7382e09SNathan Whitehorn 37b7382e09SNathan Whitehorn #include <machine/dbdma.h> 38b7382e09SNathan Whitehorn 39b7382e09SNathan Whitehorn struct ata_dbdma_channel { 40b7382e09SNathan Whitehorn struct ata_channel sc_ch; 41b7382e09SNathan Whitehorn 42b7382e09SNathan Whitehorn int dbdma_rid; 43b7382e09SNathan Whitehorn struct resource *dbdma_regs; 44b7382e09SNathan Whitehorn u_int dbdma_offset; 45b7382e09SNathan Whitehorn 46b7382e09SNathan Whitehorn dbdma_channel_t *dbdma; 47b7382e09SNathan Whitehorn int next_dma_slot; 48b7382e09SNathan Whitehorn 49b7382e09SNathan Whitehorn struct mtx dbdma_mtx; 50b7382e09SNathan Whitehorn }; 51b7382e09SNathan Whitehorn 52b7382e09SNathan Whitehorn void ata_dbdma_dmainit(device_t dev); 53b7382e09SNathan Whitehorn 54b7382e09SNathan Whitehorn #endif /* ATA_DBDMA_H */ 55