No empty .Rs/.Re
[netbsd-mini2440.git] / sys / dev / ic / iavcvar.h
blobc5365047e2866f2278e15327aacb8e7c75ddb515
1 /* $NetBSD: iavcvar.h,v 1.3 2005/12/11 12:21:27 christos Exp $ */
3 /*
4 * Copyright (c) 2001-2003 Cubical Solutions Ltd. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
27 * capi/iavc/iavc.h The AVM ISDN controllers' common declarations.
29 * $FreeBSD: src/sys/i4b/capi/iavc/iavc.h,v 1.1.2.1 2001/08/10 14:08:34 obrien Exp $
32 #include <netisdn/i4b_capi.h>
35 // iavc_softc_t
36 // The software context of one AVM T1 controller.
39 #define IAVC_IO_BASES 1
40 #define IAVC_DMA_SIZE (128 + 2048)
42 typedef struct iavc_softc {
43 struct device sc_dev;
44 capi_softc_t sc_capi;
46 bus_space_handle_t sc_mem_bh;
47 bus_space_tag_t sc_mem_bt;
49 bus_space_handle_t sc_io_bh;
50 bus_space_tag_t sc_io_bt;
52 bus_dma_tag_t dmat;
54 bus_dmamap_t tx_map;
55 bus_dmamap_t rx_map;
57 bus_dma_segment_t txseg;
58 bus_dma_segment_t rxseg;
59 int ntxsegs, nrxsegs;
61 uint32_t sc_unit;
62 uint32_t sc_intr;
64 int32_t sc_state;
65 #define IAVC_DOWN 0
66 #define IAVC_POLL 1
67 #define IAVC_INIT 2
68 #define IAVC_UP 3
69 uint32_t sc_blocked;
70 uint32_t sc_dma;
71 uint32_t sc_t1;
73 u_int32_t sc_csr;
75 void * sc_sendbuf;
76 void * sc_recvbuf;
78 u_int32_t sc_recv1;
80 struct ifqueue sc_txq;
81 } iavc_softc_t;
84 // {b1,b1dma,t1}_{detect,reset}
85 // Routines to detect and manage the specific type of card.
88 int iavc_b1_detect(iavc_softc_t *sc);
89 void iavc_b1_disable_irq(iavc_softc_t *sc);
90 void iavc_b1_reset(iavc_softc_t *sc);
92 int iavc_b1dma_detect(iavc_softc_t *sc);
93 void iavc_b1dma_reset(iavc_softc_t *sc);
95 int iavc_t1_detect(iavc_softc_t *sc);
96 void iavc_t1_disable_irq(iavc_softc_t *sc);
97 void iavc_t1_reset(iavc_softc_t *sc);
101 // iavc_handle_intr
102 // Interrupt handler, called by the bus specific interrupt routine
103 // in iavc_<bustype>.c module.
105 // iavc_load
106 // CAPI callback. Resets device and loads firmware.
108 // iavc_register
109 // CAPI callback. Registers an application id.
111 // iavc_release
112 // CAPI callback. Releases an application id.
114 // iavc_send
115 // CAPI callback. Sends a CAPI message. A B3_DATA_REQ message has
116 // m_next point to a data mbuf.
119 int iavc_handle_intr(iavc_softc_t *);
120 int iavc_load(capi_softc_t *, int, u_int8_t *);
121 int iavc_register(capi_softc_t *, int, int);
122 int iavc_release(capi_softc_t *, int);
123 int iavc_send(capi_softc_t *, struct mbuf *);
125 #ifdef notyet
126 extern void b1isa_setup_irq(struct iavc_softc *sc);
127 #endif