Commit 8d636d8b authored by Olof Johansson's avatar Olof Johansson

pasemi_mac: jumbo frame support

First cut at jumbo frame support. To support large MTU, one or several
separate channels must be allocated to calculate the TCP/UDP checksum
separately, since the mac lacks enough buffers to hold a whole packet
while it's being calculated.

Furthermore, it seems that a single function channel is not quite
enough to feed one of the 10Gig links, so allocate two channels for
XAUI interfaces.
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
Acked-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent dda56df0
This diff is collapsed.
......@@ -27,6 +27,7 @@
#include <linux/phy.h>
#define MAX_LRO_DESCRIPTORS 8
#define MAX_CS 2
struct pasemi_mac_txring {
struct pasemi_dmachan chan; /* Must be first */
......@@ -51,6 +52,15 @@ struct pasemi_mac_rxring {
struct pasemi_mac *mac; /* Needed in intr handler */
};
struct pasemi_mac_csring {
struct pasemi_dmachan chan;
unsigned int size;
unsigned int next_to_fill;
int events[2];
int last_event;
int fun;
};
struct pasemi_mac {
struct net_device *netdev;
struct pci_dev *pdev;
......@@ -60,10 +70,12 @@ struct pasemi_mac {
struct napi_struct napi;
int bufsz; /* RX ring buffer size */
int last_cs;
int num_cs;
u32 dma_if;
u8 type;
#define MAC_TYPE_GMAC 1
#define MAC_TYPE_XAUI 2
u32 dma_if;
u8 mac_addr[6];
......@@ -74,6 +86,7 @@ struct pasemi_mac {
struct pasemi_mac_txring *tx;
struct pasemi_mac_rxring *rx;
struct pasemi_mac_csring *cs[MAX_CS];
char tx_irq_name[10]; /* "eth%d tx" */
char rx_irq_name[10]; /* "eth%d rx" */
int link;
......
......@@ -128,11 +128,16 @@ enum {
#define PAS_DMA_TXCHAN_TCMDSTA_DA 0x00000100
#define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE)
#define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */
#define PAS_DMA_TXCHAN_CFG_TY_COPY 0x00000001 /* Type = copy only */
#define PAS_DMA_TXCHAN_CFG_TY_FUNC 0x00000002 /* Type = function */
#define PAS_DMA_TXCHAN_CFG_TY_XOR 0x00000003 /* Type = xor only */
#define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c
#define PAS_DMA_TXCHAN_CFG_TATTR_S 2
#define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \
PAS_DMA_TXCHAN_CFG_TATTR_M)
#define PAS_DMA_TXCHAN_CFG_WT_M 0x000001c0
#define PAS_DMA_TXCHAN_CFG_LPDQ 0x00000800
#define PAS_DMA_TXCHAN_CFG_LPSQ 0x00000400
#define PAS_DMA_TXCHAN_CFG_WT_M 0x000003c0
#define PAS_DMA_TXCHAN_CFG_WT_S 6
#define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \
PAS_DMA_TXCHAN_CFG_WT_M)
......@@ -399,11 +404,62 @@ enum {
XCT_COPY_LLEN_M)
#define XCT_COPY_SE 0x0000000000000001ull
/* Function descriptor fields */
#define XCT_FUN_T 0x8000000000000000ull
#define XCT_FUN_ST 0x4000000000000000ull
#define XCT_FUN_RR_M 0x3000000000000000ull
#define XCT_FUN_RR_NORES 0x0000000000000000ull
#define XCT_FUN_RR_8BRES 0x1000000000000000ull
#define XCT_FUN_RR_24BRES 0x2000000000000000ull
#define XCT_FUN_RR_40BRES 0x3000000000000000ull
#define XCT_FUN_I 0x0800000000000000ull
#define XCT_FUN_O 0x0400000000000000ull
#define XCT_FUN_E 0x0200000000000000ull
#define XCT_FUN_FUN_M 0x01c0000000000000ull
#define XCT_FUN_FUN_S 54
#define XCT_FUN_FUN(x) ((((long)(x)) << XCT_FUN_FUN_S) & XCT_FUN_FUN_M)
#define XCT_FUN_CRM_M 0x0038000000000000ull
#define XCT_FUN_CRM_NOP 0x0000000000000000ull
#define XCT_FUN_CRM_SIG 0x0008000000000000ull
#define XCT_FUN_LLEN_M 0x0007ffff00000000ull
#define XCT_FUN_LLEN_S 32
#define XCT_FUN_LLEN(x) ((((long)(x)) << XCT_FUN_LLEN_S) & XCT_FUN_LLEN_M)
#define XCT_FUN_SHL_M 0x00000000f8000000ull
#define XCT_FUN_SHL_S 27
#define XCT_FUN_SHL(x) ((((long)(x)) << XCT_FUN_SHL_S) & XCT_FUN_SHL_M)
#define XCT_FUN_CHL_M 0x0000000007c00000ull
#define XCT_FUN_HSZ_M 0x00000000003c0000ull
#define XCT_FUN_ALG_M 0x0000000000038000ull
#define XCT_FUN_HP 0x0000000000004000ull
#define XCT_FUN_BCM_M 0x0000000000003800ull
#define XCT_FUN_BCP_M 0x0000000000000600ull
#define XCT_FUN_SIG_M 0x00000000000001f0ull
#define XCT_FUN_SIG_TCP4 0x0000000000000140ull
#define XCT_FUN_SIG_TCP6 0x0000000000000150ull
#define XCT_FUN_SIG_UDP4 0x0000000000000160ull
#define XCT_FUN_SIG_UDP6 0x0000000000000170ull
#define XCT_FUN_A 0x0000000000000008ull
#define XCT_FUN_C 0x0000000000000004ull
#define XCT_FUN_AL2 0x0000000000000002ull
#define XCT_FUN_SE 0x0000000000000001ull
/* Function descriptor 8byte result fields */
#define XCT_FUNRES_8B_CS_M 0x0000ffff00000000ull
#define XCT_FUNRES_8B_CS_S 32
#define XCT_FUNRES_8B_CRC_M 0x00000000ffffffffull
#define XCT_FUNRES_8B_CRC_S 0
/* Control descriptor fields */
#define CTRL_CMD_T 0x8000000000000000ull
#define CTRL_CMD_META_EVT 0x2000000000000000ull
#define CTRL_CMD_O 0x0400000000000000ull
#define CTRL_CMD_REG_M 0x000000000000000full
#define CTRL_CMD_ETYPE_M 0x0038000000000000ull
#define CTRL_CMD_ETYPE_EXT 0x0000000000000000ull
#define CTRL_CMD_ETYPE_WSET 0x0020000000000000ull
#define CTRL_CMD_ETYPE_WCLR 0x0028000000000000ull
#define CTRL_CMD_ETYPE_SET 0x0030000000000000ull
#define CTRL_CMD_ETYPE_CLR 0x0038000000000000ull
#define CTRL_CMD_REG_M 0x000000000000007full
#define CTRL_CMD_REG_S 0
#define CTRL_CMD_REG(x) ((((long)(x)) << CTRL_CMD_REG_S) & \
CTRL_CMD_REG_M)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment