aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/chelsio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/chelsio')
-rw-r--r--drivers/net/chelsio/Makefile9
-rw-r--r--drivers/net/chelsio/common.h353
-rw-r--r--drivers/net/chelsio/cphy.h175
-rw-r--r--drivers/net/chelsio/cpl5_cmd.h639
-rw-r--r--drivers/net/chelsio/cxgb2.c1379
-rw-r--r--drivers/net/chelsio/elmer0.h158
-rw-r--r--drivers/net/chelsio/espi.c373
-rw-r--r--drivers/net/chelsio/espi.h68
-rw-r--r--drivers/net/chelsio/fpga_defs.h232
-rw-r--r--drivers/net/chelsio/gmac.h142
-rw-r--r--drivers/net/chelsio/mv88e1xxx.c397
-rw-r--r--drivers/net/chelsio/mv88e1xxx.h127
-rw-r--r--drivers/net/chelsio/mv88x201x.c260
-rw-r--r--drivers/net/chelsio/my3126.c209
-rw-r--r--drivers/net/chelsio/pm3393.c796
-rw-r--r--drivers/net/chelsio/regs.h2168
-rw-r--r--drivers/net/chelsio/sge.c2140
-rw-r--r--drivers/net/chelsio/sge.h94
-rw-r--r--drivers/net/chelsio/subr.c1130
-rw-r--r--drivers/net/chelsio/suni1x10gexp_regs.h1643
-rw-r--r--drivers/net/chelsio/tp.c171
-rw-r--r--drivers/net/chelsio/tp.h72
-rw-r--r--drivers/net/chelsio/vsc7326.c730
-rw-r--r--drivers/net/chelsio/vsc7326_reg.h297
24 files changed, 0 insertions, 13762 deletions
diff --git a/drivers/net/chelsio/Makefile b/drivers/net/chelsio/Makefile
deleted file mode 100644
index 57a4b262fd3..00000000000
--- a/drivers/net/chelsio/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Chelsio T1 driver
-#
-
-obj-$(CONFIG_CHELSIO_T1) += cxgb.o
-
-cxgb-$(CONFIG_CHELSIO_T1_1G) += mv88e1xxx.o vsc7326.o
-cxgb-objs := cxgb2.o espi.o tp.o pm3393.o sge.o subr.o \
- mv88x201x.o my3126.o $(cxgb-y)
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
deleted file mode 100644
index 5ccbed1784d..00000000000
--- a/drivers/net/chelsio/common.h
+++ /dev/null
@@ -1,353 +0,0 @@
-/*****************************************************************************
- * *
- * File: common.h *
- * $Revision: 1.21 $ *
- * $Date: 2005/06/22 00:43:25 $ *
- * Description: *
- * part of the Chelsio 10Gb Ethernet Driver. *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License, version 2, as *
- * published by the Free Software Foundation. *
- * *
- * You should have received a copy of the GNU General Public License along *
- * with this program; if not, write to the Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
- * *
- * http://www.chelsio.com *
- * *
- * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
- * All rights reserved. *
- * *
- * Maintainers: maintainers@chelsio.com *
- * *
- * Authors: Dimitrios Michailidis <dm@chelsio.com> *
- * Tina Yang <tainay@chelsio.com> *
- * Felix Marti <felix@chelsio.com> *
- * Scott Bardone <sbardone@chelsio.com> *
- * Kurt Ottaway <kottaway@chelsio.com> *
- * Frank DiMambro <frank@chelsio.com> *
- * *
- * History: *
- * *
- ****************************************************************************/
-
-#define pr_fmt(fmt) "cxgb: " fmt
-
-#ifndef _CXGB_COMMON_H_
-#define _CXGB_COMMON_H_
-
-#include <linux/module.h>
-#include <linux/netdevice.h>
-#include <linux/types.h>
-#include <linux/delay.h>
-#include <linux/pci.h>
-#include <linux/ethtool.h>
-#include <linux/if_vlan.h>
-#include <linux/mdio.h>
-#include <linux/crc32.h>
-#include <linux/init.h>
-#include <linux/slab.h>
-#include <asm/io.h>
-#include <linux/pci_ids.h>
-
-#define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver"
-#define DRV_NAME "cxgb"
-#define DRV_VERSION "2.2"
-
-#define CH_DEVICE(devid, ssid, idx) \
- { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx }
-
-#define SUPPORTED_PAUSE (1 << 13)
-#define SUPPORTED_LOOPBACK (1 << 15)
-
-#define ADVERTISED_PAUSE (1 << 13)
-#define ADVERTISED_ASYM_PAUSE (1 << 14)
-
-typedef struct adapter adapter_t;
-
-struct t1_rx_mode {
- struct net_device *dev;
-};
-
-#define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC)
-#define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI)
-#define t1_rx_mode_mc_cnt(rm) (netdev_mc_count(rm->dev))
-#define t1_get_netdev(rm) (rm->dev)
-
-#define MAX_NPORTS 4
-#define PORT_MASK ((1 << MAX_NPORTS) - 1)
-#define NMTUS 8
-#define TCB_SIZE 128
-
-#define SPEED_INVALID 0xffff
-#define DUPLEX_INVALID 0xff
-
-enum {
- CHBT_BOARD_N110,
- CHBT_BOARD_N210,
- CHBT_BOARD_7500,
- CHBT_BOARD_8000,
- CHBT_BOARD_CHT101,
- CHBT_BOARD_CHT110,
- CHBT_BOARD_CHT210,
- CHBT_BOARD_CHT204,
- CHBT_BOARD_CHT204V,
- CHBT_BOARD_CHT204E,
- CHBT_BOARD_CHN204,
- CHBT_BOARD_COUGAR,
- CHBT_BOARD_6800,
- CHBT_BOARD_SIMUL,
-};
-
-enum {
- CHBT_TERM_FPGA,
- CHBT_TERM_T1,
- CHBT_TERM_T2,
- CHBT_TERM_T3
-};
-
-enum {
- CHBT_MAC_CHELSIO_A,
- CHBT_MAC_IXF1010,
- CHBT_MAC_PM3393,
- CHBT_MAC_VSC7321,
- CHBT_MAC_DUMMY
-};
-
-enum {
- CHBT_PHY_88E1041,
- CHBT_PHY_88E1111,
- CHBT_PHY_88X2010,
- CHBT_PHY_XPAK,
- CHBT_PHY_MY3126,
- CHBT_PHY_8244,
- CHBT_PHY_DUMMY
-};
-
-enum {
- PAUSE_RX = 1 << 0,
- PAUSE_TX = 1 << 1,
- PAUSE_AUTONEG = 1 << 2
-};
-
-/* Revisions of T1 chip */
-enum {
- TERM_T1A = 0,
- TERM_T1B = 1,
- TERM_T2 = 3
-};
-
-struct sge_params {
- unsigned int cmdQ_size[2];
- unsigned int freelQ_size[2];
- unsigned int large_buf_capacity;
- unsigned int rx_coalesce_usecs;
- unsigned int last_rx_coalesce_raw;
- unsigned int default_rx_coalesce_usecs;
- unsigned int sample_interval_usecs;
- unsigned int coalesce_enable;
- unsigned int polling;
-};
-
-struct chelsio_pci_params {
- unsigned short speed;
- unsigned char width;
- unsigned char is_pcix;
-};
-
-struct tp_params {
- unsigned int pm_size;
- unsigned int cm_size;
- unsigned int pm_rx_base;
- unsigned int pm_tx_base;
- unsigned int pm_rx_pg_size;
- unsigned int pm_tx_pg_size;
- unsigned int pm_rx_num_pgs;
- unsigned int pm_tx_num_pgs;
- unsigned int rx_coalescing_size;
- unsigned int use_5tuple_mode;
-};
-
-struct mc5_params {
- unsigned int mode; /* selects MC5 width */
- unsigned int nservers; /* size of server region */
- unsigned int nroutes; /* size of routing region */
-};
-
-/* Default MC5 region sizes */
-#define DEFAULT_SERVER_REGION_LEN 256
-#define DEFAULT_RT_REGION_LEN 1024
-
-struct adapter_params {
- struct sge_params sge;
- struct mc5_params mc5;
- struct tp_params tp;
- struct chelsio_pci_params pci;
-
- const struct board_info *brd_info;
-
- unsigned short mtus[NMTUS];
- unsigned int nports; /* # of ethernet ports */
- unsigned int stats_update_period;
- unsigned short chip_revision;
- unsigned char chip_version;
- unsigned char is_asic;
- unsigned char has_msi;
-};
-
-struct link_config {
- unsigned int supported; /* link capabilities */
- unsigned int advertising; /* advertised capabilities */
- unsigned short requested_speed; /* speed user has requested */
- unsigned short speed; /* actual link speed */
- unsigned char requested_duplex; /* duplex user has requested */
- unsigned char duplex; /* actual link duplex */
- unsigned char requested_fc; /* flow control user has requested */
- unsigned char fc; /* actual link flow control */
- unsigned char autoneg; /* autonegotiating? */
-};
-
-struct cmac;
-struct cphy;
-
-struct port_info {
- struct net_device *dev;
- struct cmac *mac;
- struct cphy *phy;
- struct link_config link_config;
- struct net_device_stats netstats;
-};
-
-struct sge;
-struct peespi;
-
-struct adapter {
- u8 __iomem *regs;
- struct pci_dev *pdev;
- unsigned long registered_device_map;
- unsigned long open_device_map;
- unsigned long flags;
-
- const char *name;
- int msg_enable;
- u32 mmio_len;
-
- struct work_struct ext_intr_handler_task;
- struct adapter_params params;
-
- /* Terminator modules. */
- struct sge *sge;
- struct peespi *espi;
- struct petp *tp;
-
- struct napi_struct napi;
- struct port_info port[MAX_NPORTS];
- struct delayed_work stats_update_task;
- struct timer_list stats_update_timer;
-
- spinlock_t tpi_lock;
- spinlock_t work_lock;
- spinlock_t mac_lock;
-
- /* guards async operations */
- spinlock_t async_lock ____cacheline_aligned;
- u32 slow_intr_mask;
- int t1powersave;
-};
-
-enum { /* adapter flags */
- FULL_INIT_DONE = 1 << 0,
-};
-
-struct mdio_ops;
-struct gmac;
-struct gphy;
-
-struct board_info {
- unsigned char board;
- unsigned char port_number;
- unsigned long caps;
- unsigned char chip_term;
- unsigned char chip_mac;
- unsigned char chip_phy;
- unsigned int clock_core;
- unsigned int clock_mc3;
- unsigned int clock_mc4;
- unsigned int espi_nports;
- unsigned int clock_elmer0;
- unsigned char mdio_mdien;
- unsigned char mdio_mdiinv;
- unsigned char mdio_mdc;
- unsigned char mdio_phybaseaddr;
- const struct gmac *gmac;
- const struct gphy *gphy;
- const struct mdio_ops *mdio_ops;
- const char *desc;
-};
-
-static inline int t1_is_asic(const adapter_t *adapter)
-{
- return adapter->params.is_asic;
-}
-
-extern const struct pci_device_id t1_pci_tbl[];
-
-static inline int adapter_matches_type(const adapter_t *adapter,
- int version, int revision)
-{
- return adapter->params.chip_version == version &&
- adapter->params.chip_revision == revision;
-}
-
-#define t1_is_T1B(adap) adapter_matches_type(adap, CHBT_TERM_T1, TERM_T1B)
-#define is_T2(adap) adapter_matches_type(adap, CHBT_TERM_T2, TERM_T2)
-
-/* Returns true if an adapter supports VLAN acceleration and TSO */
-static inline int vlan_tso_capable(const adapter_t *adapter)
-{
- return !t1_is_T1B(adapter);
-}
-
-#define for_each_port(adapter, iter) \
- for (iter = 0; iter < (adapter)->params.nports; ++iter)
-
-#define board_info(adapter) ((adapter)->params.brd_info)
-#define is_10G(adapter) (board_info(adapter)->caps & SUPPORTED_10000baseT_Full)
-
-static inline unsigned int core_ticks_per_usec(const adapter_t *adap)
-{
- return board_info(adap)->clock_core / 1000000;
-}
-
-extern int __t1_tpi_read(adapter_t *adapter, u32 addr, u32 *valp);
-extern int __t1_tpi_write(adapter_t *adapter, u32 addr, u32 value);
-extern int t1_tpi_write(adapter_t *adapter, u32 addr, u32 value);
-extern int t1_tpi_read(adapter_t *adapter, u32 addr, u32 *value);
-
-extern void t1_interrupts_enable(adapter_t *adapter);
-extern void t1_interrupts_disable(adapter_t *adapter);
-extern void t1_interrupts_clear(adapter_t *adapter);
-extern int t1_elmer0_ext_intr_handler(adapter_t *adapter);
-extern void t1_elmer0_ext_intr(adapter_t *adapter);
-extern int t1_slow_intr_handler(adapter_t *adapter);
-
-extern int t1_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc);
-extern const struct board_info *t1_get_board_info(unsigned int board_id);
-extern const struct board_info *t1_get_board_info_from_ids(unsigned int devid,
- unsigned short ssid);
-extern int t1_seeprom_read(adapter_t *adapter, u32 addr, __le32 *data);
-extern int t1_get_board_rev(adapter_t *adapter, const struct board_info *bi,
- struct adapter_params *p);
-extern int t1_init_hw_modules(adapter_t *adapter);
-extern int t1_init_sw_modules(adapter_t *adapter, const struct board_info *bi);
-extern void t1_free_sw_modules(adapter_t *adapter);
-extern void t1_fatal_err(adapter_t *adapter);
-extern void t1_link_changed(adapter_t *adapter, int port_id);
-extern void t1_link_negotiated(adapter_t *adapter, int port_id, int link_stat,
- int speed, int duplex, int pause);
-#endif /* _CXGB_COMMON_H_ */
diff --git a/drivers/net/chelsio/cphy.h b/drivers/net/chelsio/cphy.h
deleted file mode 100644
index 1f095a9fc73..00000000000
--- a/drivers/net/chelsio/cphy.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*****************************************************************************
- * *
- * File: cphy.h *
- * $Revision: 1.7 $ *
- * $Date: 2005/06/21 18:29:47 $ *
- * Description: *
- * part of the Chelsio 10Gb Ethernet Driver. *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License, version 2, as *
- * published by the Free Software Foundation. *
- * *
- * You should have received a copy of the GNU General Public License along *
- * with this program; if not, write to the Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
- * *
- * http://www.chelsio.com *
- * *
- * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
- * All rights reserved. *
- * *
- * Maintainers: maintainers@chelsio.com *
- * *
- * Authors: Dimitrios Michailidis <dm@chelsio.com> *
- * Tina Yang <tainay@chelsio.com> *
- * Felix Marti <felix@chelsio.com> *
- * Scott Bardone <sbardone@chelsio.com> *
- * Kurt Ottaway <kottaway@chelsio.com> *
- * Frank DiMambro <frank@chelsio.com> *
- * *
- * History: *
- * *
- ****************************************************************************/
-
-#ifndef _CXGB_CPHY_H_
-#define _CXGB_CPHY_H_
-
-#include "common.h"
-
-struct mdio_ops {
- void (*init)(adapter_t *adapter, const struct board_info *bi);
- int (*read)(struct net_device *dev, int phy_addr, int mmd_addr,
- u16 reg_addr);
- int (*write)(struct net_device *dev, int phy_addr, int mmd_addr,
- u16 reg_addr, u16 val);
- unsigned mode_support;
-};
-
-/* PHY interrupt types */
-enum {
- cphy_cause_link_change = 0x1,
- cphy_cause_error = 0x2,
- cphy_cause_fifo_error = 0x3
-};
-
-enum {
- PHY_LINK_UP = 0x1,
- PHY_AUTONEG_RDY = 0x2,
- PHY_AUTONEG_EN = 0x4
-};
-
-struct cphy;
-
-/* PHY operations */
-struct cphy_ops {
- void (*destroy)(struct cphy *);
- int (*reset)(struct cphy *, int wait);
-
- int (*interrupt_enable)(struct cphy *);
- int (*interrupt_disable)(struct cphy *);
- int (*interrupt_clear)(struct cphy *);
- int (*interrupt_handler)(struct cphy *);
-
- int (*autoneg_enable)(struct cphy *);
- int (*autoneg_disable)(struct cphy *);
- int (*autoneg_restart)(struct cphy *);
-
- int (*advertise)(struct cphy *phy, unsigned int advertise_map);
- int (*set_loopback)(struct cphy *, int on);
- int (*set_speed_duplex)(struct cphy *phy, int speed, int duplex);
- int (*get_link_status)(struct cphy *phy, int *link_ok, int *speed,
- int *duplex, int *fc);
-
- u32 mmds;
-};
-
-/* A PHY instance */
-struct cphy {
- int state; /* Link status state machine */
- adapter_t *adapter; /* associated adapter */
-
- struct delayed_work phy_update;
-
- u16 bmsr;
- int count;
- int act_count;
- int act_on;
-
- u32 elmer_gpo;
-
- const struct cphy_ops *ops; /* PHY operations */
- struct mdio_if_info mdio;
- struct cphy_instance *instance;
-};
-
-/* Convenience MDIO read/write wrappers */
-static inline int cphy_mdio_read(struct cphy *cphy, int mmd, int reg,
- unsigned int *valp)
-{
- int rc = cphy->mdio.mdio_read(cphy->mdio.dev, cphy->mdio.prtad, mmd,
- reg);
- *valp = (rc >= 0) ? rc : -1;
- return (rc >= 0) ? 0 : rc;
-}
-
-static inline int cphy_mdio_write(struct cphy *cphy, int mmd, int reg,
- unsigned int val)
-{
- return cphy->mdio.mdio_write(cphy->mdio.dev, cphy->mdio.prtad, mmd,
- reg, val);
-}
-
-static inline int simple_mdio_read(struct cphy *cphy, int reg,
- unsigned int *valp)
-{
- return cphy_mdio_read(cphy, MDIO_DEVAD_NONE, reg, valp);
-}
-
-static inline int simple_mdio_write(struct cphy *cphy, int reg,
- unsigned int val)
-{
- return cphy_mdio_write(cphy, MDIO_DEVAD_NONE, reg, val);
-}
-
-/* Convenience initializer */
-static inline void cphy_init(struct cphy *phy, struct net_device *dev,
- int phy_addr, struct cphy_ops *phy_ops,
- const struct mdio_ops *mdio_ops)
-{
- struct adapter *adapter = netdev_priv(dev);
- phy->adapter = adapter;
- phy->ops = phy_ops;
- if (mdio_ops) {
- phy->mdio.prtad = phy_addr;
- phy->mdio.mmds = phy_ops->mmds;
- phy->mdio.mode_support = mdio_ops->mode_support;
- phy->mdio.mdio_read = mdio_ops->read;
- phy->mdio.mdio_write = mdio_ops->write;
- }
- phy->mdio.dev = dev;
-}
-
-/* Operations of the PHY-instance factory */
-struct gphy {
- /* Construct a PHY instance with the given PHY address */
- struct cphy *(*create)(struct net_device *dev, int phy_addr,
- const struct mdio_ops *mdio_ops);
-
- /*
- * Reset the PHY chip. This resets the whole PHY chip, not individual
- * ports.
- */
- int (*reset)(adapter_t *adapter);
-};
-
-extern const struct gphy t1_my3126_ops;
-extern const struct gphy t1_mv88e1xxx_ops;
-extern const struct gphy t1_vsc8244_ops;
-extern const struct gphy t1_mv88x201x_ops;
-
-#endif /* _CXGB_CPHY_H_ */
diff --git a/drivers/net/chelsio/cpl5_cmd.h b/drivers/net/chelsio/cpl5_cmd.h
deleted file mode 100644
index e36d45b78cc..00000000000
--- a/drivers/net/chelsio/cpl5_cmd.h
+++ /dev/null
@@ -1,639 +0,0 @@
-/*****************************************************************************
- * *
- * File: cpl5_cmd.h *
- * $Revision: 1.6 $ *
- * $Date: 2005/06/21 18:29:47 $ *
- * Description: *
- * part of the Chelsio 10Gb Ethernet Driver. *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License, version 2, as *
- * published by the Free Software Foundation. *
- * *
- * You should have received a copy of the GNU General Public License along *
- * with this program; if not, write to the Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
- * *
- * http://www.chelsio.com *
- * *
- * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
- * All rights reserved. *
- * *
- * Maintainers: maintainers@chelsio.com *
- * *
- * Authors: Dimitrios Michailidis <dm@chelsio.com> *
- * Tina Yang <tainay@chelsio.com> *
- * Felix Marti <felix@chelsio.com> *
- * Scott Bardone <sbardone@chelsio.com> *
- * Kurt Ottaway <kottaway@chelsio.com> *
- * Frank DiMambro <frank@chelsio.com> *
- * *
- * History: *
- * *
- ****************************************************************************/
-
-#ifndef _CXGB_CPL5_CMD_H_
-#define _CXGB_CPL5_CMD_H_
-
-#include <asm/byteorder.h>
-
-#if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
-#error "Adjust your <asm/byteorder.h> defines"
-#endif
-
-enum CPL_opcode {
- CPL_PASS_OPEN_REQ = 0x1,
- CPL_PASS_OPEN_RPL = 0x2,
- CPL_PASS_ESTABLISH = 0x3,
- CPL_PASS_ACCEPT_REQ = 0xE,
- CPL_PASS_ACCEPT_RPL = 0x4,
- CPL_ACT_OPEN_REQ = 0x5,
- CPL_ACT_OPEN_RPL = 0x6,
- CPL_CLOSE_CON_REQ = 0x7,
- CPL_CLOSE_CON_RPL = 0x8,
- CPL_CLOSE_LISTSRV_REQ = 0x9,
- CPL_CLOSE_LISTSRV_RPL = 0xA,
- CPL_ABORT_REQ = 0xB,
- CPL_ABORT_RPL = 0xC,
- CPL_PEER_CLOSE = 0xD,
- CPL_ACT_ESTABLISH = 0x17,
-
- CPL_GET_TCB = 0x24,
- CPL_GET_TCB_RPL = 0x25,
- CPL_SET_TCB = 0x26,
- CPL_SET_TCB_FIELD = 0x27,
- CPL_SET_TCB_RPL = 0x28,
- CPL_PCMD = 0x29,
-
- CPL_PCMD_READ = 0x31,
- CPL_PCMD_READ_RPL = 0x32,
-
-
- CPL_RX_DATA = 0xA0,
- CPL_RX_DATA_DDP = 0xA1,
- CPL_RX_DATA_ACK = 0xA3,
- CPL_RX_PKT = 0xAD,
- CPL_RX_ISCSI_HDR = 0xAF,
- CPL_TX_DATA_ACK = 0xB0,
- CPL_TX_DATA = 0xB1,
- CPL_TX_PKT = 0xB2,
- CPL_TX_PKT_LSO = 0xB6,
-
- CPL_RTE_DELETE_REQ = 0xC0,
- CPL_RTE_DELETE_RPL = 0xC1,
- CPL_RTE_WRITE_REQ = 0xC2,
- CPL_RTE_WRITE_RPL = 0xD3,
- CPL_RTE_READ_REQ = 0xC3,
- CPL_RTE_READ_RPL = 0xC4,
- CPL_L2T_WRITE_REQ = 0xC5,
- CPL_L2T_WRITE_RPL = 0xD4,
- CPL_L2T_READ_REQ = 0xC6,
- CPL_L2T_READ_RPL = 0xC7,
- CPL_SMT_WRITE_REQ = 0xC8,
- CPL_SMT_WRITE_RPL = 0xD5,
- CPL_SMT_READ_REQ = 0xC9,
- CPL_SMT_READ_RPL = 0xCA,
- CPL_ARP_MISS_REQ = 0xCD,
- CPL_ARP_MISS_RPL = 0xCE,
- CPL_MIGRATE_C2T_REQ = 0xDC,
- CPL_MIGRATE_C2T_RPL = 0xDD,
- CPL_ERROR = 0xD7,
-
- /* internal: driver -> TOM */
- CPL_MSS_CHANGE = 0xE1
-};
-
-#define NUM_CPL_CMDS 256
-
-enum CPL_error {
- CPL_ERR_NONE = 0,
- CPL_ERR_TCAM_PARITY = 1,
- CPL_ERR_TCAM_FULL = 3,
- CPL_ERR_CONN_RESET = 20,
- CPL_ERR_CONN_EXIST = 22,
- CPL_ERR_ARP_MISS = 23,
- CPL_ERR_BAD_SYN = 24,
- CPL_ERR_CONN_TIMEDOUT = 30,
- CPL_ERR_XMIT_TIMEDOUT = 31,
- CPL_ERR_PERSIST_TIMEDOUT = 32,
- CPL_ERR_FINWAIT2_TIMEDOUT = 33,
- CPL_ERR_KEEPALIVE_TIMEDOUT = 34,
- CPL_ERR_ABORT_FAILED = 42,
- CPL_ERR_GENERAL = 99
-};
-
-enum {
- CPL_CONN_POLICY_AUTO = 0,
- CPL_CONN_POLICY_ASK = 1,
- CPL_CONN_POLICY_DENY = 3
-};
-
-enum {
- ULP_MODE_NONE = 0,
- ULP_MODE_TCPDDP = 1,
- ULP_MODE_ISCSI = 2,
- ULP_MODE_IWARP = 3,
- ULP_MODE_SSL = 4
-};
-
-enum {
- CPL_PASS_OPEN_ACCEPT,
- CPL_PASS_OPEN_REJECT
-};
-
-enum {
- CPL_ABORT_SEND_RST = 0,
- CPL_ABORT_NO_RST,
- CPL_ABORT_POST_CLOSE_REQ = 2
-};
-
-enum { // TX_PKT_LSO ethernet types
- CPL_ETH_II,
- CPL_ETH_II_VLAN,
- CPL_ETH_802_3,
- CPL_ETH_802_3_VLAN
-};
-
-union opcode_tid {
- u32 opcode_tid;
- u8 opcode;
-};
-
-#define S_OPCODE 24
-#define V_OPCODE(x) ((x) << S_OPCODE)
-#define G_OPCODE(x) (((x) >> S_OPCODE) & 0xFF)
-#define G_TID(x) ((x) & 0xFFFFFF)
-
-/* tid is assumed to be 24-bits */
-#define MK_OPCODE_TID(opcode, tid) (V_OPCODE(opcode) | (tid))
-
-#define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
-
-/* extract the TID from a CPL command */
-#define GET_TID(cmd) (G_TID(ntohl(OPCODE_TID(cmd))))
-
-struct tcp_options {
- u16 mss;
- u8 wsf;
-#if defined(__LITTLE_ENDIAN_BITFIELD)
- u8 rsvd:4;
- u8 ecn:1;
- u8 sack:1;
- u8 tstamp:1;
-#else
- u8 tstamp:1;
- u8 sack:1;
- u8 ecn:1;
- u8 rsvd:4;
-#endif
-};
-
-struct cpl_pass_open_req {
- union opcode_tid ot;
- u16 local_port;
- u16 peer_port;
- u32 local_ip;
- u32 peer_ip;
- u32 opt0h;
- u32 opt0l;
- u32 peer_netmask;
- u32 opt1;
-};
-
-struct cpl_pass_open_rpl {
- union opcode_tid ot;
- u16 local_port;
- u16 peer_port;
- u32 local_ip;
- u32 peer_ip;
- u8 resvd[7];
- u8 status;
-};
-
-struct cpl_pass_establish {
- union opcode_tid ot;
- u16 local_port;
- u16 peer_port;
- u32 local_ip;
- u32 peer_ip;
- u32 tos_tid;
- u8 l2t_idx;
- u8 rsvd[3];
- u32 snd_isn;
- u32 rcv_isn;
-};
-
-struct cpl_pass_accept_req {
- union opcode_tid ot;
- u16 local_port;
- u16 peer_port;
- u32 local_ip;
- u32 peer_ip;
- u32 tos_tid;
- struct tcp_options tcp_options;
- u8 dst_mac[6];
- u16 vlan_tag;
- u8 src_mac[6];
- u8 rsvd[2];
- u32 rcv_isn;
- u32 unknown_tcp_options;
-};
-
-struct cpl_pass_accept_rpl {
- union opcode_tid ot;
- u32 rsvd0;
- u32 rsvd1;
- u32 peer_ip;
- u32 opt0h;
- union {
- u32 opt0l;
- struct {
- u8 rsvd[3];
- u8 status;
- };
- };
-};
-
-struct cpl_act_open_req {
- union opcode_tid ot;
- u16 local_port;
- u16 peer_port;
- u32 local_ip;
- u32 peer_ip;
- u32 opt0h;
- u32 opt0l;
- u32 iff_vlantag;
- u32 rsvd;
-};
-
-struct cpl_act_open_rpl {
- union opcode_tid ot;
- u16 local_port;
- u16 peer_port;
- u32 local_ip;
- u32 peer_ip;
- u32 new_tid;
- u8 rsvd[3];
- u8 status;
-};
-
-struct cpl_act_establish {
- union opcode_tid ot;
- u16 local_port;
- u16 peer_port;
- u32 local_ip;
- u32 peer_ip;
- u32 tos_tid;
- u32 rsvd;
- u32 snd_isn;
- u32 rcv_isn;
-};
-
-struct cpl_get_tcb {
- union opcode_tid ot;
- u32 rsvd;
-};
-
-struct cpl_get_tcb_rpl {
- union opcode_tid ot;
- u16 len;
- u8 rsvd;
- u8 status;
-};
-
-struct cpl_set_tcb {
- union opcode_tid ot;
- u16 len;
- u16 rsvd;
-};
-
-struct cpl_set_tcb_field {
- union opcode_tid ot;
- u8 rsvd[3];
- u8 offset;
- u32 mask;
- u32 val;
-};
-
-struct cpl_set_tcb_rpl {
- union opcode_tid ot;
- u8 rsvd[3];
- u8 status;
-};
-
-struct cpl_pcmd {
- union opcode_tid ot;
- u16 dlen_in;
- u16 dlen_out;
- u32 pcmd_parm[2];
-};
-
-struct cpl_pcmd_read {
- union opcode_tid ot;
- u32 rsvd1;
- u16 rsvd2;
- u32 addr;
- u16 len;
-};
-
-struct cpl_pcmd_read_rpl {
- union opcode_tid ot;
- u16 len;
-};
-
-struct cpl_close_con_req {
- union opcode_tid ot;
- u32 rsvd;
-};
-
-struct cpl_close_con_rpl {
- union opcode_tid ot;
- u8 rsvd[3];
- u8 status;
- u32 snd_nxt;
- u32 rcv_nxt;
-};
-
-struct cpl_close_listserv_req {
- union opcode_tid ot;
- u32 rsvd;
-};
-
-struct cpl_close_listserv_rpl {
- union opcode_tid ot;
- u8 rsvd[3];
- u8 status;
-};
-
-struct cpl_abort_req {
- union opcode_tid ot;
- u32 rsvd0;
- u8 rsvd1;
- u8 cmd;
- u8 rsvd2[6];
-};
-
-struct cpl_abort_rpl {
- union opcode_tid ot;
- u32 rsvd0;
- u8 rsvd1;
- u8 status;
- u8 rsvd2[6];
-};
-
-struct cpl_peer_close {
- union opcode_tid ot;
- u32 rsvd;
-};
-
-struct cpl_tx_data {
- union opcode_tid ot;
- u32 len;
- u32 rsvd0;
- u16 urg;
- u16 flags;
-};
-
-struct