1*c0967baeSdamien /* $OpenBSD: if_nfevar.h,v 1.7 2006/02/04 21:48:34 damien Exp $ */ 2*c0967baeSdamien 3*c0967baeSdamien /*- 4fbc14a03Sjsg * Copyright (c) 2005 Jonathan Gray <jsg@openbsd.org> 5fbc14a03Sjsg * 6fbc14a03Sjsg * Permission to use, copy, modify, and distribute this software for any 7fbc14a03Sjsg * purpose with or without fee is hereby granted, provided that the above 8fbc14a03Sjsg * copyright notice and this permission notice appear in all copies. 9fbc14a03Sjsg * 10fbc14a03Sjsg * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11fbc14a03Sjsg * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12fbc14a03Sjsg * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13fbc14a03Sjsg * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14fbc14a03Sjsg * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15fbc14a03Sjsg * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16fbc14a03Sjsg * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17fbc14a03Sjsg */ 18fbc14a03Sjsg 19fbc14a03Sjsg #define NFE_IFQ_MAXLEN 64 20fbc14a03Sjsg 21fbc14a03Sjsg struct nfe_tx_data { 22fbc14a03Sjsg bus_dmamap_t map; 23ae0a03e3Sdamien bus_dmamap_t active; 24fbc14a03Sjsg struct mbuf *m; 25fbc14a03Sjsg }; 26fbc14a03Sjsg 27fbc14a03Sjsg struct nfe_tx_ring { 28fbc14a03Sjsg bus_dmamap_t map; 29fbc14a03Sjsg bus_dma_segment_t seg; 30fbc14a03Sjsg bus_addr_t physaddr; 31ae0a03e3Sdamien struct nfe_desc32 *desc32; 32ae0a03e3Sdamien struct nfe_desc64 *desc64; 33519bb2aaSjsg struct nfe_tx_data data[NFE_TX_RING_COUNT]; 34fbc14a03Sjsg int queued; 35fbc14a03Sjsg int cur; 36fbc14a03Sjsg int next; 37fbc14a03Sjsg }; 38fbc14a03Sjsg 39fbc14a03Sjsg struct nfe_rx_data { 40fbc14a03Sjsg bus_dmamap_t map; 41fbc14a03Sjsg struct mbuf *m; 42fbc14a03Sjsg }; 43fbc14a03Sjsg 44fbc14a03Sjsg struct nfe_rx_ring { 45fbc14a03Sjsg bus_dmamap_t map; 46fbc14a03Sjsg bus_dma_segment_t seg; 47fbc14a03Sjsg bus_addr_t physaddr; 48ae0a03e3Sdamien struct nfe_desc32 *desc32; 49ae0a03e3Sdamien struct nfe_desc64 *desc64; 50519bb2aaSjsg struct nfe_rx_data data[NFE_RX_RING_COUNT]; 51fbc14a03Sjsg int cur; 52fbc14a03Sjsg int next; 53fbc14a03Sjsg }; 54fbc14a03Sjsg 55fbc14a03Sjsg struct nfe_softc { 56fbc14a03Sjsg struct device sc_dev; 57fbc14a03Sjsg struct arpcom sc_arpcom; 58ae0a03e3Sdamien bus_space_handle_t sc_memh; 59ae0a03e3Sdamien bus_space_tag_t sc_memt; 60fbc14a03Sjsg void *sc_ih; 61fbc14a03Sjsg bus_dma_tag_t sc_dmat; 62fbc14a03Sjsg struct mii_data sc_mii; 63*c0967baeSdamien struct timeout sc_tick_ch; 64cd7f2204Sdamien void *sc_powerhook; 65fbc14a03Sjsg 6618830ae9Sdamien int sc_if_flags; 67fbc14a03Sjsg u_int sc_flags; 68fbc14a03Sjsg #define NFE_JUMBO_SUP 0x01 69fbc14a03Sjsg #define NFE_40BIT_ADDR 0x02 70ae0a03e3Sdamien #define NFE_HW_CSUM 0x04 71fbc14a03Sjsg 72ae0a03e3Sdamien uint8_t phyaddr; 73fbc14a03Sjsg 74fbc14a03Sjsg struct nfe_tx_ring txq; 75fbc14a03Sjsg struct nfe_rx_ring rxq; 76fbc14a03Sjsg }; 77