Re: [PATCH 2/4] myri10ge - Driver header files

2006-05-18 Thread Brice Goglin
Randy.Dunlap wrote:
 [PATCH 2/4] myri10ge - Driver header files

  myri10ge_mcp.h|  205 
 ++
  myri10ge_mcp_gen_header.h |   58 +
 

 Please use diffstat -p 1 -w 70 is documented in
 Documentation/SubmittingPatches.
   

Ok, will do.

 +/* 16 Bytes */
 
 What is 16 bytes here?
   
 +struct mcp_slot {
 +u16 checksum;
 +u16 length;
 +};
 

Looks like I have problems to compute the size of this type.

Thanks,
Brice

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] myri10ge - Driver header files

2006-05-17 Thread Brice Goglin
[PATCH 2/4] myri10ge - Driver header files

myri10ge driver header files.
myri10ge_mcp.h is the generic header, while myri10ge_mcp_gen_header.h
is automatically generated from our firmware image.

Signed-off-by: Brice Goglin [EMAIL PROTECTED]
Signed-off-by: Andrew J. Gallatin [EMAIL PROTECTED]

 myri10ge_mcp.h|  205 ++
 myri10ge_mcp_gen_header.h |   58 +
 2 files changed, 263 insertions(+)

--- /dev/null   2006-05-16 20:08:50.920483500 +0200
+++ linux-tmp//drivers/net/myri10ge/myri10ge_mcp.h  2006-05-17 
11:02:48.0 +0200
@@ -0,0 +1,205 @@
+#ifndef __MYRI10GE_MCP_H__
+#define __MYRI10GE_MCP_H__
+
+#define MYRI10GE_MCP_VERSION_MAJOR 1
+#define MYRI10GE_MCP_VERSION_MINOR 4
+
+/* 8 Bytes */
+struct mcp_dma_addr {
+   u32 high;
+   u32 low;
+};
+
+/* 16 Bytes */
+struct mcp_slot {
+   u16 checksum;
+   u16 length;
+};
+
+/* 64 Bytes */
+struct mcp_cmd {
+   u32 cmd;
+   u32 data0;  /* will be low portion if data  32 bits */
+   /* 8 */
+   u32 data1;  /* will be high portion if data  32 bits */
+   u32 data2;  /* currently unused.. */
+   /* 16 */
+   struct mcp_dma_addr response_addr;
+   /* 24 */
+   u8 pad[40];
+};
+
+/* 8 Bytes */
+struct mcp_cmd_response {
+   u32 data;
+   u32 result;
+};
+
+/* 
+ * 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.
+ * 
+ * The  MYRI10GE_MCP_ETHER_FLAGS_ALIGN_ODD must be set if the cumulative
+ * length of all previous segments was odd.
+ */
+
+#define MYRI10GE_MCP_ETHER_FLAGS_SMALL  0x1
+#define MYRI10GE_MCP_ETHER_FLAGS_TSO_HDR0x1
+#define MYRI10GE_MCP_ETHER_FLAGS_FIRST  0x2
+#define MYRI10GE_MCP_ETHER_FLAGS_ALIGN_ODD  0x4
+#define MYRI10GE_MCP_ETHER_FLAGS_CKSUM  0x8
+#define MYRI10GE_MCP_ETHER_FLAGS_TSO_LAST   0x8
+#define MYRI10GE_MCP_ETHER_FLAGS_NO_TSO 0x10
+#define MYRI10GE_MCP_ETHER_FLAGS_TSO_CHOP   0x10
+#define MYRI10GE_MCP_ETHER_FLAGS_TSO_PLD0x20
+
+#define MYRI10GE_MCP_ETHER_SEND_SMALL_SIZE  1520
+#define MYRI10GE_MCP_ETHER_MAX_MTU  9400
+
+union mcp_pso_or_cumlen {
+   u16 pseudo_hdr_offset;
+   u16 cum_len;
+};
+
+#defineMYRI10GE_MCP_ETHER_MAX_SEND_DESC 12
+#define MYRI10GE_MCP_ETHER_PAD 2
+
+/* 16 Bytes */
+struct mcp_kreq_ether_send {
+   u32 addr_high;
+   u32 addr_low;
+   u16 pseudo_hdr_offset;
+   u16 length;
+   u8 pad;
+   u8 rdma_count;
+   u8 cksum_offset;/* where to start computing cksum */
+   u8 flags;   /* as defined above */
+};
+
+/* 8 Bytes */
+struct mcp_kreq_ether_recv {
+   u32 addr_high;
+   u32 addr_low;
+};
+
+/* Commands */
+
+#define MYRI10GE_MCP_CMD_OFFSET 0xf8
+
+enum myri10ge_mcp_cmd_type {
+   MYRI10GE_MCP_CMD_NONE = 0,
+   /* Reset the mcp, it is left in a safe state, waiting
+* for the driver to set all its parameters */
+   MYRI10GE_MCP_CMD_RESET,
+
+   /* get the version number of the current firmware..
+* (may be available in the eeprom strings..? */
+   MYRI10GE_MCP_GET_MCP_VERSION,
+
+   /* Parameters which must be set by the driver before it can
+* issue MYRI10GE_MCP_CMD_ETHERNET_UP. They persist until the next
+* MYRI10GE_MCP_CMD_RESET is issued */
+
+   MYRI10GE_MCP_CMD_SET_INTRQ_DMA,
+   MYRI10GE_MCP_CMD_SET_BIG_BUFFER_SIZE,   /* in bytes, power of 2 */
+   MYRI10GE_MCP_CMD_SET_SMALL_BUFFER_SIZE, /* in bytes */
+
+   /* Parameters which refer to lanai SRAM addresses where the 
+* driver must issue PIO writes for various things */
+
+   MYRI10GE_MCP_CMD_GET_SEND_OFFSET,
+   MYRI10GE_MCP_CMD_GET_SMALL_RX_OFFSET,
+   MYRI10GE_MCP_CMD_GET_BIG_RX_OFFSET,
+   MYRI10GE_MCP_CMD_GET_IRQ_ACK_OFFSET,
+   MYRI10GE_MCP_CMD_GET_IRQ_DEASSERT_OFFSET,
+
+   /* Parameters which refer to rings stored on the MCP,
+* and whose size is controlled by the mcp */
+
+   MYRI10GE_MCP_CMD_GET_SEND_RING_SIZE,/* in bytes */
+   MYRI10GE_MCP_CMD_GET_RX_RING_SIZE,  /* in bytes */
+
+   /* 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.  */
+
+   MYRI10GE_MCP_CMD_SET_INTRQ_SIZE,/* in bytes */
+
+   /* command to bring ethernet interface up.  Above parameters
+* (plus mtu  mac address) must have been exchanged prior
+* to issuing this command  */
+   MYRI10GE_MCP_CMD_ETHERNET_UP,
+
+   /* command to bring ethernet interface down.  No further sends

Re: [PATCH 2/4] myri10ge - Driver header files

2006-05-17 Thread Randy.Dunlap
On Wed, 17 May 2006 18:04:35 -0400 Brice Goglin wrote:

 [PATCH 2/4] myri10ge - Driver header files
 
  myri10ge_mcp.h|  205 
 ++
  myri10ge_mcp_gen_header.h |   58 +

Please use diffstat -p 1 -w 70 is documented in
Documentation/SubmittingPatches.

  2 files changed, 263 insertions(+)
 
 --- /dev/null 2006-05-16 20:08:50.920483500 +0200
 +++ linux-tmp//drivers/net/myri10ge/myri10ge_mcp.h2006-05-17 
 11:02:48.0 +0200
 @@ -0,0 +1,205 @@
 +#ifndef __MYRI10GE_MCP_H__
 +#define __MYRI10GE_MCP_H__
 +
 +#define MYRI10GE_MCP_VERSION_MAJOR   1
 +#define MYRI10GE_MCP_VERSION_MINOR   4
 +
 +/* 16 Bytes */

What is 16 bytes here?

 +struct mcp_slot {
 + u16 checksum;
 + u16 length;
 +};


---
~Randy
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html