Deleted Added
full compact
if_mxge_var.h (172162) if_mxge_var.h (175365)
1/*******************************************************************************
2
3Copyright (c) 2006-2007, Myricom Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

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

20LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
1/*******************************************************************************
2
3Copyright (c) 2006-2007, Myricom Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

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

20LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
28$FreeBSD: head/sys/dev/mxge/if_mxge_var.h 172162 2007-09-13 21:29:02Z gallatin $
28$FreeBSD: head/sys/dev/mxge/if_mxge_var.h 175365 2008-01-15 20:34:49Z gallatin $
29
30***************************************************************************/
31
32#define MXGE_ETH_STOPPED 0
33#define MXGE_ETH_STOPPING 1
34#define MXGE_ETH_STARTING 2
35#define MXGE_ETH_RUNNING 3
36#define MXGE_ETH_OPEN_FAILED 4

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

80 struct mxge_rx_buffer_state *info;
81 bus_dma_tag_t dmat;
82 bus_dmamap_t extra_map;
83 int cnt;
84 int nbufs;
85 int cl_size;
86 int alloc_fail;
87 int mask; /* number of rx slots -1 */
29
30***************************************************************************/
31
32#define MXGE_ETH_STOPPED 0
33#define MXGE_ETH_STOPPING 1
34#define MXGE_ETH_STARTING 2
35#define MXGE_ETH_RUNNING 3
36#define MXGE_ETH_OPEN_FAILED 4

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

80 struct mxge_rx_buffer_state *info;
81 bus_dma_tag_t dmat;
82 bus_dmamap_t extra_map;
83 int cnt;
84 int nbufs;
85 int cl_size;
86 int alloc_fail;
87 int mask; /* number of rx slots -1 */
88} mxge_rx_buf_t;
88} mxge_rx_ring_t;
89
90typedef struct
91{
89
90typedef struct
91{
92 struct mtx mtx;
92 volatile mcp_kreq_ether_send_t *lanai; /* lanai ptr for sendq */
93 mcp_kreq_ether_send_t *req_list; /* host shadow of sendq */
94 char *req_bytes;
95 bus_dma_segment_t *seg_list;
96 struct mxge_tx_buffer_state *info;
97 bus_dma_tag_t dmat;
98 int req; /* transmits submitted */
99 int mask; /* number of transmit slots -1 */
100 int done; /* transmits completed */
101 int pkt_done; /* packets completed */
93 volatile mcp_kreq_ether_send_t *lanai; /* lanai ptr for sendq */
94 mcp_kreq_ether_send_t *req_list; /* host shadow of sendq */
95 char *req_bytes;
96 bus_dma_segment_t *seg_list;
97 struct mxge_tx_buffer_state *info;
98 bus_dma_tag_t dmat;
99 int req; /* transmits submitted */
100 int mask; /* number of transmit slots -1 */
101 int done; /* transmits completed */
102 int pkt_done; /* packets completed */
102 int boundary; /* boundary transmits cannot cross*/
103 int max_desc; /* max descriptors per xmit */
104 int stall; /* #times hw queue exhausted */
105 int wake; /* #times irq re-enabled xmit */
106 int watchdog_req; /* cache of req */
107 int watchdog_done; /* cache of done */
108 int watchdog_rx_pause; /* cache of pause rq recvd */
103 int max_desc; /* max descriptors per xmit */
104 int stall; /* #times hw queue exhausted */
105 int wake; /* #times irq re-enabled xmit */
106 int watchdog_req; /* cache of req */
107 int watchdog_done; /* cache of done */
108 int watchdog_rx_pause; /* cache of pause rq recvd */
109} mxge_tx_buf_t;
109 int defrag;
110 char mtx_name[16];
111} mxge_tx_ring_t;
110
111struct lro_entry;
112struct lro_entry
113{
114 SLIST_ENTRY(lro_entry) next;
115 struct mbuf *m_head;
116 struct mbuf *m_tail;
117 int timestamp;

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

128 uint16_t source_port;
129 uint16_t dest_port;
130 uint16_t append_cnt;
131 uint16_t mss;
132
133};
134SLIST_HEAD(lro_head, lro_entry);
135
112
113struct lro_entry;
114struct lro_entry
115{
116 SLIST_ENTRY(lro_entry) next;
117 struct mbuf *m_head;
118 struct mbuf *m_tail;
119 int timestamp;

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

130 uint16_t source_port;
131 uint16_t dest_port;
132 uint16_t append_cnt;
133 uint16_t mss;
134
135};
136SLIST_HEAD(lro_head, lro_entry);
137
136typedef struct {
137 struct ifnet* ifp;
138 struct mtx tx_mtx;
139 int csum_flag; /* rx_csums? */
140 mxge_tx_buf_t tx; /* transmit ring */
141 mxge_rx_buf_t rx_small;
142 mxge_rx_buf_t rx_big;
138struct mxge_softc;
139typedef struct mxge_softc mxge_softc_t;
140
141struct mxge_slice_state {
142 mxge_softc_t *sc;
143 mxge_tx_ring_t tx; /* transmit ring */
144 mxge_rx_ring_t rx_small;
145 mxge_rx_ring_t rx_big;
143 mxge_rx_done_t rx_done;
144 mcp_irq_data_t *fw_stats;
146 mxge_rx_done_t rx_done;
147 mcp_irq_data_t *fw_stats;
145 bus_dma_tag_t parent_dmat;
146 volatile uint8_t *sram;
148 volatile uint32_t *irq_claim;
149 u_long ipackets;
147 struct lro_head lro_active;
148 struct lro_head lro_free;
149 int lro_queued;
150 int lro_flushed;
151 int lro_bad_csum;
150 struct lro_head lro_active;
151 struct lro_head lro_free;
152 int lro_queued;
153 int lro_flushed;
154 int lro_bad_csum;
155 mxge_dma_t fw_stats_dma;
156 struct sysctl_oid *sysctl_tree;
157 struct sysctl_ctx_list sysctl_ctx;
158 char scratch[256];
159};
160
161struct mxge_softc {
162 struct ifnet* ifp;
163 struct mxge_slice_state *ss;
164 int csum_flag; /* rx_csums? */
165 int tx_boundary; /* boundary transmits cannot cross*/
152 int lro_cnt;
166 int lro_cnt;
167 bus_dma_tag_t parent_dmat;
168 volatile uint8_t *sram;
153 int sram_size;
154 volatile uint32_t *irq_deassert;
169 int sram_size;
170 volatile uint32_t *irq_deassert;
155 volatile uint32_t *irq_claim;
156 mcp_cmd_response_t *cmd;
157 mxge_dma_t cmd_dma;
158 mxge_dma_t zeropad_dma;
171 mcp_cmd_response_t *cmd;
172 mxge_dma_t cmd_dma;
173 mxge_dma_t zeropad_dma;
159 mxge_dma_t fw_stats_dma;
160 struct pci_dev *pdev;
161 int msi_enabled;
162 int link_state;
163 unsigned int rdma_tags_available;
164 int intr_coal_delay;
165 volatile uint32_t *intr_coal_delay_ptr;
166 int wc;
167 struct mtx cmd_mtx;
168 struct mtx driver_mtx;
169 int wake_queue;
170 int stop_queue;
171 int down_cnt;
172 int watchdog_resets;
174 struct pci_dev *pdev;
175 int msi_enabled;
176 int link_state;
177 unsigned int rdma_tags_available;
178 int intr_coal_delay;
179 volatile uint32_t *intr_coal_delay_ptr;
180 int wc;
181 struct mtx cmd_mtx;
182 struct mtx driver_mtx;
183 int wake_queue;
184 int stop_queue;
185 int down_cnt;
186 int watchdog_resets;
173 int tx_defragged;
187 int watchdog_countdown;
174 int pause;
175 struct resource *mem_res;
176 struct resource *irq_res;
188 int pause;
189 struct resource *mem_res;
190 struct resource *irq_res;
191 struct resource **msix_irq_res;
192 struct resource *msix_table_res;
193 struct resource *msix_pba_res;
177 void *ih;
194 void *ih;
195 void **msix_ih;
178 char *fw_name;
179 char eeprom_strings[MXGE_EEPROM_STRINGS_SIZE];
180 char fw_version[128];
181 int fw_ver_major;
182 int fw_ver_minor;
183 int fw_ver_tiny;
184 int adopted_rx_filter_bug;
185 device_t dev;
186 struct ifmedia media;
187 int read_dma;
188 int write_dma;
189 int read_write_dma;
190 int fw_multicast_support;
191 int link_width;
192 int max_mtu;
193 int tx_defrag;
194 int media_flags;
195 int need_media_probe;
196 char *fw_name;
197 char eeprom_strings[MXGE_EEPROM_STRINGS_SIZE];
198 char fw_version[128];
199 int fw_ver_major;
200 int fw_ver_minor;
201 int fw_ver_tiny;
202 int adopted_rx_filter_bug;
203 device_t dev;
204 struct ifmedia media;
205 int read_dma;
206 int write_dma;
207 int read_write_dma;
208 int fw_multicast_support;
209 int link_width;
210 int max_mtu;
211 int tx_defrag;
212 int media_flags;
213 int need_media_probe;
214 int num_slices;
215 int rx_ring_size;
196 mxge_dma_t dmabench_dma;
197 struct callout co_hdl;
216 mxge_dma_t dmabench_dma;
217 struct callout co_hdl;
218 struct sysctl_oid *slice_sysctl_tree;
219 struct sysctl_ctx_list slice_sysctl_ctx;
198 char *mac_addr_string;
199 uint8_t mac_addr[6]; /* eeprom mac address */
200 char product_code_string[64];
201 char serial_number_string[64];
220 char *mac_addr_string;
221 uint8_t mac_addr[6]; /* eeprom mac address */
222 char product_code_string[64];
223 char serial_number_string[64];
202 char scratch[256];
203 char tx_mtx_name[16];
204 char cmd_mtx_name[16];
205 char driver_mtx_name[16];
224 char cmd_mtx_name[16];
225 char driver_mtx_name[16];
206} mxge_softc_t;
226};
207
208#define MXGE_PCI_VENDOR_MYRICOM 0x14c1
209#define MXGE_PCI_DEVICE_Z8E 0x0008
210#define MXGE_PCI_DEVICE_Z8E_9 0x0009
211#define MXGE_XFP_COMPLIANCE_BYTE 131
212
213#define MXGE_HIGHPART_TO_U32(X) \
214(sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0)

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

250 for (i = (size / sizeof (uintptr_t)); i; i--) {
251 *to = *from;
252 to++;
253 from++;
254 }
255
256}
257
227
228#define MXGE_PCI_VENDOR_MYRICOM 0x14c1
229#define MXGE_PCI_DEVICE_Z8E 0x0008
230#define MXGE_PCI_DEVICE_Z8E_9 0x0009
231#define MXGE_XFP_COMPLIANCE_BYTE 131
232
233#define MXGE_HIGHPART_TO_U32(X) \
234(sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0)

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

270 for (i = (size / sizeof (uintptr_t)); i; i--) {
271 *to = *from;
272 to++;
273 from++;
274 }
275
276}
277
258void mxge_lro_flush(mxge_softc_t *mgp, struct lro_entry *lro);
259int mxge_lro_rx(mxge_softc_t *mgp, struct mbuf *m_head, uint32_t csum);
278void mxge_lro_flush(struct mxge_slice_state *ss, struct lro_entry *lro);
279int mxge_lro_rx(struct mxge_slice_state *ss, struct mbuf *m_head,
280 uint32_t csum);
260
261
262
263/*
264 This file uses Myri10GE driver indentation.
265
266 Local Variables:
267 c-file-style:"linux"
268 tab-width:8
269 End:
270*/
281
282
283
284/*
285 This file uses Myri10GE driver indentation.
286
287 Local Variables:
288 c-file-style:"linux"
289 tab-width:8
290 End:
291*/