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