Deleted Added
full compact
if_em.h (93914) if_em.h (97785)
1/**************************************************************************
2
3Copyright (c) 2001-2002 Intel Corporation
4All rights reserved.
5
6Redistribution and use in source and binary forms of the Software, with or
7without modification, are permitted provided that the following conditions
8are met:

--- 19 unchanged lines hidden (view full) ---

28SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32SUCH DAMAGE.
33
34***************************************************************************/
35
1/**************************************************************************
2
3Copyright (c) 2001-2002 Intel Corporation
4All rights reserved.
5
6Redistribution and use in source and binary forms of the Software, with or
7without modification, are permitted provided that the following conditions
8are met:

--- 19 unchanged lines hidden (view full) ---

28SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32SUCH DAMAGE.
33
34***************************************************************************/
35
36/*$FreeBSD: head/sys/dev/em/if_em.h 93914 2002-04-06 00:36:53Z pdeuskar $*/
36/*$FreeBSD: head/sys/dev/em/if_em.h 97785 2002-06-03 22:30:51Z pdeuskar $*/
37
38#ifndef _EM_H_DEFINED_
39#define _EM_H_DEFINED_
40
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/mbuf.h>
45#include <sys/protosw.h>
46#include <sys/socket.h>
47#include <sys/malloc.h>
48#include <sys/kernel.h>
37
38#ifndef _EM_H_DEFINED_
39#define _EM_H_DEFINED_
40
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/mbuf.h>
45#include <sys/protosw.h>
46#include <sys/socket.h>
47#include <sys/malloc.h>
48#include <sys/kernel.h>
49#include <sys/sockio.h>
49
50#include <net/if.h>
50
51#include <net/if.h>
52#include <net/if_arp.h>
53#include <net/ethernet.h>
51#include <net/if_dl.h>
52#include <net/if_media.h>
54#include <net/if_dl.h>
55#include <net/if_media.h>
56
53#include <net/bpf.h>
57#include <net/bpf.h>
54#include <net/ethernet.h>
55#include <net/if_arp.h>
56#include <sys/sockio.h>
58#include <net/if_types.h>
59#include <net/if_vlan_var.h>
57
58#include <netinet/in_systm.h>
59#include <netinet/in.h>
60#include <netinet/ip.h>
61#include <netinet/tcp.h>
62#include <netinet/udp.h>
63
64#include <sys/bus.h>
65#include <machine/bus.h>
66#include <sys/rman.h>
67#include <machine/resource.h>
68#include <vm/vm.h>
69#include <vm/pmap.h>
70#include <machine/clock.h>
71#include <pci/pcivar.h>
72#include <pci/pcireg.h>
73#include "opt_bdg.h"
74
60
61#include <netinet/in_systm.h>
62#include <netinet/in.h>
63#include <netinet/ip.h>
64#include <netinet/tcp.h>
65#include <netinet/udp.h>
66
67#include <sys/bus.h>
68#include <machine/bus.h>
69#include <sys/rman.h>
70#include <machine/resource.h>
71#include <vm/vm.h>
72#include <vm/pmap.h>
73#include <machine/clock.h>
74#include <pci/pcivar.h>
75#include <pci/pcireg.h>
76#include "opt_bdg.h"
77
75#include <dev/em/if_em_fxhw.h>
76#include <dev/em/if_em_phy.h>
78#include
77
78/* Tunables */
79#define MAX_TXD 256
80#define MAX_RXD 256
81#define TX_CLEANUP_THRESHOLD MAX_TXD / 8
82#define TIDV 128
83#define RIDV 28
84#define DO_AUTO_NEG 1

--- 13 unchanged lines hidden (view full) ---

98#define EM_ROUNDUP(size, unit) (((size) + (unit) - 1) & ~((unit) - 1))
99#define EM_JUMBO_PBA 0x00000028
100#define EM_DEFAULT_PBA 0x00000030
101
102#define IOCTL_CMD_TYPE u_long
103#define MAX_NUM_MULTICAST_ADDRESSES 128
104#define PCI_ANY_ID (~0U)
105#define ETHER_ALIGN 2
79
80/* Tunables */
81#define MAX_TXD 256
82#define MAX_RXD 256
83#define TX_CLEANUP_THRESHOLD MAX_TXD / 8
84#define TIDV 128
85#define RIDV 28
86#define DO_AUTO_NEG 1

--- 13 unchanged lines hidden (view full) ---

100#define EM_ROUNDUP(size, unit) (((size) + (unit) - 1) & ~((unit) - 1))
101#define EM_JUMBO_PBA 0x00000028
102#define EM_DEFAULT_PBA 0x00000030
103
104#define IOCTL_CMD_TYPE u_long
105#define MAX_NUM_MULTICAST_ADDRESSES 128
106#define PCI_ANY_ID (~0U)
107#define ETHER_ALIGN 2
108#define QTAG_TYPE 0x8100
106
107/* Defines for printing debug information */
108#define DEBUG_INIT 0
109#define DEBUG_IOCTL 0
110#define DEBUG_HW 0
111
112#define INIT_DEBUGOUT(S) if (DEBUG_INIT) printf(S "\n")
113#define INIT_DEBUGOUT1(S, A) if (DEBUG_INIT) printf(S "\n", A)

--- 8 unchanged lines hidden (view full) ---

122
123/* Supported RX Buffer Sizes */
124#define EM_RXBUFFER_2048 2048
125#define EM_RXBUFFER_4096 4096
126#define EM_RXBUFFER_8192 8192
127#define EM_RXBUFFER_16384 16384
128
129#ifdef __alpha__
109
110/* Defines for printing debug information */
111#define DEBUG_INIT 0
112#define DEBUG_IOCTL 0
113#define DEBUG_HW 0
114
115#define INIT_DEBUGOUT(S) if (DEBUG_INIT) printf(S "\n")
116#define INIT_DEBUGOUT1(S, A) if (DEBUG_INIT) printf(S "\n", A)

--- 8 unchanged lines hidden (view full) ---

125
126/* Supported RX Buffer Sizes */
127#define EM_RXBUFFER_2048 2048
128#define EM_RXBUFFER_4096 4096
129#define EM_RXBUFFER_8192 8192
130#define EM_RXBUFFER_16384 16384
131
132#ifdef __alpha__
130#undef vtophys
131#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)(va))
133 #undef vtophys
134 #define vtophys(va) alpha_XXX_dmamap((vm_offset_t)(va))
132#endif /* __alpha__ */
133
134/* ******************************************************************************
135 * vendor_info_array
136 *
137 * This array contains the list of Subvendor/Subdevice IDs on which the driver
138 * should load.
139 *
140 * ******************************************************************************/
141typedef struct _em_vendor_info_t
142{
135#endif /* __alpha__ */
136
137/* ******************************************************************************
138 * vendor_info_array
139 *
140 * This array contains the list of Subvendor/Subdevice IDs on which the driver
141 * should load.
142 *
143 * ******************************************************************************/
144typedef struct _em_vendor_info_t
145{
143 unsigned int vendor_id;
144 unsigned int device_id;
145 unsigned int subvendor_id;
146 unsigned int subdevice_id;
147 unsigned int index;
146 unsigned int vendor_id;
147 unsigned int device_id;
148 unsigned int subvendor_id;
149 unsigned int subdevice_id;
150 unsigned int index;
148} em_vendor_info_t;
149
150
151struct em_tx_buffer {
151} em_vendor_info_t;
152
153
154struct em_tx_buffer {
152 STAILQ_ENTRY(em_tx_buffer) em_tx_entry;
153 struct mbuf *m_head;
154 u_int32_t num_tx_desc_used;
155 STAILQ_ENTRY(em_tx_buffer) em_tx_entry;
156 struct mbuf *m_head;
157 u_int32_t num_tx_desc_used;
155};
156
157
158/* ******************************************************************************
159 * This structure stores information about the 2k aligned receive buffer
160 * into which the E1000 DMA's frames.
161 * ******************************************************************************/
162struct em_rx_buffer {
158};
159
160
161/* ******************************************************************************
162 * This structure stores information about the 2k aligned receive buffer
163 * into which the E1000 DMA's frames.
164 * ******************************************************************************/
165struct em_rx_buffer {
163 STAILQ_ENTRY(em_rx_buffer) em_rx_entry;
164 struct mbuf *m_head;
165 u_int64_t buffer_addr;
166 STAILQ_ENTRY(em_rx_buffer) em_rx_entry;
167 struct mbuf *m_head;
168 u_int64_t buffer_addr;
166};
167
168typedef enum _XSUM_CONTEXT_T {
169};
170
171typedef enum _XSUM_CONTEXT_T {
169 OFFLOAD_NONE,
170 OFFLOAD_TCP_IP,
171 OFFLOAD_UDP_IP
172 OFFLOAD_NONE,
173 OFFLOAD_TCP_IP,
174 OFFLOAD_UDP_IP
172} XSUM_CONTEXT_T;
173
174/* Our adapter structure */
175struct adapter {
175} XSUM_CONTEXT_T;
176
177/* Our adapter structure */
178struct adapter {
176 struct arpcom interface_data;
177 struct adapter *next;
178 struct adapter *prev;
179 struct em_shared_adapter shared;
179 struct arpcom interface_data;
180 struct adapter *next;
181 struct adapter *prev;
182 struct em_hw hw;
180
183
181 /* FreeBSD operating-system-specific structures */
182 struct em_osdep osdep;
183 struct device *dev;
184 struct resource *res_memory;
185 struct resource *res_interrupt;
186 void *int_handler_tag;
187 struct ifmedia media;
188 struct callout_handle timer_handle;
189 u_int8_t unit;
184 /* FreeBSD operating-system-specific structures */
185 struct em_osdep osdep;
186 struct device *dev;
187 struct resource *res_memory;
188 struct resource *res_interrupt;
189 void *int_handler_tag;
190 struct ifmedia media;
191 struct callout_handle timer_handle;
192 u_int8_t unit;
190
193
191 /* Info about the board itself */
192 u_int32_t part_num;
193 u_int8_t link_active;
194 u_int16_t link_speed;
195 u_int16_t link_duplex;
196 u_int32_t tx_int_delay;
197 u_int32_t rx_int_delay;
194 /* Info about the board itself */
195 u_int32_t part_num;
196 u_int8_t link_active;
197 u_int16_t link_speed;
198 u_int16_t link_duplex;
199 u_int32_t tx_int_delay;
200 u_int32_t rx_int_delay;
198
201
199 u_int8_t rx_checksum;
200 XSUM_CONTEXT_T active_checksum_context;
202 u_int8_t rx_checksum;
203 XSUM_CONTEXT_T active_checksum_context;
201
204
202 /* Transmit definitions */
203 struct em_tx_desc *first_tx_desc;
204 struct em_tx_desc *last_tx_desc;
205 struct em_tx_desc *next_avail_tx_desc;
206 struct em_tx_desc *oldest_used_tx_desc;
207 struct em_tx_desc *tx_desc_base;
208 volatile u_int16_t num_tx_desc_avail;
209 u_int16_t num_tx_desc;
210 u_int32_t txd_cmd;
211 struct em_tx_buffer *tx_buffer_area;
212 STAILQ_HEAD(__em_tx_buffer_free, em_tx_buffer) free_tx_buffer_list;
213 STAILQ_HEAD(__em_tx_buffer_used, em_tx_buffer) used_tx_buffer_list;
205 /* Transmit definitions */
206 struct em_tx_desc *first_tx_desc;
207 struct em_tx_desc *last_tx_desc;
208 struct em_tx_desc *next_avail_tx_desc;
209 struct em_tx_desc *oldest_used_tx_desc;
210 struct em_tx_desc *tx_desc_base;
211 volatile u_int16_t num_tx_desc_avail;
212 u_int16_t num_tx_desc;
213 u_int32_t txd_cmd;
214 struct em_tx_buffer *tx_buffer_area;
215 STAILQ_HEAD(__em_tx_buffer_free, em_tx_buffer) free_tx_buffer_list;
216 STAILQ_HEAD(__em_tx_buffer_used, em_tx_buffer) used_tx_buffer_list;
214
217
215 /* Receive definitions */
216 struct em_rx_desc *first_rx_desc;
217 struct em_rx_desc *last_rx_desc;
218 struct em_rx_desc *next_rx_desc_to_check;
219 struct em_rx_desc *rx_desc_base;
220 u_int16_t num_rx_desc;
221 u_int32_t rx_buffer_len;
222 struct em_rx_buffer *rx_buffer_area;
223 STAILQ_HEAD(__em_rx_buffer, em_rx_buffer) rx_buffer_list;
218 /* Receive definitions */
219 struct em_rx_desc *first_rx_desc;
220 struct em_rx_desc *last_rx_desc;
221 struct em_rx_desc *next_rx_desc_to_check;
222 struct em_rx_desc *rx_desc_base;
223 u_int16_t num_rx_desc;
224 u_int32_t rx_buffer_len;
225 struct em_rx_buffer *rx_buffer_area;
226 STAILQ_HEAD(__em_rx_buffer, em_rx_buffer) rx_buffer_list;
224
227
225 /* Jumbo frame */
226 struct mbuf *fmp;
227 struct mbuf *lmp;
228 /* Jumbo frame */
229 struct mbuf *fmp;
230 struct mbuf *lmp;
228
229
231
232
230 /* Misc stats maintained by the driver */
231 unsigned long dropped_pkts;
232 unsigned long mbuf_alloc_failed;
233 unsigned long mbuf_cluster_failed;
234 unsigned long xmit_pullup;
235 unsigned long no_tx_desc_avail;
236 unsigned long no_tx_buffer_avail1;
237 unsigned long no_tx_buffer_avail2;
238#ifdef DBG_STATS
239 unsigned long no_pkts_avail;
240 unsigned long clean_tx_interrupts;
233 /* Misc stats maintained by the driver */
234 unsigned long dropped_pkts;
235 unsigned long mbuf_alloc_failed;
236 unsigned long mbuf_cluster_failed;
237 unsigned long xmit_pullup;
238 unsigned long no_tx_desc_avail;
239 unsigned long no_tx_buffer_avail1;
240 unsigned long no_tx_buffer_avail2;
241#ifdef DBG_STATS
242 unsigned long no_pkts_avail;
243 unsigned long clean_tx_interrupts;
241
242#endif
243
244
245#endif
246
244 struct em_shared_stats stats;
247 struct em_hw_stats stats;
245};
246
247#endif /* _EM_H_DEFINED_ */
248};
249
250#endif /* _EM_H_DEFINED_ */