1/*- 2 * Copyright (c) 2008 Nathan Whitehorn 3 * Copyright (c) 2003 Peter Grehan 4 * All rights reserved 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/dev/bm/if_bmvar.h 226995 2011-11-01 16:13:59Z marius $ |
28 */ 29 30/* 31 * Number of transmit/receive DBDMA descriptors. 32 * XXX allow override with a tuneable ? 33 */ 34#define BM_MAX_DMA_COMMANDS 256 35#define BM_NTXSEGS 16 --- 5 unchanged lines hidden (view full) --- 41 * Mutex macros 42 */ 43#define BM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) 44#define BM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) 45 46/* 47 * software state for transmit job mbufs (may be elements of mbuf chains) 48 */ |
49struct bm_txsoft { 50 struct mbuf *txs_mbuf; /* head of our mbuf chain */ 51 bus_dmamap_t txs_dmamap; /* our DMA map */ 52 int txs_firstdesc; /* first descriptor in packet */ 53 int txs_lastdesc; /* last descriptor in packet */ 54 int txs_stopdesc; /* the location of the closing STOP */ 55 56 int txs_ndescs; /* number of descriptors */ --- 8 unchanged lines hidden (view full) --- 65struct bm_rxsoft { 66 struct mbuf *rxs_mbuf; /* head of our mbuf chain */ 67 bus_dmamap_t rxs_dmamap; /* our DMA map */ 68 69 int dbdma_slot; 70 bus_dma_segment_t segment; 71}; 72 |
73struct bm_softc { 74 struct ifnet *sc_ifp; 75 struct mtx sc_mtx; 76 u_char sc_enaddr[ETHER_ADDR_LEN]; 77 78 int sc_streaming; 79 int sc_ifpflags; 80 int sc_duplex; --- 25 unchanged lines hidden (view full) --- 106 struct bm_txsq sc_txdirtyq; 107 108 bus_dma_tag_t sc_rdma_tag; 109 struct bm_rxsoft sc_rxsoft[BM_MAX_TX_PACKETS]; 110 int next_rxdma_slot, rxdma_loop_slot; 111 112 dbdma_channel_t *sc_txdma, *sc_rxdma; 113}; |