xref: /netbsd-src/sys/arch/arm/ep93xx/epevar.h (revision 40db1b6e9f2535ce271275309d2109113e630db1)
1*40db1b6eSthorpej /*      $NetBSD: epevar.h,v 1.8 2022/09/17 19:44:13 thorpej Exp $        */
24eeab775Sjoff /*-
34eeab775Sjoff  * Copyright (c) 2004 Jesse Off
44eeab775Sjoff  * All rights reserved
54eeab775Sjoff  *
64eeab775Sjoff  * Redistribution and use in source and binary forms, with or without
74eeab775Sjoff  * modification, are permitted provided that the following conditions
84eeab775Sjoff  * are met:
94eeab775Sjoff  * 1. Redistributions of source code must retain the above copyright
104eeab775Sjoff  *    notice, this list of conditions and the following disclaimer.
114eeab775Sjoff  * 2. Redistributions in binary form must reproduce the above copyright
124eeab775Sjoff  *    notice, this list of conditions and the following disclaimer in the
134eeab775Sjoff  *    documentation and/or other materials provided with the distribution.
147e82f68cSsnj  *
154eeab775Sjoff  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
164eeab775Sjoff  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
174eeab775Sjoff  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
184eeab775Sjoff  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
194eeab775Sjoff  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
204eeab775Sjoff  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
214eeab775Sjoff  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
224eeab775Sjoff  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
234eeab775Sjoff  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
244eeab775Sjoff  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
254eeab775Sjoff  * SUCH DAMAGE.
264eeab775Sjoff  *
274eeab775Sjoff  */
284eeab775Sjoff 
294eeab775Sjoff #ifndef _EPEVAR_H_
304eeab775Sjoff #define _EPEVAR_H_
314eeab775Sjoff 
324eeab775Sjoff #define TX_QLEN	16
334eeab775Sjoff #define RX_QLEN 64
344eeab775Sjoff 
354eeab775Sjoff struct epe_qmeta {
364eeab775Sjoff 	struct mbuf 	*m;
374eeab775Sjoff 	bus_dmamap_t	m_dmamap;
384eeab775Sjoff };
394eeab775Sjoff 
404eeab775Sjoff struct epe_softc {
410bc32000Smatt 	device_t		sc_dev;
424eeab775Sjoff 	bus_space_tag_t		sc_iot;
434eeab775Sjoff 	bus_space_handle_t	sc_ioh;
444eeab775Sjoff 	bus_dma_tag_t		sc_dmat;
454eeab775Sjoff 	int			sc_intr;
4608a4aba7Sskrll 	uint8_t			sc_enaddr[ETHER_ADDR_LEN];
474eeab775Sjoff 	struct ethercom		sc_ec;
484eeab775Sjoff 	mii_data_t		sc_mii;
4953524e44Schristos 	void *			ctrlpage;
50944e317aSjoff 	bus_addr_t		ctrlpage_dsaddr;
514eeab775Sjoff 	bus_dmamap_t		ctrlpage_dmamap;
5208a4aba7Sskrll 	uint32_t		*TXDQ;
5308a4aba7Sskrll 	uint32_t		TXDQ_avail;
5408a4aba7Sskrll 	uint32_t		*TXDQ_cur;
5508a4aba7Sskrll 	uint32_t		*TXStsQ;
5608a4aba7Sskrll 	uint32_t		*TXStsQ_cur;
5708a4aba7Sskrll 	uint32_t		*RXDQ;
5808a4aba7Sskrll 	uint32_t		*RXStsQ;
5908a4aba7Sskrll 	uint32_t		*RXStsQ_cur;
604eeab775Sjoff 	struct epe_qmeta	rxq[RX_QLEN];
614eeab775Sjoff 	struct epe_qmeta	txq[TX_QLEN];
624eeab775Sjoff 	struct callout		epe_tick_ch;
63*40db1b6eSthorpej 	bool			tx_busy;
644eeab775Sjoff };
654eeab775Sjoff 
664eeab775Sjoff #endif /* _EPEVAR_H_ */
67