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