2006-02-19 22:39:19 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
Copyright (c) 2006-2009, Myricom Inc.
|
2006-02-19 22:39:19 +00:00
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
|
|
|
|
1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
this list of conditions and the following disclaimer.
|
|
|
|
|
2007-07-12 16:04:55 +00:00
|
|
|
2. Neither the name of the Myricom Inc, nor the names of its
|
2006-02-19 22:39:19 +00:00
|
|
|
contributors may be used to endorse or promote products derived from
|
|
|
|
this software without specific prior written permission.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
$FreeBSD$
|
|
|
|
***************************************************************************/
|
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
#ifndef _myri10ge_mcp_h
|
|
|
|
#define _myri10ge_mcp_h
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
#define MXGEFW_VERSION_MAJOR 1
|
|
|
|
#define MXGEFW_VERSION_MINOR 4
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
#if defined MXGEFW && !defined _stdint_h_
|
2006-02-19 22:39:19 +00:00
|
|
|
typedef signed char int8_t;
|
|
|
|
typedef signed short int16_t;
|
|
|
|
typedef signed int int32_t;
|
|
|
|
typedef signed long long int64_t;
|
|
|
|
typedef unsigned char uint8_t;
|
|
|
|
typedef unsigned short uint16_t;
|
|
|
|
typedef unsigned int uint32_t;
|
|
|
|
typedef unsigned long long uint64_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* 8 Bytes */
|
2006-06-14 16:23:17 +00:00
|
|
|
struct mcp_dma_addr {
|
2006-02-19 22:39:19 +00:00
|
|
|
uint32_t high;
|
|
|
|
uint32_t low;
|
2006-06-14 16:23:17 +00:00
|
|
|
};
|
|
|
|
typedef struct mcp_dma_addr mcp_dma_addr_t;
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2008-01-15 20:34:49 +00:00
|
|
|
/* 4 Bytes */
|
2006-06-14 16:23:17 +00:00
|
|
|
struct mcp_slot {
|
2008-01-15 20:34:49 +00:00
|
|
|
uint16_t checksum;
|
|
|
|
uint16_t length;
|
|
|
|
};
|
|
|
|
typedef struct mcp_slot mcp_slot_t;
|
|
|
|
|
2007-08-22 13:22:12 +00:00
|
|
|
#ifdef MXGEFW_NDIS
|
2008-01-15 20:34:49 +00:00
|
|
|
/* 8-byte descriptor, exclusively used by NDIS drivers. */
|
|
|
|
struct mcp_slot_8 {
|
|
|
|
/* Place hash value at the top so it gets written before length.
|
2007-08-22 13:22:12 +00:00
|
|
|
* The driver polls length.
|
|
|
|
*/
|
|
|
|
uint32_t hash;
|
2006-06-14 16:23:17 +00:00
|
|
|
uint16_t checksum;
|
|
|
|
uint16_t length;
|
|
|
|
};
|
2008-01-15 20:34:49 +00:00
|
|
|
typedef struct mcp_slot_8 mcp_slot_8_t;
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2007-08-22 13:22:12 +00:00
|
|
|
/* Two bits of length in mcp_slot are used to indicate hash type. */
|
|
|
|
#define MXGEFW_RSS_HASH_NULL (0 << 14) /* bit 15:14 = 00 */
|
|
|
|
#define MXGEFW_RSS_HASH_IPV4 (1 << 14) /* bit 15:14 = 01 */
|
|
|
|
#define MXGEFW_RSS_HASH_TCP_IPV4 (2 << 14) /* bit 15:14 = 10 */
|
|
|
|
#define MXGEFW_RSS_HASH_MASK (3 << 14) /* bit 15:14 = 11 */
|
|
|
|
#endif
|
|
|
|
|
2006-02-19 22:39:19 +00:00
|
|
|
/* 64 Bytes */
|
2006-06-14 16:23:17 +00:00
|
|
|
struct mcp_cmd {
|
2006-02-19 22:39:19 +00:00
|
|
|
uint32_t cmd;
|
|
|
|
uint32_t data0; /* will be low portion if data > 32 bits */
|
|
|
|
/* 8 */
|
|
|
|
uint32_t data1; /* will be high portion if data > 32 bits */
|
|
|
|
uint32_t data2; /* currently unused.. */
|
|
|
|
/* 16 */
|
2006-06-14 16:23:17 +00:00
|
|
|
struct mcp_dma_addr response_addr;
|
2006-02-19 22:39:19 +00:00
|
|
|
/* 24 */
|
|
|
|
uint8_t pad[40];
|
2006-06-14 16:23:17 +00:00
|
|
|
};
|
|
|
|
typedef struct mcp_cmd mcp_cmd_t;
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* 8 Bytes */
|
2006-06-14 16:23:17 +00:00
|
|
|
struct mcp_cmd_response {
|
2006-02-19 22:39:19 +00:00
|
|
|
uint32_t data;
|
|
|
|
uint32_t result;
|
2006-06-14 16:23:17 +00:00
|
|
|
};
|
|
|
|
typedef struct mcp_cmd_response mcp_cmd_response_t;
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
flags used in mcp_kreq_ether_send_t:
|
|
|
|
|
|
|
|
The SMALL flag is only needed in the first segment. It is raised
|
|
|
|
for packets that are total less or equal 512 bytes.
|
|
|
|
|
|
|
|
The CKSUM flag must be set in all segments.
|
|
|
|
|
|
|
|
The PADDED flags is set if the packet needs to be padded, and it
|
|
|
|
must be set for all segments.
|
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
The MXGEFW_FLAGS_ALIGN_ODD must be set if the cumulative
|
2006-02-19 22:39:19 +00:00
|
|
|
length of all previous segments was odd.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
#define MXGEFW_FLAGS_SMALL 0x1
|
|
|
|
#define MXGEFW_FLAGS_TSO_HDR 0x1
|
|
|
|
#define MXGEFW_FLAGS_FIRST 0x2
|
|
|
|
#define MXGEFW_FLAGS_ALIGN_ODD 0x4
|
|
|
|
#define MXGEFW_FLAGS_CKSUM 0x8
|
|
|
|
#define MXGEFW_FLAGS_TSO_LAST 0x8
|
|
|
|
#define MXGEFW_FLAGS_NO_TSO 0x10
|
|
|
|
#define MXGEFW_FLAGS_TSO_CHOP 0x10
|
|
|
|
#define MXGEFW_FLAGS_TSO_PLD 0x20
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
#define MXGEFW_SEND_SMALL_SIZE 1520
|
|
|
|
#define MXGEFW_MAX_MTU 9400
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
union mcp_pso_or_cumlen {
|
2006-02-19 22:39:19 +00:00
|
|
|
uint16_t pseudo_hdr_offset;
|
|
|
|
uint16_t cum_len;
|
2006-06-14 16:23:17 +00:00
|
|
|
};
|
|
|
|
typedef union mcp_pso_or_cumlen mcp_pso_or_cumlen_t;
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
#define MXGEFW_MAX_SEND_DESC 12
|
|
|
|
#define MXGEFW_PAD 2
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* 16 Bytes */
|
2006-06-14 16:23:17 +00:00
|
|
|
struct mcp_kreq_ether_send {
|
2006-02-19 22:39:19 +00:00
|
|
|
uint32_t addr_high;
|
|
|
|
uint32_t addr_low;
|
2006-06-14 16:23:17 +00:00
|
|
|
uint16_t pseudo_hdr_offset;
|
2006-02-19 22:39:19 +00:00
|
|
|
uint16_t length;
|
2006-06-14 16:23:17 +00:00
|
|
|
uint8_t pad;
|
|
|
|
uint8_t rdma_count;
|
2006-02-19 22:39:19 +00:00
|
|
|
uint8_t cksum_offset; /* where to start computing cksum */
|
2006-06-14 16:23:17 +00:00
|
|
|
uint8_t flags; /* as defined above */
|
|
|
|
};
|
|
|
|
typedef struct mcp_kreq_ether_send mcp_kreq_ether_send_t;
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* 8 Bytes */
|
2006-06-14 16:23:17 +00:00
|
|
|
struct mcp_kreq_ether_recv {
|
2006-02-19 22:39:19 +00:00
|
|
|
uint32_t addr_high;
|
|
|
|
uint32_t addr_low;
|
2006-06-14 16:23:17 +00:00
|
|
|
};
|
|
|
|
typedef struct mcp_kreq_ether_recv mcp_kreq_ether_recv_t;
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Commands */
|
|
|
|
|
2006-09-15 19:24:45 +00:00
|
|
|
#define MXGEFW_BOOT_HANDOFF 0xfc0000
|
|
|
|
#define MXGEFW_BOOT_DUMMY_RDMA 0xfc01c0
|
|
|
|
|
|
|
|
#define MXGEFW_ETH_CMD 0xf80000
|
|
|
|
#define MXGEFW_ETH_SEND_4 0x200000
|
|
|
|
#define MXGEFW_ETH_SEND_1 0x240000
|
|
|
|
#define MXGEFW_ETH_SEND_2 0x280000
|
|
|
|
#define MXGEFW_ETH_SEND_3 0x2c0000
|
|
|
|
#define MXGEFW_ETH_RECV_SMALL 0x300000
|
|
|
|
#define MXGEFW_ETH_RECV_BIG 0x340000
|
2008-10-01 16:23:35 +00:00
|
|
|
#define MXGEFW_ETH_SEND_GO 0x380000
|
|
|
|
#define MXGEFW_ETH_SEND_STOP 0x3C0000
|
2006-09-15 19:24:45 +00:00
|
|
|
|
|
|
|
#define MXGEFW_ETH_SEND(n) (0x200000 + (((n) & 0x03) * 0x40000))
|
|
|
|
#define MXGEFW_ETH_SEND_OFFSET(n) (MXGEFW_ETH_SEND(n) - MXGEFW_ETH_SEND_4)
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
enum myri10ge_mcp_cmd_type {
|
|
|
|
MXGEFW_CMD_NONE = 0,
|
2006-02-19 22:39:19 +00:00
|
|
|
/* Reset the mcp, it is left in a safe state, waiting
|
|
|
|
for the driver to set all its parameters */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_RESET = 1,
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* get the version number of the current firmware..
|
|
|
|
(may be available in the eeprom strings..? */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_GET_MCP_VERSION = 2,
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Parameters which must be set by the driver before it can
|
2006-06-14 16:23:17 +00:00
|
|
|
issue MXGEFW_CMD_ETHERNET_UP. They persist until the next
|
|
|
|
MXGEFW_CMD_RESET is issued */
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_INTRQ_DMA = 3,
|
2008-10-01 16:23:35 +00:00
|
|
|
/* data0 = LSW of the host address
|
|
|
|
* data1 = MSW of the host address
|
|
|
|
* data2 = slice number if multiple slices are used
|
|
|
|
*/
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_BIG_BUFFER_SIZE = 4, /* in bytes, power of 2 */
|
|
|
|
MXGEFW_CMD_SET_SMALL_BUFFER_SIZE = 5, /* in bytes */
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Parameters which refer to lanai SRAM addresses where the
|
|
|
|
driver must issue PIO writes for various things */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_SEND_OFFSET = 6,
|
|
|
|
MXGEFW_CMD_GET_SMALL_RX_OFFSET = 7,
|
|
|
|
MXGEFW_CMD_GET_BIG_RX_OFFSET = 8,
|
2008-10-01 16:23:35 +00:00
|
|
|
/* data0 = slice number if multiple slices are used */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_IRQ_ACK_OFFSET = 9,
|
|
|
|
MXGEFW_CMD_GET_IRQ_DEASSERT_OFFSET = 10,
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* Parameters which refer to rings stored on the MCP,
|
|
|
|
and whose size is controlled by the mcp */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_SEND_RING_SIZE = 11, /* in bytes */
|
|
|
|
MXGEFW_CMD_GET_RX_RING_SIZE = 12, /* in bytes */
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* Parameters which refer to rings stored in the host,
|
|
|
|
and whose size is controlled by the host. Note that
|
|
|
|
all must be physically contiguous and must contain
|
|
|
|
a power of 2 number of entries. */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_INTRQ_SIZE = 13, /* in bytes */
|
2013-11-30 22:17:27 +00:00
|
|
|
#define MXGEFW_CMD_SET_INTRQ_SIZE_FLAG_NO_STRICT_SIZE_CHECK (1U << 31)
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* command to bring ethernet interface up. Above parameters
|
|
|
|
(plus mtu & mac address) must have been exchanged prior
|
|
|
|
to issuing this command */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_ETHERNET_UP = 14,
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* command to bring ethernet interface down. No further sends
|
2006-06-14 16:23:17 +00:00
|
|
|
or receives may be processed until an MXGEFW_CMD_ETHERNET_UP
|
2006-02-19 22:39:19 +00:00
|
|
|
is issued, and all interrupt queues must be flushed prior
|
|
|
|
to ack'ing this command */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_ETHERNET_DOWN = 15,
|
2006-02-19 22:39:19 +00:00
|
|
|
|
|
|
|
/* commands the driver may issue live, without resetting
|
|
|
|
the nic. Note that increasing the mtu "live" should
|
|
|
|
only be done if the driver has already supplied buffers
|
|
|
|
sufficiently large to handle the new mtu. Decreasing
|
|
|
|
the mtu live is safe */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_MTU = 16,
|
|
|
|
MXGEFW_CMD_GET_INTR_COAL_DELAY_OFFSET = 17, /* in microseconds */
|
|
|
|
MXGEFW_CMD_SET_STATS_INTERVAL = 18, /* in microseconds */
|
|
|
|
MXGEFW_CMD_SET_STATS_DMA_OBSOLETE = 19, /* replaced by SET_STATS_DMA_V2 */
|
2006-06-14 16:23:17 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_ENABLE_PROMISC = 20,
|
|
|
|
MXGEFW_DISABLE_PROMISC = 21,
|
|
|
|
MXGEFW_SET_MAC_ADDRESS = 22,
|
2006-06-14 16:23:17 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_ENABLE_FLOW_CONTROL = 23,
|
|
|
|
MXGEFW_DISABLE_FLOW_CONTROL = 24,
|
2006-06-14 16:23:17 +00:00
|
|
|
|
|
|
|
/* do a DMA test
|
|
|
|
data0,data1 = DMA address
|
|
|
|
data2 = RDMA length (MSH), WDMA length (LSH)
|
|
|
|
command return data = repetitions (MSH), 0.5-ms ticks (LSH)
|
|
|
|
*/
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_DMA_TEST = 25,
|
2006-09-15 19:24:45 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_ENABLE_ALLMULTI = 26,
|
|
|
|
MXGEFW_DISABLE_ALLMULTI = 27,
|
2006-09-15 19:24:45 +00:00
|
|
|
|
|
|
|
/* returns MXGEFW_CMD_ERROR_MULTICAST
|
|
|
|
if there is no room in the cache
|
|
|
|
data0,MSH(data1) = multicast group address */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_JOIN_MULTICAST_GROUP = 28,
|
2006-09-15 19:24:45 +00:00
|
|
|
/* returns MXGEFW_CMD_ERROR_MULTICAST
|
|
|
|
if the address is not in the cache,
|
|
|
|
or is equal to FF-FF-FF-FF-FF-FF
|
|
|
|
data0,MSH(data1) = multicast group address */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_LEAVE_MULTICAST_GROUP = 29,
|
|
|
|
MXGEFW_LEAVE_ALL_MULTICAST_GROUPS = 30,
|
2006-09-15 19:24:45 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_STATS_DMA_V2 = 31,
|
2006-09-15 19:24:45 +00:00
|
|
|
/* data0, data1 = bus addr,
|
2008-10-01 16:23:35 +00:00
|
|
|
* data2 = sizeof(struct mcp_irq_data) from driver point of view, allows
|
|
|
|
* adding new stuff to mcp_irq_data without changing the ABI
|
|
|
|
*
|
|
|
|
* If multiple slices are used, data2 contains both the size of the
|
|
|
|
* structure (in the lower 16 bits) and the slice number
|
|
|
|
* (in the upper 16 bits).
|
|
|
|
*/
|
2007-05-08 14:19:43 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_UNALIGNED_TEST = 32,
|
2007-05-08 14:19:43 +00:00
|
|
|
/* same than DMA_TEST (same args) but abort with UNALIGNED on unaligned
|
|
|
|
chipset */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_UNALIGNED_STATUS = 33,
|
2007-05-08 14:19:43 +00:00
|
|
|
/* return data = boolean, true if the chipset is known to be unaligned */
|
2007-08-22 13:22:12 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_ALWAYS_USE_N_BIG_BUFFERS = 34,
|
2007-05-21 18:32:27 +00:00
|
|
|
/* data0 = number of big buffers to use. It must be 0 or a power of 2.
|
|
|
|
* 0 indicates that the NIC consumes as many buffers as they are required
|
|
|
|
* for packet. This is the default behavior.
|
|
|
|
* A power of 2 number indicates that the NIC always uses the specified
|
|
|
|
* number of buffers for each big receive packet.
|
|
|
|
* It is up to the driver to ensure that this value is big enough for
|
|
|
|
* the NIC to be able to receive maximum-sized packets.
|
|
|
|
*/
|
2007-08-22 13:22:12 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_MAX_RSS_QUEUES = 35,
|
|
|
|
MXGEFW_CMD_ENABLE_RSS_QUEUES = 36,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* data0 = number of slices n (0, 1, ..., n-1) to enable
|
2008-10-01 16:23:35 +00:00
|
|
|
* data1 = interrupt mode | use of multiple transmit queues.
|
|
|
|
* 0=share one INTx/MSI.
|
|
|
|
* 1=use one MSI-X per queue.
|
2007-08-22 13:22:12 +00:00
|
|
|
* If all queues share one interrupt, the driver must have set
|
|
|
|
* RSS_SHARED_INTERRUPT_DMA before enabling queues.
|
2008-10-01 16:23:35 +00:00
|
|
|
* 2=enable both receive and send queues.
|
|
|
|
* Without this bit set, only one send queue (slice 0's send queue)
|
|
|
|
* is enabled. The receive queues are always enabled.
|
2007-08-22 13:22:12 +00:00
|
|
|
*/
|
2008-10-01 16:23:35 +00:00
|
|
|
#define MXGEFW_SLICE_INTR_MODE_SHARED 0x0
|
|
|
|
#define MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE 0x1
|
|
|
|
#define MXGEFW_SLICE_ENABLE_MULTIPLE_TX_QUEUES 0x2
|
2008-01-15 20:34:49 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_RSS_SHARED_INTERRUPT_MASK_OFFSET = 37,
|
|
|
|
MXGEFW_CMD_SET_RSS_SHARED_INTERRUPT_DMA = 38,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* data0, data1 = bus address lsw, msw */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_RSS_TABLE_OFFSET = 39,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* get the offset of the indirection table */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_RSS_TABLE_SIZE = 40,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* set the size of the indirection table */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_RSS_KEY_OFFSET = 41,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* get the offset of the secret key */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_RSS_KEY_UPDATED = 42,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* tell nic that the secret key's been updated */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_RSS_ENABLE = 43,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* data0 = enable/disable rss
|
|
|
|
* 0: disable rss. nic does not distribute receive packets.
|
|
|
|
* 1: enable rss. nic distributes receive packets among queues.
|
|
|
|
* data1 = hash type
|
2008-01-15 20:34:49 +00:00
|
|
|
* 1: IPV4 (required by RSS)
|
|
|
|
* 2: TCP_IPV4 (required by RSS)
|
|
|
|
* 3: IPV4 | TCP_IPV4 (required by RSS)
|
|
|
|
* 4: source port
|
2008-10-01 16:23:35 +00:00
|
|
|
* 5: source port + destination port
|
2007-08-22 13:22:12 +00:00
|
|
|
*/
|
2008-01-15 20:34:49 +00:00
|
|
|
#define MXGEFW_RSS_HASH_TYPE_IPV4 0x1
|
|
|
|
#define MXGEFW_RSS_HASH_TYPE_TCP_IPV4 0x2
|
|
|
|
#define MXGEFW_RSS_HASH_TYPE_SRC_PORT 0x4
|
2008-10-01 16:23:35 +00:00
|
|
|
#define MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT 0x5
|
|
|
|
#define MXGEFW_RSS_HASH_TYPE_MAX 0x5
|
2008-01-15 20:34:49 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE = 44,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* Return data = the max. size of the entire headers of a IPv6 TSO packet.
|
|
|
|
* If the header size of a IPv6 TSO packet is larger than the specified
|
|
|
|
* value, then the driver must not use TSO.
|
|
|
|
* This size restriction only applies to IPv6 TSO.
|
|
|
|
* For IPv4 TSO, the maximum size of the headers is fixed, and the NIC
|
|
|
|
* always has enough header buffer to store maximum-sized headers.
|
|
|
|
*/
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_TSO_MODE = 45,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* data0 = TSO mode.
|
|
|
|
* 0: Linux/FreeBSD style (NIC default)
|
|
|
|
* 1: NDIS/NetBSD style
|
|
|
|
*/
|
2008-01-15 20:34:49 +00:00
|
|
|
#define MXGEFW_TSO_MODE_LINUX 0
|
|
|
|
#define MXGEFW_TSO_MODE_NDIS 1
|
2007-08-22 13:22:12 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_MDIO_READ = 46,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* data0 = dev_addr (PMA/PMD or PCS ...), data1 = register/addr */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_MDIO_WRITE = 47,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* data0 = dev_addr, data1 = register/addr, data2 = value */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_I2C_READ = 48,
|
|
|
|
/* Starts to get a fresh copy of one byte or of the module i2c table, the
|
2007-08-22 13:22:12 +00:00
|
|
|
* obtained data is cached inside the xaui-xfi chip :
|
2009-02-17 22:15:58 +00:00
|
|
|
* data0 : 0 => get one byte, 1=> get 256 bytes
|
|
|
|
* data1 : If data0 == 0: location to refresh
|
|
|
|
* bit 7:0 register location
|
|
|
|
* bit 8:15 is the i2c slave addr (0 is interpreted as 0xA1)
|
|
|
|
* bit 23:16 is the i2c bus number (for multi-port NICs)
|
|
|
|
* If data0 == 1: unused
|
2007-08-22 13:22:12 +00:00
|
|
|
* The operation might take ~1ms for a single byte or ~65ms when refreshing all 256 bytes
|
2009-02-17 22:15:58 +00:00
|
|
|
* During the i2c operation, MXGEFW_CMD_I2C_READ or MXGEFW_CMD_I2C_BYTE attempts
|
2007-08-22 13:22:12 +00:00
|
|
|
* will return MXGEFW_CMD_ERROR_BUSY
|
|
|
|
*/
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_I2C_BYTE = 49,
|
2007-08-22 13:22:12 +00:00
|
|
|
/* Return the last obtained copy of a given byte in the xfp i2c table
|
2009-02-17 22:15:58 +00:00
|
|
|
* (copy cached during the last relevant MXGEFW_CMD_I2C_READ)
|
2007-08-22 13:22:12 +00:00
|
|
|
* data0 : index of the desired table entry
|
|
|
|
* Return data = the byte stored at the requested index in the table
|
|
|
|
*/
|
2008-01-15 20:34:49 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_VPUMP_OFFSET = 50,
|
2008-01-15 20:34:49 +00:00
|
|
|
/* Return data = NIC memory offset of mcp_vpump_public_global */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_RESET_VPUMP = 51,
|
2008-01-15 20:34:49 +00:00
|
|
|
/* Resets the VPUMP state */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_RSS_MCP_SLOT_TYPE = 52,
|
2008-01-15 20:34:49 +00:00
|
|
|
/* data0 = mcp_slot type to use.
|
|
|
|
* 0 = the default 4B mcp_slot
|
|
|
|
* 1 = 8B mcp_slot_8
|
|
|
|
*/
|
|
|
|
#define MXGEFW_RSS_MCP_SLOT_TYPE_MIN 0
|
|
|
|
#define MXGEFW_RSS_MCP_SLOT_TYPE_WITH_HASH 1
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_SET_THROTTLE_FACTOR = 53,
|
2008-01-15 20:34:49 +00:00
|
|
|
/* set the throttle factor for ethp_z8e
|
|
|
|
data0 = throttle_factor
|
|
|
|
throttle_factor = 256 * pcie-raw-speed / tx_speed
|
|
|
|
tx_speed = 256 * pcie-raw-speed / throttle_factor
|
|
|
|
|
|
|
|
For PCI-E x8: pcie-raw-speed == 16Gb/s
|
|
|
|
For PCI-E x4: pcie-raw-speed == 8Gb/s
|
|
|
|
|
|
|
|
ex1: throttle_factor == 0x1a0 (416), tx_speed == 1.23GB/s == 9.846 Gb/s
|
|
|
|
ex2: throttle_factor == 0x200 (512), tx_speed == 1.0GB/s == 8 Gb/s
|
|
|
|
|
|
|
|
with tx_boundary == 2048, max-throttle-factor == 8191 => min-speed == 500Mb/s
|
|
|
|
with tx_boundary == 4096, max-throttle-factor == 4095 => min-speed == 1Gb/s
|
|
|
|
*/
|
2008-10-01 16:23:35 +00:00
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_VPUMP_UP = 54,
|
2008-01-15 20:34:49 +00:00
|
|
|
/* Allocates VPump Connection, Send Request and Zero copy buffer address tables */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_VPUMP_CLK = 55,
|
2008-10-01 16:23:35 +00:00
|
|
|
/* Get the lanai clock */
|
|
|
|
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_GET_DCA_OFFSET = 56,
|
2008-10-01 16:23:35 +00:00
|
|
|
/* offset of dca control for WDMAs */
|
|
|
|
|
|
|
|
/* VMWare NetQueue commands */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_NETQ_GET_FILTERS_PER_QUEUE = 57,
|
|
|
|
MXGEFW_CMD_NETQ_ADD_FILTER = 58,
|
2008-10-01 16:23:35 +00:00
|
|
|
/* data0 = filter_id << 16 | queue << 8 | type */
|
|
|
|
/* data1 = MS4 of MAC Addr */
|
|
|
|
/* data2 = LS2_MAC << 16 | VLAN_tag */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_NETQ_DEL_FILTER = 59,
|
2008-10-01 16:23:35 +00:00
|
|
|
/* data0 = filter_id */
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_NETQ_QUERY1 = 60,
|
|
|
|
MXGEFW_CMD_NETQ_QUERY2 = 61,
|
|
|
|
MXGEFW_CMD_NETQ_QUERY3 = 62,
|
|
|
|
MXGEFW_CMD_NETQ_QUERY4 = 63,
|
|
|
|
|
|
|
|
MXGEFW_CMD_RELAX_RXBUFFER_ALIGNMENT = 64,
|
|
|
|
/* When set, small receive buffers can cross page boundaries.
|
|
|
|
* Both small and big receive buffers may start at any address.
|
|
|
|
* This option has performance implications, so use with caution.
|
|
|
|
*/
|
2006-06-14 16:23:17 +00:00
|
|
|
};
|
|
|
|
typedef enum myri10ge_mcp_cmd_type myri10ge_mcp_cmd_type_t;
|
|
|
|
|
|
|
|
|
|
|
|
enum myri10ge_mcp_cmd_status {
|
|
|
|
MXGEFW_CMD_OK = 0,
|
2009-02-17 22:15:58 +00:00
|
|
|
MXGEFW_CMD_UNKNOWN = 1,
|
|
|
|
MXGEFW_CMD_ERROR_RANGE = 2,
|
|
|
|
MXGEFW_CMD_ERROR_BUSY = 3,
|
|
|
|
MXGEFW_CMD_ERROR_EMPTY = 4,
|
|
|
|
MXGEFW_CMD_ERROR_CLOSED = 5,
|
|
|
|
MXGEFW_CMD_ERROR_HASH_ERROR = 6,
|
|
|
|
MXGEFW_CMD_ERROR_BAD_PORT = 7,
|
|
|
|
MXGEFW_CMD_ERROR_RESOURCES = 8,
|
|
|
|
MXGEFW_CMD_ERROR_MULTICAST = 9,
|
|
|
|
MXGEFW_CMD_ERROR_UNALIGNED = 10,
|
|
|
|
MXGEFW_CMD_ERROR_NO_MDIO = 11,
|
|
|
|
MXGEFW_CMD_ERROR_I2C_FAILURE = 12,
|
|
|
|
MXGEFW_CMD_ERROR_I2C_ABSENT = 13,
|
|
|
|
MXGEFW_CMD_ERROR_BAD_PCIE_LINK = 14
|
2006-06-14 16:23:17 +00:00
|
|
|
};
|
|
|
|
typedef enum myri10ge_mcp_cmd_status myri10ge_mcp_cmd_status_t;
|
|
|
|
|
|
|
|
|
2006-09-15 19:24:45 +00:00
|
|
|
#define MXGEFW_OLD_IRQ_DATA_LEN 40
|
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
struct mcp_irq_data {
|
2006-09-15 19:24:45 +00:00
|
|
|
/* add new counters at the beginning */
|
2007-05-08 14:19:43 +00:00
|
|
|
uint32_t future_use[1];
|
|
|
|
uint32_t dropped_pause;
|
|
|
|
uint32_t dropped_unicast_filtered;
|
|
|
|
uint32_t dropped_bad_crc32;
|
|
|
|
uint32_t dropped_bad_phy;
|
2006-09-15 19:24:45 +00:00
|
|
|
uint32_t dropped_multicast_filtered;
|
|
|
|
/* 40 Bytes */
|
2006-06-14 16:23:17 +00:00
|
|
|
uint32_t send_done_count;
|
|
|
|
|
2007-05-08 14:19:43 +00:00
|
|
|
#define MXGEFW_LINK_DOWN 0
|
|
|
|
#define MXGEFW_LINK_UP 1
|
|
|
|
#define MXGEFW_LINK_MYRINET 2
|
|
|
|
#define MXGEFW_LINK_UNKNOWN 3
|
2006-02-19 22:39:19 +00:00
|
|
|
uint32_t link_up;
|
|
|
|
uint32_t dropped_link_overflow;
|
|
|
|
uint32_t dropped_link_error_or_filtered;
|
|
|
|
uint32_t dropped_runt;
|
|
|
|
uint32_t dropped_overrun;
|
|
|
|
uint32_t dropped_no_small_buffer;
|
|
|
|
uint32_t dropped_no_big_buffer;
|
|
|
|
uint32_t rdma_tags_available;
|
2006-06-14 16:23:17 +00:00
|
|
|
|
|
|
|
uint8_t tx_stopped;
|
|
|
|
uint8_t link_down;
|
|
|
|
uint8_t stats_updated;
|
|
|
|
uint8_t valid;
|
|
|
|
};
|
|
|
|
typedef struct mcp_irq_data mcp_irq_data_t;
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2007-08-22 13:22:12 +00:00
|
|
|
#ifdef MXGEFW_NDIS
|
2008-01-15 20:34:49 +00:00
|
|
|
/* Exclusively used by NDIS drivers */
|
2007-08-22 13:22:12 +00:00
|
|
|
struct mcp_rss_shared_interrupt {
|
|
|
|
uint8_t pad[2];
|
|
|
|
uint8_t queue;
|
|
|
|
uint8_t valid;
|
|
|
|
};
|
|
|
|
#endif
|
2006-02-19 22:39:19 +00:00
|
|
|
|
2008-10-01 16:23:35 +00:00
|
|
|
/* definitions for NETQ filter type */
|
|
|
|
#define MXGEFW_NETQ_FILTERTYPE_NONE 0
|
|
|
|
#define MXGEFW_NETQ_FILTERTYPE_MACADDR 1
|
|
|
|
#define MXGEFW_NETQ_FILTERTYPE_VLAN 2
|
|
|
|
#define MXGEFW_NETQ_FILTERTYPE_VLANMACADDR 3
|
|
|
|
|
2006-06-14 16:23:17 +00:00
|
|
|
#endif /* _myri10ge_mcp_h */
|