1 /* $OpenBSD: if_nfevar.h,v 1.11 2006/02/19 13:57:02 damien Exp $ */
2 /* $DragonFly: src/sys/dev/netif/nfe/if_nfevar.h,v 1.13 2008/07/12 11:44:17 sephe Exp $ */
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.
29 struct nfe_desc32
*desc32
;
30 struct nfe_desc64
*desc64
;
32 bus_dma_tag_t data_tag
;
33 struct nfe_tx_data
*data
;
43 struct nfe_rx_ring
*ring
;
48 SLIST_ENTRY(nfe_jbuf
) jnext
;
60 struct nfe_desc32
*desc32
;
61 struct nfe_desc64
*desc64
;
66 struct nfe_jbuf
*jbuf
;
67 SLIST_HEAD(, nfe_jbuf
) jfreelist
;
69 bus_dma_tag_t data_tag
;
70 bus_dmamap_t data_tmpmap
;
71 struct nfe_rx_data
*data
;
81 struct resource
*sc_mem_res
;
82 bus_space_handle_t sc_memh
;
83 bus_space_tag_t sc_memt
;
86 struct resource
*sc_irq_res
;
90 struct callout sc_tick_ch
;
93 uint32_t sc_caps
; /* hardware capabilities */
94 #define NFE_JUMBO_SUP 0x01
95 #define NFE_40BIT_ADDR 0x02
96 #define NFE_HW_CSUM 0x04
97 #define NFE_HW_VLAN 0x08
98 #define NFE_FIX_EADDR 0x10
99 #define NFE_NO_PWRCTL 0x20
102 #define NFE_F_USE_JUMBO 0x01 /* use jumbo frame */
103 #define NFE_F_DYN_IM 0x02 /* enable dynamic interrupt moderation */
104 #define NFE_F_IRQ_TIMER 0x04 /* hardware timer irq is used */
106 uint32_t rxtxctl_desc
;
110 struct nfe_tx_ring txq
;
111 struct nfe_rx_ring rxq
;
113 uint32_t sc_irq_enable
;
116 int sc_rx_ring_count
;
117 int sc_tx_ring_count
;
119 struct sysctl_ctx_list sc_sysctl_ctx
;
120 struct sysctl_oid
*sc_sysctl_tree
;
122 struct lwkt_serialize sc_jbuf_serializer
;
125 #define NFE_IRQ_ENABLE(sc) \
126 ((sc)->sc_imtime == 0 ? NFE_IRQ_NOIMTIMER : \
127 (((sc)->sc_flags & NFE_F_DYN_IM) ? NFE_IRQ_NOIMTIMER: NFE_IRQ_IMTIMER))