1 /* 2 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi SHimokawa 3 * 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 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the acknowledgement as bellow: 15 * 16 * This product includes software developed by K. Kobayashi and H. Shimokawa 17 * 18 * 4. The name of the author may not be used to endorse or promote products 19 * derived from this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * POSSIBILITY OF SUCH DAMAGE. 32 * 33 * $FreeBSD$ 34 * 35 */ 36 typedef struct fwohci_softc { 37 struct firewire_comm fc; 38 bus_space_tag_t bst; 39 bus_space_handle_t bsh; 40 void *ih; 41 #if __FreeBSD_version < 500000 42 void *ih_cam; 43 #endif 44 45 struct resource *bsr; 46 struct resource *irq_res; 47 struct fwohci_dbch{ 48 u_int ndb; 49 u_int ndesc; 50 caddr_t dummy; 51 STAILQ_HEAD(, fwohcidb_tr) db_trq; 52 struct fwohcidb_tr *top, *bottom, *pdb_tr; 53 struct fw_xferq xferq; 54 struct { 55 int len; 56 int hlen; 57 int plen; 58 caddr_t buf; 59 } frag; 60 int flags; 61 #define FWOHCI_DBCH_INIT (1<<0) 62 #define FWOHCI_DBCH_FULL (1<<1) 63 int buf_offset; 64 #define FWOHCI_DBCH_MAX_PAGES 32 65 int npages; 66 void *pages[FWOHCI_DBCH_MAX_PAGES]; 67 } arrq, arrs, atrq, atrs, it[OHCI_DMA_ITCH], ir[OHCI_DMA_IRCH]; 68 u_int maxrec; 69 u_int32_t *cromptr; 70 u_int32_t intmask; 71 } fwohci_softc_t; 72 void fwohci_intr __P((void *arg)); 73 int fwohci_init __P((struct fwohci_softc *, device_t)); 74 void fwohci_reset __P((struct fwohci_softc *, device_t)); 75 int fwohci_detach __P((struct fwohci_softc *, device_t)); 76 int fwohci_resume __P((struct fwohci_softc *, device_t)); 77 int fwohci_shutdown __P((struct fwohci_softc *, device_t dev)); 78