Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 0/4 net-2.6.25] Proper netlink kernel sockets disposal.
From: David Miller @ 2008-01-19  7:55 UTC (permalink / raw)
  To: den; +Cc: netdev, containers, devel
In-Reply-To: <4790A0E3.9080006@sw.ru>

From: "Denis V. Lunev" <den@sw.ru>
Date: Fri, 18 Jan 2008 15:51:47 +0300

> Alexey Dobriyan found, that virtualized netlink kernel sockets (fibl &
> rtnl) are leaked during namespace start/stop loop.
> 
> Leaking fix (simple and obvious) reveals that netlink kernel socket
> disposal leads to OOPSes:
> - nl_table[protocol]->listeners is double freed
> - sometimes during namespace stop netlink_sock_destruct
>   BUG_TRAP(!atomic_read(&sk->sk_rmem_alloc)); is hit
> 
> This set address all these issues.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> Tested-by: Alexey Dobriayn <adobriyan@openvz.org>

All 4 patches applied, thanks!

^ permalink raw reply

* Re: [PATCH 0/4] [IrDA] IrDA fixes for net-2.6.25
From: David Miller @ 2008-01-19  8:01 UTC (permalink / raw)
  To: samuel-jcdQHdrhKHMdnm+yROfE0A
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	irda-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <20080119000205.827714764-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>

From: samuel-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org
Date: Sat, 19 Jan 2008 01:02:05 +0100

> Here goes a batch of 4 IrDA patches against your latest net-2.6.25 tree.

All 4 patches applied, thanks Sam.

You might want to consider submitting those first two
patches for 2.6.24 as they look like pure fixes.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply

* Re: [PATCH] [IPV6] ROUTE: Make sending algorithm more friendly with RFC 4861.
From: David Miller @ 2008-01-19  8:35 UTC (permalink / raw)
  To: yoshfuji; +Cc: mitch, netdev
In-Reply-To: <20080119.020030.44981470.yoshfuji@linux-ipv6.org>

From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
Date: Sat, 19 Jan 2008 02:00:30 +0900 (JST)

> We omit (or delay) sending NSes for known-to-unreachable routers
> (in NUD_FAILED state) according to RFC 4191 (Default Router Preferences
> and More-Specific Routes).
> But this is not fully compatible with RFC 4861 (Neighbor Discovery Protocol
> for IPv6), which does not remember unreachability of neighbors.
> 
> So, let's avoid mixing sending algorithm of RFC 4191 and that of RFC 4861,
> and make the algorithm more friendly with RFC 4861 if RFC 4191 is disabled.
> 
> Issue was found by IPv6 Ready Logo Core Self_Test 1.5.0b2 (by TAHI Project),
> and has been tracked down by Mitsuru Chinen <mitch@linux.vnet.ibm.com>.
> 
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

Applied to net-2.6, thanks.

^ permalink raw reply

* [PATCH net-2.6.25] [XFRM] Remove unneeded export of xfrm_output_resume() and remove its declaration from net/xfrm.h.
From: Rami Rosen @ 2008-01-19 13:13 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, herbert

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

Hi,

The method xfrm_output_resume() is used only in net/xfrm/xfrm_output.c.

This patch removes using unneeded EXPORT_SYMBOL_GPL to export it in
net/xfrm/xfrm_output.c and also removes its declaration in net/xfrm.h.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen <ramirose@gmail.com>

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 964 bytes --]

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 5ebb9ba..40ae133 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1242,7 +1242,6 @@ extern int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb);
 extern int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi,
 		      int encap_type);
 extern int xfrm_input_resume(struct sk_buff *skb, int nexthdr);
-extern int xfrm_output_resume(struct sk_buff *skb, int err);
 extern int xfrm_output(struct sk_buff *skb);
 extern int xfrm4_extract_header(struct sk_buff *skb);
 extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb);
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index f4a1047..9a6e92e 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -136,7 +136,6 @@ int xfrm_output_resume(struct sk_buff *skb, int err)
 out:
 	return err;
 }
-EXPORT_SYMBOL_GPL(xfrm_output_resume);
 
 static int xfrm_output2(struct sk_buff *skb)
 {

^ permalink raw reply related

* [2.6 patch] atm/idt77105.c: fix section mismatch
From: Adrian Bunk @ 2008-01-19 13:18 UTC (permalink / raw)
  To: chas, jgarzik; +Cc: netdev, linux-kernel

EXPORT_SYMBOL'ed code mustn't be __*init.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- linux-2.6/drivers/atm/idt77105.c.old	2008-01-19 11:19:53.000000000 +0200
+++ linux-2.6/drivers/atm/idt77105.c	2008-01-19 11:20:10.000000000 +0200
@@ -354,13 +354,13 @@ static const struct atmphy_ops idt77105_
 	.ioctl =	idt77105_ioctl,
 	.interrupt =	idt77105_int,
 	.stop =		idt77105_stop,
 };
 
 
-int __devinit idt77105_init(struct atm_dev *dev)
+int idt77105_init(struct atm_dev *dev)
 {
 	dev->phy = &idt77105_ops;
 	return 0;
 }
 
 EXPORT_SYMBOL(idt77105_init);


^ permalink raw reply

* [2.6 patch] atm/suni.c: fix section mismatch
From: Adrian Bunk @ 2008-01-19 13:18 UTC (permalink / raw)
  To: chas, jgarzik; +Cc: netdev, linux-kernel

EXPORT_SYMBOL'ed code mustn't be __*init.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- linux-2.6/drivers/atm/suni.c.old	2008-01-19 12:16:41.000000000 +0200
+++ linux-2.6/drivers/atm/suni.c	2008-01-19 12:17:23.000000000 +0200
@@ -275,35 +275,35 @@ static int suni_stop(struct atm_dev *dev
 	*walk = PRIV((*walk)->dev)->next;
 	if (!sunis) del_timer_sync(&poll_timer);
 	spin_unlock_irqrestore(&sunis_lock,flags);
 	kfree(PRIV(dev));
 
 	return 0;
 }
 
 
 static const struct atmphy_ops suni_ops = {
 	.start		= suni_start,
 	.ioctl		= suni_ioctl,
 	.interrupt	= suni_int,
 	.stop		= suni_stop,
 };
 
 
-int __devinit suni_init(struct atm_dev *dev)
+int suni_init(struct atm_dev *dev)
 {
 	unsigned char mri;
 
 	mri = GET(MRI); /* reset SUNI */
 	PUT(mri | SUNI_MRI_RESET,MRI);
 	PUT(mri,MRI);
 	PUT((GET(MT) & SUNI_MT_DS27_53),MT); /* disable all tests */
 	REG_CHANGE(SUNI_TPOP_APM_S,SUNI_TPOP_APM_S_SHIFT,SUNI_TPOP_S_SONET,
 	    TPOP_APM); /* use SONET */
 	REG_CHANGE(SUNI_TACP_IUCHP_CLP,0,SUNI_TACP_IUCHP_CLP,
 	    TACP_IUCHP); /* idle cells */
 	PUT(SUNI_IDLE_PATTERN,TACP_IUCPOP);
 	dev->phy = &suni_ops;
 	return 0;
 }
 
 EXPORT_SYMBOL(suni_init);


^ permalink raw reply

* Re: [2.6 patch] atm/idt77105.c: fix section mismatch
From: Sam Ravnborg @ 2008-01-19 13:28 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: chas, jgarzik, netdev, linux-kernel
In-Reply-To: <20080119131849.GA8669@does.not.exist>

On Sat, Jan 19, 2008 at 03:18:49PM +0200, Adrian Bunk wrote:
> EXPORT_SYMBOL'ed code mustn't be __*init.
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
> 
> ---
> --- linux-2.6/drivers/atm/idt77105.c.old	2008-01-19 11:19:53.000000000 +0200
> +++ linux-2.6/drivers/atm/idt77105.c	2008-01-19 11:20:10.000000000 +0200
> @@ -354,13 +354,13 @@ static const struct atmphy_ops idt77105_
>  	.ioctl =	idt77105_ioctl,
>  	.interrupt =	idt77105_int,
>  	.stop =		idt77105_stop,
>  };
>  
>  
> -int __devinit idt77105_init(struct atm_dev *dev)
> +int idt77105_init(struct atm_dev *dev)
>  {
>  	dev->phy = &idt77105_ops;
>  	return 0;
>  }
>  
>  EXPORT_SYMBOL(idt77105_init);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [2.6 patch] atm/suni.c: fix section mismatch
From: Sam Ravnborg @ 2008-01-19 13:29 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: chas, jgarzik, netdev, linux-kernel
In-Reply-To: <20080119131851.GB8669@does.not.exist>

On Sat, Jan 19, 2008 at 03:18:51PM +0200, Adrian Bunk wrote:
> EXPORT_SYMBOL'ed code mustn't be __*init.
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
> 
> ---
> --- linux-2.6/drivers/atm/suni.c.old	2008-01-19 12:16:41.000000000 +0200
> +++ linux-2.6/drivers/atm/suni.c	2008-01-19 12:17:23.000000000 +0200
> @@ -275,35 +275,35 @@ static int suni_stop(struct atm_dev *dev
>  	*walk = PRIV((*walk)->dev)->next;
>  	if (!sunis) del_timer_sync(&poll_timer);
>  	spin_unlock_irqrestore(&sunis_lock,flags);
>  	kfree(PRIV(dev));
>  
>  	return 0;
>  }
>  
>  
>  static const struct atmphy_ops suni_ops = {
>  	.start		= suni_start,
>  	.ioctl		= suni_ioctl,
>  	.interrupt	= suni_int,
>  	.stop		= suni_stop,
>  };
>  
>  
> -int __devinit suni_init(struct atm_dev *dev)
> +int suni_init(struct atm_dev *dev)
>  {
>  	unsigned char mri;
>  
>  	mri = GET(MRI); /* reset SUNI */
>  	PUT(mri | SUNI_MRI_RESET,MRI);
>  	PUT(mri,MRI);
>  	PUT((GET(MT) & SUNI_MT_DS27_53),MT); /* disable all tests */
>  	REG_CHANGE(SUNI_TPOP_APM_S,SUNI_TPOP_APM_S_SHIFT,SUNI_TPOP_S_SONET,
>  	    TPOP_APM); /* use SONET */
>  	REG_CHANGE(SUNI_TACP_IUCHP_CLP,0,SUNI_TACP_IUCHP_CLP,
>  	    TACP_IUCHP); /* idle cells */
>  	PUT(SUNI_IDLE_PATTERN,TACP_IUCPOP);
>  	dev->phy = &suni_ops;
>  	return 0;
>  }
>  
>  EXPORT_SYMBOL(suni_init);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] IPv4: Enable use of 240/4 address space
From: Jan Engelhardt @ 2008-01-19 13:44 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki / 吉藤英明
  Cc: davem, netdev, linux-kernel, ak, vaf
In-Reply-To: <20080118.111319.30002290.yoshfuji@linux-ipv6.org>


On Jan 18 2008 11:13, YOSHIFUJI Hideaki / 吉藤英明 wrote:
>> -static inline bool ipv4_is_badclass(__be32 addr)
>> +static inline bool ipv4_is_broadcast(__be32 addr)
>>  {
>
>I'm just afraid that people might think ipv4_is_broadcast
>is for testing subnet broadcast address.
>
>255.255.255.255 is "limited broadcast address"
>(vs subnet broadcast address, which can be forwarded by routers).



From 84bccef295aa9754ee662191e32ba1d64edce2ba Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@computergmbh.de>
Date: Fri, 18 Jan 2008 02:10:44 +0100
Subject: [PATCH] IPv4: enable use of 240/4 address space

This short patch modifies the IPv4 networking to enable use of the
240.0.0.0/4 (aka "class-E") address space as propsed in the internet
draft draft-fuller-240space-00.txt.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
---
 include/linux/in.h      |    5 +++--
 include/net/addrconf.h  |    2 +-
 net/core/pktgen.c       |    2 +-
 net/ipv4/fib_frontend.c |    2 +-
 net/ipv4/route.c        |   12 ++++++------
 5 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/include/linux/in.h b/include/linux/in.h
index 27d8a5a..70c6df8 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -262,9 +262,10 @@ static inline bool ipv4_is_local_multicast(__be32 addr)
 	return (addr & htonl(0xffffff00)) == htonl(0xe0000000);
 }
 
-static inline bool ipv4_is_badclass(__be32 addr)
+static inline bool ipv4_is_lbcast(__be32 addr)
 {
-	return (addr & htonl(0xf0000000)) == htonl(0xf0000000);
+	/* limited broadcast */
+	return addr == INADDR_BROADCAST;
 }
 
 static inline bool ipv4_is_zeronet(__be32 addr)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 8b1509b..496503c 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -262,7 +262,7 @@ static inline int ipv6_isatap_eui64(u8 *eui, __be32 addr)
 		  ipv4_is_private_172(addr) || ipv4_is_test_192(addr) ||
 		  ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) ||
 		  ipv4_is_test_198(addr) || ipv4_is_multicast(addr) ||
-		  ipv4_is_badclass(addr)) ? 0x00 : 0x02;
+		  ipv4_is_lbcast(addr)) ? 0x00 : 0x02;
 	eui[1] = 0;
 	eui[2] = 0x5E;
 	eui[3] = 0xFE;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index d18fdb1..eebccdb 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2266,7 +2266,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 
 					while (ipv4_is_loopback(s) ||
 					       ipv4_is_multicast(s) ||
-					       ipv4_is_badclass(s) ||
+					       ipv4_is_lbcast(s) ||
 					       ipv4_is_zeronet(s) ||
 					       ipv4_is_local_multicast(s)) {
 						t = random32() % (imx - imn) + imn;
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 8ddcd3f..995b453 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -176,7 +176,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
 	unsigned ret = RTN_BROADCAST;
 	struct fib_table *local_table;
 
-	if (ipv4_is_zeronet(addr) || ipv4_is_badclass(addr))
+	if (ipv4_is_zeronet(addr) || ipv4_is_lbcast(addr))
 		return RTN_BROADCAST;
 	if (ipv4_is_multicast(addr))
 		return RTN_MULTICAST;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1e59c0d..1e484f7 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1154,7 +1154,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
 		return;
 
 	if (new_gw == old_gw || !IN_DEV_RX_REDIRECTS(in_dev)
-	    || ipv4_is_multicast(new_gw) || ipv4_is_badclass(new_gw)
+	    || ipv4_is_multicast(new_gw) || ipv4_is_lbcast(new_gw)
 	    || ipv4_is_zeronet(new_gw))
 		goto reject_redirect;
 
@@ -1634,7 +1634,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
 	if (in_dev == NULL)
 		return -EINVAL;
 
-	if (ipv4_is_multicast(saddr) || ipv4_is_badclass(saddr) ||
+	if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) ||
 	    ipv4_is_loopback(saddr) || skb->protocol != htons(ETH_P_IP))
 		goto e_inval;
 
@@ -1891,7 +1891,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
 	   by fib_lookup.
 	 */
 
-	if (ipv4_is_multicast(saddr) || ipv4_is_badclass(saddr) ||
+	if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) ||
 	    ipv4_is_loopback(saddr))
 		goto martian_source;
 
@@ -1904,7 +1904,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
 	if (ipv4_is_zeronet(saddr))
 		goto martian_source;
 
-	if (ipv4_is_badclass(daddr) || ipv4_is_zeronet(daddr) ||
+	if (ipv4_is_lbcast(daddr) || ipv4_is_zeronet(daddr) ||
 	    ipv4_is_loopback(daddr))
 		goto martian_destination;
 
@@ -2125,7 +2125,7 @@ static inline int __mkroute_output(struct rtable **result,
 		res->type = RTN_BROADCAST;
 	else if (ipv4_is_multicast(fl->fl4_dst))
 		res->type = RTN_MULTICAST;
-	else if (ipv4_is_badclass(fl->fl4_dst) || ipv4_is_zeronet(fl->fl4_dst))
+	else if (ipv4_is_lbcast(fl->fl4_dst) || ipv4_is_zeronet(fl->fl4_dst))
 		return -EINVAL;
 
 	if (dev_out->flags & IFF_LOOPBACK)
@@ -2276,7 +2276,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
 	if (oldflp->fl4_src) {
 		err = -EINVAL;
 		if (ipv4_is_multicast(oldflp->fl4_src) ||
-		    ipv4_is_badclass(oldflp->fl4_src) ||
+		    ipv4_is_lbcast(oldflp->fl4_src) ||
 		    ipv4_is_zeronet(oldflp->fl4_src))
 			goto out;
 
-- 
1.5.3.4


^ permalink raw reply related

* Re: [PATCH][NEIGH] Fix race between neigh_parms_release and neightbl_fill_parms
From: Andrey Rahmatullin @ 2008-01-19 14:15 UTC (permalink / raw)
  To: netdev
In-Reply-To: <4785F9F5.6070502@openvz.org>

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

This patch causes messages like 'unregister_netdevice: waiting for ppp0 to
become free. Usage count = 1' when I try 'ifdown ppp0'. This happens in all
kernel versions containing this commit and doesn't happen in 2.6.24-rc8
with this commit reverted.

-- 
WBR, wRAR (ALT Linux Team)

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Your Friend and Lover
From: development @ 2008-01-18 15:18 UTC (permalink / raw)
  To: netdev

Sending You My Love http://89.39.115.149/


^ permalink raw reply

* Re: [PATCH] IPv4: Enable use of 240/4 address space
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-01-19 15:30 UTC (permalink / raw)
  To: jengelh, davem; +Cc: netdev, linux-kernel, ak, vaf, yoshfuji
In-Reply-To: <Pine.LNX.4.64.0801191443410.27831@fbirervta.pbzchgretzou.qr>

In article <Pine.LNX.4.64.0801191443410.27831@fbirervta.pbzchgretzou.qr> (at Sat, 19 Jan 2008 14:44:13 +0100 (CET)), Jan Engelhardt <jengelh@computergmbh.de> says:

> From 84bccef295aa9754ee662191e32ba1d64edce2ba Mon Sep 17 00:00:00 2001
> From: Jan Engelhardt <jengelh@computergmbh.de>
> Date: Fri, 18 Jan 2008 02:10:44 +0100
> Subject: [PATCH] IPv4: enable use of 240/4 address space
> 
> This short patch modifies the IPv4 networking to enable use of the
> 240.0.0.0/4 (aka "class-E") address space as propsed in the internet
> draft draft-fuller-240space-00.txt.
> 
> Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

--yoshfuji

^ permalink raw reply

* Re: [Bugme-new] [Bug 9773] New: pptp/ppp connection die at high speed on Athlon X2 6000+
From: Jarek Poplawski @ 2008-01-19 18:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: netdev, bugme-daemon, Paul Mackerras, wizard580
In-Reply-To: <20080117234809.fc3f6cca.akpm@linux-foundation.org>

Andrew Morton wrote, On 01/18/2008 08:48 AM:

> On Thu, 17 Jan 2008 23:33:54 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
> 
>> http://bugzilla.kernel.org/show_bug.cgi?id=9773
>>
>>            Summary: pptp/ppp connection die at high speed on Athlon X2 6000+
>>            Product: Networking
>>            Version: 2.5
>>      KernelVersion: 2.6.23.12


...

>> kernel 2.6.24rc8 makes it worst. As I see it just hangs my console with message
>> something like "waiting for ppp0 finish" or so... I don't remember exactly
>> message.

Could you please:

- check this after echo 1 > /proc/sys/kernel/sched_compat_yield
- check this with 2.6.22

Regards,
Jarek P.

^ permalink raw reply

* [PATCH] mv643xx: fix byte order when checksum offload is enabled
From: Byron Bradley @ 2008-01-19 19:27 UTC (permalink / raw)
  To: netdev
  Cc: hvr, akpm, Byron Bradley, Dale Farnsworth, Manish Lachwani,
	Tzachi Perelstein

The Marvell Orion system on chips have an integrated mv643xx MAC.
On these little endian ARM devices mv643xx will oops when checksum
offload is enabled. Swapping the byte order of the protocol and
checksum solves this problem.

Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
Cc: Dale Farnsworth <dale@farnsworth.org>
Cc: Manish Lachwani <mlachwani@mvista.com>
Cc: Tzachi Perelstein <tzachi@marvell.com>
---

This patch has only been tested on two Marvell Orion based boards so it
should be considered only very lightly tested. It applies against
2.6.24-rc8-mm1.

 drivers/net/mv643xx_eth.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 651c269..5d16a5d 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1689,7 +1689,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
 	desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		BUG_ON(skb->protocol != ETH_P_IP);
+		BUG_ON(skb->protocol != htons(ETH_P_IP));
 
 		cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
 			   ETH_GEN_IP_V_4_CHECKSUM  |
@@ -1698,10 +1698,10 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
 		switch (ip_hdr(skb)->protocol) {
 		case IPPROTO_UDP:
 			cmd_sts |= ETH_UDP_FRAME;
-			desc->l4i_chk = udp_hdr(skb)->check;
+			desc->l4i_chk = htons(udp_hdr(skb)->check);
 			break;
 		case IPPROTO_TCP:
-			desc->l4i_chk = tcp_hdr(skb)->check;
+			desc->l4i_chk = htons(tcp_hdr(skb)->check);
 			break;
 		default:
 			BUG();
-- 
1.5.4.rc2.38.gd6da3



^ permalink raw reply related

* Re: [PATCH] mv643xx: fix byte order when checksum offload is enabled
From: Al Viro @ 2008-01-19 20:09 UTC (permalink / raw)
  To: Byron Bradley
  Cc: netdev, hvr, akpm, Dale Farnsworth, Manish Lachwani,
	Tzachi Perelstein
In-Reply-To: <1200770858-11456-1-git-send-email-byron.bbradley@gmail.com>

On Sat, Jan 19, 2008 at 07:27:38PM +0000, Byron Bradley wrote:
>  		case IPPROTO_UDP:
>  			cmd_sts |= ETH_UDP_FRAME;
> -			desc->l4i_chk = udp_hdr(skb)->check;
> +			desc->l4i_chk = htons(udp_hdr(skb)->check);
>  			break;
>  		case IPPROTO_TCP:
> -			desc->l4i_chk = tcp_hdr(skb)->check;
> +			desc->l4i_chk = htons(tcp_hdr(skb)->check);
>  			break;

The first part was OK, but this one...  AFAICS, the sucker byteswaps
64bit words in descriptors wholesale, right?  Then the right way to spell
that would be ntohs((__force __be16)....->check).

What's happening here is that we take a fixed-endian (checksum) and then
correct for conversion done in hardware - i.e. we store it in something
that expects a _host_-endian value and would convert that to fixed-endian.
So we need to counter that correction and that's where the damn thing is
coming from.

It's not particulary rare - drivers that do hardware byteswap tend to need
it.  For now I'd suggest explicit form (with force-cast from __csum to
__be16 and ntohs() on top of it); if anybody has good ideas for helper
names, though...  csum_as_le() and csum_as_be(), perhaps?  Interpret
__csum (fixed-endian) and another fixed-endian type, with proper checks;
i.e. something along the lines of
static inline __be16 csum_as_be(__csum sum)
{
	return (__force __be16)sum;
}
and this stuff becoming ntohs(csum_as_be(udp_hdr(skb)->check)), etc.

^ permalink raw reply

* [PATCH] mv643xx_eth: fix byte order when checksum offload is enabled
From: Dale Farnsworth @ 2008-01-19 20:23 UTC (permalink / raw)
  To: jgarzik
  Cc: netdev, hvr, akpm, Manish Lachwani, Tzachi Perelstein,
	Byron Bradley
In-Reply-To: <1200770858-11456-1-git-send-email-byron.bbradley@gmail.com>

From: Byron Bradley <byron.bbradley@gmail.com>

The Marvell Orion system on chips have an integrated mv643xx MAC.
On these little endian ARM devices mv643xx will oops when checksum
offload is enabled. Swapping the byte order of the protocol and
checksum solves this problem.

Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Cc: Manish Lachwani <mlachwani@mvista.com>
Cc: Tzachi Perelstein <tzachi@marvell.com>

---

Byron Bradley wrote:
> This patch has only been tested on two Marvell Orion based boards so it
> should be considered only very lightly tested. It applies against
> 2.6.24-rc8-mm1.

Dale Farnsworth:
Looks good to me and I successfully booted it on a big-endian prpmc2800 board.

Jeff, please pick this up.  My mv643xx queue is otherwise empty.

Thanks,
-Dale

 drivers/net/mv643xx_eth.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 651c269..5d16a5d 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1689,7 +1689,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
 	desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		BUG_ON(skb->protocol != ETH_P_IP);
+		BUG_ON(skb->protocol != htons(ETH_P_IP));
 
 		cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
 			   ETH_GEN_IP_V_4_CHECKSUM  |
@@ -1698,10 +1698,10 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
 		switch (ip_hdr(skb)->protocol) {
 		case IPPROTO_UDP:
 			cmd_sts |= ETH_UDP_FRAME;
-			desc->l4i_chk = udp_hdr(skb)->check;
+			desc->l4i_chk = htons(udp_hdr(skb)->check);
 			break;
 		case IPPROTO_TCP:
-			desc->l4i_chk = tcp_hdr(skb)->check;
+			desc->l4i_chk = htons(tcp_hdr(skb)->check);
 			break;
 		default:
 			BUG();
-- 
1.5.4.rc2.38.gd6da3



^ permalink raw reply related

* Re: [PATCH net-2.6.25] [XFRM] Remove unneeded export of xfrm_output_resume() and remove its declaration from net/xfrm.h.
From: Herbert Xu @ 2008-01-19 20:32 UTC (permalink / raw)
  To: Rami Rosen; +Cc: davem, netdev, herbert
In-Reply-To: <eb3ff54b0801190513k6b59ce6cq956ac8ebb6dc5e40@mail.gmail.com>

Rami Rosen <ramirose@gmail.com> wrote:
> 
> The method xfrm_output_resume() is used only in net/xfrm/xfrm_output.c.
> 
> This patch removes using unneeded EXPORT_SYMBOL_GPL to export it in
> net/xfrm/xfrm_output.c and also removes its declaration in net/xfrm.h.

This will be used ESP.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH] mv643xx_eth: fix byte order when checksum offload is enabled
From: Dale Farnsworth @ 2008-01-19 20:45 UTC (permalink / raw)
  To: jgarzik
  Cc: netdev, hvr, akpm, Manish Lachwani, Tzachi Perelstein,
	Byron Bradley
In-Reply-To: <20080119202301.GA26826@farnsworth.org>

OK, after digesting Al Viro's comments on this, I agree with him
and retract this.  These multiple byte swaps sure are confusing.

Byron, would you please resubmit?

Thanks,
-Dale

On Sat, Jan 19, 2008 at 01:23:01PM -0700, Dale Farnsworth wrote:
> From: Byron Bradley <byron.bbradley@gmail.com>
> 
> The Marvell Orion system on chips have an integrated mv643xx MAC.
> On these little endian ARM devices mv643xx will oops when checksum
> offload is enabled. Swapping the byte order of the protocol and
> checksum solves this problem.
> 
> Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
> Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
> Cc: Manish Lachwani <mlachwani@mvista.com>
> Cc: Tzachi Perelstein <tzachi@marvell.com>
> 
> ---
> 
> Byron Bradley wrote:
> > This patch has only been tested on two Marvell Orion based boards so it
> > should be considered only very lightly tested. It applies against
> > 2.6.24-rc8-mm1.
> 
> Dale Farnsworth:
> Looks good to me and I successfully booted it on a big-endian prpmc2800 board.
> 
> Jeff, please pick this up.  My mv643xx queue is otherwise empty.
> 
> Thanks,
> -Dale
> 
>  drivers/net/mv643xx_eth.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
> index 651c269..5d16a5d 100644
> --- a/drivers/net/mv643xx_eth.c
> +++ b/drivers/net/mv643xx_eth.c
> @@ -1689,7 +1689,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
>  	desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);
>  
>  	if (skb->ip_summed == CHECKSUM_PARTIAL) {
> -		BUG_ON(skb->protocol != ETH_P_IP);
> +		BUG_ON(skb->protocol != htons(ETH_P_IP));
>  
>  		cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
>  			   ETH_GEN_IP_V_4_CHECKSUM  |
> @@ -1698,10 +1698,10 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
>  		switch (ip_hdr(skb)->protocol) {
>  		case IPPROTO_UDP:
>  			cmd_sts |= ETH_UDP_FRAME;
> -			desc->l4i_chk = udp_hdr(skb)->check;
> +			desc->l4i_chk = htons(udp_hdr(skb)->check);
>  			break;
>  		case IPPROTO_TCP:
> -			desc->l4i_chk = tcp_hdr(skb)->check;
> +			desc->l4i_chk = htons(tcp_hdr(skb)->check);
>  			break;
>  		default:
>  			BUG();
> -- 
> 1.5.4.rc2.38.gd6da3
> 
> 

^ permalink raw reply

* Re: Packetlost when "tc qdisc del dev eth0 root"
From: Jarek Poplawski @ 2008-01-19 23:21 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: slavon, netdev
In-Reply-To: <478D9222.7030603@trash.net>

Patrick McHardy wrote, On 01/16/2008 06:12 AM:

> slavon@bigtelecom.ru wrote:
>> Good night! =)
>>
>> Sorry... i was wrong...
>> I see that problem more serious....
>>
>> Lets see to scheme
>>
>> Class 1
>> ---qdisc
>> ------- 10k classes
>> Class 2
>> ---qdisc
>> ------- 10k classes
>>
>> All traffic go to class 2... class 1 qdisc not have packets and if we 
>> delete it - packets not lost... in theory... lets try delete class 1 
>> qdisc (all childrens delete too)...
>> PC freeze on 2-5 seconds... its not forward any traffic at this 
>> moment... its great tree lock?
>>
>> Its normal or code need to more accurate lock?
> 
> 
> htb class destruction can be quite expansive if one of the rb trees
> needs to be rebalanced. Doing that for 10000 classes would explain
> the delay.

I've just looked at this and it seems there should be no rbtrees operations
during htb qdisc deletion (or I miss something).

Slavon, I see nearby that you teach oprofile...

Regards,
Jarek P.

^ permalink raw reply

* [PATCH 01/14] Fix sparse warning: returning void-valued expression
From: Jussi Kivilinna @ 2008-01-20  0:13 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA
  Cc: bjd-a1rhEgazXTw, dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f,
	netdev-u79uwXL29TY76Z2rM5mHXA

From: Bjorge Dijkstra <bjd-a1rhEgazXTw@public.gmane.org>

rndis_unbind and usbnet_cdc_unbind don't return anything.

Signed-off-by: Bjorge Dijkstra <bjd-a1rhEgazXTw@public.gmane.org>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna-E01nCVcF24I@public.gmane.org>
---

 drivers/net/usb/rndis_host.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 1ebe325..96ef6a9 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -585,7 +585,7 @@ static void rndis_unbind(struct usbnet *dev, struct usb_interface *intf)
 		kfree(halt);
 	}
 
-	return usbnet_cdc_unbind(dev, intf);
+	usbnet_cdc_unbind(dev, intf);
 }
 
 /*

^ permalink raw reply related

* [PATCH 00/14] RFC: Driver for Wireless RNDIS USB devices.
From: Jussi Kivilinna @ 2008-01-20  0:13 UTC (permalink / raw)
  To: linux-wireless; +Cc: bjd, dbrownell, netdev

Hello,

This is second try on wireless RNDIS patchset started by Bjorge Dijkstra. Since
Bjorge has disappeared, I claim maintainership of rndis_wext and this patchset
until he returns.

This patchset adds support for various 802.11 USB devices based on Broadcom
4320 chip. Chip uses RNDIS to communicate with the host, so module depend
heavily on rndis_host/cdc_ether/usbnet and needs some changes on these 
modules in order to work.

Patches 1-6 are from first patchset:
 1. Fix sparse warning: returning void valued expression
 2. [cdc_ether] Hardwire CDC descriptors when missing
 3. [rndis_host] Use 1KB buffer in rndis_unbind
 4. [rndis_host] Halt device if rndis_bind fails
 5. [rndis_host] Fix rndis packet filter flags
 6. [usbnet] Use wlan device name for RNDIS wireless devices

Of these 1, 3 and 4 are not required for this version of rndis_wext to work.

Actual wireless part is changed from extension on rndis_host to separate 
driver. Different devices are detected by device specific USB vendor/product 
IDs as the way done with Windows drivers instead of detecting RNDIS media type 
like in first patchset.

New patches 7-14:
 7. [rndis_host] Split up rndis_host.c
 8. [rndis_host] export functions
 9. [usbnet] add driver_priv pointer to 'struct usbnet'
10. [rndis_host] Add rndis_early_init function pointer to 'struct rndis_data'.
11. [rndis_host] Add rndis_link_change function pointer to 'struct rndis_data'.
12. Move usbnet.h and rndis_host.h to include/linux/usb
13. [rndis_host] blacklist known wireless RNDIS devices
14. Add new driver 'rndis_wext' for wireless RNDIS devices.

Patches should be applied in order, series apply cleanly to 2.6.24-rc8.

 - Jussi Kivilinna


^ permalink raw reply

* [PATCH 02/14] [cdc_ether] Hardwire CDC descriptors when missing
From: Jussi Kivilinna @ 2008-01-20  0:13 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA
  Cc: bjd-a1rhEgazXTw, dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f,
	netdev-u79uwXL29TY76Z2rM5mHXA

From: Bjorge Dijkstra <bjd-a1rhEgazXTw@public.gmane.org>

Just as ActiveSync devices, some regular RNDIS devices also lack
the CDC descriptors (e.g. devices based on BCM4320 WLAN chip).
This patch hardwires the CDC descriptors for all RNDIS style devices
when they are missing.

Signed-off-by: Bjorge Dijkstra <bjd-a1rhEgazXTw@public.gmane.org>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna-E01nCVcF24I@public.gmane.org>
---

 drivers/net/usb/cdc_ether.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index a42acc3..97c17bb 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -228,15 +228,16 @@ next_desc:
 		buf += buf [0];
 	}
 
-	/* Microsoft ActiveSync based RNDIS devices lack the CDC descriptors,
-	 * so we'll hard-wire the interfaces and not check for descriptors.
+	/* Microsoft ActiveSync based and some regular RNDIS devices lack the
+	 * CDC descriptors, so we'll hard-wire the interfaces and not check
+	 * for descriptors.
 	 */
-	if (is_activesync(&intf->cur_altsetting->desc) && !info->u) {
+	if (rndis && !info->u) {
 		info->control = usb_ifnum_to_if(dev->udev, 0);
 		info->data = usb_ifnum_to_if(dev->udev, 1);
 		if (!info->control || !info->data) {
 			dev_dbg(&intf->dev,
-				"activesync: master #0/%p slave #1/%p\n",
+				"rndis: master #0/%p slave #1/%p\n",
 				info->control,
 				info->data);
 			goto bad_desc;
@@ -316,7 +317,6 @@ void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
 }
 EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);
 
-\f
 /*-------------------------------------------------------------------------
  *
  * Communications Device Class, Ethernet Control model

^ permalink raw reply related

* [PATCH 03/14] [rndis_host] Use 1KB buffer in rndis_unbind
From: Jussi Kivilinna @ 2008-01-20  0:13 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA
  Cc: bjd-a1rhEgazXTw, dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f,
	netdev-u79uwXL29TY76Z2rM5mHXA

rndis_command requires the caller to pass in a buffer of at least 1KB.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna-E01nCVcF24I@public.gmane.org>
Signed-off-by: Bjorge Dijkstra <bjd-a1rhEgazXTw@public.gmane.org>
---

 drivers/net/usb/rndis_host.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 96ef6a9..42b161c 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -577,7 +577,7 @@ static void rndis_unbind(struct usbnet *dev, struct usb_interface *intf)
 	struct rndis_halt	*halt;
 
 	/* try to clear any rndis state/activity (no i/o from stack!) */
-	halt = kzalloc(sizeof *halt, GFP_KERNEL);
+	halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL);
 	if (halt) {
 		halt->msg_type = RNDIS_MSG_HALT;
 		halt->msg_len = ccpu2(sizeof *halt);

^ permalink raw reply related

* [PATCH 04/14] [rndis_host] Halt device if rndis_bind fails.
From: Jussi Kivilinna @ 2008-01-20  0:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: bjd, dbrownell, netdev

When bind fails after device was initialized, shutdown device properly
by sending RNDIS_MSG_HALT.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Bjorge Dijkstra <bjd@jooz.net>
---

 drivers/net/usb/rndis_host.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 42b161c..c686025 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -467,6 +467,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
 		struct rndis_query_c	*get_c;
 		struct rndis_set	*set;
 		struct rndis_set_c	*set_c;
+		struct rndis_halt	*halt;
 	} u;
 	u32			tmp;
 	int			reply_len;
@@ -517,7 +518,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
 				"dev can't take %u byte packets (max %u)\n",
 				dev->hard_mtu, tmp);
 			retval = -EINVAL;
-			goto fail_and_release;
+			goto halt_fail_and_release;
 		}
 		dev->hard_mtu = tmp;
 		net->mtu = dev->hard_mtu - net->hard_header_len;
@@ -539,7 +540,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
 			48, (void **) &bp, &reply_len);
 	if (unlikely(retval< 0)) {
 		dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval);
-		goto fail_and_release;
+		goto halt_fail_and_release;
 	}
 	memcpy(net->dev_addr, bp, ETH_ALEN);
 
@@ -555,7 +556,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
 	retval = rndis_command(dev, u.header);
 	if (unlikely(retval < 0)) {
 		dev_err(&intf->dev, "rndis set packet filter, %d\n", retval);
-		goto fail_and_release;
+		goto halt_fail_and_release;
 	}
 
 	retval = 0;
@@ -563,6 +564,11 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
 	kfree(u.buf);
 	return retval;
 
+halt_fail_and_release:
+	memset(u.halt, 0, sizeof *u.halt);
+	u.halt->msg_type = RNDIS_MSG_HALT;
+	u.halt->msg_len = ccpu2(sizeof *u.halt);
+	(void) rndis_command(dev, (void *)u.halt);
 fail_and_release:
 	usb_set_intfdata(info->data, NULL);
 	usb_driver_release_interface(driver_of(intf), info->data);


^ permalink raw reply related

* [PATCH 05/14] [rndis_host] Fix rndis packet filter flags.
From: Jussi Kivilinna @ 2008-01-20  0:14 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA
  Cc: bjd-a1rhEgazXTw, dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f,
	netdev-u79uwXL29TY76Z2rM5mHXA

RNDIS packet filter flags are not exactly the same as CDC flags
so we cannot reuse them.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna-E01nCVcF24I@public.gmane.org>
Signed-off-by: Bjorge Dijkstra <bjd-a1rhEgazXTw@public.gmane.org>
---

 drivers/net/usb/rndis_host.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index c686025..12daf9c 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -256,6 +256,27 @@ struct rndis_keepalive_c {	/* IN (optionally OUT) */
 #define OID_GEN_MAXIMUM_FRAME_SIZE	ccpu2(0x00010106)
 #define OID_GEN_CURRENT_PACKET_FILTER	ccpu2(0x0001010e)
 
+/* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */
+#define RNDIS_PACKET_TYPE_DIRECTED		ccpu2(0x00000001)
+#define RNDIS_PACKET_TYPE_MULTICAST		ccpu2(0x00000002)
+#define RNDIS_PACKET_TYPE_ALL_MULTICAST		ccpu2(0x00000004)
+#define RNDIS_PACKET_TYPE_BROADCAST		ccpu2(0x00000008)
+#define RNDIS_PACKET_TYPE_SOURCE_ROUTING	ccpu2(0x00000010)
+#define RNDIS_PACKET_TYPE_PROMISCUOUS		ccpu2(0x00000020)
+#define RNDIS_PACKET_TYPE_SMT			ccpu2(0x00000040)
+#define RNDIS_PACKET_TYPE_ALL_LOCAL		ccpu2(0x00000080)
+#define RNDIS_PACKET_TYPE_GROUP			ccpu2(0x00001000)
+#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL	ccpu2(0x00002000)
+#define RNDIS_PACKET_TYPE_FUNCTIONAL		ccpu2(0x00004000)
+#define RNDIS_PACKET_TYPE_MAC_FRAME		ccpu2(0x00008000)
+
+/* default filter used with RNDIS devices */
+#define RNDIS_DEFAULT_FILTER ( \
+	RNDIS_PACKET_TYPE_DIRECTED | \
+	RNDIS_PACKET_TYPE_BROADCAST | \
+	RNDIS_PACKET_TYPE_ALL_MULTICAST | \
+	RNDIS_PACKET_TYPE_PROMISCUOUS)
+
 /*
  * RNDIS notifications from device: command completion; "reverse"
  * keepalives; etc
@@ -551,7 +572,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
 	u.set->oid = OID_GEN_CURRENT_PACKET_FILTER;
 	u.set->len = ccpu2(4);
 	u.set->offset = ccpu2((sizeof *u.set) - 8);
-	*(__le32 *)(u.buf + sizeof *u.set) = ccpu2(DEFAULT_FILTER);
+	*(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER;
 
 	retval = rndis_command(dev, u.header);
 	if (unlikely(retval < 0)) {

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox