]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/myri10ge/myri10ge_mcp.h
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
[linux-2.6-omap-h63xx.git] / drivers / net / myri10ge / myri10ge_mcp.h
index 9519ae7cd5ec74f0dc9e64fca428b7b515c03ebe..fdbeeee073727240a4df96f60b7837f8efc8f0d1 100644 (file)
@@ -6,23 +6,23 @@
 
 /* 8 Bytes */
 struct mcp_dma_addr {
-       u32 high;
-       u32 low;
+       __be32 high;
+       __be32 low;
 };
 
 /* 4 Bytes */
 struct mcp_slot {
-       u16 checksum;
-       u16 length;
+       __sum16 checksum;
+       __be16 length;
 };
 
 /* 64 Bytes */
 struct mcp_cmd {
-       u32 cmd;
-       u32 data0;              /* will be low portion if data > 32 bits */
+       __be32 cmd;
+       __be32 data0;           /* will be low portion if data > 32 bits */
        /* 8 */
-       u32 data1;              /* will be high portion if data > 32 bits */
-       u32 data2;              /* currently unused.. */
+       __be32 data1;           /* will be high portion if data > 32 bits */
+       __be32 data2;           /* currently unused.. */
        /* 16 */
        struct mcp_dma_addr response_addr;
        /* 24 */
@@ -31,8 +31,8 @@ struct mcp_cmd {
 
 /* 8 Bytes */
 struct mcp_cmd_response {
-       u32 data;
-       u32 result;
+       __be32 data;
+       __be32 result;
 };
 
 /*
@@ -73,10 +73,10 @@ union mcp_pso_or_cumlen {
 
 /* 16 Bytes */
 struct mcp_kreq_ether_send {
-       u32 addr_high;
-       u32 addr_low;
-       u16 pseudo_hdr_offset;
-       u16 length;
+       __be32 addr_high;
+       __be32 addr_low;
+       __be16 pseudo_hdr_offset;
+       __be16 length;
        u8 pad;
        u8 rdma_count;
        u8 cksum_offset;        /* where to start computing cksum */
@@ -85,8 +85,8 @@ struct mcp_kreq_ether_send {
 
 /* 8 Bytes */
 struct mcp_kreq_ether_recv {
-       u32 addr_high;
-       u32 addr_low;
+       __be32 addr_high;
+       __be32 addr_low;
 };
 
 /* Commands */
@@ -144,6 +144,7 @@ enum myri10ge_mcp_cmd_type {
         * a power of 2 number of entries.  */
 
        MXGEFW_CMD_SET_INTRQ_SIZE,      /* in bytes */
+#define MXGEFW_CMD_SET_INTRQ_SIZE_FLAG_NO_STRICT_SIZE_CHECK  (1 << 31)
 
        /* command to bring ethernet interface up.  Above parameters
         * (plus mtu & mac address) must have been exchanged prior
@@ -200,6 +201,134 @@ enum myri10ge_mcp_cmd_type {
        /* data0, data1 = bus addr,
         * data2 = sizeof(struct mcp_irq_data) from driver point of view, allows
         * adding new stuff to mcp_irq_data without changing the ABI */
+
+       MXGEFW_CMD_UNALIGNED_TEST,
+       /* same than DMA_TEST (same args) but abort with UNALIGNED on unaligned
+        * chipset */
+
+       MXGEFW_CMD_UNALIGNED_STATUS,
+       /* return data = boolean, true if the chipset is known to be unaligned */
+
+       MXGEFW_CMD_ALWAYS_USE_N_BIG_BUFFERS,
+       /* 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.
+        */
+
+       MXGEFW_CMD_GET_MAX_RSS_QUEUES,
+       MXGEFW_CMD_ENABLE_RSS_QUEUES,
+       /* data0 = number of slices n (0, 1, ..., n-1) to enable
+        * data1 = interrupt mode.
+        * 0=share one INTx/MSI, 1=use one MSI-X per queue.
+        * If all queues share one interrupt, the driver must have set
+        * RSS_SHARED_INTERRUPT_DMA before enabling queues.
+        */
+#define MXGEFW_SLICE_INTR_MODE_SHARED 0
+#define MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE 1
+
+       MXGEFW_CMD_GET_RSS_SHARED_INTERRUPT_MASK_OFFSET,
+       MXGEFW_CMD_SET_RSS_SHARED_INTERRUPT_DMA,
+       /* data0, data1 = bus address lsw, msw */
+       MXGEFW_CMD_GET_RSS_TABLE_OFFSET,
+       /* get the offset of the indirection table */
+       MXGEFW_CMD_SET_RSS_TABLE_SIZE,
+       /* set the size of the indirection table */
+       MXGEFW_CMD_GET_RSS_KEY_OFFSET,
+       /* get the offset of the secret key */
+       MXGEFW_CMD_RSS_KEY_UPDATED,
+       /* tell nic that the secret key's been updated */
+       MXGEFW_CMD_SET_RSS_ENABLE,
+       /* 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
+        * 1: IPV4            (required by RSS)
+        * 2: TCP_IPV4        (required by RSS)
+        * 3: IPV4 | TCP_IPV4 (required by RSS)
+        * 4: source port
+        */
+#define MXGEFW_RSS_HASH_TYPE_IPV4      0x1
+#define MXGEFW_RSS_HASH_TYPE_TCP_IPV4  0x2
+#define MXGEFW_RSS_HASH_TYPE_SRC_PORT  0x4
+
+       MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE,
+       /* 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.
+        */
+
+       MXGEFW_CMD_SET_TSO_MODE,
+       /* data0 = TSO mode.
+        * 0: Linux/FreeBSD style (NIC default)
+        * 1: NDIS/NetBSD style
+        */
+#define MXGEFW_TSO_MODE_LINUX  0
+#define MXGEFW_TSO_MODE_NDIS   1
+
+       MXGEFW_CMD_MDIO_READ,
+       /* data0 = dev_addr (PMA/PMD or PCS ...), data1 = register/addr */
+       MXGEFW_CMD_MDIO_WRITE,
+       /* data0 = dev_addr,  data1 = register/addr, data2 = value  */
+
+       MXGEFW_CMD_XFP_I2C_READ,
+       /* Starts to get a fresh copy of one byte or of the whole xfp i2c table, the
+        * obtained data is cached inside the xaui-xfi chip :
+        *   data0 : "all" flag : 0 => get one byte, 1=> get 256 bytes,
+        *   data1 : if (data0 == 0): index of byte to refresh [ not used otherwise ]
+        * The operation might take ~1ms for a single byte or ~65ms when refreshing all 256 bytes
+        * During the i2c operation,  MXGEFW_CMD_XFP_I2C_READ or MXGEFW_CMD_XFP_BYTE attempts
+        *  will return MXGEFW_CMD_ERROR_BUSY
+        */
+       MXGEFW_CMD_XFP_BYTE,
+       /* Return the last obtained copy of a given byte in the xfp i2c table
+        * (copy cached during the last relevant MXGEFW_CMD_XFP_I2C_READ)
+        *   data0 : index of the desired table entry
+        *  Return data = the byte stored at the requested index in the table
+        */
+
+       MXGEFW_CMD_GET_VPUMP_OFFSET,
+       /* Return data = NIC memory offset of mcp_vpump_public_global */
+       MXGEFW_CMD_RESET_VPUMP,
+       /* Resets the VPUMP state */
+
+       MXGEFW_CMD_SET_RSS_MCP_SLOT_TYPE,
+       /* 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
+
+       MXGEFW_CMD_SET_THROTTLE_FACTOR,
+       /* 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
+        */
+
+       MXGEFW_CMD_VPUMP_UP,
+       /* Allocates VPump Connection, Send Request and Zero copy buffer address tables */
+       MXGEFW_CMD_GET_VPUMP_CLK,
+       /* Get the lanai clock */
+
+       MXGEFW_CMD_GET_DCA_OFFSET,
+       /* offset of dca control for WDMAs */
 };
 
 enum myri10ge_mcp_cmd_status {
@@ -212,26 +341,39 @@ enum myri10ge_mcp_cmd_status {
        MXGEFW_CMD_ERROR_HASH_ERROR,
        MXGEFW_CMD_ERROR_BAD_PORT,
        MXGEFW_CMD_ERROR_RESOURCES,
-       MXGEFW_CMD_ERROR_MULTICAST
+       MXGEFW_CMD_ERROR_MULTICAST,
+       MXGEFW_CMD_ERROR_UNALIGNED,
+       MXGEFW_CMD_ERROR_NO_MDIO,
+       MXGEFW_CMD_ERROR_XFP_FAILURE,
+       MXGEFW_CMD_ERROR_XFP_ABSENT,
+       MXGEFW_CMD_ERROR_BAD_PCIE_LINK
 };
 
 #define MXGEFW_OLD_IRQ_DATA_LEN 40
 
 struct mcp_irq_data {
        /* add new counters at the beginning */
-       u32 future_use[5];
-       u32 dropped_multicast_filtered;
+       __be32 future_use[1];
+       __be32 dropped_pause;
+       __be32 dropped_unicast_filtered;
+       __be32 dropped_bad_crc32;
+       __be32 dropped_bad_phy;
+       __be32 dropped_multicast_filtered;
        /* 40 Bytes */
-       u32 send_done_count;
-
-       u32 link_up;
-       u32 dropped_link_overflow;
-       u32 dropped_link_error_or_filtered;
-       u32 dropped_runt;
-       u32 dropped_overrun;
-       u32 dropped_no_small_buffer;
-       u32 dropped_no_big_buffer;
-       u32 rdma_tags_available;
+       __be32 send_done_count;
+
+#define MXGEFW_LINK_DOWN 0
+#define MXGEFW_LINK_UP 1
+#define MXGEFW_LINK_MYRINET 2
+#define MXGEFW_LINK_UNKNOWN 3
+       __be32 link_up;
+       __be32 dropped_link_overflow;
+       __be32 dropped_link_error_or_filtered;
+       __be32 dropped_runt;
+       __be32 dropped_overrun;
+       __be32 dropped_no_small_buffer;
+       __be32 dropped_no_big_buffer;
+       __be32 rdma_tags_available;
 
        u8 tx_stopped;
        u8 link_down;