diff options
author | Christoph Lameter <christoph@graphe.net> | 2005-03-30 16:34:31 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-15 19:15:02 -0400 |
commit | 8199d3a79c224bbe5943fa08684e1f93a17881b0 (patch) | |
tree | 77726ddade7ca4282bc12315abcb01fdf241be74 /drivers/net/chelsio/cxgb2.h | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
[PATCH] A new 10GB Ethernet Driver by Chelsio Communications
A Linux driver for the Chelsio 10Gb Ethernet Network Controller by Chelsio
(http://www.chelsio.com). This driver supports the Chelsio N210 NIC and is
backward compatible with the Chelsio N110 model 10Gb NICs. It supports
AMD64, EM64T and x86 systems.
Signed-off-by: Tina Yang <tinay@chelsio.com>
Signed-off-by: Scott Bardone <sbardone@chelsio.com>
Signed-off-by: Christoph Lameter <christoph@lameter.com>
Adrian said:
- my3126.c is unused (because t1_my3126_ops isn't used anywhere)
- what are the EXTRA_CFLAGS in drivers/net/chelsio/Makefile for?
- $(cxgb-y) in drivers/net/chelsio/Makefile seems to be unneeded
- completely unused global functions:
- espi.c: t1_espi_get_intr_counts
- sge.c: t1_sge_get_intr_counts
- the following functions can be made static:
- sge.c: t1_espi_workaround
- sge.c: t1_sge_tx
- subr.c: __t1_tpi_read
- subr.c: __t1_tpi_write
- subr.c: t1_wait_op_done
shemminger said:
The performance recommendations in cxgb.txt are common to all fast devices,
and should be in one file rather than just for this device. I would rather
see ip-sysctl.txt updated or a new file on tuning recommendations started.
Some of them have consequences that aren't documented well.
For example, turning off TCP timestamps risks data corruption from sequence wrap.
A new driver shouldn't need so may #ifdef's unless you want to putit on older
vendor versions of 2.4
Some accessor and wrapper functions like:
t1_pci_read_config_4
adapter_name
t1_malloc
are just annoying noise.
Why have useless dead code like:
/* Interrupt handler */
+static int pm3393_interrupt_handler(struct cmac *cmac)
+{
+ u32 master_intr_status;
+/*
+ 1. Read master interrupt register.
+ 2. Read BLOCK's interrupt status registers.
+ 3. Handle BLOCK interrupts.
+*/
Jeff said:
step 1: kill all the OS wrappers.
And do you really need hooks for multiple MACs, when only one MAC is
really supported? Typically these hooks are at a higher level anyway --
struct net_device.
From: Christoph Lameter <christoph@lameter
Driver modified as suggested by Pekka Enberg, Stephen Hemminger and Andrian
Bunk. Reduces the size of the driver to ~260k.
- clean up tabs
- removed my3126.c
- removed 85% of suni1x10gexp_regs.h
- removed 80% of regs.h
- removed various calls, renamed variables/functions.
- removed system specific and other wrappers (usleep, msleep)
- removed dead code
- dropped redundant casts in osdep.h
- dropped redundant check of kfree
- dropped weird code (MODVERSIONS stuff)
- reduced number of #ifdefs
- use kcalloc now instead of kmalloc
- Add information about known issues with the driver
- Add information about authors
Signed-off-by: Scott Bardone <sbardone@chelsio.com>
Signed-off-by: Christoph Lameter <christoph@lameter.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
diff -puN /dev/null Documentation/networking/cxgb.txt
Diffstat (limited to 'drivers/net/chelsio/cxgb2.h')
-rw-r--r-- | drivers/net/chelsio/cxgb2.h | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/drivers/net/chelsio/cxgb2.h b/drivers/net/chelsio/cxgb2.h new file mode 100644 index 000000000000..6ac326afcf01 --- /dev/null +++ b/drivers/net/chelsio/cxgb2.h | |||
@@ -0,0 +1,122 @@ | |||
1 | /***************************************************************************** | ||
2 | * * | ||
3 | * File: cxgb2.h * | ||
4 | * $Revision: 1.8 $ * | ||
5 | * $Date: 2005/03/23 07:41:27 $ * | ||
6 | * Description: * | ||
7 | * part of the Chelsio 10Gb Ethernet Driver. * | ||
8 | * * | ||
9 | * This program is free software; you can redistribute it and/or modify * | ||
10 | * it under the terms of the GNU General Public License, version 2, as * | ||
11 | * published by the Free Software Foundation. * | ||
12 | * * | ||
13 | * You should have received a copy of the GNU General Public License along * | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., * | ||
15 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | ||
16 | * * | ||
17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * | ||
18 | * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * | ||
19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * | ||
20 | * * | ||
21 | * http://www.chelsio.com * | ||
22 | * * | ||
23 | * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. * | ||
24 | * All rights reserved. * | ||
25 | * * | ||
26 | * Maintainers: maintainers@chelsio.com * | ||
27 | * * | ||
28 | * Authors: Dimitrios Michailidis <dm@chelsio.com> * | ||
29 | * Tina Yang <tainay@chelsio.com> * | ||
30 | * Felix Marti <felix@chelsio.com> * | ||
31 | * Scott Bardone <sbardone@chelsio.com> * | ||
32 | * Kurt Ottaway <kottaway@chelsio.com> * | ||
33 | * Frank DiMambro <frank@chelsio.com> * | ||
34 | * * | ||
35 | * History: * | ||
36 | * * | ||
37 | ****************************************************************************/ | ||
38 | |||
39 | #ifndef __CXGB_LINUX_H__ | ||
40 | #define __CXGB_LINUX_H__ | ||
41 | |||
42 | #include <linux/netdevice.h> | ||
43 | #include <linux/skbuff.h> | ||
44 | #include <linux/version.h> | ||
45 | #include <asm/semaphore.h> | ||
46 | #include <asm/bitops.h> | ||
47 | |||
48 | /* This belongs in if_ether.h */ | ||
49 | #define ETH_P_CPL5 0xf | ||
50 | |||
51 | struct cmac; | ||
52 | struct cphy; | ||
53 | |||
54 | struct port_info { | ||
55 | struct net_device *dev; | ||
56 | struct cmac *mac; | ||
57 | struct cphy *phy; | ||
58 | struct link_config link_config; | ||
59 | struct net_device_stats netstats; | ||
60 | }; | ||
61 | |||
62 | struct cxgbdev; | ||
63 | struct t1_sge; | ||
64 | struct pemc3; | ||
65 | struct pemc4; | ||
66 | struct pemc5; | ||
67 | struct peulp; | ||
68 | struct petp; | ||
69 | struct pecspi; | ||
70 | struct peespi; | ||
71 | struct work_struct; | ||
72 | struct vlan_group; | ||
73 | |||
74 | enum { /* adapter flags */ | ||
75 | FULL_INIT_DONE = 0x1, | ||
76 | USING_MSI = 0x2, | ||
77 | TSO_CAPABLE = 0x4, | ||
78 | TCP_CSUM_CAPABLE = 0x8, | ||
79 | UDP_CSUM_CAPABLE = 0x10, | ||
80 | VLAN_ACCEL_CAPABLE = 0x20, | ||
81 | RX_CSUM_ENABLED = 0x40, | ||
82 | }; | ||
83 | |||
84 | struct adapter { | ||
85 | u8 *regs; | ||
86 | struct pci_dev *pdev; | ||
87 | unsigned long registered_device_map; | ||
88 | unsigned long open_device_map; | ||
89 | unsigned int flags; | ||
90 | |||
91 | const char *name; | ||
92 | int msg_enable; | ||
93 | u32 mmio_len; | ||
94 | |||
95 | struct work_struct ext_intr_handler_task; | ||
96 | struct adapter_params params; | ||
97 | |||
98 | struct vlan_group *vlan_grp; | ||
99 | |||
100 | /* Terminator modules. */ | ||
101 | struct sge *sge; | ||
102 | struct pemc3 *mc3; | ||
103 | struct pemc4 *mc4; | ||
104 | struct pemc5 *mc5; | ||
105 | struct petp *tp; | ||
106 | struct pecspi *cspi; | ||
107 | struct peespi *espi; | ||
108 | struct peulp *ulp; | ||
109 | |||
110 | struct port_info port[MAX_NPORTS]; | ||
111 | struct work_struct stats_update_task; | ||
112 | struct timer_list stats_update_timer; | ||
113 | |||
114 | struct semaphore mib_mutex; | ||
115 | spinlock_t tpi_lock; | ||
116 | spinlock_t work_lock; | ||
117 | |||
118 | spinlock_t async_lock ____cacheline_aligned; /* guards async operations */ | ||
119 | u32 slow_intr_mask; | ||
120 | }; | ||
121 | |||
122 | #endif | ||