1 1.8 thorpej /* $NetBSD: epevar.h,v 1.8 2022/09/17 19:44:13 thorpej Exp $ */ 2 1.1 joff /*- 3 1.1 joff * Copyright (c) 2004 Jesse Off 4 1.1 joff * All rights reserved 5 1.1 joff * 6 1.1 joff * Redistribution and use in source and binary forms, with or without 7 1.1 joff * modification, are permitted provided that the following conditions 8 1.1 joff * are met: 9 1.1 joff * 1. Redistributions of source code must retain the above copyright 10 1.1 joff * notice, this list of conditions and the following disclaimer. 11 1.1 joff * 2. Redistributions in binary form must reproduce the above copyright 12 1.1 joff * notice, this list of conditions and the following disclaimer in the 13 1.1 joff * documentation and/or other materials provided with the distribution. 14 1.5 snj * 15 1.1 joff * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 16 1.1 joff * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 1.1 joff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 1.1 joff * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 19 1.1 joff * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 1.1 joff * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 1.1 joff * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 1.1 joff * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 1.1 joff * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 1.1 joff * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 1.1 joff * SUCH DAMAGE. 26 1.1 joff * 27 1.1 joff */ 28 1.1 joff 29 1.1 joff #ifndef _EPEVAR_H_ 30 1.1 joff #define _EPEVAR_H_ 31 1.1 joff 32 1.1 joff #define TX_QLEN 16 33 1.1 joff #define RX_QLEN 64 34 1.1 joff 35 1.1 joff struct epe_qmeta { 36 1.1 joff struct mbuf *m; 37 1.1 joff bus_dmamap_t m_dmamap; 38 1.1 joff }; 39 1.1 joff 40 1.1 joff struct epe_softc { 41 1.6 matt device_t sc_dev; 42 1.1 joff bus_space_tag_t sc_iot; 43 1.1 joff bus_space_handle_t sc_ioh; 44 1.1 joff bus_dma_tag_t sc_dmat; 45 1.1 joff int sc_intr; 46 1.7 skrll uint8_t sc_enaddr[ETHER_ADDR_LEN]; 47 1.1 joff struct ethercom sc_ec; 48 1.1 joff mii_data_t sc_mii; 49 1.4 christos void * ctrlpage; 50 1.2 joff bus_addr_t ctrlpage_dsaddr; 51 1.1 joff bus_dmamap_t ctrlpage_dmamap; 52 1.7 skrll uint32_t *TXDQ; 53 1.7 skrll uint32_t TXDQ_avail; 54 1.7 skrll uint32_t *TXDQ_cur; 55 1.7 skrll uint32_t *TXStsQ; 56 1.7 skrll uint32_t *TXStsQ_cur; 57 1.7 skrll uint32_t *RXDQ; 58 1.7 skrll uint32_t *RXStsQ; 59 1.7 skrll uint32_t *RXStsQ_cur; 60 1.1 joff struct epe_qmeta rxq[RX_QLEN]; 61 1.1 joff struct epe_qmeta txq[TX_QLEN]; 62 1.1 joff struct callout epe_tick_ch; 63 1.8 thorpej bool tx_busy; 64 1.1 joff }; 65 1.1 joff 66 1.1 joff #endif /* _EPEVAR_H_ */ 67