Re: [PATCH 3/4] ehea: queue managment

2006-06-07 Thread Muli Ben-Yehuda
On Wed, Jun 07, 2006 at 10:29:50AM -0700, Stephen Hemminger wrote:

> Be careful about global namespace issues. Stick to one prefix like ehea_
> for all non static function names. Consider putting all in one file, or
> use #include to cause it to be one compilation unit.

I thought including .c files was discouraged (if not, it should be...)

Cheers,
Muli
-
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


Re: Updated sysctl documentation take #2

2006-06-07 Thread David Lang

On Thu, 8 Jun 2006, Johannes Stezenbach wrote:


On Wed, Jun 07, 2006, Diego Calleja wrote:

Since people didn't like the "many small files" approach, I've moved
it to directories containing index.txt files:

Documentation/sysctl/vm/index.txt
Documentation/sysctl/net/core/index.txt


Why not just

Documentation/sysctl/vm.txt
Documentation/sysctl/net/core.txt

etc.?


better matching of the proc layout would be my guess.
-
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


Re: Updated sysctl documentation take #2

2006-06-07 Thread Johannes Stezenbach
On Wed, Jun 07, 2006, Diego Calleja wrote:
> Since people didn't like the "many small files" approach, I've moved
> it to directories containing index.txt files:
> 
> Documentation/sysctl/vm/index.txt
> Documentation/sysctl/net/core/index.txt

Why not just

Documentation/sysctl/vm.txt
Documentation/sysctl/net/core.txt

etc.?


Johannes
-
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 9/10] Add Vitesse 8244 PHY for MPC8641 HPCN platform.

2006-06-07 Thread Jon Loeliger

Signed-off-by: Kriston Carson <[EMAIL PROTECTED]>
Signed-off-by: Xianghua Xiao <[EMAIL PROTECTED]>
Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]>

---

 drivers/net/Kconfig   |6 +-
 drivers/net/phy/Kconfig   |5 ++
 drivers/net/phy/Makefile  |1 
 drivers/net/phy/vitesse.c |  136 +
 4 files changed, 145 insertions(+), 3 deletions(-)


diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index bdaaad8..c1c2758 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2179,11 +2179,11 @@ config SPIDER_NET
 
 config GIANFAR
tristate "Gianfar Ethernet"
-   depends on 85xx || 83xx
+   depends on 85xx || 83xx || PPC_86xx
select PHYLIB
help
- This driver supports the Gigabit TSEC on the MPC85xx 
- family of chips, and the FEC on the 8540
+ This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx,
+ and MPC86xx family of chips, and the FEC on the 8540.
 
 config GFAR_NAPI
bool "NAPI Support"
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index fa39b94..76e51b1 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -44,6 +44,11 @@ config CICADA_PHY
depends on PHYLIB
---help---
  Currently supports the cis8204
+config VITESSE_PHY
+tristate "Drivers for the Vitesse PHYs"
+depends on PHYLIB
+---help---
+  Currently supports the vsc8244
 
 endmenu
 
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index e4116a5..a8d066e 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_DAVICOM_PHY)   += davicom.o
 obj-$(CONFIG_CICADA_PHY)   += cicada.o
 obj-$(CONFIG_LXT_PHY)  += lxt.o
 obj-$(CONFIG_QSEMI_PHY)+= qsemi.o
+obj-$(CONFIG_VITESSE_PHY)  += vitesse.o
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
new file mode 100644
index 000..45a605f
--- /dev/null
+++ b/drivers/net/phy/vitesse.c
@@ -0,0 +1,136 @@
+/*
+ * Driver for Vitesse PHYs
+ *
+ * Author: Kriston Carson
+ *
+ * Copyright (c) 2005 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+/* Vitesse Extended Control Register 1 */
+#define MII_VSC8244_EXT_CON1   0x17
+#define MII_VSC8244_EXTCON1_INIT   0x
+
+/* Vitesse Interrupt Mask Register */
+#define MII_VSC8244_IMASK  0x19
+#define MII_VSC8244_IMASK_IEN  0x8000
+#define MII_VSC8244_IMASK_SPEED0x4000
+#define MII_VSC8244_IMASK_LINK 0x2000
+#define MII_VSC8244_IMASK_DUPLEX   0x1000
+#define MII_VSC8244_IMASK_MASK 0xf000
+
+/* Vitesse Interrupt Status Register */
+#define MII_VSC8244_ISTAT  0x1a
+#define MII_VSC8244_ISTAT_STATUS   0x8000
+#define MII_VSC8244_ISTAT_SPEED0x4000
+#define MII_VSC8244_ISTAT_LINK 0x2000
+#define MII_VSC8244_ISTAT_DUPLEX   0x1000
+
+/* Vitesse Auxiliary Control/Status Register */
+#define MII_VSC8244_AUX_CONSTAT0x1c
+#define MII_VSC8244_AUXCONSTAT_INIT0x0004
+#define MII_VSC8244_AUXCONSTAT_DUPLEX  0x0020
+#define MII_VSC8244_AUXCONSTAT_SPEED   0x0018
+#define MII_VSC8244_AUXCONSTAT_GBIT0x0010
+#define MII_VSC8244_AUXCONSTAT_100 0x0008
+
+MODULE_DESCRIPTION("Vitesse PHY driver");
+MODULE_AUTHOR("Kriston Carson");
+MODULE_LICENSE("GPL");
+
+static int vsc824x_config_init(struct phy_device *phydev)
+{
+   int err;
+
+   err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT,
+   MII_VSC8244_AUXCONSTAT_INIT);
+
+   if (err < 0)
+   return err;
+
+   err = phy_write(phydev, MII_VSC8244_EXT_CON1,
+   MII_VSC8244_EXTCON1_INIT);
+
+   return err;
+
+}
+
+static int vsc824x_ack_interrupt(struct phy_device *phydev)
+{
+   int err = phy_read(phydev, MII_VSC8244_ISTAT);
+
+   return (err < 0) ? err : 0;
+
+}
+
+static int vsc824x_config_intr(struct phy_device *phydev)
+{
+   int err;
+
+   if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
+   err = phy_write(phydev, MII_VSC8244_IMASK,
+   MII_VSC8244_IMASK_MASK);
+   else
+   err = phy_write(phydev, MII_VSC8244_IMASK, 0);
+
+   return err;
+
+}
+
+/* Vitesse 824x */
+static struct phy_driver vsc8244_driver = {
+   .phy_id = 0x000fc6c2,
+   .name   = "Vitesse VSC8244",
+

Re: [PATCH] pcnet32 driver NAPI support

2006-06-07 Thread Don Fry
One other problem I ran into.  I applied the patch but it will not
compile because rl_active is never defined.  I have worked around it but
...


-- 
Don Fry
[EMAIL PROTECTED]
-
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


Re: Updated sysctl documentation take #2

2006-06-07 Thread Diego Calleja
El Wed, 7 Jun 2006 13:06:53 -0700,
"Randy.Dunlap" <[EMAIL PROTECTED]> escribió:


> I don't know how long it takes to review such a large patch, but
> I'll continue to do so.  For now:

Yeah, my english is poor ;)

Most of the sysctl documentation cames from other files anyway, 
README was (re)written by me, so the rest is not so bad...


> OK, that's all for the README file.  I'll look at the rest of it
> sometime this week.  I don't think that it's quite ready to be merged.


Thank's for your review, altought I didn't though someone was to review
so deeply a documentation patch ;) I've gone through all the files and
fixed the 72-col limit and everything I could. I've updated the patch
http://terra.es/personal/diegocg/sysctl-docs

-
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


Re: [PATCH v2 2/2] iWARP Core Changes.

2006-06-07 Thread Tom Tucker

A reference is being taken on an iWARP device that is never getting
released. This prevents a participating iWARP netdev device from being
unloaded after a connection has been established on the passive side.

Search for ip_dev_find below...

On Wed, 2006-06-07 at 15:06 -0500, Steve Wise wrote:
> This patch contains modifications to the existing rdma header files,
> core files, drivers, and ulp files to support iWARP.
> 
> Review updates:
> 
> - copy_addr() -> rdma_copy_addr()
> 
> - dst_dev_addr param in rdma_copy_addr to const.
> 
> - various spacing nits with recasting
> 
> - include linux/inetdevice.h to get ip_dev_find() prototype.
> ---
> 
>  drivers/infiniband/core/Makefile |4 
>  drivers/infiniband/core/addr.c   |   19 +
>  drivers/infiniband/core/cache.c  |8 -
>  drivers/infiniband/core/cm.c |3 
>  drivers/infiniband/core/cma.c|  353 
> +++---
>  drivers/infiniband/core/device.c |6 
>  drivers/infiniband/core/mad.c|   11 +
>  drivers/infiniband/core/sa_query.c   |5 
>  drivers/infiniband/core/smi.c|   18 +
>  drivers/infiniband/core/sysfs.c  |   18 +
>  drivers/infiniband/core/ucm.c|5 
>  drivers/infiniband/core/user_mad.c   |9 -
>  drivers/infiniband/hw/ipath/ipath_verbs.c|2 
>  drivers/infiniband/hw/mthca/mthca_provider.c |2 
>  drivers/infiniband/ulp/ipoib/ipoib_main.c|8 +
>  drivers/infiniband/ulp/srp/ib_srp.c  |2 
>  include/rdma/ib_addr.h   |   15 +
>  include/rdma/ib_verbs.h  |   39 +++
>  18 files changed, 435 insertions(+), 92 deletions(-)
> 
> diff --git a/drivers/infiniband/core/Makefile 
> b/drivers/infiniband/core/Makefile
> index 68e73ec..163d991 100644
> --- a/drivers/infiniband/core/Makefile
> +++ b/drivers/infiniband/core/Makefile
> @@ -1,7 +1,7 @@
>  infiniband-$(CONFIG_INFINIBAND_ADDR_TRANS)   := ib_addr.o rdma_cm.o
>  
>  obj-$(CONFIG_INFINIBAND) +=  ib_core.o ib_mad.o ib_sa.o \
> - ib_cm.o $(infiniband-y)
> + ib_cm.o iw_cm.o $(infiniband-y)
>  obj-$(CONFIG_INFINIBAND_USER_MAD) += ib_umad.o
>  obj-$(CONFIG_INFINIBAND_USER_ACCESS) +=  ib_uverbs.o ib_ucm.o
>  
> @@ -14,6 +14,8 @@ ib_sa-y :=  sa_query.o
>  
>  ib_cm-y :=   cm.o
>  
> +iw_cm-y :=   iwcm.o
> +
>  rdma_cm-y := cma.o
>  
>  ib_addr-y := addr.o
> diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
> index d294bbc..83f84ef 100644
> --- a/drivers/infiniband/core/addr.c
> +++ b/drivers/infiniband/core/addr.c
> @@ -32,6 +32,7 @@ #include 
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -60,12 +61,15 @@ static LIST_HEAD(req_list);
>  static DECLARE_WORK(work, process_req, NULL);
>  static struct workqueue_struct *addr_wq;
>  
> -static int copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
> -  unsigned char *dst_dev_addr)
> +int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
> +  const unsigned char *dst_dev_addr)
>  {
>   switch (dev->type) {
>   case ARPHRD_INFINIBAND:
> - dev_addr->dev_type = IB_NODE_CA;
> + dev_addr->dev_type = RDMA_NODE_IB_CA;
> + break;
> + case ARPHRD_ETHER:
> + dev_addr->dev_type = RDMA_NODE_RNIC;
>   break;
>   default:
>   return -EADDRNOTAVAIL;
> @@ -77,6 +81,7 @@ static int copy_addr(struct rdma_dev_add
>   memcpy(dev_addr->dst_dev_addr, dst_dev_addr, MAX_ADDR_LEN);
>   return 0;
>  }
> +EXPORT_SYMBOL(rdma_copy_addr);
>  
>  int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
>  {
> @@ -88,7 +93,7 @@ int rdma_translate_ip(struct sockaddr *a
>   if (!dev)
>   return -EADDRNOTAVAIL;
>  
> - ret = copy_addr(dev_addr, dev, NULL);
> + ret = rdma_copy_addr(dev_addr, dev, NULL);
>   dev_put(dev);
>   return ret;
>  }
> @@ -160,7 +165,7 @@ static int addr_resolve_remote(struct so
>  
>   /* If the device does ARP internally, return 'done' */
>   if (rt->idev->dev->flags & IFF_NOARP) {
> - copy_addr(addr, rt->idev->dev, NULL);
> + rdma_copy_addr(addr, rt->idev->dev, NULL);
>   goto put;
>   }
>  
> @@ -180,7 +185,7 @@ static int addr_resolve_remote(struct so
>   src_in->sin_addr.s_addr = rt->rt_src;
>   }
>  
> - ret = copy_addr(addr, neigh->dev, neigh->ha);
> + ret = rdma_copy_addr(addr, neigh->dev, neigh->ha);
>  release:
>   neigh_release(neigh);
>  put:
> @@ -244,7 +249,7 @@ static int addr_resolve_local(struct soc
>   if (ZERONET(src_ip)) {
>   src_in->sin_family = dst_in->sin

Re: [PATCH] pcnet32 driver NAPI support

2006-06-07 Thread Don Fry
On Wed, Jun 07, 2006 at 03:34:56PM -0400, Lennart Sorensen wrote:
> On Wed, Jun 07, 2006 at 11:20:40AM -0700, Don Fry wrote:
> 
> > Some areas of concern that you may have addressed already, I have not
> > scanned your changes yet, are what happens if the ring size is changed
> > without bringing down the interface (via ethtool), or if the loopback
> > test is run in a similar fashion, or a tx timeout occurs.
> 
> The same thing as if it was done before enabling napi.  From a few
> messages I have seen, it doesn't work right now, and it won't work any
> better with my changes.  I have never tried changing the ring size on
> the fly, so I don't know.

Today without your NAPI changes the device can be up and operational,
and change the ring size without hanging or causing a panic or causing
problems with the driver.  The same can be said for running the loopback
test, or when a tx timeout occurs.

It does not look like the same can be said for your NAPI changes, yet.
Try changing the ring size a dozen times during a receive storm and see
what happens.

> 
> It appears that the port is stopped before the ring size change is done,
> although I can't really tell how it handles things if the queue is not
> empty when it stops the port.  Does it try to handle anything left in
> the ring first or does it just toss those packets? (That I would
> consider wrong).
> 
> > The lp->lock MUST be held whenever accessing the csr or bcr registers as
> > this is a multi-step process, and has been the source of problems in the
> > past.  Even on UP systems.
> 
> Hmm, I just followed what appeared to be in pcnet32_rx and how tulip and
> a few other drivers had done their napi conversions.  It certainly works
> for me the way I did it.  Haven't seen any lockups yet.  I do see that I
> am not holding the lock when I acknowledge IRQs in pcnet32_poll, which
> pcnet32_rx doesn't need to worry about since it is called from the
> interrupt handler which already holds the lock.  That should be fixed
> then.

Yes, that is the minimum that needs to be changed.
There have been a lot of changes made to the driver, by myself included,
that seem to work just fine, but later the timing changes and you lose
the race, resulting in problems.  Changing one part of the driver
without understanding the whole thing is very risky.

> 
> So I can do:
> // Clear RX interrupts
> spin_lock(&lp->lock);
> lp->a.write_csr (ioaddr, 0, 0x1400);
> spin_unlock(&lp->lock);
> That part seems simple enough to protect.
> 
> Is this safe without holding the lock?
> } while(lp->a.read_csr (ioaddr, 0) & 0x1400);

No, see below.

> Not sure how to wrap a lock around that one without holding the lock for
> way too long.
> 
> perhaps:
> spin_lock(&lp->lock);
>   state=lp->a.read_csr (ioaddr, 0) & 0x1400;
> spin_unlock(&lp->lock);
> } while(state);
> Does that seem more reasonable?

The lock must be held during ANY read or write to a csr or bcr.

The problem is that accessing a csr/bcr takes two steps.  One is to
write the address register indicating which register to read or write,
and second, read or write the register.  The problem is that without the
lock, entity A writes to the rap to access register X, then before it
can access that register entity B writes the rap to access register Y,
At that point entity A will read, or worse write, the contents of the
wrong register.

This problem is even worse when reading/writing a PHY register because
it entails writing bcr 33 and reading/writing bcr 34, without being
interrupted by something that might change bcr 33.  Not likely, but not
something that can be ignored.  It may not happen often, but it will
happen eventually.

> 
> Len Sorensen

-- 
Don Fry
[EMAIL PROTECTED]
-
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


Re: [PATCH v2 2/7] AMSO1100 WR / Event Definitions.

2006-06-07 Thread Steve Wise
On Wed, 2006-06-07 at 13:43 -0700, Roland Dreier wrote:
> I just realized it could be the spam filters.  You have some comments
> with three 'X's in a row which might be getting it blocked.  Is that
> possible?


There are other files that have comments with 'XXX' like c2_provider.c
and c2_qp.c which is in patch 3/7 and it made it though.  

These 'XXX' comments need to be cleaned up anyway, so I'll remove them
(or address the issue if there is one) and we'll see next time I post a
new version.

Steve.

-
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


Re: Updated sysctl documentation take #2

2006-06-07 Thread Diego Calleja
El Wed, 7 Jun 2006 12:46:41 -0700,
Stephen Hemminger <[EMAIL PROTECTED]> escribió:

> The network stuff was all in Documentation/networking/ip-sysctl.txt.
> Someone else has already started fixing it.

Darn, didn't know that. Anyway, I merged that file into
Documentation/sysctl/ because IMO all sysctls must be in the same
place.
-
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


Re: [PATCH v2 2/7] AMSO1100 WR / Event Definitions.

2006-06-07 Thread Roland Dreier
I just realized it could be the spam filters.  You have some comments
with three 'X's in a row which might be getting it blocked.  Is that
possible?

 - R.
-
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 v2 2/7] AMSO1100 WR / Event Definitions.

2006-06-07 Thread Steve Wise
Resending 2/7 gziped.  

linux-kernel and netdev mailing lists didn't formward the plain text
patch... 

If anywone knows how to address this issue, please email me directly cuz
I don't know why 2/7 didn't get forwarded.  

Sorry.

Steve.



amso1100_wr.gz
Description: GNU Zip compressed data


[PATCH v2 6/7] AMSO1100: Privileged Verbs Queues.

2006-06-07 Thread Steve Wise

Review Changes:

dprintk() -> pr_debug()
---

 drivers/infiniband/hw/amso1100/c2_vq.c |  260 
 drivers/infiniband/hw/amso1100/c2_vq.h |   63 
 2 files changed, 323 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_vq.c 
b/drivers/infiniband/hw/amso1100/c2_vq.c
new file mode 100644
index 000..445b1ed
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/c2_vq.c
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2005 Ammasso, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *  - Redistributions of source code must retain the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer.
+ *
+ *  - Redistributions in binary form must reproduce the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer in the documentation and/or other materials
+ *provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#include 
+#include 
+
+#include "c2_vq.h"
+#include "c2_provider.h"
+
+/*
+ * Verbs Request Objects:
+ *
+ * VQ Request Objects are allocated by the kernel verbs handlers.
+ * They contain a wait object, a refcnt, an atomic bool indicating that the
+ * adapter has replied, and a copy of the verb reply work request.
+ * A pointer to the VQ Request Object is passed down in the context
+ * field of the work request message, and reflected back by the adapter
+ * in the verbs reply message.  The function handle_vq() in the interrupt
+ * path will use this pointer to:
+ * 1) append a copy of the verbs reply message
+ * 2) mark that the reply is ready
+ * 3) wake up the kernel verbs handler blocked awaiting the reply.
+ *
+ *
+ * The kernel verbs handlers do a "get" to put a 2nd reference on the 
+ * VQ Request object.  If the kernel verbs handler exits before the adapter
+ * can respond, this extra reference will keep the VQ Request object around
+ * until the adapter's reply can be processed.  The reason we need this is
+ * because a pointer to this object is stuffed into the context field of
+ * the verbs work request message, and reflected back in the reply message.
+ * It is used in the interrupt handler (handle_vq()) to wake up the appropriate
+ * kernel verb handler that is blocked awaiting the verb reply.  
+ * So handle_vq() will do a "put" on the object when it's done accessing it.
+ * NOTE:  If we guarantee that the kernel verb handler will never bail before 
+ *getting the reply, then we don't need these refcnts.
+ *
+ *
+ * VQ Request objects are freed by the kernel verbs handlers only 
+ * after the verb has been processed, or when the adapter fails and
+ * does not reply.  
+ *
+ *
+ * Verbs Reply Buffers:
+ *
+ * VQ Reply bufs are local host memory copies of a 
+ * outstanding Verb Request reply
+ * message.  The are always allocated by the kernel verbs handlers, and _may_ 
be
+ * freed by either the kernel verbs handler -or- the interrupt handler.  The
+ * kernel verbs handler _must_ free the repbuf, then free the vq request object
+ * in that order.
+ */
+
+int vq_init(struct c2_dev *c2dev)
+{
+   sprintf(c2dev->vq_cache_name, "c2-vq:dev%c",
+   (char) ('0' + c2dev->devnum));
+   c2dev->host_msg_cache =
+   kmem_cache_create(c2dev->vq_cache_name, c2dev->rep_vq.msg_size, 0,
+ SLAB_HWCACHE_ALIGN, NULL, NULL);
+   if (c2dev->host_msg_cache == NULL) {
+   return -ENOMEM;
+   }
+   return 0;
+}
+
+void vq_term(struct c2_dev *c2dev)
+{
+   kmem_cache_destroy(c2dev->host_msg_cache);
+}
+
+/* vq_req_alloc - allocate a VQ Request Object and initialize it.
+ * The refcnt is set to 1.
+ */
+struct c2_vq_req *vq_req_alloc(struct c2_dev *c2dev)
+{
+   struct c2_vq_req *r;
+
+   r = kmalloc(sizeof(struct c2_vq_req), GFP_KERNEL);
+   if (r) {
+   init_waitqueue_head(&r->wait_object);
+   r->reply_msg = (u64) NULL;
+   r->

[PATCH v2 1/2] iWARP Connection Manager.

2006-06-07 Thread Steve Wise

This patch provides the new files implementing the iWARP Connection
Manager.

Review Changes:

- sizeof -> sizeof()

- removed printks

- removed TT debug code

- cleaned up lock/unlock around switch statements.

- waitqueue -> completion for destroy path.
---

 drivers/infiniband/core/iwcm.c |  877 
 include/rdma/iw_cm.h   |  254 
 include/rdma/iw_cm_private.h   |   62 +++
 3 files changed, 1193 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
new file mode 100644
index 000..994bc79
--- /dev/null
+++ b/drivers/infiniband/core/iwcm.c
@@ -0,0 +1,877 @@
+/*
+ * Copyright (c) 2004, 2005 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
+ * Copyright (c) 2004, 2005 Voltaire Corporation.  All rights reserved.
+ * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
+ * Copyright (c) 2005 Network Appliance, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *  - Redistributions of source code must retain the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer.
+ *
+ *  - Redistributions in binary form must reproduce the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer in the documentation and/or other materials
+ *provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+MODULE_AUTHOR("Tom Tucker");
+MODULE_DESCRIPTION("iWARP CM");
+MODULE_LICENSE("Dual BSD/GPL");
+
+static struct workqueue_struct *iwcm_wq;
+struct iwcm_work {
+   struct work_struct work;
+   struct iwcm_id_private *cm_id;
+   struct list_head list;
+   struct iw_cm_event event;
+};
+
+/* 
+ * Release a reference on cm_id. If the last reference is being removed
+ * and iw_destroy_cm_id is waiting, wake up the waiting thread.
+ */
+static int iwcm_deref_id(struct iwcm_id_private *cm_id_priv)
+{
+   int ret = 0;
+
+   BUG_ON(atomic_read(&cm_id_priv->refcount)==0);
+   if (atomic_dec_and_test(&cm_id_priv->refcount)) {
+   BUG_ON(!list_empty(&cm_id_priv->work_list));
+   if (waitqueue_active(&cm_id_priv->destroy_comp.wait)) {
+   BUG_ON(cm_id_priv->state != IW_CM_STATE_DESTROYING);
+   BUG_ON(test_bit(IWCM_F_CALLBACK_DESTROY,
+   &cm_id_priv->flags));
+   ret = 1;
+   }
+   complete(&cm_id_priv->destroy_comp);
+   }
+
+   return ret;
+}
+
+static void add_ref(struct iw_cm_id *cm_id)
+{
+   struct iwcm_id_private *cm_id_priv;
+   cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
+   atomic_inc(&cm_id_priv->refcount);
+}
+
+static void rem_ref(struct iw_cm_id *cm_id)
+{
+   struct iwcm_id_private *cm_id_priv;
+   cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
+   iwcm_deref_id(cm_id_priv);
+}
+
+static void cm_event_handler(struct iw_cm_id *cm_id, struct iw_cm_event 
*event);
+
+struct iw_cm_id *iw_create_cm_id(struct ib_device *device,
+iw_cm_handler cm_handler,
+void *context)
+{
+   struct iwcm_id_private *cm_id_priv;
+
+   cm_id_priv = kzalloc(sizeof(*cm_id_priv), GFP_KERNEL);
+   if (!cm_id_priv)
+   return ERR_PTR(-ENOMEM);
+
+   cm_id_priv->state = IW_CM_STATE_IDLE;
+   cm_id_priv->id.device = device;
+   cm_id_priv->id.cm_handler = cm_handler;
+   cm_id_priv->id.context = context;
+   cm_id_priv->id.event_handler = cm_event_handler;
+   cm_id_priv->id.add_ref = add_ref;
+   cm_id_priv->id.rem_ref = rem_ref;
+   spin_lock_init(&cm_id_priv->lock);
+   atomic_set(&cm_id_priv->re

[PATCH v2 5/7] AMSO1100 Message Queues.

2006-06-07 Thread Steve Wise

Review Changes:

- remove useless asserts

- assert() -> BUG_ON()

- C2_DEBUG -> DEBUG
---

 drivers/infiniband/hw/amso1100/c2_mq.c |  175 
 drivers/infiniband/hw/amso1100/c2_mq.h |  103 +++
 2 files changed, 278 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_mq.c 
b/drivers/infiniband/hw/amso1100/c2_mq.c
new file mode 100644
index 000..0b0ab02
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/c2_mq.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2005 Ammasso, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *  - Redistributions of source code must retain the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer.
+ *
+ *  - Redistributions in binary form must reproduce the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer in the documentation and/or other materials
+ *provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#include "c2.h"
+#include "c2_mq.h"
+
+void *c2_mq_alloc(struct c2_mq *q)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_ADAPTER_TARGET);
+
+   if (c2_mq_full(q)) {
+   return NULL;
+   } else {
+#ifdef DEBUG
+   struct c2wr_hdr *m =
+   (struct c2wr_hdr *) (q->msg_pool.host + q->priv * 
q->msg_size);
+#ifdef CCMSGMAGIC
+   BUG_ON(m->magic != be32_to_cpu(~CCWR_MAGIC));
+   m->magic = cpu_to_be32(CCWR_MAGIC);
+#endif
+   return m;
+#else
+   return q->msg_pool.host + q->priv * q->msg_size;
+#endif
+   }
+}
+
+void c2_mq_produce(struct c2_mq *q)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_ADAPTER_TARGET);
+
+   if (!c2_mq_full(q)) {
+   q->priv = (q->priv + 1) % q->q_size;
+   q->hint_count++;
+   /* Update peer's offset. */
+   __raw_writew(cpu_to_be16(q->priv), &q->peer->shared);
+   }
+}
+
+void *c2_mq_consume(struct c2_mq *q)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_HOST_TARGET);
+
+   if (c2_mq_empty(q)) {
+   return NULL;
+   } else {
+#ifdef DEBUG
+   struct c2wr_hdr *m = (struct c2wr_hdr *)
+   (q->msg_pool.host + q->priv * q->msg_size);
+#ifdef CCMSGMAGIC
+   BUG_ON(m->magic != be32_to_cpu(CCWR_MAGIC));
+#endif
+   return m;
+#else
+   return q->msg_pool.host + q->priv * q->msg_size;
+#endif
+   }
+}
+
+void c2_mq_free(struct c2_mq *q)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_HOST_TARGET);
+
+   if (!c2_mq_empty(q)) {
+
+#ifdef CCMSGMAGIC
+   {
+   struct c2wr_hdr __iomem *m = (struct c2wr_hdr __iomem *)
+   (q->msg_pool.adapter + q->priv * q->msg_size);
+   __raw_writel(cpu_to_be32(~CCWR_MAGIC), &m->magic);
+   }
+#endif
+   q->priv = (q->priv + 1) % q->q_size;
+   /* Update peer's offset. */
+   __raw_writew(cpu_to_be16(q->priv), &q->peer->shared);
+   }
+}
+
+
+void c2_mq_lconsume(struct c2_mq *q, u32 wqe_count)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_ADAPTER_TARGET);
+
+   while (wqe_count--) {
+   BUG_ON(c2_mq_empty(q));
+   *q->shared = cpu_to_be16((be16_to_cpu(*q->shared)+1) % 
q->q_size);
+   }
+}
+
+
+u32 c2_mq_count(struct c2_mq *q)
+{
+   s32 count;
+
+   if (q->type == C2_MQ_HOST_TARGET) {
+   count = be16_to_cpu(*q->shared) - q->priv;
+   } else {
+   count = q->priv - be16_to_cpu(*q->shared);
+   }
+
+   if (count < 0) {
+   count += q->q_size;
+   }
+
+   return (u32) count;
+}
+
+void c2_mq_req_init(struct c2_mq *q, u32 index, u32 q_size, u32 msg_size,
+ 

[PATCH v2 4/7] AMSO1100 Memory Management.

2006-06-07 Thread Steve Wise

Review Changes:

- sizeof -> sizeof()
---

 drivers/infiniband/hw/amso1100/c2_alloc.c |  256 
 drivers/infiniband/hw/amso1100/c2_mm.c|  378 +
 2 files changed, 634 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_alloc.c 
b/drivers/infiniband/hw/amso1100/c2_alloc.c
new file mode 100644
index 000..e496eb7
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/c2_alloc.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2004 Topspin Communications.  All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *  - Redistributions of source code must retain the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer.
+ *
+ *  - Redistributions in binary form must reproduce the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer in the documentation and/or other materials
+ *provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+
+#include "c2.h"
+
+/* Trivial bitmap-based allocator */
+u32 c2_alloc(struct c2_alloc *alloc)
+{
+   u32 obj;
+
+   spin_lock(&alloc->lock);
+   obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last);
+   if (obj >= alloc->max)
+   obj = find_first_zero_bit(alloc->table, alloc->max);
+   if (obj >= 0) {
+   alloc->last = obj+1;
+   if (alloc->last > alloc->max)
+   alloc->last = 0;
+   }
+   spin_unlock(&alloc->lock);
+
+   return obj;
+}
+
+void c2_free(struct c2_alloc *alloc, u32 obj)
+{
+   spin_lock(&alloc->lock);
+   clear_bit(obj, alloc->table);
+   spin_unlock(&alloc->lock);
+}
+
+int c2_alloc_init(struct c2_alloc *alloc, u32 num, u32 reserved)
+{
+   int i;
+
+   alloc->last = 0;
+   alloc->max = num;
+   spin_lock_init(&alloc->lock);
+   alloc->table = kmalloc(BITS_TO_LONGS(num) * sizeof(long), GFP_KERNEL);
+   if (!alloc->table)
+   return -ENOMEM;
+
+   bitmap_zero(alloc->table, num);
+   for (i = 0; i < reserved; ++i)
+   set_bit(i, alloc->table);
+
+   return 0;
+}
+
+void c2_alloc_cleanup(struct c2_alloc *alloc)
+{
+   kfree(alloc->table);
+}
+
+/*
+ * Array of pointers with lazy allocation of leaf pages.  Callers of
+ * _get, _set and _clear methods must use a lock or otherwise
+ * serialize access to the array.
+ */
+
+void *c2_array_get(struct c2_array *array, int index)
+{
+   int p = (index * sizeof(void *)) >> PAGE_SHIFT;
+
+   if (array->page_list[p].page) {
+   int i = index & (PAGE_SIZE / sizeof(void *) - 1);
+   return array->page_list[p].page[i];
+   } else
+   return NULL;
+}
+
+int c2_array_set(struct c2_array *array, int index, void *value)
+{
+   int p = (index * sizeof(void *)) >> PAGE_SHIFT;
+
+   /* Allocate with GFP_ATOMIC because we'll be called with locks held. */
+   if (!array->page_list[p].page)
+   array->page_list[p].page =
+   (void **) get_zeroed_page(GFP_ATOMIC);
+
+   if (!array->page_list[p].page)
+   return -ENOMEM;
+
+   array->page_list[p].page[index & (PAGE_SIZE / sizeof(void *) - 1)] =
+   value;
+   ++array->page_list[p].used;
+
+   return 0;
+}
+
+void c2_array_clear(struct c2_array *array, int index)
+{
+   int p = (index * sizeof(void *)) >> PAGE_SHIFT;
+
+   if (--array->page_list[p].used == 0) {
+   free_page((unsigned long) array->page_list[p].page);
+   array->page_list[p].page = NULL;
+   }
+
+   if (array->page_list[p].used < 0)
+   pr_debug("Array %p index %d page %d with ref count %d < 0\n",
+array, index, p, array->page_list[p].used);
+}
+
+int c2_array_init(struct c2_array *array, int nent)
+{
+   int npage = (nent * sizeof(void *) + PAGE_SIZE - 1) / PAGE_SIZE;
+   int i;
+
+

[PATCH v2 0/2][RFC] iWARP Core Support

2006-06-07 Thread Steve Wise

This patchset defines the modifications to the Linux infiniband subsystem
to support iWARP devices.  We're submitting it for review now with the
goal for inclusion in the 2.6.19 kernel.  This code has gone through
several reviews in the openib-general list.  Now we are submitting it
for external review by the linux community.

This StGIT patchset is cloned from Roland Dreier's infiniband.git
for-2.6.18 branch.  The patchset consists of 2 patches:

1 - New iWARP CM implementation.  
2 - Core changes to support iWARP.

I believe I've addressed all the round 1 review comments.  Details of
the changes are tracked in each patch comment.

Signed-off-by: Tom Tucker <[EMAIL PROTECTED]>
Signed-off-by: Steve Wise <[EMAIL PROTECTED]>
-
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 v2 2/2] iWARP Core Changes.

2006-06-07 Thread Steve Wise

This patch contains modifications to the existing rdma header files,
core files, drivers, and ulp files to support iWARP.

Review updates:

- copy_addr() -> rdma_copy_addr()

- dst_dev_addr param in rdma_copy_addr to const.

- various spacing nits with recasting

- include linux/inetdevice.h to get ip_dev_find() prototype.
---

 drivers/infiniband/core/Makefile |4 
 drivers/infiniband/core/addr.c   |   19 +
 drivers/infiniband/core/cache.c  |8 -
 drivers/infiniband/core/cm.c |3 
 drivers/infiniband/core/cma.c|  353 +++---
 drivers/infiniband/core/device.c |6 
 drivers/infiniband/core/mad.c|   11 +
 drivers/infiniband/core/sa_query.c   |5 
 drivers/infiniband/core/smi.c|   18 +
 drivers/infiniband/core/sysfs.c  |   18 +
 drivers/infiniband/core/ucm.c|5 
 drivers/infiniband/core/user_mad.c   |9 -
 drivers/infiniband/hw/ipath/ipath_verbs.c|2 
 drivers/infiniband/hw/mthca/mthca_provider.c |2 
 drivers/infiniband/ulp/ipoib/ipoib_main.c|8 +
 drivers/infiniband/ulp/srp/ib_srp.c  |2 
 include/rdma/ib_addr.h   |   15 +
 include/rdma/ib_verbs.h  |   39 +++
 18 files changed, 435 insertions(+), 92 deletions(-)

diff --git a/drivers/infiniband/core/Makefile b/drivers/infiniband/core/Makefile
index 68e73ec..163d991 100644
--- a/drivers/infiniband/core/Makefile
+++ b/drivers/infiniband/core/Makefile
@@ -1,7 +1,7 @@
 infiniband-$(CONFIG_INFINIBAND_ADDR_TRANS) := ib_addr.o rdma_cm.o
 
 obj-$(CONFIG_INFINIBAND) +=ib_core.o ib_mad.o ib_sa.o \
-   ib_cm.o $(infiniband-y)
+   ib_cm.o iw_cm.o $(infiniband-y)
 obj-$(CONFIG_INFINIBAND_USER_MAD) +=   ib_umad.o
 obj-$(CONFIG_INFINIBAND_USER_ACCESS) +=ib_uverbs.o ib_ucm.o
 
@@ -14,6 +14,8 @@ ib_sa-y :=sa_query.o
 
 ib_cm-y := cm.o
 
+iw_cm-y := iwcm.o
+
 rdma_cm-y :=   cma.o
 
 ib_addr-y :=   addr.o
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index d294bbc..83f84ef 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -32,6 +32,7 @@ #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -60,12 +61,15 @@ static LIST_HEAD(req_list);
 static DECLARE_WORK(work, process_req, NULL);
 static struct workqueue_struct *addr_wq;
 
-static int copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
-unsigned char *dst_dev_addr)
+int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
+const unsigned char *dst_dev_addr)
 {
switch (dev->type) {
case ARPHRD_INFINIBAND:
-   dev_addr->dev_type = IB_NODE_CA;
+   dev_addr->dev_type = RDMA_NODE_IB_CA;
+   break;
+   case ARPHRD_ETHER:
+   dev_addr->dev_type = RDMA_NODE_RNIC;
break;
default:
return -EADDRNOTAVAIL;
@@ -77,6 +81,7 @@ static int copy_addr(struct rdma_dev_add
memcpy(dev_addr->dst_dev_addr, dst_dev_addr, MAX_ADDR_LEN);
return 0;
 }
+EXPORT_SYMBOL(rdma_copy_addr);
 
 int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
 {
@@ -88,7 +93,7 @@ int rdma_translate_ip(struct sockaddr *a
if (!dev)
return -EADDRNOTAVAIL;
 
-   ret = copy_addr(dev_addr, dev, NULL);
+   ret = rdma_copy_addr(dev_addr, dev, NULL);
dev_put(dev);
return ret;
 }
@@ -160,7 +165,7 @@ static int addr_resolve_remote(struct so
 
/* If the device does ARP internally, return 'done' */
if (rt->idev->dev->flags & IFF_NOARP) {
-   copy_addr(addr, rt->idev->dev, NULL);
+   rdma_copy_addr(addr, rt->idev->dev, NULL);
goto put;
}
 
@@ -180,7 +185,7 @@ static int addr_resolve_remote(struct so
src_in->sin_addr.s_addr = rt->rt_src;
}
 
-   ret = copy_addr(addr, neigh->dev, neigh->ha);
+   ret = rdma_copy_addr(addr, neigh->dev, neigh->ha);
 release:
neigh_release(neigh);
 put:
@@ -244,7 +249,7 @@ static int addr_resolve_local(struct soc
if (ZERONET(src_ip)) {
src_in->sin_family = dst_in->sin_family;
src_in->sin_addr.s_addr = dst_ip;
-   ret = copy_addr(addr, dev, dev->dev_addr);
+   ret = rdma_copy_addr(addr, dev, dev->dev_addr);
} else if (LOOPBACK(src_ip)) {
ret = rdma_translate_ip((struct sockaddr *)dst_in, addr);
if (!ret)
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index e05ca2c..061858c 100644
--- a/drivers/infiniband/core/cach

[PATCH v2 7/7] AMSO1100 Makefiles and Kconfig changes.

2006-06-07 Thread Steve Wise

Review Changes:

- C2DEBUG -> DEBUG
---

 drivers/infiniband/Kconfig |1 +
 drivers/infiniband/Makefile|1 +
 drivers/infiniband/hw/amso1100/Kbuild  |   10 ++
 drivers/infiniband/hw/amso1100/Kconfig |   15 +++
 drivers/infiniband/hw/amso1100/README  |   11 +++
 5 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig
index ba2d650..04e6d4f 100644
--- a/drivers/infiniband/Kconfig
+++ b/drivers/infiniband/Kconfig
@@ -36,6 +36,7 @@ config INFINIBAND_ADDR_TRANS
 
 source "drivers/infiniband/hw/mthca/Kconfig"
 source "drivers/infiniband/hw/ipath/Kconfig"
+source "drivers/infiniband/hw/amso1100/Kconfig"
 
 source "drivers/infiniband/ulp/ipoib/Kconfig"
 
diff --git a/drivers/infiniband/Makefile b/drivers/infiniband/Makefile
index eea2732..e2b93f9 100644
--- a/drivers/infiniband/Makefile
+++ b/drivers/infiniband/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_INFINIBAND)   += core/
 obj-$(CONFIG_INFINIBAND_MTHCA) += hw/mthca/
 obj-$(CONFIG_IPATH_CORE)   += hw/ipath/
+obj-$(CONFIG_INFINIBAND_AMSO1100)  += hw/amso1100/
 obj-$(CONFIG_INFINIBAND_IPOIB) += ulp/ipoib/
 obj-$(CONFIG_INFINIBAND_SRP)   += ulp/srp/
diff --git a/drivers/infiniband/hw/amso1100/Kbuild 
b/drivers/infiniband/hw/amso1100/Kbuild
new file mode 100644
index 000..e1f10ab
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/Kbuild
@@ -0,0 +1,10 @@
+EXTRA_CFLAGS += -Idrivers/infiniband/include
+
+ifdef CONFIG_INFINIBAND_AMSO1100_DEBUG
+EXTRA_CFLAGS += -DDEBUG
+endif
+
+obj-$(CONFIG_INFINIBAND_AMSO1100) += iw_c2.o
+
+iw_c2-y := c2.o c2_provider.o c2_rnic.o c2_alloc.o c2_mq.o c2_ae.o c2_vq.o \
+   c2_intr.o c2_cq.o c2_qp.o c2_cm.o c2_mm.o c2_pd.o
diff --git a/drivers/infiniband/hw/amso1100/Kconfig 
b/drivers/infiniband/hw/amso1100/Kconfig
new file mode 100644
index 000..809cb14
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/Kconfig
@@ -0,0 +1,15 @@
+config INFINIBAND_AMSO1100
+   tristate "Ammasso 1100 HCA support"
+   depends on PCI && INET && INFINIBAND
+   ---help---
+ This is a low-level driver for the Ammasso 1100 host
+ channel adapter (HCA).
+
+config INFINIBAND_AMSO1100_DEBUG
+   bool "Verbose debugging output"
+   depends on INFINIBAND_AMSO1100
+   default n
+   ---help---
+ This option causes the amso1100 driver to produce a bunch of
+ debug messages.  Select this if you are developing the driver
+ or trying to diagnose a problem.
diff --git a/drivers/infiniband/hw/amso1100/README 
b/drivers/infiniband/hw/amso1100/README
new file mode 100644
index 000..1331353
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/README
@@ -0,0 +1,11 @@
+This is the OpenFabrics provider driver for the 
+AMSO1100 1Gb RNIC adapter. 
+
+This adapter is available in limited quantities 
+for development purposes from Open Grid Computing.
+
+This driver requires the IWCM and CMA mods necessary
+to support iWARP.
+
+Contact [EMAIL PROTECTED] for more information.
+
-
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 v2 0/7][RFC] Ammasso 1100 iWARP Driver

2006-06-07 Thread Steve Wise

This patchset implements the iWARP provider driver for the Ammasso
1100 RNIC.  It is dependent on the "iWARP Core Support" patch set.  We're
submitting it for review with the goal for inclusion in the 2.6.19 kernel.
This code has gone through several reviews in the openib-general list.
Now we are submitting it for external review by the linux community.

This StGIT patchset is cloned from Roland Dreier's infiniband.git
for-2.6.18 branch.  The patchset consists of 7 patches:

1 - Low-level device interface and native stack support
2 - Work request definitions
3 - Provider interface
4 - Memory management
5 - User mode message queue implementation  
6 - Verbs queue implementation
7 - Kconfig and Makefile

I believe I've addressed all the round 1 review comments.  Details of
the changes are tracked in each patch comment.

Signed-off-by: Tom Tucker <[EMAIL PROTECTED]>
Signed-off-by: Steve Wise <[EMAIL PROTECTED]>
-
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


Re: Updated sysctl documentation take #2

2006-06-07 Thread Randy.Dunlap
On Wed, 7 Jun 2006 20:53:16 +0200 Diego Calleja wrote:

> Since people didn't like the "many small files" approach, I've moved
> it to directories containing index.txt files:
> 
> Documentation/sysctl/vm/index.txt
> Documentation/sysctl/net/core/index.txt
> Documentation/sysctl/net/unix/index.txt
> Documentation/sysctl/net/ipv4/index.txt
> Documentation/sysctl/net/ipv4/conf/index.txt
> Documentation/sysctl/net/ipv4/route/index.txt
> Documentation/sysctl/net/ipv4/neigh/index.txt
> 
> and so on.
> 
> As previously, this moves all sysctl documentation (including
> XFS and network) to Documentation/sysctl/*. The patch is
> against linus tree and weights more than 200K in size
> and is place at: http://www.terra.es/personal/diegocg/sysctl-docs

~> diffstat -p1 -w 70 sysctl-docs 
 Documentation/filesystems/proc.txt| 1210 
 Documentation/filesystems/xfs.txt |   84 -
 Documentation/networking/00-INDEX |2 
 Documentation/networking/Configurable |2 
 Documentation/networking/decnet.txt   |4 
 Documentation/networking/ip-sysctl.txt|  899 ---
 Documentation/networking/xfrm_sync.txt|   11 
 Documentation/sysctl/README   |  121 -
 Documentation/sysctl/abi.txt  |   54 
 Documentation/sysctl/abi/index.txt|   49 
 Documentation/sysctl/dev/README   |2 
 Documentation/sysctl/fs.txt   |  150 -
 Documentation/sysctl/fs/index.txt |  240 +++
 Documentation/sysctl/fs/xfs/index.txt |  170 ++
 Documentation/sysctl/kernel.txt   |  344 
 Documentation/sysctl/kernel/index.txt |  628 
 Documentation/sysctl/net/README   |8 
 Documentation/sysctl/net/appletalk/index.txt  |   38 
 Documentation/sysctl/net/bridge/index.txt |   44 
 Documentation/sysctl/net/core/index.txt   |  115 +
 Documentation/sysctl/net/ipv4/conf/index.txt  |  270 +++
 Documentation/sysctl/net/ipv4/index.txt   |  739 +
 Documentation/sysctl/net/ipv4/neigh/index.txt |  138 +
 Documentation/sysctl/net/ipv4/route/index.txt |  143 +
 Documentation/sysctl/net/ipv6/conf/index.txt  |  256 +++
 Documentation/sysctl/net/ipv6/icmp/index.txt  |   15 
 Documentation/sysctl/net/ipv6/index.txt   |   65 
 Documentation/sysctl/net/ipv6/neigh/index.txt |  134 +
 Documentation/sysctl/net/ipv6/route/index.txt |   78 +
 Documentation/sysctl/net/unix/index.txt   |   15 
 Documentation/sysctl/sunrpc.txt   |   20 
 Documentation/sysctl/sunrpc/index.txt |   64 
 Documentation/sysctl/vm.txt   |  180 --
 Documentation/sysctl/vm/index.txt |  334 
 Documentation/sysrq.txt   |   20 
 35 files changed, 3611 insertions(+), 3035 deletions(-)
I don't know how long it takes to review such a large patch, but
I'll continue to do so.  For now:

README:

1. +Documentation for /proc/sys/, aka. sysctl

a.k.a. or just "aka".  Not "aka.".  or spell it out, or omit it,
maybe like:

Documentation for /proc/sys/ (sysctl)

2.  Limit lines to max. of 80 characters, but around 70-72 is better
IMO.  That allows someone to make minor corrections without having
to fudge the lines around.

3.  +This means there're several parameters
use "there are"

4.  +are: enabling or disabling forwading in a certain network interface
forwarding

5.  +is also used to export some stadistic information, ej: some
statistic or statistics or statistical
ej: ??  use e.g.: (preferred) or eg:

6.  +can be read but can _not_ be written.
_cannot_

7.  +own program to read them aswell)
as well)

8.  +to change '/' by '.' and ignore the '/proc/sys' part of the path, ie
s/by/to/
s/ie/i.e./

9.  +means that any tweak that you do will be lost the next time you restart  
your
* collapse 2 spaces to 1

10. +_VERY_ DANGEROUS and can ruin the performance performance,
drop one "performance"

11. +As a quick 'ls /proc/sys' will show, the directory consists of several 
subdirs.
+Each subdir is mainly about one part of the kernel, so you can do configuration

Spell out "subdirectories" and "subdirectory".

12. +fs/specific filesystems filehandle, inode, dentry and 
quota tuning

insert ":" after "filesystems"


OK, that's all for the README file.  I'll look at the rest of it
sometime this week.  I don't think that it's quite ready to be merged.

---
~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


Re: kernel panic (on DHCP discover?) in sky2 driver of 2.6.17-rc1

2006-06-07 Thread Stephen Hemminger
On Wed, 7 Jun 2006 12:33:21 -0700
"Guenther Thomsen" <[EMAIL PROTECTED]> wrote:

> I was perhaps a bit quick to declare victory. While the results below stand 
> and the machine survived the last few days (idle), it occurred to me only 
> today, to have a look at the kernel's message buffer, where I found following:
> --8<--
> sky2 eth0: enabling interface
> sky2 eth0: Link is up at 1000 Mbps, full duplex, flow control none
> sky2 eth1: enabling interface
> sky2 eth1: Link is up at 1000 Mbps, full duplex, flow control none
> audit(1149379670.514:3): audit_pid=1915 old=0 by auid=4294967295
> : hw csum failure.
> sky2 eth1: rx error, status 0x7ffc0001 length 444
> 
> Call Trace: {__skb_checksum_complete+76}
>{__tcp_checksum_complete_user+33}
>{tcp_rcv_established+817} {tcp_v4_
> do_rcv+43}
>{sk_wait_data+203} {tcp_prequeue_p
> rocess+121}
>{tcp_recvmsg+1104} {sock_common_re
> cvmsg+48}
>{do_sock_read+209} {sock_aio_read+
> 83}
>{dev_queue_xmit+0} {do_sync_read+1
> 99}
>{remove_wait_queue+18} {autoremove
> _wake_function+0}
>{vfs_read+228} {sys_read+69}
>{tracesys+209}
> : hw csum failure.
> sky2 eth1: rx error, status 0x7ffc0001 length 444

Different problem, I have seen it before.  Basically if the receiver gets 
overloaded, the
packet FIFO gets full. The driver needs to have some kind of recovery logic for 
this;
probably just shutting down the receiver and restarting.
-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Larry Finger

Dan Williams wrote:

Weird, does the kernel not do something that fprintf() _does_ do here?
I tested with a short C program that mimics the behavior of this chunk
of code, and "%.2x" didn't work, but "%.2hhx" certainly did.  "hh" is
supposed to mean "A following integer conversion corresponds to a signed
char or unsigned char argument".  The original conversion was converting
stuff from la-la land after the first 4 bytes (in both softmac and my
testcase), and "hh" solved it in the testcase.  I did try casting to
char, but glibc pretty much ignored that.


I also found that casting with char gave the same result as no cast, but that a u8 cast worked. I 
guess printk is _almost_ like fprintf.


Larry

-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Dan Williams
On Wed, 2006-06-07 at 13:12 -0500, Larry Finger wrote:
> Dan Williams wrote:
> > 
> > from ieee80211softmac_wx.c: ieee80211softmac_wx_set_genie()
> > 
> > memcpy(mac->wpa.IE, extra, wrqu->data.length);
> > dprintk(KERN_INFO PFX "generic IE set to ");
> > for (i=0;idata.length;i++)
> > dprintk("%.2x", mac->wpa.IE[i]);
> > dprintk("\n");
> > 
> > the dprintk code isn't doing the right thing here, given an array of
> > bytes.  You probably want:
> > 
> > dprintk("%.2hhx", mac->wpa.IE[i]);
> > 
> > (ie, add the "hh" before the x to tell the print that it's a char)
> > 
> That doesn't work - the result is

Weird, does the kernel not do something that fprintf() _does_ do here?
I tested with a short C program that mimics the behavior of this chunk
of code, and "%.2x" didn't work, but "%.2hhx" certainly did.  "hh" is
supposed to mean "A following integer conversion corresponds to a signed
char or unsigned char argument".  The original conversion was converting
stuff from la-la land after the first 4 bytes (in both softmac and my
testcase), and "hh" solved it in the testcase.  I did try casting to
char, but glibc pretty much ignored that.

Dan

> %hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx
> 
> I changed the line to cast the output byte as a u8 as follows:
> 
>  dprintk("%.2x", (u8)mac->wpa.IE[i]);
> 
> This produces the line
> 
> generic IE set to dd160050f2010150f2020150f2020150f202
> 
> This is the WPA IE supplied by wpa_supplicant and it matches the one used in 
> the ndiswrapper case. 
> One mystery solved, but why doesn't it work?
> 
> Johannes - should I submit the patch to fix this printout, or would you like 
> to do it?
> 
> Larry

-
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


Re: [PATCH] pcnet32 driver NAPI support

2006-06-07 Thread Lennart Sorensen
On Wed, Jun 07, 2006 at 11:20:40AM -0700, Don Fry wrote:
> I am also working on a NAPI version of the pcnet32 driver for many of
> the same reasons, and will compare what you have with my own
> implementation.  I probably won't be able to do much until Friday.  
> 
> Just a couple of comments.  I am adding netdev@vger.kernel.org to the cc
> list, as most network driver discussion is done here rather than lkml.
> linux-kernel (and linux-net) should be deleted in future replies.

I must have picked the wrong place to cc.

> The 2.6.17-rc6 would be the correct source to patch against.  Since this
> is an enhancement it will not come out till 2.6.18.

I thought so.  That is why I did it against both 2.6.17-rc6 and 2.6.16
(since I use it with 2.6.16).

> I would not change the driver name from pcnet32 to pcnet32napi, but I
> would changes the version from 1.32 to 1.33NAPI or something like that.

Hmm, perhaps.  I just wanted something that made it obvious in dmesg
which driver I was running.  I see tulip actually does put it in the
version instead.  I don't remember where I got the driver name change
idea from.

> Some areas of concern that you may have addressed already, I have not
> scanned your changes yet, are what happens if the ring size is changed
> without bringing down the interface (via ethtool), or if the loopback
> test is run in a similar fashion, or a tx timeout occurs.

The same thing as if it was done before enabling napi.  From a few
messages I have seen, it doesn't work right now, and it won't work any
better with my changes.  I have never tried changing the ring size on
the fly, so I don't know.

It appears that the port is stopped before the ring size change is done,
although I can't really tell how it handles things if the queue is not
empty when it stops the port.  Does it try to handle anything left in
the ring first or does it just toss those packets? (That I would
consider wrong).

> The lp->lock MUST be held whenever accessing the csr or bcr registers as
> this is a multi-step process, and has been the source of problems in the
> past.  Even on UP systems.

Hmm, I just followed what appeared to be in pcnet32_rx and how tulip and
a few other drivers had done their napi conversions.  It certainly works
for me the way I did it.  Haven't seen any lockups yet.  I do see that I
am not holding the lock when I acknowledge IRQs in pcnet32_poll, which
pcnet32_rx doesn't need to worry about since it is called from the
interrupt handler which already holds the lock.  That should be fixed
then.

So I can do:
// Clear RX interrupts
spin_lock(&lp->lock);
lp->a.write_csr (ioaddr, 0, 0x1400);
spin_unlock(&lp->lock);
That part seems simple enough to protect.

Is this safe without holding the lock?
} while(lp->a.read_csr (ioaddr, 0) & 0x1400);
Not sure how to wrap a lock around that one without holding the lock for
way too long.

perhaps:
spin_lock(&lp->lock);
state=lp->a.read_csr (ioaddr, 0) & 0x1400;
spin_unlock(&lp->lock);
} while(state);
Does that seem more reasonable?

Len Sorensen
-
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


RE: kernel panic (on DHCP discover?) in sky2 driver of 2.6.17-rc1

2006-06-07 Thread Guenther Thomsen
I was perhaps a bit quick to declare victory. While the results below stand and 
the machine survived the last few days (idle), it occurred to me only today, to 
have a look at the kernel's message buffer, where I found following:
--8<--
sky2 eth0: enabling interface
sky2 eth0: Link is up at 1000 Mbps, full duplex, flow control none
sky2 eth1: enabling interface
sky2 eth1: Link is up at 1000 Mbps, full duplex, flow control none
audit(1149379670.514:3): audit_pid=1915 old=0 by auid=4294967295
: hw csum failure.
sky2 eth1: rx error, status 0x7ffc0001 length 444

Call Trace: {__skb_checksum_complete+76}
   {__tcp_checksum_complete_user+33}
   {tcp_rcv_established+817} {tcp_v4_
do_rcv+43}
   {sk_wait_data+203} {tcp_prequeue_p
rocess+121}
   {tcp_recvmsg+1104} {sock_common_re
cvmsg+48}
   {do_sock_read+209} {sock_aio_read+
83}
   {dev_queue_xmit+0} {do_sync_read+1
99}
   {remove_wait_queue+18} {autoremove
_wake_function+0}
   {vfs_read+228} {sys_read+69}
   {tracesys+209}
: hw csum failure.
sky2 eth1: rx error, status 0x7ffc0001 length 444


Call Trace: {__skb_checksum_complete+76}
   {__tcp_checksum_complete_user+33}
   {tcp_rcv_established+817} {tcp_v4_
do_rcv+43}
   {sk_wait_data+203} {tcp_prequeue_p
rocess+121}
   {tcp_recvmsg+1104} {sock_common_re
cvmsg+48}
   {alloc_sock_iocb+20} {do_sock_read
+209}
   {sock_aio_read+83} {do_sync_read+1
99}
   {remove_wait_queue+18} {autoremove
_wake_function+0}
   {vfs_read+228} {sys_read+69}
   {tracesys+209}
: hw csum failure.
sky2 eth1: rx error, status 0x7ffc0001 length 444


Call Trace: {__skb_checksum_complete+76}
   {__tcp_checksum_complete_user+33}
   {tcp_rcv_established+817} {tcp_v4_
do_rcv+43}
   {sk_wait_data+203} {tcp_prequeue_p
rocess+121}
   {tcp_recvmsg+1104} {sock_common_re
cvmsg+48}
   {do_sock_read+209} {sock_aio_read+
83}
   {do_sync_read+199} {remove_wait_qu
eue+18}
   {autoremove_wake_function+0} {curr
ent_kernel_time+13}
   {vfs_read+228} {sys_read+69}
   {tracesys+209}

sky2 eth0: rx error, status 0x7ffc0001 length 444
sky2 eth0: rx error, status 0x7ffc0001 length 444
sky2 eth1: rx error, status 0x7ffc0001 length 444
sky2 eth1: rx error, status 0x7ffc0001 length 444
sky2 eth1: rx error, status 0x7ffc0001 length 444
-->8--
Looks, like we're almost, but not quite there yet.

cheers
Guenther


-Original Message-
From: Guenther Thomsen 
Sent: Saturday, June 03, 2006 9:06 PM
To: 'Stephen Hemminger'
Cc: John W. Linville; netdev@vger.kernel.org
Subject: RE: kernel panic (on DHCP discover?) in sky2 driver of
2.6.17-rc1


I received the hardware back and took the opportunity to test with 
2.6.17-rc5-git11. So far I did only little tests (ttcp on both interfaces in, 
out or mixed with some 10e6 packets), but it looks good. No errors (well, 16 
overruns in 76574513 packets) and line rate (about 111MB/s) on both channels 
simultaneously. Hurray!

Thanks a lot for you continued efforts.
Guenther

-Original Message-
From: Stephen Hemminger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 16, 2006 12:12 PM
To: Guenther Thomsen
Cc: John W. Linville; netdev@vger.kernel.org
Subject: Re: kernel panic (on DHCP discover?) in sky2 driver of
2.6.17-rc1


Could you try the 2.6.17-rc4 version with this patch. It turns out the board
seems to give out of order status responses.

Ignore the vendor sk98lin driver, when I try the stock version it spends it's
life resetting itself because it sets up PCI bus wrong. If I fix that, it spends
it's time getting confused because it can't handle intermixed status reports
properly (checksum et all is per port not per board).


 drivers/net/sky2.c |   28 +---
 1 files changed, 21 insertions(+), 7 deletions(-)

792547bc5e8e4f7d5a1070a168056f429635c254
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index ffd267f..11e7914 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1020,8 +1020,27 @@ static int sky2_up(struct net_device *de
struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port;
u32 ramsize, rxspace, imask;
-   int err = -ENOMEM;
+   int cap, err;
+   struct net_device *otherdev = hw->dev[sky2->port^1];
 
+   /*
+* Reduce split transactions (and turn off) rx checksums to
+* prevent problems with dual ports.
+*/
+   if (otherdev && netif_running(otherdev) &&
+   (cap = pci_find_capability(hw->pdev, PCI_CAP_ID_PCIX))) {
+   struct sky2_port *osky2 = netdev_priv(otherdev);
+   u16 cmd;
+
+   cmd = sky2_pci_read16(hw, cap + PCI_X_CMD);
+   cmd &= ~PCI_X_CMD_MAX_SPLIT;
+   sky2_pci_write16(hw, cap + PCI_X_CMD, cmd);
+
+   sky2->rx_csum = 0;
+   osky2->rx_csum = 0;
+   }
+
+   err = -ENOMEM;
if (netif_msg_ifup(sky2))
printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
 

Re: [PATCH 1/2] e1000: fix netpoll with NAPI

2006-06-07 Thread Neil Horman
On Wed, Jun 07, 2006 at 02:44:54PM -0400, Jeff Moyer wrote:
> ==> Regarding Re: [PATCH 1/2] e1000: fix netpoll with NAPI; Auke Kok <[EMAIL 
> PROTECTED]> adds:
> 
> auke-jan.h.kok> Hi,
> 
> auke-jan.h.kok> we're not too happy with this as it puts a branch right in
> auke-jan.h.kok> the regular receive path. We haven't ran the numbers on it
> auke-jan.h.kok> yet but it is likely that this will lower performance
> auke-jan.h.kok> significantly during normal receives for something that is
> auke-jan.h.kok> not common use.
> 
> auke-jan.h.kok> Attached below a (revised) patch that adds proper locking
> auke-jan.h.kok> around the rx_clean to prevent the race.
> 
> That patch locks around the tx clean routine.  As such, it doesn't prevent
> the problem.
> 
Further to that, do tests on this if you like, but I would certainly think a
properly formed conditional operation is going to provide better performance
than a spin_lock operation in the receive path.  Why not just turn the:
if(netpoll_op)
into an
if(unlikely(netpoll_op))

I expect that will reduce the overhead of the conditional to effectively zero
for the normal receive case.  The following patch does that, and I expect you
performance won't suffer at all:

Signed-off-by: Neil Horman <[EMAIL PROTECTED]>



 e1000_main.c |   54 +-
 1 files changed, 45 insertions(+), 9 deletions(-)



--- linux-2.6.9/drivers/net/e1000/e1000_main.c.neil 2006-06-06 
10:37:42.0 -0400
+++ linux-2.6.9/drivers/net/e1000/e1000_main.c  2006-06-07 10:48:22.0 
-0400
@@ -3207,8 +3207,9 @@ e1000_update_stats(struct e1000_adapter 
  * @pt_regs: CPU registers structure
  **/
 
+
 static irqreturn_t
-e1000_intr(int irq, void *data, struct pt_regs *regs)
+__e1000_intr(int irq, void *data, struct pt_regs *regs, int netpoll_op)
 {
struct net_device *netdev = data;
struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -3217,6 +3218,7 @@ e1000_intr(int irq, void *data, struct p
 #ifndef CONFIG_E1000_NAPI
int i;
 #else
+   struct net_device *dev_to_sched;
/* Interrupt Auto-Mask...upon reading ICR,
 * interrupts are masked.  No need for the
 * IMC write, but it does mean we should
@@ -3255,8 +3257,22 @@ e1000_intr(int irq, void *data, struct p
E1000_WRITE_REG(hw, IMC, ~0);
E1000_WRITE_FLUSH(hw);
}
-   if (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0])))
-   __netif_rx_schedule(&adapter->polling_netdev[0]);
+
+   /*
+* netpoll operations, in the interests of efficiency 
+* only do napi polling on the device passed to the 
+* poll_controller.  Therefore, if we are preforming 
+* a netpoll operation, then we can't schedule a receive
+* to one of the dummy net devices that exist for sole
+* purpose of spreading out rx schedules
+*/ 
+   if (unlikely(netpoll_op))
+   dev_to_sched = netdev;
+   else
+   dev_to_sched = &adapter->polling_netdev[0];
+
+   if (likely(netif_rx_schedule_prep(dev_to_sched)))
+   __netif_rx_schedule(dev_to_sched);
else
e1000_irq_enable(adapter);
 #else
@@ -3288,6 +3304,13 @@ e1000_intr(int irq, void *data, struct p
return IRQ_HANDLED;
 }
 
+static irqreturn_t
+e1000_intr(int irq, void *data, struct pt_regs *regs)
+{
+   return __e1000_intr(irq, data, regs, 0);
+}
+
+
 #ifdef CONFIG_E1000_NAPI
 /**
  * e1000_clean - NAPI Rx polling callback
@@ -3300,7 +3323,6 @@ e1000_clean(struct net_device *poll_dev,
struct e1000_adapter *adapter;
int work_to_do = min(*budget, poll_dev->quota);
int tx_cleaned = 0, i = 0, work_done = 0;
-
/* Must NOT use netdev_priv macro here. */
adapter = poll_dev->priv;
 
@@ -3308,10 +3330,24 @@ e1000_clean(struct net_device *poll_dev,
if (!netif_carrier_ok(adapter->netdev))
goto quit_polling;
 
-   while (poll_dev != &adapter->polling_netdev[i]) {
-   i++;
-   if (unlikely(i == adapter->num_rx_queues))
-   BUG();
+   /*
+* only search for a matching polling_netdev in the event
+* that this isn't a real registered net_device
+* A real net device can be passed in here in the event
+* that netdump has been activated (this comes through 
+* netpoll_poll_dev).  We detect this by virtue of the 
+* fact that each polling_netdev->priv points to the private
+* data of its parent (registered) netdev.  So if:
+* poll_dev->priv == netdev_priv(poll_dev), its a real device
+* otherwise its a polling_netdev.
+*/
+   if (likely(adapter != netdev_priv(poll_dev))) {
+   while (poll_dev != &adapter->polling_netdev[i]) {
+   i++;
+   if (unlikely(i == adapter->num_rx_queues))
+ 

Re: [PATCH 1/2] e1000: fix netpoll with NAPI

2006-06-07 Thread John W. Linville
On Wed, Jun 07, 2006 at 11:25:29AM -0700, Auke Kok wrote:

> @@ -4584,10 +4584,25 @@ static void
>  e1000_netpoll(struct net_device *netdev)
>  {
> struct e1000_adapter *adapter = netdev_priv(netdev);
> +#ifdef CONFIG_E1000_NAPI
> +   int budget = 0;
> +
> +   disable_irq(adapter->pdev->irq);
> +   if (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0]))) {
> +   if (spin_trylock(&adapter->tx_queue_lock)) {
> +   e1000_clean_tx_irq(adapter, &adapter->tx_ring[0]);
> +   spin_unlock(&adapter->tx_queue_lock);
> +   }
> +   adapter->clean_rx(adapter, adapter->rx_ring,
> +   &budget, netdev->weight);
> +   clear_bit(__LINK_STATE_RX_SCHED,
> +   &adapter->polling_netdev[0].state);
> +   }
> +#else
> +
> disable_irq(adapter->pdev->irq);

Pedantic objection, but I think this would read easier w/o the extra
newline before disable_irq.

John
-- 
John W. Linville
[EMAIL PROTECTED]
-
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


Re: [PATCH 1/2] e1000: fix netpoll with NAPI

2006-06-07 Thread Jeff Moyer
==> Regarding Re: [PATCH 1/2] e1000: fix netpoll with NAPI; Auke Kok <[EMAIL 
PROTECTED]> adds:

auke-jan.h.kok> Hi,

auke-jan.h.kok> we're not too happy with this as it puts a branch right in
auke-jan.h.kok> the regular receive path. We haven't ran the numbers on it
auke-jan.h.kok> yet but it is likely that this will lower performance
auke-jan.h.kok> significantly during normal receives for something that is
auke-jan.h.kok> not common use.

auke-jan.h.kok> Attached below a (revised) patch that adds proper locking
auke-jan.h.kok> around the rx_clean to prevent the race.

That patch locks around the tx clean routine.  As such, it doesn't prevent
the problem.

> + disable_irq(adapter->pdev->irq);
> + if (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0]))) {
> + if (spin_trylock(&adapter->tx_queue_lock)) {
> + e1000_clean_tx_irq(adapter, &adapter->tx_ring[0]);
> + spin_unlock(&adapter->tx_queue_lock);
> + }
> + adapter->clean_rx(adapter, adapter->rx_ring,
> + &budget, netdev->weight);
> + clear_bit(__LINK_STATE_RX_SCHED,
> + &adapter->polling_netdev[0].state);

-Jeff
-
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


Updated sysctl documentation take #2

2006-06-07 Thread Diego Calleja
Since people didn't like the "many small files" approach, I've moved
it to directories containing index.txt files:

Documentation/sysctl/vm/index.txt
Documentation/sysctl/net/core/index.txt
Documentation/sysctl/net/unix/index.txt
Documentation/sysctl/net/ipv4/index.txt
Documentation/sysctl/net/ipv4/conf/index.txt
Documentation/sysctl/net/ipv4/route/index.txt
Documentation/sysctl/net/ipv4/neigh/index.txt

and so on.

As previously, this moves all sysctl documentation (including
XFS and network) to Documentation/sysctl/*. The patch is
against linus tree and weights more than 200K in size
and is place at: http://www.terra.es/personal/diegocg/sysctl-docs

Comments?
-
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


Re: [PATCH 1/2] e1000: fix netpoll with NAPI

2006-06-07 Thread Auke Kok

Matt Mackall wrote:

On Wed, Jun 07, 2006 at 11:05:22AM -0400, Neil Horman wrote:
 

Matt, any ideas on this?

Not at the moment.

how about this for a solution?  It doesn't make netpoll any more robust, but I
think in the interests of efficiency it would be fair to require that, when
netpolled, a driver must receive frames on the same net device for which it was
polled.  With this patch we detect that condition and handle it accordingly in
e1000_intr.  This eliminates the need for us to call the clean_rx method from
the poll_controller when napi is configured, instead allowing the poll method to
be called from napi_poll, as the netpoll model currently does.  This fixes the
netdump regression, and eliminates the layering violation and the potential race
that we've been discussing.  I've just tested it with netdump here and it works
quite well.

Thoughts appreciated.


This looks pretty reasonable, mostly from the perspective that it
doesn't put any further ugliness in netpoll. We might want to add a
comment somewhere in netpoll of the new rule we're now observing.
I'll let the e1000 guys comment on the particulars of the driver change.


Hi,

we're not too happy with this as it puts a branch right in the regular receive 
path. We haven't ran the numbers on it yet but it is likely that this will 
lower performance significantly during normal receives for something that is 
not common use.


Attached below a (revised) patch that adds proper locking around the rx_clean 
to prevent the race.


Cheers,

Auke

---

e1000: fix netpoll with NAPI

This fixes netpoll when using NAPI, and protects against a rare race condition
in the netpoll routine, while staying out of our ways from the normal hotpath.

Signed-off-by: Mitch Williams <[EMAIL PROTECTED]>
Signed-off-by: Auke Kok <[EMAIL PROTECTED]>

---
 e1000_main.c |   17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index bd709e5..876251c 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4584,10 +4584,25 @@ static void
 e1000_netpoll(struct net_device *netdev)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
+#ifdef CONFIG_E1000_NAPI
+	int budget = 0;
+
+	disable_irq(adapter->pdev->irq);
+	if (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0]))) {
+		if (spin_trylock(&adapter->tx_queue_lock)) {
+			e1000_clean_tx_irq(adapter, &adapter->tx_ring[0]);
+			spin_unlock(&adapter->tx_queue_lock);
+		}
+		adapter->clean_rx(adapter, adapter->rx_ring,
+&budget, netdev->weight);
+		clear_bit(__LINK_STATE_RX_SCHED,
+&adapter->polling_netdev[0].state);
+	}
+#else
+
 	disable_irq(adapter->pdev->irq);
 	e1000_intr(adapter->pdev->irq, netdev, NULL);
 	e1000_clean_tx_irq(adapter, adapter->tx_ring);
-#ifndef CONFIG_E1000_NAPI
 	adapter->clean_rx(adapter, adapter->rx_ring);
 #endif
 	enable_irq(adapter->pdev->irq);


Re: 2.6.17-rc6-mm1

2006-06-07 Thread Dave Jones
On Wed, Jun 07, 2006 at 10:47:24AM -0700, Andrew Morton wrote:

 > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17-rc6/2.6.17-rc6-mm1/

Just spotted this typo in a new option.

Signed-off-by: Dave Jones <[EMAIL PROTECTED]>

--- rc6mm1/net/Kconfig~ 2006-06-07 14:19:44.0 -0400
+++ rc6mm1/net/Kconfig  2006-06-07 14:19:58.0 -0400
@@ -227,7 +227,7 @@ config NET_TCPPROBE
depends on INET && EXPERIMENTAL && PROC_FS && KPROBES
---help---
This module allows for capturing the changes to TCP connection
-   state in response to incoming patckets. It is used for debugging
+   state in response to incoming packets. It is used for debugging
TCP congestion avoidance modules. If you don't understand
what was just said, you don't need it: say N.
 


-- 
http://www.codemonkey.org.uk
-
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


Re: [PATCH] pcnet32 driver NAPI support

2006-06-07 Thread Don Fry
On Wed, Jun 07, 2006 at 12:52:25PM -0400, Lennart Sorensen wrote:
> I have added NAPI support to the pcnet32 driver.  This has greatly
> improved the responsiveness on my systems (geode GX1 266MHz) when under
> heavy network load.  Without this change the system would become
> unresponsive due to interrupts when flooded with traffic, and eventually
> the watchdog would reboot the system due to the watchdog daemon being
> starved for cpu time.  With the patch the system is still useable on a
> serial console, although very slow.  Network throughput is also higher
> since more time is spend processing packets and getting them sent out,
> instead of only spending time acknowledging interrupts from incoming
> packets.
> 
> Now having never actually done a patch submission to the kernel before,
> I will try and see if I can do it right.
> 
> The patch adds a PCNET32_NAPI config option to drivers/net/Kconfig, and
> the appropriate code to support the option to drivers/net/pcnet32.c and
> has been tested on many of my systems (allthough they are allmost all
> identical, and require some extra patches to pcnet32 due to not having
> an EEPROM installed), and on an AT-2700TX.
> 
> I have made a diff against 2.6.16.20 and 2.6.17-rc6.
> 
> Comments would be very welcome.

I am also working on a NAPI version of the pcnet32 driver for many of
the same reasons, and will compare what you have with my own
implementation.  I probably won't be able to do much until Friday.  

Just a couple of comments.  I am adding netdev@vger.kernel.org to the cc
list, as most network driver discussion is done here rather than lkml.
linux-kernel (and linux-net) should be deleted in future replies.

The 2.6.17-rc6 would be the correct source to patch against.  Since this
is an enhancement it will not come out till 2.6.18.

I would not change the driver name from pcnet32 to pcnet32napi, but I
would changes the version from 1.32 to 1.33NAPI or something like that.

Some areas of concern that you may have addressed already, I have not
scanned your changes yet, are what happens if the ring size is changed
without bringing down the interface (via ethtool), or if the loopback
test is run in a similar fashion, or a tx timeout occurs.

The lp->lock MUST be held whenever accessing the csr or bcr registers as
this is a multi-step process, and has been the source of problems in the
past.  Even on UP systems.

> 
> Signed-off-by: Len Sorensen <[EMAIL PROTECTED]>
> 
> Len Sorensen

-- 
Don Fry
[EMAIL PROTECTED]
-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Larry Finger

Dan Williams wrote:

On Wed, 2006-06-07 at 17:57 +0200, Johannes Berg wrote:

On Wed, 2006-06-07 at 17:51 +0200, Johannes Berg wrote:


Well, it should be shown in the 802.11i spec too.

I suppose that it is the association request, and needs to contain the
RSN described in 7.3.2.25 as per 7.2.3.4 in 802.11i. This is, afaik, the
'generic IE' that is added with the wext. Now, it looks like the RSN
isn't included but the WPA2 info or something? Also, the genIE in your
log doesn't look correct to me, starting with ff?? Jouni, do you
have any idea what might be going on?


I believe that wpa_supplicant tells the driver what genie to use through
the SIOCSIWGENIE wext call.  The IEs match between what the driver
appears to be reporting, and what wpa_supplicant says from the logs.
wpa_supplicant is almost certainly writing the correct IE to the driver
through wext, so I think the debug output from softmac must be
formatting the string incorrectly when printing it out to the logs.

Looking at it further:

struct ieee80211softmac_wpa {
char *IE;
int IElen;
int IEbuflen;
};

from ieee80211softmac_wx.c: ieee80211softmac_wx_set_genie()

memcpy(mac->wpa.IE, extra, wrqu->data.length);
dprintk(KERN_INFO PFX "generic IE set to ");
for (i=0;idata.length;i++)
dprintk("%.2x", mac->wpa.IE[i]);
dprintk("\n");

the dprintk code isn't doing the right thing here, given an array of
bytes.  You probably want:

dprintk("%.2hhx", mac->wpa.IE[i]);

(ie, add the "hh" before the x to tell the print that it's a char)


That doesn't work - the result is

%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx

I changed the line to cast the output byte as a u8 as follows:

dprintk("%.2x", (u8)mac->wpa.IE[i]);

This produces the line

generic IE set to dd160050f2010150f2020150f2020150f202

This is the WPA IE supplied by wpa_supplicant and it matches the one used in the ndiswrapper case. 
One mystery solved, but why doesn't it work?


Johannes - should I submit the patch to fix this printout, or would you like to 
do it?

Larry
-
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


Re: [PATCH 4/4] ehea: Kconfig and Makefile

2006-06-07 Thread Randy.Dunlap
On Wed, 07 Jun 2006 19:06:03 +0200 Jan-Bernd Themann wrote:

> Signed-off-by:  Jan-Bernd Themann <[EMAIL PROTECTED]>
> 
> 
> drivers/net/ehea/Kconfig  |6 ++
> drivers/net/ehea/Makefile |   45 +
> 2 files changed, 51 insertions(+)
> 
> 
> 
> --- linux-2.6.16-rc5-orig/drivers/net/ehea/Makefile1969-12-31 
> 16:00:00.0 -0800
> +++ kernel/drivers/net/ehea/Makefile2006-06-07 07:01:14.634178704 -0700
> @@ -0,0 +1,45 @@
> +# Server eHEA ethernet device driver for Linux on POWER
> +#
> +#
> +#  linux/drivers/net/ehea/Makefile
> +#
> +#  eHEA ethernet device driver for IBM eServer System p
> +#
> +#  (C) Copyright IBM Corp. 2006
> +#
> +#  Authors:
> +#   Christoph Raisch <[EMAIL PROTECTED]>
> +#   Jan-Bernd Themann <[EMAIL PROTECTED]>
> +#   Heiko-Joerg Schick <[EMAIL PROTECTED]>
> +#   Thomas Klein <[EMAIL PROTECTED]>
> +#
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2, or (at your option)
> +# any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
> +
> +
> +
> +
> +# To compile module type:
> +# make -C /root/linux-2.6.5-7.244 SUBDIRS=`pwd` V=1 modules CONFIG_EHEA=m
> +# make -C /usr/src/linux-2.6.17-rc5 SUBDIRS=`pwd` V=1 modules CONFIG_EHEA=m
> +
> +ehea_mod-objs = ehea_main.o ehea_phyp.o ehea_qmr.o ehea_ethtool.o ehea_phyp.o
> +
> +obj-$(CONFIG_EHEA) += ehea_mod.o
> +
> +#CFLAGS += -Werror
> +
> +
> +

45 lines for a 5-line makefile.  :(

You need to integrate the Makefile and Kconfig into the upper-level
directory Makefile and Kconfig files.  Don't expect/require people
to enter thing like this:
> +# make -C /root/linux-2.6.5-7.244 SUBDIRS=`pwd` V=1 modules CONFIG_EHEA=m
> +# make -C /usr/src/linux-2.6.17-rc5 SUBDIRS=`pwd` V=1 modules CONFIG_EHEA=m


> --- linux-2.6.16-rc5-orig/drivers/net/ehea/Kconfig1969-12-31 
> 16:00:00.0 -0800
> +++ kernel/drivers/net/ehea/Kconfig2006-06-07 07:01:14.637178248 -0700
> @@ -0,0 +1,6 @@
> +config EHEA
> +   tristate "eHEA Ethernet support"
> +   depends on IBMEBUS
> +   ---help---
> +   This driver supports the IBM pSeries
> +   Ethernet adapter

That last sentence can be on one line, please.

---
~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


Re: [PATCH 3/4] ehea: queue managment

2006-06-07 Thread Stephen Hemminger
On Wed, 07 Jun 2006 19:05:02 +0200
Jan-Bernd Themann <[EMAIL PROTECTED]> wrote:

> Signed-off-by:  Jan-Bernd Themann <[EMAIL PROTECTED]>
> 
> 
> drivers/net/ehea/ehea_qmr.c |  719 
> 
> drivers/net/ehea/ehea_qmr.h |  390 +++
> 2 files changed, 1109 insertions(+)
> 

Make it look less like C++

Do you really need to use vmalloc/vfree? Are the data structures that big?

Be careful about global namespace issues. Stick to one prefix like ehea_
for all non static function names. Consider putting all in one file, or
use #include to cause it to be one compilation unit.


-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Dan Williams
On Wed, 2006-06-07 at 17:57 +0200, Johannes Berg wrote:
> On Wed, 2006-06-07 at 17:51 +0200, Johannes Berg wrote:
> 
> > Well, it should be shown in the 802.11i spec too.
> 
> I suppose that it is the association request, and needs to contain the
> RSN described in 7.3.2.25 as per 7.2.3.4 in 802.11i. This is, afaik, the
> 'generic IE' that is added with the wext. Now, it looks like the RSN
> isn't included but the WPA2 info or something? Also, the genIE in your
> log doesn't look correct to me, starting with ff?? Jouni, do you
> have any idea what might be going on?

I believe that wpa_supplicant tells the driver what genie to use through
the SIOCSIWGENIE wext call.  The IEs match between what the driver
appears to be reporting, and what wpa_supplicant says from the logs.
wpa_supplicant is almost certainly writing the correct IE to the driver
through wext, so I think the debug output from softmac must be
formatting the string incorrectly when printing it out to the logs.

Looking at it further:

struct ieee80211softmac_wpa {
char *IE;
int IElen;
int IEbuflen;
};

from ieee80211softmac_wx.c: ieee80211softmac_wx_set_genie()

memcpy(mac->wpa.IE, extra, wrqu->data.length);
dprintk(KERN_INFO PFX "generic IE set to ");
for (i=0;idata.length;i++)
dprintk("%.2x", mac->wpa.IE[i]);
dprintk("\n");

the dprintk code isn't doing the right thing here, given an array of
bytes.  You probably want:

dprintk("%.2hhx", mac->wpa.IE[i]);

(ie, add the "hh" before the x to tell the print that it's a char)

Dan


-
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


Re: [PATCH 0/4] ehea: IBM eHEA Ethernet Device Driver

2006-06-07 Thread Stephen Hemminger
On Wed, 07 Jun 2006 17:12:45 +0200
Jan-Bernd Themann <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> this is the first version of the IBM eHEA Ethernet Device Driver.
> It supports a new IBM ethernet chip on System p.
> 
> Main functionality including broadcast multicast and some parts of
> ethtool already work.
> 
> Things we're still working on:
> - vlan support
> - performance improvements in SMP systems
> - kernel coding style

Please:
   - Get rid of the debug macro's with 9 arguments...

-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Larry Finger

Johannes Berg wrote:

On Wed, 2006-06-07 at 09:01 -0700, Sam Leffler wrote:


Beware of the order of IE's in the management frames; some AP's are
touchy about this.


Uh oh. I have no idea where the ieee80211 layer sticks that one,
probably at the end.


I moved the WPA IE from the end forward without any effect. I have dumped that IE and find the 
following:


SoftMAC: Added WPA_IE of 24 bytes to association request
Contents of WPA_IE: 0xdd 0x16 0x00 0x50 0xf2 0x01 0x01 0x00 0x00 0x50
0xf2 0x02 0x01 0x00 0x00 0x50 0xf2 0x02 0x01 0x00
0x00 0x50 0xf2 0x02

I think I got the right thing, but I'm having trouble interpreting it. The dump was made by 
modifying the part of ieee80211softmac_assoc_req in ieee80211softmac_io.c where the WPA IE is added:


/* Add WPA IE */
if (mac->wpa.IElen && mac->wpa.IE) {
int i;
memcpy(data, mac->wpa.IE, mac->wpa.IElen);
data += mac->wpa.IElen;
printk(KERN_INFO PFX "Added WPA_IE of %d bytes to association 
request\n"
"Contents of WPA_IE: ", mac->wpa.IElen);
for (i=0; iwpa.IElen; i++)
printk("0x%02x ",mac->wpa.IE[i]);
printk("\n");
}

Larry
-
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 4/4] ehea: Kconfig and Makefile

2006-06-07 Thread Jan-Bernd Themann

Signed-off-by:  Jan-Bernd Themann <[EMAIL PROTECTED]>


drivers/net/ehea/Kconfig  |6 ++
drivers/net/ehea/Makefile |   45 +
2 files changed, 51 insertions(+)



--- linux-2.6.16-rc5-orig/drivers/net/ehea/Makefile1969-12-31 
16:00:00.0 -0800
+++ kernel/drivers/net/ehea/Makefile2006-06-07 07:01:14.634178704 -0700
@@ -0,0 +1,45 @@
+# Server eHEA ethernet device driver for Linux on POWER
+#
+#
+#  linux/drivers/net/ehea/Makefile
+#
+#  eHEA ethernet device driver for IBM eServer System p
+#
+#  (C) Copyright IBM Corp. 2006
+#
+#  Authors:
+#   Christoph Raisch <[EMAIL PROTECTED]>
+#   Jan-Bernd Themann <[EMAIL PROTECTED]>
+#   Heiko-Joerg Schick <[EMAIL PROTECTED]>
+#   Thomas Klein <[EMAIL PROTECTED]>
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+
+
+# To compile module type:
+# make -C /root/linux-2.6.5-7.244 SUBDIRS=`pwd` V=1 modules CONFIG_EHEA=m
+# make -C /usr/src/linux-2.6.17-rc5 SUBDIRS=`pwd` V=1 modules CONFIG_EHEA=m
+
+ehea_mod-objs = ehea_main.o ehea_phyp.o ehea_qmr.o ehea_ethtool.o ehea_phyp.o
+
+obj-$(CONFIG_EHEA) += ehea_mod.o
+
+#CFLAGS += -Werror
+
+
+
--- linux-2.6.16-rc5-orig/drivers/net/ehea/Kconfig1969-12-31 
16:00:00.0 -0800
+++ kernel/drivers/net/ehea/Kconfig2006-06-07 07:01:14.637178248 -0700
@@ -0,0 +1,6 @@
+config EHEA
+   tristate "eHEA Ethernet support"
+   depends on IBMEBUS
+   ---help---
+   This driver supports the IBM pSeries
+   Ethernet adapter



-
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 3/4] ehea: queue managment

2006-06-07 Thread Jan-Bernd Themann

Signed-off-by:  Jan-Bernd Themann <[EMAIL PROTECTED]>


drivers/net/ehea/ehea_qmr.c |  719 
drivers/net/ehea/ehea_qmr.h |  390 +++
2 files changed, 1109 insertions(+)



--- linux-2.6.16-rc5-orig/drivers/net/ehea/ehea_qmr.c1969-12-31 
16:00:00.0 -0800
+++ kernel/drivers/net/ehea/ehea_qmr.c2006-06-07 07:01:14.664174144 -0700
@@ -0,0 +1,719 @@
+/*
+ *  linux/drivers/net/ehea/ehea_qmr.c
+ *
+ *  eHEA ethernet device driver for IBM eServer System p
+ *
+ *  (C) Copyright IBM Corp. 2006
+ *
+ *  Authors:
+ *   Christoph Raisch <[EMAIL PROTECTED]>
+ *   Jan-Bernd Themann <[EMAIL PROTECTED]>
+ *   Heiko-Joerg Schick <[EMAIL PROTECTED]>
+ *   Thomas Klein <[EMAIL PROTECTED]>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "ehea.h"
+#include "ehea_phyp.h"
+#include "ehea_qmr.h"
+
+static void *ipz_qpageit_get_inc(struct ipz_queue *queue)
+{
+void *retvalue = ipz_qeit_get(queue);
+queue->current_q_offset += queue->pagesize;
+if (queue->current_q_offset > queue->queue_length) {
+queue->current_q_offset -= queue->pagesize;
+retvalue = NULL;
+}
+else if u64) retvalue) & (EHEA_PAGESIZE-1)) != 0) {
+EDEB(4, "ERROR!! not at PAGE-Boundary");
+return NULL;
+}
+EDEB(7, "queue=%p retvalue=%p", queue, retvalue);
+return retvalue;
+}
+
+static int ipz_queue_ctor(struct ipz_queue *queue,
+  const u32 nr_of_pages,
+  const u32 pagesize, const u32 qe_size,
+  const u32 nr_of_sg)
+{
+int f;
+EDEB_EN(7, "nr_of_pages=%x pagesize=%x qe_size=%x",
+nr_of_pages, pagesize, qe_size);
+queue->queue_length = nr_of_pages * pagesize;
+queue->queue_pages = vmalloc(nr_of_pages * sizeof(void *));
+if (!queue->queue_pages) {
+EDEB(4, "ERROR!! didn't get the memory");
+return 0;
+}
+memset(queue->queue_pages, 0, nr_of_pages * sizeof(void *));
+
+for (f = 0; f < nr_of_pages; f++) {
+(queue->queue_pages)[f] =
+(struct ipz_page *)get_zeroed_page(GFP_KERNEL);
+if (!(queue->queue_pages)[f]) {
+break;
+}
+}
+if (f < nr_of_pages) {
+int g;
+EDEB_ERR(4, "couldn't get 0ed pages queue=%p f=%x "
+ "nr_of_pages=%x", queue, f, nr_of_pages);
+for (g = 0; g < f; g++) {
+free_page((unsigned long)(queue->queue_pages)[g]);
+}
+return 0;
+}
+queue->current_q_offset = 0;
+queue->qe_size = qe_size;
+queue->act_nr_of_sg = nr_of_sg;
+queue->pagesize = pagesize;
+queue->toggle_state = 1;
+EDEB_EX(7, "queue_length=%x queue_pages=%p qe_size=%x"
+" act_nr_of_sg=%x", queue->queue_length, queue->queue_pages,
+queue->qe_size, queue->act_nr_of_sg);
+return 1;
+}
+
+static int ipz_queue_dtor(struct ipz_queue *queue)
+{
+int g;
+EDEB_EN(7, "ipz_queue pointer=%p", queue);
+if (!queue) {
+return 0;
+}
+if (!queue->queue_pages) {
+return 0;
+}
+EDEB(7, "destructing a queue with the following properties:\n"
+ "queue_length=%x act_nr_of_sg=%x pagesize=%x qe_size=%x",
+ queue->queue_length, queue->act_nr_of_sg, queue->pagesize,
+ queue->qe_size);
+for (g = 0; g < (queue->queue_length / queue->pagesize); g++) {
+free_page((unsigned long)(queue->queue_pages)[g]);
+}
+vfree(queue->queue_pages);
+
+EDEB_EX(7, "queue freed!");
+return 1;
+}
+
+struct ehea_cq *ehea_cq_new(void)
+{
+struct ehea_cq *cq = vmalloc(sizeof(*cq));
+if (cq)
+memset(cq, 0, sizeof(*cq));
+return cq;
+}
+
+void ehea_cq_delete(struct ehea_cq *cq)
+{
+vfree(cq);
+}
+
+struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
+   int nr_of_cqe, u64 eq_handle, u32 cq_token)
+{
+struct ehea_cq *cq = NULL;
+struct h_galpa gal;
+
+u64 *cq_handle_ref;
+u32 act_nr_of_entries;
+u32 act_pages;
+u64 hret;
+int ipz_rc;
+u32 counter;
+void *vpage = NULL;
+u64 rpage = 0;
+
+EDEB_EN(7, "adapter=%p nr_of_cqe=%x , eq_handle: %016lX",
+adapter, nr_of_cqe, eq_handle);
+
+cq = ehea_cq_new();
+if (!cq) {
+cq = NULL;
+EDEB_ERR(4, "ehea_create_cq ret=%p 

Re: [PATCH 1/2] e1000: fix netpoll with NAPI

2006-06-07 Thread Matt Mackall
On Wed, Jun 07, 2006 at 11:05:22AM -0400, Neil Horman wrote:
> >  
> > > Matt, any ideas on this?
> > 
> > Not at the moment.
> 
> how about this for a solution?  It doesn't make netpoll any more robust, but I
> think in the interests of efficiency it would be fair to require that, when
> netpolled, a driver must receive frames on the same net device for which it 
> was
> polled.  With this patch we detect that condition and handle it accordingly in
> e1000_intr.  This eliminates the need for us to call the clean_rx method from
> the poll_controller when napi is configured, instead allowing the poll method 
> to
> be called from napi_poll, as the netpoll model currently does.  This fixes the
> netdump regression, and eliminates the layering violation and the potential 
> race
> that we've been discussing.  I've just tested it with netdump here and it 
> works
> quite well.
> 
> Thoughts appreciated.

This looks pretty reasonable, mostly from the perspective that it
doesn't put any further ugliness in netpoll. We might want to add a
comment somewhere in netpoll of the new rule we're now observing.
I'll let the e1000 guys comment on the particulars of the driver change.

> Signed-off-by: Neil Horman <[EMAIL PROTECTED]>
Signed-off-by: Matt Mackall <[EMAIL PROTECTED]>

-- 
Mathematics is the supreme nostalgia of our time.
-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Larry Finger

Johannes Berg wrote:

On Wed, 2006-06-07 at 09:01 -0700, Sam Leffler wrote:


Beware of the order of IE's in the management frames; some AP's are
touchy about this.


Uh oh. I have no idea where the ieee80211 layer sticks that one,
probably at the end.


I can verify that. I'm currently building a new module with a printk to verify that it is being 
added. If it is, I'll try moving it to see if it helps.


Larry
-
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


Re: [patch] workaround zd1201 interference problem

2006-06-07 Thread Daniel Drake

Pavel Machek wrote:

Well, I'll try _enable() alone, but it seems to me that _enable()
command is needed to initialize radio properly. I do not think we can
get much further without firmware sources...


If you can formulate a proper and technical description of the issue 
(and exactly what is needed to workaround it), I can contact ZyDAS for 
you. They have been very helpful with ZD1211.


Daniel
-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Larry Finger

Sam Leffler wrote:

Beware of the order of IE's in the management frames; some AP's are
touchy about this.


That may be the cause here as the behavior when I changed AP's from the Linux-based model to one 
with VXWorks.


Larry
-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Johannes Berg
On Wed, 2006-06-07 at 09:01 -0700, Sam Leffler wrote:

> Beware of the order of IE's in the management frames; some AP's are
> touchy about this.

Uh oh. I have no idea where the ieee80211 layer sticks that one,
probably at the end.

johannes


signature.asc
Description: This is a digitally signed message part


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Sam Leffler
Johannes Berg wrote:
> On Wed, 2006-06-07 at 10:47 -0500, Larry Finger wrote:
> 
>> I have a little more information on what is happening. 
> 
> Great.
> 
>> In IEEE Std 802.11i-2004, which defines the 
>> WPA protocol, Figure 11a shows the sequence of exchanges needed to 
>> associate. Both bcm43xx-softmac 
>> and ndiswrapper go through the "Open System Authentication" process. 
> 
> Right, you always have to do that.
> 
>> Where they seem to diverge is 
>> in the STA's "Association Request (Security Parameters)" step. With 
>> ndiswrapper, the AP responds 
>> with a WPA EAPOL-Key message; whereas with softmac, the AP sends back the 
>> "invalid pairwise cipher 
>> message" and rejects the association.
> 
> Interesting. That's strange.
> 
>> Can anyone point to a reference that states what the content of the 
>> Association Request should be to 
>> get the AP to respond with the EAPOL-Key message? Unfortunately, I have no 
>> possibility of 
>> implementing a sniffer to see what a "correct" message contains.
> 
> Well, it should be shown in the 802.11i spec too.

Beware of the order of IE's in the management frames; some AP's are
touchy about this.

Sam

-
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


Re: [PATCH 2/7] AMSO1100 Low Level Driver.

2006-06-07 Thread Steve Wise

On Wed, 2006-05-31 at 11:59 -0700, Stephen Hemminger wrote:
> The following should be replaced with BUG_ON() or WARN_ON().
> and pr_debug()
> 
> +#ifdef C2_DEBUG
> +#define assert(expr)  \
> +if(!(expr)) { \
> +printk(KERN_ERR PFX "Assertion failed! %s, %s, %s, line %d\n",\
> +   #expr, __FILE__, __FUNCTION__, __LINE__);  \
> +}
> +#define dprintk(fmt, args...) do {printk(KERN_INFO PFX fmt, ##args);} while 
> (0)
> +#else
> +#define assert(expr)  do {} while (0)
> +#define dprintk(fmt, args...) do {} while (0)
> +#endif   /* C2_DEBUG */
> 
> 
> Also, you tend to use assert() as a bogus NULL pointer check.
> If you get passed a NULL, it is a bug, and the deref will fail
> and cause a pretty stack dump...
> 

done.

> 
> +static void c2_set_rxbufsize(struct c2_port *c2_port)
> +{
> + struct net_device *netdev = c2_port->netdev;
> +
> + assert(netdev != NULL);
> 
> Bogus, you will just fail on the deref below
> 

done.

> +
> + if (netdev->mtu > RX_BUF_SIZE)
> + c2_port->rx_buf_size =
> + netdev->mtu + ETH_HLEN + sizeof(struct c2_rxp_hdr) +
> + NET_IP_ALIGN;
> + else
> + c2_port->rx_buf_size = sizeof(struct c2_rxp_hdr) + RX_BUF_SIZE;
> +}
> 
> 
> +static void c2_rx_interrupt(struct net_device *netdev)
> +{
> + struct c2_port *c2_port = netdev_priv(netdev);
> + struct c2_dev *c2dev = c2_port->c2dev;
> + struct c2_ring *rx_ring = &c2_port->rx_ring;
> + struct c2_element *elem;
> + struct c2_rx_desc *rx_desc;
> + struct c2_rxp_hdr *rxp_hdr;
> + struct sk_buff *skb;
> + dma_addr_t mapaddr;
> + u32 maplen, buflen;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&c2dev->lock, flags);
> +
> + /* Begin where we left off */
> + rx_ring->to_clean = rx_ring->start + c2dev->cur_rx;
> +
> + for (elem = rx_ring->to_clean; elem->next != rx_ring->to_clean;
> +  elem = elem->next) {
> + rx_desc = elem->ht_desc;
> + mapaddr = elem->mapaddr;
> + maplen = elem->maplen;
> + skb = elem->skb;
> + rxp_hdr = (struct c2_rxp_hdr *) skb->data;
> +
> + if (rxp_hdr->flags != RXP_HRXD_DONE)
> + break;
> + buflen = rxp_hdr->len;
> +
> + /* Sanity check the RXP header */
> + if (rxp_hdr->status != RXP_HRXD_OK ||
> + buflen > (rx_desc->len - sizeof(*rxp_hdr))) {
> + c2_rx_error(c2_port, elem);
> + continue;
> + }
> +
> + /* 
> +  * Allocate and map a new skb for replenishing the host 
> +  * RX desc 
> +  */
> + if (c2_rx_alloc(c2_port, elem)) {
> + c2_rx_error(c2_port, elem);
> + continue;
> + }
> +
> + /* Unmap the old skb */
> + pci_unmap_single(c2dev->pcidev, mapaddr, maplen,
> +  PCI_DMA_FROMDEVICE);
> +
> 
> prefetch(skb->data) here will help performance.
> 
> 

good. ok.

> + /*
> +  * Skip past the leading 8 bytes comprising of the 
> +  * "struct c2_rxp_hdr", prepended by the adapter 
> +  * to the usual Ethernet header ("struct ethhdr"), 
> +  * to the start of the raw Ethernet packet.
> +  * 
> +  * Fix up the various fields in the sk_buff before 
> +  * passing it up to netif_rx(). The transfer size 
> +  * (in bytes) specified by the adapter len field of 
> +  * the "struct rxp_hdr_t" does NOT include the 
> +  * "sizeof(struct c2_rxp_hdr)".
> +  */
> + skb->data += sizeof(*rxp_hdr);
> + skb->tail = skb->data + buflen;
> + skb->len = buflen;
> + skb->dev = netdev;
> + skb->protocol = eth_type_trans(skb, netdev);
> +
> + /* Drop arp requests to the pseudo nic ip addr */
> + if (unlikely(ntohs(skb->protocol) == ETH_P_ARP)) {
> + u8 *tpa;
> +
> + /* pull out the tgt ip addr */
> + tpa = skb->data /* beginning of the arp packet */
> + + 8 /* arp addr fmts, lens, and opcode */
> + + 6 /* arp src hw addr */
> + + 4 /* arp src proto addr */
> + + 6;/* arp tgt hw addr */
> + if (is_rnic_addr(c2dev->pseudo_netdev, *((u32 *)tpa))) {
> + dprintk("Dropping arp req for"
> + " %03d.%03d.%03d.%03d\n",
> + tpa[0], tpa[1], tpa[2], tpa[3])

Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Johannes Berg
On Wed, 2006-06-07 at 17:51 +0200, Johannes Berg wrote:

> Well, it should be shown in the 802.11i spec too.

I suppose that it is the association request, and needs to contain the
RSN described in 7.3.2.25 as per 7.2.3.4 in 802.11i. This is, afaik, the
'generic IE' that is added with the wext. Now, it looks like the RSN
isn't included but the WPA2 info or something? Also, the genIE in your
log doesn't look correct to me, starting with ff?? Jouni, do you
have any idea what might be going on?

johannes


signature.asc
Description: This is a digitally signed message part


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Johannes Berg
On Wed, 2006-06-07 at 10:47 -0500, Larry Finger wrote:

> I have a little more information on what is happening. 

Great.

> In IEEE Std 802.11i-2004, which defines the 
> WPA protocol, Figure 11a shows the sequence of exchanges needed to associate. 
> Both bcm43xx-softmac 
> and ndiswrapper go through the "Open System Authentication" process. 

Right, you always have to do that.

> Where they seem to diverge is 
> in the STA's "Association Request (Security Parameters)" step. With 
> ndiswrapper, the AP responds 
> with a WPA EAPOL-Key message; whereas with softmac, the AP sends back the 
> "invalid pairwise cipher 
> message" and rejects the association.

Interesting. That's strange.

> Can anyone point to a reference that states what the content of the 
> Association Request should be to 
> get the AP to respond with the EAPOL-Key message? Unfortunately, I have no 
> possibility of 
> implementing a sniffer to see what a "correct" message contains.

Well, it should be shown in the 802.11i spec too.

johannes


signature.asc
Description: This is a digitally signed message part


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Larry Finger

Johannes Berg wrote:


generic IE is what the wext is called, it is the IE that wpa_supplicant
sets. Not sure what's going on though, I know next to nothing about wpa.


I have a little more information on what is happening. In IEEE Std 802.11i-2004, which defines the 
WPA protocol, Figure 11a shows the sequence of exchanges needed to associate. Both bcm43xx-softmac 
and ndiswrapper go through the "Open System Authentication" process. Where they seem to diverge is 
in the STA's "Association Request (Security Parameters)" step. With ndiswrapper, the AP responds 
with a WPA EAPOL-Key message; whereas with softmac, the AP sends back the "invalid pairwise cipher 
message" and rejects the association.


Can anyone point to a reference that states what the content of the Association Request should be to 
get the AP to respond with the EAPOL-Key message? Unfortunately, I have no possibility of 
implementing a sniffer to see what a "correct" message contains.


Larry
-
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


HELP! Slip Interface losing packets. Looking for contractor to fix.

2006-06-07 Thread Butler, Gerald

Hello,


We have a custom compiled Linux Kernel running oh RHEL 3.1


[EMAIL PROTECTED] root]# uname -a
Linux st0056_1 2.4.21-32.0.1.ELcustom #12 SMP Wed Sep 14 
11:55:22 EDT 2005 i686 i686 i386 GNU/Linux


We compiled in SLIP support using the standard RHEL kernel supplied by 
Redhat. Unfortunately, RH does not support SLIP. We are experiencing problems 
that we believe are a kernel issue (either SLIP or SERIAL) and are interested 
in hiring a contractor to diagnose the problem and provide a kernel patch to 
the kernel we are using (if necessary). We do not want to upgrade or change 
distributions at this time (business/practicality reasons).


If you are interested, please send an e-mail with your resume (doc, 
odf, or plain text) to '[EMAIL PROTECTED]' (I'll provide a private e-mail 
address to interested parties).


The company website is here: http://www.sterlingjewelers.com/


 Thank You,
 



Gerald Butler
Project Manager - Store Systems
Sterling Inc
 




The information contained in this e-mail message is privileged and/or
confidential and is intended only for the use of the individual or entity
named above.  If the reader of this message is not the intended
recipient, or the employee or agent responsible to deliver it to the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please immediately
notify us by telephone (330-668-5000), and destroy the original
message.  Thank you.

-
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 0/4] ehea: IBM eHEA Ethernet Device Driver

2006-06-07 Thread Jan-Bernd Themann

Hello,

this is the first version of the IBM eHEA Ethernet Device Driver.
It supports a new IBM ethernet chip on System p.

Main functionality including broadcast multicast and some parts of
ethtool already work.

Things we're still working on:
- vlan support
- performance improvements in SMP systems
- kernel coding style

This code is not ready for kernel inclusion as is, but we definetly
want to get there.

The patch series consists of 4 patches
01: interfaces to network stack and headers
02: pHYP interface
03: queue managment
04: Kconfig and Makefile

Signed-off-by:  Jan-Bernd Themann <[EMAIL PROTECTED]>

drivers/net/ehea/Kconfig |6
drivers/net/ehea/Makefile|   45
drivers/net/ehea/ehea.h  |  434 +++
drivers/net/ehea/ehea_hw.h   |  319 +
drivers/net/ehea/ehea_main.c | 2571 
+++

drivers/net/ehea/ehea_phyp.c | 1026 +
drivers/net/ehea/ehea_phyp.h |  625 ++
drivers/net/ehea/ehea_qmr.c  |  719 
drivers/net/ehea/ehea_qmr.h  |  390 ++
9 files changed, 6135 insertions(+)



-
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


Re: [PATCH 1/2] e1000: fix netpoll with NAPI

2006-06-07 Thread Neil Horman
>  
> > Matt, any ideas on this?
> 
> Not at the moment.

how about this for a solution?  It doesn't make netpoll any more robust, but I
think in the interests of efficiency it would be fair to require that, when
netpolled, a driver must receive frames on the same net device for which it was
polled.  With this patch we detect that condition and handle it accordingly in
e1000_intr.  This eliminates the need for us to call the clean_rx method from
the poll_controller when napi is configured, instead allowing the poll method to
be called from napi_poll, as the netpoll model currently does.  This fixes the
netdump regression, and eliminates the layering violation and the potential race
that we've been discussing.  I've just tested it with netdump here and it works
quite well.

Thoughts appreciated.

Thanks & Regards
Neil

Signed-off-by: Neil Horman <[EMAIL PROTECTED]>


 e1000_main.c |   54 +-
 1 files changed, 45 insertions(+), 9 deletions(-)


--- linux-2.6.9/drivers/net/e1000/e1000_main.c.neil 2006-06-06 
10:37:42.0 -0400
+++ linux-2.6.9/drivers/net/e1000/e1000_main.c  2006-06-07 10:48:22.0 
-0400
@@ -3207,8 +3207,9 @@
  * @pt_regs: CPU registers structure
  **/
 
+
 static irqreturn_t
-e1000_intr(int irq, void *data, struct pt_regs *regs)
+__e1000_intr(int irq, void *data, struct pt_regs *regs, int netpoll_op)
 {
struct net_device *netdev = data;
struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -3217,6 +3218,7 @@
 #ifndef CONFIG_E1000_NAPI
int i;
 #else
+   struct net_device *dev_to_sched;
/* Interrupt Auto-Mask...upon reading ICR,
 * interrupts are masked.  No need for the
 * IMC write, but it does mean we should
@@ -3255,8 +3257,22 @@
E1000_WRITE_REG(hw, IMC, ~0);
E1000_WRITE_FLUSH(hw);
}
-   if (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0])))
-   __netif_rx_schedule(&adapter->polling_netdev[0]);
+
+   /*
+* netpoll operations, in the interests of efficiency 
+* only do napi polling on the device passed to the 
+* poll_controller.  Therefore, if we are preforming 
+* a netpoll operation, then we can't schedule a receive
+* to one of the dummy net devices that exist for sole
+* purpose of spreading out rx schedules
+*/ 
+   if (netpoll_op)
+   dev_to_sched = netdev;
+   else
+   dev_to_sched = &adapter->polling_netdev[0];
+
+   if (likely(netif_rx_schedule_prep(dev_to_sched)))
+   __netif_rx_schedule(dev_to_sched);
else
e1000_irq_enable(adapter);
 #else
@@ -3288,6 +3304,13 @@
return IRQ_HANDLED;
 }
 
+static irqreturn_t
+e1000_intr(int irq, void *data, struct pt_regs *regs)
+{
+   return __e1000_intr(irq, data, regs, 0);
+}
+
+
 #ifdef CONFIG_E1000_NAPI
 /**
  * e1000_clean - NAPI Rx polling callback
@@ -3300,7 +3323,6 @@
struct e1000_adapter *adapter;
int work_to_do = min(*budget, poll_dev->quota);
int tx_cleaned = 0, i = 0, work_done = 0;
-
/* Must NOT use netdev_priv macro here. */
adapter = poll_dev->priv;
 
@@ -3308,10 +3330,24 @@
if (!netif_carrier_ok(adapter->netdev))
goto quit_polling;
 
-   while (poll_dev != &adapter->polling_netdev[i]) {
-   i++;
-   if (unlikely(i == adapter->num_rx_queues))
-   BUG();
+   /*
+* only search for a matching polling_netdev in the event
+* that this isn't a real registered net_device
+* A real net device can be passed in here in the event
+* that netdump has been activated (this comes through 
+* netpoll_poll_dev).  We detect this by virtue of the 
+* fact that each polling_netdev->priv points to the private
+* data of its parent (registered) netdev.  So if:
+* poll_dev->priv == netdev_priv(poll_dev), its a real device
+* otherwise its a polling_netdev.
+*/
+   if (adapter != netdev_priv(poll_dev)) {
+   while (poll_dev != &adapter->polling_netdev[i]) {
+   i++;
+   if (unlikely(i == adapter->num_rx_queues))
+   BUG();
+   }
+
}
 
if (likely(adapter->num_tx_queues == 1)) {
@@ -4624,7 +4660,7 @@
 {
struct e1000_adapter *adapter = netdev_priv(netdev);
disable_irq(adapter->pdev->irq);
-   e1000_intr(adapter->pdev->irq, netdev, NULL);
+   __e1000_intr(adapter->pdev->irq, netdev, NULL, 1);
e1000_clean_tx_irq(adapter, adapter->tx_ring);
 #ifndef CONFIG_E1000_NAPI
adapter->clean_rx(adapter, adapter->rx_ring);
-- 
/***
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 *

Re: [PATCH 3/4] Make Intel e1000 driver legacy I/O port free

2006-06-07 Thread Auke Kok

Kenji Kaneshige wrote:

Auke Kok wrote:

Kenji Kaneshige wrote:


This patch makes Intel e1000 driver legacy I/O port free.

Signed-off-by: Kenji Kaneshige <[EMAIL PROTECTED]>


(adding netdev and the other e1000 maintainers to cc:)

without sending this to any of the listed e1000 maintainers *and* 
not even including netdev???




I'm sorry about that.


I also didn't see that you were sending this to Greg-KH. I think I got thrown 
off by that as I wasn't following lkml until yesterday in the first place. 
I'll toss the patches around over here and see what comes up.


Cheers,

Auke

-
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


Re: [patch] workaround zd1201 interference problem

2006-06-07 Thread Pavel Machek
On St 07-06-06 16:08:28, Jiri Benc wrote:
> On Wed, 7 Jun 2006 16:00:45 +0200, Pavel Machek wrote:
> > +   zd1201_enable(zd);  /* zd1201 likes to startup shouting, 
> > interfering */
> > +   zd1201_disable(zd); /* with all the wifis in range */
> 
> I would prefer to track it down and find out where exactly is the
> problem instead of this quick hack.

Well, I'll try _enable() alone, but it seems to me that _enable()
command is needed to initialize radio properly. I do not think we can
get much further without firmware sources...

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
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


Re: [patch] workaround zd1201 interference problem

2006-06-07 Thread Jiri Benc
On Wed, 7 Jun 2006 16:00:45 +0200, Pavel Machek wrote:
> + zd1201_enable(zd);  /* zd1201 likes to startup shouting, 
> interfering */
> + zd1201_disable(zd); /* with all the wifis in range */

I would prefer to track it down and find out where exactly is the
problem instead of this quick hack.

 Jiri

-- 
Jiri Benc
SUSE Labs
-
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] workaround zd1201 interference problem

2006-06-07 Thread Pavel Machek
zd1201 likes to start up shouting, interfering with all wifis in
range. It is capable of stopping ipw2200 up-to few meters away, and
stops other cards at smaller distances, too.

This works around it. Only forcing ZD1201_CMDCODE_DISABLE is not
enough to prevent interference.

From: Jirka Benc <[EMAIL PROTECTED]>
Signed-off-by: Pavel Machek <[EMAIL PROTECTED]>


--- linux-good/drivers/net/wireless/zd1201.c2006-03-30 13:51:58.0 
+0200
+++ linux/drivers/net/wireless/zd1201.c 2006-06-07 15:55:01.0 +0200
@@ -1835,6 +1835,8 @@
zd->dev->name);

usb_set_intfdata(interface, zd);
+   zd1201_enable(zd);  /* zd1201 likes to startup shouting, 
interfering */
+   zd1201_disable(zd); /* with all the wifis in range */
return 0;
 
 err_net:

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
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


Re: Problem authenticating using WPA with bcm43xx-softmac

2006-06-07 Thread Johannes Berg
On Tue, 2006-06-06 at 14:24 -0500, Larry Finger wrote:
> Jun  6 13:34:10 larrylap kernel: SoftMAC: generic IE set to 
> ffdd160050fff2010150fff2020150fff2020150fff202

> Why does SoftMAC set a generic IE rather than get one from wpa_supplicant? I 
> would appreciate help 
> with this problem.

generic IE is what the wext is called, it is the IE that wpa_supplicant
sets. Not sure what's going on though, I know next to nothing about wpa.

johannes


signature.asc
Description: This is a digitally signed message part


Re: [PATCH] Right prototype of __raw_v4_lookup()

2006-06-07 Thread Alexey Dobriyan
On Mon, Jun 05, 2006 at 09:07:07PM -0700, David Miller wrote:
> From: Alexey Dobriyan <[EMAIL PROTECTED]>
> Date: Sun, 28 May 2006 01:09:32 +0400
>
> > All users pass 32-bit values as addresses and internally they're compared 
> > with
> > 32-bit entities. So, change "laddr" and "raddr" types to __be32.

> Applied.
>
> Doesn't this mean that, at least eventually, we should change
> the address members of inet_sock to __be32 as well?

I think, yes. Al Viro is sitting on terabytes of endian annotations in
networking code. See net-endian.b* branches at
git://git.kernel.org/pub/scm/linux/kernel/git/viro/bird.git
I don't know if he considers them ready.

-
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 9/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add netxen driver niu (hardware phy interface component)
  handling routines
* Add netxen hardware CRB register definitions

diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_niu.c 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_niu.c
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_niu.c1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_niu.c 2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,761 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ *
+ *
+ * Provides access to the Network Interface Unit h/w block.
+ *
+ */
+
+#include "netxen_nic.h"
+#include 
+
+/** 
+ * netxen_niu_gbe_phy_read - read a register from the GbE PHY via

+ * mii management interface.
+ *
+ * Note: The MII management interface goes through port 0.
+ *   Individual phys are addressed as follows:
+ * @param phy  [15:8]  phy id
+ * @param reg  [7:0]   register number
+ *
+ * @returns  0 on success
+ *  -1 on error
+ *
+ **/
+long netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
+long reg, netxen_crbword_t * readval)
+{
+   long timeout = 0;
+   long result = 0;
+   long restore = 0;
+   struct netxen_niu_gb_mii_mgmt_address address;
+   struct netxen_niu_gb_mii_mgmt_command command;
+   struct netxen_niu_gb_mii_mgmt_indicators status;
+   struct netxen_niu_gb_mii_mgmt_config mii_cfg;
+   struct netxen_niu_gb_mac_config_0_t mac_cfg0;
+
+   /* MII mgmt all goes through port 0 MAC interface, so it cannot be in 
reset */
+   if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(0),
+ &mac_cfg0, 4))
+   return -EIO;
+   if (mac_cfg0.soft_reset) {
+   struct netxen_niu_gb_mac_config_0_t temp;
+   *(netxen_crbword_t *) & temp = 0;
+   temp.tx_reset_pb = 1;
+   temp.rx_reset_pb = 1;
+   temp.tx_reset_mac = 1;
+   temp.rx_reset_mac = 1;
+   if (netxen_nic_hw_write_wx(adapter,
+  NETXEN_NIU_GB_MAC_CONFIG_0(0),
+  &temp, 4))
+   return -EIO;
+   restore = 1;
+   }
+
+   /* reset MII management interface */
+   *(netxen_crbword_t *) & mii_cfg = 0;
+   mii_cfg.clockselect = 7;
+   mii_cfg.reset = 1;
+   if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_CONFIG(0),
+  &mii_cfg, 4))
+   return -EIO;
+   mii_cfg.reset = 0;
+   if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_CONFIG(0),
+  &mii_cfg, 4))
+   return -EIO;
+
+   *(netxen_crbword_t *) & address = 0;
+   address.reg_addr = reg;
+   address.phy_addr = phy;
+   if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR(0),
+  &address, 4))
+   return -EIO;
+   *(netxen_crbword_t *) & command = 0;/* turn off any prior 
activity */
+   if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_COMMAND(0),
+  &command, 4))
+   return -EIO;
+   /* send read command */
+   command.read_cycle = 1;
+   if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_GB_MII_MGMT_COMMAND(0),
+  &command, 4))
+   return -EIO;
+
+   *(netxen_crbword_t *) & status = 0;
+   do {
+   if (netxen_nic_hw_read_wx(adapter,
+ NETXEN_NIU_GB_MII_MGMT_INDICATE(0),
+ &status, 4))
+   return -EIO;
+   timeout++;
+   } while ((status.busy || status.notvalid)
+&& (timeout++ < NETXEN_NIU_PHY_WAITMAX));
+
+   i

[PATCH 8/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add netxen driver main routines: module initialization, probe,
  xmit, receive, interrupt handler

diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_main.c 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_main.c
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_main.c   1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_main.c2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,1228 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ *
+ *
+ *  Main source file for NetXen NIC Driver on Linux
+ *
+ */
+
+#include "netxen_nic.h"
+
+#define DEFINE_GLOBAL_RECV_CRB
+#include "netxen_nic_phan_reg.h"
+#include "netxen_nic_ioctl.h"
+
+MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
+MODULE_LICENSE("GPL");
+MODULE_VERSION(NETXEN_NIC_LINUX_VERSIONID);
+
+char netxen_nic_driver_name[] = "netxen";
+char netxen_nic_driver_string[] = "NetXen Network Driver version "
+NETXEN_NIC_LINUX_VERSIONID
+"-" NETXEN_NIC_BUILD_NO " generated " NETXEN_NIC_TIMESTAMP;
+
+#define NETXEN_NETDEV_WEIGHT 120
+#define NETXEN_ADAPTER_UP_MAGIC 777
+
+static int netxen_nic_probe_err = 0;
+
+/* Local functions to NetXen NIC driver */
+static int __devinit netxen_nic_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent);
+static void __devexit netxen_nic_remove(struct pci_dev *pdev);
+static int netxen_nic_open(struct net_device *netdev);
+static int netxen_nic_close(struct net_device *netdev);
+static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *);
+static void netxen_tx_timeout(struct net_device *netdev);
+static void netxen_tx_timeout_task(struct net_device *netdev);
+static void netxen_watchdog(unsigned long);
+static int netxen_handle_int(struct netxen_adapter *, struct net_device *);
+static int netxen_nic_ioctl(struct net_device *netdev,
+   struct ifreq *ifr, int cmd);
+static int netxen_nic_poll(struct net_device *dev, int *budget);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void netxen_nic_poll_controller(struct net_device *netdev);
+#endif
+static irqreturn_t netxen_intr(int irq, void *data, struct pt_regs *regs);
+
+/*  PCI Device ID Table  */
+static struct pci_device_id netxen_pci_tbl[] __devinitdata = {
+   NETXEN_PCI_ID(PCI_DEVICE_ID_NX_QG),
+   NETXEN_PCI_ID(PCI_DEVICE_ID_NX_XG),
+   NETXEN_PCI_ID(PCI_DEVICE_ID_NX_CX4),
+   NETXEN_PCI_ID(PCI_DEVICE_ID_NX_IMEZ),
+   NETXEN_PCI_ID(PCI_DEVICE_ID_NX_HMEZ),
+   {0,}
+};
+
+MODULE_DEVICE_TABLE(pci, netxen_pci_tbl);
+
+struct netxen_adapter *adapterlist[MAX_NUM_CARDS];
+
+/*
+ * netxen_nic_probe()
+ *
+ * Linux system will invoke this after identifying the vendor ID and device Id
+ * in the pci_tbl where this module will search for NetXen vendor and device 
ID for
+ * quad port adapter.
+ *
+ * Even though there are 4 seperate devices (functions) on the quad port NIC, 
but
+ * the probe will be invoked for the first device (function) only. This will
+ * initialize the adapter, and setup the global parameters along with the 
port's
+ * specific structure.
+ */
+static int __devinit
+netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+{
+   struct net_device *netdev = NULL;
+   struct netxen_adapter *adapter = NULL;
+   struct netxen_port *port = NULL;
+   u8 *mem_ptr = NULL;
+   u8 *db_ptr = NULL;
+   unsigned long mem_base, mem_len, db_base, db_len;
+   int pci_using_dac, i, err;
+   int boardno = 0;
+   int ring;
+   struct netxen_recv_context *recv_ctx = NULL;
+   struct netxen_rcv_desc_ctx *rcv_desc = NULL;
+   struct netxen_cmd_buffer *cmd_buf_arr[MAX_RING_CTX] = { NULL };
+   struct netxen_ring_context *ctx;
+   static int netxen_cards_found = 0;
+   u64 mac_addr[FLASH_NUM_PORTS + 1];
+   int valid_mac;
+
+   if ((err = pci_enable_device(pdev))) {

[PATCH 7/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add netxen ioctl interface
* Add netxen interrupt related routines

diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_ioctl.h 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_ioctl.h
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_ioctl.h  1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_ioctl.h   2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ */
+
+#ifndef __NETXEN_NIC_IOCTL_H__
+#define __NETXEN_NIC_IOCTL_H__
+
+#include 
+
+#define NETXEN_CMD_STARTSIOCDEVPRIVATE
+#define NETXEN_NIC_CMD  (NETXEN_CMD_START + 1)
+#define NETXEN_NIC_NAME (NETXEN_CMD_START + 2)
+
+typedef enum {
+   netxen_nic_cmd_none = 0,
+   netxen_nic_cmd_pci_read,
+   netxen_nic_cmd_pci_write,
+   netxen_nic_cmd_pci_mem_read,
+   netxen_nic_cmd_pci_mem_write,
+   netxen_nic_cmd_pci_config_read,
+   netxen_nic_cmd_pci_config_write,
+   netxen_nic_cmd_get_stats,
+   netxen_nic_cmd_clear_stats,
+   netxen_nic_cmd_get_version
+} netxen_nic_ioctl_cmd_t;
+
+struct netxen_nic_ioctl_data {
+   u32 cmd;
+   u32 unused1;
+   u64 off;
+   u32 size;
+   u32 rv;
+   char u[64];
+   void *ptr;
+};
+
+struct netxen_statistics {
+   u64 rx_packets;
+   u64 tx_packets;
+   u64 rx_bytes;
+   u64 rx_errors;
+   u64 tx_bytes;
+   u64 tx_errors;
+   u64 rx_crc_errors;
+   u64 rx_short_length_error;
+   u64 rx_long_length_error;
+   u64 rx_mac_errors;
+};
+
+#endif /* __NETXEN_NIC_IOCTL_H_ */
diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_isr.c 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_isr.c
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_isr.c1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_isr.c 2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,430 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ */
+
+#include 
+#include 
+
+#include "netxen_nic.h"
+#include "netxen_nic_hw.h"
+#include "netxen_nic_phan_reg.h"
+
+/*
+ * This will be called when all the ports of the adapter are removed.
+ * This will cleanup and disable interrupts and irq.
+ */
+void netxen_nic_down(struct netxen_port *port)
+{
+   struct netxen_adapter *adapter = port->adapter;
+   int i, j, ctxid;
+   struct netxen_cmd_buffer *cmd_buff;
+   struct netxen_skb_frag *buffrag;
+   struct netxen_ring_context *ctx;
+
+   /* disable phy_ints */
+   netxen_nic_disable_phy_interrupts(adapter, (long)port->portnum);
+
+   adapter->active_ports--;
+
+   if (!adapter->active_ports) {
+   read_lock(&adapter->adapter_lock);
+   netxen_nic_disable_int(adapter);
+   read_unlock(&adapter->adapter_lock);
+
+   for (ctxid = 0; ctxid < MAX_RING_CTX

[PATCH 6/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add netxen hardware initialization routines

diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_init.c 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_init.c
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_init.c   1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_init.c2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,1263 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ *
+ *
+ * Source file for NIC routines to initialize the Phantom Hardware
+ *
+ */
+
+#include 
+#include 
+#include "netxen_nic.h"
+#include "netxen_nic_hw.h"
+#include "netxen_nic_ioctl.h"
+#include "netxen_nic_phan_reg.h"
+
+struct crb_addr_pair {
+   long addr;
+   long data;
+};
+
+#define NETXEN_MAX_CRB_XFORM 60
+static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM];
+#define NETXEN_ADDR_ERROR ((unsigned long ) 0x )
+
+#define crb_addr_transform(name) \
+crb_addr_xform[NETXEN_HW_PX_MAP_CRB_##name] = \
+NETXEN_HW_CRB_HUB_AGT_ADR_##name << 20
+
+#define NETXEN_FLASH_BASE  (BOOTLD_START)
+#define NETXEN_PHANTOM_MEM_BASE(NETXEN_FLASH_BASE)
+
+static void crb_addr_transform_setup(void)
+{
+   crb_addr_transform(XDMA);
+   crb_addr_transform(TIMR);
+   crb_addr_transform(SRE);
+   crb_addr_transform(SQN3);
+   crb_addr_transform(SQN2);
+   crb_addr_transform(SQN1);
+   crb_addr_transform(SQN0);
+   crb_addr_transform(SQS3);
+   crb_addr_transform(SQS2);
+   crb_addr_transform(SQS1);
+   crb_addr_transform(SQS0);
+   crb_addr_transform(RPMX7);
+   crb_addr_transform(RPMX6);
+   crb_addr_transform(RPMX5);
+   crb_addr_transform(RPMX4);
+   crb_addr_transform(RPMX3);
+   crb_addr_transform(RPMX2);
+   crb_addr_transform(RPMX1);
+   crb_addr_transform(RPMX0);
+   crb_addr_transform(ROMUSB);
+   crb_addr_transform(SN);
+   crb_addr_transform(QMN);
+   crb_addr_transform(QMS);
+   crb_addr_transform(PGNI);
+   crb_addr_transform(PGND);
+   crb_addr_transform(PGN3);
+   crb_addr_transform(PGN2);
+   crb_addr_transform(PGN1);
+   crb_addr_transform(PGN0);
+   crb_addr_transform(PGSI);
+   crb_addr_transform(PGSD);
+   crb_addr_transform(PGS3);
+   crb_addr_transform(PGS2);
+   crb_addr_transform(PGS1);
+   crb_addr_transform(PGS0);
+   crb_addr_transform(PS);
+   crb_addr_transform(PH);
+   crb_addr_transform(NIU);
+   crb_addr_transform(I2Q);
+   crb_addr_transform(EG);
+   crb_addr_transform(MN);
+   crb_addr_transform(MS);
+   crb_addr_transform(CAS2);
+   crb_addr_transform(CAS1);
+   crb_addr_transform(CAS0);
+   crb_addr_transform(CAM);
+   crb_addr_transform(C2C1);
+   crb_addr_transform(C2C0);
+}
+
+static int cmdline_max_cmd_desc = 1024;
+static int cmdline_max_rcv_desc = 16384;
+static int cmdline_max_jumbo_rcv_desc = 512;
+
+module_param(cmdline_max_cmd_desc, int, S_IRUGO);
+module_param(cmdline_max_rcv_desc, int, S_IRUGO);
+module_param(cmdline_max_jumbo_rcv_desc, int, S_IRUGO);
+
+void inline netxen_check_cmdline_params(void)
+{
+   if (cmdline_max_cmd_desc < 1024)
+   cmdline_max_cmd_desc = MAX_CMD_DESCRIPTORS;
+   if (cmdline_max_rcv_desc < 16384)
+   cmdline_max_rcv_desc = MAX_RCV_DESCRIPTORS;
+   if (cmdline_max_jumbo_rcv_desc < 512)
+   cmdline_max_jumbo_rcv_desc = MAX_JUMBO_RCV_DESCRIPTORS;
+}
+
+void __devinit netxen_check_options(struct netxen_adapter *adapter)
+{
+   struct netxen_ring_context *ctx;
+   int i;
+
+   for (i = 0; i < MAX_RING_CTX; i++) {
+   ctx = &adapter->ring_ctx[i];
+   ctx->max_tx_desc_count = cmdline_max_cmd_desc;
+   ctx->max_rx_desc_count = cmdline_max_rcv_desc;
+   ctx->max_jumbo_rx_desc_count = cmdline_max_jumbo_rcv_desc;
+   }
+}
+
+int init_firmwa

[PATCH 4/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add netxen driver hardware access routines

diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_hw.c 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_hw.c
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_hw.c 1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_hw.c  2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,1308 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ *
+ *
+ * Source file for NIC routines to access the Phantom hardware
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "netxen_nic.h"
+#include "netxen_nic_hw.h"
+#include "netxen_nic_phan_reg.h"
+
+/*  PCI Windowing for DDR regions.  */
+
+#define ADDR_IN_RANGE(addr, low, high) \
+   (((addr) <= (high)) && ((addr) >= (low)))
+
+static unsigned long netxen_nic_pci_set_window(unsigned long long pci_base,
+  unsigned long long addr);
+void netxen_free_hw_resources(struct netxen_adapter *adapter);
+
+int netxen_nic_set_mac(struct net_device *netdev, void *p)
+{
+   struct netxen_port *port = netdev_priv(netdev);
+   struct sockaddr *addr = p;
+#ifdef NETXEN_DEBUG
+   struct netxen_adapter *adapter = port->adapter;
+#endif
+
+   if (netif_running(netdev))
+   return -EBUSY;
+
+   if (!is_valid_ether_addr(addr->sa_data))
+   return -EADDRNOTAVAIL;
+
+   DPRINTK(INFO, "valid ether addr\n");
+   memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+
+   netxen_nic_macaddr_set(port, addr->sa_data);
+
+   return 0;
+}
+
+/**
+ * netxen_nic_set_multi - Multicast
+ **/
+void netxen_nic_set_multi(struct net_device *netdev)
+{
+   struct netxen_port *port = netdev_priv(netdev);
+   struct dev_mc_list *mc_ptr;
+
+   mc_ptr = netdev->mc_list;
+   if (netdev->flags & IFF_PROMISC)
+   netxen_nic_set_promisc_mode(port);
+   else
+   netxen_nic_unset_promisc_mode(port);
+}
+
+/*
+ * netxen_nic_change_mtu - Change the Maximum Transfer Unit
+ * @returns 0 on success, negative on failure
+ */
+int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu)
+{
+   struct netxen_port *port = netdev_priv(netdev);
+
+   if (new_mtu & 0x)
+   return -EINVAL;
+
+   if (new_mtu > 8000) {
+   printk(KERN_ERR "%s: %s MTU > 8000 is not supported\n",
+  netxen_nic_driver_name, netdev->name);
+   return -EINVAL;
+   }
+
+   netxen_nic_set_mtu(port, new_mtu);
+   netdev->mtu = new_mtu;
+
+   return 0;
+}
+
+/*
+ * check if the firmware has been downloaded and ready to run  and
+ * setup the address for the descriptors in the adapter
+ */
+int netxen_nic_hw_resources(struct netxen_adapter *adapter)
+{
+   int i;
+   u32 state = 0;
+   void *addr;
+   int loops = 0, err = 0;
+   int ring;
+   u32 card_cmdring = 0;
+   struct netxen_recv_context *recv_ctx;
+   struct netxen_rcv_desc_ctx *rcv_desc;
+   u32 ring_size;
+   struct netxen_ring_context *ctx;
+
+   DPRINTK(INFO, "pci_base: %lx\n", adapter->ahw.pci_base);
+   DPRINTK(INFO, "crb_base: %lx %lx", NETXEN_PCI_CRBSPACE,
+   adapter->ahw.pci_base + NETXEN_PCI_CRBSPACE);
+   DPRINTK(INFO, "cam base: %lx %lx", NETXEN_CRB_CAM,
+   adapter->ahw.pci_base + NETXEN_CRB_CAM);
+   DPRINTK(INFO, "cam RAM: %lx %lx", NETXEN_CAM_RAM_BASE,
+   adapter->ahw.pci_base + NETXEN_CAM_RAM_BASE);
+   DPRINTK(INFO, "NIC base:%lx %lx\n", NIC_CRB_BASE_PORT1,
+   adapter->ahw.pci_base + NIC_CRB_BASE_PORT1);
+
+   /* Window 1 call */
+   read_lock(&adapter->adapter_lock);
+   card_cmdring = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_CMDRING));
+   read_unlock(&adapter->adapter_lock);
+
+   DPRINTK(INFO, "Command Peg sends 0x%x for cmdring base\n",
+   

[PATCH 5/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add a header file containing netxen hardware access routines

diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_hw.h 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_hw.h
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_hw.h 1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_hw.h  2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,346 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ *
+ *
+ * Structures, enums, and macros for the MAC
+ *
+ */
+
+#ifndef __NETXEN_NIC_HW_H_
+#define __NETXEN_NIC_HW_H_
+
+#include "netxen_nic_hdr.h"
+
+/* Hardware memory size of 128 meg */
+#define NETXEN_MEMADDR_MAX (128 * 1024 * 1024)
+
+#ifndef readq
+static inline u64 readq(void __iomem * addr)
+{
+   return readl(addr) | (((u64) readl(addr + 4)) << 32LL);
+}
+#endif
+
+#ifndef writeq
+static inline void writeq(u64 val, void __iomem * addr)
+{
+   writel(((u32) (val)), (addr));
+   writel(((u32) (val >> 32)), (addr + 4));
+}
+#endif
+
+#define NETXEN_NIC_HW_BLOCK_WRITE_64(DATA_PTR, ADDR, NUM_WORDS) \
+do {\
+int num;\
+u64 *a = (u64 *) (DATA_PTR);\
+u64 *b = (u64 *) (ADDR);\
+for (num = 0; num < (NUM_WORDS); num++) {   \
+writeq(readq(a), b);\
+b++;\
+a++;\
+}   \
+} while (0)
+
+#define NETXEN_NIC_HW_BLOCK_READ_64(DATA_PTR, ADDR, NUM_WORDS)\
+do {  \
+int num;  \
+u64 *a = (u64 *) (DATA_PTR);  \
+u64 *b = (u64 *) (ADDR);  \
+for (num = 0; num < (NUM_WORDS); num++) { \
+writeq(readq(b), a);  \
+b++;  \
+a++;  \
+} \
+} while (0)
+
+#define NETXEN_PCI_MAPSIZE_BYTES  (NETXEN_PCI_MAPSIZE << 20)
+#define NETXEN_DB_MAPSIZE_BYTES0x4000
+
+#define NETXEN_NIC_LOCKED_READ_REG(X, Y)   \
+addr = (void *)(adapter->ahw.pci_base + X); \
+*(u32 *)Y = readl(addr);
+
+#define NETXEN_NIC_LOCKED_WRITE_REG(X, Y)  \
+   addr = (void *)(adapter->ahw.pci_base + X);  \
+   writel(*(u32 *)Y, addr);
+
+struct netxen_port;
+void netxen_nic_set_link_parameters(struct netxen_port *port);
+struct netxen_adapter;
+void netxen_nic_flash_print(struct netxen_adapter *adapter);
+
+int netxen_nic_hw_write_wx(struct netxen_adapter *adapter, u64 off,
+  void *data, int len);
+void netxen_crb_writelit_adapter(struct netxen_adapter *adapter,
+unsigned long off, int data);
+int netxen_nic_hw_read_wx(struct netxen_adapter *adapter, u64 off,
+ void *data, int len);
+
+typedef u8 netxen_ethernet_macaddr_t[6];
+
+/* Nibble or Byte mode for phy interface (GbE mode only) */
+typedef enum {
+   NETXEN_NIU_10_100_MB = 0,
+   NETXEN_NIU_1000_MB
+} netxen_niu_gbe_ifmode_t;
+
+/*
+ * NIU GB MAC Config Register 0 (applies to GB0, GB1, GB2, GB3)
+ */
+struct netxen_niu_gb_mac_config_0_t {
+   netxen_crbword_t tx_enable:1,   /* 1:enable frame xmit, 0:disable */
+tx_synched:1,  /* R/O: xmit enable synched to xmit stream */
+rx_enable:1

Re: [PATCH 1/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Andi Kleen
On Wednesday 07 June 2006 11:39, Linsys Contractor Amit S. Kale wrote:

> + switch (mode) {

... You could save a lot of code by using a table and a loop over the registers.


> + case 4:{/* XGB Mode */
> + NETXEN_NIC_LOCKED_READ_REG(NETXEN_NIU_XG_SINGLE_TERM,
> +®s_buff[3]);


-Andi
-
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 3/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add a header file containing netxen registers info

diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_hdr.h 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_hdr.h
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_hdr.h1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_hdr.h 2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,684 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ */
+
+#ifndef __NETXEN_NIC_HDR_H_
+#define __NETXEN_NIC_HDR_H_
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include   /* for memset */
+
+extern struct netxen_adapter *g_adapter;
+
+/*
+ * The basic unit of access when reading/writing control registers.
+ */
+
+typedef u32 netxen_crbword_t;  /* single word in CRB space */
+
+#define NETXEN_HW_H0_CH_HUB_ADR0x05
+#define NETXEN_HW_H1_CH_HUB_ADR0x0E
+#define NETXEN_HW_H2_CH_HUB_ADR0x03
+#define NETXEN_HW_H3_CH_HUB_ADR0x01
+#define NETXEN_HW_H4_CH_HUB_ADR0x06
+#define NETXEN_HW_H5_CH_HUB_ADR0x07
+#define NETXEN_HW_H6_CH_HUB_ADR0x08
+
+/*  Hub 0 */
+#define NETXEN_HW_MN_CRB_AGT_ADR   0x15
+#define NETXEN_HW_MS_CRB_AGT_ADR   0x25
+
+/*  Hub 1 */
+#define NETXEN_HW_PS_CRB_AGT_ADR   0x73
+#define NETXEN_HW_SS_CRB_AGT_ADR   0x20
+#define NETXEN_HW_RPMX3_CRB_AGT_ADR0x0b
+#define NETXEN_HW_QMS_CRB_AGT_ADR  0x00
+#define NETXEN_HW_SQGS0_CRB_AGT_ADR0x01
+#define NETXEN_HW_SQGS1_CRB_AGT_ADR0x02
+#define NETXEN_HW_SQGS2_CRB_AGT_ADR0x03
+#define NETXEN_HW_SQGS3_CRB_AGT_ADR0x04
+#define NETXEN_HW_C2C0_CRB_AGT_ADR 0x58
+#define NETXEN_HW_C2C1_CRB_AGT_ADR 0x59
+#define NETXEN_HW_C2C2_CRB_AGT_ADR 0x5a
+#define NETXEN_HW_RPMX2_CRB_AGT_ADR0x0a
+#define NETXEN_HW_RPMX4_CRB_AGT_ADR0x0c
+#define NETXEN_HW_RPMX7_CRB_AGT_ADR0x0f
+#define NETXEN_HW_RPMX9_CRB_AGT_ADR0x12
+#define NETXEN_HW_SMB_CRB_AGT_ADR  0x18
+
+/*  Hub 2 */
+#define NETXEN_HW_NIU_CRB_AGT_ADR  0x31
+#define NETXEN_HW_I2C0_CRB_AGT_ADR 0x19
+#define NETXEN_HW_I2C1_CRB_AGT_ADR 0x29
+
+#define NETXEN_HW_SN_CRB_AGT_ADR   0x10
+#define NETXEN_HW_I2Q_CRB_AGT_ADR  0x20
+#define NETXEN_HW_LPC_CRB_AGT_ADR  0x22
+#define NETXEN_HW_ROMUSB_CRB_AGT_ADR   0x21
+#define NETXEN_HW_QM_CRB_AGT_ADR   0x66
+#define NETXEN_HW_SQG0_CRB_AGT_ADR 0x60
+#define NETXEN_HW_SQG1_CRB_AGT_ADR 0x61
+#define NETXEN_HW_SQG2_CRB_AGT_ADR 0x62
+#define NETXEN_HW_SQG3_CRB_AGT_ADR 0x63
+#define NETXEN_HW_RPMX1_CRB_AGT_ADR0x09
+#define NETXEN_HW_RPMX5_CRB_AGT_ADR0x0d
+#define NETXEN_HW_RPMX6_CRB_AGT_ADR0x0e
+#define NETXEN_HW_RPMX8_CRB_AGT_ADR0x11
+
+/*  Hub 3 */
+#define NETXEN_HW_PH_CRB_AGT_ADR   0x1A
+#define NETXEN_HW_SRE_CRB_AGT_ADR  0x50
+#define NETXEN_HW_EG_CRB_AGT_ADR   0x51
+#define NETXEN_HW_RPMX0_CRB_AGT_ADR0x08
+
+/*  Hub 4 */
+#define NETXEN_HW_PEGN0_CRB_AGT_ADR0x40
+#define NETXEN_HW_PEGN1_CRB_AGT_ADR0x41
+#define NETXEN_HW_PEGN2_CRB_AGT_ADR0x42
+#define NETXEN_HW_PEGN3_CRB_AGT_ADR0x43
+#define NETXEN_HW_PEGNI_CRB_AGT_ADR0x44
+#define NETXEN_HW_PEGND_CRB_AGT_ADR0x45
+#define NETXEN_HW_PEGNC_CRB_AGT_ADR0x46
+#define NETXEN_HW_PEGR0_CRB_AGT_ADR0x47
+#define NETXEN_HW_PEGR1_CRB_AGT_ADR0x48
+#define NETXEN_HW_PEGR2_CRB_AGT_ADR0x49
+#define NETXEN_HW_PEGR3_CRB_AGT_ADR0x4a
+
+/*  Hub 5 */
+#define NETXEN_HW_PEGS0_CRB_AGT_ADR0x40
+#define NETXEN_HW_PEGS1_CRB_AGT_ADR0x41
+#define NETXEN_HW_PEGS2_CRB_AGT_ADR0x42
+#define NETXEN_HW_PEGS3_CRB_AGT_ADR0x43
+#define NETXEN_HW_PEGSI_CRB_AGT_ADR0x44
+#define NETXEN_HW_PEGSD_CRB_AGT_ADR0x45
+#define NETXEN_HW_PEGSC_CRB_AGT_ADR0x46
+
+/*  Hub 6 */
+#define NETXEN_HW_CAS0_CRB_AGT_ADR 0x46
+#define NETXEN_HW_CAS1_CRB_AGT_ADR 0x47
+#define NETXEN_HW_CAS2_CRB_AGT_A

[PATCH 2/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add netxen driver main header file
diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic.h 
linux-2.6.16.20/drivers/net/netxen/netxen_nic.h
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic.h1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic.h 2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,998 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ */
+
+#ifndef _NETXEN_NIC_H_
+#define _NETXEN_NIC_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "netxen_nic_hw.h"
+#include "netxen_nic_hdr.h"
+
+#define NETXEN_NIC_BUILD_NO "231"
+#define _NETXEN_NIC_LINUX_MAJOR 2
+#define _NETXEN_NIC_LINUX_MINOR 1
+#define _NETXEN_NIC_LINUX_SUBVERSION 39
+#define NETXEN_NIC_LINUX_VERSIONID  "2.1.39"
+#define NETXEN_NIC_FW_VERSIONID "2.1.39"
+#define NETXEN_NIC_TIMESTAMP "Mon May  1 01:34:07 PDT 2006"
+
+#define RCV_DESC_RINGSIZE(ctxid)   \
+   (sizeof(struct rcv_desc_t) * adapter->ring_ctx[ctxid].max_rx_desc_count)
+#define STATUS_DESC_RINGSIZE(i)\
+   (sizeof(struct status_desc_t)* adapter->ring_ctx[i].max_rx_desc_count)
+#define TX_RINGSIZE(i) (sizeof(struct netxen_cmd_buffer)   \
+   * adapter->ring_ctx[i].max_tx_desc_count)
+#define JUMBO_DESC_RINGSIZE\
+   (sizeof(rcvDesc_t) * adapter->ring_ctx[i].MaxJumboRxDescCount)
+#define RCV_BUFFSIZE   \
+   (sizeof(struct netxen_rx_buffer) * rcv_desc->max_rx_desc_count)
+
+#define DB_PAGE_SIZE0x1000
+#define NETXEN_CMD_PRODUCER_OFFSET(ctx) \
+   ((NETXEN_CMD_PRODUCER_DB_PAGE(ctx)) * DB_PAGE_SIZE)
+#define NETXEN_RCV_STATUS_CONSUMER_OFFSET(ctx) \
+   ((NETXEN_RCV_STATUS_CONSUMER_DB_PAGE(ctx)) * DB_PAGE_SIZE)
+#define NETXEN_RCV_PRODUCER_OFFSET(ctx,ring) \
+   ((NETXEN_RCV_PRODUCER_DB_PAGE(ctx,ring)) * DB_PAGE_SIZE)
+
+#define find_diff_among(a,b,range) ((a)<(b)?((b)-(a)):((b)+(range)-(a)))
+
+#define NETXEN_NETDEV_STATUS 0x1
+
+#define ADDR_IN_WINDOW1(off)   \
+   ((off > NETXEN_CRB_PCIX_HOST2) && (off < NETXEN_CRB_MAX)) ? 1 : 0
+
+/* 
+ * normalize a 64MB crb address to 32MB PCI window 
+ * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1

+ */
+#define NETXEN_CRB_NORMALIZE(adapter, reg) \
+   (void *)(ptrdiff_t)(adapter->ahw.pci_base+ (reg) \
+   - NETXEN_CRB_PCIX_HOST2 + NETXEN_CRB_PCIX_HOST)
+
+#define DB_NORMALIZE(adapter, off) \
+   (void *)(ptrdiff_t)(adapter->ahw.db_base + (off))
+
+#define MAX_RX_BUFFER_LENGTH   2000
+#define MAX_RX_JUMBO_BUFFER_LENGTH 9046
+#define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - NET_IP_ALIGN)
+#define RX_JUMBO_DMA_MAP_LEN   \
+   (MAX_RX_JUMBO_BUFFER_LENGTH - NET_IP_ALIGN)
+
+/*
+ * Maximum number of ring contexts
+ */
+#define MAX_RING_CTX 1
+
+/* Opcodes to be used with the commands */
+#defineTX_ETHER_PKT 0x01
+/* The following opcodes are for IP checksum   */
+#defineTX_TCP_PKT  0x02
+#defineTX_UDP_PKT  0x03
+#defineTX_IP_PKT   0x04
+#defineTX_TCP_LSO  0x05
+#defineTX_IPSEC0x06
+#defineTX_IPSEC_CMD0x07
+
+/* The following opcodes are for internal consumption. */
+#define NETXEN_CONTROL_OP  0x10
+#define PEGNET_REQUEST 0x11
+
+#defineMAX_NUM_CARDS   4
+
+#define MAX_BUFFERS_PER_CMD32
+
+/*
+ * Following are the states of the Phantom. Phantom will set them and
+ * Host will read to check if the fields are correct.
+ */
+#define PHAN_INITIALIZE_START  0xff00
+#define PHAN_INITIALIZE_FAILED 0x
+#define PHAN_INITIALIZE_COMPLETE   0xff01
+
+/* Host writes the following to notify that it has done the ini

[PATCH 1/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

2006-06-07 Amit S. Kale <[EMAIL PROTECTED]>
* Add Kconfig, Makefile entries and Makefiles for netxen driver
* Add ethtool interface for netxen driver

diff -Naru linux-2.6.16.20.orig/drivers/net/Kconfig 
linux-2.6.16.20/drivers/net/Kconfig
--- linux-2.6.16.20.orig/drivers/net/Kconfig2006-06-06 04:48:38.0 
-0700
+++ linux-2.6.16.20/drivers/net/Kconfig 2006-06-06 05:02:26.0 -0700
@@ -2313,6 +2313,11 @@

  If in doubt, say N.

+config NETXEN_NIC
+   tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC"
+   help
+ This enables the support for NetXen's Gigabit Ethernet card.
+
 endmenu

 if !UML
diff -Naru linux-2.6.16.20.orig/drivers/net/Makefile 
linux-2.6.16.20/drivers/net/Makefile
--- linux-2.6.16.20.orig/drivers/net/Makefile   2006-06-06 04:48:38.0 
-0700
+++ linux-2.6.16.20/drivers/net/Makefile2006-06-06 04:49:32.0 
-0700
@@ -213,3 +213,4 @@

 obj-$(CONFIG_FS_ENET) += fs_enet/

+obj-$(CONFIG_NETXEN_NIC) += netxen/
diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/Makefile 
linux-2.6.16.20/drivers/net/netxen/Makefile
--- linux-2.6.16.20.orig/drivers/net/netxen/Makefile1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/Makefile 2006-06-06 06:58:11.0 
-0700
@@ -0,0 +1,35 @@
+# Copyright (C) 2003 - 2006 NetXen, Inc.
+# All rights reserved.
+# 
+# This program is free software; you can redistribute it and/or

+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but

+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# 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.
+# 
+# The full GNU General Public License is included in this distribution

+# in the file called LICENSE.
+# 
+# Contact Information:

+#[EMAIL PROTECTED]
+# NetXen,
+# 3965 Freedom Circle, Fourth floor,
+# Santa Clara, CA 95054
+#
+# Makefile for the NetXen NIC Driver
+#
+
+
+obj-$(CONFIG_NETXEN_NIC) := netxen_nic.o
+
+netxen_nic-y := netxen_nic_hw.o netxen_nic_main.o netxen_nic_init.o \
+   netxen_nic_isr.o netxen_nic_ethtool.o netxen_nic_niu.o
diff -Naru linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_ethtool.c 
linux-2.6.16.20/drivers/net/netxen/netxen_nic_ethtool.c
--- linux-2.6.16.20.orig/drivers/net/netxen/netxen_nic_ethtool.c
1969-12-31 16:00:00.0 -0800
+++ linux-2.6.16.20/drivers/net/netxen/netxen_nic_ethtool.c 2006-06-06 
06:58:11.0 -0700
@@ -0,0 +1,775 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * 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.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ *
+ *
+ * ethtool support for netxen nic
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "netxen_nic_hw.h"
+#include "netxen_nic.h"
+#include "netxen_nic_phan_reg.h"
+#include "netxen_nic_ioctl.h"
+
+struct netxen_nic_stats {
+   char stat_string[ETH_GSTRING_LEN];
+   int sizeof_stat;
+   int stat_offset;
+};
+
+#define NETXEN_NIC_STAT(m) sizeof(((struct netxen_port *)0)->m), \
+offsetof(struct netxen_port, m)
+
+static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = {
+   {"rcvd_bad_skb", NETXEN_NIC_STAT(stats.rcvdbadskb)},
+   {"xmit_called", NETXEN_NIC_STAT(stats.xmitcalled)},
+   {"xmited_frames", NETXEN_NIC_STAT(stats.xmitedframes)},
+   {"xmit_finished", NETXEN_NIC_STAT(stats.xmitfinished)},
+   {"bad_skb_len", NETXEN_NIC_STAT(stats.badskblen)},
+   {"no_cmd_desc", NETXEN_NIC_STAT(stats.nocmddescriptor)},
+   {"polled", NETXEN_NIC_STAT(stats.polled)},
+   {"uphappy

[PATCH 0/9] NetXen 1G/10G ethernet driver patch with corrections

2006-06-07 Thread Linsys Contractor Amit S. Kale

Hi,

I'll be sending a NetXen 1G/10G ethernet driver patch in
subsequent emails. We have made changes as per the feedback received.
We would like this driver to be inluded in mainline kernel.

Kindly review it and feel free to send feedback.

Thanks.
-Amit


Signed-off-by: Amit S. Kale <[EMAIL PROTECTED]>

 Kconfig  |5
 Makefile |1
 netxen/Makefile  |   35 +
 netxen/netxen_nic.h  |  998 
 netxen/netxen_nic_ethtool.c  |  775 +
 netxen/netxen_nic_hdr.h  |  684 ++
 netxen/netxen_nic_hw.c   | 1308 
+++

 netxen/netxen_nic_hw.h   |  346 +++
 netxen/netxen_nic_init.c | 1263 
+

 netxen/netxen_nic_ioctl.h|   75 ++
 netxen/netxen_nic_isr.c  |  430 ++
 netxen/netxen_nic_main.c | 1228 


 netxen/netxen_nic_niu.c  |  761 +
 netxen/netxen_nic_phan_reg.h |  293 +
 14 files changed, 8202 insertions(+)
~

-
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


Re: [PATCH 3/4] Make Intel e1000 driver legacy I/O port free

2006-06-07 Thread Kenji Kaneshige

Auke Kok wrote:

Kenji Kaneshige wrote:


This patch makes Intel e1000 driver legacy I/O port free.

Signed-off-by: Kenji Kaneshige <[EMAIL PROTECTED]>



(adding netdev and the other e1000 maintainers to cc:)

without sending this to any of the listed e1000 maintainers *and* 
not even including netdev???




I'm sorry about that.

I'm going to take a look at it first, and have some other colleagues 
look at this and the impact, which is unclear to me at the moment. 


Thank you for reviewing.
What this patch try to do is not to request/enable I/O port regions
if the device can be handled without using I/O port so that the device
can work even if I/O port resource is not assigned to it on the large
servers. Please see the "[PATCH 2/4] Update Document/pci.txt" about
details.

Thanks,
Kenji Kaneshige




Please don't commit  this like this.

Auke




---
 drivers/net/e1000/e1000.h  |6 +
 drivers/net/e1000/e1000_main.c |  130 
++---

 2 files changed, 75 insertions(+), 61 deletions(-)

Index: linux-2.6.17-rc6/drivers/net/e1000/e1000.h
===
--- linux-2.6.17-rc6.orig/drivers/net/e1000/e1000.h2006-06-06 
21:39:11.0 +0900
+++ linux-2.6.17-rc6/drivers/net/e1000/e1000.h2006-06-06 
21:56:41.0 +0900

@@ -77,8 +77,9 @@
 #define BAR_11
 #define BAR_55
 
-#define INTEL_E1000_ETHERNET_DEVICE(device_id) {\

-PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
+#define E1000_NO_IOPORT(1 << 0)
+#define INTEL_E1000_ETHERNET_DEVICE(device_id, flags) {\
+PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id), .driver_data = flags}
 
 struct e1000_adapter;
 
@@ -338,6 +339,7 @@

 #ifdef NETIF_F_TSO
 boolean_t tso_force;
 #endif
+int bars;/* BARs to be enabled */
 };
 
 
Index: linux-2.6.17-rc6/drivers/net/e1000/e1000_main.c

===
--- linux-2.6.17-rc6.orig/drivers/net/e1000/e1000_main.c2006-06-06 
21:39:11.0 +0900
+++ linux-2.6.17-rc6/drivers/net/e1000/e1000_main.c2006-06-06 
21:56:41.0 +0900

@@ -86,54 +86,54 @@
  *   {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
  */
 static struct pci_device_id e1000_pci_tbl[] = {
-INTEL_E1000_ETHERNET_DEVICE(0x1000),
-INTEL_E1000_ETHERNET_DEVICE(0x1001),
-INTEL_E1000_ETHERNET_DEVICE(0x1004),
-INTEL_E1000_ETHERNET_DEVICE(0x1008),
-INTEL_E1000_ETHERNET_DEVICE(0x1009),
-INTEL_E1000_ETHERNET_DEVICE(0x100C),
-INTEL_E1000_ETHERNET_DEVICE(0x100D),
-INTEL_E1000_ETHERNET_DEVICE(0x100E),
-INTEL_E1000_ETHERNET_DEVICE(0x100F),
-INTEL_E1000_ETHERNET_DEVICE(0x1010),
-INTEL_E1000_ETHERNET_DEVICE(0x1011),
-INTEL_E1000_ETHERNET_DEVICE(0x1012),
-INTEL_E1000_ETHERNET_DEVICE(0x1013),
-INTEL_E1000_ETHERNET_DEVICE(0x1014),
-INTEL_E1000_ETHERNET_DEVICE(0x1015),
-INTEL_E1000_ETHERNET_DEVICE(0x1016),
-INTEL_E1000_ETHERNET_DEVICE(0x1017),
-INTEL_E1000_ETHERNET_DEVICE(0x1018),
-INTEL_E1000_ETHERNET_DEVICE(0x1019),
-INTEL_E1000_ETHERNET_DEVICE(0x101A),
-INTEL_E1000_ETHERNET_DEVICE(0x101D),
-INTEL_E1000_ETHERNET_DEVICE(0x101E),
-INTEL_E1000_ETHERNET_DEVICE(0x1026),
-INTEL_E1000_ETHERNET_DEVICE(0x1027),
-INTEL_E1000_ETHERNET_DEVICE(0x1028),
-INTEL_E1000_ETHERNET_DEVICE(0x105E),
-INTEL_E1000_ETHERNET_DEVICE(0x105F),
-INTEL_E1000_ETHERNET_DEVICE(0x1060),
-INTEL_E1000_ETHERNET_DEVICE(0x1075),
-INTEL_E1000_ETHERNET_DEVICE(0x1076),
-INTEL_E1000_ETHERNET_DEVICE(0x1077),
-INTEL_E1000_ETHERNET_DEVICE(0x1078),
-INTEL_E1000_ETHERNET_DEVICE(0x1079),
-INTEL_E1000_ETHERNET_DEVICE(0x107A),
-INTEL_E1000_ETHERNET_DEVICE(0x107B),
-INTEL_E1000_ETHERNET_DEVICE(0x107C),
-INTEL_E1000_ETHERNET_DEVICE(0x107D),
-INTEL_E1000_ETHERNET_DEVICE(0x107E),
-INTEL_E1000_ETHERNET_DEVICE(0x107F),
-INTEL_E1000_ETHERNET_DEVICE(0x108A),
-INTEL_E1000_ETHERNET_DEVICE(0x108B),
-INTEL_E1000_ETHERNET_DEVICE(0x108C),
-INTEL_E1000_ETHERNET_DEVICE(0x1096),
-INTEL_E1000_ETHERNET_DEVICE(0x1098),
-INTEL_E1000_ETHERNET_DEVICE(0x1099),
-INTEL_E1000_ETHERNET_DEVICE(0x109A),
-INTEL_E1000_ETHERNET_DEVICE(0x10B5),
-INTEL_E1000_ETHERNET_DEVICE(0x10B9),
+INTEL_E1000_ETHERNET_DEVICE(0x1000, E1000_NO_IOPORT),
+INTEL_E1000_ETHERNET_DEVICE(0x1001, E1000_NO_IOPORT),
+INTEL_E1000_ETHERNET_DEVICE(0x1004, E1000_NO_IOPORT),
+INTEL_E1000_ETHERNET_DEVICE(0x1008, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x1009, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x100C, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x100D, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x100E, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x100F, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x1010, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x1011, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x1012, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x1013, 0),
+INTEL_E1000_ETHERNET_DEVICE(0x1014, E1000_NO_IOPORT),
+INTEL_E1000_ETHERNET

Re: 2.6.17-rc5-mm3-lockdep -

2006-06-07 Thread Herbert Xu
On Tue, Jun 06, 2006 at 04:39:21PM +, Stefan Richter wrote:
> 
> BTW, the locking in -mm's net/unix/af_unix.c::unix_stream_connect() 
> differs a bit from stock unix_stream_connect(). I see spin_lock_bh() in 
> 2.6.17-rc5-mm3 where 2.6.17-rc5 has spin_lock().

Hi Ingo:

Looks like this change was introduced by the validator patch.  Any idea
why this was done? AF_UNIX is a user-space-driven socket so there shouldn't
be any need for BH to be disabled there.

Even if it does this patch should go through the normal channels rather
than the lock validator.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
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