fwohcivar.h revision 1.30 1 1.30 kiyohara /* $NetBSD: fwohcivar.h,v 1.30 2010/03/29 03:05:28 kiyohara Exp $ */
2 1.25 christos
3 1.1 matt /*-
4 1.24 kiyohara * Copyright (c) 2003 Hidetoshi SHimokawa
5 1.24 kiyohara * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi SHimokawa
6 1.1 matt * All rights reserved.
7 1.1 matt *
8 1.1 matt * Redistribution and use in source and binary forms, with or without
9 1.1 matt * modification, are permitted provided that the following conditions
10 1.1 matt * are met:
11 1.1 matt * 1. Redistributions of source code must retain the above copyright
12 1.1 matt * notice, this list of conditions and the following disclaimer.
13 1.1 matt * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 matt * notice, this list of conditions and the following disclaimer in the
15 1.1 matt * documentation and/or other materials provided with the distribution.
16 1.1 matt * 3. All advertising materials mentioning features or use of this software
17 1.24 kiyohara * must display the acknowledgement as bellow:
18 1.24 kiyohara *
19 1.24 kiyohara * This product includes software developed by K. Kobayashi and H. Shimokawa
20 1.1 matt *
21 1.24 kiyohara * 4. The name of the author may not be used to endorse or promote products
22 1.24 kiyohara * derived from this software without specific prior written permission.
23 1.24 kiyohara *
24 1.24 kiyohara * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25 1.24 kiyohara * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 1.24 kiyohara * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 1.24 kiyohara * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
28 1.24 kiyohara * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 1.24 kiyohara * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 1.24 kiyohara * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.24 kiyohara * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 1.24 kiyohara * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 1.24 kiyohara * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 1.1 matt * POSSIBILITY OF SUCH DAMAGE.
35 1.24 kiyohara *
36 1.27 kiyohara * $FreeBSD: src/sys/dev/firewire/fwohcivar.h,v 1.16 2007/06/06 14:31:36 simokawa Exp $
37 1.24 kiyohara *
38 1.1 matt */
39 1.30 kiyohara #ifndef _FWOHCIVAR_H_
40 1.30 kiyohara #define _FWOHCIVAR_H_
41 1.1 matt
42 1.24 kiyohara MALLOC_DECLARE(M_FW);
43 1.1 matt
44 1.30 kiyohara struct fwohci_softc {
45 1.24 kiyohara struct firewire_comm fc;
46 1.24 kiyohara bus_space_tag_t bst;
47 1.24 kiyohara bus_space_handle_t bsh;
48 1.24 kiyohara bus_size_t bssize;
49 1.30 kiyohara struct fwohci_dbch {
50 1.30 kiyohara int off;
51 1.24 kiyohara u_int ndb;
52 1.24 kiyohara u_int ndesc;
53 1.24 kiyohara STAILQ_HEAD(, fwohcidb_tr) db_trq;
54 1.30 kiyohara struct fwohcidb_tr *top;
55 1.30 kiyohara struct fwohcidb_tr *bottom;
56 1.30 kiyohara struct fwohcidb_tr *pdb_tr;
57 1.24 kiyohara struct fw_xferq xferq;
58 1.24 kiyohara int flags;
59 1.24 kiyohara #define FWOHCI_DBCH_INIT (1<<0)
60 1.24 kiyohara #define FWOHCI_DBCH_FULL (1<<1)
61 1.24 kiyohara /* used only in receive context */
62 1.24 kiyohara int buf_offset; /* signed */
63 1.24 kiyohara #define FWOHCI_DBCH_MAX_PAGES 32
64 1.24 kiyohara /* Context programs buffer */
65 1.24 kiyohara struct fwdma_alloc_multi *am;
66 1.24 kiyohara } arrq, arrs, atrq, atrs, it[OHCI_DMA_ITCH], ir[OHCI_DMA_IRCH];
67 1.24 kiyohara u_int maxrec;
68 1.24 kiyohara uint32_t *sid_buf;
69 1.24 kiyohara struct fwdma_alloc sid_dma;
70 1.24 kiyohara struct fwdma_alloc crom_dma;
71 1.24 kiyohara struct fwdma_alloc dummy_dma;
72 1.30 kiyohara uint32_t intmask;
73 1.24 kiyohara uint32_t intstat;
74 1.30 kiyohara uint32_t irstat;
75 1.30 kiyohara uint32_t itstat;
76 1.24 kiyohara int cycle_lost;
77 1.30 kiyohara };
78 1.1 matt
79 1.30 kiyohara #define OWRITE(sc, r, x) bus_space_write_4((sc)->bst, (sc)->bsh, (r), (x))
80 1.30 kiyohara #define OREAD(sc, r) bus_space_read_4((sc)->bst, (sc)->bsh, (r))
81 1.30 kiyohara
82 1.30 kiyohara int fwohci_init(struct fwohci_softc *);
83 1.27 kiyohara int fwohci_detach(struct fwohci_softc *, int);
84 1.30 kiyohara int fwohci_intr(void *arg);
85 1.30 kiyohara int fwohci_resume(struct fwohci_softc *);
86 1.30 kiyohara int fwohci_stop(struct fwohci_softc *);
87 1.30 kiyohara
88 1.30 kiyohara #endif /* _FWOHCIVAR_H_ */
89