From 415294ecbb32ddbd0a7a2b7bae0b60fedfa09cc4 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 1 Dec 2006 16:36:15 -0800 Subject: [PATCH] chelsio: remove unused mutex This mutex is unused in current (non TOE) code. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/chelsio/common.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/net/chelsio/common.h') diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h index 5d9dd14427c5..efe1f6685285 100644 --- a/drivers/net/chelsio/common.h +++ b/drivers/net/chelsio/common.h @@ -212,7 +212,6 @@ struct adapter { struct work_struct stats_update_task; struct timer_list stats_update_timer; - struct semaphore mib_mutex; spinlock_t tpi_lock; spinlock_t work_lock; /* guards async operations */ -- cgit v1.2.3 From f1d3d38af75789f1b82969b83b69cab540609789 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 1 Dec 2006 16:36:16 -0800 Subject: [PATCH] chelsio: add support for other 10G boards Add support for other versions of the 10G Chelsio boards. This is basically a port of the vendor driver with the TOE features removed. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/chelsio/common.h | 101 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 13 deletions(-) (limited to 'drivers/net/chelsio/common.h') diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h index efe1f6685285..e4e59d2d410e 100644 --- a/drivers/net/chelsio/common.h +++ b/drivers/net/chelsio/common.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -53,13 +54,30 @@ #define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver" #define DRV_NAME "cxgb" -#define DRV_VERSION "2.1.1" +#define DRV_VERSION "2.2" #define PFX DRV_NAME ": " #define CH_ERR(fmt, ...) printk(KERN_ERR PFX fmt, ## __VA_ARGS__) #define CH_WARN(fmt, ...) printk(KERN_WARNING PFX fmt, ## __VA_ARGS__) #define CH_ALERT(fmt, ...) printk(KERN_ALERT PFX fmt, ## __VA_ARGS__) +/* + * More powerful macro that selectively prints messages based on msg_enable. + * For info and debugging messages. + */ +#define CH_MSG(adapter, level, category, fmt, ...) do { \ + if ((adapter)->msg_enable & NETIF_MSG_##category) \ + printk(KERN_##level PFX "%s: " fmt, (adapter)->name, \ + ## __VA_ARGS__); \ +} while (0) + +#ifdef DEBUG +# define CH_DBG(adapter, category, fmt, ...) \ + CH_MSG(adapter, DEBUG, category, fmt, ## __VA_ARGS__) +#else +# define CH_DBG(fmt, ...) +#endif + #define CH_DEVICE(devid, ssid, idx) \ { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx } @@ -71,10 +89,6 @@ typedef struct adapter adapter_t; -void t1_elmer0_ext_intr(adapter_t *adapter); -void t1_link_changed(adapter_t *adapter, int port_id, int link_status, - int speed, int duplex, int fc); - struct t1_rx_mode { struct net_device *dev; u32 idx; @@ -97,26 +111,53 @@ static inline u8 *t1_get_next_mcaddr(struct t1_rx_mode *rm) } #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_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_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 { @@ -150,16 +191,43 @@ struct chelsio_pci_params { 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; }; struct link_config { @@ -207,6 +275,7 @@ struct adapter { /* Terminator modules. */ struct sge *sge; struct peespi *espi; + struct petp *tp; struct port_info port[MAX_NPORTS]; struct work_struct stats_update_task; @@ -217,6 +286,7 @@ struct adapter { /* guards async operations */ spinlock_t async_lock ____cacheline_aligned; u32 slow_intr_mask; + int t1powersave; }; enum { /* adapter flags */ @@ -255,6 +325,11 @@ struct board_info { const char *desc; }; +static inline int t1_is_asic(const adapter_t *adapter) +{ + return adapter->params.is_asic; +} + extern struct pci_device_id t1_pci_tbl[]; static inline int adapter_matches_type(const adapter_t *adapter, @@ -284,13 +359,15 @@ 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 elmer0_ext_intr_handler(adapter_t *adapter); +extern int t1_elmer0_ext_intr_handler(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); @@ -304,9 +381,7 @@ 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_tp_set_udp_checksum_offload(adapter_t *adapter, int enable); -extern void t1_tp_set_tcp_checksum_offload(adapter_t *adapter, int enable); -extern void t1_tp_set_ip_checksum_offload(adapter_t *adapter, int enable); - +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_ */ -- cgit v1.2.3 From 352c417ddb593de757f0ee1fa490cb5444778c41 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 1 Dec 2006 16:36:17 -0800 Subject: [PATCH] chelsio: add 1G swcixw aupport Add support for 1G versions of Chelsio devices. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/chelsio/common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/chelsio/common.h') diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h index e4e59d2d410e..55f1eaad115c 100644 --- a/drivers/net/chelsio/common.h +++ b/drivers/net/chelsio/common.h @@ -283,6 +283,8 @@ struct adapter { 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; -- cgit v1.2.3 From 325dde48914e8ec1614d79ffacdbf9c0b8d24f42 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 1 Dec 2006 16:36:20 -0800 Subject: [PATCH] chelsio: add MSI support Using MSI can avoid sharing IRQ and associated overhead. Tested on PCI-X. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/chelsio/common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/chelsio/common.h') diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h index 55f1eaad115c..b265941e1372 100644 --- a/drivers/net/chelsio/common.h +++ b/drivers/net/chelsio/common.h @@ -228,6 +228,7 @@ struct adapter_params { unsigned short chip_revision; unsigned char chip_version; unsigned char is_asic; + unsigned char has_msi; }; struct link_config { -- cgit v1.2.3