xref: /netbsd-src/sys/arch/arm/at91/at91emacvar.h (revision 274254cdae52594c1aa480a736aef78313d15c9c)
1 /*	$Id: at91emacvar.h,v 1.2 2008/07/03 01:15:38 matt Exp $	*/
2 /*      $NetBSD: at91emacvar.h,v 1.2 2008/07/03 01:15:38 matt Exp $	*/
3 /*-
4  * Copyright (c) 2007 Embedtronics Oy
5  * All rights reserved
6  *
7  * Based on arch/arm/ep93xx/epevar.h
8  *
9  * Copyright (c) 2004 Jesse Off
10  * All rights reserved
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  * 3. All advertising materials mentioning features or use of this software
21  *    must display the following acknowledgement:
22  *      This product includes software developed by the NetBSD
23  *      Foundation, Inc. and its contributors.
24  * 4. Neither the name of The NetBSD Foundation nor the names of its
25  *    contributors may be used to endorse or promote products derived
26  *    from this software without specific prior written permission.
27  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37  * SUCH DAMAGE.
38  *
39  */
40 
41 #ifndef _AT91EMACVAR_H_
42 #define _AT91EMACVAR_H_
43 
44 #define RX_QLEN 64
45 #define	TX_QLEN	2		/* I'm very sorry but that's where we can get */
46 
47 struct emac_qmeta {
48 	struct mbuf 	*m;
49 	bus_dmamap_t	m_dmamap;
50 };
51 
52 struct emac_softc {
53 	device_t		sc_dev;
54 	bus_space_tag_t		sc_iot;
55 	bus_space_handle_t	sc_ioh;
56 	bus_dma_tag_t		sc_dmat;
57 	int			sc_pid;
58 	uint8_t			sc_enaddr[ETHER_ADDR_LEN];
59 	struct ethercom		sc_ec;
60 	mii_data_t		sc_mii;
61 	void			*rbqpage;
62 	unsigned		rbqlen;
63 	bus_addr_t		rbqpage_dsaddr;
64 	bus_dmamap_t		rbqpage_dmamap;
65 
66 	volatile struct eth_rdsc *RDSC;
67 	int			rxqi;
68 	struct emac_qmeta	rxq[RX_QLEN];
69 	int			txqi, txqc;
70 	struct emac_qmeta	txq[TX_QLEN];
71 	callout_t		emac_tick_ch;
72 };
73 
74 #endif /* _AT91EMACVAR_H_ */
75