xref: /netbsd/sys/arch/dreamcast/dev/maple/maplevar.h (revision bf9ec67e)
1 /* $NetBSD: maplevar.h,v 1.4 2001/05/26 19:04:40 marcus Exp $ */
2 /*-
3  * Copyright (c) 2001 Marcus Comstedt
4  * All rights reserved.
5  *
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.
14  * 3. All advertising materials mentioning features or use of this software
15  *    must display the following acknowledgement:
16  *	This product includes software developed by Marcus Comstedt.
17  * 4. Neither the name of The NetBSD Foundation nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #include <machine/bus.h>
35 
36 struct maple_softc {
37 	struct device sc_dev;
38 
39 	struct callout maple_callout_ch;
40 	int maple_commands_pending;
41 
42 	int sc_port_units[MAPLE_PORTS];
43 	int sc_port_units_open[MAPLE_PORTS];
44 
45 	struct maple_unit sc_unit[MAPLE_PORTS][MAPLE_SUBUNITS];
46 
47 	u_int32_t *sc_txbuf;	/* start of allocated transmit buffer */
48 	u_int32_t *sc_txpos;	/* current write position in tx buffer */
49 	u_int32_t *sc_txlink;   /* start of last written frame */
50 
51 	/* start of each receive buffer */
52 	u_int32_t *sc_rxbuf[MAPLE_PORTS][MAPLE_SUBUNITS];
53 
54 	u_int32_t sc_txbuf_phys;	/* 29-bit physical address */
55   	u_int32_t sc_rxbuf_phys[MAPLE_PORTS][MAPLE_SUBUNITS];
56 };
57 
58