2 * SPDX-License-Identifier: BSD-4-Clause
4 * Copyright (c) 2003 Hidetoshi SHimokawa
5 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi SHimokawa
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the acknowledgement as bellow:
19 * This product includes software developed by K. Kobayashi and H. Shimokawa
21 * 4. The name of the author may not be used to endorse or promote products
22 * derived from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
28 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
40 #include <sys/taskqueue.h>
42 typedef struct fwohci_softc {
43 struct firewire_comm fc;
45 bus_space_handle_t bsh;
48 struct resource *irq_res;
52 STAILQ_HEAD(, fwohcidb_tr) db_trq;
53 struct fwohcidb_tr *top, *bottom, *pdb_tr;
54 struct fw_xferq xferq;
56 #define FWOHCI_DBCH_INIT (1<<0)
57 #define FWOHCI_DBCH_FULL (1<<1)
58 /* used only in receive context */
59 int buf_offset; /* signed */
60 #define FWOHCI_DBCH_MAX_PAGES 32
61 /* Context programs buffer */
62 struct fwdma_alloc_multi *am;
64 } arrq, arrs, atrq, atrs, it[OHCI_DMA_ITCH], ir[OHCI_DMA_IRCH];
67 struct fwdma_alloc sid_dma;
68 struct fwdma_alloc crom_dma;
69 struct fwdma_alloc dummy_dma;
70 uint32_t intmask, irstat, itstat;
72 struct task fwohci_task_busreset;
73 struct task fwohci_task_sid;
74 struct task fwohci_task_dma;
78 void fwohci_intr (void *arg);
79 int fwohci_init (struct fwohci_softc *, device_t);
80 void fwohci_poll (struct firewire_comm *, int, int);
81 void fwohci_reset (struct fwohci_softc *, device_t);
82 int fwohci_detach (struct fwohci_softc *, device_t);
83 int fwohci_resume (struct fwohci_softc *, device_t);
84 int fwohci_stop (struct fwohci_softc *, device_t dev);