Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / dev / pci / if_nfevar.h
blob100b955ed834b1d30ef5b7e6618dfacd6e77fffd
1 /* $NetBSD: if_nfevar.h,v 1.8 2008/04/17 19:12:26 christos Exp $ */
2 /* $OpenBSD: if_nfevar.h,v 1.13 2007/12/05 08:30:33 jsg Exp $ */
4 /*-
5 * Copyright (c) 2005 Jonathan Gray <jsg@openbsd.org>
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #define NFE_IFQ_MAXLEN 64
22 struct nfe_tx_data {
23 bus_dmamap_t map;
24 bus_dmamap_t active;
25 struct mbuf *m;
28 struct nfe_tx_ring {
29 bus_dmamap_t map;
30 bus_dma_segment_t seg;
31 bus_addr_t physaddr;
32 struct nfe_desc32 *desc32;
33 struct nfe_desc64 *desc64;
34 struct nfe_tx_data data[NFE_TX_RING_COUNT];
35 int queued;
36 int cur;
37 int next;
40 struct nfe_jbuf {
41 void *buf;
42 bus_addr_t physaddr;
43 SLIST_ENTRY(nfe_jbuf) jnext;
46 struct nfe_rx_data {
47 bus_dmamap_t map;
48 struct mbuf *m;
51 struct nfe_rx_ring {
52 bus_dmamap_t map;
53 bus_dma_segment_t seg;
54 bus_dmamap_t jmap;
55 bus_dma_segment_t jseg;
56 bus_addr_t physaddr;
57 struct nfe_desc32 *desc32;
58 struct nfe_desc64 *desc64;
59 void *jpool;
60 struct nfe_rx_data data[NFE_RX_RING_COUNT];
61 struct nfe_jbuf jbuf[NFE_JPOOL_COUNT];
62 int jbufmap[NFE_RX_RING_COUNT];
63 SLIST_HEAD(, nfe_jbuf) jfreelist;
64 int bufsz;
65 int cur;
66 int next;
67 kmutex_t mtx;
70 struct nfe_softc {
71 device_t sc_dev;
72 struct ethercom sc_ethercom;
73 uint8_t sc_enaddr[ETHER_ADDR_LEN];
74 bus_space_handle_t sc_memh;
75 bus_space_tag_t sc_memt;
76 void *sc_ih;
77 bus_dma_tag_t sc_dmat;
78 struct mii_data sc_mii;
79 struct callout sc_tick_ch;
81 int sc_if_flags;
82 u_int sc_flags;
83 #define NFE_JUMBO_SUP 0x01
84 #define NFE_40BIT_ADDR 0x02
85 #define NFE_HW_CSUM 0x04
86 #define NFE_HW_VLAN 0x08
87 #define NFE_USE_JUMBO 0x10
88 #define NFE_CORRECT_MACADDR 0x20
89 #define NFE_PWR_MGMT 0x40
91 uint32_t rxtxctl;
92 uint8_t mii_phyaddr;
94 struct nfe_tx_ring txq;
95 struct nfe_rx_ring rxq;