Patch: SIOCSIWNAME -> SIOCSIWCOMMIT in comment

2006-01-12 Thread Pete Zaitcev
The ioctl was renamed from SIOCSIWNAME to SIOCSIWCOMMIT.

Signed-off-by: Pete Zaitcev <[EMAIL PROTECTED]>

---

Obviously this makes no difference for the code. It helps grepping only.

diff -urpN -X dontdiff linux-2.6.15/include/net/iw_handler.h 
linux-2.6.15-wlan/include/net/iw_handler.h
--- linux-2.6.15/include/net/iw_handler.h   2005-11-21 19:47:23.0 
-0800
+++ linux-2.6.15-wlan/include/net/iw_handler.h  2006-01-11 19:50:23.0 
-0800
@@ -327,7 +327,7 @@ struct iw_handler_def
__u16   num_private_args;
 
/* Array of handlers for standard ioctls
-* We will call dev->wireless_handlers->standard[ioctl - SIOCSIWNAME]
+* We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT]
 */
const iw_handler *  standard;
 
-
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: cls_u32.c

2006-01-12 Thread David S. Miller
From: "April, Eric (Satnet)" <[EMAIL PROTECTED]>
Date: Thu, 12 Jan 2006 17:36:36 -0500

> Problem found with cls_u32.c ...
> Bert has asked me to forward this to this address so it can be taken care
> of.

That bogus ifdef hasn't been there for years, please use
a newer kernel.
-
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/4 - 2.6.15]net: 32 bit (socket layer) ioctl emulation for 64 bit kernels

2006-01-12 Thread Shaun Pereira
Hi Arnd
Thank you for reviewing that bit of code.  
I had a look at compat_sys_gettimeofday and sys32_gettimeofday codes.
They seem to work in a similar way, casting a pointer to the structure
from user space to a compat_timeval type.

But to make sure I have tested the routine by forcing the sk-
>sk_stamp.tv_sec value to 0 in the x25_module ( for testing purposes
only, as it is initialised to -1). Now when
I make a 32 bit userspace SIOCGSTAMP ioctl to the 64 bit kernel I should
get the current time back in user space. This seems to work, the ioctl
returns the system time (just after TEST6:)

So I have left the patch as is for now. However if necessary to use
the element-by-element __put_user routine as in put_tv32, then I can
make the change, just let me know.

Lastly, if anyone following this mail can help with adding this into the
next release, that would be really helpful. We are building a network
management application on linux for a telco and while they have 
the support of the SuSE's and Redhat's, any patches accepted by the
kernel community makes a difference, besides saving us from building
custom patches. (BTW, the application used to run on HP-UX, we are now
porting it to linux).

Many Thanks 
Shaun
--
ghostview:/home/spereira/x25_32/src/func_tests/server # uname -a
Linux ghostview 2.6.15-smp #9 SMP Fri Jan 13 12:43:27 EST 2006 x86_64
x86_64 x86_64 GNU/Linux
ghostview:/home/spereira/x25_32/src/func_tests/server # file server
server: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
ghostview:/home/spereira/x25_32/src/func_tests/server # ./server
usage: server  
ghostview:/home/spereira/x25_32/src/func_tests/server # ./server
0505238450 x25tap0
TEST1: create socket : passed
TEST2: bind socket : passed
TEST3: set subscription: passed
TEST4: set facilities: passed

**
 Window size in = 2
 Window size out = 2
 Packet size in = 7
 Packet size out = 7
 Reverse flag = 00
 Throughput  = DD
**
TEST5: set call user data on listen passed
cud[ 0 ] = 02
cud[ 1 ] = 03
TEST6: set matchlength on listen socket handle passed
The time stamp is Fri Jan 13 13:37:17 2006
TEST7: listen on socket: passed
 Waiting for X25 packets
---





On Thu, 2006-01-12 at 19:24 +, Arnd Bergmann wrote:
> On Thursday 12 January 2006 06:02, Shaun Pereira wrote:
> > +int compat_sock_get_timestamp(struct sock *sk, struct timeval __user
> > *userstamp)
> > +{
> > +   struct compat_timeval __user *ctv;
> > +   ctv = (struct compat_timeval __user*) userstamp;
> > +   if(!sock_flag(sk, SOCK_TIMESTAMP))
> > +   sock_enable_timestamp(sk);
> > +   if(sk->sk_stamp.tv_sec == -1)
> > +   return -ENOENT;
> > +   if(sk->sk_stamp.tv_sec == 0)
> > +   do_gettimeofday(&sk->sk_stamp);
> > +   return copy_to_user(ctv, &sk->sk_stamp, sizeof(struct
> > compat_timeval)) ?
> > +   -EFAULT : 0;
> > +}
> 
> This looks wrong, you're not doing any conversion here.
> You cannot just copy sk_stamp to ctv, they are not compatible.
> See compat_sys_gettimeofday on how to copy a struct timeval
> correctly.
> 
> The other patches look good.
> 
>   Arnd <><

-
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 netdev-2.6 32/39] Added disable packet split capability

2006-01-12 Thread Jeff Kirsher
On 1/12/06, Andi Kleen <[EMAIL PROTECTED]> wrote:
> On Friday 13 January 2006 01:51, Jeff Kirsher wrote:
> > Adds the ability to disability packet split at compile time and use the
> > legacy receive path on PCI express hardware.
>
> Does this patch really do what you described?
>
> > -#ifdef CONFIG_E1000_PACKET_SPLIT
> > +#ifndef DISABLE_PACKET_SPLIT
> >   uint32_t pages = 0;
> >  #endif
>
>
> ...
> -
> 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
>

Yes, it does.  By setting pages to 0, the packet split registers will
not be used, which is done later in e1000_setup_rctl().

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


Re: [PATCH netdev-2.6 32/39] Added disable packet split capability

2006-01-12 Thread Andi Kleen
On Friday 13 January 2006 01:51, Jeff Kirsher wrote:
> Adds the ability to disability packet split at compile time and use the
> legacy receive path on PCI express hardware.

Does this patch really do what you described? 

> -#ifdef CONFIG_E1000_PACKET_SPLIT
> +#ifndef DISABLE_PACKET_SPLIT
>   uint32_t pages = 0;
>  #endif


...
-
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] drivers/net/3c59x: notice carrier a little sooner

2006-01-12 Thread Dan Williams
On Thu, 12 Jan 2006, Steffen Klassert wrote:

> On Thu, Jan 12, 2006 at 03:02:25PM -0500, Dan Williams wrote:
> > On Thu, 2006-01-12 at 20:57 +0100, Steffen Klassert wrote:
> > > Did you give the patch a try?
> > > 
> > > Actually I have no possibility to test, but
> > > I think that netif_carrier_{on,off} still does not
> > > work proper. The timer function does just nothing
> > > if vp->medialock is set.
> > > 
> > Worked for me with 3c905 card in a Dell Latitude C610.  I just c&p'd the
> > code into the vortex, so maybe vortex is different than boomerang.
> > Anyway, shouldn't the timer be run a bit later after the *_rx()
> > function?
> > 
> > Dan
> 
> Of course the timer function should run in both cases.
> If it works with the boomerang then it should work with vortex too.
> I just remember that I had some problems with netif_carrier_ok()
> when I tried to use ethtool_op_get_link about a year ago.
> Perhaps I'm not up to date and it works in default case. 
> I think a problem should appear at least
> if one forces a certain media type. 
> I still have a patch in queue to improve usage of netif_carrier_{on,off} 
> but I had no possibility to test yet, so I did not send.

I'd be happy to test it out if you'd like.

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


[PATCH RESEND netdev-2.6 3/3] e100: e100 whitespace fixes

2006-01-12 Thread Jesse Brandeburg

e100: e100 whitespace fixes

These are whitespace only fixes.

Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e100.c |   74 ++--
 1 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1,25 +1,25 @@
 
/***
 
-  
+
   Copyright(c) 1999 - 2005 Intel Corporation. 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) 
+
+  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 
+
+  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 
+  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:
   Linux NICS <[EMAIL PROTECTED]>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
@@ -316,7 +316,7 @@ enum cuc_dump {
cuc_dump_complete   = 0xA005,
cuc_dump_reset_complete = 0xA007,
 };
-   
+
 enum port {
software_reset  = 0x,
selftest= 0x0001,
@@ -710,10 +710,10 @@ static u16 e100_eeprom_read(struct nic *
ctrl = (cmd_addr_data & (1 << i)) ? eecs | eedi : eecs;
writeb(ctrl, &nic->csr->eeprom_ctrl_lo);
e100_write_flush(nic); udelay(4);
-   
+
writeb(ctrl | eesk, &nic->csr->eeprom_ctrl_lo);
e100_write_flush(nic); udelay(4);
-   
+
/* Eeprom drives a dummy zero to EEDO after receiving
 * complete address.  Use this to adjust addr_len. */
ctrl = readb(&nic->csr->eeprom_ctrl_lo);
@@ -721,7 +721,7 @@ static u16 e100_eeprom_read(struct nic *
*addr_len -= (i - 16);
i = 17;
}
-   
+
data = (data << 1) | (ctrl & eedo ? 1 : 0);
}
 
@@ -1053,13 +1053,13 @@ static void e100_setup_ucode(struct nic 
 *  driver can change the algorithm.
 *
 *  INTDELAY - This loads the dead-man timer with its inital value.
-*When this timer expires the interrupt is asserted, and the 
+*When this timer expires the interrupt is asserted, and the
 *timer is reset each time a new packet is received.  (see
 *BUNDLEMAX below to set the limit on number of chained packets)
 *The current default is 0x600 or 1536.  Experiments show that
 *the value should probably stay within the 0x200 - 0x1000.
 *
-*  BUNDLEMAX - 
+*  BUNDLEMAX -
 *This sets the maximum number of frames that will be bundled.  In
 *some situations, such as the TCP windowing algorithm, it may be
 *better to limit the growth of the bundle size than let it go as
@@ -1069,7 +1069,7 @@ static void e100_setup_ucode(struct nic 
 *an interrupt for every frame received.  If you do not want to put
 *a limit on the bundle size, set this value to x.
 *
-*  BUNDLESMALL - 
+*  BUNDLESMALL -
 *This contains a bit-mask describing the minimum size frame that
 *will be bundled.  The default masks the lower 7 bits, which means
 *that any frame less than 128 bytes in length will not be bundled,
@@ -1084,7 +1084,7 @@ static void e100_setup_ucode(struct nic 
 *
 *The current default is 0xFF80, which masks out the lower 7 bits.
 *This means that any frame which is x7F (127) bytes or smaller
-*will cause an immediate interrupt.  Because this value must be a 
+*will cause an immediate interrupt.  Because this value must be a
 *bit mask, there are only a few valid values that can be used.  To
 *turn this feature off, the driver can write the value x to the
 *lower word of this i

[PATCH RESEND netdev-2.6 2/3] e100: Handle the return values from pci_* functions

2006-01-12 Thread Jesse Brandeburg

e100: Handle the return values from pci_* functions

This is to resolve warnings during compile time.

Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e100.c |   30 +++---
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2638,7 +2638,9 @@ static int __devinit e100_probe(struct p
nic->flags |= wol_magic;
 
/* ack any pending wake events, disable PME */
-   pci_enable_wake(pdev, 0, 0);
+   err = pci_enable_wake(pdev, 0, 0);
+   if (err)
+   DPRINTK(PROBE, ERR, "Error clearing wake event\n");
 
strcpy(netdev->name, "eth%d");
if((err = register_netdev(netdev))) {
@@ -2689,6 +2691,7 @@ static int e100_suspend(struct pci_dev *
 {
struct net_device *netdev = pci_get_drvdata(pdev);
struct nic *nic = netdev_priv(netdev);
+   int retval;
 
if(netif_running(netdev))
e100_down(nic);
@@ -2696,9 +2699,14 @@ static int e100_suspend(struct pci_dev *
netif_device_detach(netdev);
 
pci_save_state(pdev);
-   pci_enable_wake(pdev, pci_choose_state(pdev, state), nic->flags & 
(wol_magic | e100_asf(nic)));
+   retval = pci_enable_wake(pdev, pci_choose_state(pdev, state),
+nic->flags & (wol_magic | e100_asf(nic)));
+   if (retval)
+   DPRINTK(PROBE,ERR, "Error enabling wake\n");
pci_disable_device(pdev);
-   pci_set_power_state(pdev, pci_choose_state(pdev, state));
+   retval = pci_set_power_state(pdev, pci_choose_state(pdev, state));
+   if (retval)
+   DPRINTK(PROBE,ERR, "Error %d setting power state\n", retval);
 
return 0;
 }
@@ -2707,11 +2715,16 @@ static int e100_resume(struct pci_dev *p
 {
struct net_device *netdev = pci_get_drvdata(pdev);
struct nic *nic = netdev_priv(netdev);
+   int retval;
 
-   pci_set_power_state(pdev, PCI_D0);
+   retval = pci_set_power_state(pdev, PCI_D0);
+   if (retval)
+   DPRINTK(PROBE,ERR, "Error waking adapter\n");
pci_restore_state(pdev);
/* ack any pending wake events, disable PME */
-   pci_enable_wake(pdev, 0, 0);
+   retval = pci_enable_wake(pdev, 0, 0);
+   if (retval)
+   DPRINTK(PROBE,ERR, "Error clearing wake events\n");
if(e100_hw_init(nic))
DPRINTK(HW, ERR, "e100_hw_init failed\n");
 
@@ -2728,12 +2741,15 @@ static void e100_shutdown(struct pci_dev
 {
struct net_device *netdev = pci_get_drvdata(pdev);
struct nic *nic = netdev_priv(netdev);
+   int retval;
 
 #ifdef CONFIG_PM
-   pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic)));
+   retval = pci_enable_wake(pdev, 0, nic->flags & (wol_magic | 
e100_asf(nic)));
 #else
-   pci_enable_wake(pdev, 0, nic->flags & (wol_magic));
+   retval = pci_enable_wake(pdev, 0, nic->flags & (wol_magic));
 #endif
+   if (retval)
+   DPRINTK(PROBE,ERR, "Error enabling wake\n");
 }
 
 

-
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 RESEND netdev-2.6 0/3] e100 driver update

2006-01-12 Thread Jesse Brandeburg
this is a resend of the previous patch set, wish us luck.

e100 driver update

1. Fix TX hang and RMCP Ping issue (due to a microcode loading issue)
2. Handle the return values from pci_* functions
3. e100 whitespace fixes

Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[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 RESEND netdev-2.6 1/3] e100: Fix TX hang and RMCP Ping issue (due to a microcode loading issue)

2006-01-12 Thread Jesse Brandeburg

e100: Fix TX hang and RMCP Ping issue (due to a microcode loading issue)

The large number of lines changed for this patch are due to several fuctions
moving in order to be called from a new function.

Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e100.c |  315 +---
 1 files changed, 174 insertions(+), 141 deletions(-)

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -156,7 +156,7 @@
 
 #define DRV_NAME   "e100"
 #define DRV_EXT"-NAPI"
-#define DRV_VERSION"3.4.14-k4"DRV_EXT
+#define DRV_VERSION"3.5.10-k2"DRV_EXT
 #define DRV_DESCRIPTION"Intel(R) PRO/100 Network Driver"
 #define DRV_COPYRIGHT  "Copyright(c) 1999-2005 Intel Corporation"
 #define PFXDRV_NAME ": "
@@ -872,141 +872,6 @@ err_unlock:
return err;
 }
 
-static u16 mdio_ctrl(struct nic *nic, u32 addr, u32 dir, u32 reg, u16 data)
-{
-   u32 data_out = 0;
-   unsigned int i;
-
-   writel((reg << 16) | (addr << 21) | dir | data, &nic->csr->mdi_ctrl);
-
-   for(i = 0; i < 100; i++) {
-   udelay(20);
-   if((data_out = readl(&nic->csr->mdi_ctrl)) & mdi_ready)
-   break;
-   }
-
-   DPRINTK(HW, DEBUG,
-   "%s:addr=%d, reg=%d, data_in=0x%04X, data_out=0x%04X\n",
-   dir == mdi_read ? "READ" : "WRITE", addr, reg, data, data_out);
-   return (u16)data_out;
-}
-
-static int mdio_read(struct net_device *netdev, int addr, int reg)
-{
-   return mdio_ctrl(netdev_priv(netdev), addr, mdi_read, reg, 0);
-}
-
-static void mdio_write(struct net_device *netdev, int addr, int reg, int data)
-{
-   mdio_ctrl(netdev_priv(netdev), addr, mdi_write, reg, data);
-}
-
-static void e100_get_defaults(struct nic *nic)
-{
-   struct param_range rfds = { .min = 16, .max = 256, .count = 256 };
-   struct param_range cbs  = { .min = 64, .max = 256, .count = 128 };
-
-   pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id);
-   /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */
-   nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->rev_id;
-   if(nic->mac == mac_unknown)
-   nic->mac = mac_82557_D100_A;
-
-   nic->params.rfds = rfds;
-   nic->params.cbs = cbs;
-
-   /* Quadwords to DMA into FIFO before starting frame transmit */
-   nic->tx_threshold = 0xE0;
-
-   /* no interrupt for every tx completion, delay = 256us if not 557*/
-   nic->tx_command = cpu_to_le16(cb_tx | cb_tx_sf |
-   ((nic->mac >= mac_82558_D101_A4) ? cb_cid : cb_i));
-
-   /* Template for a freshly allocated RFD */
-   nic->blank_rfd.command = cpu_to_le16(cb_el);
-   nic->blank_rfd.rbd = 0x;
-   nic->blank_rfd.size = cpu_to_le16(VLAN_ETH_FRAME_LEN);
-
-   /* MII setup */
-   nic->mii.phy_id_mask = 0x1F;
-   nic->mii.reg_num_mask = 0x1F;
-   nic->mii.dev = nic->netdev;
-   nic->mii.mdio_read = mdio_read;
-   nic->mii.mdio_write = mdio_write;
-}
-
-static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
-{
-   struct config *config = &cb->u.config;
-   u8 *c = (u8 *)config;
-
-   cb->command = cpu_to_le16(cb_config);
-
-   memset(config, 0, sizeof(struct config));
-
-   config->byte_count = 0x16;  /* bytes in this struct */
-   config->rx_fifo_limit = 0x8;/* bytes in FIFO before DMA */
-   config->direct_rx_dma = 0x1;/* reserved */
-   config->standard_tcb = 0x1; /* 1=standard, 0=extended */
-   config->standard_stat_counter = 0x1;/* 1=standard, 0=extended */
-   config->rx_discard_short_frames = 0x1;  /* 1=discard, 0=pass */
-   config->tx_underrun_retry = 0x3;/* # of underrun retries */
-   config->mii_mode = 0x1; /* 1=MII mode, 0=503 mode */
-   config->pad10 = 0x6;
-   config->no_source_addr_insertion = 0x1; /* 1=no, 0=yes */
-   config->preamble_length = 0x2;  /* 0=1, 1=3, 2=7, 3=15 bytes */
-   config->ifs = 0x6;  /* x16 = inter frame spacing */
-   config->ip_addr_hi = 0xF2;  /* ARP IP filter - not used */
-   config->pad15_1 = 0x1;
-   config->pad15_2 = 0x1;
-   config->crs_or_cdt = 0x0;   /* 0=CRS only, 1=CRS or CDT */
-   config->fc_delay_hi = 0x40; /* time delay for fc frame */
-   config->tx_padding = 0x1;   /* 1=pad short frames */
-   config->fc_priority_threshold = 0x7;/* 7=priority fc disabled */
-   config->pad18 = 0x1;
-   config->full_duplex_pin = 0x1;  /* 1=examine FDX# pin */
-   config->pad20_1 = 0x1F;
-   config->fc_priorit

[PATCH netdev-2.6 13/39] Fix EEPROM read logic

2006-01-12 Thread Jeff Kirsher
Fixed read_eeprom logic to test use_eerd instead of testing for 82573 
controllers.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.c |   18 ++
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index bb9d00e..19a0b2a 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -3888,14 +3888,16 @@ e1000_read_eeprom(struct e1000_hw *hw,
 return -E1000_ERR_EEPROM;
 }
 
-/* FLASH reads without acquiring the semaphore are safe in 82573-based
- * controllers.
- */
-if ((e1000_is_onboard_nvm_eeprom(hw) == TRUE) ||
-(hw->mac_type != e1000_82573)) {
-/* Prepare the EEPROM for reading  */
-if(e1000_acquire_eeprom(hw) != E1000_SUCCESS)
-return -E1000_ERR_EEPROM;
+/* FLASH reads without acquiring the semaphore are safe */
+if (e1000_is_onboard_nvm_eeprom(hw) == TRUE &&
+hw->eeprom.use_eerd == FALSE) {
+switch (hw->mac_type) {
+default:
+/* Prepare the EEPROM for reading  */
+if (e1000_acquire_eeprom(hw) != E1000_SUCCESS)
+return -E1000_ERR_EEPROM;
+break;
+}
 }
 
 if(eeprom->use_eerd == TRUE) {

-
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 netdev-2.6 04/39] Fix SoL/IDER link and loopback

2006-01-12 Thread Jeff Kirsher
Fix so that if a SoL/IDER session is active, do not allow operations which 
require a PHY reset and instead log a message.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_ethtool.c |  128 ++---
 drivers/net/e1000/e1000_main.c|   16 +++--
 drivers/net/e1000/e1000_param.c   |6 ++
 3 files changed, 65 insertions(+), 85 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index c88f1a3..c929277 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -183,7 +183,15 @@ e1000_set_settings(struct net_device *ne
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
 
-   if(ecmd->autoneg == AUTONEG_ENABLE) {
+   /* When SoL/IDER sessions are active, autoneg/speed/duplex
+* cannot be changed */
+   if (e1000_check_phy_reset_block(hw)) {
+   DPRINTK(DRV, ERR, "Cannot change link characteristics "
+   "when SoL/IDER is active.\n");
+   return -EINVAL;
+   }
+
+   if (ecmd->autoneg == AUTONEG_ENABLE) {
hw->autoneg = 1;
if(hw->media_type == e1000_media_type_fiber)
hw->autoneg_advertised = ADVERTISED_1000baseT_Full |
@@ -562,29 +570,10 @@ e1000_get_drvinfo(struct net_device *net
struct ethtool_drvinfo *drvinfo)
 {
struct e1000_adapter *adapter = netdev_priv(netdev);
-   char firmware_version[32];
-   uint16_t eeprom_data;
 
strncpy(drvinfo->driver,  e1000_driver_name, 32);
strncpy(drvinfo->version, e1000_driver_version, 32);
-   
-   /* EEPROM image version # is reported as firware version # for
-* 8257{1|2|3} controllers */
-   e1000_read_eeprom(&adapter->hw, 5, 1, &eeprom_data);
-   switch (adapter->hw.mac_type) {
-   case e1000_82571:
-   case e1000_82572:
-   case e1000_82573:
-   sprintf(firmware_version, "%d.%d-%d", 
-   (eeprom_data & 0xF000) >> 12,
-   (eeprom_data & 0x0FF0) >> 4,
-   eeprom_data & 0x000F);
-   break;
-   default:
-   sprintf(firmware_version, "n/a");
-   }
-
-   strncpy(drvinfo->fw_version, firmware_version, 32);
+   strncpy(drvinfo->fw_version, "N/A", 32);
strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
drvinfo->n_stats = E1000_STATS_LEN;
drvinfo->testinfo_len = E1000_TEST_LEN;
@@ -990,10 +979,8 @@ e1000_free_desc_rings(struct e1000_adapt
 
kfree(txdr->buffer_info);
txdr->buffer_info = NULL;
-
kfree(rxdr->buffer_info);
rxdr->buffer_info = NULL;
-
return;
 }
 
@@ -1328,32 +1315,21 @@ static int
 e1000_setup_loopback_test(struct e1000_adapter *adapter)
 {
uint32_t rctl;
-   struct e1000_hw *hw = &adapter->hw;
 
-   if (hw->media_type == e1000_media_type_fiber ||
-  hw->media_type == e1000_media_type_internal_serdes) {
-   switch (hw->mac_type) {
-   case e1000_82545:
-   case e1000_82546:
-   case e1000_82545_rev_3:
-   case e1000_82546_rev_3:
+   if(adapter->hw.media_type == e1000_media_type_fiber ||
+  adapter->hw.media_type == e1000_media_type_internal_serdes) {
+   if(adapter->hw.mac_type == e1000_82545 ||
+  adapter->hw.mac_type == e1000_82546 ||
+  adapter->hw.mac_type == e1000_82545_rev_3 ||
+  adapter->hw.mac_type == e1000_82546_rev_3)
return e1000_set_phy_loopback(adapter);
-   break;
-   case e1000_82571:
-   case e1000_82572:
-#define E1000_SERDES_LB_ON 0x410
-   e1000_set_phy_loopback(adapter);
-   E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_ON);
-   msec_delay(10);
-   return 0;
-   break;
-   default:
-   rctl = E1000_READ_REG(hw, RCTL);
+   else {
+   rctl = E1000_READ_REG(&adapter->hw, RCTL);
rctl |= E1000_RCTL_LBM_TCVR;
-   E1000_WRITE_REG(hw, RCTL, rctl);
+   E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
return 0;
}
-   } else if (hw->media_type == e1000_media_type_copper)
+   } else if(adapter->hw.media_type == e1000_media_type_copper)
return e1000_set_phy_loopback(adapter);
 
return 7;
@@ -1364,36 +1340,25 @@ e1000_loopback_cleanup(struct e1000_adap
 {
uint32_t rctl;
uint16_t phy_reg;
-   struct e1000_hw *hw = &adapter->hw;
 
rctl = E1000_READ_REG(

[PATCH netdev-2.6 07/39] Fix e1000 stats

2006-01-12 Thread Jeff Kirsher
Updated the e1000_stats structure and removed mpx for rx_errors and rx_dropped.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000.h |2 ++
 drivers/net/e1000/e1000_ethtool.c |2 ++
 drivers/net/e1000/e1000_main.c|8 
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index c87187d..4dd1326 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -275,6 +275,7 @@ struct e1000_adapter {
uint64_t gotcl_old;
uint64_t tpt_old;
uint64_t colc_old;
+   uint32_t tx_timeout_count;
uint32_t tx_fifo_head;
uint32_t tx_head_addr;
uint32_t tx_fifo_size;
@@ -307,6 +308,7 @@ struct e1000_adapter {
uint64_t hw_csum_err;
uint64_t hw_csum_good;
uint64_t rx_hdr_split;
+   uint32_t alloc_rx_buff_failed;
uint32_t rx_int_delay;
uint32_t rx_abs_int_delay;
boolean_t rx_csum;
diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index c929277..791110d 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -80,6 +80,7 @@ static const struct e1000_stats e1000_gs
{ "tx_deferred_ok", E1000_STAT(stats.dc) },
{ "tx_single_coll_ok", E1000_STAT(stats.scc) },
{ "tx_multi_coll_ok", E1000_STAT(stats.mcc) },
+   { "tx_timeout_count", E1000_STAT(tx_timeout_count) },
{ "rx_long_length_errors", E1000_STAT(stats.roc) },
{ "rx_short_length_errors", E1000_STAT(stats.ruc) },
{ "rx_align_errors", E1000_STAT(stats.algnerrc) },
@@ -93,6 +94,7 @@ static const struct e1000_stats e1000_gs
{ "rx_csum_offload_good", E1000_STAT(hw_csum_good) },
{ "rx_csum_offload_errors", E1000_STAT(hw_csum_err) },
{ "rx_header_split", E1000_STAT(rx_hdr_split) },
+   { "alloc_rx_buff_failed", E1000_STAT(alloc_rx_buff_failed) },
 };
 #define E1000_STATS_LEN\
sizeof(e1000_gstrings_stats) / sizeof(struct e1000_stats)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 5b42871..5f848b3 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2902,6 +2902,7 @@ e1000_tx_timeout_task(struct net_device 
 {
struct e1000_adapter *adapter = netdev_priv(netdev);
 
+   adapter->tx_timeout_count++;
e1000_down(adapter);
e1000_up(adapter);
 }
@@ -2919,7 +2920,7 @@ e1000_get_stats(struct net_device *netde
 {
struct e1000_adapter *adapter = netdev_priv(netdev);
 
-   e1000_update_stats(adapter);
+   /* only return the current stats */
return &adapter->net_stats;
 }
 
@@ -3106,12 +3107,11 @@ e1000_update_stats(struct e1000_adapter 
 
adapter->net_stats.rx_errors = adapter->stats.rxerrc +
adapter->stats.crcerrs + adapter->stats.algnerrc +
-   adapter->stats.rlec + adapter->stats.mpc + 
-   adapter->stats.cexterr;
+   adapter->stats.rlec + adapter->stats.cexterr;
+   adapter->net_stats.rx_dropped = 0;
adapter->net_stats.rx_length_errors = adapter->stats.rlec;
adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc;
-   adapter->net_stats.rx_fifo_errors = adapter->stats.mpc;
adapter->net_stats.rx_missed_errors = adapter->stats.mpc;
 
/* Tx Errors */

-
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 netdev-2.6 15/39] Fix TX queue length based on link speed

2006-01-12 Thread Jeff Kirsher
10/100 speeds seem to have some problems reporting false tx timeouts especially 
at half duplex.  Fixed by using a timeout factor to attempt to mitigate the 
false timeouts.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000.h  |1 +
 drivers/net/e1000/e1000_main.c |   15 +++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 0a084e9..d95a5f8 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -296,6 +296,7 @@ struct e1000_adapter {
uint32_t tx_fifo_head;
uint32_t tx_head_addr;
uint32_t tx_fifo_size;
+   uint8_t  tx_timeout_factor;
atomic_t tx_fifo_stall;
boolean_t pcix_82544;
boolean_t detect_tx_hung;
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index cefc7cc..cf4fc51 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2319,6 +2319,21 @@ e1000_watchdog_task(struct e1000_adapter
   adapter->link_duplex == FULL_DUPLEX ?
   "Full Duplex" : "Half Duplex");
 
+   /* tweak tx_queue_len according to speed/duplex */
+   netdev->tx_queue_len = adapter->tx_queue_len;
+   adapter->tx_timeout_factor = 1;
+   if (adapter->link_duplex == HALF_DUPLEX) {
+   switch (adapter->link_speed) {
+   case SPEED_10:
+   netdev->tx_queue_len = 10;
+   adapter->tx_timeout_factor = 8;
+   break;
+   case SPEED_100:
+   netdev->tx_queue_len = 100;
+   break;
+   }
+   }
+
netif_carrier_on(netdev);
netif_wake_queue(netdev);
mod_timer(&adapter->phy_info_timer, jiffies + 2 * HZ);

-
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 netdev-2.6 27/39] Added hardware support for PCI express, 82546GB, and 82571 Fiber

2006-01-12 Thread Jeff Kirsher
Added 82571 fiber to WOL fix for dual port adapters.
Added support for 82546GB (Quad Copper).
Added PCIe typedef for x2, igp cable length 115, and extended TX CTRL registers.
Added parity error detection and PCIe CTRL registers.
Added EEPROM config registers.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_ethtool.c |2 ++
 drivers/net/e1000/e1000_hw.c  |   12 
 drivers/net/e1000/e1000_hw.h  |   19 +++
 drivers/net/e1000/e1000_main.c|5 +++--
 4 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index 8363d8d..0f9c860 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1628,6 +1628,7 @@ e1000_get_wol(struct net_device *netdev,
 
case E1000_DEV_ID_82546EB_FIBER:
case E1000_DEV_ID_82546GB_FIBER:
+   case E1000_DEV_ID_82571EB_FIBER:
/* Wake events only supported on port A for dual fiber */
if(E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) {
wol->supported = 0;
@@ -1671,6 +1672,7 @@ e1000_set_wol(struct net_device *netdev,
 
case E1000_DEV_ID_82546EB_FIBER:
case E1000_DEV_ID_82546GB_FIBER:
+   case E1000_DEV_ID_82571EB_FIBER:
/* Wake events only supported on port A for dual fiber */
if(E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
return wol->wolopts ? -EOPNOTSUPP : 0;
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index ac227c7..2437d36 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -318,6 +318,8 @@ e1000_set_mac_type(struct e1000_hw *hw)
 case E1000_DEV_ID_82546GB_FIBER:
 case E1000_DEV_ID_82546GB_SERDES:
 case E1000_DEV_ID_82546GB_PCIE:
+case E1000_DEV_ID_82546GB_QUAD_COPPER:
+case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
 hw->mac_type = e1000_82546_rev_3;
 break;
 case E1000_DEV_ID_82541EI:
@@ -639,6 +641,7 @@ e1000_init_hw(struct e1000_hw *hw)
 uint16_t cmd_mmrbc;
 uint16_t stat_mmrbc;
 uint32_t mta_size;
+uint32_t ctrl_ext;
 
 DEBUGFUNC("e1000_init_hw");
 
@@ -774,6 +777,15 @@ e1000_init_hw(struct e1000_hw *hw)
  */
 e1000_clear_hw_cntrs(hw);
 
+if (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER ||
+hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3) {
+ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
+/* Relaxed ordering must be disabled to avoid a parity
+ * error crash in a PCI slot. */
+ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
+E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext);
+}
+
 return ret_val;
 }
 
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 600570f..0b8f6f2 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -439,6 +439,7 @@ int32_t e1000_check_phy_reset_block(stru
 #define E1000_DEV_ID_82546GB_FIBER   0x107A
 #define E1000_DEV_ID_82546GB_SERDES  0x107B
 #define E1000_DEV_ID_82546GB_PCIE0x108A
+#define E1000_DEV_ID_82546GB_QUAD_COPPER 0x1099
 #define E1000_DEV_ID_82547EI 0x1019
 #define E1000_DEV_ID_82571EB_COPPER  0x105E
 #define E1000_DEV_ID_82571EB_FIBER   0x105F
@@ -449,6 +450,7 @@ int32_t e1000_check_phy_reset_block(stru
 #define E1000_DEV_ID_82573E  0x108B
 #define E1000_DEV_ID_82573E_IAMT 0x108C
 #define E1000_DEV_ID_82573L  0x109A
+#define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5
 
 
 #define NODE_ADDRESS_SIZE 6
@@ -1955,6 +1957,23 @@ struct e1000_host_command_info {
 
 #define E1000_MDALIGN  4096
 
+/* PCI-Ex registers */
+
+/* PCI-Ex Control Register */
+#define E1000_GCR_RXD_NO_SNOOP 0x0001
+#define E1000_GCR_RXDSCW_NO_SNOOP  0x0002
+#define E1000_GCR_RXDSCR_NO_SNOOP  0x0004
+#define E1000_GCR_TXD_NO_SNOOP 0x0008
+#define E1000_GCR_TXDSCW_NO_SNOOP  0x0010
+#define E1000_GCR_TXDSCR_NO_SNOOP  0x0020
+
+#define PCI_EX_NO_SNOOP_ALL (E1000_GCR_RXD_NO_SNOOP| \
+
E1000_GCR_RXDSCW_NO_SNOOP  | \
+
E1000_GCR_RXDSCR_NO_SNOOP  | \
+E1000_GCR TXD_NO_SNOOP 
| \
+
E1000_GCR_TXDSCW_NO_SNOOP  | \
+
E1000_GCR_TXDSCR_NO_SNOOP)
+
 #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x0800
 /* Function Active and Power State to MNG */
 #define E1000_FACTPS_FUNC0_POWER_STATE_MASK 0x0003
diff --git a/drivers/net/e1000/e1000_main.c b/drivers

[PATCH netdev-2.6 28/39] Added firmware version reporting for 8257{1|2|3} controllers

2006-01-12 Thread Jeff Kirsher
The EEPROM image version is reported as a firmware version for these 
controllers.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_ethtool.c |   21 -
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index 0f9c860..d252297 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -582,10 +582,29 @@ e1000_get_drvinfo(struct net_device *net
struct ethtool_drvinfo *drvinfo)
 {
struct e1000_adapter *adapter = netdev_priv(netdev);
+   char firmware_version[32];
+   uint16_t eeprom_data;
 
strncpy(drvinfo->driver,  e1000_driver_name, 32);
strncpy(drvinfo->version, e1000_driver_version, 32);
-   strncpy(drvinfo->fw_version, "N/A", 32);
+
+   /* EEPROM image version # is reported as firmware version # for
+* 8257{1|2|3} controllers */
+   e1000_read_eeprom(&adapter->hw, 5, 1, &eeprom_data);
+   switch (adapter->hw.mac_type) {
+   case e1000_82571:
+   case e1000_82572:
+   case e1000_82573:
+   sprintf(firmware_version, "%d.%d-%d",
+   (eeprom_data & 0xF000) >> 12,
+   (eeprom_data & 0x0FF0) >> 4,
+   eeprom_data & 0x000F);
+   break;
+   default:
+   sprintf(firmware_version, "N/A");
+   }
+
+   strncpy(drvinfo->fw_version, firmware_version, 32);
strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
drvinfo->n_stats = E1000_STATS_LEN;
drvinfo->testinfo_len = E1000_TEST_LEN;

-
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 netdev-2.6 35/39] Added RX buffer enhancements

2006-01-12 Thread Jeff Kirsher
Align the prefetches to a dword to help speed them up.
Recycle skb's and early replenish.
Force memory writes to complete before fetching more descriptors.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |  137 +++-
 1 files changed, 78 insertions(+), 59 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 57a5ce2..7840596 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1653,23 +1653,8 @@ e1000_setup_rctl(struct e1000_adapter *a
rctl |= adapter->rx_buffer_len << 0x11;
} else {
rctl &= ~E1000_RCTL_SZ_4096;
-   rctl |= E1000_RCTL_BSEX; 
-   switch (adapter->rx_buffer_len) {
-   case E1000_RXBUFFER_2048:
-   default:
-   rctl |= E1000_RCTL_SZ_2048;
-   rctl &= ~E1000_RCTL_BSEX;
-   break;
-   case E1000_RXBUFFER_4096:
-   rctl |= E1000_RCTL_SZ_4096;
-   break;
-   case E1000_RXBUFFER_8192:
-   rctl |= E1000_RCTL_SZ_8192;
-   break;
-   case E1000_RXBUFFER_16384:
-   rctl |= E1000_RCTL_SZ_16384;
-   break;
-   }
+   rctl &= ~E1000_RCTL_BSEX;
+   rctl |= E1000_RCTL_SZ_2048;
}
 
 #ifndef DISABLE_PACKET_SPLIT
@@ -3571,7 +3556,6 @@ e1000_clean_rx_irq(struct e1000_adapter 
struct pci_dev *pdev = adapter->pdev;
struct e1000_rx_desc *rx_desc;
struct e1000_buffer *buffer_info;
-   struct sk_buff *skb;
unsigned long flags;
uint32_t length;
uint8_t last_byte;
@@ -3581,9 +3565,10 @@ e1000_clean_rx_irq(struct e1000_adapter 
 
i = rx_ring->next_to_clean;
rx_desc = E1000_RX_DESC(*rx_ring, i);
+   buffer_info = &rx_ring->buffer_info[i];
 
-   while(rx_desc->status & E1000_RXD_STAT_DD) {
-   buffer_info = &rx_ring->buffer_info[i];
+   while (rx_desc->status & E1000_RXD_STAT_DD) {
+   struct sk_buff *skb;
u8 status;
 #ifdef CONFIG_E1000_NAPI
if(*work_done >= work_to_do)
@@ -3591,6 +3576,7 @@ e1000_clean_rx_irq(struct e1000_adapter 
(*work_done)++;
 #endif
status = rx_desc->status;
+   skb = buffer_info->skb;
cleaned = TRUE;
cleaned_count++;
pci_unmap_single(pdev,
@@ -3598,20 +3584,50 @@ e1000_clean_rx_irq(struct e1000_adapter 
 buffer_info->length,
 PCI_DMA_FROMDEVICE);
 
-   skb = buffer_info->skb;
length = le16_to_cpu(rx_desc->length);
 
-   if(unlikely(!(rx_desc->status & E1000_RXD_STAT_EOP))) {
-   /* All receives must fit into a single buffer */
-   E1000_DBG("%s: Receive packet consumed multiple"
- " buffers\n", netdev->name);
-   dev_kfree_skb_irq(skb);
+   skb_put(skb, length);
+
+   if (!(status & E1000_RXD_STAT_EOP)) {
+   if (!rx_ring->rx_skb_top) {
+   rx_ring->rx_skb_top = skb;
+   rx_ring->rx_skb_top->len = length;
+   rx_ring->rx_skb_prev = skb;
+   } else {
+   if (skb_shinfo(rx_ring->rx_skb_top)->frag_list) 
{
+   rx_ring->rx_skb_prev->next = skb;
+   skb->prev = rx_ring->rx_skb_prev;
+   } else {
+   
skb_shinfo(rx_ring->rx_skb_top)->frag_list = skb;
+   }
+   rx_ring->rx_skb_prev = skb;
+   rx_ring->rx_skb_top->data_len += length;
+   }
goto next_desc;
+   } else {
+   if (rx_ring->rx_skb_top) {
+   if (skb_shinfo(rx_ring->rx_skb_top)
+   ->frag_list) {
+   rx_ring->rx_skb_prev->next = skb;
+   skb->prev = rx_ring->rx_skb_prev;
+   } else
+   skb_shinfo(rx_ring->rx_skb_top)
+   ->frag_list = skb;
+
+   rx_ring->rx_skb_top->data_len += length;
+   rx_ring->rx_skb_top->len +=
+   rx_ring

[PATCH netdev-2.6 01/39] Fix jumbo frame performance

2006-01-12 Thread Jeff Kirsher
Partition PBA for Jumbo frames based on MTU size.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 438a931..4b44bcd 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -43,7 +43,7 @@ static char e1000_driver_string[] = "Int
 #else
 #define DRIVERNAPI "-NAPI"
 #endif
-#define DRV_VERSION "6.1.16-k2"DRIVERNAPI
+#define DRV_VERSION "6.3.9-k2"DRIVERNAPI
 char e1000_driver_version[] = DRV_VERSION;
 static char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
 
@@ -449,7 +449,7 @@ e1000_reset(struct e1000_adapter *adapte
}
 
if((adapter->hw.mac_type != e1000_82573) &&
-  (adapter->rx_buffer_len > E1000_RXBUFFER_8192)) {
+  (adapter->netdev->mtu > E1000_RXBUFFER_8192)) {
pba -= 8; /* allocate more FIFO for Tx */
/* send an XOFF when there is enough space in the
 * Rx FIFO to hold one extra full size Rx packet 

-
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 netdev-2.6 29/39] Added PCIe bus information

2006-01-12 Thread Jeff Kirsher
This is two patches, the first is adding additional bus information for the 
8257{1|2|3} controllers.  The second patch was orginally a community patch to 
print bus type/speed/width, and enhanced by us.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index ca4e5e9..75cd6df 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -807,6 +807,26 @@ e1000_probe(struct pci_dev *pdev,
if(eeprom_data & eeprom_apme_mask)
adapter->wol |= E1000_WUFC_MAG;
 
+   /* print bus type/speed/width info */
+   {
+   struct e1000_hw *hw = &adapter->hw;
+   DPRINTK(PROBE, INFO, "(PCI%s:%s:%s) ",
+   ((hw->bus_type == e1000_bus_type_pcix) ? "-X" :
+(hw->bus_type == e1000_bus_type_pci_express ? " Express":"")),
+   ((hw->bus_speed == e1000_bus_speed_2500) ? "2.5Gb/s" :
+(hw->bus_speed == e1000_bus_speed_133) ? "133MHz" :
+(hw->bus_speed == e1000_bus_speed_120) ? "120MHz" :
+(hw->bus_speed == e1000_bus_speed_100) ? "100MHz" :
+(hw->bus_speed == e1000_bus_speed_66) ? "66MHz" : "33MHz"),
+   ((hw->bus_width == e1000_bus_width_64) ? "64-bit" :
+(hw->bus_width == e1000_bus_width_pciex_4) ? "Width x4" :
+(hw->bus_width == e1000_bus_width_pciex_1) ? "Width x1" :
+"32-bit"));
+   }
+
+   for (i = 0; i < 6; i++)
+   printk("%2.2x%c", netdev->dev_addr[i], i == 5 ? '\n' : ':');
+
/* reset the hardware with the new settings */
e1000_reset(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 netdev-2.6 06/39] Fix PHY config for 82573 controller

2006-01-12 Thread Jeff Kirsher
Added a delay to allow PHY configuration to complete before accessing NVM.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index f853e10..45fa386 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -6722,6 +6722,12 @@ e1000_get_phy_cfg_done(struct e1000_hw *
 break;
 }
 
+/* PHY configuration from NVM just starts after EECD_AUTO_RD sets to high.
+ * Need to wait for PHY configuration completion before accessing NVM
+ * and PHY. */
+if (hw->mac_type == e1000_82573)
+msec_delay(25);
+
 return E1000_SUCCESS;
 }
 

-
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 netdev-2.6 33/39] Cleaned up code and removed hard coded numbers

2006-01-12 Thread Jeff Kirsher


Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   34 +-
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 33e8b45..95cd969 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1920,12 +1920,10 @@ e1000_unmap_and_free_tx_resource(struct 
buffer_info->dma,
buffer_info->length,
PCI_DMA_TODEVICE);
-   buffer_info->dma = 0;
}
-   if(buffer_info->skb) {
+   if (buffer_info->skb)
dev_kfree_skb_any(buffer_info->skb);
-   buffer_info->skb = NULL;
-   }
+   memset(buffer_info, 0, sizeof(struct e1000_buffer));
 }
 
 /**
@@ -2044,8 +2042,6 @@ e1000_clean_rx_ring(struct e1000_adapter
for(i = 0; i < rx_ring->count; i++) {
buffer_info = &rx_ring->buffer_info[i];
if(buffer_info->skb) {
-   ps_page = &rx_ring->ps_page[i];
-   ps_page_dma = &rx_ring->ps_page_dma[i];
pci_unmap_single(pdev,
 buffer_info->dma,
 buffer_info->length,
@@ -2543,11 +2539,11 @@ e1000_tso(struct e1000_adapter *adapter,
if (++i == tx_ring->count) i = 0;
tx_ring->next_to_use = i;
 
-   return 1;
+   return TRUE;
}
 #endif
 
-   return 0;
+   return FALSE;
 }
 
 static inline boolean_t
@@ -3383,7 +3379,19 @@ e1000_clean(struct net_device *poll_dev,
BUG();
}
 
-   tx_cleaned = e1000_clean_tx_irq(adapter, &adapter->tx_ring[i]);
+   if (likely(adapter->num_tx_queues == 1)) {
+   /* e1000_clean is called per-cpu.  This lock protects
+* tx_ring[0] from being cleaned by multiple cpus
+* simultaneously.  A failure obtaining the lock means
+* tx_ring[0] is currently being cleaned anyway. */
+   if (spin_trylock(&adapter->tx_queue_lock)) {
+   tx_cleaned = e1000_clean_tx_irq(adapter,
+   &adapter->tx_ring[0]);
+   spin_unlock(&adapter->tx_queue_lock);
+   }
+   } else
+   tx_cleaned = e1000_clean_tx_irq(adapter, &adapter->tx_ring[i]);
+
adapter->clean_rx(adapter, &adapter->rx_ring[i],
  &work_done, work_to_do);
 
@@ -3428,11 +3436,11 @@ e1000_clean_tx_irq(struct e1000_adapter 
buffer_info = &tx_ring->buffer_info[i];
cleaned = (i == eop);
 
+#ifdef CONFIG_E1000_MQ
+   tx_ring->tx_stats.bytes += buffer_info->length;
+#endif
e1000_unmap_and_free_tx_resource(adapter, buffer_info);
-
-   tx_desc->buffer_addr = 0;
-   tx_desc->lower.data = 0;
-   tx_desc->upper.data = 0;
+   memset(tx_desc, 0, sizeof(struct e1000_tx_desc));
 
if(unlikely(++i == tx_ring->count)) i = 0;
}

-
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 netdev-2.6 16/39] Fix Desc. Rings and Jumbo Frames

2006-01-12 Thread Jeff Kirsher
This patch contains two fixes.  The first fix is to the tx and rx descriptor 
rings clean up process.  The second fix is to jumbo frames, which cleans up the 
code logic and removes most of the fifo related limitations on jumbo frames.  
This is because the driver code now supports splitting a packet across multiple 
descriptors.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |  108 +++-
 1 files changed, 61 insertions(+), 47 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index cf4fc51..41f44a3 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1542,6 +1542,8 @@ setup_rx_desc_die:
 
rxdr->next_to_clean = 0;
rxdr->next_to_use = 0;
+   rxdr->rx_skb_top = NULL;
+   rxdr->rx_skb_prev = NULL;
 
return 0;
 }
@@ -2010,19 +2012,30 @@ e1000_clean_rx_ring(struct e1000_adapter
 
dev_kfree_skb(buffer_info->skb);
buffer_info->skb = NULL;
-
-   for(j = 0; j < adapter->rx_ps_pages; j++) {
-   if(!ps_page->ps_page[j]) break;
-   pci_unmap_single(pdev,
-ps_page_dma->ps_page_dma[j],
-PAGE_SIZE, PCI_DMA_FROMDEVICE);
-   ps_page_dma->ps_page_dma[j] = 0;
-   put_page(ps_page->ps_page[j]);
-   ps_page->ps_page[j] = NULL;
-   }
}
+   ps_page = &rx_ring->ps_page[i];
+   ps_page_dma = &rx_ring->ps_page_dma[i];
+   for (j = 0; j < adapter->rx_ps_pages; j++) {
+   if (!ps_page->ps_page[j]) break;
+   pci_unmap_page(pdev,
+  ps_page_dma->ps_page_dma[j],
+  PAGE_SIZE, PCI_DMA_FROMDEVICE);
+   ps_page_dma->ps_page_dma[j] = 0;
+   put_page(ps_page->ps_page[j]);
+   ps_page->ps_page[j] = NULL;
+   }
+   }
+
+   /* there also may be some cached data in our adapter */
+   if (rx_ring->rx_skb_top) {
+   dev_kfree_skb(rx_ring->rx_skb_top);
+
+   /* rx_skb_prev will be wiped out by rx_skb_top */
+   rx_ring->rx_skb_top = NULL;
+   rx_ring->rx_skb_prev = NULL;
}
 
+
size = sizeof(struct e1000_buffer) * rx_ring->count;
memset(rx_ring->buffer_info, 0, size);
size = sizeof(struct e1000_ps_page) * rx_ring->count;
@@ -2985,50 +2998,51 @@ e1000_change_mtu(struct net_device *netd
if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
(max_frame > MAX_JUMBO_FRAME_SIZE)) {
DPRINTK(PROBE, ERR, "Invalid MTU setting\n");
-   return -EINVAL;
-   }
-
-#define MAX_STD_JUMBO_FRAME_SIZE 9234
-   /* might want this to be bigger enum check... */
-   /* 82571 controllers limit jumbo frame size to 10500 bytes */
-   if ((adapter->hw.mac_type == e1000_82571 || 
-adapter->hw.mac_type == e1000_82572) &&
-   max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
-   DPRINTK(PROBE, ERR, "MTU > 9216 bytes not supported "
-   "on 82571 and 82572 controllers.\n");
return -EINVAL;
}
 
-   if(adapter->hw.mac_type == e1000_82573 &&
-   max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
-   DPRINTK(PROBE, ERR, "Jumbo Frames not supported "
-   "on 82573\n");
-   return -EINVAL;
-   }
-
-   if(adapter->hw.mac_type > e1000_82547_rev_2) {
-   adapter->rx_buffer_len = max_frame;
-   E1000_ROUNDUP(adapter->rx_buffer_len, 1024);
-   } else {
-   if(unlikely((adapter->hw.mac_type < e1000_82543) &&
-  (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE))) {
-   DPRINTK(PROBE, ERR, "Jumbo Frames not supported "
-   "on 82542\n");
+   /* Adapter-specific max frame size limits. */
+   switch (adapter->hw.mac_type) {
+   case e1000_82542_rev2_0:
+   case e1000_82542_rev2_1:
+   case e1000_82573:
+   if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
+   DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n");
return -EINVAL;
-
-   } else {
-   if(max_frame <= E1000_RXBUFFER_2048) {
-   adapter->rx_buffer_len = E1000_RXBUFFER_2048;
-   } else if(max_frame <= E1000_RXBUFFER_4096) {
- 

[PATCH netdev-2.6 23/39] Fixed frame size logic

2006-01-12 Thread Jeff Kirsher
Simplified the logic used to assign the frame_size.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_ethtool.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index ad9ca2a..8363d8d 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1401,7 +1401,7 @@ static void
 e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
 {
memset(skb->data, 0xFF, frame_size);
-   frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size;
+   frame_size &= ~1;
memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
@@ -1410,7 +1410,7 @@ e1000_create_lbtest_frame(struct sk_buff
 static int
 e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
 {
-   frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size;
+   frame_size &= ~1;
if(*(skb->data + 3) == 0xFF) {
if((*(skb->data + frame_size / 2 + 10) == 0xBE) &&
   (*(skb->data + frame_size / 2 + 12) == 0xAF)) {

-
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 netdev-2.6 36/39] Added functions to save and restore config

2006-01-12 Thread Jeff Kirsher
These functions help restore the driver to active configuration when coming out 
of resume for power management.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   60 +++-
 1 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 7840596..4725d29 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4437,6 +4437,54 @@ e1000_set_spd_dplx(struct e1000_adapter 
 }
 
 #ifdef CONFIG_PM
+/* these functions save and restore 16 or 64 dwords (64-256 bytes) of config
+ * space versus the 64 bytes that pci_[save|restore]_state handle
+ */
+#define PCIE_CONFIG_SPACE_LEN 256
+#define PCI_CONFIG_SPACE_LEN 64
+static int
+e1000_pci_save_state(struct e1000_adapter *adapter)
+{
+   struct pci_dev *dev = adapter->pdev;
+   int size;
+   int i;
+   if (adapter->hw.mac_type >= e1000_82571)
+   size = PCIE_CONFIG_SPACE_LEN;
+   else
+   size = PCI_CONFIG_SPACE_LEN;
+
+   WARN_ON(adapter->config_space != NULL);
+
+   adapter->config_space = kmalloc(size, GFP_KERNEL);
+   if (!adapter->config_space) {
+   DPRINTK(PROBE, ERR, "unable to allocate %d bytes\n", size);
+   return -ENOMEM;
+   }
+   for (i = 0; i < (size / 4); i++)
+   pci_read_config_dword(dev, i * 4, &adapter->config_space[i]);
+   return 0;
+}
+
+static void
+e1000_pci_restore_state(struct e1000_adapter *adapter)
+{
+   struct pci_dev *dev = adapter->pdev;
+   int size;
+   int i;
+   if (adapter->config_space == NULL)
+   return;
+   if (adapter->hw.mac_type >= e1000_82571)
+   size = PCIE_CONFIG_SPACE_LEN;
+   else
+   size = PCI_CONFIG_SPACE_LEN;
+   for (i = 0; i < (size / 4); i++)
+   pci_write_config_dword(dev, i * 4, adapter->config_space[i]);
+   kfree(adapter->config_space);
+   adapter->config_space = NULL;
+   return;
+}
+#endif /* CONFIG_PM */
+
 static int
 e1000_suspend(struct pci_dev *pdev, pm_message_t state)
 {
@@ -4451,6 +4499,14 @@ e1000_suspend(struct pci_dev *pdev, pm_m
if(netif_running(netdev))
e1000_down(adapter);
 
+#ifdef CONFIG_PM
+   /* implement our own version of pci_save_state(pdev) because pci 
+* express adapters have larger 256 byte config spaces */
+   retval = e1000_pci_save_state(adapter);
+   if (retval)
+   return retval;
+#endif
+
status = E1000_READ_REG(&adapter->hw, STATUS);
if(status & E1000_STATUS_LU)
wufc &= ~E1000_WUFC_LNKC;
@@ -4507,8 +4563,6 @@ e1000_suspend(struct pci_dev *pdev, pm_m
DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
}
 
-   pci_save_state(pdev);
-
if(adapter->hw.mac_type >= e1000_82540 &&
   adapter->hw.media_type == e1000_media_type_copper) {
manc = E1000_READ_REG(&adapter->hw, MANC);
@@ -4537,6 +4591,7 @@ e1000_suspend(struct pci_dev *pdev, pm_m
return 0;
 }
 
+#ifdef CONFIG_PM
 static int
 e1000_resume(struct pci_dev *pdev)
 {
@@ -4548,6 +4603,7 @@ e1000_resume(struct pci_dev *pdev)
retval = pci_set_power_state(pdev, PCI_D0);
if (retval)
DPRINTK(PROBE, ERR, "Error in setting power state\n");
+   e1000_pci_restore_state(adapter);
ret_val = pci_enable_device(pdev);
pci_set_master(pdev);
 

-
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 netdev-2.6 25/39] Added interrupt auto mask support

2006-01-12 Thread Jeff Kirsher


Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   31 +--
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 6d7f9c9..53f87fe 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1736,10 +1736,15 @@ e1000_configure_rx(struct e1000_adapter 
}
 
if (hw->mac_type >= e1000_82571) {
-   /* Reset delay timers after every interrupt */
ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
+   /* Reset delay timers after every interrupt */
ctrl_ext |= E1000_CTRL_EXT_CANC;
+#ifdef CONFIG_E1000_NAPI
+   /* Auto-Mask interrupts upon ICR read. */
+   ctrl_ext |= E1000_CTRL_EXT_IAME;
+#endif
E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext);
+   E1000_WRITE_REG(hw, IAM, ~0);
E1000_WRITE_FLUSH(hw);
}
 
@@ -3244,12 +3249,24 @@ e1000_intr(int irq, void *data, struct p
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
uint32_t icr = E1000_READ_REG(hw, ICR);
-#if defined(CONFIG_E1000_NAPI) && defined(CONFIG_E1000_MQ) || 
!defined(CONFIG_E1000_NAPI)
+#ifndef CONFIG_E1000_NAPI
int i;
+#else
+   /* Interrupt Auto-Mask...upon reading ICR,
+* interrupts are masked.  No need for the
+* IMC write, but it does mean we should
+* account for it ASAP. */
+   if (likely(hw->mac_type >= e1000_82571))
+   atomic_inc(&adapter->irq_sem);
 #endif
 
-   if(unlikely(!icr))
+   if (unlikely(!icr)) {
+#ifdef CONFIG_E1000_NAPI
+   if (hw->mac_type >= e1000_82571)
+   e1000_irq_enable(adapter);
+#endif
return IRQ_NONE;  /* Not our interrupt */
+   }
 
if(unlikely(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))) {
hw->get_link_status = 1;
@@ -3257,9 +3274,11 @@ e1000_intr(int irq, void *data, struct p
}
 
 #ifdef CONFIG_E1000_NAPI
-   atomic_inc(&adapter->irq_sem);
-   E1000_WRITE_REG(hw, IMC, ~0);
-   E1000_WRITE_FLUSH(hw);
+   if (unlikely(hw->mac_type < e1000_82571)) {
+   atomic_inc(&adapter->irq_sem);
+   E1000_WRITE_REG(hw, IMC, ~0);
+   E1000_WRITE_FLUSH(hw);
+   }
 #ifdef CONFIG_E1000_MQ
if (atomic_read(&adapter->rx_sched_call_data.count) == 0) {
/* We must setup the cpumask once count == 0 since

-
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 netdev-2.6 10/39] Fix mulitple queues

2006-01-12 Thread Jeff Kirsher
Fixed stats when using multiple queues.
When multiple queues are enabled, log a message in syslog.
Fixed memory allocation for multiple queues.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000.h |   26 ---
 drivers/net/e1000/e1000_ethtool.c |   65 -
 drivers/net/e1000/e1000_main.c|   47 ---
 3 files changed, 120 insertions(+), 18 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 5940f7a..0a084e9 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -72,10 +72,6 @@
 #include 
 #include 
 #include 
-#ifdef CONFIG_E1000_MQ
-#include 
-#include 
-#endif
 
 #define BAR_0  0
 #define BAR_1  1
@@ -87,6 +83,10 @@
 struct e1000_adapter;
 
 #include "e1000_hw.h"
+#ifdef CONFIG_E1000_MQ
+#include 
+#include 
+#endif
 
 #ifdef DBG
 #define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
@@ -169,6 +169,13 @@ struct e1000_buffer {
uint16_t next_to_watch;
 };
 
+#ifdef CONFIG_E1000_MQ
+struct e1000_queue_stats {
+   uint64_t packets;
+   uint64_t bytes;
+};
+#endif
+
 struct e1000_ps_page { struct page *ps_page[PS_PAGE_BUFFERS]; };
 struct e1000_ps_page_dma { uint64_t ps_page_dma[PS_PAGE_BUFFERS]; };
 
@@ -194,6 +201,9 @@ struct e1000_tx_ring {
 
boolean_t last_tx_tso;
 
+#ifdef CONFIG_E1000_MQ
+   struct e1000_queue_stats tx_stats;
+#endif
 };
 
 struct e1000_rx_ring {
@@ -223,6 +233,9 @@ struct e1000_rx_ring {
 
uint16_t rdh;
uint16_t rdt;
+#ifdef CONFIG_E1000_MQ
+   struct e1000_queue_stats rx_stats;
+#endif
 };
 
 #define E1000_DESC_UNUSED(R) \
@@ -255,6 +268,9 @@ struct e1000_adapter {
uint16_t link_speed;
uint16_t link_duplex;
spinlock_t stats_lock;
+#ifdef CONFIG_E1000_NAPI
+   spinlock_t tx_queue_lock;
+#endif
atomic_t irq_sem;
struct work_struct tx_timeout_task;
struct work_struct watchdog_task;
@@ -302,7 +318,7 @@ struct e1000_adapter {
 #ifdef CONFIG_E1000_MQ
struct net_device **cpu_netdev; /* per-cpu */
struct call_async_data_struct rx_sched_call_data;
-   int cpu_for_queue[4];
+   cpumask_t cpumask;
 #endif
int num_tx_queues;
int num_rx_queues;
diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index fa9a465..ffdf76b 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -96,8 +96,18 @@ static const struct e1000_stats e1000_gs
{ "rx_header_split", E1000_STAT(rx_hdr_split) },
{ "alloc_rx_buff_failed", E1000_STAT(alloc_rx_buff_failed) },
 };
-#define E1000_STATS_LEN\
+
+#ifdef CONFIG_E1000_MQ
+#define E1000_QUEUE_STATS_LEN \
+   (((struct e1000_adapter *)netdev->priv)->num_tx_queues + \
+((struct e1000_adapter *)netdev->priv)->num_rx_queues) \
+   * (sizeof(struct e1000_queue_stats) / sizeof(uint64_t))
+#else
+#define E1000_QUEUE_STATS_LEN 0
+#endif
+#define E1000_GLOBAL_STATS_LEN \
sizeof(e1000_gstrings_stats) / sizeof(struct e1000_stats)
+#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN + E1000_QUEUE_STATS_LEN)
 static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
"Register test  (offline)", "Eeprom test(offline)",
"Interrupt test (offline)", "Loopback test  (offline)",
@@ -1746,19 +1756,43 @@ e1000_get_ethtool_stats(struct net_devic
struct ethtool_stats *stats, uint64_t *data)
 {
struct e1000_adapter *adapter = netdev_priv(netdev);
+#ifdef CONFIG_E1000_MQ
+   uint64_t *queue_stat;
+   int stat_count = sizeof(struct e1000_queue_stats) / sizeof(uint64_t);
+   int j, k;
+#endif
int i;
 
e1000_update_stats(adapter);
-   for(i = 0; i < E1000_STATS_LEN; i++) {
-   char *p = (char *)adapter+e1000_gstrings_stats[i].stat_offset;  
-   data[i] = (e1000_gstrings_stats[i].sizeof_stat == 
+   for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
+   char *p = (char *)adapter+e1000_gstrings_stats[i].stat_offset;
+   data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p;
}
+#ifdef CONFIG_E1000_MQ
+   for (j = 0; j < adapter->num_tx_queues; j++) {
+   queue_stat = (uint64_t *)&adapter->tx_ring[j].tx_stats;
+   for (k = 0; k < stat_count; k++)
+   data[i + k] = queue_stat[k];
+   i += k;
+   }
+   for (j = 0; j < adapter->num_rx_queues; j++) {
+   queue_stat = (uint64_t *)&adapter->rx_ring[j].rx_stats;
+   for (k = 0; k < stat_count; k++)
+   data[i + k] = queue_stat[k];
+   i += k;
+   }
+#endif
+/* BUG_ON(i != E1000_STATS_LEN); */
 }
 
 static voi

[PATCH netdev-2.6 02/39] Fix TSO

2006-01-12 Thread Jeff Kirsher
Fixed the TSO workaround for 82571/2 controllers.
Fixed TSO issue where a non-tso packet in a linear SKB which followed a TSO 
packet would get written back prematurely.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   37 ++---
 1 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4b44bcd..4945a41 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2688,11 +2688,23 @@ e1000_xmit_frame(struct sk_buff *skb, st
 * overrun the FIFO, adjust the max buffer len if mss
 * drops. */
if(mss) {
+   uint8_t hdr_len;
max_per_txd = min(mss << 2, max_per_txd);
max_txd_pwr = fls(max_per_txd) - 1;
+
+   /* TSO Workaround for 82571/2 Controllers -- if skb->data
+* points to just header, pull a few bytes of payload from
+* frags into skb->data */
+   hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
+   if (skb->data_len && (hdr_len == (skb->len - skb->data_len)) &&
+   (adapter->hw.mac_type == e1000_82571 ||
+   adapter->hw.mac_type == e1000_82572)) {
+   len = skb->len - skb->data_len;
+   }
}
 
if((mss) || (skb->ip_summed == CHECKSUM_HW))
+   /* reserve a descriptor for the offload context */
count++;
count++;
 #else
@@ -2726,26 +2738,13 @@ e1000_xmit_frame(struct sk_buff *skb, st
if(adapter->pcix_82544)
count += nr_frags;
 
-#ifdef NETIF_F_TSO
-   /* TSO Workaround for 82571/2 Controllers -- if skb->data
-* points to just header, pull a few bytes of payload from 
-* frags into skb->data */
-   if (skb_shinfo(skb)->tso_size) {
-   uint8_t hdr_len;
-   hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
-   if (skb->data_len && (hdr_len < (skb->len - skb->data_len)) && 
-   (adapter->hw.mac_type == e1000_82571 ||
-   adapter->hw.mac_type == e1000_82572)) {
-   unsigned int pull_size;
-   pull_size = min((unsigned int)4, skb->data_len);
-   if (!__pskb_pull_tail(skb, pull_size)) {
-   printk(KERN_ERR "__pskb_pull_tail failed.\n");
-   dev_kfree_skb_any(skb);
-   return -EFAULT;
-   }
+   unsigned int pull_size;
+   pull_size = min((unsigned int)4, skb->data_len);
+   if (!__pskb_pull_tail(skb, pull_size)) {
+   printk(KERN_ERR "__pskb_pull_tail failed.\n");
+   dev_kfree_skb_any(skb);
+   return -EFAULT;
}
-   }
-#endif
 
if(adapter->hw.tx_pkt_filtering && (adapter->hw.mac_type == 
e1000_82573) )
e1000_transfer_dhcp_info(adapter, skb);

-
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 netdev-2.6 08/39] Fix LED functionality for 82573

2006-01-12 Thread Jeff Kirsher
Fixed adapter identification issue.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_ethtool.c |   22 +++---
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index 791110d..54ae880 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1699,13 +1699,21 @@ e1000_phys_id(struct net_device *netdev,
mod_timer(&adapter->blink_timer, jiffies);
msleep_interruptible(data * 1000);
del_timer_sync(&adapter->blink_timer);
-   }
-   else {
-   E1000_WRITE_REG(&adapter->hw, LEDCTL, 
(E1000_LEDCTL_LED2_BLINK_RATE |
-   E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK | 
-   (E1000_LEDCTL_MODE_LED_ON << 
E1000_LEDCTL_LED2_MODE_SHIFT) |
-   (E1000_LEDCTL_MODE_LINK_ACTIVITY << 
E1000_LEDCTL_LED1_MODE_SHIFT) |
-   (E1000_LEDCTL_MODE_LED_OFF << 
E1000_LEDCTL_LED0_MODE_SHIFT)));
+   } else if (adapter->hw.mac_type < e1000_82573) {
+   E1000_WRITE_REG(&adapter->hw, LEDCTL,
+   (E1000_LEDCTL_LED2_BLINK_RATE |
+E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK |
+(E1000_LEDCTL_MODE_LED_ON << 
E1000_LEDCTL_LED2_MODE_SHIFT) |
+(E1000_LEDCTL_MODE_LINK_ACTIVITY << 
E1000_LEDCTL_LED0_MODE_SHIFT) |
+(E1000_LEDCTL_MODE_LED_OFF << 
E1000_LEDCTL_LED1_MODE_SHIFT)));
+   msleep_interruptible(data * 1000);
+   } else {
+   E1000_WRITE_REG(&adapter->hw, LEDCTL,
+   (E1000_LEDCTL_LED2_BLINK_RATE |
+E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK |
+(E1000_LEDCTL_MODE_LED_ON << 
E1000_LEDCTL_LED2_MODE_SHIFT) |
+(E1000_LEDCTL_MODE_LINK_ACTIVITY << 
E1000_LEDCTL_LED1_MODE_SHIFT) |
+(E1000_LEDCTL_MODE_LED_OFF << 
E1000_LEDCTL_LED0_MODE_SHIFT)));
msleep_interruptible(data * 1000);
}
 

-
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 netdev-2.6 39/39] Added driver comments

2006-01-12 Thread Jeff Kirsher


Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   72 +---
 1 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index c68ffb7..fd0a788 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -29,11 +29,73 @@
 #include "e1000.h"
 
 /* Change Log
- * 6.0.58   4/20/05
- *   o Accepted ethtool cleanup patch from Stephen Hemminger 
- * 6.0.44+ 2/15/05
- *   o applied Anton's patch to resolve tx hang in hardware
- *   o Applied Andrew Mortons patch - e1000 stops working after resume
+ * 6.3.9   12/16/2005
+ *   o incorporate fix for recycled skbs from IBM LTC
+ * 6.3.7   11/18/2005
+ *   o Honor eeprom setting for enabling/disabling Wake On Lan
+ * 6.3.5   11/17/2005
+ *   o Fix memory leak in rx ring handling for PCI Express adapters
+ * 6.3.4   11/8/05
+ *   o Patch from Jesper Juhl to remove redundant NULL checks for kfree
+ * 6.3.2   9/20/05
+ *   o Render logic that sets/resets DRV_LOAD as inline functions to 
+ * avoid code replication. If f/w is AMT then set DRV_LOAD only when
+ * network interface is open.
+ *   o Handle DRV_LOAD set/reset in cases where AMT uses VLANs.
+ *   o Adjust PBA partioning for Jumbo frames using MTU size and not
+ * rx_buffer_len
+ * 6.3.1   9/19/05
+ *   o Use adapter->tx_timeout_factor in Tx Hung Detect logic 
+   (e1000_clean_tx_irq)
+ *   o Support for 8086:10B5 device (Quad Port)
+ * 6.2.14  9/15/05
+ *   o In AMT enabled configurations, set/reset DRV_LOAD bit on interface 
+ * open/close 
+ * 6.2.13   9/14/05
+ *   o Invoke e1000_check_mng_mode only for 8257x controllers since it 
+ * accesses the FWSM that is not supported in other controllers
+ * 6.2.12   9/9/05
+ *   o Add support for device id E1000_DEV_ID_82546GB_QUAD_COPPER
+ *   o set RCTL:SECRC only for controllers newer than 82543. 
+ *   o When the n/w interface comes down reset DRV_LOAD bit to notify f/w.
+ * This code was moved from e1000_remove to e1000_close
+ * 6.2.10   9/6/05
+ *   o Fix error in updating RDT in el1000_alloc_rx_buffers[_ps] -- one off.
+ *   o Enable fc by default on 82573 controllers (do not read eeprom)
+ *   o Fix rx_errors statistic not to include missed_packet_count
+ *   o Fix rx_dropped statistic not to include missed_packet_count 
+   (Padraig Brady)
+ * 6.2.98/30/05
+ *   o Remove call to update statistics from the controller ib e1000_get_stats
+ * 6.2.88/30/05
+ *   o Improved algorithm for rx buffer allocation/rdt update
+ *   o Flow control watermarks relative to rx PBA size
+ *   o Simplified 'Tx Hung' detect logic
+ * 6.2.7   8/17/05
+ *   o Report rx buffer allocation failures and tx timeout counts in stats
+ * 6.2.6   8/16/05
+ *   o Implement workaround for controller erratum -- linear non-tso packet
+ * following a TSO gets written back prematurely
+ * 6.2.5   8/15/05
+ *   o Set netdev->tx_queue_len based on link speed/duplex settings.
+ *   o Fix net_stats.rx_fifo_errors <[EMAIL PROTECTED]>
+ *   o Do not power off PHY if SoL/IDER session is active
+ * 6.2.4   8/10/05
+ *   o Fix loopback test setup/cleanup for 82571/3 controllers
+ *   o Fix parsing of outgoing packets (e1000_transfer_dhcp_info) to treat
+ * all packets as raw
+ *   o Prevent operations that will cause the PHY to be reset if SoL/IDER
+ * sessions are active and log a message
+ * 6.2.2   7/21/05
+ *   o used fixed size descriptors for all MTU sizes, reduces memory load
+ * 6.2.1   7/21/05
+ *   o Performance tweaks, including copybreak and prefetch
+ * 6.1.2   4/13/05
+ *   o Fixed ethtool diagnostics
+ *   o Enabled flow control to take default eeprom settings
+ *   o Added stats_lock around e1000_read_phy_reg commands to avoid concurrent
+ * calls, one from mii_ioctl and other from within update_stats while 
+ * processing MIIREG ioctl.
  */
 
 char e1000_driver_name[] = "e1000";

-
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 netdev-2.6 18/39] Fix desc. clean up

2006-01-12 Thread Jeff Kirsher
These were two separate community submitted patches.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_ethtool.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index ceb9cd0..ad9ca2a 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -980,11 +980,11 @@ e1000_free_desc_rings(struct e1000_adapt
}
}
 
-   if(txdr->desc) {
+   if (txdr->desc) {
pci_free_consistent(pdev, txdr->size, txdr->desc, txdr->dma);
txdr->desc = NULL;
}
-   if(rxdr->desc) {
+   if (rxdr->desc) {
pci_free_consistent(pdev, rxdr->size, rxdr->desc, rxdr->dma);
rxdr->desc = NULL;
}
@@ -993,6 +993,7 @@ e1000_free_desc_rings(struct e1000_adapt
txdr->buffer_info = NULL;
kfree(rxdr->buffer_info);
rxdr->buffer_info = NULL;
+
return;
 }
 

-
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 netdev-2.6 24/39] Fix Netpoll issue

2006-01-12 Thread Jeff Kirsher
Fixed an issue netpoll would error out during communication, generating the 
following error:
--netdump[14973]: Got toomany timeouts in handshaking, ...
Even after a kernel panic, netpoll requires two way communication to 
successfully transfer the crash log to the remote server.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 8190eb0..6d7f9c9 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4449,6 +4449,9 @@ e1000_netpoll(struct net_device *netdev)
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);
 }
 #endif

-
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 netdev-2.6 20/39] Fix collision distance

2006-01-12 Thread Jeff Kirsher
Fixed the collision distance for 82543 controllers and newer.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.c   |9 +++--
 drivers/net/e1000/e1000_hw.h   |5 -
 drivers/net/e1000/e1000_main.c |   28 ++--
 3 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index f79d2a0..ac227c7 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -1933,14 +1933,19 @@ e1000_phy_force_speed_duplex(struct e100
 void
 e1000_config_collision_dist(struct e1000_hw *hw)
 {
-uint32_t tctl;
+uint32_t tctl, coll_dist;
 
 DEBUGFUNC("e1000_config_collision_dist");
 
+if (hw->mac_type < e1000_82543)
+coll_dist = E1000_COLLISION_DISTANCE_82542;
+else
+coll_dist = E1000_COLLISION_DISTANCE;
+
 tctl = E1000_READ_REG(hw, TCTL);
 
 tctl &= ~E1000_TCTL_COLD;
-tctl |= E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT;
+tctl |= coll_dist << E1000_COLD_SHIFT;
 
 E1000_WRITE_REG(hw, TCTL, tctl);
 E1000_WRITE_FLUSH(hw);
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 1ddfd56..600570f 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -2078,7 +2078,10 @@ struct e1000_host_command_info {
 /* Collision related configuration parameters */
 #define E1000_COLLISION_THRESHOLD   15
 #define E1000_CT_SHIFT  4
-#define E1000_COLLISION_DISTANCE64
+/* Collision distance is a 0-based value that applies to
+ * half-duplex-capable hardware only. */
+#define E1000_COLLISION_DISTANCE63
+#define E1000_COLLISION_DISTANCE_82542  64
 #define E1000_FDX_COLLISION_DISTANCEE1000_COLLISION_DISTANCE
 #define E1000_HDX_COLLISION_DISTANCEE1000_COLLISION_DISTANCE
 #define E1000_COLD_SHIFT12
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index d2e77ee..36b04d4 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1342,6 +1342,7 @@ e1000_configure_tx(struct e1000_adapter 
uint64_t tdba;
struct e1000_hw *hw = &adapter->hw;
uint32_t tdlen, tctl, tipg, tarc;
+   uint32_t ipgr1, ipgr2;
 
/* Setup the HW Tx Head and Tail descriptor pointers */
 
@@ -1375,22 +1376,26 @@ e1000_configure_tx(struct e1000_adapter 
 
/* Set the default values for the Tx Inter Packet Gap timer */
 
+   if (hw->media_type == e1000_media_type_fiber ||
+   hw->media_type == e1000_media_type_internal_serdes)
+   tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
+   else
+   tipg = DEFAULT_82543_TIPG_IPGT_COPPER;
+
switch (hw->mac_type) {
case e1000_82542_rev2_0:
case e1000_82542_rev2_1:
tipg = DEFAULT_82542_TIPG_IPGT;
-   tipg |= DEFAULT_82542_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT;
-   tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT;
+   ipgr1 = DEFAULT_82542_TIPG_IPGR1;
+   ipgr2 = DEFAULT_82542_TIPG_IPGR2;
break;
default:
-   if (hw->media_type == e1000_media_type_fiber ||
-   hw->media_type == e1000_media_type_internal_serdes)
-   tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
-   else
-   tipg = DEFAULT_82543_TIPG_IPGT_COPPER;
-   tipg |= DEFAULT_82543_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT;
-   tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT;
+   ipgr1 = DEFAULT_82543_TIPG_IPGR1;
+   ipgr2 = DEFAULT_82543_TIPG_IPGR2;
+   break;
}
+   tipg |= ipgr1 << E1000_TIPG_IPGR1_SHIFT;
+   tipg |= ipgr2 << E1000_TIPG_IPGR2_SHIFT;
E1000_WRITE_REG(hw, TIPG, tipg);
 
/* Set the Tx Interrupt Delay register */
@@ -1600,7 +1605,10 @@ e1000_setup_rctl(struct e1000_adapter *a
E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
(adapter->hw.mc_filter_type << E1000_RCTL_MO_SHIFT);
 
-   if(adapter->hw.tbi_compatibility_on == 1)
+   if (adapter->hw.mac_type > e1000_82543)
+   rctl |= E1000_RCTL_SECRC;
+
+   if (adapter->hw.tbi_compatibility_on == 1)
rctl |= E1000_RCTL_SBP;
else
rctl &= ~E1000_RCTL_SBP;

-
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 netdev-2.6 37/39] Added functions declarations

2006-01-12 Thread Jeff Kirsher
Added e1000_mc_addr_list_update
Added e1000_read_reg_io
Added e1000_enable_pciex_master

These are not static functions, that is why we have them declared in the header.
Jeb can you elaborate more on these? Please...

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 0b8f6f2..09a7c80 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -377,6 +377,7 @@ int32_t e1000_swfw_sync_acquire(struct e
 void e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask);
 
 /* Filters (multicast, vlan, receive) */
+void e1000_mc_addr_list_update(struct e1000_hw *hw, uint8_t * mc_addr_list, 
uint32_t mc_addr_count, uint32_t pad, uint32_t rar_used_count);
 uint32_t e1000_hash_mc_addr(struct e1000_hw *hw, uint8_t * mc_addr);
 void e1000_mta_set(struct e1000_hw *hw, uint32_t hash_value);
 void e1000_rar_set(struct e1000_hw *hw, uint8_t * mc_addr, uint32_t rar_index);
@@ -401,7 +402,9 @@ void e1000_read_pci_cfg(struct e1000_hw 
 void e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
 /* Port I/O is only supported on 82544 and newer */
 uint32_t e1000_io_read(struct e1000_hw *hw, unsigned long port);
+uint32_t e1000_read_reg_io(struct e1000_hw *hw, uint32_t offset);
 void e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value);
+void e1000_enable_pciex_master(struct e1000_hw *hw);
 int32_t e1000_disable_pciex_master(struct e1000_hw *hw);
 int32_t e1000_get_software_semaphore(struct e1000_hw *hw);
 void e1000_release_software_semaphore(struct e1000_hw *hw);

-
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 netdev-2.6 26/39] Added cleaned_count to RX buffer allocation

2006-01-12 Thread Jeff Kirsher


Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000.h  |9 +++--
 drivers/net/e1000/e1000_main.c |   68 +++-
 2 files changed, 51 insertions(+), 26 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index d95a5f8..27c7730 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -304,14 +304,15 @@ struct e1000_adapter {
/* RX */
 #ifdef CONFIG_E1000_NAPI
boolean_t (*clean_rx) (struct e1000_adapter *adapter,
-  struct e1000_rx_ring *rx_ring,
-  int *work_done, int work_to_do);
+  struct e1000_rx_ring 
*rx_ring,
+  int *work_done, int 
work_to_do);
 #else
boolean_t (*clean_rx) (struct e1000_adapter *adapter,
-  struct e1000_rx_ring *rx_ring);
+  struct e1000_rx_ring 
*rx_ring);
 #endif
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
- struct e1000_rx_ring *rx_ring);
+ struct e1000_rx_ring *rx_ring,
+ int cleaned_count);
struct e1000_rx_ring *rx_ring;  /* One per active queue */
 #ifdef CONFIG_E1000_NAPI
struct net_device *polling_netdev;  /* One per active queue */
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 53f87fe..72a8009 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -171,9 +171,11 @@ static boolean_t e1000_clean_rx_irq_ps(s
struct e1000_rx_ring *rx_ring);
 #endif
 static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
-   struct e1000_rx_ring *rx_ring);
+   struct e1000_rx_ring *rx_ring,
+  int cleaned_count);
 static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
-  struct e1000_rx_ring *rx_ring);
+  struct e1000_rx_ring *rx_ring,
+ int cleaned_count);
 static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
 static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
   int cmd);
@@ -411,8 +413,12 @@ e1000_up(struct e1000_adapter *adapter)
e1000_configure_tx(adapter);
e1000_setup_rctl(adapter);
e1000_configure_rx(adapter);
+   /* call E1000_DESC_UNUSED which always leaves
+* at least 1 descriptor unused to make sure
+* next_to_use != next_to_clean */
for (i = 0; i < adapter->num_rx_queues; i++) {
-   adapter->alloc_rx_buf(adapter, &adapter->rx_ring[i]);
+   struct e1000_rx_ring *ring = &adapter->rx_ring[i];
+   adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring));
}
 
 #ifdef CONFIG_PCI_MSI
@@ -2119,7 +2125,9 @@ e1000_leave_82542_rst(struct e1000_adapt
 
if(netif_running(netdev)) {
e1000_configure_rx(adapter);
-   e1000_alloc_rx_buffers(adapter, &adapter->rx_ring[0]);
+   /* No need to loop, because 82542 supports only 1 queue */
+   struct e1000_rx_ring *ring = &adapter->rx_ring[0];
+   adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring));
}
 }
 
@@ -3539,6 +3547,7 @@ e1000_clean_rx_irq(struct e1000_adapter 
uint8_t last_byte;
unsigned int i;
boolean_t cleaned = FALSE;
+   int cleaned_count = 0;
 
i = rx_ring->next_to_clean;
rx_desc = E1000_RX_DESC(*rx_ring, i);
@@ -3550,11 +3559,10 @@ e1000_clean_rx_irq(struct e1000_adapter 
break;
(*work_done)++;
 #endif
-   cleaned = TRUE;
 
-   pci_unmap_single(pdev,
-buffer_info->dma,
-buffer_info->length,
+   cleaned = TRUE;
+   cleaned_count++;
+   pci_unmap_single(pdev, buffer_info->dma, buffer_info->length,
 PCI_DMA_FROMDEVICE);
 
skb = buffer_info->skb;
@@ -3573,8 +3581,7 @@ e1000_clean_rx_irq(struct e1000_adapter 
if(TBI_ACCEPT(&adapter->hw, rx_desc->status,
  rx_desc->errors, length, last_byte)) {
spin_lock_irqsave(&adapter->stats_lock, flags);
-   e1000_tbi_adjust_stats(&adapter->hw,
-  &adapter->stats,
+

[PATCH netdev-2.6 32/39] Added disable packet split capability

2006-01-12 Thread Jeff Kirsher
Adds the ability to disability packet split at compile time and use the legacy 
receive path on PCI express hardware.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index bef4d9d..33e8b45 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1621,7 +1621,7 @@ e1000_setup_rctl(struct e1000_adapter *a
 {
uint32_t rctl, rfctl;
uint32_t psrctl = 0;
-#ifdef CONFIG_E1000_PACKET_SPLIT
+#ifndef DISABLE_PACKET_SPLIT
uint32_t pages = 0;
 #endif
 
@@ -1672,7 +1672,7 @@ e1000_setup_rctl(struct e1000_adapter *a
}
}
 
-#ifdef CONFIG_E1000_PACKET_SPLIT
+#ifndef DISABLE_PACKET_SPLIT
/* 82571 and greater support packet-split where the protocol
 * header is placed in skb->data and the packet data is
 * placed in pages hanging off of skb_shinfo(skb)->nr_frags.

-
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 netdev-2.6 12/39] Fix PHY reset when blocked

2006-01-12 Thread Jeff Kirsher


Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 45fa386..bb9d00e 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -838,6 +838,11 @@ e1000_setup_link(struct e1000_hw *hw)
 
 DEBUGFUNC("e1000_setup_link");
 
+/* In the case of the phy reset being blocked, we already have a link.
+ * We do not have to set it up again. */
+if (e1000_check_phy_reset_block(hw))
+return E1000_SUCCESS;
+
 /* Read and store word 0x0F of the EEPROM. This word contains bits
  * that determine the hardware's default PAUSE (flow control) mode,
  * a bit that determines whether the HW defaults to enabling or

-
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 netdev-2.6 17/39] Fix TX timeout logic

2006-01-12 Thread Jeff Kirsher
Fixed the TX timeout logic to use "end of packet" rather than "next to clean".  
Updated message log.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   16 ++--
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 41f44a3..d2e77ee 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3403,15 +3403,13 @@ e1000_clean_tx_irq(struct e1000_adapter 
/* Detect a transmit hang in hardware, this serializes the
 * check with the clearing of time_stamp and movement of i */
adapter->detect_tx_hung = FALSE;
-   if (tx_ring->buffer_info[i].dma &&
-   time_after(jiffies, tx_ring->buffer_info[i].time_stamp + HZ)
+   if (tx_ring->buffer_info[eop].dma &&
+   time_after(jiffies, tx_ring->buffer_info[eop].time_stamp +
+  adapter->tx_timeout_factor * HZ)
&& !(E1000_READ_REG(&adapter->hw, STATUS) &
-   E1000_STATUS_TXOFF)) {
+E1000_STATUS_TXOFF)) {
 
/* detected Tx unit hang */
-   i = tx_ring->next_to_clean;
-   eop = tx_ring->buffer_info[i].next_to_watch;
-   eop_desc = E1000_TX_DESC(*tx_ring, eop);
DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n"
"  Tx Queue <%lu>\n"
"  TDH  <%x>\n"
@@ -3419,7 +3417,6 @@ e1000_clean_tx_irq(struct e1000_adapter 
"  next_to_use  <%x>\n"
"  next_to_clean<%x>\n"
"buffer_info[next_to_clean]\n"
-   "  dma  <%llx>\n"
"  time_stamp   <%lx>\n"
"  next_to_watch<%x>\n"
"  jiffies  <%lx>\n"
@@ -3429,9 +3426,8 @@ e1000_clean_tx_irq(struct e1000_adapter 
readl(adapter->hw.hw_addr + tx_ring->tdh),
readl(adapter->hw.hw_addr + tx_ring->tdt),
tx_ring->next_to_use,
-   i,
-   (unsigned long long)tx_ring->buffer_info[i].dma,
-   tx_ring->buffer_info[i].time_stamp,
+   tx_ring->next_to_clean,
+   tx_ring->buffer_info[eop].time_stamp,
eop,
jiffies,
eop_desc->upper.fields.status);

-
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 netdev-2.6 09/39] Fix adapter structure and prepare for multique fix

2006-01-12 Thread Jeff Kirsher
Fix adapter structure to handle multiple queues and prepping the driver for 
full multiple queue support, some changes are ifdef'd our unless you define 
CONFIG_E1000_MQ.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000.h |5 ++
 drivers/net/e1000/e1000_ethtool.c |8 ++--
 drivers/net/e1000/e1000_hw.h  |1 
 drivers/net/e1000/e1000_main.c|   76 +
 drivers/net/e1000/e1000_param.c   |4 +-
 5 files changed, 55 insertions(+), 39 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 4dd1326..5940f7a 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -268,6 +268,7 @@ struct e1000_adapter {
 #ifdef CONFIG_E1000_MQ
struct e1000_tx_ring **cpu_tx_ring; /* per-cpu */
 #endif
+   unsigned long tx_queue_len;
uint32_t txd_cmd;
uint32_t tx_int_delay;
uint32_t tx_abs_int_delay;
@@ -303,7 +304,8 @@ struct e1000_adapter {
struct call_async_data_struct rx_sched_call_data;
int cpu_for_queue[4];
 #endif
-   int num_queues;
+   int num_tx_queues;
+   int num_rx_queues;
 
uint64_t hw_csum_err;
uint64_t hw_csum_good;
@@ -336,6 +338,7 @@ struct e1000_adapter {
struct e1000_rx_ring test_rx_ring;
 
 
+   u32 *config_space;
int msg_enable;
 #ifdef CONFIG_PCI_MSI
boolean_t have_msi;
diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index 54ae880..fa9a465 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -614,8 +614,8 @@ e1000_set_ringparam(struct net_device *n
struct e1000_rx_ring *rxdr, *rx_old, *rx_new;
int i, err, tx_ring_size, rx_ring_size;
 
-   tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_queues;
-   rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_queues;
+   tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues;
+   rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues;
 
if (netif_running(adapter->netdev))
e1000_down(adapter);
@@ -654,10 +654,10 @@ e1000_set_ringparam(struct net_device *n
E1000_MAX_TXD : E1000_MAX_82544_TXD));
E1000_ROUNDUP(txdr->count, REQ_TX_DESCRIPTOR_MULTIPLE); 
 
-   for (i = 0; i < adapter->num_queues; i++) {
+   for (i = 0; i < adapter->num_tx_queues; i++)
txdr[i].count = txdr->count;
+   for (i = 0; i < adapter->num_rx_queues; i++)
rxdr[i].count = rxdr->count;
-   }
 
if(netif_running(adapter->netdev)) {
/* Try to get new resources before deleting old */
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 7caa357..1ddfd56 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1497,6 +1497,7 @@ struct e1000_hw {
 #define E1000_CTRL_EXT_EE_RST0x2000 /* Reinitialize from EEPROM */
 #define E1000_CTRL_EXT_IPS   0x4000 /* Invert Power State */
 #define E1000_CTRL_EXT_SPD_BYPS  0x8000 /* Speed Select Bypass */
+#define E1000_CTRL_EXT_RO_DIS0x0002 /* Relaxed Ordering disable */
 #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C0
 #define E1000_CTRL_EXT_LINK_MODE_GMII 0x
 #define E1000_CTRL_EXT_LINK_MODE_TBI  0x00C0
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 5f848b3..540c856 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -411,8 +411,9 @@ e1000_up(struct e1000_adapter *adapter)
e1000_configure_tx(adapter);
e1000_setup_rctl(adapter);
e1000_configure_rx(adapter);
-   for (i = 0; i < adapter->num_queues; i++)
+   for (i = 0; i < adapter->num_rx_queues; i++) {
adapter->alloc_rx_buf(adapter, &adapter->rx_ring[i]);
+   }
 
 #ifdef CONFIG_PCI_MSI
if(adapter->hw.mac_type > e1000_82547_rev_2) {
@@ -867,7 +868,7 @@ e1000_remove(struct pci_dev *pdev)
 
unregister_netdev(netdev);
 #ifdef CONFIG_E1000_NAPI
-   for (i = 0; i < adapter->num_queues; i++)
+   for (i = 0; i < adapter->num_rx_queues; i++)
__dev_put(&adapter->polling_netdev[i]);
 #endif
 
@@ -972,15 +973,25 @@ e1000_sw_init(struct e1000_adapter *adap
switch (hw->mac_type) {
case e1000_82571:
case e1000_82572:
-   adapter->num_queues = 2;
+   /* These controllers support 2 tx queues, but with a single
+* qdisc implementation, multiple tx queues aren't quite as
+* interesting.  If we can find a logical way of mapping
+* flows to a queue, then perhaps we can up the num_tx_queue
+* count back to its default.  Until then, we run the risk of
+* terrible performa

[PATCH netdev-2.6 21/39] Fix __pskb_pull_tail

2006-01-12 Thread Jeff Kirsher
Fixed by moving code to correct location (for 82572 and 82571 controllers).

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   15 +++
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 36b04d4..dd3d323 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2834,6 +2834,13 @@ e1000_xmit_frame(struct sk_buff *skb, st
if (skb->data_len && (hdr_len == (skb->len - skb->data_len)) &&
(adapter->hw.mac_type == e1000_82571 ||
adapter->hw.mac_type == e1000_82572)) {
+   unsigned int pull_size;
+   pull_size = min((unsigned int)4, skb->data_len);
+   if (!__pskb_pull_tail(skb, pull_size)) {
+   printk(KERN_ERR "__pskb_pull_tail failed.\n");
+   dev_kfree_skb_any(skb);
+   return -EFAULT;
+   }
len = skb->len - skb->data_len;
}
}
@@ -2873,14 +2880,6 @@ e1000_xmit_frame(struct sk_buff *skb, st
if(adapter->pcix_82544)
count += nr_frags;
 
-   unsigned int pull_size;
-   pull_size = min((unsigned int)4, skb->data_len);
-   if (!__pskb_pull_tail(skb, pull_size)) {
-   printk(KERN_ERR "__pskb_pull_tail failed.\n");
-   dev_kfree_skb_any(skb);
-   return -EFAULT;
-   }
-
if(adapter->hw.tx_pkt_filtering && (adapter->hw.mac_type == 
e1000_82573) )
e1000_transfer_dhcp_info(adapter, skb);
 

-
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 netdev-2.6 31/39] Added copy break code

2006-01-12 Thread Jeff Kirsher
Improves small packet performance with large amounts of reassembly being done 
in the stack.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   59 
 1 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 8207db4..bef4d9d 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -420,7 +420,8 @@ e1000_up(struct e1000_adapter *adapter)
 * next_to_use != next_to_clean */
for (i = 0; i < adapter->num_rx_queues; i++) {
struct e1000_rx_ring *ring = &adapter->rx_ring[i];
-   adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring));
+   adapter->alloc_rx_buf(adapter, ring,
+ E1000_DESC_UNUSED(ring));
}
 
 #ifdef CONFIG_PCI_MSI
@@ -3567,23 +3568,26 @@ e1000_clean_rx_irq(struct e1000_adapter 
uint32_t length;
uint8_t last_byte;
unsigned int i;
-   boolean_t cleaned = FALSE;
int cleaned_count = 0;
+   boolean_t cleaned = FALSE, multi_descriptor = FALSE;
 
i = rx_ring->next_to_clean;
rx_desc = E1000_RX_DESC(*rx_ring, i);
 
while(rx_desc->status & E1000_RXD_STAT_DD) {
buffer_info = &rx_ring->buffer_info[i];
+   u8 status;
 #ifdef CONFIG_E1000_NAPI
if(*work_done >= work_to_do)
break;
(*work_done)++;
 #endif
-
+   status = rx_desc->status;
cleaned = TRUE;
cleaned_count++;
-   pci_unmap_single(pdev, buffer_info->dma, buffer_info->length,
+   pci_unmap_single(pdev,
+buffer_info->dma,
+buffer_info->length,
 PCI_DMA_FROMDEVICE);
 
skb = buffer_info->skb;
@@ -3602,7 +3606,8 @@ e1000_clean_rx_irq(struct e1000_adapter 
if(TBI_ACCEPT(&adapter->hw, rx_desc->status,
  rx_desc->errors, length, last_byte)) {
spin_lock_irqsave(&adapter->stats_lock, flags);
-   e1000_tbi_adjust_stats(&adapter->hw, 
&adapter->stats,
+   e1000_tbi_adjust_stats(&adapter->hw,
+  &adapter->stats,
   length, skb->data);
spin_unlock_irqrestore(&adapter->stats_lock,
   flags);
@@ -3613,17 +3618,40 @@ e1000_clean_rx_irq(struct e1000_adapter 
}
}
 
-   /* Good Receive */
-   skb_put(skb, length - ETHERNET_FCS_SIZE);
+   /* code added for copybreak, this should improve
+* performance for small packets with large amounts
+* of reassembly being done in the stack */
+#define E1000_CB_LENGTH 256
+   if ((length < E1000_CB_LENGTH) &&
+  !rx_ring->rx_skb_top &&
+  /* or maybe (status & E1000_RXD_STAT_EOP) && */
+  !multi_descriptor) {
+   struct sk_buff *new_skb =
+   dev_alloc_skb(length + NET_IP_ALIGN);
+   if (new_skb) {
+   skb_reserve(new_skb, NET_IP_ALIGN);
+   new_skb->dev = netdev;
+   memcpy(new_skb->data - NET_IP_ALIGN,
+  skb->data - NET_IP_ALIGN,
+  length + NET_IP_ALIGN);
+   /* save the skb in buffer_info as good */
+   buffer_info->skb = skb;
+   skb = new_skb;
+   skb_put(skb, length);
+   }
+   }
+
+   /* end copybreak code */
 
/* Receive Checksum Offload */
-   e1000_rx_checksum(adapter, (uint32_t)(rx_desc->status) |
+   e1000_rx_checksum(adapter,
+ (uint32_t)(status) |
  ((uint32_t)(rx_desc->errors) << 24),
  rx_desc->csum, skb);
skb->protocol = eth_type_trans(skb, netdev);
 #ifdef CONFIG_E1000_NAPI
if(unlikely(adapter->vlgrp &&
-   (rx_desc->status & E1000_RXD_STAT_VP))) {
+   (status & E1000_RXD_STAT_VP))) {
vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
 le16_to_cpu(rx_desc->special) &
   

[PATCH netdev-2.6 19/39] Fix bit 22 (TXDCTL) for 82571 & 82572 controllers

2006-01-12 Thread Jeff Kirsher
Removed duplicate code, TXDCTL and TXDCTL_COUNT_DESC are the same bit and there 
is no need to set it twice.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 19a0b2a..f79d2a0 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -735,7 +735,6 @@ e1000_init_hw(struct e1000_hw *hw)
 break;
 case e1000_82571:
 case e1000_82572:
-ctrl |= (1 << 22);
 case e1000_82573:
 ctrl |= E1000_TXDCTL_COUNT_DESC;
 break;

-
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 netdev-2.6 14/39] Fix flow control water marks

2006-01-12 Thread Jeff Kirsher
Fixed flow control water marks based on PBA size.
Store flow control state in original_fc in addition to fc.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c  |   21 +++--
 drivers/net/e1000/e1000_param.c |2 +-
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4016264..cefc7cc 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -504,10 +504,8 @@ e1000_down(struct e1000_adapter *adapter
 void
 e1000_reset(struct e1000_adapter *adapter)
 {
-   struct net_device *netdev = adapter->netdev;
uint32_t pba, manc;
uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
-   uint16_t fc_low_water_mark = E1000_FC_LOW_DIFF;
 
/* Repartition Pba for greater than 9k mtu
 * To take effect CTRL.RST is required.
@@ -531,15 +529,8 @@ e1000_reset(struct e1000_adapter *adapte
}
 
if((adapter->hw.mac_type != e1000_82573) &&
-  (adapter->netdev->mtu > E1000_RXBUFFER_8192)) {
+  (adapter->netdev->mtu > E1000_RXBUFFER_8192))
pba -= 8; /* allocate more FIFO for Tx */
-   /* send an XOFF when there is enough space in the
-* Rx FIFO to hold one extra full size Rx packet 
-   */
-   fc_high_water_mark = netdev->mtu + ENET_HEADER_SIZE + 
-   ETHERNET_FCS_SIZE + 1;
-   fc_low_water_mark = fc_high_water_mark + 8;
-   }
 
 
if(adapter->hw.mac_type == e1000_82547) {
@@ -553,10 +544,12 @@ e1000_reset(struct e1000_adapter *adapte
E1000_WRITE_REG(&adapter->hw, PBA, pba);
 
/* flow control settings */
-   adapter->hw.fc_high_water = (pba << E1000_PBA_BYTES_SHIFT) -
-   fc_high_water_mark;
-   adapter->hw.fc_low_water = (pba << E1000_PBA_BYTES_SHIFT) -
-  fc_low_water_mark;
+   /* Set the FC high water mark to 90% of the FIFO size.
+* Required to clear last 3 LSB */
+   fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8;
+
+   adapter->hw.fc_high_water = fc_high_water_mark;
+   adapter->hw.fc_low_water = fc_high_water_mark - 8;
adapter->hw.fc_pause_time = E1000_FC_PAUSE_TIME;
adapter->hw.fc_send_xon = 1;
adapter->hw.fc = adapter->hw.original_fc;
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index eb3f009..37fbb56 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -388,7 +388,7 @@ e1000_check_options(struct e1000_adapter
e1000_validate_option(&fc, &opt, adapter);
adapter->hw.fc = adapter->hw.original_fc = fc;
} else {
-   adapter->hw.fc = opt.def;
+   adapter->hw.fc = adapter->hw.original_fc = opt.def;
}
}
{ /* Transmit Interrupt Delay */

-
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 netdev-2.6 30/39] Added variable to handle return values for pci_enable_* functions

2006-01-12 Thread Jeff Kirsher
This was to fix compilation warnings.  Also added log messages when 
pci_enable_* functions return with an error.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   44 ++--
 1 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 75cd6df..8207db4 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4382,6 +4382,7 @@ e1000_suspend(struct pci_dev *pdev, pm_m
struct e1000_adapter *adapter = netdev_priv(netdev);
uint32_t ctrl, ctrl_ext, rctl, manc, status;
uint32_t wufc = adapter->wol;
+   int retval = 0;
 
netif_device_detach(netdev);
 
@@ -4427,13 +4428,21 @@ e1000_suspend(struct pci_dev *pdev, pm_m
 
E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN);
E1000_WRITE_REG(&adapter->hw, WUFC, wufc);
-   pci_enable_wake(pdev, 3, 1);
-   pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */
+   retval = pci_enable_wake(pdev, PCI_D3hot, 1);
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
+   retval = pci_enable_wake(pdev, PCI_D3cold, 1);
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
} else {
E1000_WRITE_REG(&adapter->hw, WUC, 0);
E1000_WRITE_REG(&adapter->hw, WUFC, 0);
-   pci_enable_wake(pdev, 3, 0);
-   pci_enable_wake(pdev, 4, 0); /* 4 == D3 cold */
+   retval = pci_enable_wake(pdev, PCI_D3hot, 0);
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
+   retval = pci_enable_wake(pdev, PCI_D3cold, 0); /* 4 == D3 cold 
*/
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
}
 
pci_save_state(pdev);
@@ -,8 +4453,12 @@ e1000_suspend(struct pci_dev *pdev, pm_m
if(manc & E1000_MANC_SMBUS_EN) {
manc |= E1000_MANC_ARP_EN;
E1000_WRITE_REG(&adapter->hw, MANC, manc);
-   pci_enable_wake(pdev, 3, 1);
-   pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */
+   retval = pci_enable_wake(pdev, PCI_D3hot, 1);
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
+   retval = pci_enable_wake(pdev, PCI_D3cold, 1);
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error enabling D3 cold 
wake\n");
}
}
 
@@ -4454,7 +4467,10 @@ e1000_suspend(struct pci_dev *pdev, pm_m
e1000_release_hw_control(adapter);
 
pci_disable_device(pdev);
-   pci_set_power_state(pdev, pci_choose_state(pdev, state));
+
+   retval = pci_set_power_state(pdev, pci_choose_state(pdev, state));
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error in setting power state\n");
 
return 0;
 }
@@ -4464,15 +4480,21 @@ e1000_resume(struct pci_dev *pdev)
 {
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
+   int retval;
uint32_t manc, ret_val;
 
-   pci_set_power_state(pdev, PCI_D0);
-   pci_restore_state(pdev);
+   retval = pci_set_power_state(pdev, PCI_D0);
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error in setting power state\n");
ret_val = pci_enable_device(pdev);
pci_set_master(pdev);
 
-   pci_enable_wake(pdev, PCI_D3hot, 0);
-   pci_enable_wake(pdev, PCI_D3cold, 0);
+   retval = pci_enable_wake(pdev, PCI_D3hot, 0);
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
+   retval = pci_enable_wake(pdev, PCI_D3cold, 0);
+   if (retval)
+   DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
 
e1000_reset(adapter);
E1000_WRITE_REG(&adapter->hw, WUS, ~0);

-
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 netdev-2.6 03/39] General Fixes

2006-01-12 Thread Jeff Kirsher
These fixes update the TX and RX ring structures.  Prepare driver for up-coming 
fixes.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000.h  |8 ++--
 drivers/net/e1000/e1000_main.c |   14 +-
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index e02e9ba..c87187d 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -191,7 +191,6 @@ struct e1000_tx_ring {
spinlock_t tx_lock;
uint16_t tdh;
uint16_t tdt;
-   uint64_t pkt;
 
boolean_t last_tx_tso;
 
@@ -216,9 +215,14 @@ struct e1000_rx_ring {
struct e1000_ps_page *ps_page;
struct e1000_ps_page_dma *ps_page_dma;
 
+   struct sk_buff *rx_skb_top;
+   struct sk_buff *rx_skb_prev;
+
+   /* cpu for rx queue */
+   int cpu;
+
uint16_t rdh;
uint16_t rdt;
-   uint64_t pkt;
 };
 
 #define E1000_DESC_UNUSED(R) \
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4945a41..22c8286 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2204,7 +2204,7 @@ static void
 e1000_watchdog_task(struct e1000_adapter *adapter)
 {
struct net_device *netdev = adapter->netdev;
-   struct e1000_tx_ring *txdr = &adapter->tx_ring[0];
+   struct e1000_tx_ring *txdr = adapter->tx_ring;
uint32_t link;
 
e1000_check_for_link(&adapter->hw);
@@ -2314,6 +2314,7 @@ e1000_tso(struct e1000_adapter *adapter,
 {
 #ifdef NETIF_F_TSO
struct e1000_context_desc *context_desc;
+   struct e1000_buffer *buffer_info;
unsigned int i;
uint32_t cmd_length = 0;
uint16_t ipcse = 0, tucse, mss;
@@ -2363,6 +2364,7 @@ e1000_tso(struct e1000_adapter *adapter,
 
i = tx_ring->next_to_use;
context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
+   buffer_info = &tx_ring->buffer_info[i];
 
context_desc->lower_setup.ip_fields.ipcss  = ipcss;
context_desc->lower_setup.ip_fields.ipcso  = ipcso;
@@ -2374,6 +2376,8 @@ e1000_tso(struct e1000_adapter *adapter,
context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
context_desc->cmd_and_length = cpu_to_le32(cmd_length);
 
+   buffer_info->time_stamp = jiffies;
+
if (++i == tx_ring->count) i = 0;
tx_ring->next_to_use = i;
 
@@ -2389,6 +2393,7 @@ e1000_tx_csum(struct e1000_adapter *adap
   struct sk_buff *skb)
 {
struct e1000_context_desc *context_desc;
+   struct e1000_buffer *buffer_info;
unsigned int i;
uint8_t css;
 
@@ -2396,6 +2401,7 @@ e1000_tx_csum(struct e1000_adapter *adap
css = skb->h.raw - skb->data;
 
i = tx_ring->next_to_use;
+   buffer_info = &tx_ring->buffer_info[i];
context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
 
context_desc->upper_setup.tcp_fields.tucss = css;
@@ -2404,6 +2410,8 @@ e1000_tx_csum(struct e1000_adapter *adap
context_desc->tcp_seg_setup.data = 0;
context_desc->cmd_and_length = cpu_to_le32(E1000_TXD_CMD_DEXT);
 
+   buffer_info->time_stamp = jiffies;
+
if (unlikely(++i == tx_ring->count)) i = 0;
tx_ring->next_to_use = i;
 
@@ -3255,8 +3263,6 @@ e1000_clean_tx_irq(struct e1000_adapter 
if(unlikely(++i == tx_ring->count)) i = 0;
}
 
-   tx_ring->pkt++;
-   
eop = tx_ring->buffer_info[i].next_to_watch;
eop_desc = E1000_TX_DESC(*tx_ring, eop);
}
@@ -3461,7 +3467,6 @@ e1000_clean_rx_irq(struct e1000_adapter 
}
 #endif /* CONFIG_E1000_NAPI */
netdev->last_rx = jiffies;
-   rx_ring->pkt++;
 
 next_desc:
rx_desc->status = 0;
@@ -3592,7 +3597,6 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
}
 #endif /* CONFIG_E1000_NAPI */
netdev->last_rx = jiffies;
-   rx_ring->pkt++;
 
 next_desc:
rx_desc->wb.middle.status_error &= ~0xFF;

-
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 netdev-2.6 11/39] Fix loopback logic

2006-01-12 Thread Jeff Kirsher
Fixed the loopback logic to work for the PCI express adapters.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_ethtool.c |   70 -
 1 files changed, 46 insertions(+), 24 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index ffdf76b..ceb9cd0 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1326,22 +1326,33 @@ e1000_set_phy_loopback(struct e1000_adap
 static int
 e1000_setup_loopback_test(struct e1000_adapter *adapter)
 {
+   struct e1000_hw *hw = &adapter->hw;
uint32_t rctl;
 
-   if(adapter->hw.media_type == e1000_media_type_fiber ||
-  adapter->hw.media_type == e1000_media_type_internal_serdes) {
-   if(adapter->hw.mac_type == e1000_82545 ||
-  adapter->hw.mac_type == e1000_82546 ||
-  adapter->hw.mac_type == e1000_82545_rev_3 ||
-  adapter->hw.mac_type == e1000_82546_rev_3)
+   if (hw->media_type == e1000_media_type_fiber ||
+   hw->media_type == e1000_media_type_internal_serdes) {
+   switch (hw->mac_type) {
+   case e1000_82545:
+   case e1000_82546:
+   case e1000_82545_rev_3:
+   case e1000_82546_rev_3:
return e1000_set_phy_loopback(adapter);
-   else {
-   rctl = E1000_READ_REG(&adapter->hw, RCTL);
+   break;
+   case e1000_82571:
+   case e1000_82572:
+#define E1000_SERDES_LB_ON 0x410
+   e1000_set_phy_loopback(adapter);
+   E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_ON);
+   msec_delay(10);
+   return 0;
+   break;
+   default:
+   rctl = E1000_READ_REG(hw, RCTL);
rctl |= E1000_RCTL_LBM_TCVR;
-   E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
+   E1000_WRITE_REG(hw, RCTL, rctl);
return 0;
}
-   } else if(adapter->hw.media_type == e1000_media_type_copper)
+   } else if (hw->media_type == e1000_media_type_copper)
return e1000_set_phy_loopback(adapter);
 
return 7;
@@ -1350,27 +1361,38 @@ e1000_setup_loopback_test(struct e1000_a
 static void
 e1000_loopback_cleanup(struct e1000_adapter *adapter)
 {
+   struct e1000_hw *hw = &adapter->hw;
uint32_t rctl;
uint16_t phy_reg;
 
-   rctl = E1000_READ_REG(&adapter->hw, RCTL);
+   rctl = E1000_READ_REG(hw, RCTL);
rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
-   E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
+   E1000_WRITE_REG(hw, RCTL, rctl);
 
-   if(adapter->hw.media_type == e1000_media_type_copper ||
-  ((adapter->hw.media_type == e1000_media_type_fiber ||
-adapter->hw.media_type == e1000_media_type_internal_serdes) &&
-   (adapter->hw.mac_type == e1000_82545 ||
-adapter->hw.mac_type == e1000_82546 ||
-adapter->hw.mac_type == e1000_82545_rev_3 ||
-adapter->hw.mac_type == e1000_82546_rev_3))) {
-   adapter->hw.autoneg = TRUE;
-   e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &phy_reg);
-   if(phy_reg & MII_CR_LOOPBACK) {
+   switch (hw->mac_type) {
+   case e1000_82571:
+   case e1000_82572:
+   if (hw->media_type == e1000_media_type_fiber ||
+   hw->media_type == e1000_media_type_internal_serdes) {
+#define E1000_SERDES_LB_OFF 0x400
+   E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_OFF);
+   msec_delay(10);
+   break;
+   }
+   /* Fall Through */
+   case e1000_82545:
+   case e1000_82546:
+   case e1000_82545_rev_3:
+   case e1000_82546_rev_3:
+   default:
+   hw->autoneg = TRUE;
+   e1000_read_phy_reg(hw, PHY_CTRL, &phy_reg);
+   if (phy_reg & MII_CR_LOOPBACK) {
phy_reg &= ~MII_CR_LOOPBACK;
-   e1000_write_phy_reg(&adapter->hw, PHY_CTRL, phy_reg);
-   e1000_phy_reset(&adapter->hw);
+   e1000_write_phy_reg(hw, PHY_CTRL, phy_reg);
+   e1000_phy_reset(hw);
}
+   break;
}
 }
 

-
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 netdev-2.6 22/39] Fix VLAN support

2006-01-12 Thread Jeff Kirsher
Fixed VLAN support by switching control over to the firmware.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index dd3d323..8190eb0 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4245,8 +4245,12 @@ e1000_vlan_rx_kill_vid(struct net_device
 
if((adapter->hw.mng_cookie.status &
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
-   (vid == adapter->mng_vlan_id))
+   (vid == adapter->mng_vlan_id)) {
+   /* release control to f/w */
+   e1000_release_hw_control(adapter);
return;
+   }
+
/* remove VID from filter table */
index = (vid >> 5) & 0x7F;
vfta = E1000_READ_REG_ARRAY(&adapter->hw, VFTA, index);

-
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 netdev-2.6 05/39] Fix ASF/AMT for 8257{1|2|3} controllers

2006-01-12 Thread Jeff Kirsher
The 82573 controller required different logic than 82571|2 controllers.  
Corrected the reset logic for 8257{1|2|3} controllers.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.c   |2 
 drivers/net/e1000/e1000_main.c |  175 
 2 files changed, 107 insertions(+), 70 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 136fc03..f853e10 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -2982,6 +2982,8 @@ e1000_phy_hw_reset(struct e1000_hw *hw)
 
 if (hw->mac_type < e1000_82571) 
 msec_delay(10);
+else
+udelay(100);
 
 E1000_WRITE_REG(hw, CTRL, ctrl);
 E1000_WRITE_FLUSH(hw);
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 66cf174..5b42871 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -319,7 +319,75 @@ e1000_update_mng_vlan(struct e1000_adapt
}
}
 }
-   
+
+/**
+ * e1000_release_hw_control - release control of the h/w to f/w
+ * @adapter: address of board private structure
+ *
+ * e1000_release_hw_control resets {CTRL_EXT|FWSM}:DRV_LOAD bit.
+ * For ASF and Pass Through versions of f/w this means that the
+ * driver is no longer loaded. For AMT version (only with 82573) i
+ * of the f/w this means that the netowrk i/f is closed.
+ * 
+ **/
+
+static inline void 
+e1000_release_hw_control(struct e1000_adapter *adapter)
+{
+   uint32_t ctrl_ext;
+   uint32_t swsm;
+
+   /* Let firmware taken over control of h/w */
+   switch (adapter->hw.mac_type) {
+   case e1000_82571:
+   case e1000_82572:
+   ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
+   E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
+   ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD);
+   break;
+   case e1000_82573:
+   swsm = E1000_READ_REG(&adapter->hw, SWSM);
+   E1000_WRITE_REG(&adapter->hw, SWSM,
+   swsm & ~E1000_SWSM_DRV_LOAD);
+   default:
+   break;
+   }
+}
+
+/**
+ * e1000_get_hw_control - get control of the h/w from f/w
+ * @adapter: address of board private structure
+ *
+ * e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit.
+ * For ASF and Pass Through versions of f/w this means that 
+ * the driver is loaded. For AMT version (only with 82573) 
+ * of the f/w this means that the netowrk i/f is open.
+ * 
+ **/
+
+static inline void 
+e1000_get_hw_control(struct e1000_adapter *adapter)
+{
+   uint32_t ctrl_ext;
+   uint32_t swsm;
+   /* Let firmware know the driver has taken over */
+   switch (adapter->hw.mac_type) {
+   case e1000_82571:
+   case e1000_82572:
+   ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
+   E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
+   ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
+   break;
+   case e1000_82573:
+   swsm = E1000_READ_REG(&adapter->hw, SWSM);
+   E1000_WRITE_REG(&adapter->hw, SWSM,
+   swsm | E1000_SWSM_DRV_LOAD);
+   break;
+   default:
+   break;
+   }
+}
+
 int
 e1000_up(struct e1000_adapter *adapter)
 {
@@ -523,8 +591,6 @@ e1000_probe(struct pci_dev *pdev,
struct net_device *netdev;
struct e1000_adapter *adapter;
unsigned long mmio_start, mmio_len;
-   uint32_t ctrl_ext;
-   uint32_t swsm;
 
static int cards_found = 0;
int i, err, pci_using_dac;
@@ -736,22 +802,13 @@ e1000_probe(struct pci_dev *pdev,
/* reset the hardware with the new settings */
e1000_reset(adapter);
 
-   /* Let firmware know the driver has taken over */
-   switch(adapter->hw.mac_type) {
-   case e1000_82571:
-   case e1000_82572:
-   ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
-   E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
-   ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
-   break;
-   case e1000_82573:
-   swsm = E1000_READ_REG(&adapter->hw, SWSM);
-   E1000_WRITE_REG(&adapter->hw, SWSM,
-   swsm | E1000_SWSM_DRV_LOAD);
-   break;
-   default:
-   break;
-   }
+   /* If the controller is 82573 and f/w is AMT, do not set
+* DRV_LOAD until the interface is up.  For all other cases,
+* let the f/w know that the h/w is now under the control
+* of the driver. */
+   if (adapter->hw.mac_type != e1000_82573 ||
+   !e1000_check_mng_mode(&adapter->hw))
+   e1000_get_hw_control(adapter);
 
strcpy(netdev->name, "eth%d");

[PATCH netdev-2.6 34/39] Removed unused variables and initialized variables

2006-01-12 Thread Jeff Kirsher


Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c  |2 +-
 drivers/net/e1000/e1000_param.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 95cd969..57a5ce2 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3364,7 +3364,7 @@ e1000_clean(struct net_device *poll_dev,
 {
struct e1000_adapter *adapter;
int work_to_do = min(*budget, poll_dev->quota);
-   int tx_cleaned, i = 0, work_done = 0;
+   int tx_cleaned = 0, i = 0, work_done = 0;
 
/* Must NOT use netdev_priv macro here. */
adapter = poll_dev->priv;
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 37fbb56..1c70aef 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -177,7 +177,7 @@ E1000_PARAM(RxAbsIntDelay, "Receive Abso
  *
  * Valid Range: 100-10 (0=off, 1=dynamic)
  *
- * Default Value: 1
+ * Default Value: 8000
  */
 
 E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");

-
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: [ZD1211] Uli's code

2006-01-12 Thread Ulrich Kunitz
Daniel,

just to add something about the website, the list about the
devices with the chip was very useful. It helped me to buy an
additional dongle for development. The other ZD1211 is inside my
Shuttle and the Zydas driver didn't work at 64 bit. Under the 32
bit it didn't work as expected ;-). It connected to a neighbour's
network regardless what ESSID I have been setting. At least Zydas
published their code under the GPL, so we have a chance to find
out, what the driver is doing. Linux drivers for other WLAN USB
dongles are delivered with a big library object and a source kernel
interface.

Daniel Drake wrote:

> How do you feel about the current design of your driver?

I feel it is quite right for the task to understand the chip and
getting an idea, what is going on. If that would not be a problem,
I would not be so explicit. You could discuss for instance the
wrapper functions for register accesses.

The idea is currently to separate the USB interface, the chip, the
RF module, the soft mac and the net device. This way I hope to
write a lot of tiny functions, which are easy to understand and
not this function monsters of the original driver (TOD). I looked
at the soft-mac for the broadcom chip, but it didn't brought much
functionality to the table and it had spin locks in every code
path, which means we can't sleep waiting for the URB callbacks or
we have to create asynchronous work queue functions for
everything, making things much more complex. There might be
comparable issues with ieee80211 stack, but it has much more
functionality, so it makes no sense to ignore it. Not using
out-of-kernel modules will make it easier for others to test the
drivers and will increase the chances to get into the kernel.

> I'm wondering whether you have also found the same - have you developed your
> driver and had thoughts that you eventually need to try a new approach?
Yes, I have moved things around quite a bit.
> I'm still picking up
> things, haven't spent a great deal of time looking at the project yet.

Maybe my notes_zd1211.txt could help a little bit and zd_chip.h
might also give some ideas.

Thanks for the pointer regarding the docs. Every piece of
information about the chip, will help to get an idea. For instance
I got some ideas about the RF chip from the data sheet about the
predecessor chip. Otherwise I would not have had any ideas about the
serial interface and that register addresses and values are coded
in one word. I would also like to know, what all the physical
registers are doing and I hope that variance will be not so high
as with the software registers controlled by the firmware.

I agree that the firmware load sequence is strange, TOD has code
which seems to support a kind of auto-address mode, I implemented
it and it didn't work. 

Cheers,

Uli
-- 
Ulrich Kunitz - [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: [git patches] 2.6.x net driver updates

2006-01-12 Thread Adrian Bunk
On Thu, Jan 12, 2006 at 05:42:27PM -0500, Jeff Garzik wrote:
> On Thu, Jan 12, 2006 at 02:30:19PM -0800, Linus Torvalds wrote:
> > 
> > 
> > On Thu, 12 Jan 2006, Jeff Garzik wrote:
> > > 
> > > dann frazier:
> > >   CONFIG_AIRO needs CONFIG_CRYPTO
> > 
> > I think this is done wrong.
> > 
> > It should "select CRYPTO" rather than "depends on CRYPTO".
> 
> OK
>...

What was wrong with my patch [1] that did not only this, but also fixes 
the same bug with AIRO_CS and removes all the #ifdef's for the 
non-compiling CRYPTO=n case from the driver?

>   Jeff

cu
Adrian

[1] http://lkml.org/lkml/2006/1/10/328

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
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] pcnet32: Add PCI_DEVICE macro to pcnet32_pci_tbl

2006-01-12 Thread Jon Mason
This patch adds the PCI_DEVICE macro to the pcnet32 driver.

This has been tested on my opteron with my "trident" adapter.

Thanks,
Jon

Signed-off-by: Jon Mason <[EMAIL PROTECTED]>

diff -r 4a7597b41d25 drivers/net/pcnet32.c
--- a/drivers/net/pcnet32.c Wed Jan 11 19:14:08 2006
+++ b/drivers/net/pcnet32.c Thu Jan 12 15:22:57 2006
@@ -58,13 +58,13 @@
  * PCI device identifiers for "new style" Linux PCI Device Drivers
  */
 static struct pci_device_id pcnet32_pci_tbl[] = {
-{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE_HOME, PCI_ANY_ID, PCI_ANY_ID, 
0, 0, 0 },
-{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, 0, 
0, 0 },
+{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE_HOME), 0, 0, 0},
+{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE), 0, 0, 0},
 /*
  * Adapters that were sold with IBM's RS/6000 or pSeries hardware have
  * the incorrect vendor id.
  */
-{ PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID,
+{ PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_AMD_LANCE), 
PCI_CLASS_NETWORK_ETHERNET << 8, 0x00, 0 },
 { 0, }
 };
-
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: [ZD1211] Uli's code

2006-01-12 Thread Daniel Drake

Ulrich Kunitz wrote:

Well, I even remember browsing your website, but it seems that you
started your project just recently.


Indeed, just a few days ago.


I had a look at your branch/dsd file. Actually the code is quite
comparable. I wouldn't mind to restart with your code, but I have
already some patches in mind. :-) But please take a look at my
code also and write me what you think. No doubt, it makes no sense
to develop two different versions of the driver. We should
definitely join forces.


That's great.

How do you feel about the current design of your driver?

My branch was really just for messing around to figure things out, I've 
had some thoughts about how the driver should/shouldn't be structured 
since then, and I think the way it is written at the moment probably 
won't hold.


I'm wondering whether you have also found the same - have you developed 
your driver and had thoughts that you eventually need to try a new approach?


Or are you happy with the structure you have developed? If so, I think 
we should stick with your code. You have implemented a lot more and it 
looks like you have a much better understanding at this stage (I'm still 
picking up things, haven't spent a great deal of time looking at the 
project yet).



If you could forward me the docs it would be really great. Please
contact me if there is any action required on my side.


Please email [EMAIL PROTECTED] about this. You need to agree that you 
won't ever distribute them.


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: [ZD1211] Uli's code

2006-01-12 Thread Daniel Drake

Ulrich Kunitz wrote:

If you could forward me the docs it would be really great. Please
contact me if there is any action required on my side.


Oh, and for your own good, don't take them seriously! It's not as if 
they are just outdated, they are just plain wrong in parts (look at the 
firmware upload routine for an example). They are also not complete 
enough to write a driver from (despite ZyDAS claiming that their 
'engineers' wrote their driver purely off the specs).


I keep comparing the vendor driver to the specs and getting very 
confused. I've now learned not to do that where possible :)


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


[PKT_SCHED]: Change default clock source to gettimeofday

2006-01-12 Thread Patrick McHardy

Sorry for the repost Dave, I accidentally used the @oss.sgi.com address
in my previous posting.

-

It seems to be a common mistake to use jiffies as clocksource,
which gives very bad results in most cases. This patch changes
the default to gettimeofday.
[PKT_SCHED]: Change default clock source to gettimeofday

The default of using jiffies is very bad and results in underutilization
except with very low bandwidth.

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>

---
commit 99b5071d1db625d970b0eb9403c0cd32ef0d1071
tree 5a1a5dc005b26e0cc78ba253c21ce7c9ff3cc65c
parent e1109d524e3ddbe9e4a4704c829ef1c286a1e944
author Patrick McHardy <[EMAIL PROTECTED]> Thu, 12 Jan 2006 23:55:53 +0100
committer Patrick McHardy <[EMAIL PROTECTED]> Thu, 12 Jan 2006 23:55:53 +0100

 net/sched/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 8a260d4..778b1e5 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -44,7 +44,7 @@ if NET_SCHED
 
 choice
prompt "Packet scheduler clock source"
-   default NET_SCH_CLK_JIFFIES
+   default NET_SCH_CLK_GETTIMEOFDAY
---help---
  Packet schedulers need a monotonic clock that increments at a static
  rate. The kernel provides several suitable interfaces, each with


Re: [git patches] 2.6.x net driver updates

2006-01-12 Thread Andrew Morton
Linus Torvalds <[EMAIL PROTECTED]> wrote:
>
> On Thu, 12 Jan 2006, Jeff Garzik wrote:
>  > 
>  > dann frazier:
>  >   CONFIG_AIRO needs CONFIG_CRYPTO
> 
>  I think this is done wrong.
> 
>  It should "select CRYPTO" rather than "depends on CRYPTO".
> 
>  Otherwise people won't see it just because they don't have crypto enabled, 
>  which is not very user-friendly.
> 

Yes, I think that's much more Aunt-Nellie-friendly, but Roman considers it
abuse of the Kconfig system in ways which I never completely understood?
-
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: [git patches] 2.6.x net driver updates

2006-01-12 Thread Linus Torvalds


On Thu, 12 Jan 2006, Andrew Morton wrote:
> 
> Yes, I think that's much more Aunt-Nellie-friendly, but Roman considers it
> abuse of the Kconfig system in ways which I never completely understood?

Hmm. If Roman dislikes it, he must dislike the fact that we already do 
exactly this for a ton of different things. There's something like 2000+ 
"select" statements in the kernel Kconfig tree, and just grepping for 
"select.*CRYPTO" gets 52 hits..

So this isn't new..

Linus
-
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: [git patches] 2.6.x net driver updates

2006-01-12 Thread Jeff Garzik
On Thu, Jan 12, 2006 at 02:30:19PM -0800, Linus Torvalds wrote:
> 
> 
> On Thu, 12 Jan 2006, Jeff Garzik wrote:
> > 
> > dann frazier:
> >   CONFIG_AIRO needs CONFIG_CRYPTO
> 
> I think this is done wrong.
> 
> It should "select CRYPTO" rather than "depends on CRYPTO".

OK


> Otherwise people won't see it just because they don't have crypto enabled, 
> which is not very user-friendly.
> 
> Btw, why are these casts there? Either the functions are of the right 
> type, or they aren't. In neither case is the cast correct.
> 
> I do realize that there are comments in  that says that 
> you should do the cast, but that's no excuse for crap or stupid code.
> 
> If it's an issue of trying to make greppable code, why not have
> just the comment?
> 
> > @@ -2378,6 +2566,15 @@ static const iw_handler atmel_handler[] 
> > (iw_handler) atmel_get_encode,  /* SIOCGIWENCODE */
> > (iw_handler) atmel_set_power,   /* SIOCSIWPOWER */
> > (iw_handler) atmel_get_power,   /* SIOCGIWPOWER */
> > +   (iw_handler) NULL,  /* -- hole -- */
> > +   (iw_handler) NULL,  /* -- hole -- */
> ...
> 
> Hmm?

Welcome to the awful wireless driver API.  This type crapola is a key
thing that needs changing, but its not the only thing.  There are also
some nasty wireless APIs which do casts based on variable (passed-in)
struct offsets...

This needs to change to a type-safe thingy like struct ethtool_ops, but
the above is what we were lumped with.

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


cls_u32.c

2006-01-12 Thread April, Eric (Satnet)
FYI

Problem found with cls_u32.c ...
Bert has asked me to forward this to this address so it can be taken care
of.

Thanks,

Eric April

-Original Message-
From: April, Eric (Satnet) 
Sent: Thursday, January 12, 2006 4:25 PM
To: '[EMAIL PROTECTED]'
Subject: RE: tc filter


Hello Bert,

Finally, I had to debug the problem in cls_u32.c and found what was causing
me the trouble.

In the u32_classify function, there was the following which was compiled for
me

100 static int u32_classify(struct sk_buff *skb, struct tcf_proto *tp,
struct tcf_result *res)
101 {
102 struct {
103 struct tc_u_knode *knode;
104 u8*ptr;
105 } stack[TC_U32_MAXDEPTH];
106 
107 struct tc_u_hnode *ht = (struct tc_u_hnode*)tp->root;
108 u8 *ptr = skb->nh.raw;
109 struct tc_u_knode *n;
110 int sdepth = 0;
111 int off2 = 0;
112 int sel = 0;
113 int i;
114 
115 #if !defined(__i386__) && !defined(__mc68000__)
116 if ((unsigned long)ptr & 3)
117 return -1;
118 #endif

I had to comment this #if statement because, in my case, on sat0,  this
pointer is offset by 14 bytes because of the ethernet header since the
interface is IP.  With this modification, the u32 classifier also works on
my sat0 interface.

I noticed that this #if was removed in 2.4.28 and 2.6.x.  However, it would
be nice to document this problem somewhere for somebody else running into
the same problem in versions 2.4.18/20.

Thanks again for your help.

Best regards,

Eric

-Original Message-
From: April, Eric (Satnet) 
Sent: Wednesday, January 11, 2006 5:40 PM
To: '[EMAIL PROTECTED]'; April, Eric (Satnet)
Subject: RE: tc filter


Thanks for the quick answer.  

I ran tcpdump on sat0 interface and I got the following:
~ # Warning: arptype 65535 not supported by libpcap - falling back to cooked
socket
tcpdump: listening on sat0

Could an unsupported arptype be the reason tc filter is not working as
expected? I initialize my interface sat0 with type

   dev->type = ARPHRD_VOID;

which is 0x.  I do not see which other one would better apply from the
file if_arp.h.

Anyhow, I could still get the traces.  Here they are:

~ # 00:11:06.878047 192.168.20.75 > 192.168.230.90: icmp: echo request (ttl
127, id 21494, len 60)
00:11:06.953003 192.168.230.90 > 192.168.20.75: icmp: echo reply (ttl 128,
id 18399, len 60)
00:11:07.878502 192.168.20.75 > 192.168.230.90: icmp: echo request (ttl 127,
id 21498, len 60)
00:11:07.932731 192.168.230.90 > 192.168.20.75: icmp: echo reply (ttl 128,
id 18655, len 60)
00:11:08.878553 192.168.20.75 > 192.168.230.90: icmp: echo request (ttl 127,
id 21501, len 60)
00:11:08.940482 192.168.230.90 > 192.168.20.75: icmp: echo reply (ttl 128,
id 18911, len 60)
00:11:09.879582 192.168.20.75 > 192.168.230.90: icmp: echo request (ttl 127,
id 21504, len 60)
00:11:09.946738 192.168.230.90 > 192.168.20.75: icmp: echo reply (ttl 128,
id 19167, len 60)

~ # tc -s -d class show dev sat0
class htb 1:1 root prio 0 quantum 1280 rate 100Kbit ceil 100Kbit burst
1728b/8 mpu 0b cburst 1728b/8 mpu 0b level 0
 Sent 240 bytes 4 pkts (dropped 0, overlimits 0)
 rate 5bps
 lended: 4 borrowed: 0 giants: 0
 tokens: 107008 ctokens: 107008

class htb 1:2 root prio 0 quantum 1000 rate 50Kbit ceil 50Kbit burst 1664b/8
mpu 0b cburst 1664b/8 mpu 0b level 0
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
 lended: 0 borrowed: 0 giants: 0
 tokens: 212992 ctokens: 212992

~ #
~ # tc filter show dev sat0
filter parent 1: protocol ip pref 49152 u32
filter parent 1: protocol ip pref 49152 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 49152 u32 fh 800::800 order 2048 key ht
800 bkt 0 flowid 1:2
  match c0a8e65a/ at 16
~ #

Everything seems fine to me except that the packets go in the wrong classid.
Any ideas what the problem is?

Unfortunately, I was not able to run iptables with --set-mark argument.

~ # /mnt/rfs/sbin/iptables -A POSTROUTING -o sat0 -p icmp -j MARK --set-mark
6
iptables v1.2.6a: Unknown arg `--set-mark'
Try `iptables -h' or 'iptables --help' for more information.

Which version do I need?  In any case, I would rather try to make tc filter
u32 classifier work first if at all possible.

-Original Message-
From: bert hubert [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 10, 2006 6:46 PM
To: April, Eric (Satnet)
Cc: '[EMAIL PROTECTED]'
Subject: Re: tc filter


On Tue, Jan 10, 2006 at 06:33:24PM -0500, April, Eric (Satnet) wrote:
> Hello Mr Bert Hubert,
> 
> I would really appreciate if you could help me out with this problem.

Eric,

Could you run 'tcpdump -n -i eth0 -v -v icmp' and 'tcpdump -n -i sat0 -v -v
icmp'
both during pining?

This would answer two questions:
1) are the ip addresses right when they go out on the line
2) it sat0 might have some odd encapsulation that makes tc miss the
   ip header

Another solution would be to use iptables to set the classi

Re: pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Jon Mason
On Thu, Jan 12, 2006 at 02:23:20PM -0800, Don Fry wrote:
> There are just a few differences between the 2.4 (1.30h) version of
> pcnet32.c and the 2.6 (1.30j) version, as I have tried to keep them
> as similar as possible.
> 
> The driver was changed in February 2004 to recognize the incorrect
> vendor ID so that the ppc workaround was no longer required, and so that
> the cards would work in non ppc systems.  From the driver perspective
> the ppc workaround could be deleted.
> 
> On my systems lspci shows all the devices with the correct name whether
> it is ppc or x86.

Funny, I get the following on my opteron system:

# lspci | grep Ethernet
:03:02.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5703X 
Gigabit Ethernet (rev 02)
:0e:01.0 Ethernet controller: Trident Microsystems 4DWave DX (rev 26)

> 
> PPC:
> [EMAIL PROTECTED]:/usr/src> lspci | grep Ethernet
> :01:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 
> [PCnet32 LANCE] (rev 54)
> :21:01.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 
> 100] (rev 0d)
> :62:00.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 
> [PCnet32 LANCE] (rev 26)
> :62:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 
> [PCnet32 LANCE] (rev 26)
> :62:02.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 
> [PCnet32 LANCE] (rev 26)
> :62:03.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 
> [PCnet32 LANCE] (rev 26)
> 0001:21:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 
> [PCnet32 LANCE] (rev 44)
> 0001:31:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 
> [PCnet32 LANCE] (rev 26)
> 0001:41:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet 
> Controller (Copper) (rev 01)
> 0001:61:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c978 
> [HomePNA] (rev 51)
> [EMAIL PROTECTED]:/usr/src>
> 
> x86:
> [EMAIL PROTECTED] linux-2.6.14-git11]$ lspci | grep Ethernet
> 00:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet 
> LANCE] (rev 54)
> 00:05.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet 
> LANCE] (rev 44)
> 02:05.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet 
> LANCE] (rev 16)
> 02:06.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet 
> LANCE] (rev 36)
> 05:02.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet 
> LANCE] (rev 44)
> 05:03.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet 
> LANCE] (rev 54)
> 05:04.0 Ethernet controller: Advanced Micro Devices [AMD] 79c978 [HomePNA] 
> (rev 51)
> [EMAIL PROTECTED] linux-2.6.14-git11]$ 
> 
> On Thu, Jan 12, 2006 at 04:24:35PM -0500, Bill Nottingham wrote:
> > Bill Nottingham ([EMAIL PROTECTED]) said: 
> > > I remember looking at this a while back. I think the corrected information
> > > is only being propagated to the 'vendor' file, and the write_config_word
> > > isn't actually updating the 'config' entry in sysfs.
> > 
> > Ah, here's an example from the box I remember working on this on
> > (without the libpci change):
> > 
> > [EMAIL PROTECTED] :00:0c.0]# pwd
> > /sys/bus/pci/devices/:00:0c.0
> > [EMAIL PROTECTED] :00:0c.0]# lspci | grep 0c.0
> > 00:0c.0 Ethernet controller: Trident Microsystems 4DWave DX (rev 26)
> > [EMAIL PROTECTED] :00:0c.0]# lspci -n | grep 0c.0
> > 00:0c.0 Class 0200: 1023:2000 (rev 26)
> > [EMAIL PROTECTED] :00:0c.0]# cat vendor
> > 0x1022
> > [EMAIL PROTECTED] :00:0c.0]# cat device
> > 0x2000
> > [EMAIL PROTECTED] :00:0c.0]# od -x config
> > 000 2310 0020 4701 8002 2600 0002 0048 
> > 020 01f0 ff00 0070 21c3    
> > 040        
> > 060  10c3     1101 06ff
> > 100        
> > *
> > 400
> > 
> > Note that the config space is different than the vendor file. This
> > was with 2.6.9-ish, I don't have the box around any more to confirm
> > with something more recent.
> > 
> > Bill
> -- 
> 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: [git patches] 2.6.x net driver updates

2006-01-12 Thread Linus Torvalds


On Thu, 12 Jan 2006, Jeff Garzik wrote:
> 
> dann frazier:
>   CONFIG_AIRO needs CONFIG_CRYPTO

I think this is done wrong.

It should "select CRYPTO" rather than "depends on CRYPTO".

Otherwise people won't see it just because they don't have crypto enabled, 
which is not very user-friendly.

Btw, why are these casts there? Either the functions are of the right 
type, or they aren't. In neither case is the cast correct.

I do realize that there are comments in  that says that 
you should do the cast, but that's no excuse for crap or stupid code.

If it's an issue of trying to make greppable code, why not have
just the comment?

> @@ -2378,6 +2566,15 @@ static const iw_handler atmel_handler[] 
>   (iw_handler) atmel_get_encode,  /* SIOCGIWENCODE */
>   (iw_handler) atmel_set_power,   /* SIOCSIWPOWER */
>   (iw_handler) atmel_get_power,   /* SIOCGIWPOWER */
> + (iw_handler) NULL,  /* -- hole -- */
> + (iw_handler) NULL,  /* -- hole -- */
...

Hmm?

Linus
-
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/5] spidernet: performance optimizations

2006-01-12 Thread Arnd Bergmann
Performance optimizations, changes in these areas:
  - RX and TX checksum offload
  - correct maximum MTU
  - don't use TX interrupts anymore, use a timer instead
  - remove some superfluous barriers
  - improve RX RAM full handling

From: Utz Bacher <[EMAIL PROTECTED]>
Signed-off-by: Jens Osterkamp <[EMAIL PROTECTED]>
Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>

Index: linux-2.6.16-rc/drivers/net/spider_net.c
===
--- linux-2.6.16-rc.orig/drivers/net/spider_net.c
+++ linux-2.6.16-rc/drivers/net/spider_net.c
@@ -22,7 +22,6 @@
  */
 
 #include 
-
 #include 
 #include 
 #include 
@@ -43,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -108,42 +108,6 @@ spider_net_write_reg(struct spider_net_c
writel(value, card->regs + reg);
 }
 
-/**
- * spider_net_write_reg_sync - writes to an SMMIO register of a card
- * @card: device structure
- * @reg: register to write to
- * @value: value to write into the specified SMMIO register
- *
- * Unlike spider_net_write_reg, this will also make sure the
- * data arrives on the card by reading the reg again.
- */
-static void
-spider_net_write_reg_sync(struct spider_net_card *card, u32 reg, u32 value)
-{
-   value = cpu_to_le32(value);
-   writel(value, card->regs + reg);
-   (void)readl(card->regs + reg);
-}
-
-/**
- * spider_net_rx_irq_off - switch off rx irq on this spider card
- * @card: device structure
- *
- * switches off rx irq by masking them out in the GHIINTnMSK register
- */
-static void
-spider_net_rx_irq_off(struct spider_net_card *card)
-{
-   u32 regvalue;
-   unsigned long flags;
-
-   spin_lock_irqsave(&card->intmask_lock, flags);
-   regvalue = spider_net_read_reg(card, SPIDER_NET_GHIINT0MSK);
-   regvalue &= ~SPIDER_NET_RXINT;
-   spider_net_write_reg_sync(card, SPIDER_NET_GHIINT0MSK, regvalue);
-   spin_unlock_irqrestore(&card->intmask_lock, flags);
-}
-
 /** spider_net_write_phy - write to phy register
  * @netdev: adapter to be written to
  * @mii_id: id of MII
@@ -199,60 +163,33 @@ spider_net_read_phy(struct net_device *n
 }
 
 /**
- * spider_net_rx_irq_on - switch on rx irq on this spider card
- * @card: device structure
- *
- * switches on rx irq by enabling them in the GHIINTnMSK register
- */
-static void
-spider_net_rx_irq_on(struct spider_net_card *card)
-{
-   u32 regvalue;
-   unsigned long flags;
-
-   spin_lock_irqsave(&card->intmask_lock, flags);
-   regvalue = spider_net_read_reg(card, SPIDER_NET_GHIINT0MSK);
-   regvalue |= SPIDER_NET_RXINT;
-   spider_net_write_reg_sync(card, SPIDER_NET_GHIINT0MSK, regvalue);
-   spin_unlock_irqrestore(&card->intmask_lock, flags);
-}
-
-/**
- * spider_net_tx_irq_off - switch off tx irq on this spider card
+ * spider_net_rx_irq_off - switch off rx irq on this spider card
  * @card: device structure
  *
- * switches off tx irq by masking them out in the GHIINTnMSK register
+ * switches off rx irq by masking them out in the GHIINTnMSK register
  */
 static void
-spider_net_tx_irq_off(struct spider_net_card *card)
+spider_net_rx_irq_off(struct spider_net_card *card)
 {
u32 regvalue;
-   unsigned long flags;
 
-   spin_lock_irqsave(&card->intmask_lock, flags);
-   regvalue = spider_net_read_reg(card, SPIDER_NET_GHIINT0MSK);
-   regvalue &= ~SPIDER_NET_TXINT;
-   spider_net_write_reg_sync(card, SPIDER_NET_GHIINT0MSK, regvalue);
-   spin_unlock_irqrestore(&card->intmask_lock, flags);
+   regvalue = SPIDER_NET_INT0_MASK_VALUE & (~SPIDER_NET_RXINT);
+   spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, regvalue);
 }
 
 /**
- * spider_net_tx_irq_on - switch on tx irq on this spider card
+ * spider_net_rx_irq_on - switch on rx irq on this spider card
  * @card: device structure
  *
- * switches on tx irq by enabling them in the GHIINTnMSK register
+ * switches on rx irq by enabling them in the GHIINTnMSK register
  */
 static void
-spider_net_tx_irq_on(struct spider_net_card *card)
+spider_net_rx_irq_on(struct spider_net_card *card)
 {
u32 regvalue;
-   unsigned long flags;
 
-   spin_lock_irqsave(&card->intmask_lock, flags);
-   regvalue = spider_net_read_reg(card, SPIDER_NET_GHIINT0MSK);
-   regvalue |= SPIDER_NET_TXINT;
-   spider_net_write_reg_sync(card, SPIDER_NET_GHIINT0MSK, regvalue);
-   spin_unlock_irqrestore(&card->intmask_lock, flags);
+   regvalue = SPIDER_NET_INT0_MASK_VALUE | SPIDER_NET_RXINT;
+   spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, regvalue);
 }
 
 /**
@@ -326,9 +263,8 @@ static enum spider_net_descr_status
 spider_net_get_descr_status(struct spider_net_descr *descr)
 {
u32 cmd_status;
-   rmb();
+
cmd_status = descr->dmac_cmd_status;
-   rmb();
cmd_status >>= SPIDER_NET_DESCR_IND_PROC_SHIFT;
/* no need to mask out any bits, as cmd_status is 32 bits wide only
 * (and unsigned) */

[git patches] 2.6.x net driver updates

2006-01-12 Thread Jeff Garzik

Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git

to receive the following updates:

 drivers/net/bonding/bond_alb.c |4 
 drivers/net/bonding/bonding.h  |4 
 drivers/net/e100.c |   32 +
 drivers/net/gianfar.c  |6 -
 drivers/net/gianfar_mii.c  |5 
 drivers/net/phy/mdio_bus.c |2 
 drivers/net/phy/phy.c  |2 
 drivers/net/tulip/uli526x.c|6 -
 drivers/net/via-velocity.c |2 
 drivers/net/wireless/Kconfig   |2 
 drivers/net/wireless/atmel.c   |  227 -
 include/linux/fsl_devices.h|6 -
 include/linux/phy.h|3 
 include/net/ieee80211.h|6 -
 14 files changed, 281 insertions(+), 26 deletions(-)

Dan Williams:
  wireless/atmel: add IWENCODEEXT, IWAUTH, and association event support

dann frazier:
  CONFIG_AIRO needs CONFIG_CRYPTO

Eric Sesterhenn / snakebyte:
  replace MODULE_PARM in tulip/uli526x.c

Jay Vosburgh:
  bonding: UPDATED hash-table corruption in bond_alb.c

Johannes Berg:
  fix wrong comments in ieee80211.h

John W. Linville:
  via-velocity: use NETIF_F_IP_CSUM (hardware only support IPv4)

Kumar Gala:
  gfar: fix compile error
  gianfar mii: Use proper resource for MII memory region
  phy: Added a macro to represent the string format used to match a phy 
device
  gianfar: Use new PHY_ID_FMT macro

ODonnell, Michael:
  corruption during e100 MDI register access

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 854ddfb..f2a6318 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -169,9 +169,9 @@ static void tlb_clear_slave(struct bondi
index = next_index;
}
 
-   _unlock_tx_hashtbl(bond);
-
tlb_init_slave(slave);
+
+   _unlock_tx_hashtbl(bond);
 }
 
 /* Must be called before starting the monitor timer */
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index f20bb85..3dd78d0 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -22,8 +22,8 @@
 #include "bond_3ad.h"
 #include "bond_alb.h"
 
-#define DRV_VERSION"3.0.0"
-#define DRV_RELDATE"November 8, 2005"
+#define DRV_VERSION"3.0.1"
+#define DRV_RELDATE"January 9, 2006"
 #define DRV_NAME   "bonding"
 #define DRV_DESCRIPTION"Ethernet Channel Bonding Driver"
 
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 22cd045..23de226 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -132,6 +132,10 @@
  * TODO:
  * o several entry points race with dev->close
  * o check for tx-no-resources/stop Q races with tx clean/wake Q
+ *
+ * FIXES:
+ * 2005/12/02 - Michael O'Donnell 
+ * - Stratus87247: protect MDI control register manipulations
  */
 
 #include 
@@ -578,6 +582,7 @@ struct nic {
u16 leds;
u16 eeprom_wc;
u16 eeprom[256];
+   spinlock_t mdio_lock;
 };
 
 static inline void e100_write_flush(struct nic *nic)
@@ -876,15 +881,35 @@ static u16 mdio_ctrl(struct nic *nic, u3
 {
u32 data_out = 0;
unsigned int i;
+   unsigned long flags;
+
 
+   /*
+* Stratus87247: we shouldn't be writing the MDI control
+* register until the Ready bit shows True.  Also, since
+* manipulation of the MDI control registers is a multi-step
+* procedure it should be done under lock.
+*/
+   spin_lock_irqsave(&nic->mdio_lock, flags);
+   for (i = 100; i; --i) {
+   if (readl(&nic->csr->mdi_ctrl) & mdi_ready)
+   break;
+   udelay(20);
+   }
+   if (unlikely(!i)) {
+   printk("e100.mdio_ctrl(%s) won't go Ready\n",
+   nic->netdev->name );
+   spin_unlock_irqrestore(&nic->mdio_lock, flags);
+   return 0;   /* No way to indicate timeout error */
+   }
writel((reg << 16) | (addr << 21) | dir | data, &nic->csr->mdi_ctrl);
 
-   for(i = 0; i < 100; i++) {
+   for (i = 0; i < 100; i++) {
udelay(20);
-   if((data_out = readl(&nic->csr->mdi_ctrl)) & mdi_ready)
+   if ((data_out = readl(&nic->csr->mdi_ctrl)) & mdi_ready)
break;
}
-
+   spin_unlock_irqrestore(&nic->mdio_lock, flags);
DPRINTK(HW, DEBUG,
"%s:addr=%d, reg=%d, data_in=0x%04X, data_out=0x%04X\n",
dir == mdi_read ? "READ" : "WRITE", addr, reg, data, data_out);
@@ -2562,6 +2587,7 @@ static int __devinit e100_probe(struct p
/* locks must be initialized before calling hw_reset */
spin_lock_init(&nic->cb_lock);
spin_lock_init(&nic->cmd_lock);
+   spin_lock_init(&nic->mdio_lock);
 
/* Reset the device before pci_set_master() in case device is in some
 * funky state and has a

[patch 2/5] spidernet: read firmware from the OF device tree

2006-01-12 Thread Arnd Bergmann
request_firmware() is sometimes problematic, especially
in initramfs, reading the firmware from Open Firmware
is much preferrable.

We still try to get the firmware from the file system
first, in order to support old SLOF releases and to allow
updates of the spidernet firmware without reflashing
the system.

From: Jens Osterkamp <[EMAIL PROTECTED]>
Signed-off-by: Jens Osterkamp <[EMAIL PROTECTED]>
Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>

Index: linux-2.6.16-rc/drivers/net/spider_net.c
===
--- linux-2.6.16-rc.orig/drivers/net/spider_net.c
+++ linux-2.6.16-rc/drivers/net/spider_net.c
@@ -1895,16 +1895,27 @@ spider_net_download_firmware(struct spid
 static int
 spider_net_init_firmware(struct spider_net_card *card)
 {
-   const struct firmware *firmware;
+   struct firmware *firmware;
+   struct device_node *dn;
+   u8 *fw_prop;
int err = -EIO;
 
-   if (request_firmware(&firmware,
+   if (request_firmware((const struct firmware **)&firmware,
 SPIDER_NET_FIRMWARE_NAME, &card->pdev->dev) < 0) {
if (netif_msg_probe(card))
pr_err("Couldn't read in sequencer data file %s.\n",
   SPIDER_NET_FIRMWARE_NAME);
-   firmware = NULL;
-   goto out;
+
+   dn = pci_device_to_OF_node(card->pdev);
+   if (!dn)
+   goto out;
+
+   fw_prop = (u8 *)get_property(dn, "firmware", NULL);
+   if (!fw_prop)
+   goto out;
+
+   memcpy(firmware->data, fw_prop, 6 * SPIDER_NET_FIRMWARE_LEN * 
sizeof(u32));
+   firmware->size = 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32);
}
 
if (firmware->size != 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32)) {

--

-
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/5] [RESEND^2] spidernet fixes

2006-01-12 Thread Arnd Bergmann
On Thursday 12 January 2006 21:38, Jeff Garzik wrote:
> failed on first patch:
> 
> 
> [EMAIL PROTECTED] netdev-2.6]$ git-applymbox /g/tmp/mbox
> ~/info/signoff.txt
> 5 patch(es) to process.
> 
> Applying 'spidernet: check if firmware was loaded correctly'
> 
> fatal: corrupt patch at line 39

Ok, I'm pretty sure now that I found what went wrong.
The broken patch was stored in out CVS, but quilt silently
applied it anyway. It seems that quilt ignores empty context
lines at the end of a patch. After refreshing all patches,
this seems to be solved.

Arnd <><

-
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: pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Don Fry
There are just a few differences between the 2.4 (1.30h) version of
pcnet32.c and the 2.6 (1.30j) version, as I have tried to keep them
as similar as possible.

The driver was changed in February 2004 to recognize the incorrect
vendor ID so that the ppc workaround was no longer required, and so that
the cards would work in non ppc systems.  From the driver perspective
the ppc workaround could be deleted.

On my systems lspci shows all the devices with the correct name whether
it is ppc or x86.

PPC:
[EMAIL PROTECTED]:/usr/src> lspci | grep Ethernet
:01:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 
LANCE] (rev 54)
:21:01.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 
100] (rev 0d)
:62:00.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 
LANCE] (rev 26)
:62:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 
LANCE] (rev 26)
:62:02.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 
LANCE] (rev 26)
:62:03.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 
LANCE] (rev 26)
0001:21:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 
LANCE] (rev 44)
0001:31:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 
LANCE] (rev 26)
0001:41:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet 
Controller (Copper) (rev 01)
0001:61:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c978 [HomePNA] 
(rev 51)
[EMAIL PROTECTED]:/usr/src>

x86:
[EMAIL PROTECTED] linux-2.6.14-git11]$ lspci | grep Ethernet
00:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet LANCE] 
(rev 54)
00:05.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet LANCE] 
(rev 44)
02:05.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet LANCE] 
(rev 16)
02:06.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet LANCE] 
(rev 36)
05:02.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet LANCE] 
(rev 44)
05:03.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet LANCE] 
(rev 54)
05:04.0 Ethernet controller: Advanced Micro Devices [AMD] 79c978 [HomePNA] (rev 
51)
[EMAIL PROTECTED] linux-2.6.14-git11]$ 

On Thu, Jan 12, 2006 at 04:24:35PM -0500, Bill Nottingham wrote:
> Bill Nottingham ([EMAIL PROTECTED]) said: 
> > I remember looking at this a while back. I think the corrected information
> > is only being propagated to the 'vendor' file, and the write_config_word
> > isn't actually updating the 'config' entry in sysfs.
> 
> Ah, here's an example from the box I remember working on this on
> (without the libpci change):
> 
> [EMAIL PROTECTED] :00:0c.0]# pwd
> /sys/bus/pci/devices/:00:0c.0
> [EMAIL PROTECTED] :00:0c.0]# lspci | grep 0c.0
> 00:0c.0 Ethernet controller: Trident Microsystems 4DWave DX (rev 26)
> [EMAIL PROTECTED] :00:0c.0]# lspci -n | grep 0c.0
> 00:0c.0 Class 0200: 1023:2000 (rev 26)
> [EMAIL PROTECTED] :00:0c.0]# cat vendor
> 0x1022
> [EMAIL PROTECTED] :00:0c.0]# cat device
> 0x2000
> [EMAIL PROTECTED] :00:0c.0]# od -x config
> 000 2310 0020 4701 8002 2600 0002 0048 
> 020 01f0 ff00 0070 21c3    
> 040        
> 060  10c3     1101 06ff
> 100        
> *
> 400
> 
> Note that the config space is different than the vendor file. This
> was with 2.6.9-ish, I don't have the box around any more to confirm
> with something more recent.
> 
> Bill
-- 
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


[patch 5/5] spidernet: fix missing include

2006-01-12 Thread Arnd Bergmann
This is now required to avoid
drivers/net/spider_net.c:844: error: 'IPPROTO_TCP' undeclared

Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>

Index: linux-2.6.16-rc/drivers/net/spider_net.c
===
--- linux-2.6.16-rc.orig/drivers/net/spider_net.c
+++ linux-2.6.16-rc/drivers/net/spider_net.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

--

-
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 1/5] spidernet: check if firmware was loaded correctly

2006-01-12 Thread Arnd Bergmann
Uploading the device firmware may fail if wrong input data
was provided by the user. This checks for the condition.

From: Jens Osterkamp <[EMAIL PROTECTED]>
Signed-off-by: Jens Osterkamp <[EMAIL PROTECTED]>
Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>

Index: linux-2.6.16-rc/drivers/net/spider_net.c
===
--- linux-2.6.16-rc.orig/drivers/net/spider_net.c
+++ linux-2.6.16-rc/drivers/net/spider_net.c
@@ -1836,7 +1836,7 @@ spider_net_setup_phy(struct spider_net_c
  * spider_net_download_firmware loads the firmware opened by
  * spider_net_init_firmware into the adapter.
  */
-static void
+static int
 spider_net_download_firmware(struct spider_net_card *card,
 const struct firmware *firmware)
 {
@@ -1857,8 +1857,13 @@ spider_net_download_firmware(struct spid
}
}
 
+   if (spider_net_read_reg(card, SPIDER_NET_GSINIT))
+   return -EIO;
+
spider_net_write_reg(card, SPIDER_NET_GSINIT,
 SPIDER_NET_RUN_SEQ_VALUE);
+
+   return 0;
 }
 
 /**
@@ -1909,9 +1914,8 @@ spider_net_init_firmware(struct spider_n
goto out;
}
 
-   spider_net_download_firmware(card, firmware);
-
-   err = 0;
+   if (!spider_net_download_firmware(card, firmware))
+   err = 0;
 out:
release_firmware(firmware);
 

--

-
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/5] spidernet: fix HW structures for 64 bit dma_addr_t

2006-01-12 Thread Arnd Bergmann
The driver incorrectly used dma_addr_t to describe
HW structures and consequently broke when that type
was changed in 2.6.15-rc.

This changed spidernet to use u32 for 32 bit HW defined
structure elements.

From: Jens Osterkamp <[EMAIL PROTECTED]>
Signed-off-by: Jens Osterkamp <[EMAIL PROTECTED]>
Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>

Index: linux-2.6.16-rc/drivers/net/spider_net.h
===
--- linux-2.6.16-rc.orig/drivers/net/spider_net.h
+++ linux-2.6.16-rc/drivers/net/spider_net.h
@@ -373,9 +373,9 @@ enum spider_net_descr_status {
 
 struct spider_net_descr {
/* as defined by the hardware */
-   dma_addr_t buf_addr;
+   u32 buf_addr;
u32 buf_size;
-   dma_addr_t next_descr_addr;
+   u32 next_descr_addr;
u32 dmac_cmd_status;
u32 result_size;
u32 valid_size; /* all zeroes for tx */
Index: linux-2.6.16-rc/drivers/net/spider_net.c
===
--- linux-2.6.16-rc.orig/drivers/net/spider_net.c
+++ linux-2.6.16-rc/drivers/net/spider_net.c
@@ -480,6 +480,7 @@ static int
 spider_net_prepare_rx_descr(struct spider_net_card *card,
struct spider_net_descr *descr)
 {
+   dma_addr_t buf;
int error = 0;
int offset;
int bufsize;
@@ -510,10 +511,11 @@ spider_net_prepare_rx_descr(struct spide
if (offset)
skb_reserve(descr->skb, SPIDER_NET_RXBUF_ALIGN - offset);
/* io-mmu-map the skb */
-   descr->buf_addr = pci_map_single(card->pdev, descr->skb->data,
+   buf = pci_map_single(card->pdev, descr->skb->data,
 SPIDER_NET_MAX_MTU,
 PCI_DMA_BIDIRECTIONAL);
-   if (descr->buf_addr == DMA_ERROR_CODE) {
+   descr->buf_addr = buf;
+   if (buf == DMA_ERROR_CODE) {
dev_kfree_skb_any(descr->skb);
if (netif_msg_rx_err(card))
pr_err("Could not iommu-map rx buffer\n");
@@ -914,15 +916,16 @@ spider_net_prepare_tx_descr(struct spide
struct spider_net_descr *descr,
struct sk_buff *skb)
 {
-   descr->buf_addr = pci_map_single(card->pdev, skb->data,
-skb->len, PCI_DMA_BIDIRECTIONAL);
-   if (descr->buf_addr == DMA_ERROR_CODE) {
+   dma_addr_t buf = pci_map_single(card->pdev, skb->data,
+   skb->len, PCI_DMA_BIDIRECTIONAL);
+   if (buf == DMA_ERROR_CODE) {
if (netif_msg_tx_err(card))
pr_err("could not iommu-map packet (%p, %i). "
  "Dropping packet\n", skb->data, skb->len);
return -ENOMEM;
}
 
+   descr->buf_addr = buf;
descr->buf_size = skb->len;
descr->skb = skb;
descr->data_status = 0;

--

-
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] Spelling fix in IPW2100 and IPW2200 Kconfig entries

2006-01-12 Thread Alex Shepard
s/remvoed/removed/


Signed-off-by: Alex Shepard <[EMAIL PROTECTED]>

--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -160,7 +160,7 @@ config IPW2100
   .
  
   If you want to compile the driver as a module ( = code which can be
-  inserted in and remvoed from the running kernel whenever you want),
+  inserted in and removed from the running kernel whenever you want),
   say M here and read .  The module
   will be called ipw2100.ko.

@@ -213,7 +213,7 @@ config IPW2200
   .
  
   If you want to compile the driver as a module ( = code which can be
-  inserted in and remvoed from the running kernel whenever you want),
+  inserted in and removed from the running kernel whenever you want),
   say M here and read .  The module
   will be called ipw2200.ko.
 


-
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] drivers/net/3c59x: notice carrier a little sooner

2006-01-12 Thread Steffen Klassert
On Thu, Jan 12, 2006 at 03:02:25PM -0500, Dan Williams wrote:
> On Thu, 2006-01-12 at 20:57 +0100, Steffen Klassert wrote:
> > Did you give the patch a try?
> > 
> > Actually I have no possibility to test, but
> > I think that netif_carrier_{on,off} still does not
> > work proper. The timer function does just nothing
> > if vp->medialock is set.
> > 
> Worked for me with 3c905 card in a Dell Latitude C610.  I just c&p'd the
> code into the vortex, so maybe vortex is different than boomerang.
> Anyway, shouldn't the timer be run a bit later after the *_rx()
> function?
> 
> Dan

Of course the timer function should run in both cases.
If it works with the boomerang then it should work with vortex too.
I just remember that I had some problems with netif_carrier_ok()
when I tried to use ethtool_op_get_link about a year ago.
Perhaps I'm not up to date and it works in default case. 
I think a problem should appear at least
if one forces a certain media type. 
I still have a patch in queue to improve usage of netif_carrier_{on,off} 
but I had no possibility to test yet, so I did not send.

Steffen
-
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: WCONF, netlink based WE replacement.

2006-01-12 Thread Stuffed Crust
On Thu, Jan 12, 2006 at 08:43:06PM +0100, Jiri Benc wrote:
> I didn't mean channels, just frequencies. To be conformal with standards
> and regulations, we can allow specific frequencies only. Those
> frequencies are unambiguously mapped to channels anyway (you have to
> specify a band of course). So I see no point in specifying frequencies
> from userspace, channels should be enough.

While frequencies map cleanly to channels, the other direction is more 
difficult, as different bands have the same channel numbers.  This isn't 
theoretical -- 802.11j's lower 5.0Ghz band uses "channels" 8-16, 
directly clashing with 802.11-1999's 2.4GHz use of channels 8-14.  

(That's before we even begin to start talking about 802.11j's concept of 
 both 20MHz and 10MHz-wide channels..)

It makes more sense to specify the frequency, as there is no ambiguity
there at all (and saves us having to specify a [band,channel] pair each
time) -- it's trivial to map this into a prettier end-user
representation, but that should happen in userland, and not be hardwired 
into the underlying API/ABI or kernel itself.

 - Solomon
-- 
Solomon Peachy   ICQ: 1318344
Melbourne, FL
Quidquid latine dictum sit, altum viditur.


pgpkcnVp0CUFB.pgp
Description: PGP signature


Re: 2.6.15-mm3

2006-01-12 Thread Patrick McHardy

Andrew Morton wrote:

"Rafael J. Wysocki" <[EMAIL PROTECTED]> wrote:


Hi,

On Wednesday, 11 January 2006 13:21, Andrew Morton wrote:


ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.15/2.6.15-mm3/


I got that on system shutdown (x86-64, 1 CPU):



Thanks.   ipv6 died.  I think shemminger had a recent problem with ipv6 too?

I don't think there were any core networking changes in -mm3 which weren't
in linus-at-that-time.



Unable to handle kernel NULL pointer dereference at 01b4 RIP:
{:ipv6:ip6_xmit+593}


That crash is already fixed in Linus' latest tree by this patch:

tree 3d4ce288b86cb2845d79c6adec9e254054bb0e02
parent a7768097557be91d0d4c37e8f2e38cd126c4cdf9
author David Woodhouse <[EMAIL PROTECTED]> Thu, 12 Jan 2006 07:53:04 -0800
committer David S. Miller <[EMAIL PROTECTED]> Thu, 12 Jan 2006 
08:32:13 -0800


[IPV6]: Avoid calling ip6_xmit() with NULL sk
The ip6_xmit() function now assumes that its sk argument is non-NULL,
which isn't currently true when TCPv6 code is sending RST or ACK
packets. This fixes that code to use a socket of its own for sending
such packets, as TCPv4 does. (Thanks Andi for the pointer).

Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[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


[ZD1211] Uli's code

2006-01-12 Thread Ulrich Kunitz
My version of the ZD1211 driver can be git-cloned from
http://www.deine-taler.de/zd1211/zd1211_uk.git.

Under http://www.deine-taler.de/zd1211/ a tar-snapshot can be
found.

> That would be great. We should merge our work as soon as possible and continue
> on one version only. I just wish you'd announced/publicised your work when you
> started so that we wouldn't have duplicated up to this point.

Well, I even remember browsing your website, but it seems that you
started your project just recently.

I had a look at your branch/dsd file. Actually the code is quite
comparable. I wouldn't mind to restart with your code, but I have
already some patches in mind. :-) But please take a look at my
code also and write me what you think. No doubt, it makes no sense
to develop two different versions of the driver. We should
definitely join forces.

If you could forward me the docs it would be really great. Please
contact me if there is any action required on my side.

Cheers,

Uli

-- 
Ulrich Kunitz - [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: Wireless: One small step towards a more perfect union...? [ZD1211]

2006-01-12 Thread Simon Kelley

Phil Dibowitz wrote:

Thanks for stepping up John.

I'm really new to the netdev area, but I thought I'd throw this out as
I've been watching this thread with interest...

The GPL Realtek driver Andrea Merello:

http://rtl8180-sa2400.sourceforge.net/
and
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Linux.Wireless.drivers.802.11b.html#RealtekGPL)

seems like a prime candidate for inclusion as lots of people have
reported success...



If you need testing, I have a PCI card with this chip in my junk-box. I
can even plug it into an SMP box, for extra points..


Cheers,

Simon.
-
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: 2.6.15-mm3

2006-01-12 Thread Andrew Morton
"Rafael J. Wysocki" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> On Wednesday, 11 January 2006 13:21, Andrew Morton wrote:
> > 
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.15/2.6.15-mm3/
> 
> I got that on system shutdown (x86-64, 1 CPU):

Thanks.   ipv6 died.  I think shemminger had a recent problem with ipv6 too?

I don't think there were any core networking changes in -mm3 which weren't
in linus-at-that-time.

> Unable to handle kernel NULL pointer dereference at 01b4 RIP:
> {:ipv6:ip6_xmit+593}
> PGD 2441f067 PUD 231b1067 PMD 0
> Oops:  [1] PREEMPT
> CPU 0
> Modules linked in: ipt_LOG ipt_limit ipt_pkttype ipt_state ipt_REJECT 
> iptable_mangle iptable_nat iptable_filter ip6table_mangle ip_nat_ftp
> ip_nat ip_conntrack_ftp ip_conntrack ip_tables ip6table_filter ip6_tables 
> ipv6 usbserial thermal processor fan button battery ac snd_pcm_os
> s snd_mixer_oss snd_intel8x0 snd_ac97_codec snd_ac97_bus snd_pcm snd_timer 
> snd soundcore snd_page_alloc af_packet pcmcia firmware_class yen
> ta_socket rsrc_nonstatic pcmcia_core usbhid ehci_hcd ohci_hcd sk98lin evdev 
> joydev sg st sr_mod sd_mod scsi_mod ide_cd cdrom dm_mod parport
> _pc lp parport
> Pid: 18912, comm: kcminit Not tainted 2.6.15-mm3 #25
> RIP: 0010:[] {:ipv6:ip6_xmit+593}
> RSP: 0018:80489cc8  EFLAGS: 00010246
> RAX: 810029a47658 RBX: 810029a47658 RCX: 
> RDX:  RSI: 80489d50 RDI: 810001f33e00
> RBP: 80489d28 R08:  R09: 0080
> R10: 8100201a9f5c R11: 80489d40 R12: 810001f33dd8
> R13:  R14: 80489d38 R15: 0014
> FS:  2e769de0() GS:80515000() knlGS:5617d560
> CS:  0010 DS:  ES:  CR0: 8005003b
> CR2: 01b4 CR3: 249eb000 CR4: 06e0
> Process kcminit (pid: 18912, threadinfo 8100233ca000, task 
> 810028afa090)
> Stack: 810029a476a0 8100201a9e60  881cb324
>810029a47658 80489d40 060180489d48 810029a476a0
>80489d40 810001f33e00
> Call Trace:  {:ipv6:tcp_v6_send_reset+525}
>{inet6_lookup_listener+264} 
> {:ipv6:tcp_v6_rcv+1842}
>{:ipv6:ip6_input+568} 
> {:ipv6:ipv6_rcv+527}
>{netif_receive_skb+635} 
> {process_backlog+153}
>{net_rx_action+179} 
> {__do_softirq+80}
>{call_softirq+30}   
> {do_softirq+53}
>{local_bh_enable+114} 
> {dev_queue_xmit+583}
>{neigh_resolve_output+639} 
> {:ipv6:ip6_output2+562}
>{:ipv6:dst_output+0} 
> {:ipv6:ip6_output+2045}
>{:ipv6:ip6_xmit+747} 
> {:ipv6:inet6_csk_xmit+769}
>{tcp_transmit_skb+1743} 
> {__alloc_skb+127}
>{tcp_connect+723} 
> {:ipv6:tcp_v6_connect+1529}
>{__mutex_init+83} 
> {_spin_unlock_bh+24}
>{inet_stream_connect+207} 
> {_spin_unlock_bh+24}
>{lock_sock+201} 
> {_spin_unlock_bh+24}
>{fget+170} {sys_connect+140}
>{sys_setsockopt+162} 
> {system_call+126}
> 
> 
> Code: 41 8b 95 b4 01 00 00 89 90 98 00 00 00 48 8b 45 a8 8b 58 40
> RIP {:ipv6:ip6_xmit+593} RSP 
> CR2: 01b4
>  <0>Kernel panic - not syncing: Aiee, killing interrupt handler!
>  <4>atkbd.c: Spurious ACK on isa0060/serio0. Some program, like XFree86, 
> might be trying access hardware directly.
> atkbd.c: Spurious ACK on isa0060/serio0. Some program, like XFree86, might be 
> trying access hardware directly.
> atkbd.c: Spurious ACK on isa0060/serio0. Some program, like XFree86, might be 
> trying access hardware directly.
> atkbd.c: Spurious ACK on isa0060/serio0. Some program, like XFree86, might be 
> trying access hardware directly.
> 
> and so on forever.
> 
> Greetings,
> Rafael
-
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: [RFC]: IPsec tunnel wildcard addresses

2006-01-12 Thread Patrick McHardy

David S. Miller wrote:

From: Herbert Xu <[EMAIL PROTECTED]>
Date: Fri, 13 Jan 2006 08:06:00 +1100



The only reason I mentioned doing it in userspace is that it gives us
a little bit more flexibility since userspace can choose a different
method to pick the source address.



Note that userspace could override and do something with the zero
source address before the kernel ever gets to see it.

This behavior in the kernel is in line with how socket binding works,
and it's not a bad fallback in the case where we do see a zero tunnel
source addres which frankly has no other sane semantic than the one
Patrick has given to it.

The main point is that putting zero tunnel source address handling
into the kernel does not preclude at all userspace doing something
interesting with it as well.

Therefore I think Patrick's initial kernel patch makes a lot of sense.


Great, here is a properly signed off patch without the extra
hunks.
[XFRM]: IPsec tunnel wildcard address support

When the source address of a tunnel is given as 0.0.0.0 do a routing lookup
to get the real source address for the destination and fill that into the
acquire message. This allows to specify policies like this:

spdadd 172.16.128.13/32 172.16.0.0/20 any -P out ipsec
esp/tunnel/0.0.0.0-x.x.x.x/require;
spdadd 172.16.0.0/20 172.16.128.13/32 any -P in ipsec
esp/tunnel/x.x.x.x-0.0.0.0/require;

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>

---
commit e1109d524e3ddbe9e4a4704c829ef1c286a1e944
tree 17e3a2059b601790a58cd1d5d3a6cb705754c314
parent b7ad9d284f47611352d759214af371a4b9475dc9
author Patrick McHardy <[EMAIL PROTECTED]> Thu, 12 Jan 2006 22:50:14 +0100
committer Patrick McHardy <[EMAIL PROTECTED]> Thu, 12 Jan 2006 22:50:14 +0100

 net/ipv4/xfrm4_state.c |   15 +++
 net/ipv6/xfrm6_state.c |   17 +
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
index d23e07f..dbabf81 100644
--- a/net/ipv4/xfrm4_state.c
+++ b/net/ipv4/xfrm4_state.c
@@ -42,6 +42,21 @@ __xfrm4_init_tempsel(struct xfrm_state *
x->props.saddr = tmpl->saddr;
if (x->props.saddr.a4 == 0)
x->props.saddr.a4 = saddr->a4;
+   if (tmpl->mode && x->props.saddr.a4 == 0) {
+   struct rtable *rt;
+   struct flowi fl_tunnel = {
+   .nl_u = {
+   .ip4_u = {
+   .daddr = x->id.daddr.a4,
+   }
+   }
+   };
+   if (!xfrm_dst_lookup((struct xfrm_dst **)&rt,
+&fl_tunnel, AF_INET)) {
+   x->props.saddr.a4 = rt->rt_src;
+   dst_release(&rt->u.dst);
+   }
+   }
x->props.mode = tmpl->mode;
x->props.reqid = tmpl->reqid;
x->props.family = AF_INET;
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index bf0d0ab..a572302 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static struct xfrm_state_afinfo xfrm6_state_afinfo;
 
@@ -41,6 +42,22 @@ __xfrm6_init_tempsel(struct xfrm_state *
memcpy(&x->props.saddr, &tmpl->saddr, sizeof(x->props.saddr));
if (ipv6_addr_any((struct in6_addr*)&x->props.saddr))
memcpy(&x->props.saddr, saddr, sizeof(x->props.saddr));
+   if (tmpl->mode && ipv6_addr_any((struct in6_addr*)&x->props.saddr)) {
+   struct rt6_info *rt;
+   struct flowi fl_tunnel = {
+   .nl_u = {
+   .ip6_u = {
+   .daddr = *(struct in6_addr *)daddr,
+   }
+   }
+   };
+   if (!xfrm_dst_lookup((struct xfrm_dst **)&rt,
+&fl_tunnel, AF_INET6)) {
+   ipv6_get_saddr(&rt->u.dst, (struct in6_addr *)daddr,
+  (struct in6_addr *)&x->props.saddr);
+   dst_release(&rt->u.dst);
+   }
+   }
x->props.mode = tmpl->mode;
x->props.reqid = tmpl->reqid;
x->props.family = AF_INET6;


Re: [PATCH netdev-2.6 01/39] e1000: Fix jumbo frame performance

2006-01-12 Thread Jeff Kirsher
On 1/12/06, Jeff Garzik <[EMAIL PROTECTED]> wrote:
>
> We need to fix Intel's patch submission process to ensure that (a)
> git-applymbox doesn't reject the patches, and (b) only a single copy of
> each patch accompanies each email.

I will remove the attachments, that is not a problem.  Could you let
me know if my ethtool patch applies just fine?  Is so I will use the
same method for e100 and e1000.

Jesse has been working getting a git repository on a system that you
can pull from to make it easier for you, but I am not sure what the
time line will be in getting it up and running.

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


Re: Marvell driver question

2006-01-12 Thread Stephen Hemminger
On Thu, 12 Jan 2006 21:15:21 +0100
"JaniD++" <[EMAIL PROTECTED]> wrote:

> Hello, list,
> 
> I have one problem, with my marvell adapter on my asus motherboard.
> The problem is not exactly with the linux marvell driver, the problem is
> with the marvell-boot-rom. :-)
> 
> I want to boot with this card, and the first time it works.
> But after the linux driver gets the card, the next reboot the boot rom
> cannot detect the link. :-)
> The reset did not fix this issue, only the hard poweroff, and wait ~ 1
> minute.
> 
> Is there an easy way to workaround this issue?

Which chip. I suspect the code to power down the driver on remove
is confusing the boot rom (Windows has the same problem).

Does this change anything? and what are the initial boot values
from cold boot and reboot.

--- skge-2.6.orig/drivers/net/skge.c
+++ skge-2.6/drivers/net/skge.c
@@ -2993,6 +2993,7 @@ static int skge_reset(struct skge_hw *hw
int i;
 
ctst = skge_read16(hw, B0_CTST);
+   printk(PFX "boot ctst %x\n", ctst);
 
/* do a SW reset */
skge_write8(hw, B0_CTST, CS_RST_SET);
@@ -3355,7 +3356,7 @@ static void __devexit skge_remove(struct
skge_write32(hw, B0_IMSK, 0);
skge_write16(hw, B0_LED, LED_STAT_OFF);
skge_pci_clear(hw);
-   skge_write8(hw, B0_CTST, CS_RST_SET);
+   skge_write8(hw, B0_CTST, CS_MRST_SET);
 
tasklet_kill(&hw->ext_tasklet);
 
-
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] ipw2100: support WEXT-18 enc_capa v3

2006-01-12 Thread Jeff Garzik

Dan Williams wrote:

Hi,

This patch allows ipw2100 driver to advertise the WPA-related encryption
options that it does really support.  It's necessary to work correctly
with NetworkManager and other programs that actually check driver & card
capabilities.

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>


content OK, but:


[EMAIL PROTECTED] netdev-2.6]$ git-applymbox /g/tmp/mbox ~/info/signoff.txt
1 patch(es) to process.

Applying 'ipw2100: support WEXT-18 enc_capa v3'

error: patch failed: drivers/net/wireless/ipw2100.c:7236
error: drivers/net/wireless/ipw2100.c: patch does not apply
-
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 netdev-2.6] bonding: UPDATED hash-table corruption in bond_alb.c

2006-01-12 Thread Jeff Garzik

Jay Vosburgh wrote:

I believe I see the race Michael refers to (tlb_choose_channel
may set head, which tlb_init_slave clears), although I was not able to
reproduce it.  I have updated his patch for the current netdev-2.6.git
tree and added a version update.  His original comment follows:

Our systems have been crashing during testing of PCI HotPlug
support in the various networking components.  We've faulted in
the bonding driver due to a bug in bond_alb.c:tlb_clear_slave()

In that routine, the last modification to the TLB hash table is
made without protection of the lock, allowing a race that can lead
tlb_choose_channel() to select an invalid table element.

-J

---
-Jay Vosburgh, IBM Linux Technology Center, [EMAIL PROTECTED]


Signed-off-by: Michael O'Donnell 
Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>


applied.

Please fix your future submissions to eliminate your signature and 
.signature.  git-applymbox, quite rightly, elides everything after the 
standard "---" delimiter.


Anything that doesn't belong in the kernel changelog must be hand-edited 
out by me, before running scripts to merge your change.


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


Re: [2.6.15 patch] wireless/atmel: add IWENCODEEXT, IWAUTH, and association event support

2006-01-12 Thread Jeff Garzik

Dan Williams wrote:

Hi,

This patch allows the Atmel driver to work correctly with wpa_supplicant
and other programs that require some conformance with WEXT-18.  It
should not affect current behavior of the driver.  The patch does four
things:


applied.

Please don't include the "hi" in your email, I have to hand-edit it out 
before running the patch application scripts.


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


Re: [PATCH netdev-2.6 0/3] e100: driver update

2006-01-12 Thread Jeff Garzik

Jeff Kirsher wrote:

e100 driver update

Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>

1. Fix TX hang and RMCP Ping issue (due to a microcode loading issue)
2. Handle the return values from pci_* functions
3. e100 whitespace fixes


e100 submission is the same as e1000 :(

Content is good, but you used wonky MIME attachments and git-applymbox 
blows up.


Once you figure out a good patch submission method for e1000, please 
repeat it with this e100 patch series.


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


Re: [PATCH netdev-2.6 01/39] e1000: Fix jumbo frame performance

2006-01-12 Thread Jeff Garzik

Jeff Kirsher wrote:

Fix jumbo frame performance

Partition PBA for Jumbo frames based on MTU size.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>


nooo ;-) ;-)

The patch content looks good, but two process problems:

Problem 1) Test application of the very first patch fails:

[EMAIL PROTECTED] netdev-2.6]$ git-applymbox /g/tmp/mbox ~/info/signoff.txt
1 patch(es) to process.

Applying 'e1000: Fix jumbo frame performance'

error: patch failed: drivers/net/e1000/e1000_main.c:43
error: drivers/net/e1000/e1000_main.c: patch does not apply

Manual application with "patch -sp1 < mbox" succeeds, which means that 
git(1) is once again being more strict than patch(1).  /me grumbles in 
the general direction of git developers...  :)



Problem 2) You include the patch twice, once inline as a reviewable 
patch (good), and once as a base64-encoded plaintext attachment (bad). 
Please simply eliminate the attachment.



So, I am now faced with applying 39 patches by hand, manually pasting in 
the changelog for each one, not something I am highly motivated to do.


We need to fix Intel's patch submission process to ensure that (a) 
git-applymbox doesn't reject the patches, and (b) only a single copy of 
each patch accompanies each email.


A highly recommended alternative would be to follow the example of James 
Ketrenos(sp?) at Intel, who pushes ipw driver updates to me via git. 
All you need is an http, rsync, or git server somewhere.


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


Re: pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Bill Nottingham
Bill Nottingham ([EMAIL PROTECTED]) said: 
> I remember looking at this a while back. I think the corrected information
> is only being propagated to the 'vendor' file, and the write_config_word
> isn't actually updating the 'config' entry in sysfs.

Ah, here's an example from the box I remember working on this on
(without the libpci change):

[EMAIL PROTECTED] :00:0c.0]# pwd
/sys/bus/pci/devices/:00:0c.0
[EMAIL PROTECTED] :00:0c.0]# lspci | grep 0c.0
00:0c.0 Ethernet controller: Trident Microsystems 4DWave DX (rev 26)
[EMAIL PROTECTED] :00:0c.0]# lspci -n | grep 0c.0
00:0c.0 Class 0200: 1023:2000 (rev 26)
[EMAIL PROTECTED] :00:0c.0]# cat vendor
0x1022
[EMAIL PROTECTED] :00:0c.0]# cat device
0x2000
[EMAIL PROTECTED] :00:0c.0]# od -x config
000 2310 0020 4701 8002 2600 0002 0048 
020 01f0 ff00 0070 21c3    
040        
060  10c3     1101 06ff
100        
*
400

Note that the config space is different than the vendor file. This
was with 2.6.9-ish, I don't have the box around any more to confirm
with something more recent.

Bill
-
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: pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Bill Nottingham
Matthew Wilcox ([EMAIL PROTECTED]) said: 
> On Thu, Jan 12, 2006 at 01:57:14PM -0700, Matthew Wilcox wrote:
> > On Thu, Jan 12, 2006 at 08:49:42PM +, Daniel Drake wrote:
> > > interesting:
> > > 
> > > http://forums.gentoo.org/viewtopic-t-420013-highlight-trident.html
> > > 
> > > The user saw the correct vendor ID (AMD) in 2.4, but when upgrading to 
> > > 2.6, it changed to Trident.
> > 
> > It looks to me like there used to be a quirk that knew about this bug
> > and fixed it.
> > 
> > The reason I say this is that the lspci -x dumps are the same -- both
> > featuring the wrong vendor ID.  Want to dig through 2.4 and look for
> > this quirk?
> 
> Oh -- found it.  It's still in 2.6:
> 
> static void
> fixup_broken_pcnet32(struct pci_dev* dev)
> {
> if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
> dev->vendor = PCI_VENDOR_ID_AMD;
> pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
> }
> }
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID,   
>   
> fixup_broken_pcnet32);
> 
> Wonder why it isn't working now ... someone with a PPC box needs to check
> (a) whether this function is being called and (b) if it is called, why
> it's not doing what it's supposed to.

I remember looking at this a while back. I think the corrected information
is only being propagated to the 'vendor' file, and the write_config_word
isn't actually updating the 'config' entry in sysfs.

If you remove the "#if 0" from lib/sysfs.c in pciutils, it should
start reporting the corrected value in base lspci, etc.

Bill
-
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: WCONF, netlink based WE replacement.

2006-01-12 Thread Michael Buesch
On Thursday 12 January 2006 22:00, you wrote:
> On Thu, Jan 12, 2006 at 09:04:24PM +0100, Michael Buesch wrote:
> > On Thursday 12 January 2006 20:43, you wrote:
> > > On Thu, 12 Jan 2006 19:55:39 +0100, Michael Buesch wrote:
> > > > > This ieee80211_device structure is redundant, wconf_device etc. should
> > > > > be in ieee80211_hw.
> > > > 
> > > > Well, ieee80211_device is basically a hackish replacement for the
> > > > currently used net_device, which we use for the master device.
> > > > See the comment.
> > > 
> > > Master net_device should be replaced by ieee80211_hw.
> > 
> > Whatever.
> > 
> > > > > What is WCONF_CMD_NICK for?
> > > > 
> > > > Just for users convenience, like the nick in WE.
> > > 
> > > Is it really useful?
> > 
> > No :)
> > 
> 
> Is the point here to support all current WEXT functionality?

Yes, plus all additionally stuff, which we need to figure out. ;)

> It probably should be.  For compatibility, we will likely need code
> to translate the WEXT ioctls to the netlink stuff.  The ioctl to
> change the nickname will need someplace to go.  So, useless or not,
> I think the WCONF_CMD_NICK is appropriate.

Well, it is nice to have a human readable name for a device.
Althought kernel space is maybe a suboptimal place to
implement such stuff.

> > > We don't have anything like this for e. g. Ethernet 
> > > devices.
> > > 
> > > > > Do we really need private commands?
> > > > 
> > > > yes, I _really_ think so.
> > > > The bcm43xx driver has some device specific stuff to configure
> > > > for example.
> > > 
> > > I don't know what is that stuff, so I can be wrong (probably some
> > > clarification will help, if this won't take you much time). But if it is
> > > something at least theoretically general (e. g. your card is the only
> > > one implementing that command but it is mentioned in the standard), it
> > > should be implemented in ieee80211.
> > 
> > Well, I don't really want to list specific stuff here,
> > as it is a general design decision.
> > I really don't think we should remove the private interface and
> > force drivers to use yet another incompatible new API _if_ they
> > have the need for such a private configuration task.
> 
> I sympathize with the need for "side configuration" and wanting to
> avoid using multiple APIs.  Still, what is the fundamental difference
> between private netlink messages and private ioctls?  If it were
> coded as an ioctl, it would be generally derided.

The difference is that we want a, yet to be written, userspace
counterpart of the API. Do we really want to deal with ioctls
in the program managing the private handlers? I don't think so.
The private netlink command mechanism is very lean and has basically
additional cost, as it is built on top of the standard message mechanism.
(It only needs an additional generic struct in the message union.
I forgot to add it)

> If you can use sysfs for any necessary private configuration then I
> think that is what is needed.  You will need a custom tool for your
> custom configuration anyway (unless you plan to pollute iproute2 or
> whatever), so using a different API shouldn't be an undue burden.
> 
> If sysfs just doesn't meet the needs and it just has to be netlink,
> then perhaps we can entertain the private netlink messages later?
> For now, I would prefer not to endorse the idea of using them.

Ok, the private messages are of very low priority and were only
meant as an additional cookie (as they are easily implemented
on top of the standard handlers).

So the next step would be to clone WE functionality, but
avoiding such (IMHO ugly) stuff like IWENCODE(EXT)?

-- 
Greetings Michael.


pgpBm1Oo5NsVK.pgp
Description: PGP signature


Re: [RFC]: IPsec tunnel wildcard addresses

2006-01-12 Thread David S. Miller
From: Herbert Xu <[EMAIL PROTECTED]>
Date: Fri, 13 Jan 2006 08:06:00 +1100

> The only reason I mentioned doing it in userspace is that it gives us
> a little bit more flexibility since userspace can choose a different
> method to pick the source address.

Note that userspace could override and do something with the zero
source address before the kernel ever gets to see it.

This behavior in the kernel is in line with how socket binding works,
and it's not a bad fallback in the case where we do see a zero tunnel
source addres which frankly has no other sane semantic than the one
Patrick has given to it.

The main point is that putting zero tunnel source address handling
into the kernel does not preclude at all userspace doing something
interesting with it as well.

Therefore I think Patrick's initial kernel patch makes a lot of sense.
-
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: pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Lennart Sorensen
On Thu, Jan 12, 2006 at 08:49:42PM +, Daniel Drake wrote:
> On the subject of pcnet32 and the invalid vendor ID, you may find this 
> interesting:
> 
> http://forums.gentoo.org/viewtopic-t-420013-highlight-trident.html
> 
> The user saw the correct vendor ID (AMD) in 2.4, but when upgrading to 
> 2.6, it changed to Trident.
> 
> I guess this is still likely to be a hardware bug, but it demonstrates 
> that the Linux PCI layer has something to do with it (even if it is just 
> triggering it somehow).

Perhaps there is a significant different in the pcnet32.c files between
the two versions.  I also remember that there is some powerpc specific
code in there related to MAC address detection.  There are certainly
differences in 2.4 and 2.6's version of the driver, maybe something is
broken in the newer one when run on powerpc.  I don't run gentoo and
have no idea how to get a hold of the source of pcnet32.c from each of
those two.

It does seem odd that only the pcnet32 has the pci ID change, but at the
same time, somehow the driver is recognizing it and loading at boot
time, so the ID can't be wrong at that time.  Does the ID get mangled as
part of what makes the MAC addresses read incorrectly on your 2.6.14?
The 2.4 system shows all the cards overriding the MAC based on the PROM,
which I believe is what the driver code should do on a powerpc system.
On 2.6 that appears to only happen on one of the cards.  At least on
that device (pci 01:01) appears to agree what the MAC should be in both
cases.

Perhaps the lspci being wrong is just a side effect of the real problem.
Maybe the driver is broken and messing things up.

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: pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Matthew Wilcox
On Thu, Jan 12, 2006 at 01:57:14PM -0700, Matthew Wilcox wrote:
> On Thu, Jan 12, 2006 at 08:49:42PM +, Daniel Drake wrote:
> > interesting:
> > 
> > http://forums.gentoo.org/viewtopic-t-420013-highlight-trident.html
> > 
> > The user saw the correct vendor ID (AMD) in 2.4, but when upgrading to 
> > 2.6, it changed to Trident.
> 
> It looks to me like there used to be a quirk that knew about this bug
> and fixed it.
> 
> The reason I say this is that the lspci -x dumps are the same -- both
> featuring the wrong vendor ID.  Want to dig through 2.4 and look for
> this quirk?

Oh -- found it.  It's still in 2.6:

static void
fixup_broken_pcnet32(struct pci_dev* dev)
{
if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
dev->vendor = PCI_VENDOR_ID_AMD;
pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, 
fixup_broken_pcnet32);

Wonder why it isn't working now ... someone with a PPC box needs to check
(a) whether this function is being called and (b) if it is called, why
it's not doing what it's supposed to.
-
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: [RFC]: IPsec tunnel wildcard addresses

2006-01-12 Thread Herbert Xu
On Thu, Jan 12, 2006 at 01:35:35PM +0100, Patrick McHardy wrote:
> 
> That shouldn't be the deciding reason. although its certainly true.
> The advantage of doing this in the kernel is that it hopefully works
> transparently with any keying daemon, but as the racoon patch shows,
> its quite easy to do this in userspace. I'm fine either way, so
> someone else please decide :)

Well I'm not that bothered so I'll leave it up to you :)

The only reason I mentioned doing it in userspace is that it gives us
a little bit more flexibility since userspace can choose a different
method to pick the source address.

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


[PATCH] Clean up comments for sk_chk_filter()

2006-01-12 Thread Kris Katterjohn
This removes redundant comments, and moves one comment to a better location.

Signed-off-by: Kris Katterjohn <[EMAIL PROTECTED]>

We all ready know the filter must end with a RET instruction because it says so
in the header comment for sk_chk_filter(). And I think the header comment is a
better place to say that the jumps are always forward.

-EINVAL is always returned for an error, so we'd might as well just say that.

Let me know what you think. Thanks!

--- x/net/core/filter.c 2006-01-12 14:13:21.0 -0600
+++ y/net/core/filter.c 2006-01-12 14:50:54.0 -0600
@@ -287,7 +287,9 @@ load_b:
  * no references or jumps that are out of range, no illegal
  * instructions, and must end with a RET instruction.
  *
- * Returns 0 if the rule set is legal or a negative errno code if not.
+ * All jumps are forward as they are not signed.
+ *
+ * Returns 0 if the rule set is legal or -EINVAL if not.
  */
 int sk_chk_filter(struct sock_filter *filter, int flen)
 {
@@ -299,7 +301,6 @@ int sk_chk_filter(struct sock_filter *fi
 
/* check the filter code now */
for (pc = 0; pc < flen; pc++) {
-   /* all jumps are forward as they are not signed */
ftest = &filter[pc];
 
/* Only allow valid instructions */
@@ -383,11 +384,6 @@ int sk_chk_filter(struct sock_filter *fi
}
}
 
-   /*
-* The program must end with a return. We don't care where they
-* jumped within the script (its always forwards) but in the end
-* they _will_ hit this.
-*/
 return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
 }
 


-
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: pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Daniel Drake

Matthew Wilcox wrote:

It looks to me like there used to be a quirk that knew about this bug
and fixed it.

The reason I say this is that the lspci -x dumps are the same -- both
featuring the wrong vendor ID.


Good catch. I didn't notice this.

> Want to dig through 2.4 and look for

this quirk?


No time for this personally.

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: WCONF, netlink based WE replacement.

2006-01-12 Thread John W. Linville
On Thu, Jan 12, 2006 at 09:04:24PM +0100, Michael Buesch wrote:
> On Thursday 12 January 2006 20:43, you wrote:
> > On Thu, 12 Jan 2006 19:55:39 +0100, Michael Buesch wrote:
> > > > This ieee80211_device structure is redundant, wconf_device etc. should
> > > > be in ieee80211_hw.
> > > 
> > > Well, ieee80211_device is basically a hackish replacement for the
> > > currently used net_device, which we use for the master device.
> > > See the comment.
> > 
> > Master net_device should be replaced by ieee80211_hw.
> 
> Whatever.
> 
> > > > What is WCONF_CMD_NICK for?
> > > 
> > > Just for users convenience, like the nick in WE.
> > 
> > Is it really useful?
> 
> No :)
> 

Is the point here to support all current WEXT functionality?
It probably should be.  For compatibility, we will likely need code
to translate the WEXT ioctls to the netlink stuff.  The ioctl to
change the nickname will need someplace to go.  So, useless or not,
I think the WCONF_CMD_NICK is appropriate.

> > We don't have anything like this for e. g. Ethernet 
> > devices.
> > 
> > > > Do we really need private commands?
> > > 
> > > yes, I _really_ think so.
> > > The bcm43xx driver has some device specific stuff to configure
> > > for example.
> > 
> > I don't know what is that stuff, so I can be wrong (probably some
> > clarification will help, if this won't take you much time). But if it is
> > something at least theoretically general (e. g. your card is the only
> > one implementing that command but it is mentioned in the standard), it
> > should be implemented in ieee80211.
> 
> Well, I don't really want to list specific stuff here,
> as it is a general design decision.
> I really don't think we should remove the private interface and
> force drivers to use yet another incompatible new API _if_ they
> have the need for such a private configuration task.

I sympathize with the need for "side configuration" and wanting to
avoid using multiple APIs.  Still, what is the fundamental difference
between private netlink messages and private ioctls?  If it were
coded as an ioctl, it would be generally derided.

If you can use sysfs for any necessary private configuration then I
think that is what is needed.  You will need a custom tool for your
custom configuration anyway (unless you plan to pollute iproute2 or
whatever), so using a different API shouldn't be an undue burden.

If sysfs just doesn't meet the needs and it just has to be netlink,
then perhaps we can entertain the private netlink messages later?
For now, I would prefer not to endorse the idea of using them.

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: pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Matthew Wilcox
On Thu, Jan 12, 2006 at 08:49:42PM +, Daniel Drake wrote:
> interesting:
> 
> http://forums.gentoo.org/viewtopic-t-420013-highlight-trident.html
> 
> The user saw the correct vendor ID (AMD) in 2.4, but when upgrading to 
> 2.6, it changed to Trident.

It looks to me like there used to be a quirk that knew about this bug
and fixed it.

The reason I say this is that the lspci -x dumps are the same -- both
featuring the wrong vendor ID.  Want to dig through 2.4 and look for
this quirk?
-
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


pcnet32 devices with incorrect trident vendor ID

2006-01-12 Thread Daniel Drake

Jon Mason wrote:

Some pcnet32 hardware erroneously has the Vendor ID for Trident.  The
pcnet32 driver looks for the PCI ethernet class before grabbing the
hardware, but the current trident driver does not check against the
PCI audio class.  This allows the trident driver to claim the pcnet32 
hardware.  This patch prevents that.


On the subject of pcnet32 and the invalid vendor ID, you may find this 
interesting:


http://forums.gentoo.org/viewtopic-t-420013-highlight-trident.html

The user saw the correct vendor ID (AMD) in 2.4, but when upgrading to 
2.6, it changed to Trident.


I guess this is still likely to be a hardware bug, but it demonstrates 
that the Linux PCI layer has something to do with it (even if it is just 
triggering it somehow).


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: WCONF, netlink based WE replacement.

2006-01-12 Thread Michael Buesch
On Thursday 12 January 2006 20:43, you wrote:
> On Thu, 12 Jan 2006 19:55:39 +0100, Michael Buesch wrote:
> > > This ieee80211_device structure is redundant, wconf_device etc. should
> > > be in ieee80211_hw.
> > 
> > Well, ieee80211_device is basically a hackish replacement for the
> > currently used net_device, which we use for the master device.
> > See the comment.
> 
> Master net_device should be replaced by ieee80211_hw.

Whatever.

> > > What is WCONF_CMD_NICK for?
> > 
> > Just for users convenience, like the nick in WE.
> 
> Is it really useful?

No :)

> We don't have anything like this for e. g. Ethernet 
> devices.
> 
> > > Do we really need private commands?
> > 
> > yes, I _really_ think so.
> > The bcm43xx driver has some device specific stuff to configure
> > for example.
> 
> I don't know what is that stuff, so I can be wrong (probably some
> clarification will help, if this won't take you much time). But if it is
> something at least theoretically general (e. g. your card is the only
> one implementing that command but it is mentioned in the standard), it
> should be implemented in ieee80211.

Well, I don't really want to list specific stuff here,
as it is a general design decision.
I really don't think we should remove the private interface and
force drivers to use yet another incompatible new API _if_ they
have the need for such a private configuration task.

> Real device-specific stuff (like 
> firmware flashing) can be done through sysfs then.

Why this extra complexity?
One think I'd like to see (well, keep) is that a wireless device
can be configured >>in a whole<< through one well known
interface. Including private card configuration.

We currently set the interference mitigation mode through
a private WE. We can argue, if the Radio Interference
Mitigation conf should be implemented as a standard command... .
We also set a few other things (don't remember them now) and I know
that there are still lots of finetuning parameters hardcoded, which
could be made available through this private interface.

We also have a function to burn (and read) the SPROM though a
private handler, atm. I consider this a very device specific task,
which does not really need a standard API. Noone will ever reflash
the SPROM, if he has no good good good reasons. ;)

Imagine device-specific firmware tuning parameters.

> > > Do we really want frequency to be set from userspace?
> > 
> > Yes, I think so. The user must be able to switch channels
> > manually (frequency == channel).
> 
> I didn't mean channels, just frequencies. To be conformal with standards
> and regulations, we can allow specific frequencies only. Those
> frequencies are unambiguously mapped to channels anyway (you have to
> specify a band of course). So I see no point in specifying frequencies
> from userspace, channels should be enough.

Ah, I understand what you mean and I agree.
I thought there was a reason for freq selection in WE. Does
not seem so, though... .

> > This is supposed to be a well-defined API
> > and a different behaviour is simply considered a bug.
> > I don't see how you can reduce the possibility of such bugs
> > by doing callbacks.
> > My point is: I think of simple "commands" which do one thing
> > at a time. I do not want to implement such beasts like IWENCODEEXT
> > in the first place, which make misbehaviour by slightly different
> > implementations easily possible.
> > If we have one command for each task, it is easily possible
> > to get them right. It is also much easier to implement.
> > If we have a WCONF_CMD_KEY and a corresponding struct:
> > struct wconf_cmd_key {
> > __u8 index;
> > __u8 key[LEN];
> > };
> > there is not much to get wrong. Especially if it is documented
> > very well.
> > The current encryption algorithms (WEP, WPA, etc..) would be set
> > previously through some seperate WCONF_CMD_CRYPTALG or something
> > like that.
> 
> Ok.
> 
> > That is not implemented.
> > a magic "dest" string "all" could be used instead
> > of the specific interface.
> 
> Wouldn't it mean "all interfaces on all wireless cards"?

Yes. Need to think about it... It's too late now :P

> And what in the 
> case you have some interface named "all"?

Simply disallow this special case. :P

> > We also need more "global" calls to wconf, like
> > a user query for a list of all available interfaces, etc..
> 
> It can be determined from sysfs, do we really need to implement it as a
> netlink command too?

Well, I think at least a simple listing of all available
interfaces should be implemented through netlink, to
ease the userspace program a lot. Otherwise we would always
have to deal with two APIs (sysfs and netlink) to get the simplest
stuff done.
I don't think there is a need for another device-unbound function.
Anyone?

-- 
Greetings Michael.


pgpcjA5YRm2mO.pgp
Description: PGP signature


Re: [patch] drivers/net/3c59x: notice carrier a little sooner

2006-01-12 Thread Dan Williams
On Thu, 2006-01-12 at 20:57 +0100, Steffen Klassert wrote:
> Did you give the patch a try?
> 
> Actually I have no possibility to test, but
> I think that netif_carrier_{on,off} still does not
> work proper. The timer function does just nothing
> if vp->medialock is set.
> 
Worked for me with 3c905 card in a Dell Latitude C610.  I just c&p'd the
code into the vortex, so maybe vortex is different than boomerang.
Anyway, shouldn't the timer be run a bit later after the *_rx()
function?

Dan

> Steffen
> 
> 
> On Thu, Jan 12, 2006 at 01:29:23PM -0500, Dan Williams wrote:
> > Hi,
> > 
> > This patch attempts to notice carrier 'on' state a little sooner.  Since
> > the carrier watchdog only fires in really, really long intervals (like,
> > 60s in most cases), it takes up to 60s to notice that a cable has been
> > plugged/unplugged.  This patch fires the carrier watchdog if (1) the
> > carrier is off, and (2) packets have been successfully received.

-
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] drivers/net/wireless: correct reported ssid lengths

2006-01-12 Thread Dan Williams
Hi,

ESSIDs can technically include NULL characters.  Drivers should not be
adjusting the length of the ESSID before reporting it in their
SIOCGIWESSID handlers.  Breaks stuff like wpa_supplicant.  Note that ipw
drivers, which seem to currently be the "most correct", don't have this
problem.

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>

--- a/drivers/net/wireless/atmel.c.ssid-fix 2006-01-12 13:31:22.0 
-0500
+++ b/drivers/net/wireless/atmel.c  2006-01-12 13:40:48.0 -0500
@@ -1680,11 +1680,11 @@
if (priv->new_SSID_size != 0) {
memcpy(extra, priv->new_SSID, priv->new_SSID_size);
extra[priv->new_SSID_size] = '\0';
-   dwrq->length = priv->new_SSID_size + 1;
+   dwrq->length = priv->new_SSID_size;
} else {
memcpy(extra, priv->SSID, priv->SSID_size);
extra[priv->SSID_size] = '\0';
-   dwrq->length = priv->SSID_size + 1;
+   dwrq->length = priv->SSID_size;
}
 
dwrq->flags = !priv->connect_to_any_BSS; /* active */
--- a/drivers/net/wireless/ray_cs.c.ssid-fix2006-01-12 13:37:08.0 
-0500
+++ b/drivers/net/wireless/ray_cs.c 2006-01-12 13:37:26.0 -0500
@@ -1256,7 +1256,7 @@
extra[IW_ESSID_MAX_SIZE] = '\0';
 
/* Push it out ! */
-   dwrq->length = strlen(extra) + 1;
+   dwrq->length = strlen(extra);
dwrq->flags = 1; /* active */
 
return 0;
--- a/drivers/net/wireless/airo.c.ssid-fix  2006-01-12 13:30:30.0 
-0500
+++ b/drivers/net/wireless/airo.c   2006-01-12 13:41:15.0 -0500
@@ -5783,7 +5783,7 @@
/* If none, we may want to get the one that was set */
 
/* Push it out ! */
-   dwrq->length = status_rid.SSIDlen + 1;
+   dwrq->length = status_rid.SSIDlen;
dwrq->flags = 1; /* active */
 
return 0;
--- a/drivers/net/wireless/prism54/isl_ioctl.c.ssid-fix 2006-01-12 
13:36:36.0 -0500
+++ b/drivers/net/wireless/prism54/isl_ioctl.c  2006-01-12 13:36:57.0 
-0500
@@ -748,7 +748,7 @@
if (essid->length) {
dwrq->flags = 1;/* set ESSID to ON for Wireless 
Extensions */
/* if it is to big, trunk it */
-   dwrq->length = min(IW_ESSID_MAX_SIZE, essid->length + 1);
+   dwrq->length = min(IW_ESSID_MAX_SIZE, essid->length);
} else {
dwrq->flags = 0;
dwrq->length = 0;
--- a/drivers/net/wireless/wavelan_cs.c.ssid-fix2006-01-12 
13:38:22.0 -0500
+++ b/drivers/net/wireless/wavelan_cs.c 2006-01-12 13:38:26.0 -0500
@@ -2280,7 +2280,7 @@
extra[IW_ESSID_MAX_SIZE] = '\0';
 
/* Set the length */
-   wrqu->data.length = strlen(extra) + 1;
+   wrqu->data.length = strlen(extra);
 
return 0;
 }


-
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] drivers/net/3c59x: notice carrier a little sooner

2006-01-12 Thread Steffen Klassert
Did you give the patch a try?

Actually I have no possibility to test, but
I think that netif_carrier_{on,off} still does not
work proper. The timer function does just nothing
if vp->medialock is set.

Steffen


On Thu, Jan 12, 2006 at 01:29:23PM -0500, Dan Williams wrote:
> Hi,
> 
> This patch attempts to notice carrier 'on' state a little sooner.  Since
> the carrier watchdog only fires in really, really long intervals (like,
> 60s in most cases), it takes up to 60s to notice that a cable has been
> plugged/unplugged.  This patch fires the carrier watchdog if (1) the
> carrier is off, and (2) packets have been successfully received.
-
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: WCONF, netlink based WE replacement.

2006-01-12 Thread Jiri Benc
On Thu, 12 Jan 2006 19:55:39 +0100, Michael Buesch wrote:
> > This ieee80211_device structure is redundant, wconf_device etc. should
> > be in ieee80211_hw.
> 
> Well, ieee80211_device is basically a hackish replacement for the
> currently used net_device, which we use for the master device.
> See the comment.

Master net_device should be replaced by ieee80211_hw.

> > What is WCONF_CMD_NICK for?
> 
> Just for users convenience, like the nick in WE.

Is it really useful? We don't have anything like this for e. g. Ethernet
devices.

> > Do we really need private commands?
> 
> yes, I _really_ think so.
> The bcm43xx driver has some device specific stuff to configure
> for example.

I don't know what is that stuff, so I can be wrong (probably some
clarification will help, if this won't take you much time). But if it is
something at least theoretically general (e. g. your card is the only
one implementing that command but it is mentioned in the standard), it
should be implemented in ieee80211. Real device-specific stuff (like
firmware flashing) can be done through sysfs then.

> > Do we really want frequency to be set from userspace?
> 
> Yes, I think so. The user must be able to switch channels
> manually (frequency == channel).

I didn't mean channels, just frequencies. To be conformal with standards
and regulations, we can allow specific frequencies only. Those
frequencies are unambiguously mapped to channels anyway (you have to
specify a band of course). So I see no point in specifying frequencies
from userspace, channels should be enough.

> This is supposed to be a well-defined API
> and a different behaviour is simply considered a bug.
> I don't see how you can reduce the possibility of such bugs
> by doing callbacks.
> My point is: I think of simple "commands" which do one thing
> at a time. I do not want to implement such beasts like IWENCODEEXT
> in the first place, which make misbehaviour by slightly different
> implementations easily possible.
> If we have one command for each task, it is easily possible
> to get them right. It is also much easier to implement.
> If we have a WCONF_CMD_KEY and a corresponding struct:
> struct wconf_cmd_key {
>   __u8 index;
>   __u8 key[LEN];
> };
> there is not much to get wrong. Especially if it is documented
> very well.
> The current encryption algorithms (WEP, WPA, etc..) would be set
> previously through some seperate WCONF_CMD_CRYPTALG or something
> like that.

Ok.

> That is not implemented.
> a magic "dest" string "all" could be used instead
> of the specific interface.

Wouldn't it mean "all interfaces on all wireless cards"? And what in the
case you have some interface named "all"?

> We also need more "global" calls to wconf, like
> a user query for a list of all available interfaces, etc..

It can be determined from sysfs, do we really need to implement it as a
netlink command too?


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


  1   2   >