Re: SiS190 on ASUS. monodirectional traffic

2006-01-09 Thread Marco Atzeri
On Mon, Jan 09, 2006 at 12:47:06AM +0100, Francois Romieu wrote:
> > In both the two directions I noted that from 1469 and over the loss is 100%
> 
> 4 bytes too soon. Sh*t.
> 
> Can you try the patch below and send the dump of a simple
> for i in $(seq 1467 1473); do ping -c 1 -s $i 192.168.1.2; done

patch applied, I started the laptop with a linux-cd distro
(RIP 14.7) kernel 2.6.14-rc3-git7
no ethereal available but I added tcpdump on the laptop

So I uploaded two new log

ethereal_asus_txt
tcpdump_lap.txt

I see that from 1469 and over the ASUS do not recognize the ping request

 grep ICMP  ethereal_asus.txt 

0.000227 192.168.1.252 -> 192.168.1.2  ICMP Echo (ping) request
0.000271  192.168.1.2 -> 192.168.1.252 ICMP Echo (ping) reply
0.002089 192.168.1.252 -> 192.168.1.2  ICMP Echo (ping) request
0.002104  192.168.1.2 -> 192.168.1.252 ICMP Echo (ping) reply
40.016546 192.168.1.252 -> 192.168.1.2  IP Fragmented IP protocol 
(proto=ICMP 0x01, off=1480)

> Any chance you could do the test with a tethereal/linux on both side ?
> 
> diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
> index 478791e..bf6f188 100644
> --- a/drivers/net/sis190.c
> +++ b/drivers/net/sis190.c
> @@ -602,7 +602,7 @@ static int sis190_rx_interrupt(struct ne
>   sis190_give_to_asic(desc, tp->rx_buf_sz);
>   else {
>   struct sk_buff *skb = tp->Rx_skbuff[entry];
> - int pkt_size = (status & RxSizeMask) - 4;
> + int pkt_size = status & RxSizeMask;
>   void (*pci_action)(struct pci_dev *, dma_addr_t,
>   size_t, int) = pci_dma_sync_single_for_device;
>  

-- 
   marco.atzeri at fastwebnet.it

La prima delle Frequently Asked Questions: 
dove sono le FAQ ?  it.faq
-
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] net: 32 bit (socket layer) ioctl emulation for 64 bit kernels

2006-01-09 Thread Arnd Bergmann
On Monday 09 January 2006 06:46, Shaun Pereira wrote:
> Hi all,
> The attached patch is a follow up to a post made earlier to this site
> with regard to 32 bit (socket layer) ioctl emulation for 64 bit kernels.

Ok, cool. Note that I also posted a longer series of patches that does
this and much more. Unfortunately, I have suspended working on it for
now, so it's probably better to first get your stuff in.

> I needed to implement 32 bit userland ioctl support for modular (x.25)
> socket ioctls in a 64 bit kernel. With the removal of the
> register_ioctl32_conversion() function from the kernel, one of the
> suggestions made by Andi was "to just extend the socket code to add a
> compat_ioctl vector to the socket options"
> 
> With Arnd's help (see previous mails with subject = 32 bit (socket
> layer) ioctl emulation for 64 bit kernels) I have prepared the following
> patchand tested with with x25 over tcp on a x26_64 kernel. 
> 
> Since we are interested in ioctl's from userspace I have not added the 
> .compat_ioctl function pointer to struct net_device. The assumption
> being once the userspace data has reached the kernel via the socket api,
> if the socket layer protocol knows how to handle the data, it will
> prepare it for the device.

I think we need to have it in the long run, but if you don't need it
for x25, then it's not your call to implement net_device->compat_ioctl.
I've been thinking about how to get it right before, but did not
reach a proper conclusion, since dev_ioctl is called in so many places
that would all need to be changed for this.

> Am not too sure whether struct proto requires modification. Since it is 
> allocated dynamically in the protocol layer I have left it alone;no
> compat_ioctl. Also it seems like the socket layer would know how to
> "ioctl" the transport layer, userspace does not need to know about
> this? 

The proto ioctls are all forwarded from sock ioctls, so in theory
it would be needed. 

> But if any of this is incorrect and needs to be changed please advise 
> and I will make the changes accordingly. If this patch is accepted I 
> would be in a position to submit a patch for x25 (32 bit userspace 
> for 64 bit kernel). 

Please post that patch now as well, just make a series out of this
socket compat_ioctl patch and your x25 patch so it becomes clear
that they depend on each other. It should be easier to justify the
infrastructure patch when there is an actual user for it ;-)

> @@ -143,6 +143,10 @@ struct proto_ops {
>   struct poll_table_struct *wait);
> int (*ioctl) (struct socket *sock, unsigned int cmd,
>   unsigned long arg);
> +#ifdef CONFIG_COMPAT
> +   int (*compat_ioctl) (struct socket *sock, unsigned int 
> cmd,
> + unsigned long arg);
> +#endif
> int (*listen)(struct socket *sock, int len);
> int (*shutdown)  (struct socket *sock, int flags);
> int (*setsockopt)(struct socket *sock, int level,
...
> +
> +#define SOCKOPS_COMPAT_WRAP(name, fam)   
> \
> +SOCKCALL_WRAP(name, release, (struct socket *sock), (sock))  \
> +SOCKCALL_WRAP(name, bind, (struct socket *sock, struct sockaddr *uaddr,
> int addr_len), \
> +   (sock, uaddr, addr_len))  

I really don't like the way you are extending the SOCKCALL_WRAP
mechanism like this. Ideally, you should convert the x25 layer to
not need SOCKOPS_WRAP at all.
Besides x25, only four other users of this remain, all others have
gotten rid of it. If you have a really good reason to keep it, it's
probably easier to add the compat_ioctl method unconditionally so
you don't need two different version of SOCKOPS_WRAP.
Making it unconditional would also help with those protocols that
have only compatible ioctl handlers and could then also point
.compat_ioctl to their native ioctl method without needing #ifdef
around it.

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] net: 32 bit (socket layer) ioctl emulation for 64 bit kernels

2006-01-09 Thread Arnaldo Carvalho de Melo
On 1/9/06, Arnd Bergmann <[EMAIL PROTECTED]> wrote:
> On Monday 09 January 2006 06:46, Shaun Pereira wrote:

> > Since we are interested in ioctl's from userspace I have not added the
> > .compat_ioctl function pointer to struct net_device. The assumption
> > being once the userspace data has reached the kernel via the socket api,
> > if the socket layer protocol knows how to handle the data, it will
> > prepare it for the device.
>
> I think we need to have it in the long run, but if you don't need it
> for x25, then it's not your call to implement net_device->compat_ioctl.
> I've been thinking about how to get it right before, but did not
> reach a proper conclusion, since dev_ioctl is called in so many places
> that would all need to be changed for this.

Nowadays dev_ioctl is only called from one funcion: sock_ioctl in
net/socket.c, this is after a recent changeset by hch.

- Arnaldo
-
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] running tcpdump on 3c905b causes freeze (reproducable)

2006-01-09 Thread Andrew Morton
Folkert van Heusden <[EMAIL PROTECTED]> wrote:
>
> My system freezes (crashes) when I run tcpdump on the interface
>  connected to a 3c905b card.

Works for me with a 3c980-TX.  I can dig out a 905b.

Please send the exact commands which you're using to demonstrate this -
sufficient info for me to get as close as possible to what you're doing.

Have you tried enabling the NMI watchdog?  Enable CONFIG_X86_LOCAL_APIC and
boot with `nmi_watchdog=1' on the command line, make sure that the NMI line
of /proc/interrupts is incrementing.

-
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] rt2x00core: fix mismatched rwsem calls

2006-01-09 Thread Olaf Kirch
I'm not sure if netdev is the right list to post problems in
this driver to, but here we go...

Subject: rt2x00core: fix mismatched rwsem calls

 rt2x00_update_config pairs a down_write with an up_read call
 on the same semaphore.

 Similarly, rt2x00_link_down pairs a down_read call with an
 up_write call.

Signed-off-by: Olaf Kirch <[EMAIL PROTECTED]>

 rt2x00core.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: rt2x00-2.0.0-b3/rt2x00core.c
===
--- rt2x00-2.0.0-b3.orig/rt2x00core.c
+++ rt2x00-2.0.0-b3/rt2x00core.c
@@ -93,7 +93,7 @@ rt2x00_update_config(struct _rt2x00_devi
if(likely(update_flags))
device->handler->dev_update_config(device, &core->config, 
update_flags);
 
-   up_read(&device->rt2x00_sem);
+   up_write(&device->rt2x00_sem);
 
clear_bit(DEVICE_CONFIG_UPDATE, &device->flags);
 }
@@ -1709,7 +1709,7 @@ rt2x00_link_down(struct _rt2x00_device *
dev_set_promiscuity(device->net_dev, -1);
}
 
-   up_write(&device->rt2x00_sem);
+   up_read(&device->rt2x00_sem);
 
rt2x00_disconnect(device);
 

-- 
Olaf Kirch   |  --- o --- Nous sommes du soleil we love when we play
[EMAIL PROTECTED] |/ | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax
-
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] running tcpdump on 3c905b causes freeze (reproducable)

2006-01-09 Thread Folkert van Heusden
> > My system freezes (crashes) when I run tcpdump on the interface
> >  connected to a 3c905b card.
> Works for me with a 3c980-TX.  I can dig out a 905b.
> Please send the exact commands which you're using to demonstrate this -
> sufficient info for me to get as close as possible to what you're doing.

The exact command is:
tcpdump -i eth1

Yes, it is that simple. Not only tcpdump gives this problem; iftop as
well.

> Have you tried enabling the NMI watchdog?  Enable CONFIG_X86_LOCAL_APIC and
> boot with `nmi_watchdog=1' on the command line, make sure that the NMI line
> of /proc/interrupts is incrementing.

I'll give it a try. I've added it to the append-line in the lilo config.
Am now compiling the kernel.


Folkert van Heusden

-- 
Try MultiTail! Multiple windows with logfiles, filtered with regular
expressions, colored output, etc. etc. www.vanheusden.com/multitail/
--
Get your PGP/GPG key signed at www.biglumber.com!
--
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
-
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] ipw2100: support WEXT-18 enc_capa

2006-01-09 Thread Dan Williams
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]>

--- ipw2100.c.nowpa 2006-01-08 14:04:00.0 -0500
+++ ipw2100.c   2006-01-08 15:47:37.0 -0500
@@ -7236,7 +7236,7 @@
 
/* Set the Wireless Extension versions */
range->we_version_compiled = WIRELESS_EXT;
-   range->we_version_source = 16;
+   range->we_version_source = 18;
 
 //  range->retry_capa;  /* What retry options are supported */
 //  range->retry_flags; /* How to decode max/min retry limit */
@@ -7262,6 +7262,11 @@
}
range->num_frequency = val;
 
+#if WIRELESS_EXT > 17
+   range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
+   IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
+#endif /* WIRELESS_EXT > 17 */
+
IPW_DEBUG_WX("GET Range\n");
 
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] smc91x: allow for dynamic bus access configs

2006-01-09 Thread Jeff Garzik

Nicolas Pitre wrote:
All accessor's different methods are now selected with C code and unused 
ones statically optimized away at compile time instead of being selected 
with #if's and #ifdef's.  This has many advantages such as allowing the 
compiler to validate the syntax of the whole code, making it cleaner and 
easier to understand, and ultimately allowing people to define 
configuration symbols in terms of variables if they really want to 
dynamically support multiple bus configurations at the same time (with 
the unavoidable performance cost).


Signed-off-by: Nicolas Pitre <[EMAIL PROTECTED]>


OK, but patch doesn't apply:


Applying 'smc91x: allow for dynamic bus access configs'

error: patch failed: drivers/net/smc91x.h:342
error: drivers/net/smc91x.h: 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] ipw2100: support WEXT-18 enc_capa

2006-01-09 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]>

--- ipw2100.c.nowpa 2006-01-08 14:04:00.0 -0500
+++ ipw2100.c   2006-01-08 15:47:37.0 -0500
@@ -7236,7 +7236,7 @@
 
 	/* Set the Wireless Extension versions */

range->we_version_compiled = WIRELESS_EXT;
-   range->we_version_source = 16;
+   range->we_version_source = 18;
 
 //  range->retry_capa;  /* What retry options are supported */

 //  range->retry_flags; /* How to decode max/min retry limit */
@@ -7262,6 +7262,11 @@
}
range->num_frequency = val;
 
+#if WIRELESS_EXT > 17

+   range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
+   IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
+#endif /* WIRELESS_EXT > 17 */


please resend without this ifdef.

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


[patch] ipw2100: support WEXT-18 enc_capa v2

2006-01-09 Thread Dan Williams
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]>

--- ipw2100.c.nowpa 2006-01-08 14:04:00.0 -0500
+++ ipw2100.c   2006-01-08 15:47:37.0 -0500
@@ -7236,7 +7236,7 @@
 
/* Set the Wireless Extension versions */
range->we_version_compiled = WIRELESS_EXT;
-   range->we_version_source = 16;
+   range->we_version_source = 18;
 
 //  range->retry_capa;  /* What retry options are supported */
 //  range->retry_flags; /* How to decode max/min retry limit */
@@ -7262,6 +7262,9 @@
}
range->num_frequency = val;
 
+   range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
+   IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
+
IPW_DEBUG_WX("GET Range\n");
 
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] ipw2100: support WEXT-18 enc_capa v2

2006-01-09 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]>

--- ipw2100.c.nowpa 2006-01-08 14:04:00.0 -0500
+++ ipw2100.c   2006-01-08 15:47:37.0 -0500


Malformed patch:

Applying 'ipw2100: support WEXT-18 enc_capa v2'

error: ipw2100.c: does not exist in index

Please resend in correct format (applies with 'patch -sp1').

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


[patch] ipw2100: support WEXT-18 enc_capa v3

2006-01-09 Thread Dan Williams
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]>

--- a/drivers/net/wireless/ipw2100.c2006-01-08 14:04:00.0 -0500
+++ b/drivers/net/wireless/ipw2100.c2006-01-08 15:47:37.0 -0500
@@ -7236,7 +7236,7 @@
 
/* Set the Wireless Extension versions */
range->we_version_compiled = WIRELESS_EXT;
-   range->we_version_source = 16;
+   range->we_version_source = 18;
 
 //  range->retry_capa;  /* What retry options are supported */
 //  range->retry_flags; /* How to decode max/min retry limit */
@@ -7262,6 +7262,9 @@
}
range->num_frequency = val;
 
+   range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
+   IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
+
IPW_DEBUG_WX("GET Range\n");
 
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


[PATCH] ipw2200 - do not sleep in ipw_request_direct_scan

2006-01-09 Thread Olaf Kirch
Hi,

We have been seeing frequent deadlocks involving wpa_supplicant on an
ipw2200 card, which rendered the system close to unusable. The scenario
is

 -  wpa_supplicant requests a network scan
 -  For some odd reason, the SCAN_COMPLETED notification never
arrives, possibly because the device loses the beacon and
disassociates, or because something is missing a wake_up
call.
 -  ifconfig etc block in state D
 -  events/0 blocks

Here's my analysis so far:

wpa_supplicant triggers the scan via an ioctl. This calls dev_ioctl, which
takes the rtnl_lock, then the ipw2200 interface's priv->sem.  finds there
is a scan in progress, and goes to sleep until the other scan is complete.

This causes frequent deadlocks: wpa_supplicant triggers the scan, and
blocks. Note that this will first take the rtnl_lock (this is an
ioctl), and then the ipw2200 interface's priv->sem.

The ipw2200 worker thread also tries to do something and blocks on
priv->sem.

events/0 is trying run the linkwatch_queue (net/core/link_watch.c),
and tries to take the rtnl lock but blocks as well. While it does that,
it holds the lock_cpu_hotplug() lock for its CPU, effectively blocking
all sorts of other tasks that try to perform a flush_workqueue on some
work queue.

For sysrq-t ouput and other details, see
https://bugzilla.novell.com/show_bug.cgi?id=133513

What really surprised me was how much of the system a driver can take
down by simply blocking in an ioctl...

And now for a patch - I'm still waiting for feedback on whether this
fixes the problem for good.

-8<- cut here 
Subject: ipw2200 - do not sleep in ipw_request_direct_scan

 Drivers should not sleep for very long inside an ioctl -
 so return EAGAIN and let wpa_supplicant handle the problem.

Signed-off-by: Olaf Kirch <[EMAIL PROTECTED]>

 drivers/net/wireless/ipw2200.c |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

Index: linux-2.6.15/drivers/net/wireless/ipw2200.c
===
--- linux-2.6.15.orig/drivers/net/wireless/ipw2200.c
+++ linux-2.6.15/drivers/net/wireless/ipw2200.c
@@ -8940,14 +8940,12 @@ static int ipw_request_direct_scan(struc
IPW_DEBUG_HC("starting request direct scan!\n");
 
if (priv->status & (STATUS_SCANNING | STATUS_SCAN_ABORTING)) {
-   err = wait_event_interruptible(priv->wait_state,
-  !(priv->
-status & (STATUS_SCANNING |
-  
STATUS_SCAN_ABORTING)));
-   if (err) {
-   IPW_DEBUG_HC("aborting direct scan");
-   goto done;
-   }
+   /* We should not sleep here; otherwise we will block most
+* of the system (for instance, we hold rtnl_lock when we
+* get here).
+*/
+   err = -EAGAIN;
+   goto done;
}
memset(&scan, 0, sizeof(scan));
 
-8<- cut here 

-- 
Olaf Kirch   |  --- o --- Nous sommes du soleil we love when we play
[EMAIL PROTECTED] |/ | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax
-
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


Subject: spidernet: fix missing include

2006-01-09 Thread Arnd Bergmann
Including in.h 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


cs89x0: fix setting of ALLOW_DMA

2006-01-09 Thread Lennert Buytenhek
There's an ifdef in cs89x0.c that seems to have been the wrong way round
since it was merged (and noone seems to have noticed) -- the IXDP2x01
doesn't support ISA-style DMA, but when building for IXDP2x01, cs89x0's
ALLOW_DMA is set to 1, and when building for another platform, ALLOW_DMA
is set to 0.

rmk proposed replacing CONFIG_ARCH_IXDP2X01 with CONFIG_ISA_DMA_API.  Ok?

Signed-off-by: Lennert Buytenhek <[EMAIL PROTECTED]>

--- linux-2.6.15/drivers/net/cs89x0.c.orig  2006-01-08 21:35:35.0 
+0100
+++ linux-2.6.15/drivers/net/cs89x0.c   2006-01-08 21:35:53.0 +0100
@@ -100,7 +100,7 @@
  * Note that even if DMA is turned off we still support the 'dma' and  
'use_dma'
  * module options so we don't break any startup scripts.
  */
-#ifndef CONFIG_ARCH_IXDP2X01
+#ifndef CONFIG_ISA_DMA_API
 #define ALLOW_DMA  0
 #else
 #define ALLOW_DMA  1
-
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


[git patches] 2.6.x net driver updates

2006-01-09 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:

 Documentation/networking/bonding.txt |2 
 MAINTAINERS  |1 
 drivers/net/3c503.c  |   16 +--
 drivers/net/Kconfig  |4 
 drivers/net/ac3200.c |   16 +--
 drivers/net/bonding/bonding.h|8 -
 drivers/net/e1000/e1000_param.c  |   10 +-
 drivers/net/e2100.c  |   14 +-
 drivers/net/es3210.c |   14 +-
 drivers/net/forcedeth.c  |  164 +--
 drivers/net/gianfar.h|4 
 drivers/net/hp-plus.c|   12 +-
 drivers/net/hp.c |   12 +-
 drivers/net/ibm_emac/ibm_emac.h  |3 
 drivers/net/ibm_emac/ibm_emac_core.c |2 
 drivers/net/lance.c  |   22 ++--
 drivers/net/lne390.c |   14 +-
 drivers/net/mv643xx_eth.c|2 
 drivers/net/ne.c |   18 +--
 drivers/net/ne2.c|   16 +--
 drivers/net/sk98lin/skge.c   |  129 ---
 drivers/net/smc-ultra.c  |   24 ++---
 drivers/net/tulip/tulip_core.c   |2 
 drivers/net/wd.c |   14 +-
 drivers/net/wireless/ipw2100.c   |5 -
 net/ieee80211/ieee80211_crypt_wep.c  |   61 +
 net/ieee80211/ieee80211_tx.c |2 
 net/ieee80211/ieee80211_wx.c |2 
 28 files changed, 341 insertions(+), 252 deletions(-)

Adrian Bunk:
  drivers/net/Kconfig: indentation fix
  drivers/net/bonding/bonding.h: "extern inline" -> "static inline"
  drivers/net/gianfar.h: "extern inline" -> "static inline"

Ayaz Abdulla:
  forcedeth: TSO fix for large buffers

Christoph Dworzak:
  tulip: enable multiport NIC BIOS fixups for x86_64

Dan Williams:
  [patch] ipw2100: support WEXT-18 enc_capa v3

Denis Vlasenko:
  fix a few "warning: 'cleanup_card' defined but not used"

Eric Paris:
  update bonding.txt to not show ip address on slaves

Eugene Surovegin:
  PPC44x EMAC driver: disable TX status deferral in half-duplex mode

Franck:
  Add MIPS dependency for dm9000 driver

Johannes Berg:
  ieee80211: enable hw wep where host has to build IV

Kenji Kaneshige:
  e1000: Fix invalid memory reference

Olaf Hering:
  remove bouncing mail address of mv643xx_eth maintainer

Stephen Hemminger:
  sk98lin: routine called from probe marked __init
  sk98lin: not doing high dma properly
  sk98lin: error handling on dual port board
  sk98lin: use kzalloc
  sk98lin: error handling on probe
  sk98lin: error handling of pci setup

diff --git a/Documentation/networking/bonding.txt 
b/Documentation/networking/bonding.txt
index b0fe41d..8d8b4e5 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -945,7 +945,6 @@ bond0 Link encap:Ethernet  HWaddr 00
   collisions:0 txqueuelen:0
 
 eth0  Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4
-  inet addr:XXX.XXX.XXX.YYY  Bcast:XXX.XXX.XXX.255  Mask:255.255.252.0
   UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
   RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0
   TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0
@@ -953,7 +952,6 @@ eth0  Link encap:Ethernet  HWaddr 00
   Interrupt:10 Base address:0x1080
 
 eth1  Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4
-  inet addr:XXX.XXX.XXX.YYY  Bcast:XXX.XXX.XXX.255  Mask:255.255.252.0
   UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
   RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0
   TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0
diff --git a/MAINTAINERS b/MAINTAINERS
index 76dc820..270e28c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1697,7 +1697,6 @@ S: Maintained
 
 MARVELL MV64340 ETHERNET DRIVER
 P: Manish Lachwani
-M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 L: netdev@vger.kernel.org
 S: Supported
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c
index 5c5eebd..dcc98af 100644
--- a/drivers/net/3c503.c
+++ b/drivers/net/3c503.c
@@ -148,14 +148,6 @@ el2_pio_probe(struct net_device *dev)
 return -ENODEV;
 }
 
-static void cleanup_card(struct net_device *dev)
-{
-   /* NB: el2_close() handles free_irq */
-   release_region(dev->base_addr, EL2_IO_EXTENT);
-   if (ei_status.mem)
-   iounmap(ei_status.mem);
-}
-
 #ifndef MODULE
 struct net_device * __init el2_probe(int unit)
 {
@@ -726,6 +718,14 @@ init_module(void)
return -ENXIO;
 }
 
+static void cleanup_card(struct net_device *dev)
+{
+   /* NB: el2_close() handles free_irq */
+   release_region(dev->base_addr, EL2_IO_EXTENT);
+   if (ei_status.mem)
+   iounmap(ei_status.mem);
+}
+
 void
 cle

Re: [Bcm43xx-dev] [Fwd: State of the Union: Wireless]

2006-01-09 Thread Ingo Oeser
David S. Miller wrote:
> From: David Lang <[EMAIL PROTECTED]>
> Date: Fri, 6 Jan 2006 14:16:17 -0800 (PST)
> 
> > character devices are far easier to script. this really sounds like the 
> > type of configuration stuff that sysfs was designed for. can we avoid yet 
> > another configuration tool that's required?
> 
> netlink is being recommended exactly because it can result
> in only needing one tool for everything

Yes, iproute2 rocks!

I recently discovered that it can do "xfrm" stuff and was amazed to
see that the developer(s) had a big clue about what we like to
see (and what is human readable), if we type "ip xfrm state" 
and "ip xfrm policy" as opposed to "setkey -D" and "setkey -PD".

So I can only hope that netlink and iproute will be chosen as a way
to represent it to the user, just because of the clueful developers of
iproute2.


Regards

Ingo Oeser

-
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] smc91x: allow for dynamic bus access configs

2006-01-09 Thread Nicolas Pitre
On Mon, 9 Jan 2006, Jeff Garzik wrote:

> Nicolas Pitre wrote:
> > All accessor's different methods are now selected with C code and unused
> > ones statically optimized away at compile time instead of being selected
> > with #if's and #ifdef's.  This has many advantages such as allowing the
> > compiler to validate the syntax of the whole code, making it cleaner and
> > easier to understand, and ultimately allowing people to define configuration
> > symbols in terms of variables if they really want to dynamically support
> > multiple bus configurations at the same time (with the unavoidable
> > performance cost).
> > 
> > Signed-off-by: Nicolas Pitre <[EMAIL PROTECTED]>
> 
> OK, but patch doesn't apply:
> 
> 
> Applying 'smc91x: allow for dynamic bus access configs'
> 
> error: patch failed: drivers/net/smc91x.h:342
> error: drivers/net/smc91x.h: patch does not apply

Gah...  Resynched patch follows.


Nicolas
-
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] smc91x: allow for dynamic bus access configs

2006-01-09 Thread Nicolas Pitre
All accessor's different methods are now selected with C code and unused 
ones statically optimized away at compile time instead of being selected 
with #if's and #ifdef's.  This has many advantages such as allowing the 
compiler to validate the syntax of the whole code, making it cleaner and 
easier to understand, and ultimately allowing people to define 
configuration symbols in terms of variables if they really want to 
dynamically support multiple bus configurations at the same time (with 
the unavoidable performance cost).

Signed-off-by: Nicolas Pitre <[EMAIL PROTECTED]>

---

Index: linux-2.6/drivers/net/smc91x.c
===
--- linux-2.6.orig/drivers/net/smc91x.c
+++ linux-2.6/drivers/net/smc91x.c
@@ -215,15 +215,12 @@ struct smc_local {
 
spinlock_t lock;
 
-#ifdef SMC_CAN_USE_DATACS
-   u32 __iomem *datacs;
-#endif
-
 #ifdef SMC_USE_PXA_DMA
/* DMA needs the physical address of the chip */
u_long physaddr;
 #endif
void __iomem *base;
+   void __iomem *datacs;
 };
 
 #if SMC_DEBUG > 0
@@ -2104,9 +2101,8 @@ static int smc_enable_device(struct plat
 * Set the appropriate byte/word mode.
 */
ecsr = readb(addr + (ECSR << SMC_IO_SHIFT)) & ~ECSR_IOIS8;
-#ifndef SMC_CAN_USE_16BIT
-   ecsr |= ECSR_IOIS8;
-#endif
+   if (SMC_CAN_USE_16BIT)
+   ecsr |= ECSR_IOIS8;
writeb(ecsr, addr + (ECSR << SMC_IO_SHIFT));
local_irq_restore(flags);
 
@@ -2143,40 +2139,39 @@ static void smc_release_attrib(struct pl
release_mem_region(res->start, ATTRIB_SIZE);
 }
 
-#ifdef SMC_CAN_USE_DATACS
-static void smc_request_datacs(struct platform_device *pdev, struct net_device 
*ndev)
+static inline void smc_request_datacs(struct platform_device *pdev, struct 
net_device *ndev)
 {
-   struct resource * res = platform_get_resource_byname(pdev, 
IORESOURCE_MEM, "smc91x-data32");
-   struct smc_local *lp = netdev_priv(ndev);
+   if (SMC_CAN_USE_DATACS) {
+   struct resource * res = platform_get_resource_byname(pdev, 
IORESOURCE_MEM, "smc91x-data32");
+   struct smc_local *lp = netdev_priv(ndev);
 
-   if (!res)
-   return;
+   if (!res)
+   return;
 
-   if(!request_mem_region(res->start, SMC_DATA_EXTENT, CARDNAME)) {
-   printk(KERN_INFO "%s: failed to request datacs memory 
region.\n", CARDNAME);
-   return;
-   }
+   if(!request_mem_region(res->start, SMC_DATA_EXTENT, CARDNAME)) {
+   printk(KERN_INFO "%s: failed to request datacs memory 
region.\n", CARDNAME);
+   return;
+   }
 
-   lp->datacs = ioremap(res->start, SMC_DATA_EXTENT);
+   lp->datacs = ioremap(res->start, SMC_DATA_EXTENT);
+   }
 }
 
 static void smc_release_datacs(struct platform_device *pdev, struct net_device 
*ndev)
 {
-   struct smc_local *lp = netdev_priv(ndev);
-   struct resource * res = platform_get_resource_byname(pdev, 
IORESOURCE_MEM, "smc91x-data32");
+   if (SMC_CAN_USE_DATACS) {
+   struct smc_local *lp = netdev_priv(ndev);
+   struct resource * res = platform_get_resource_byname(pdev, 
IORESOURCE_MEM, "smc91x-data32");
 
-   if (lp->datacs)
-   iounmap(lp->datacs);
+   if (lp->datacs)
+   iounmap(lp->datacs);
 
-   lp->datacs = NULL;
+   lp->datacs = NULL;
 
-   if (res)
-   release_mem_region(res->start, SMC_DATA_EXTENT);
+   if (res)
+   release_mem_region(res->start, SMC_DATA_EXTENT);
+   }
 }
-#else
-static void smc_request_datacs(struct platform_device *pdev, struct net_device 
*ndev) {}
-static void smc_release_datacs(struct platform_device *pdev, struct net_device 
*ndev) {}
-#endif
 
 /*
  * smc_init(void)
Index: linux-2.6/drivers/net/smc91x.h
===
--- linux-2.6.orig/drivers/net/smc91x.h
+++ linux-2.6/drivers/net/smc91x.h
@@ -275,7 +275,10 @@ SMC_outw(u16 val, void __iomem *ioaddr, 
 #define SMC_insw(a,r,p,l)  readsw ((void*) ((a) + (r)), p, l)
 #define SMC_outw(v,a,r) ({ writew ((v), (a) + (r)); 
LPD7A40X_IOBARRIER; })
 
-static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)
+#define SMC_outsw  LPD7A40X_SMC_outsw
+
+static inline void LPD7A40X_SMC_outsw(unsigned long a, int r,
+unsigned char* p, int l)
 {
unsigned short* ps = (unsigned short*) p;
while (l-- > 0) {
@@ -342,10 +345,6 @@ static inline void SMC_outsw (unsigned l
 
 #endif
 
-#ifndefSMC_IRQ_FLAGS
-#defineSMC_IRQ_FLAGS   SA_TRIGGER_RISING
-#endif
-
 #ifdef SMC_USE_PXA_DMA
 /*
  * Let's use the DMA engine on the XScale PXA2xx for RX packets. This is
@@ -441,10 +440,85 @@ smc_

[PATCH 2/4][INET_DIAG]: whitespace/simple cleanups

2006-01-09 Thread Arnaldo Carvalho de Melo
Hi David,

 Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.git

Best Regards,

- Arnaldo
tree 774bb91dabc36c0689ca69e9fc99045e895806a8
parent 547f8b8fc1bdf3770a9ff66ff89f55e826db948f
author Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1136826601 -0200
committer Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1136826601 -0200

[INET_DIAG]: whitespace/simple cleanups

Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>

--

 inet_diag.c |   57 -
 1 file changed, 28 insertions(+), 29 deletions(-)

--

diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index c3b3348..4c4ae4a 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -51,8 +51,8 @@ static struct sock *idiagnl;
 	RTA_DATA(__RTA_PUT(skb, attrtype, attrlen))
 
 static int inet_diag_fill(struct sk_buff *skb, struct sock *sk,
-			int ext, u32 pid, u32 seq, u16 nlmsg_flags,
-			const struct nlmsghdr *unlh)
+			  int ext, u32 pid, u32 seq, u16 nlmsg_flags,
+			  const struct nlmsghdr *unlh)
 {
 	const struct inet_sock *inet = inet_sk(sk);
 	const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -77,7 +77,7 @@ static int inet_diag_fill(struct sk_buff
 		if (ext & (1 << (INET_DIAG_INFO - 1)))
 			info = INET_DIAG_PUT(skb, INET_DIAG_INFO,
 	   handler->idiag_info_size);
-		
+
 		if ((ext & (1 << (INET_DIAG_CONG - 1))) && icsk->icsk_ca_ops) {
 			size_t len = strlen(icsk->icsk_ca_ops->name);
 			strcpy(INET_DIAG_PUT(skb, INET_DIAG_CONG, len + 1),
@@ -185,7 +185,8 @@ nlmsg_failure:
 	return -1;
 }
 
-static int inet_diag_get_exact(struct sk_buff *in_skb, const struct nlmsghdr *nlh)
+static int inet_diag_get_exact(struct sk_buff *in_skb,
+			   const struct nlmsghdr *nlh)
 {
 	int err;
 	struct sock *sk;
@@ -283,7 +284,7 @@ static int bitstring_match(const u32 *a1
 
 
 static int inet_diag_bc_run(const void *bc, int len,
-			  const struct inet_diag_entry *entry)
+			const struct inet_diag_entry *entry)
 {
 	while (len > 0) {
 		int yes = 1;
@@ -322,7 +323,7 @@ static int inet_diag_bc_run(const void *
 yes = 0;
 break;
 			}
-			
+
 			if (cond->prefix_len == 0)
 break;
 
@@ -331,7 +332,8 @@ static int inet_diag_bc_run(const void *
 			else
 addr = entry->daddr;
 
-			if (bitstring_match(addr, cond->addr, cond->prefix_len))
+			if (bitstring_match(addr, cond->addr,
+	cond->prefix_len))
 break;
 			if (entry->family == AF_INET6 &&
 			cond->family == AF_INET) {
@@ -346,7 +348,7 @@ static int inet_diag_bc_run(const void *
 		}
 		}
 
-		if (yes) { 
+		if (yes) {
 			len -= op->yes;
 			bc += op->yes;
 		} else {
@@ -407,14 +409,14 @@ static int inet_diag_bc_audit(const void
 		default:
 			return -EINVAL;
 		}
-		bc += op->yes;
+		bc  += op->yes;
 		len -= op->yes;
 	}
 	return len == 0 ? 0 : -EINVAL;
 }
 
 static int inet_diag_dump_sock(struct sk_buff *skb, struct sock *sk,
-			 struct netlink_callback *cb)
+			   struct netlink_callback *cb)
 {
 	struct inet_diag_req *r = NLMSG_DATA(cb->nlh);
 
@@ -445,13 +447,12 @@ static int inet_diag_dump_sock(struct sk
 	}
 
 	return inet_diag_fill(skb, sk, r->idiag_ext, NETLINK_CB(cb->skb).pid,
-			cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh);
+			  cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh);
 }
 
 static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
-			struct request_sock *req,
-			u32 pid, u32 seq,
-			const struct nlmsghdr *unlh)
+			  struct request_sock *req, u32 pid, u32 seq,
+			  const struct nlmsghdr *unlh)
 {
 	const struct inet_request_sock *ireq = inet_rsk(req);
 	struct inet_sock *inet = inet_sk(sk);
@@ -504,7 +505,7 @@ nlmsg_failure:
 }
 
 static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,
-			 struct netlink_callback *cb)
+			   struct netlink_callback *cb)
 {
 	struct inet_diag_entry entry;
 	struct inet_diag_req *r = NLMSG_DATA(cb->nlh);
@@ -556,7 +557,7 @@ static int inet_diag_dump_reqs(struct sk
 	inet6_rsk(req)->loc_addr.s6_addr32 :
 #endif
 	&ireq->loc_addr;
-entry.daddr = 
+entry.daddr =
 #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
 	(entry.family == AF_INET6) ?
 	inet6_rsk(req)->rmt_addr.s6_addr32 :
@@ -599,7 +600,7 @@ static int inet_diag_dump(struct sk_buff
 	handler = inet_diag_table[cb->nlh->nlmsg_type];
 	BUG_ON(handler == NULL);
 	hashinfo = handler->idiag_hashinfo;
-		
+
 	s_i = cb->args[1];
 	s_num = num = cb->args[2];
 
@@ -672,7 +673,6 @@ skip_listen_ht:
 			s_num = 0;
 
 		read_lock_bh(&head->lock);
-
 		num = 0;
 		sk_for_each(sk, node, &head->chain) {
 			struct inet_sock *inet = inet_sk(sk);
@@ -684,7 +684,8 @@ skip_listen_ht:
 			if (r->id.idiag_sport != inet->sport &&
 			r->id.idiag_sport)
 goto next_normal;
-			if (r->id.idiag_dport != inet->dport && r->i

[PATCH 1/4][INET_DIAG]: Use inet_twsk() with TIME_WAIT sockets

2006-01-09 Thread Arnaldo Carvalho de Melo
Hi David,

 Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.git

Best Regards,

- Arnaldo
tree e28be60d944faa8bc8c97f554d39fcb38d64b365
parent 53927b62ae8c8eb2958046ad7660601605ae991d
author Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1136826022 -0200
committer Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1136826022 -0200

[INET_DIAG]: Use inet_twsk() with TIME_WAIT sockets

The fields being accessed in inet_diag_dump are outside sock_common, the
common part of struct sock and struct inet_timewait_sock.

Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>

--

 inet_diag.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--

diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index c499081..c3b3348 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -697,14 +697,14 @@ next_normal:
 		if (r->idiag_states & TCPF_TIME_WAIT) {
 			sk_for_each(sk, node,
 &hashinfo->ehash[i + hashinfo->ehash_size].chain) {
-struct inet_sock *inet = inet_sk(sk);
+const struct inet_timewait_sock *tw = inet_twsk(sk);
 
 if (num < s_num)
 	goto next_dying;
-if (r->id.idiag_sport != inet->sport &&
+if (r->id.idiag_sport != tw->tw_sport &&
 r->id.idiag_sport)
 	goto next_dying;
-if (r->id.idiag_dport != inet->dport &&
+if (r->id.idiag_dport != tw->tw_dport &&
 r->id.idiag_dport)
 	goto next_dying;
 if (inet_diag_dump_sock(skb, sk, cb) < 0) {



[PATCH 3/4][INET_DIAG]: Introduce inet_twsk_diag_dump & inet_twsk_diag_fill

2006-01-09 Thread Arnaldo Carvalho de Melo
Hi David,

 Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.git

Best Regards,

- Arnaldo
tree 61f746002fb4d78f93ead4c3e095b01267c35b1d
parent 20026cb4c8573a36eea417acac80620a98048e70
author Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1136829432 -0200
committer Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1136829432 -0200

[INET_DIAG]: Introduce inet_twsk_diag_dump & inet_twsk_diag_fill

To properly dump TIME_WAIT sockets and to reduce complexity a bit by having
per socket class accessor routines.

Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>

--

 inet_diag.c |  158 ++--
 1 file changed, 111 insertions(+), 47 deletions(-)

--

diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 4c4ae4a..985c573 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -70,20 +70,22 @@ static int inet_diag_fill(struct sk_buff
 	nlh->nlmsg_flags = nlmsg_flags;
 
 	r = NLMSG_DATA(nlh);
-	if (sk->sk_state != TCP_TIME_WAIT) {
-		if (ext & (1 << (INET_DIAG_MEMINFO - 1)))
-			minfo = INET_DIAG_PUT(skb, INET_DIAG_MEMINFO,
-	  sizeof(*minfo));
-		if (ext & (1 << (INET_DIAG_INFO - 1)))
-			info = INET_DIAG_PUT(skb, INET_DIAG_INFO,
-	   handler->idiag_info_size);
-
-		if ((ext & (1 << (INET_DIAG_CONG - 1))) && icsk->icsk_ca_ops) {
-			size_t len = strlen(icsk->icsk_ca_ops->name);
-			strcpy(INET_DIAG_PUT(skb, INET_DIAG_CONG, len + 1),
-			   icsk->icsk_ca_ops->name);
-		}
+	BUG_ON(sk->sk_state == TCP_TIME_WAIT);
+
+	if (ext & (1 << (INET_DIAG_MEMINFO - 1)))
+		minfo = INET_DIAG_PUT(skb, INET_DIAG_MEMINFO, sizeof(*minfo));
+
+	if (ext & (1 << (INET_DIAG_INFO - 1)))
+		info = INET_DIAG_PUT(skb, INET_DIAG_INFO,
+ handler->idiag_info_size);
+
+	if ((ext & (1 << (INET_DIAG_CONG - 1))) && icsk->icsk_ca_ops) {
+		const size_t len = strlen(icsk->icsk_ca_ops->name);
+
+		strcpy(INET_DIAG_PUT(skb, INET_DIAG_CONG, len + 1),
+		   icsk->icsk_ca_ops->name);
 	}
+
 	r->idiag_family = sk->sk_family;
 	r->idiag_state = sk->sk_state;
 	r->idiag_timer = 0;
@@ -93,37 +95,6 @@ static int inet_diag_fill(struct sk_buff
 	r->id.idiag_cookie[0] = (u32)(unsigned long)sk;
 	r->id.idiag_cookie[1] = (u32)(((unsigned long)sk >> 31) >> 1);
 
-	if (r->idiag_state == TCP_TIME_WAIT) {
-		const struct inet_timewait_sock *tw = inet_twsk(sk);
-		long tmo = tw->tw_ttd - jiffies;
-		if (tmo < 0)
-			tmo = 0;
-
-		r->id.idiag_sport = tw->tw_sport;
-		r->id.idiag_dport = tw->tw_dport;
-		r->id.idiag_src[0] = tw->tw_rcv_saddr;
-		r->id.idiag_dst[0] = tw->tw_daddr;
-		r->idiag_state = tw->tw_substate;
-		r->idiag_timer = 3;
-		r->idiag_expires = (tmo * 1000 + HZ - 1) / HZ;
-		r->idiag_rqueue = 0;
-		r->idiag_wqueue = 0;
-		r->idiag_uid = 0;
-		r->idiag_inode = 0;
-#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
-		if (r->idiag_family == AF_INET6) {
-			const struct inet6_timewait_sock *tw6 = inet6_twsk(sk);
-
-			ipv6_addr_copy((struct in6_addr *)r->id.idiag_src,
-   &tw6->tw_v6_rcv_saddr);
-			ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst,
-   &tw6->tw_v6_daddr);
-		}
-#endif
-		nlh->nlmsg_len = skb->tail - b;
-		return skb->len;
-	}
-
 	r->id.idiag_sport = inet->sport;
 	r->id.idiag_dport = inet->dport;
 	r->id.idiag_src[0] = inet->rcv_saddr;
@@ -185,6 +156,62 @@ nlmsg_failure:
 	return -1;
 }
 
+static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
+			   struct sk_buff *skb, int ext, u32 pid,
+			   u32 seq, u16 nlmsg_flags,
+			   const struct nlmsghdr *unlh)
+{
+	long tmo;
+	struct inet_diag_msg *r;
+	const unsigned char *previous_tail = skb->tail;
+	struct nlmsghdr *nlh = NLMSG_PUT(skb, pid, seq,
+	 unlh->nlmsg_type, sizeof(*r));
+
+	r = NLMSG_DATA(nlh);
+	BUG_ON(tw->tw_state != TCP_TIME_WAIT);
+
+	nlh->nlmsg_flags = nlmsg_flags;
+
+	tmo = tw->tw_ttd - jiffies;
+	if (tmo < 0)
+		tmo = 0;
+
+	r->idiag_family	  = tw->tw_family;
+	r->idiag_state	  = tw->tw_state;
+	r->idiag_timer	  = 0;
+	r->idiag_retrans  = 0;
+	r->id.idiag_if	  = tw->tw_bound_dev_if;
+	r->id.idiag_cookie[0] = (u32)(unsigned long)tw;
+	r->id.idiag_cookie[1] = (u32)(((unsigned long)tw >> 31) >> 1);
+	r->id.idiag_sport = tw->tw_sport;
+	r->id.idiag_dport = tw->tw_dport;
+	r->id.idiag_src[0]= tw->tw_rcv_saddr;
+	r->id.idiag_dst[0]= tw->tw_daddr;
+	r->idiag_state	  = tw->tw_substate;
+	r->idiag_timer	  = 3;
+	r->idiag_expires  = (tmo * 1000 + HZ - 1) / HZ;
+	r->idiag_rqueue	  = 0;
+	r->idiag_wqueue	  = 0;
+	r->idiag_uid	  = 0;
+	r->idiag_inode	  = 0;
+#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
+	if (tw->tw_family == AF_INET6) {
+		const struct inet6_timewait_sock *tw6 =
+		inet6_twsk((struct sock *)tw);
+
+		ipv6_addr_copy((struct in6_addr *)r->id.idiag_src,
+			   &

[PATCH 4/4][INET_DIAG]: Introduce sk_diag_fill

2006-01-09 Thread Arnaldo Carvalho de Melo
Hi David,

 Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.git

Best Regards,

- Arnaldo
tree 064901483ba7876e3bc9b4fa8dc9131cfcd9118b
parent 771afe39fecad0e567cd8cc75f6c74a8ff426ab8
author Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1136834604 -0200
committer Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1136834604 -0200

[INET_DIAG]: Introduce sk_diag_fill

To be called from inet_diag_get_exact, also rename inet_diag_fill to
inet_csk_diag_fill, for consistency with inet_twsk_diag_fill.

Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>

--

 inet_diag.c |   34 --
 1 file changed, 24 insertions(+), 10 deletions(-)

--

diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 985c573..457db99 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -50,9 +50,10 @@ static struct sock *idiagnl;
 #define INET_DIAG_PUT(skb, attrtype, attrlen) \
 	RTA_DATA(__RTA_PUT(skb, attrtype, attrlen))
 
-static int inet_diag_fill(struct sk_buff *skb, struct sock *sk,
-			  int ext, u32 pid, u32 seq, u16 nlmsg_flags,
-			  const struct nlmsghdr *unlh)
+static int inet_csk_diag_fill(struct sock *sk,
+			  struct sk_buff *skb,
+			  int ext, u32 pid, u32 seq, u16 nlmsg_flags,
+			  const struct nlmsghdr *unlh)
 {
 	const struct inet_sock *inet = inet_sk(sk);
 	const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -212,6 +213,17 @@ nlmsg_failure:
 	return -1;
 }
 
+static int sk_diag_fill(struct sock *sk, struct sk_buff *skb,
+			int ext, u32 pid, u32 seq, u16 nlmsg_flags,
+			const struct nlmsghdr *unlh)
+{
+	if (sk->sk_state == TCP_TIME_WAIT)
+		return inet_twsk_diag_fill((struct inet_timewait_sock *)sk,
+	   skb, ext, pid, seq, nlmsg_flags,
+	   unlh);
+	return inet_csk_diag_fill(sk, skb, ext, pid, seq, nlmsg_flags, unlh);
+}
+
 static int inet_diag_get_exact(struct sk_buff *in_skb,
 			   const struct nlmsghdr *nlh)
 {
@@ -263,7 +275,7 @@ static int inet_diag_get_exact(struct sk
 	if (!rep)
 		goto out;
 
-	if (inet_diag_fill(rep, sk, req->idiag_ext,
+	if (sk_diag_fill(sk, rep, req->idiag_ext,
 			 NETLINK_CB(in_skb).pid,
 			 nlh->nlmsg_seq, 0, nlh) <= 0)
 		BUG();
@@ -442,8 +454,9 @@ static int inet_diag_bc_audit(const void
 	return len == 0 ? 0 : -EINVAL;
 }
 
-static int inet_diag_dump_sock(struct sk_buff *skb, struct sock *sk,
-			   struct netlink_callback *cb)
+static int inet_csk_diag_dump(struct sock *sk,
+			  struct sk_buff *skb,
+			  struct netlink_callback *cb)
 {
 	struct inet_diag_req *r = NLMSG_DATA(cb->nlh);
 
@@ -473,8 +486,9 @@ static int inet_diag_dump_sock(struct sk
 			return 0;
 	}
 
-	return inet_diag_fill(skb, sk, r->idiag_ext, NETLINK_CB(cb->skb).pid,
-			  cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh);
+	return inet_csk_diag_fill(sk, skb, r->idiag_ext,
+  NETLINK_CB(cb->skb).pid,
+  cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh);
 }
 
 static int inet_twsk_diag_dump(struct inet_timewait_sock *tw,
@@ -694,7 +708,7 @@ static int inet_diag_dump(struct sk_buff
 cb->args[3] > 0)
 	goto syn_recv;
 
-if (inet_diag_dump_sock(skb, sk, cb) < 0) {
+if (inet_csk_diag_dump(sk, skb, cb) < 0) {
 	inet_listen_unlock(hashinfo);
 	goto done;
 }
@@ -750,7 +764,7 @@ skip_listen_ht:
 			if (r->id.idiag_dport != inet->dport &&
 			r->id.idiag_dport)
 goto next_normal;
-			if (inet_diag_dump_sock(skb, sk, cb) < 0) {
+			if (inet_csk_diag_dump(sk, skb, cb) < 0) {
 read_unlock_bh(&head->lock);
 goto done;
 			}



[PATCH] Change memcmp(,,ETH_ALEN) to compare_ether_addr()

2006-01-09 Thread Kris Katterjohn
This changes some memcmp(one,two,ETH_ALEN) to compare_ether_addr(one,two).

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

This is a diff from 2.6.15. It compiles fine and seems to work fine.

Thanks!

--- x/net/8021q/vlan_dev.c  2006-01-02 21:21:10.0 -0600
+++ y/net/8021q/vlan_dev.c  2006-01-09 12:52:46.0 -0600
@@ -214,7 +214,7 @@ int vlan_skb_recv(struct sk_buff *skb, s
 * This allows the VLAN to have a different MAC than the 
underlying
 * device, and still route correctly.
 */
-   if (memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN) 
== 0) {
+   if (!compare_ether_addr(eth_hdr(skb)->h_dest, 
skb->dev->dev_addr)) {
/* It is for our (changed) MAC-address! */
skb->pkt_type = PACKET_HOST;
}

--- x/net/atm/br2684.c  2006-01-02 21:21:10.0 -0600
+++ y/net/atm/br2684.c  2006-01-09 12:53:37.0 -0600
@@ -296,13 +296,13 @@ static inline __be16 br_type_trans(struc
eth = eth_hdr(skb);
 
if (*eth->h_dest & 1) {
-   if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0)
+   if (!compare_ether_addr(eth->h_dest, dev->broadcast))
skb->pkt_type = PACKET_BROADCAST;
else
skb->pkt_type = PACKET_MULTICAST;
}
 
-   else if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
+   else if (compare_ether_addr(eth->h_dest, dev->dev_addr))
skb->pkt_type = PACKET_OTHERHOST;
 
if (ntohs(eth->h_proto) >= 1536)

--- x/net/atm/lec.c 2006-01-02 21:21:10.0 -0600
+++ y/net/atm/lec.c 2006-01-09 12:58:07.0 -0600
@@ -1321,7 +1321,7 @@ static int lane2_associate_req (struct n
 struct sk_buff *skb;
 struct lec_priv *priv = (struct lec_priv*)dev->priv;
 
-if ( memcmp(lan_dst, dev->dev_addr, ETH_ALEN) != 0 )
+if (compare_ether_addr(lan_dst, dev->dev_addr))
 return (0);   /* not our mac address */
 
 kfree(priv->tlvs); /* NULL if there was no previous association */
@@ -1798,7 +1798,7 @@ lec_arp_find(struct lec_priv *priv,
   
 to_return = priv->lec_arp_tables[place];
 while(to_return) {
-if (memcmp(mac_addr, to_return->mac_addr, ETH_ALEN) == 0) {
+if (!compare_ether_addr(mac_addr, to_return->mac_addr)) {
 return to_return;
 }
 to_return = to_return->next;
@@ -2002,7 +2002,7 @@ lec_arp_resolve(struct lec_priv *priv, u
 return priv->mcast_vcc;
 break;
 case 2:  /* LANE2 wants arp for multicast addresses */
-if ( memcmp(mac_to_find, bus_mac, ETH_ALEN) == 0)
+if (!compare_ether_addr(mac_to_find, bus_mac))
 return priv->mcast_vcc;
 break;
 default:

--- x/net/atm/mpc.c 2006-01-02 21:21:10.0 -0600
+++ y/net/atm/mpc.c 2006-01-09 12:54:12.0 -0600
@@ -552,7 +552,7 @@ static int mpc_send_packet(struct sk_buf
goto non_ip; /* Multi-Protocol Over ATM :-) */
 
while (i < mpc->number_of_mps_macs) {
-   if (memcmp(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN), ETH_ALEN) 
== 0)
+   if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + 
i*ETH_ALEN)))
if ( send_via_shortcut(skb, mpc) == 0 )   /* 
try shortcut */
return 0; /* 
success! */
i++;

--- x/net/bluetooth/bnep/core.c 2006-01-02 21:21:10.0 -0600
+++ y/net/bluetooth/bnep/core.c 2006-01-09 12:54:45.0 -0600
@@ -75,7 +75,7 @@ static struct bnep_session *__bnep_get_s
 
list_for_each(p, &bnep_session_list) {
s = list_entry(p, struct bnep_session, list);   
-   if (!memcmp(dst, s->eh.h_source, ETH_ALEN))
+   if (!compare_ether_addr(dst, s->eh.h_source))
return s;
}
return NULL;
@@ -420,10 +420,10 @@ static inline int bnep_tx_frame(struct b
iv[il++] = (struct kvec) { &type, 1 };
len++;
 
-   if (!memcmp(eh->h_dest, s->eh.h_source, ETH_ALEN))
+   if (!compare_ether_addr(eh->h_dest, s->eh.h_source))
type |= 0x01;
 
-   if (!memcmp(eh->h_source, s->eh.h_dest, ETH_ALEN))
+   if (!compare_ether_addr(eh->h_source, s->eh.h_dest))
type |= 0x02;
 
if (type)

--- x/net/bridge/netfilter/ebt_stp.c2006-01-02 21:21:10.0 -0600
+++ y/net/bridge/netfilter/ebt_stp.c2006-01-09 12:55:25.0 -0600
@@ -164,8 +164,8 @@ static int ebt_stp_check(const char *tab
if (datalen != len)
return -EINVAL;
/* Make sure the match only receives stp frames */

Re: [2.6.15] running tcpdump on 3c905b causes freeze (reproducable)

2006-01-09 Thread Folkert van Heusden
> > Have you tried enabling the NMI watchdog?  Enable CONFIG_X86_LOCAL_APIC and
> > boot with `nmi_watchdog=1' on the command line, make sure that the NMI line
> > of /proc/interrupts is incrementing.
> I'll give it a try. I've added it to the append-line in the lilo config.
> Am now compiling the kernel.

No change. Well, that is: the last message on the console now is
"setting eth1 to promiscues mode".


Folkert van Heusden

-- 
Try MultiTail! Multiple windows with logfiles, filtered with regular
expressions, colored output, etc. etc. www.vanheusden.com/multitail/
--
Get your PGP/GPG key signed at www.biglumber.com!
--
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
-
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] bonding: UPDATED hash-table corruption in bond_alb.c

2006-01-09 Thread Jay Vosburgh

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

--- netdev-2.6.git-upstream/drivers/net/bonding/bond_alb.c  2006/01/07 
00:26:11 1.1
+++ netdev-2.6.git-upstream/drivers/net/bonding/bond_alb.c  2006/01/09 
19:55:12
@@ -169,9 +169,9 @@
index = next_index;
}
 
-   _unlock_tx_hashtbl(bond);
-
tlb_init_slave(slave);
+
+   _unlock_tx_hashtbl(bond);
 }
 
 /* Must be called before starting the monitor timer */
--- netdev-2.6.git-upstream/drivers/net/bonding/bonding.h   2006/01/07 
00:26:11 1.1
+++ netdev-2.6.git-upstream/drivers/net/bonding/bonding.h   2006/01/09 
19:55:42
@@ -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"
 
-
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-09 Thread ODonnell, Michael
IIRC, it was easy to reproduce by cranking the rebalance freq
up (1s or even faster) and also introducing a delay of a few
milliseconds in that bond_alb.c:tlb_clear_slave() routine
between where we drop the lock and call tlb_init_slave()

  --Michael O'Donnell  --  Stratus Technologies, Maynard, MA USA

> -Original Message-
> From: Jay Vosburgh [mailto:[EMAIL PROTECTED] 
> Sent: Monday, January 09, 2006 3:14 PM
> To: [EMAIL PROTECTED]; netdev@vger.kernel.org
> Cc: ODonnell, Michael
> Subject: [PATCH netdev-2.6] bonding: UPDATED hash-table 
> corruption in bond_alb.c
> 
> 
>   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]>
> 
> --- netdev-2.6.git-upstream/drivers/net/bonding/bond_alb.c
> 2006/01/07 00:26:11   1.1
> +++ netdev-2.6.git-upstream/drivers/net/bonding/bond_alb.c
> 2006/01/09 19:55:12
> @@ -169,9 +169,9 @@
>   index = next_index;
>   }
>  
> - _unlock_tx_hashtbl(bond);
> -
>   tlb_init_slave(slave);
> +
> + _unlock_tx_hashtbl(bond);
>  }
>  
>  /* Must be called before starting the monitor timer */
> --- netdev-2.6.git-upstream/drivers/net/bonding/bonding.h 
> 2006/01/07 00:26:11   1.1
> +++ netdev-2.6.git-upstream/drivers/net/bonding/bonding.h 
> 2006/01/09 19:55:42
> @@ -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"
>  
> 
-
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] sk_chk_filter() filter length should be unsigned

2006-01-09 Thread Kris Katterjohn
This makes the filter length in sk_chk_filter() unsigned as it should be.

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

This is a diff from 2.6.15.

The length should never be negative, and if the length were negative, the for
loop would fail.

Thanks!

--- x/net/core/filter.c 2006-01-02 21:21:10.0 -0600
+++ y/net/core/filter.c 2006-01-09 15:22:37.0 -0600
@@ -288,10 +288,10 @@ load_b:
  *
  * Returns 0 if the rule set is legal or a negative errno code if not.
  */
-int sk_chk_filter(struct sock_filter *filter, int flen)
+int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
 {
struct sock_filter *ftest;
-   int pc;
+   unsigned int pc;
 
if (flen == 0 || flen > BPF_MAXINSNS)
return -EINVAL;
@@ -308,7 +308,7 @@ int sk_chk_filter(struct sock_filter *fi
 * Compare this with conditional jumps below,
 * where offsets are limited. --ANK (981016)
 */
-   if (ftest->k >= (unsigned)(flen-pc-1))
+   if (ftest->k >= flen - pc - 1)
return -EINVAL;
} else {
/* for conditionals both must be safe */

--- x/include/linux/filter.h2006-01-02 21:21:10.0 -0600
+++ y/include/linux/filter.h2006-01-09 15:29:27.0 -0600
@@ -145,7 +145,7 @@ struct sock;
 
 extern int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int 
flen);
 extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
-extern int sk_chk_filter(struct sock_filter *filter, int flen);
+extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
 #endif /* __KERNEL__ */
 
 #endif /* __LINUX_FILTER_H__ */


-
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] ax25/mkiss: misc little fixes

2006-01-09 Thread Francois Romieu
Ralf Baechle <[EMAIL PROTECTED]> :
[...]
> No, with your patch the spinlock is dropped only after the
> tty->driver->write() call which might sleep.

@#$!*

Ok, try #2.


- remove duplicate code: mkiss_open() is the sole user of ax_open() and
  it has already issued spin_lock_init() when ax_open() is called;
- mkiss_open() returns err: force it to be < 0 when register_netdev()
  fails;
- missing free_netdev().

Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>

diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index 3e9accf..ac25380 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -638,8 +638,6 @@ static int ax_open(struct net_device *de
 
ax->flags   &= (1 << AXF_INUSE);  /* Clear ESCAPE & ERROR flags */
 
-   spin_lock_init(&ax->buflock);
-
return 0;
 
 noxbuff:
@@ -764,7 +762,8 @@ static int mkiss_open(struct tty_struct 
goto out_free_netdev;
}
 
-   if (register_netdev(dev))
+   err = register_netdev(dev);
+   if (err < 0)
goto out_free_buffers;
 
/* after register_netdev() - because else printk smashes the kernel */
@@ -836,6 +835,8 @@ static void mkiss_close(struct tty_struc
kfree(ax->xbuff);
 
ax->tty = NULL;
+
+   free_netdev(ax->dev);
 }
 
 /* Perform I/O control on an active ax25 channel. */
-
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


cs89x0: fix Kconfig help text

2006-01-09 Thread Lennert Buytenhek
From: Jean Delvare <[EMAIL PROTECTED]>

Fix the help text of the cs89x0 network driver Kconfig entry.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>

--- linux-2.6.15-git.orig/drivers/net/Kconfig   2006-01-09 18:29:50.0 
+0100
+++ linux-2.6.15-git/drivers/net/Kconfig2006-01-09 20:17:33.0 
+0100
@@ -1384,7 +1384,7 @@
 
  To compile this driver as a module, choose M here and read
  .  The module will be
- called cs89x.
+ called cs89x0.
 
 config TC35815
tristate "TOSHIBA TC35815 Ethernet support"
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4][INET_DIAG]: Use inet_twsk() with TIME_WAIT sockets

2006-01-09 Thread David S. Miller
From: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
Date: Mon, 9 Jan 2006 17:29:16 -0200

> [INET_DIAG]: Use inet_twsk() with TIME_WAIT sockets
> 
> The fields being accessed in inet_diag_dump are outside sock_common, the
> common part of struct sock and struct inet_timewait_sock.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>

All 4 patches applied, thanks.

How long have we had these inet_twsk() bugs? :-)
-
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] Change memcmp(,,ETH_ALEN) to compare_ether_addr()

2006-01-09 Thread David S. Miller
From: "Kris Katterjohn" <[EMAIL PROTECTED]>
Date: Mon, 9 Jan 2006 11:48:49 -0800

> This changes some memcmp(one,two,ETH_ALEN) to compare_ether_addr(one,two).
> 
> Signed-off-by: Kris Katterjohn <[EMAIL PROTECTED]>

Patch doesn't apply, in fact due to a patch you merged to me
the other day :-)

> --- x/net/atm/br2684.c2006-01-02 21:21:10.0 -0600
> +++ y/net/atm/br2684.c2006-01-09 12:53:37.0 -0600
> @@ -296,13 +296,13 @@ static inline __be16 br_type_trans(struc
>   eth = eth_hdr(skb);
>  
>   if (*eth->h_dest & 1) {

This now uses is_multicast_ether_addr().

Please resubmit your patch against current GIT, thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4][INET_DIAG]: Use inet_twsk() with TIME_WAIT sockets

2006-01-09 Thread Arnaldo Carvalho de Melo
On 1/9/06, David S. Miller <[EMAIL PROTECTED]> wrote:
> From: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
> Date: Mon, 9 Jan 2006 17:29:16 -0200
>
> > [INET_DIAG]: Use inet_twsk() with TIME_WAIT sockets
> >
> > The fields being accessed in inet_diag_dump are outside sock_common, the
> > common part of struct sock and struct inet_timewait_sock.
> >
> > Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
>
> All 4 patches applied, thanks.
>
> How long have we had these inet_twsk() bugs? :-)

I don't wanna even check that, but its over six months, I'd say, I
guess not that many
people use ss... I guess I should just bite this bullet and convert
net-tools to use netlink 8)

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


Fw: [Bugme-new] [Bug 5857] New: errors in ppp

2006-01-09 Thread Andrew Morton

ppp regression.


Begin forwarded message:

Date: Mon, 9 Jan 2006 06:48:39 -0800
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Bugme-new] [Bug 5857] New: errors in ppp


http://bugzilla.kernel.org/show_bug.cgi?id=5857

   Summary: errors in ppp
Kernel Version: 2.6.15
Status: NEW
  Severity: normal
 Owner: [EMAIL PROTECTED]
 Submitter: [EMAIL PROTECTED]


Most recent kernel where this bug did not occur: 2.6.14.5
Distribution: fedora core 4 with updates
Hardware Environment: amd64
Software Environment: ppp 2.4.2-7
Problem Description: when use ppp with wvdial ppp doesn't work and in dmesg
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
skb_over_panic: text:88052ce1 len:1 put:1 head:81003e875000
data:81013e875002 tail:81013e875003 end:81003e875600
dev:--- [cut here ] - [please bite here ] -
Kernel BUG at net/core/skbuff.c:94
invalid operand:  [1]
CPU 0
Modules linked in: ppp_async ppp_generic slhc ohci_hcd ehci_hcd 8139too ne2k_pci
8390 usbcore sata_nv libata
Pid: 3, comm: events/0 Not tainted 2.6.15 #18
RIP: 0010:[] {skb_over_panic+75}
RSP: 0018:81003fea9de8  EFLAGS: 00010092
RAX: 009a RBX: 81013e875002 RCX: 80311290
RDX: 80311290 RSI: 0001 RDI: 81003f978240
RBP: 810039b09800 R08: 36357068 R09: 810037d410c0
R10: 0010 R11: 0010 R12: 8100396265d6
R13: 8100396261d6 R14: 0001 R15: 0003
FS:  2aac19c0() GS:8039f800() knlGS:
CS:  0010 DS: 0018 ES: 0018 CR0: 8005003b
CR2: 003a30691c30 CR3: 39ae9000 CR4: 06e0
Process events/0 (pid: 3, threadinfo 81003fea8000, task 81003ff80710)
Stack: 81013e875003 81003e875600 802d8be3 81013e875003
   81013e875003 88052ce9 0b2b 810039626000
   0202 810039626000
Call Trace:{:ppp_async:ppp_asynctty_receive+496}
   {worker_thread+0} 
{flush_to_ldisc+192}
   {worker_thread+343}
{default_wake_function+0}
   {worker_thread+0} {kthread+205}
   {child_rip+8} {kthread+0}
   {child_rip+0}

Code: 0f 0b 68 16 4f 2e 80 c2 5e 00 48 83 c4 28 c3 51 49 89 d2 48
RIP {skb_over_panic+75} RSP 
 <6>

Steps to reproduce: use wvdial with ppp and kernel 2.6.15, with 2.6.14.5 it work
correctly

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.
-
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] congestion and af_ops can be const

2006-01-09 Thread Stephen Hemminger
The congestion ops and af_ops in the inet_connection_sock
can be const.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- pro-2.6.orig/include/net/inet_connection_sock.h
+++ pro-2.6/include/net/inet_connection_sock.h
@@ -83,8 +83,8 @@ struct inet_connection_sock {
struct timer_list icsk_delack_timer;
__u32 icsk_rto;
__u32 icsk_pmtu_cookie;
-   struct tcp_congestion_ops *icsk_ca_ops;
-   struct inet_connection_sock_af_ops *icsk_af_ops;
+   const struct tcp_congestion_ops *icsk_ca_ops;
+   const struct inet_connection_sock_af_ops *icsk_af_ops;
unsigned int  (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
__u8  icsk_ca_state;
__u8  icsk_retransmits;
-
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] congestion and af_ops can be const

2006-01-09 Thread Arnaldo Carvalho de Melo
On 1/9/06, Stephen Hemminger <[EMAIL PROTECTED]> wrote:
> The congestion ops and af_ops in the inet_connection_sock
> can be const.
>
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

Signed-off-by: Arnaldo Carvalho de Melo <[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/7] net_em: sparse warning fix

2006-01-09 Thread Stephen Hemminger
Get rid of sparse warning in em_meta API.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- pro-2.6.orig/net/sched/em_meta.c
+++ pro-2.6/net/sched/em_meta.c
@@ -384,7 +384,7 @@ META_COLLECTOR(int_sk_sndbuf)
 META_COLLECTOR(int_sk_alloc)
 {
SKIP_NONLOCAL(skb);
-   dst->value = skb->sk->sk_allocation;
+   dst->value = (__force unsigned long) skb->sk->sk_allocation;
 }
 
 META_COLLECTOR(int_sk_route_caps)

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
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 7/7] ipmr: sparse warning

2006-01-09 Thread Stephen Hemminger
Cleanup sparse warning where ipmr is doing dev ioctl.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- pro-2.6.orig/net/ipv4/ipmr.c
+++ pro-2.6/net/ipv4/ipmr.c
@@ -140,9 +140,10 @@ struct net_device *ipmr_new_tunnel(struc
p.iph.ihl = 5;
p.iph.protocol = IPPROTO_IPIP;
sprintf(p.name, "dvmrp%d", v->vifc_vifi);
-   ifr.ifr_ifru.ifru_data = (void*)&p;
+   ifr.ifr_ifru.ifru_data = (void __user *) &p;
 
-   oldfs = get_fs(); set_fs(KERNEL_DS);
+   oldfs = get_fs();
+   set_fs(KERNEL_DS);
err = dev->do_ioctl(dev, &ifr, SIOCADDTUNNEL);
set_fs(oldfs);
 

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
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/7] bonding: sparse fix

2006-01-09 Thread Stephen Hemminger
Cleanup sparse warnings in the bonding driver.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- pro-2.6.orig/drivers/net/bonding/bond_main.c
+++ pro-2.6/drivers/net/bonding/bond_main.c
@@ -593,7 +593,7 @@ static int bond_update_speed_duplex(stru
ioctl = slave_dev->do_ioctl;
strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
etool.cmd = ETHTOOL_GSET;
-   ifr.ifr_data = (char*)&etool;
+   ifr.ifr_data = (void __user *) &etool;
if (!ioctl || (IOCTL(slave_dev, &ifr, SIOCETHTOOL) < 0)) {
return -1;
}
@@ -690,7 +690,7 @@ static int bond_check_dev_link(struct bo
if (ioctl) {
strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
etool.cmd = ETHTOOL_GLINK;
-   ifr.ifr_data = (char*)&etool;
+   ifr.ifr_data = (void __user *) &etool;
if (IOCTL(slave_dev, &ifr, SIOCETHTOOL) == 0) {
if (etool.data == 1) {
return BMSR_LSTATUS;
--- pro-2.6.orig/drivers/net/bonding/bond_sysfs.c
+++ pro-2.6/drivers/net/bonding/bond_sysfs.c
@@ -260,7 +260,7 @@ static ssize_t bonding_store_slaves(stru
char *ifname;
int i, res, found, ret = count;
struct slave *slave;
-   struct net_device *dev = 0;
+   struct net_device *dev = NULL;
struct bonding *bond = to_bond(cd);
 
/* Quick sanity check -- is the bond interface up? */
@@ -995,8 +995,8 @@ static ssize_t bonding_store_primary(str
printk(KERN_INFO DRV_NAME
   ": %s: Setting primary slave to None.\n",
   bond->dev->name);
-   bond->primary_slave = 0;
-   bond_select_active_slave(bond);
+   bond->primary_slave = NULL;
+   bond_select_active_slave(bond);
} else {
printk(KERN_INFO DRV_NAME
   ": %s: Unable to set %.*s as primary slave as it 
is not a slave.\n",
@@ -1123,8 +1123,8 @@ static ssize_t bonding_store_active_slav
printk(KERN_INFO DRV_NAME
   ": %s: Setting active slave to None.\n",
   bond->dev->name);
-   bond->primary_slave = 0;
-   bond_select_active_slave(bond);
+   bond->primary_slave = NULL;
+   bond_select_active_slave(bond);
} else {
printk(KERN_INFO DRV_NAME
   ": %s: Unable to set %.*s as active slave as it 
is not a slave.\n",

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
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/7] net_cls: sparse warning fix

2006-01-09 Thread Stephen Hemminger
Get rid of warnings by using ifdef instead of putting
an attribute on a label. The sparse tool doesn't understand
attributes on labels, and the rest of the kernel doesn't do that.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- pro-2.6.orig/net/sched/cls_api.c
+++ pro-2.6/net/sched/cls_api.c
@@ -593,8 +593,11 @@ tcf_exts_dump(struct sk_buff *skb, struc
}
 #endif
return 0;
-rtattr_failure: __attribute__ ((unused))
+
+#ifdef CONFIG_NET_CLS_ACT
+rtattr_failure:
return -1;
+#endif
 }
 
 int
@@ -611,8 +614,11 @@ tcf_exts_dump_stats(struct sk_buff *skb,
goto rtattr_failure;
 #endif
return 0;
-rtattr_failure: __attribute__ ((unused))
+
+#ifdef CONFIG_NET_CLS_ACT
+rtattr_failure:
return -1;
+#endif
 }
 
 static int __init tc_filter_init(void)

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
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/7] skge: sparse warning fix

2006-01-09 Thread Stephen Hemminger
On 64 bit platform MAX_SCHEDULE_TIMEOUT is 64 bits, so sparse throws
a warning on the check in the blink code. Just recode to a simpler version.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- pro-2.6.orig/drivers/net/skge.c
+++ pro-2.6/drivers/net/skge.c
@@ -57,7 +57,6 @@
 #define ETH_JUMBO_MTU  9000
 #define TX_WATCHDOG(5 * HZ)
 #define NAPI_WEIGHT64
-#define BLINK_MS   250
 
 MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver");
 MODULE_AUTHOR("Stephen Hemminger <[EMAIL PROTECTED]>");
@@ -670,21 +669,15 @@ static void skge_led(struct skge_port *s
 static int skge_phys_id(struct net_device *dev, u32 data)
 {
struct skge_port *skge = netdev_priv(dev);
-   unsigned long ms;
enum led_mode mode = LED_MODE_TST;
+   unsigned i;
 
-   if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
-   ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT / HZ) * 1000;
-   else
-   ms = data * 1000;
-
-   while (ms > 0) {
+   for (i = 0; i < data * 2; i++) {
skge_led(skge, mode);
mode ^= LED_MODE_TST;
 
-   if (msleep_interruptible(BLINK_MS))
+   if (msleep_interruptible(500))
break;
-   ms -= BLINK_MS;
}
 
/* back to regular LED state */

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
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 6/7] ip: missing prototype

2006-01-09 Thread Stephen Hemminger
ip_output needs to get prototype for xfrm4_output.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- pro-2.6.orig/net/ipv4/ip_output.c
+++ pro-2.6/net/ipv4/ip_output.c
@@ -76,6 +76,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
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 2/7] sky2: sparse warning fix

2006-01-09 Thread Stephen Hemminger
On 64 bit platform MAX_SCHEDULE_TIMEOUT is 64 bits, so sparse throws
a warning on the check in the blink code. Just recode to a simpler version.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- pro-2.6.orig/drivers/net/sky2.c
+++ pro-2.6/drivers/net/sky2.c
@@ -2606,15 +2606,9 @@ static int sky2_phys_id(struct net_devic
struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port;
u16 ledctrl, ledover = 0;
-   long ms;
-   int interrupted;
+   unsigned i;
int onoff = 1;
 
-   if (!data || data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ))
-   ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT);
-   else
-   ms = data * 1000;
-
/* save initial values */
down(&sky2->phy_sema);
if (hw->chip_id == CHIP_ID_YUKON_XL) {
@@ -2626,20 +2620,20 @@ static int sky2_phys_id(struct net_devic
ledctrl = gm_phy_read(hw, port, PHY_MARV_LED_CTRL);
ledover = gm_phy_read(hw, port, PHY_MARV_LED_OVER);
}
+   up(&sky2->phy_sema);
 
-   interrupted = 0;
-   while (!interrupted && ms > 0) {
+   for (i = 0; i < data * 2; i++) {
+   down(&sky2->phy_sema);
sky2_led(hw, port, onoff);
-   onoff = !onoff;
-
up(&sky2->phy_sema);
-   interrupted = msleep_interruptible(250);
-   down(&sky2->phy_sema);
+   onoff = !onoff;
 
-   ms -= 250;
+   if (msleep_interruptible(500))
+   break;
}
 
/* resume regularly scheduled programming */
+   down(&sky2->phy_sema);
if (hw->chip_id == CHIP_ID_YUKON_XL) {
u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
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] Change memcmp(,,ETH_ALEN) to compare_ether_addr()

2006-01-09 Thread Kris Katterjohn
From: David S. Miller
Sent: 1/9/2006 3:02:35 PM

> From: "Kris Katterjohn" <[EMAIL PROTECTED]>
> Date: Mon, 9 Jan 2006 11:48:49 -0800
> 
> > This changes some memcmp(one,two,ETH_ALEN) to compare_ether_addr(one,two).
> > 
> > Signed-off-by: Kris Katterjohn <[EMAIL PROTECTED]>
> 
> Patch doesn't apply, in fact due to a patch you merged to me
> the other day :-)
> 
> ...
> 
> Please resubmit your patch against current GIT, thanks.

Okey-dokey. It patched fine on git5 for me.

--- x/net/8021q/vlan_dev.c  2006-01-09 17:04:49.0 -0600
+++ y/net/8021q/vlan_dev.c  2006-01-09 17:23:33.0 -0600
@@ -214,7 +214,7 @@ int vlan_skb_recv(struct sk_buff *skb, s
 * This allows the VLAN to have a different MAC than the 
underlying
 * device, and still route correctly.
 */
-   if (memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN) 
== 0) {
+   if (!compare_ether_addr(eth_hdr(skb)->h_dest, 
skb->dev->dev_addr)) {
/* It is for our (changed) MAC-address! */
skb->pkt_type = PACKET_HOST;
}

--- x/net/atm/br2684.c  2006-01-09 17:04:49.0 -0600
+++ y/net/atm/br2684.c  2006-01-09 17:23:33.0 -0600
@@ -296,13 +296,13 @@ static inline __be16 br_type_trans(struc
eth = eth_hdr(skb);
 
if (is_multicast_ether_addr(eth->h_dest)) {
-   if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0)
+   if (!compare_ether_addr(eth->h_dest, dev->broadcast))
skb->pkt_type = PACKET_BROADCAST;
else
skb->pkt_type = PACKET_MULTICAST;
}
 
-   else if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
+   else if (compare_ether_addr(eth->h_dest, dev->dev_addr))
skb->pkt_type = PACKET_OTHERHOST;
 
if (ntohs(eth->h_proto) >= 1536)

--- x/net/atm/lec.c 2006-01-09 17:04:49.0 -0600
+++ y/net/atm/lec.c 2006-01-09 17:23:33.0 -0600
@@ -1321,7 +1321,7 @@ static int lane2_associate_req (struct n
 struct sk_buff *skb;
 struct lec_priv *priv = (struct lec_priv*)dev->priv;
 
-if ( memcmp(lan_dst, dev->dev_addr, ETH_ALEN) != 0 )
+if (compare_ether_addr(lan_dst, dev->dev_addr))
 return (0);   /* not our mac address */
 
 kfree(priv->tlvs); /* NULL if there was no previous association */
@@ -1798,7 +1798,7 @@ lec_arp_find(struct lec_priv *priv,
   
 to_return = priv->lec_arp_tables[place];
 while(to_return) {
-if (memcmp(mac_addr, to_return->mac_addr, ETH_ALEN) == 0) {
+if (!compare_ether_addr(mac_addr, to_return->mac_addr)) {
 return to_return;
 }
 to_return = to_return->next;
@@ -2002,7 +2002,7 @@ lec_arp_resolve(struct lec_priv *priv, u
 return priv->mcast_vcc;
 break;
 case 2:  /* LANE2 wants arp for multicast addresses */
-if ( memcmp(mac_to_find, bus_mac, ETH_ALEN) == 0)
+if (!compare_ether_addr(mac_to_find, bus_mac))
 return priv->mcast_vcc;
 break;
 default:

--- x/net/atm/mpc.c 2006-01-09 17:04:49.0 -0600
+++ y/net/atm/mpc.c 2006-01-09 17:23:33.0 -0600
@@ -552,7 +552,7 @@ static int mpc_send_packet(struct sk_buf
goto non_ip; /* Multi-Protocol Over ATM :-) */
 
while (i < mpc->number_of_mps_macs) {
-   if (memcmp(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN), ETH_ALEN) 
== 0)
+   if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + 
i*ETH_ALEN)))
if ( send_via_shortcut(skb, mpc) == 0 )   /* 
try shortcut */
return 0; /* 
success! */
i++;

--- x/net/bluetooth/bnep/core.c 2006-01-09 17:04:49.0 -0600
+++ y/net/bluetooth/bnep/core.c 2006-01-09 17:23:33.0 -0600
@@ -75,7 +75,7 @@ static struct bnep_session *__bnep_get_s
 
list_for_each(p, &bnep_session_list) {
s = list_entry(p, struct bnep_session, list);   
-   if (!memcmp(dst, s->eh.h_source, ETH_ALEN))
+   if (!compare_ether_addr(dst, s->eh.h_source))
return s;
}
return NULL;
@@ -420,10 +420,10 @@ static inline int bnep_tx_frame(struct b
iv[il++] = (struct kvec) { &type, 1 };
len++;
 
-   if (!memcmp(eh->h_dest, s->eh.h_source, ETH_ALEN))
+   if (!compare_ether_addr(eh->h_dest, s->eh.h_source))
type |= 0x01;
 
-   if (!memcmp(eh->h_source, s->eh.h_dest, ETH_ALEN))
+   if (!compare_ether_addr(eh->h_source, s->eh.h_dest))
type |= 0x02;
 
if (type)

--- x/net/bridge/netfilter/ebt_stp.c

Re: SiS190 on ASUS. monodirectional traffic

2006-01-09 Thread Francois Romieu
Marco Atzeri <[EMAIL PROTECTED]> :
[...]
> I see that from 1469 and over the ASUS do not recognize the ping request

The patch below is yucky at will but I am really curious to know what
the device has really received. Add a "-" in front of the file in the
/etc/syslogd.conf record for the kernel messages to keep the disks quiet.

Pass 'debug=16' as an option to the module and send the whole syslogd
output after the test: I'd really appreciate the usual log for
ping -c 1 -s 1467, 1468, 1469 1470 as well as the _raw_ tcpdump/tethereal
dump on both side (ie 'tethereal -F libpcap -w /tmp/foo icmp or arp or not ip'
and 'tcpdump -s 0 -w /tmp/bar icmp or arp or not ip').

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index 478791e..27ec380 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -495,7 +495,7 @@ static int sis190_alloc_rx_skb(struct pc
 {
struct sk_buff *skb;
dma_addr_t mapping;
-   int ret = 0;
+   int i, ret = 0;
 
skb = dev_alloc_skb(rx_buf_sz);
if (!skb)
@@ -503,6 +503,9 @@ static int sis190_alloc_rx_skb(struct pc
 
*sk_buff = skb;
 
+   for (i = 0; i < rx_buf_sz; i++)
+   skb->data[i] = 0xa5;
+
mapping = pci_map_single(pdev, skb->data, rx_buf_sz,
 PCI_DMA_FROMDEVICE);
 
@@ -595,8 +598,8 @@ static int sis190_rx_interrupt(struct ne
 
status = le32_to_cpu(desc->PSize);
 
-   // net_intr(tp, KERN_INFO "%s: Rx PSize = %08x.\n", dev->name,
-   //   status);
+   net_intr(tp, KERN_INFO "%s: Rx PSize = %08x.\n", dev->name,
+status);
 
if (sis190_rx_pkt_err(status, stats) < 0)
sis190_give_to_asic(desc, tp->rx_buf_sz);
@@ -629,7 +632,22 @@ static int sis190_rx_interrupt(struct ne
 
pci_action(tp->pci_dev, le32_to_cpu(desc->addr),
   tp->rx_buf_sz, PCI_DMA_FROMDEVICE);
+{
+   char quuz[90], *p;
+   unsigned int i;
 
+   for (i = 0, p = quuz; i < tp->rx_buf_sz; i++) {
+   p += sprintf(p, "%02x", skb->data[i]);
+   if (!((i+1)%40)) {
+   *p = '\0';
+   printk(KERN_INFO "%s\n", quuz);
+   p = quuz;
+   }
+   }
+   *p = '\0';
+   printk(KERN_INFO "%s\n\n", quuz);
+   
+}
skb->dev = dev;
skb_put(skb, pkt_size);
skb->protocol = eth_type_trans(skb, dev);
-
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] netlink oops fix due to incorrect error code

2006-01-09 Thread Patrick McHardy

Kirill Korotaev wrote:

Fixed oops after failed netlink socket creation.
Wrong parathenses in if() statement caused err to be 1,
instead of negative value.
Trivial fix, not trivial to find though.

Signed-Off-By: Dmitry Mishin <[EMAIL PROTECTED]>
Signed-Off-By: Kirill Korotaev <[EMAIL PROTECTED]>


Good catch. Dave, please apply.





--- ./net/netlink/af_netlink.c.nlfix2006-01-06 18:37:28.0 +0300
+++ ./net/netlink/af_netlink.c  2006-01-09 16:40:49.0 +0300
@@ -416,7 +416,7 @@ static int netlink_create(struct socket 
 	groups = nl_table[protocol].groups;

netlink_unlock_table();
 
-	if ((err = __netlink_create(sock, protocol) < 0))

+   if ((err = __netlink_create(sock, protocol)) < 0)
goto out_module;
 
 	nlk = nlk_sk(sock->sk);




-
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] congestion and af_ops can be const

2006-01-09 Thread David S. Miller
From: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
Date: Mon, 9 Jan 2006 21:22:40 -0200

> On 1/9/06, Stephen Hemminger <[EMAIL PROTECTED]> wrote:
> > The congestion ops and af_ops in the inet_connection_sock
> > can be const.
> >
> > Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
> 
> Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>

Applied.
-
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] Change memcmp(,,ETH_ALEN) to compare_ether_addr()

2006-01-09 Thread David S. Miller
From: "Kris Katterjohn" <[EMAIL PROTECTED]>
Date: Mon, 9 Jan 2006 15:35:05 -0800

> Okey-dokey. It patched fine on git5 for me.

Applied, thanks.
-
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] netlink oops fix due to incorrect error code

2006-01-09 Thread David S. Miller
From: Patrick McHardy <[EMAIL PROTECTED]>
Date: Tue, 10 Jan 2006 00:50:52 +0100

> Kirill Korotaev wrote:
> > Fixed oops after failed netlink socket creation.
> > Wrong parathenses in if() statement caused err to be 1,
> > instead of negative value.
> > Trivial fix, not trivial to find though.
> > 
> > Signed-Off-By: Dmitry Mishin <[EMAIL PROTECTED]>
> > Signed-Off-By: Kirill Korotaev <[EMAIL PROTECTED]>
> 
> Good catch. Dave, please apply.

Already in Linus's tree, he applied it directly :-)
-
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] sk_chk_filter() filter length should be unsigned

2006-01-09 Thread Kris Katterjohn
From: Kris Katterjohn
Sent: 1/9/2006 1:36:49 PM
> This makes the filter length in sk_chk_filter() unsigned as it should be.
> 
> Signed-off-by: Kris Katterjohn <[EMAIL PROTECTED]>
> 
> This is a diff from 2.6.15.

Here's a new patch against 2.6.15-git5:

--- x/net/core/filter.c 2006-01-09 12:17:03.0 -0600
+++ y/net/core/filter.c 2006-01-09 18:19:07.0 -0600
@@ -289,10 +289,10 @@ load_b:
  *
  * Returns 0 if the rule set is legal or a negative errno code if not.
  */
-int sk_chk_filter(struct sock_filter *filter, int flen)
+int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
 {
struct sock_filter *ftest;
-   int pc;
+   unsigned int pc;
 
if (flen == 0 || flen > BPF_MAXINSNS)
return -EINVAL;
@@ -360,7 +360,7 @@ int sk_chk_filter(struct sock_filter *fi
 * Compare this with conditional jumps below,
 * where offsets are limited. --ANK (981016)
 */
-   if (ftest->k >= (unsigned)(flen-pc-1))
+   if (ftest->k >= flen - pc - 1)
return -EINVAL;
break;
 
--- x/include/linux/filter.h2006-01-09 12:16:58.0 -0600
+++ y/include/linux/filter.h2006-01-09 18:19:28.0 -0600
@@ -145,7 +145,7 @@ struct sock;
 
 extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter 
*filter, int flen);
 extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
-extern int sk_chk_filter(struct sock_filter *filter, int flen);
+extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
 #endif /* __KERNEL__ */
 
 #endif /* __LINUX_FILTER_H__ */


-
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] sk_chk_filter() filter length should be unsigned

2006-01-09 Thread Patrick McHardy

Kris Katterjohn wrote:

This makes the filter length in sk_chk_filter() unsigned as it should be.

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

This is a diff from 2.6.15.

The length should never be negative, and if the length were negative, the for
loop would fail.




-   if (ftest->k >= (unsigned)(flen-pc-1))
+   if (ftest->k >= flen - pc - 1)


NAK. The subtraction makes the whole expressions signed, so
a very large ftest->k is interpreted as a negative number
and passes the test.
-
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] sk_chk_filter() filter length should be unsigned

2006-01-09 Thread Patrick McHardy

Patrick McHardy wrote:

Kris Katterjohn wrote:


This makes the filter length in sk_chk_filter() unsigned as it should be.

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

This is a diff from 2.6.15.

The length should never be negative, and if the length were negative, 
the for

loop would fail.




-if (ftest->k >= (unsigned)(flen-pc-1))
+if (ftest->k >= flen - pc - 1)



NAK. The subtraction makes the whole expressions signed, so
a very large ftest->k is interpreted as a negative number
and passes the test.


After actually testing it, it behaves correctly, so OK :)

ACKed-by: Patrick McHardy <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] sk_chk_filter() filter length should be unsigned

2006-01-09 Thread Kris Katterjohn
From: Patrick McHardy
Sent: 1/9/2006 4:24:18 PM
> Kris Katterjohn wrote:
> > This makes the filter length in sk_chk_filter() unsigned as it should be.
> > 
> > Signed-off-by: Kris Katterjohn <[EMAIL PROTECTED]>
> > 
> > This is a diff from 2.6.15.
> > 
> > The length should never be negative, and if the length were negative, the 
> > for
> > loop would fail.
> > 
> 
> > -   if (ftest->k >= (unsigned)(flen-pc-1))
> > +   if (ftest->k >= flen - pc - 1)
> 
> NAK. The subtraction makes the whole expressions signed, so
> a very large ftest->k is interpreted as a negative number
> and passes the test.

Okey-dokey. Against git5:

--- x/net/core/filter.c 2006-01-09 12:17:03.0 -0600
+++ y/net/core/filter.c 2006-01-09 18:19:07.0 -0600
@@ -289,10 +289,10 @@ load_b:
  *
  * Returns 0 if the rule set is legal or a negative errno code if not.
  */
-int sk_chk_filter(struct sock_filter *filter, int flen)
+int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
 {
struct sock_filter *ftest;
-   int pc;
+   unsigned int pc;
 
if (flen == 0 || flen > BPF_MAXINSNS)
return -EINVAL;
 
--- x/include/linux/filter.h2006-01-09 12:16:58.0 -0600
+++ y/include/linux/filter.h2006-01-09 18:19:28.0 -0600
@@ -145,7 +145,7 @@ struct sock;
 
 extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter 
*filter, int flen);
 extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
-extern int sk_chk_filter(struct sock_filter *filter, int flen);
+extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
 #endif /* __KERNEL__ */
 
 #endif /* __LINUX_FILTER_H__ */


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] skge: sparse warning fix

2006-01-09 Thread Jeff Garzik

Stephen Hemminger wrote:

On 64 bit platform MAX_SCHEDULE_TIMEOUT is 64 bits, so sparse throws
a warning on the check in the blink code. Just recode to a simpler version.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- pro-2.6.orig/drivers/net/skge.c
+++ pro-2.6/drivers/net/skge.c


can you split the net driver patches off and send to me?

I just pushed some of your stuff, but I think I have a sky2 update still 
pending (received in duplicate, gotta figure out which one is valid)


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


[PATCH] happy-meal-pci-probing

2006-01-09 Thread Jiri Slaby
against 2.6.15-mm2

happy-meal-pci-probing

Pci probing functions added, some functions were rewritten.
Use PCI_DEVICE macro.

Signed-off-by: Jiri Slaby <[EMAIL PROTECTED]>

---
commit eb724d05644c4a6fa80fc7f4beaeabfcd7a19905
tree a75be76af0e6a59f2f1526c7cce188403cff63cf
parent 43aabaed0719318490527bd09bc0b0872953c518
author <[EMAIL PROTECTED](none)> Tue, 10 Jan 2006 01:52:57 +0100
committer <[EMAIL PROTECTED](none)> Tue, 10 Jan 2006 01:52:57 +0100

 drivers/net/sunhme.c |   79 +++---
 1 files changed, 55 insertions(+), 24 deletions(-)

diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3013,7 +3013,7 @@ static void get_hme_mac_nonsparc(struct 
 }
 #endif /* !(__sparc__) */
 
-static int __init happy_meal_pci_init(struct pci_dev *pdev)
+static int __devinit happy_meal_pci_init(struct pci_dev *pdev)
 {
struct quattro *qp = NULL;
 #ifdef __sparc__
@@ -3073,6 +3073,7 @@ static int __init happy_meal_pci_init(st
memset(hp, 0, sizeof(*hp));
 
hp->happy_dev = pdev;
+   pci_dev_get(pdev);
 
spin_lock_init(&hp->happy_lock);
 
@@ -3260,6 +3261,7 @@ err_out_free_res:
pci_release_regions(pdev);
 
 err_out_clear_quattro:
+   pci_dev_put(pdev);
if (qp != NULL)
qp->happy_meals[qfe_slot] = NULL;
 
@@ -3304,21 +3306,58 @@ static int __init happy_meal_sbus_probe(
 #endif
 
 #ifdef CONFIG_PCI
-static int __init happy_meal_pci_probe(void)
+static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
+   const struct pci_device_id *id)
 {
-   struct pci_dev *pdev = NULL;
-   int cards = 0;
+   int retval;
+
+   retval = pci_enable_device(pdev);
+   if (retval < 0)
+   goto err;
+
+   pci_set_master(pdev);
+   happy_meal_pci_init(pdev);
+
+   return 0;
+err:
+   return retval;
+}
 
-   while ((pdev = pci_find_device(PCI_VENDOR_ID_SUN,
-  PCI_DEVICE_ID_SUN_HAPPYMEAL, pdev)) != 
NULL) {
-   if (pci_enable_device(pdev))
-   continue;
-   pci_set_master(pdev);
-   cards++;
-   happy_meal_pci_init(pdev);
+static void __devexit happy_meal_pci_remove(struct pci_dev *pdev)
+{
+   struct quattro *tmp, *qp = qfe_pci_list;
+   struct pci_dev *bdev = pdev->bus->self;
+
+   if (qp->quattro_dev == bdev) { /* is it the 1st one? */
+   qfe_pci_list = qp->next;
+   kfree(qp);
+   goto end;
}
-   return cards;
+
+   for (; qp->next != NULL; qp = qp->next) /* some further? */
+   if (qp->next->quattro_dev == bdev)
+   break;
+
+   tmp = qp->next; /* kill it, but preserve list */
+   qp->next = qp->next->next;
+   kfree(tmp);
+end:
+   pci_dev_put(pdev);
 }
+
+static struct pci_device_id happy_meal_pci_tbl[] = {
+   { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
+   { 0 }
+};
+MODULE_DEVICE_TABLE(pci, happy_meal_pci_tbl);
+
+static struct pci_driver happy_meal_pci_driver = {
+   .name   = "happy_meal_pci",
+   .id_table   = happy_meal_pci_tbl,
+   .probe  = happy_meal_pci_probe,
+   .remove = __devexit_p(happy_meal_pci_remove)
+};
+
 #endif
 
 static int __init happy_meal_probe(void)
@@ -3337,11 +3376,10 @@ static int __init happy_meal_probe(void)
cards += happy_meal_sbus_probe();
 #endif
 #ifdef CONFIG_PCI
-   cards += happy_meal_pci_probe();
+   return pci_register_driver(&happy_meal_pci_driver);
+#else
+   return cards ? 0 : -ENODEV;
 #endif
-   if (!cards)
-   return -ENODEV;
-   return 0;
 }
 
 
@@ -3408,14 +3446,7 @@ static void __exit happy_meal_cleanup_mo
}
 #endif
 #ifdef CONFIG_PCI
-   while (qfe_pci_list) {
-   struct quattro *qfe = qfe_pci_list;
-   struct quattro *next = qfe->next;
-
-   kfree(qfe);
-
-   qfe_pci_list = next;
-   }
+   pci_unregister_driver(&happy_meal_pci_driver);
 #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] Fix spelling error in debug message

2006-01-09 Thread Kris Katterjohn
This fixes the misspelling of the word "receive" in a debugging message.

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

This is a diff from 2.6.15-git5.

Thanks!

--- x/net/ieee80211/ieee80211_rx.c  2006-01-09 17:28:34.0 -0600
+++ y/net/ieee80211/ieee80211_rx.c  2006-01-09 19:26:05.0 -0600
@@ -1439,7 +1439,7 @@ void ieee80211_rx_mgt(struct ieee80211_d
break;
 
case IEEE80211_STYPE_PROBE_REQ:
-   IEEE80211_DEBUG_MGMT("recieved auth (%d)\n",
+   IEEE80211_DEBUG_MGMT("received auth (%d)\n",
 WLAN_FC_GET_STYPE(le16_to_cpu
   (header->frame_ctl)));
 
@@ -1473,7 +1473,7 @@ void ieee80211_rx_mgt(struct ieee80211_d
break;
case IEEE80211_STYPE_AUTH:
 
-   IEEE80211_DEBUG_MGMT("recieved auth (%d)\n",
+   IEEE80211_DEBUG_MGMT("received auth (%d)\n",
 WLAN_FC_GET_STYPE(le16_to_cpu
   (header->frame_ctl)));
 


-
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] Change memcmp(,,ETH_ALEN) to compare_ether_addr()

2006-01-09 Thread Pete Zaitcev
On Mon, 9 Jan 2006 11:48:49 -0800, "Kris Katterjohn" <[EMAIL PROTECTED]> wrote:

> - if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0)
> + if (!compare_ether_addr(eth->h_dest, dev->broadcast))

Wait a second. compare_ether_addr returns a boolean, not an error code.

return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;

This evaluates to zero if all bytes are equal, and then some wise guy
converted it to boolean with !=, which yields 1 when they are all equal.
The return type, however, is unsigned!

Cheesus, people.

-- Pete
-
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] Fix grammar for comment for compare_ether_addr()

2006-01-09 Thread Kris Katterjohn
This fixes the wording in the comment for compare_ether_addr().

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

This is a diff from 2.6.15-git5.

Thanks!

--- x/include/linux/etherdevice.h   2006-01-09 12:16:58.0 -0600
+++ y/include/linux/etherdevice.h   2006-01-09 20:10:12.0 -0600
@@ -113,8 +113,8 @@ static inline void random_ether_addr(u8 
 
 /**
  * compare_ether_addr - Compare two Ethernet addresses
- * @addr1: Pointer to a six-byte array containing the Ethernet address
- * @addr2: Pointer other six-byte array containing the Ethernet address
+ * @addr1: Pointer to a six-byte array containing an Ethernet address
+ * @addr2: Pointer to another six-byte array containing an Ethernet address
  *
  * Compare two ethernet addresses, returns 0 if equal
  */


-
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] Change memcmp(,,ETH_ALEN) to compare_ether_addr()

2006-01-09 Thread Pete Zaitcev
On Mon, 9 Jan 2006 11:48:49 -0800, "Kris Katterjohn" <[EMAIL PROTECTED]> wrote:

> This is a diff from 2.6.15. It compiles fine and seems to work fine.

> - else if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
> + else if (compare_ether_addr(eth->h_dest, dev->dev_addr))

Please never mind me, this code is fine.

-- Pete
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PROBLEM: bug in e1000 module causes very high CPU load

2006-01-09 Thread Jesse Brandeburg
On 12/23/05, Leroy van Logchem <[EMAIL PROTECTED]> wrote:
> 
> > Yes, let the server act as usual, it just starts happening out of the blue.
> > No new hardware has been added or removed, no new programs has been
> > installed.
>
> "Me too"



> Is there a method which can give hints about what was going on during
> the sharply rising load? My guess is that even monitoring/sampling

well, maybe top, maybe you could schedule sar to gather stats on your system.

> aint doable anymore if the bad situation occurs. Tips on obtaining
> information about subjects like:
> - who was using which tcp/udp connection with what bandwidth

i like a utility like iptraf to help with this.

> - who was generating how many read/writes on which filesystem incl. location

hm, thats a little tougher, nfsstat doesn't give that does it.

> - etc etc.
> are more then welcome too. Does using profile=2 and storing
> readprofile output to files every 5 seconds give enough information to
> tacle the source of this problem?

yes, i think that would certainly help figure out what happens at the TOD :-)
you could enable sysrq in order to get a stack after it hung.  For
bonus points you can hook up a serial console and dump the state of
all processes with sysrq.

hopefully before it died you would be able to sync your drive and
reboot in order to maximize your chances of fully writing files.

Jesse
-
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 0/3] e100: driver update

2006-01-09 Thread Jeff Kirsher
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

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


[PATCH netdev-2.6 1/3] e100: Fix TX hang and RMCP ping

2006-01-09 Thread Jeff Kirsher
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_priority_locat

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

2006-01-09 Thread Jeff Kirsher
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");
 }
 
 Handle the return values from pci_* functions

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

[PATCH netdev-2.6 3/3] e100: Fix whitespace

2006-01-09 Thread Jeff Kirsher
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 instruct

[PATCH 2/2 - 2.6.15]net:32 bit (socket layer) ioctl emulation for 64 bit kernels

2006-01-09 Thread Shaun Pereira
x25 module patch

diff -uprN -X dontdiff linux-2.6.15-vanilla/include/net/x25.h
linux-2.6.15/include/net/x25.h
--- linux-2.6.15-vanilla/include/net/x25.h  2006-01-03 14:21:10.0
+1100
+++ linux-2.6.15/include/net/x25.h  2006-01-10 16:15:16.0 +1100
@@ -223,6 +223,18 @@ extern struct x25_route *x25_get_route(s
 extern struct net_device *x25_dev_get(char *);
 extern void x25_route_device_down(struct net_device *dev);
 extern int  x25_route_ioctl(unsigned int, void __user *);
+
+#ifdef CONFIG_COMPAT
+#include 
+
+struct x25_route_struct32{
+   struct x25_address address;
+   compat_uint_t   sigdigits;
+   chardevice[200];
+};
+extern int  compat_x25_route_ioctl(unsigned int, struct
x25_route_struct32 __user *);
+#endif
+
 extern void x25_route_free(void);
 
 static __inline__ void x25_route_hold(struct x25_route *rt)
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/x25/af_x25.c
linux-2.6.15/net/x25/af_x25.c
--- linux-2.6.15-vanilla/net/x25/af_x25.c   2006-01-10 16:06:29.0
+1100
+++ linux-2.6.15/net/x25/af_x25.c   2006-01-10 16:15:16.0 +1100
@@ -475,6 +475,12 @@ out:
 
 void x25_init_timers(struct sock *sk);
 
+#ifdef CONFIG_COMPAT
+#include "x25_ioctl_compat.c"
+#else
+#define compat_x25_ioctl NULL
+#endif
+
 static int x25_create(struct socket *sock, int protocol)
 {
struct sock *sk;
@@ -1403,7 +1409,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname =  x25_getname,
.poll = datagram_poll,
.ioctl =x25_ioctl,
-   .compat_ioctl=  NULL,
+   .compat_ioctl=  compat_x25_ioctl,
.listen =   x25_listen,
.shutdown = sock_no_shutdown,
.setsockopt =   x25_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/x25/x25_ioctl_compat.c
linux-2.6.15/net/x25/x25_ioctl_compat.c
--- linux-2.6.15-vanilla/net/x25/x25_ioctl_compat.c 1970-01-01
10:00:00.0 +1000
+++ linux-2.6.15/net/x25/x25_ioctl_compat.c 2006-01-10
16:15:16.0 +1100
@@ -0,0 +1,264 @@
+#include 
+
+struct x25_subscrip_struct32{
+   char device[200-sizeof(compat_ulong_t)];
+   compat_ulong_t global_facil_mask;
+   compat_uint_t extended;
+};
+
+struct x25_facilities32{
+   compat_uint_t   winzize_in, winsize_out;
+   compat_uint_t   pacsize_in, packsize_out;
+   compat_uint_t   throughput;
+   compat_uint_t   reverse;
+};
+
+struct x25_calluserdata32 {
+   compat_uint_t   cudlength;
+   unsigned char   cuddata[128];
+};
+
+struct x25_subaddr32 {
+   compat_uint_t   cudmatchlength;
+};
+
+static int compat_x25_subscr_ioctl(unsigned int cmd,
+   struct x25_subscrip_struct32 __user *x25_subscr32)
+{
+   struct x25_subscrip_struct x25_subscr;
+   struct x25_neigh *nb;
+   struct net_device *dev;
+   int rc = -EINVAL;
+
+   if (cmd != SIOCX25GSUBSCRIP && cmd != SIOCX25SSUBSCRIP)
+   goto out;
+
+   rc = -EFAULT;
+   if(copy_from_user(&x25_subscr, x25_subscr32, sizeof(*x25_subscr32)))
+   goto out;
+
+   rc = -EINVAL;
+   if ((dev = x25_dev_get(x25_subscr.device)) == NULL)
+   goto out;
+
+   if ((nb = x25_get_neigh(dev)) == NULL)
+   goto out_dev_put;
+
+   dev_put(dev);
+
+   if(cmd == SIOCX25GSUBSCRIP) {
+   x25_subscr.extended = nb->extended;
+   x25_subscr.global_facil_mask = nb->global_facil_mask;
+   rc = copy_to_user(x25_subscr32, &x25_subscr,
+   sizeof(*x25_subscr32)) ? -EFAULT : 0;
+   } else {
+   rc = -EINVAL;
+   if (!(x25_subscr.extended && x25_subscr.extended != 1)) {
+   rc = 0;
+   nb->extended= x25_subscr.extended;
+   nb->global_facil_mask   = x25_subscr.global_facil_mask;
+   }
+   }
+   x25_neigh_put(nb);
+out:
+   return rc;
+out_dev_put:
+   dev_put(dev);
+   goto out;
+}
+
+static int compat_x25_facility_ioctl(struct socket *sock, struct
x25_facilities32 __user *facilities32)
+{
+   struct sock *sk = sock->sk;
+   struct x25_sock *x25 = x25_sk(sk);
+   struct x25_facilities   facilities;
+   int rc;
+   rc = -EFAULT;
+   if(copy_from_user(&facilities, facilities32, sizeof(*facilities32)))
+  goto out;
+   rc = -EINVAL;
+   if (sk->sk_state != TCP_LISTEN &&
+   sk->sk_state != TCP_CLOSE)
+   goto out;
+   if (facilities.pacsize_in < X25_PS16 ||
+   facilities.pacsize_in > X25_PS4096)
+   goto out;
+   if (facilities.pacsize_out < X25_PS16 ||
+   facilities.pacsize_out > X25_PS4096)
+   goto out;
+   if (facilities.winsize_in < 1 ||
+   facilities.winsize_in > 127)
+   goto out;
+   if (facilities.throughput < 0x03 ||
+   facilities.throughput > 0xDD)

[PATCH 1/2 RESEND- 2.6.15] net: 32 bit (socket layer) ioctl emulation for 64 bit kernels

2006-01-09 Thread Shaun Pereira
Hi Arnd, Arnaldo
Thanks for your comments. I initially did not wish to change any of the 
other modules, but based on Arnd's comments I have removed the
extra macro, SOCKOPS_COMPAT_WRAP and use the original SOCKOPS_WRAP.

I'm a bit pressed for time to use the lock_sock() in each of the 
functions pointed to by proto_ops, ( getting rid of SOCKS_WRAP
in x25 at the moment), as we are currently building an application
for a telco on linux. Perhaps will try this a bit later, and use the
SOCKOPS_WRAP macro for now. I have made the compat_ioctl function 
pointer unconditional in proto_ops as suggested. 

Patch 2/2 has the modifications for x25. Any suggestions are welcome. 
rgds,
Shaun

diff -uprN -X dontdiff linux-2.6.15-vanilla/include/linux/net.h
linux-2.6.15/include/linux/net.h
--- linux-2.6.15-vanilla/include/linux/net.h2006-01-03
14:21:10.0 +1100
+++ linux-2.6.15/include/linux/net.h2006-01-10 15:56:55.0 +1100
@@ -143,6 +143,8 @@ struct proto_ops {
  struct poll_table_struct *wait);
int (*ioctl) (struct socket *sock, unsigned int cmd,
  unsigned long arg);
+   int (*compat_ioctl) (struct socket *sock, unsigned int cmd,
+ unsigned long arg);
int (*listen)(struct socket *sock, int len);
int (*shutdown)  (struct socket *sock, int flags);
int (*setsockopt)(struct socket *sock, int level,
@@ -247,6 +249,8 @@ SOCKCALL_UWRAP(name, poll, (struct file 
  (file, sock, wait)) \
 SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \
 unsigned long arg), (sock, cmd, arg)) \
+SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int
cmd, \
+unsigned long arg), (sock, cmd, arg)) \
 SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock,
len)) \
 SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock,
flags)) \
 SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int
optname, \
@@ -271,6 +275,7 @@ static struct proto_ops name##_ops = {  
.getname= __lock_##name##_getname,  \
.poll   = __lock_##name##_poll, \
.ioctl  = __lock_##name##_ioctl,\
+   .compat_ioctl   = __lock_##name##_compat_ioctl, \
.listen = __lock_##name##_listen,   \
.shutdown   = __lock_##name##_shutdown, \
.setsockopt = __lock_##name##_setsockopt,   \
@@ -279,6 +284,7 @@ static struct proto_ops name##_ops = {  
.recvmsg= __lock_##name##_recvmsg,  \
.mmap   = __lock_##name##_mmap, \
 };
+
 #endif
 
 #define MODULE_ALIAS_NETPROTO(proto) \
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/appletalk/ddp.c
linux-2.6.15/net/appletalk/ddp.c
--- linux-2.6.15-vanilla/net/appletalk/ddp.c2006-01-03
14:21:10.0 +1100
+++ linux-2.6.15/net/appletalk/ddp.c2006-01-10 15:56:55.0 +1100
@@ -1852,6 +1852,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname= atalk_getname,
.poll   = datagram_poll,
.ioctl  = atalk_ioctl,
+   .compat_ioctl   = NULL,
.listen = sock_no_listen,
.shutdown   = sock_no_shutdown,
.setsockopt = sock_no_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/econet/af_econet.c
linux-2.6.15/net/econet/af_econet.c
--- linux-2.6.15-vanilla/net/econet/af_econet.c 2006-01-03
14:21:10.0 +1100
+++ linux-2.6.15/net/econet/af_econet.c 2006-01-10 15:56:55.0
+1100
@@ -698,6 +698,7 @@ static struct net_proto_family econet_fa
.owner  =   THIS_MODULE,
 };
 
+
 static struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
.family =   PF_ECONET,
.owner =THIS_MODULE,
@@ -709,6 +710,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname =  econet_getname, 
.poll = datagram_poll,
.ioctl =econet_ioctl,
+   .compat_ioctl=  NULL,
.listen =   sock_no_listen,
.shutdown = sock_no_shutdown,
.setsockopt =   sock_no_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/ipx/af_ipx.c
linux-2.6.15/net/ipx/af_ipx.c
--- linux-2.6.15-vanilla/net/ipx/af_ipx.c   2006-01-03 14:21:10.0
+1100
+++ linux-2.6.15/net/ipx/af_ipx.c   2006-01-10 15:56:55.0 +1100
@@ -1912,6 +1912,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname= ipx_getname,
.poll   = datagram_poll,
.ioctl  = ipx_ioctl,
+   .compat_ioctl   = NULL,
.listen = sock_no_listen,
.shutdown   = sock_no_shutdown, /* FIXME: support shutdown */
.setsockopt = ipx_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/irda/af_irda.c
l

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

2006-01-09 Thread Dan Williams
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:

1) Implements SIOCSIWENCODEEXT, SIOCGIWENCODEEXT, SIOCSIWAUTH, and
SIOCGIWAUTH calls for unencrypted and WEP operation

2) Accepts zero-filled addresses for SIOCSIWAP, which are legal and
should turn off any previous forced WAP address

3) Sends association and de-association events to userspace at most of
the appropriate times

4) Fixes erroneous order of CIPHER_SUITE_WEP_* arguments in one location
which are actually unused anyway

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


--- a/drivers/net/wireless/atmel.c  2006-01-09 12:45:00.0 -0500
+++ b/drivers/net/wireless/atmel.c  2006-01-10 00:10:46.0 -0500
@@ -1407,6 +1407,17 @@
 {
struct atmel_private *priv = netdev_priv(dev);
 
+   /* Send event to userspace that we are disassociating */
+   if (priv->station_state == STATION_STATE_READY) {
+   union iwreq_data wrqu;
+
+   wrqu.data.length = 0;
+   wrqu.data.flags = 0;
+   wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+   memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
+   wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
+   }
+
atmel_enter_state(priv, STATION_STATE_DOWN);
 
if (priv->bus_type == BUS_TYPE_PCCARD)
@@ -1780,10 +1791,10 @@
priv->wep_is_on = 1;
priv->exclude_unencrypted = 1;
if (priv->wep_key_len[index] > 5) {
-   priv->pairwise_cipher_suite = 
CIPHER_SUITE_WEP_64;
+   priv->pairwise_cipher_suite = 
CIPHER_SUITE_WEP_128;
priv->encryption_level = 2;
} else {
-   priv->pairwise_cipher_suite = 
CIPHER_SUITE_WEP_128;
+   priv->pairwise_cipher_suite = 
CIPHER_SUITE_WEP_64;
priv->encryption_level = 1;
}
}
@@ -1853,6 +1864,181 @@
return 0;
 }
 
+static int atmel_set_encodeext(struct net_device *dev,
+   struct iw_request_info *info,
+   union iwreq_data *wrqu,
+   char *extra)
+{
+   struct atmel_private *priv = netdev_priv(dev);
+   struct iw_point *encoding = &wrqu->encoding;
+   struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
+   int idx, key_len;
+
+   /* Determine and validate the key index */
+   idx = encoding->flags & IW_ENCODE_INDEX;
+   if (idx) {
+   if (idx < 1 || idx > WEP_KEYS)
+   return -EINVAL;
+   idx--;
+   } else
+   idx = priv->default_key;
+
+   if ((encoding->flags & IW_ENCODE_DISABLED) ||
+   ext->alg == IW_ENCODE_ALG_NONE) {
+   priv->wep_is_on = 0;
+   priv->encryption_level = 0;
+   priv->pairwise_cipher_suite = CIPHER_SUITE_NONE;
+   }
+
+   if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
+   priv->default_key = idx;
+
+   /* Set the requested key */
+   switch (ext->alg) {
+   case IW_ENCODE_ALG_NONE:
+   break;
+   case IW_ENCODE_ALG_WEP:
+   if (ext->key_len > 5) {
+   priv->wep_key_len[idx] = 13;
+   priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_128;
+   priv->encryption_level = 2;
+   } else if (ext->key_len > 0) {
+   priv->wep_key_len[idx] = 5;
+   priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_64;
+   priv->encryption_level = 1;
+   } else {
+   return -EINVAL;
+   }
+   priv->wep_is_on = 1;
+   memset(priv->wep_keys[idx], 0, 13);
+   key_len = min ((int)ext->key_len, priv->wep_key_len[idx]);
+   memcpy(priv->wep_keys[idx], ext->key, key_len);
+   break;
+   default:
+   return -EINVAL;
+   }
+
+   return -EINPROGRESS;
+}
+
+static int atmel_get_encodeext(struct net_device *dev,
+   struct iw_request_info *info,
+   union iwreq_data *wrqu,
+   char *extra)
+{
+   struct atmel_private *priv = netdev_priv(dev);
+   struct iw_point *encoding = &wrqu->encoding;
+   struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
+   int idx, max_key_len;
+
+   max_key_len = encoding->length - sizeof(*ext);
+   if (max_key_len < 0)
+   return -EINVAL;
+
+   idx = encoding->flags & IW_ENCODE_INDEX;
+   if (idx) {
+   if (idx < 1 || idx > WEP_KEYS)
+   

RFC: kill acx100-devel, migrate to netdev@vger.kernel.org

2006-01-09 Thread Denis Vlasenko
Hi folks,

Please read http://lkml.org/lkml/2006/1/5/671

What about moving all acx development discussion
to [EMAIL PROTECTED]

If yes, can acx100-devel address be automatically
redirected?
--
vda
-
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: State of the Union: Wireless

2006-01-09 Thread Denis Vlasenko
On Friday 06 January 2006 06:22, Jeff Garzik wrote:
> 
>   State of the Union - Wireless
> January 5, 2006

[ snip ]

> * Wireless drivers and the wireless stack need to be maintained IN-TREE
>   as a COLLECTIVE ENTITY, not piecemeal maintenance as its done now.
> 
> The whole point of working in-tree, the whole point of this open source
> thing is that everybody works on the same code, and the entire Internet
> is your test bed.  Quality improves the more people work together.
> The entire Linux kernel engineering process is focused on getting core
> kernel code out to distributions (then to end users) and power users.
> Out-of-tree code breaks that model, breaking the It Just Works(tm)
> theme applicable to other Linux-supported hardware.

Cool, so may I please know why acx driver is not included in the mainline?
In case it needs more work, well, (a) at least tell us what exactly
you want improved, and (b) why do you think that in-tree acx would not
be improved? It will get more visibility, maybe some people will
get interested and will send a patch or two to us...
 
> * Release early, release often.  Pushing from an external repository to
>   the official kernel tree every few months creates more problems
>   than it solves.  Out-of-tree drivers fail to take advantage of
>   recent kernel changes and coding practices, which leads to bugs and
>   incompatibilities.  Slow pushing leads to huge periodic updates,
>   which are awful for debugging, testing, and general use.

I want to avoid exactly this, and therefore want acx in mainline.

> * ALL wireless stacks need work.  It is currently fashionable to laud
>   DeviceScape and trash in-kernel ieee80211, but outside of the
>   cheerleading, BOTH have real technical issues that need addressing.
>   IOW, no matter what code is chosen, _somebody_ is on the hook for
>   a fair amount of work.  A switch is not without its costs.
> 
> * I would prefer that people patch the in-tree ieee80211 code,
>   probably in the direction of Jiri Benc's proposed ieee80211_device
>   direction.  I take patches from all parties, not just Intel.
> 
> * However, if the engineering reasons for switching to DeviceScape
>   or another wireless stack are powerful enough to overcome Linux's
>   "no big patches, evolve it" maxim, great!  But make sure to work
>   on converting drivers to this new stack.  The wireless drivers and
>   wireless stack should evolve in tandem.  Otherwise, drivers get
>   left behind, grow moldy, and Linux users suffer.

How are we going to find out which stack is best and which stack
we should concentrate our efforts on? In an absense of wifi maintainer,
maybe we should throw _all stacks_ (currently two) into the mainline,
and evolution will find the best one. Yes, it would be a bit ugly
at first, but I hope it will speed up evolution a lot.

Let current stack sit in include/net/ieee80211*.h and net/ieee80211/*,
add dcape one into include/net/wlan*.h and net/wlan/*
(s/wlan/dscape/ or whatever)

We can even give Devicescape folks blanket permissions to
maintain their stack in include/net/wlan*.h and net/wlan/*.
Maybe they can act as a wifi maintainer long term.

Existing drivers won't need to closely track every change
in dscape stack. If dscape will survive, old drivers can be
converted to it gradually. If not, just dike it out.

> * Feel free to submit radical changes -- wireless is yet young --
>   just make sure all drivers keep working from release to release.
> 
> * Long term, wireless should go from being a library of common code to a
>   "real" wireless stack, as shown in the template developed by David Miller:
>   
> http://kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/davem-p80211.tar.bz2
>   Zhu Yi @ Intel and Vladmir @ somewhere both independently did some
>   work in this area.
> 
> * Please CC wireless stack/driver discussions to netdev@vger.kernel.org
>   mailing list, rather than everybody hiding in their own little
>   corner.

[snip]

> So... there it is.  We suck.  There's hope.  No Luke Skywalker in sight.
> I hope we can avoid being slaves to fashion, by merging a rewrite, but
> that way be the way to go.
--
vda
-
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] running tcpdump on 3c905b causes freeze (reproducable)

2006-01-09 Thread Andrew Morton
Folkert van Heusden <[EMAIL PROTECTED]> wrote:
>
> > > Have you tried enabling the NMI watchdog?  Enable CONFIG_X86_LOCAL_APIC 
> > > and
> > > boot with `nmi_watchdog=1' on the command line, make sure that the NMI 
> > > line
> > > of /proc/interrupts is incrementing.
> > I'll give it a try. I've added it to the append-line in the lilo config.
> > Am now compiling the kernel.
> 
> No change. Well, that is: the last message on the console now is
> "setting eth1 to promiscues mode".
> 

Did you confirm that the NMI counters in /proc/interrupts are incrementing?
-
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