1 /* $NetBSD: iavcvar.h,v 1.3 2005/12/11 12:21:27 christos Exp $ */
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
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
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>
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
{
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
;
57 bus_dma_segment_t txseg
;
58 bus_dma_segment_t rxseg
;
80 struct ifqueue sc_txq
;
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
);
102 // Interrupt handler, called by the bus specific interrupt routine
103 // in iavc_<bustype>.c module.
106 // CAPI callback. Resets device and loads firmware.
109 // CAPI callback. Registers an application id.
112 // CAPI callback. Releases an application id.
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
*);
126 extern void b1isa_setup_irq(struct iavc_softc
*sc
);