mxge_mcp.h revision 171917
1155852Sgallatin/*******************************************************************************
2155852Sgallatin
3171405SgallatinCopyright (c) 2006-2007, Myricom Inc.
4155852SgallatinAll rights reserved.
5155852Sgallatin
6155852SgallatinRedistribution and use in source and binary forms, with or without
7155852Sgallatinmodification, are permitted provided that the following conditions are met:
8155852Sgallatin
9155852Sgallatin 1. Redistributions of source code must retain the above copyright notice,
10155852Sgallatin    this list of conditions and the following disclaimer.
11155852Sgallatin
12171405Sgallatin 2. Neither the name of the Myricom Inc, nor the names of its
13155852Sgallatin    contributors may be used to endorse or promote products derived from
14155852Sgallatin    this software without specific prior written permission.
15155852Sgallatin
16155852SgallatinTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17155852SgallatinAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18155852SgallatinIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19155852SgallatinARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20155852SgallatinLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21155852SgallatinCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22155852SgallatinSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23155852SgallatinINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24155852SgallatinCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25155852SgallatinARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26155852SgallatinPOSSIBILITY OF SUCH DAMAGE.
27155852Sgallatin
28155852Sgallatin$FreeBSD: head/sys/dev/mxge/mxge_mcp.h 171917 2007-08-22 13:22:12Z gallatin $
29155852Sgallatin***************************************************************************/
30155852Sgallatin
31159612Sgallatin#ifndef _myri10ge_mcp_h
32159612Sgallatin#define _myri10ge_mcp_h
33155852Sgallatin
34159612Sgallatin#define MXGEFW_VERSION_MAJOR	1
35159612Sgallatin#define MXGEFW_VERSION_MINOR	4
36159612Sgallatin
37159612Sgallatin#ifdef MXGEFW
38155852Sgallatintypedef signed char          int8_t;
39155852Sgallatintypedef signed short        int16_t;
40155852Sgallatintypedef signed int          int32_t;
41155852Sgallatintypedef signed long long    int64_t;
42155852Sgallatintypedef unsigned char       uint8_t;
43155852Sgallatintypedef unsigned short     uint16_t;
44155852Sgallatintypedef unsigned int       uint32_t;
45155852Sgallatintypedef unsigned long long uint64_t;
46155852Sgallatin#endif
47155852Sgallatin
48155852Sgallatin/* 8 Bytes */
49159612Sgallatinstruct mcp_dma_addr {
50155852Sgallatin  uint32_t high;
51155852Sgallatin  uint32_t low;
52159612Sgallatin};
53159612Sgallatintypedef struct mcp_dma_addr mcp_dma_addr_t;
54155852Sgallatin
55171917Sgallatin/* 4 Bytes.  8 Bytes for NDIS drivers. */
56159612Sgallatinstruct mcp_slot {
57171917Sgallatin#ifdef MXGEFW_NDIS
58171917Sgallatin  /* Place at the top so it gets written before length.
59171917Sgallatin   * The driver polls length.
60171917Sgallatin   */
61171917Sgallatin  uint32_t hash;
62171917Sgallatin#endif
63159612Sgallatin  uint16_t checksum;
64159612Sgallatin  uint16_t length;
65159612Sgallatin};
66159612Sgallatintypedef struct mcp_slot mcp_slot_t;
67155852Sgallatin
68171917Sgallatin#ifdef MXGEFW_NDIS
69171917Sgallatin/* Two bits of length in mcp_slot are used to indicate hash type. */
70171917Sgallatin#define MXGEFW_RSS_HASH_NULL (0 << 14) /* bit 15:14 = 00 */
71171917Sgallatin#define MXGEFW_RSS_HASH_IPV4 (1 << 14) /* bit 15:14 = 01 */
72171917Sgallatin#define MXGEFW_RSS_HASH_TCP_IPV4 (2 << 14) /* bit 15:14 = 10 */
73171917Sgallatin#define MXGEFW_RSS_HASH_MASK (3 << 14) /* bit 15:14 = 11 */
74171917Sgallatin#endif
75171917Sgallatin
76155852Sgallatin/* 64 Bytes */
77159612Sgallatinstruct mcp_cmd {
78155852Sgallatin  uint32_t cmd;
79155852Sgallatin  uint32_t data0;	/* will be low portion if data > 32 bits */
80155852Sgallatin  /* 8 */
81155852Sgallatin  uint32_t data1;	/* will be high portion if data > 32 bits */
82155852Sgallatin  uint32_t data2;	/* currently unused.. */
83155852Sgallatin  /* 16 */
84159612Sgallatin  struct mcp_dma_addr response_addr;
85155852Sgallatin  /* 24 */
86155852Sgallatin  uint8_t pad[40];
87159612Sgallatin};
88159612Sgallatintypedef struct mcp_cmd mcp_cmd_t;
89155852Sgallatin
90155852Sgallatin/* 8 Bytes */
91159612Sgallatinstruct mcp_cmd_response {
92155852Sgallatin  uint32_t data;
93155852Sgallatin  uint32_t result;
94159612Sgallatin};
95159612Sgallatintypedef struct mcp_cmd_response mcp_cmd_response_t;
96155852Sgallatin
97155852Sgallatin
98155852Sgallatin
99155852Sgallatin/*
100155852Sgallatin   flags used in mcp_kreq_ether_send_t:
101155852Sgallatin
102155852Sgallatin   The SMALL flag is only needed in the first segment. It is raised
103155852Sgallatin   for packets that are total less or equal 512 bytes.
104155852Sgallatin
105155852Sgallatin   The CKSUM flag must be set in all segments.
106155852Sgallatin
107155852Sgallatin   The PADDED flags is set if the packet needs to be padded, and it
108155852Sgallatin   must be set for all segments.
109155852Sgallatin
110159612Sgallatin   The  MXGEFW_FLAGS_ALIGN_ODD must be set if the cumulative
111155852Sgallatin   length of all previous segments was odd.
112155852Sgallatin*/
113155852Sgallatin
114155852Sgallatin
115159612Sgallatin#define MXGEFW_FLAGS_SMALL      0x1
116159612Sgallatin#define MXGEFW_FLAGS_TSO_HDR    0x1
117159612Sgallatin#define MXGEFW_FLAGS_FIRST      0x2
118159612Sgallatin#define MXGEFW_FLAGS_ALIGN_ODD  0x4
119159612Sgallatin#define MXGEFW_FLAGS_CKSUM      0x8
120159612Sgallatin#define MXGEFW_FLAGS_TSO_LAST   0x8
121159612Sgallatin#define MXGEFW_FLAGS_NO_TSO     0x10
122159612Sgallatin#define MXGEFW_FLAGS_TSO_CHOP   0x10
123159612Sgallatin#define MXGEFW_FLAGS_TSO_PLD    0x20
124155852Sgallatin
125159612Sgallatin#define MXGEFW_SEND_SMALL_SIZE  1520
126159612Sgallatin#define MXGEFW_MAX_MTU          9400
127155852Sgallatin
128159612Sgallatinunion mcp_pso_or_cumlen {
129155852Sgallatin  uint16_t pseudo_hdr_offset;
130155852Sgallatin  uint16_t cum_len;
131159612Sgallatin};
132159612Sgallatintypedef union mcp_pso_or_cumlen mcp_pso_or_cumlen_t;
133155852Sgallatin
134159612Sgallatin#define	MXGEFW_MAX_SEND_DESC 12
135159612Sgallatin#define MXGEFW_PAD	    2
136155852Sgallatin
137155852Sgallatin/* 16 Bytes */
138159612Sgallatinstruct mcp_kreq_ether_send {
139155852Sgallatin  uint32_t addr_high;
140155852Sgallatin  uint32_t addr_low;
141159612Sgallatin  uint16_t pseudo_hdr_offset;
142155852Sgallatin  uint16_t length;
143159612Sgallatin  uint8_t  pad;
144159612Sgallatin  uint8_t  rdma_count;
145155852Sgallatin  uint8_t  cksum_offset; 	/* where to start computing cksum */
146159612Sgallatin  uint8_t  flags;	       	/* as defined above */
147159612Sgallatin};
148159612Sgallatintypedef struct mcp_kreq_ether_send mcp_kreq_ether_send_t;
149155852Sgallatin
150155852Sgallatin/* 8 Bytes */
151159612Sgallatinstruct mcp_kreq_ether_recv {
152155852Sgallatin  uint32_t addr_high;
153155852Sgallatin  uint32_t addr_low;
154159612Sgallatin};
155159612Sgallatintypedef struct mcp_kreq_ether_recv mcp_kreq_ether_recv_t;
156155852Sgallatin
157155852Sgallatin
158155852Sgallatin/* Commands */
159155852Sgallatin
160162328Sgallatin#define	MXGEFW_BOOT_HANDOFF	0xfc0000
161162328Sgallatin#define	MXGEFW_BOOT_DUMMY_RDMA	0xfc01c0
162155852Sgallatin
163162328Sgallatin#define	MXGEFW_ETH_CMD		0xf80000
164162328Sgallatin#define	MXGEFW_ETH_SEND_4	0x200000
165162328Sgallatin#define	MXGEFW_ETH_SEND_1	0x240000
166162328Sgallatin#define	MXGEFW_ETH_SEND_2	0x280000
167162328Sgallatin#define	MXGEFW_ETH_SEND_3	0x2c0000
168162328Sgallatin#define	MXGEFW_ETH_RECV_SMALL	0x300000
169162328Sgallatin#define	MXGEFW_ETH_RECV_BIG	0x340000
170162328Sgallatin
171162328Sgallatin#define	MXGEFW_ETH_SEND(n)		(0x200000 + (((n) & 0x03) * 0x40000))
172162328Sgallatin#define	MXGEFW_ETH_SEND_OFFSET(n)	(MXGEFW_ETH_SEND(n) - MXGEFW_ETH_SEND_4)
173162328Sgallatin
174159612Sgallatinenum myri10ge_mcp_cmd_type {
175159612Sgallatin  MXGEFW_CMD_NONE = 0,
176155852Sgallatin  /* Reset the mcp, it is left in a safe state, waiting
177155852Sgallatin     for the driver to set all its parameters */
178159612Sgallatin  MXGEFW_CMD_RESET,
179155852Sgallatin
180155852Sgallatin  /* get the version number of the current firmware..
181155852Sgallatin     (may be available in the eeprom strings..? */
182159612Sgallatin  MXGEFW_GET_MCP_VERSION,
183155852Sgallatin
184155852Sgallatin
185155852Sgallatin  /* Parameters which must be set by the driver before it can
186159612Sgallatin     issue MXGEFW_CMD_ETHERNET_UP. They persist until the next
187159612Sgallatin     MXGEFW_CMD_RESET is issued */
188155852Sgallatin
189159612Sgallatin  MXGEFW_CMD_SET_INTRQ_DMA,
190159612Sgallatin  MXGEFW_CMD_SET_BIG_BUFFER_SIZE,	/* in bytes, power of 2 */
191159612Sgallatin  MXGEFW_CMD_SET_SMALL_BUFFER_SIZE,	/* in bytes */
192155852Sgallatin
193155852Sgallatin
194155852Sgallatin  /* Parameters which refer to lanai SRAM addresses where the
195155852Sgallatin     driver must issue PIO writes for various things */
196155852Sgallatin
197159612Sgallatin  MXGEFW_CMD_GET_SEND_OFFSET,
198159612Sgallatin  MXGEFW_CMD_GET_SMALL_RX_OFFSET,
199159612Sgallatin  MXGEFW_CMD_GET_BIG_RX_OFFSET,
200159612Sgallatin  MXGEFW_CMD_GET_IRQ_ACK_OFFSET,
201159612Sgallatin  MXGEFW_CMD_GET_IRQ_DEASSERT_OFFSET,
202155852Sgallatin
203155852Sgallatin  /* Parameters which refer to rings stored on the MCP,
204155852Sgallatin     and whose size is controlled by the mcp */
205155852Sgallatin
206159612Sgallatin  MXGEFW_CMD_GET_SEND_RING_SIZE,	/* in bytes */
207159612Sgallatin  MXGEFW_CMD_GET_RX_RING_SIZE,		/* in bytes */
208155852Sgallatin
209155852Sgallatin  /* Parameters which refer to rings stored in the host,
210155852Sgallatin     and whose size is controlled by the host.  Note that
211155852Sgallatin     all must be physically contiguous and must contain
212155852Sgallatin     a power of 2 number of entries.  */
213155852Sgallatin
214159612Sgallatin  MXGEFW_CMD_SET_INTRQ_SIZE, 	/* in bytes */
215155852Sgallatin
216155852Sgallatin  /* command to bring ethernet interface up.  Above parameters
217155852Sgallatin     (plus mtu & mac address) must have been exchanged prior
218155852Sgallatin     to issuing this command  */
219159612Sgallatin  MXGEFW_CMD_ETHERNET_UP,
220155852Sgallatin
221155852Sgallatin  /* command to bring ethernet interface down.  No further sends
222159612Sgallatin     or receives may be processed until an MXGEFW_CMD_ETHERNET_UP
223155852Sgallatin     is issued, and all interrupt queues must be flushed prior
224155852Sgallatin     to ack'ing this command */
225155852Sgallatin
226159612Sgallatin  MXGEFW_CMD_ETHERNET_DOWN,
227155852Sgallatin
228155852Sgallatin  /* commands the driver may issue live, without resetting
229155852Sgallatin     the nic.  Note that increasing the mtu "live" should
230155852Sgallatin     only be done if the driver has already supplied buffers
231155852Sgallatin     sufficiently large to handle the new mtu.  Decreasing
232155852Sgallatin     the mtu live is safe */
233155852Sgallatin
234159612Sgallatin  MXGEFW_CMD_SET_MTU,
235159612Sgallatin  MXGEFW_CMD_GET_INTR_COAL_DELAY_OFFSET,  /* in microseconds */
236159612Sgallatin  MXGEFW_CMD_SET_STATS_INTERVAL,   /* in microseconds */
237162328Sgallatin  MXGEFW_CMD_SET_STATS_DMA_OBSOLETE, /* replaced by SET_STATS_DMA_V2 */
238155852Sgallatin
239159612Sgallatin  MXGEFW_ENABLE_PROMISC,
240159612Sgallatin  MXGEFW_DISABLE_PROMISC,
241159612Sgallatin  MXGEFW_SET_MAC_ADDRESS,
242155852Sgallatin
243159612Sgallatin  MXGEFW_ENABLE_FLOW_CONTROL,
244159612Sgallatin  MXGEFW_DISABLE_FLOW_CONTROL,
245155852Sgallatin
246159612Sgallatin  /* do a DMA test
247159612Sgallatin     data0,data1 = DMA address
248159612Sgallatin     data2       = RDMA length (MSH), WDMA length (LSH)
249159612Sgallatin     command return data = repetitions (MSH), 0.5-ms ticks (LSH)
250159612Sgallatin  */
251162328Sgallatin  MXGEFW_DMA_TEST,
252162328Sgallatin
253162328Sgallatin  MXGEFW_ENABLE_ALLMULTI,
254162328Sgallatin  MXGEFW_DISABLE_ALLMULTI,
255162328Sgallatin
256162328Sgallatin  /* returns MXGEFW_CMD_ERROR_MULTICAST
257162328Sgallatin     if there is no room in the cache
258162328Sgallatin     data0,MSH(data1) = multicast group address */
259162328Sgallatin  MXGEFW_JOIN_MULTICAST_GROUP,
260162328Sgallatin  /* returns MXGEFW_CMD_ERROR_MULTICAST
261162328Sgallatin     if the address is not in the cache,
262162328Sgallatin     or is equal to FF-FF-FF-FF-FF-FF
263162328Sgallatin     data0,MSH(data1) = multicast group address */
264162328Sgallatin  MXGEFW_LEAVE_MULTICAST_GROUP,
265162328Sgallatin  MXGEFW_LEAVE_ALL_MULTICAST_GROUPS,
266162328Sgallatin
267162328Sgallatin  MXGEFW_CMD_SET_STATS_DMA_V2,
268162328Sgallatin  /* data0, data1 = bus addr,
269162328Sgallatin     data2 = sizeof(struct mcp_irq_data) from driver point of view, allows
270162328Sgallatin     adding new stuff to mcp_irq_data without changing the ABI */
271169376Sgallatin
272169376Sgallatin  MXGEFW_CMD_UNALIGNED_TEST,
273169376Sgallatin  /* same than DMA_TEST (same args) but abort with UNALIGNED on unaligned
274169376Sgallatin     chipset */
275169376Sgallatin
276169840Sgallatin  MXGEFW_CMD_UNALIGNED_STATUS,
277169376Sgallatin  /* return data = boolean, true if the chipset is known to be unaligned */
278171917Sgallatin
279169840Sgallatin  MXGEFW_CMD_ALWAYS_USE_N_BIG_BUFFERS,
280169840Sgallatin  /* data0 = number of big buffers to use.  It must be 0 or a power of 2.
281169840Sgallatin   * 0 indicates that the NIC consumes as many buffers as they are required
282169840Sgallatin   * for packet. This is the default behavior.
283169840Sgallatin   * A power of 2 number indicates that the NIC always uses the specified
284169840Sgallatin   * number of buffers for each big receive packet.
285169840Sgallatin   * It is up to the driver to ensure that this value is big enough for
286169840Sgallatin   * the NIC to be able to receive maximum-sized packets.
287169840Sgallatin   */
288171917Sgallatin
289171917Sgallatin  MXGEFW_CMD_GET_MAX_RSS_QUEUES,
290171917Sgallatin  MXGEFW_CMD_ENABLE_RSS_QUEUES,
291171917Sgallatin  /* data0 = number of slices n (0, 1, ..., n-1) to enable
292171917Sgallatin   * data1 = interrupt mode. 0=share one INTx/MSI, 1=use one MSI-X per queue.
293171917Sgallatin   * If all queues share one interrupt, the driver must have set
294171917Sgallatin   * RSS_SHARED_INTERRUPT_DMA before enabling queues.
295171917Sgallatin   */
296171917Sgallatin  MXGEFW_CMD_GET_RSS_SHARED_INTERRUPT_MASK_OFFSET,
297171917Sgallatin  MXGEFW_CMD_SET_RSS_SHARED_INTERRUPT_DMA,
298171917Sgallatin  /* data0, data1 = bus address lsw, msw */
299171917Sgallatin  MXGEFW_CMD_GET_RSS_TABLE_OFFSET,
300171917Sgallatin  /* get the offset of the indirection table */
301171917Sgallatin  MXGEFW_CMD_SET_RSS_TABLE_SIZE,
302171917Sgallatin  /* set the size of the indirection table */
303171917Sgallatin  MXGEFW_CMD_GET_RSS_KEY_OFFSET,
304171917Sgallatin  /* get the offset of the secret key */
305171917Sgallatin  MXGEFW_CMD_RSS_KEY_UPDATED,
306171917Sgallatin  /* tell nic that the secret key's been updated */
307171917Sgallatin  MXGEFW_CMD_SET_RSS_ENABLE,
308171917Sgallatin  /* data0 = enable/disable rss
309171917Sgallatin   * 0: disable rss.  nic does not distribute receive packets.
310171917Sgallatin   * 1: enable rss.  nic distributes receive packets among queues.
311171917Sgallatin   * data1 = hash type
312171917Sgallatin   * 1: IPV4
313171917Sgallatin   * 2: TCP_IPV4
314171917Sgallatin   * 3: IPV4 | TCP_IPV4
315171917Sgallatin   */
316171917Sgallatin
317171917Sgallatin  MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE,
318171917Sgallatin  /* Return data = the max. size of the entire headers of a IPv6 TSO packet.
319171917Sgallatin   * If the header size of a IPv6 TSO packet is larger than the specified
320171917Sgallatin   * value, then the driver must not use TSO.
321171917Sgallatin   * This size restriction only applies to IPv6 TSO.
322171917Sgallatin   * For IPv4 TSO, the maximum size of the headers is fixed, and the NIC
323171917Sgallatin   * always has enough header buffer to store maximum-sized headers.
324171917Sgallatin   */
325171917Sgallatin
326171917Sgallatin  MXGEFW_CMD_SET_TSO_MODE,
327171917Sgallatin  /* data0 = TSO mode.
328171917Sgallatin   * 0: Linux/FreeBSD style (NIC default)
329171917Sgallatin   * 1: NDIS/NetBSD style
330171917Sgallatin   */
331171917Sgallatin
332171917Sgallatin  MXGEFW_CMD_MDIO_READ,
333171917Sgallatin  /* data0 = dev_addr (PMA/PMD or PCS ...), data1 = register/addr */
334171917Sgallatin  MXGEFW_CMD_MDIO_WRITE,
335171917Sgallatin  /* data0 = dev_addr,  data1 = register/addr, data2 = value  */
336171917Sgallatin
337171917Sgallatin  MXGEFW_CMD_XFP_I2C_READ,
338171917Sgallatin  /* Starts to get a fresh copy of one byte or of the whole xfp i2c table, the
339171917Sgallatin   * obtained data is cached inside the xaui-xfi chip :
340171917Sgallatin   *   data0 : "all" flag : 0 => get one byte, 1=> get 256 bytes,
341171917Sgallatin   *   data1 : if (data0 == 0): index of byte to refresh [ not used otherwise ]
342171917Sgallatin   * The operation might take ~1ms for a single byte or ~65ms when refreshing all 256 bytes
343171917Sgallatin   * During the i2c operation,  MXGEFW_CMD_XFP_I2C_READ or MXGEFW_CMD_XFP_BYTE attempts
344171917Sgallatin   *  will return MXGEFW_CMD_ERROR_BUSY
345171917Sgallatin   */
346171917Sgallatin  MXGEFW_CMD_XFP_BYTE
347171917Sgallatin  /* Return the last obtained copy of a given byte in the xfp i2c table
348171917Sgallatin   * (copy cached during the last relevant MXGEFW_CMD_XFP_I2C_READ)
349171917Sgallatin   *   data0 : index of the desired table entry
350171917Sgallatin   *  Return data = the byte stored at the requested index in the table
351171917Sgallatin   */
352159612Sgallatin};
353159612Sgallatintypedef enum myri10ge_mcp_cmd_type myri10ge_mcp_cmd_type_t;
354155852Sgallatin
355155852Sgallatin
356159612Sgallatinenum myri10ge_mcp_cmd_status {
357159612Sgallatin  MXGEFW_CMD_OK = 0,
358159612Sgallatin  MXGEFW_CMD_UNKNOWN,
359159612Sgallatin  MXGEFW_CMD_ERROR_RANGE,
360159612Sgallatin  MXGEFW_CMD_ERROR_BUSY,
361159612Sgallatin  MXGEFW_CMD_ERROR_EMPTY,
362159612Sgallatin  MXGEFW_CMD_ERROR_CLOSED,
363159612Sgallatin  MXGEFW_CMD_ERROR_HASH_ERROR,
364159612Sgallatin  MXGEFW_CMD_ERROR_BAD_PORT,
365162328Sgallatin  MXGEFW_CMD_ERROR_RESOURCES,
366169376Sgallatin  MXGEFW_CMD_ERROR_MULTICAST,
367171917Sgallatin  MXGEFW_CMD_ERROR_UNALIGNED,
368171917Sgallatin  MXGEFW_CMD_ERROR_NO_MDIO,
369171917Sgallatin  MXGEFW_CMD_ERROR_XFP_FAILURE,
370171917Sgallatin  MXGEFW_CMD_ERROR_XFP_ABSENT
371159612Sgallatin};
372159612Sgallatintypedef enum myri10ge_mcp_cmd_status myri10ge_mcp_cmd_status_t;
373155852Sgallatin
374155852Sgallatin
375162328Sgallatin#define MXGEFW_OLD_IRQ_DATA_LEN 40
376162328Sgallatin
377162328Sgallatinstruct mcp_irq_data {
378162328Sgallatin  /* add new counters at the beginning */
379169376Sgallatin  uint32_t future_use[1];
380169376Sgallatin  uint32_t dropped_pause;
381169376Sgallatin  uint32_t dropped_unicast_filtered;
382169376Sgallatin  uint32_t dropped_bad_crc32;
383169376Sgallatin  uint32_t dropped_bad_phy;
384162328Sgallatin  uint32_t dropped_multicast_filtered;
385159612Sgallatin/* 40 Bytes */
386159612Sgallatin  uint32_t send_done_count;
387159612Sgallatin
388169376Sgallatin#define MXGEFW_LINK_DOWN 0
389169376Sgallatin#define MXGEFW_LINK_UP 1
390169376Sgallatin#define MXGEFW_LINK_MYRINET 2
391169376Sgallatin#define MXGEFW_LINK_UNKNOWN 3
392155852Sgallatin  uint32_t link_up;
393155852Sgallatin  uint32_t dropped_link_overflow;
394155852Sgallatin  uint32_t dropped_link_error_or_filtered;
395155852Sgallatin  uint32_t dropped_runt;
396155852Sgallatin  uint32_t dropped_overrun;
397155852Sgallatin  uint32_t dropped_no_small_buffer;
398155852Sgallatin  uint32_t dropped_no_big_buffer;
399155852Sgallatin  uint32_t rdma_tags_available;
400155852Sgallatin
401159612Sgallatin  uint8_t tx_stopped;
402159612Sgallatin  uint8_t link_down;
403159612Sgallatin  uint8_t stats_updated;
404159612Sgallatin  uint8_t valid;
405159612Sgallatin};
406159612Sgallatintypedef struct mcp_irq_data mcp_irq_data_t;
407155852Sgallatin
408171917Sgallatin#ifdef MXGEFW_NDIS
409171917Sgallatinstruct mcp_rss_shared_interrupt {
410171917Sgallatin  uint8_t pad[2];
411171917Sgallatin  uint8_t queue;
412171917Sgallatin  uint8_t valid;
413171917Sgallatin};
414171917Sgallatin#endif
415159612Sgallatin
416159612Sgallatin#endif /* _myri10ge_mcp_h */
417