fwohcivar.h revision 109379
1103285Sikob/* 2103285Sikob * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi SHimokawa 3103285Sikob * All rights reserved. 4103285Sikob * 5103285Sikob * Redistribution and use in source and binary forms, with or without 6103285Sikob * modification, are permitted provided that the following conditions 7103285Sikob * are met: 8103285Sikob * 1. Redistributions of source code must retain the above copyright 9103285Sikob * notice, this list of conditions and the following disclaimer. 10103285Sikob * 2. Redistributions in binary form must reproduce the above copyright 11103285Sikob * notice, this list of conditions and the following disclaimer in the 12103285Sikob * documentation and/or other materials provided with the distribution. 13103285Sikob * 3. All advertising materials mentioning features or use of this software 14103285Sikob * must display the acknowledgement as bellow: 15103285Sikob * 16103285Sikob * This product includes software developed by K. Kobayashi and H. Shimokawa 17103285Sikob * 18103285Sikob * 4. The name of the author may not be used to endorse or promote products 19103285Sikob * derived from this software without specific prior written permission. 20103285Sikob * 21103285Sikob * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22103285Sikob * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23103285Sikob * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24103285Sikob * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 25103285Sikob * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26103285Sikob * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27103285Sikob * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28103285Sikob * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29103285Sikob * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 30103285Sikob * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31103285Sikob * POSSIBILITY OF SUCH DAMAGE. 32103285Sikob * 33103285Sikob * $FreeBSD: head/sys/dev/firewire/fwohcivar.h 109379 2003-01-16 13:09:33Z simokawa $ 34103285Sikob * 35103285Sikob */ 36103285Sikobtypedef struct fwohci_softc { 37103285Sikob struct firewire_comm fc; 38103285Sikob bus_space_tag_t bst; 39103285Sikob bus_space_handle_t bsh; 40103285Sikob void *ih; 41103285Sikob#if __FreeBSD_version < 500000 42103285Sikob void *ih_cam; 43103285Sikob#endif 44103285Sikob 45103285Sikob struct resource *bsr; 46103285Sikob struct resource *irq_res; 47103285Sikob struct fwohci_dbch{ 48103285Sikob u_int ndb; 49103285Sikob u_int ndesc; 50103285Sikob caddr_t dummy; 51103285Sikob STAILQ_HEAD(, fwohcidb_tr) db_trq; 52103285Sikob struct fwohcidb_tr *top, *bottom, *pdb_tr; 53103285Sikob struct fw_xferq xferq; 54103285Sikob struct { 55103285Sikob int len; 56103285Sikob int hlen; 57103285Sikob int plen; 58103285Sikob caddr_t buf; 59103285Sikob } frag; 60103285Sikob int flags; 61108527Ssimokawa#define FWOHCI_DBCH_INIT (1<<0) 62103285Sikob#define FWOHCI_DBCH_FULL (1<<1) 63103285Sikob int buf_offset; 64109379Ssimokawa#define FWOHCI_DBCH_MAX_PAGES 32 65109379Ssimokawa int npages; 66109379Ssimokawa void *pages[FWOHCI_DBCH_MAX_PAGES]; 67108276Ssimokawa } arrq, arrs, atrq, atrs, it[OHCI_DMA_ITCH], ir[OHCI_DMA_IRCH]; 68103285Sikob u_int maxrec; 69103285Sikob u_int32_t *cromptr; 70103285Sikob u_int32_t intmask; 71103285Sikob} fwohci_softc_t; 72103285Sikobvoid fwohci_intr __P((void *arg)); 73103285Sikobint fwohci_init __P((struct fwohci_softc *, device_t)); 74108530Ssimokawavoid fwohci_reset __P((struct fwohci_softc *, device_t)); 75108527Ssimokawaint fwohci_detach __P((struct fwohci_softc *, device_t)); 76108642Ssimokawaint fwohci_resume __P((struct fwohci_softc *, device_t)); 77108642Ssimokawaint fwohci_shutdown __P((struct fwohci_softc *, device_t dev)); 78