Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next] scm: Don't use struct ucred in NETLINK_CB and struct scm_cookie.
From: Eric Dumazet @ 2012-09-07 15:07 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: David Miller, netdev, Serge E. Hallyn
In-Reply-To: <87haralb0u.fsf@xmission.com>

On Thu, 2012-09-06 at 21:20 -0700, Eric W. Biederman wrote:
> Passing uids and gids on NETLINK_CB from a process in one user
> namespace to a process in another user namespace can result in the
> wrong uid or gid being presented to userspace.  Avoid that problem by
> passing kuids and kgids instead.
> 
> - define struct scm_creds for use in scm_cookie and netlink_skb_parms
>   that holds uid and gid information in kuid_t and kgid_t.
> 
> - Modify scm_set_cred to fill out scm_creds by heand instead of using
>   cred_to_ucred to fill out struct ucred.  This conversion ensures
>   userspace does not get incorrect uid or gid values to look at.
> 
> - Modify scm_recv to convert from struct scm_creds to struct ucred
>   before copying credential values to userspace.
> 
> - Modify __scm_send to populate struct scm_creds on in the scm_cookie,
>   instead of just copying struct ucred from userspace.
> 
> - Modify netlink_sendmsg to copy scm_creds instead of struct ucred
>   into the NETLINK_CB.
> 
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>


> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
> index 7cb7867..6473267 100644
> --- a/net/netlink/af_netlink.c
> +++ b/net/netlink/af_netlink.c
> @@ -1398,7 +1398,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
>  
>  	NETLINK_CB(skb).pid	= nlk->pid;
>  	NETLINK_CB(skb).dst_group = dst_group;
> -	memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
> +	NETLINK_CB(skb).creds	= siocb->scm->creds;
>  
>  	err = -EFAULT;
>  	if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {

Seems fine to me, but I am not sure why you kept NETLINK_CREDS()
defined/used once.

^ permalink raw reply

* Re: [PATCH 1/2] dst: take into account policy update on check()
From: Eric Dumazet @ 2012-09-07 15:08 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: Nicolas Dichtel, davem, sri, linux-sctp, netdev
In-Reply-To: <504A09FD.1050201@gmail.com>

On Fri, 2012-09-07 at 10:51 -0400, Vlad Yasevich wrote:

> I thought of that too, but that requires hacking xfrm to know the 
> namespace at the time it changes the flow_cache_genid.  This one seems 
> simpler to do.

Simpler maybe, but its yet another test done in fast path.

^ permalink raw reply

* Re: [PATCH 1/2] dst: take into account policy update on check()
From: Eric Dumazet @ 2012-09-07 15:09 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: vyasevich, davem, sri, linux-sctp, netdev
In-Reply-To: <504A08EA.3080506@6wind.com>

On Fri, 2012-09-07 at 16:47 +0200, Nicolas Dichtel wrote:
> Le 07/09/2012 16:35, Eric Dumazet a écrit :
> >
> > Hmm... cant we reuse rt_genid ?
> >
> > (When changing flow_cache_genid, change &net->ipv4.rt_genid)
> 
> And so adding a new field in net->ipv6?

or move net->ipv4.rt_genid to net->rt_genid

Having separate field for IPv4/IPv6 is of little interest IMHO

^ permalink raw reply

* Re: [PATCH 0/5] dev_<level> and dynamic_debug cleanups
From: Joe Perches @ 2012-09-07 15:12 UTC (permalink / raw)
  To: Jason Baron
  Cc: Andrew Morton, netdev, Greg Kroah-Hartman, David S. Miller,
	Jim Cromie, Kay Sievers, linux-kernel
In-Reply-To: <20120907145235.GA18673@redhat.com>

On Fri, 2012-09-07 at 10:52 -0400, Jason Baron wrote:
> On Thu, Sep 06, 2012 at 11:43:46AM -0700, Joe Perches wrote:
> > On Thu, 2012-09-06 at 13:51 -0400, Jason Baron wrote:
> > > On Sun, Aug 26, 2012 at 04:25:25AM -0700, Joe Perches wrote:
> > > > The recent commit to fix dynamic_debug was a bit unclean.
> > > > Neaten the style for dynamic_debug.
> > > > Reduce the stack use of message logging that uses netdev_printk
> > > > Add utility functions dev_printk_emit and dev_vprintk_emit for /dev/kmsg.
> > > > 
> > > > Joe Perches (5):
> > > >   dev_dbg/dynamic_debug: Update to use printk_emit, optimize stack
> > > >   netdev_printk/dynamic_netdev_dbg: Directly call printk_emit
> > > >   netdev_printk/netif_printk: Remove a superfluous logging colon
> > > >   dev: Add dev_vprintk_emit and dev_printk_emit
> > > >   device and dynamic_debug: Use dev_vprintk_emit and dev_printk_emit
> > > > 
> > > 
> > > Looks Good.
> > > 
> > > The one thing that is bothering me though, is that for
> > > __dynamic_dev_dbg(), __dynamic_netdev_dbg(), we are copying much of the core
> > > logic of __dev_printk(), __netdev_printk(), respectively. I would prefer
> > > have this in one place. Can we add a 'prefix' argument to __dev_printk(),
> > > and __netdev_printk() that dynamic debug can use, but is simply empty
> > > for dev_printk() and netdev_printk().
> > 
> > I don't think that's an improvement actually.
> > Why don't you try it.
> > 
> 
> Ok, below is what I was thinking. It winds up being more deletions than
> insertions.
> 
> Thanks,
> 
> -Jason
> 
> dynamic debug: remove duplicate __netdev_printk() and  __dev_printk() logic 
> 
> Add an option prefix string argument to __netdev_printk() and __dev_printk().
> In this way dynamic debug does not have to contain duplicate logic.
> 
> Signed-off-by: Jason Baron <jbaron@redhat.com>
> ---
>  drivers/base/core.c       |   13 +++++++------
>  include/linux/device.h    |    3 +++
>  include/linux/netdevice.h |    3 +++
>  lib/dynamic_debug.c       |   32 ++++++++------------------------
>  net/core/dev.c            |   11 ++++++-----
>  5 files changed, 27 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 65f82e3..7b4ee6d 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1937,15 +1937,16 @@ int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
>  }
>  EXPORT_SYMBOL(dev_printk_emit);
>  
> -static int __dev_printk(const char *level, const struct device *dev,
> -			struct va_format *vaf)
> +int __dev_printk(const char *level, const struct device *dev,
> +		 char *prefix, struct va_format *vaf)
>  {
>  	if (!dev)
>  		return printk("%s(NULL device *): %pV", level, vaf);
>  
>  	return dev_printk_emit(level[1] - '0', dev,
> -			       "%s %s: %pV",
> -			       dev_driver_string(dev), dev_name(dev), vaf);
> +			       "%s%s %s: %pV",
> +			       prefix, dev_driver_string(dev),
> +			       dev_name(dev), vaf);
>  }
>  
>  int dev_printk(const char *level, const struct device *dev,
> @@ -1960,7 +1961,7 @@ int dev_printk(const char *level, const struct device *dev,
>  	vaf.fmt = fmt;
>  	vaf.va = &args;
>  
> -	r = __dev_printk(level, dev, &vaf);
> +	r = __dev_printk(level, dev, "", &vaf);
>  
>  	va_end(args);
>  
> @@ -1980,7 +1981,7 @@ int func(const struct device *dev, const char *fmt, ...)	\
>  	vaf.fmt = fmt;						\
>  	vaf.va = &args;						\
>  								\
> -	r = __dev_printk(kern_level, dev, &vaf);		\
> +	r = __dev_printk(kern_level, dev, "", &vaf);		\
>  								\
>  	va_end(args);						\
>  								\
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 2da4589..573b15e 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -891,6 +891,9 @@ extern const char *dev_driver_string(const struct device *dev);
>  
>  #ifdef CONFIG_PRINTK
>  
> +extern int __dev_printk(const char *level, const struct device *dev,
> +			char *prefix, struct va_format *vaf);
> +
>  extern int dev_vprintk_emit(int level, const struct device *dev,
>  			    const char *fmt, va_list args);
>  extern __printf(3, 4)
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 5f49cc0..63f6165 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -2720,6 +2720,9 @@ static inline const char *netdev_name(const struct net_device *dev)
>  	return dev->name;
>  }
>  
> +extern int __netdev_printk(const char *level, const struct net_device *dev,
> +			   char *prefix, struct va_format *vaf);
> +
>  extern __printf(3, 4)
>  int netdev_printk(const char *level, const struct net_device *dev,
>  		  const char *format, ...);
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index e7f7d99..83bf601 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -578,6 +578,7 @@ int __dynamic_dev_dbg(struct _ddebug *descriptor,
>  	struct va_format vaf;
>  	va_list args;
>  	int res;
> +	char buf[PREFIX_SIZE];
>  
>  	BUG_ON(!descriptor);
>  	BUG_ON(!fmt);
> @@ -587,16 +588,9 @@ int __dynamic_dev_dbg(struct _ddebug *descriptor,
>  	vaf.fmt = fmt;
>  	vaf.va = &args;
>  
> -	if (!dev) {
> -		res = printk(KERN_DEBUG "(NULL device *): %pV", &vaf);
> -	} else {
> -		char buf[PREFIX_SIZE];
> -
> -		res = dev_printk_emit(7, dev, "%s%s %s: %pV",
> -				      dynamic_emit_prefix(descriptor, buf),
> -				      dev_driver_string(dev), dev_name(dev),
> -				      &vaf);
> -	}
> +	res = __dev_printk(KERN_DEBUG, dev,
> +			   dynamic_emit_prefix(descriptor, buf),
> +			   &vaf);
>  
>  	va_end(args);
>  
> @@ -612,6 +606,7 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
>  	struct va_format vaf;
>  	va_list args;
>  	int res;
> +	char buf[PREFIX_SIZE];
>  
>  	BUG_ON(!descriptor);
>  	BUG_ON(!fmt);
> @@ -621,20 +616,9 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
>  	vaf.fmt = fmt;
>  	vaf.va = &args;
>  
> -	if (dev && dev->dev.parent) {
> -		char buf[PREFIX_SIZE];
> -
> -		res = dev_printk_emit(7, dev->dev.parent,
> -				      "%s%s %s %s: %pV",
> -				      dynamic_emit_prefix(descriptor, buf),
> -				      dev_driver_string(dev->dev.parent),
> -				      dev_name(dev->dev.parent),
> -				      netdev_name(dev), &vaf);
> -	} else if (dev) {
> -		res = printk(KERN_DEBUG "%s: %pV", netdev_name(dev), &vaf);
> -	} else {
> -		res = printk(KERN_DEBUG "(NULL net_device): %pV", &vaf);
> -	}
> +	res = __netdev_printk(KERN_DEBUG, dev,
> +			      dynamic_emit_prefix(descriptor, buf),
> +			      &vaf);
>  
>  	va_end(args);
>  
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 8ad42fd..5fef0f6 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6422,15 +6422,16 @@ const char *netdev_drivername(const struct net_device *dev)
>  	return empty;
>  }
>  
> -static int __netdev_printk(const char *level, const struct net_device *dev,
> -			   struct va_format *vaf)
> +int __netdev_printk(const char *level, const struct net_device *dev,
> +		    char *prefix, struct va_format *vaf)
>  {
>  	int r;
>  
>  	if (dev && dev->dev.parent) {
>  		r = dev_printk_emit(level[1] - '0',
>  				    dev->dev.parent,
> -				    "%s %s %s: %pV",
> +				    "%s%s %s %s: %pV",
> +				    prefix,
>  				    dev_driver_string(dev->dev.parent),
>  				    dev_name(dev->dev.parent),
>  				    netdev_name(dev), vaf);
> @@ -6455,7 +6456,7 @@ int netdev_printk(const char *level, const struct net_device *dev,
>  	vaf.fmt = format;
>  	vaf.va = &args;
>  
> -	r = __netdev_printk(level, dev, &vaf);
> +	r = __netdev_printk(level, dev, "", &vaf);
>  
>  	va_end(args);
>  
> @@ -6475,7 +6476,7 @@ int func(const struct net_device *dev, const char *fmt, ...)	\
>  	vaf.fmt = fmt;						\
>  	vaf.va = &args;						\
>  								\
> -	r = __netdev_printk(level, dev, &vaf);			\
> +	r = __netdev_printk(level, dev, "", &vaf);		\
>  								\
>  	va_end(args);						\
>  								\

'Morning Jason.

Funny.  Crossed emails.

I still don't think this is better.

This does add an effectively unused "" to non-dynamic debug builds.
ie: the more common paths are encumbered as dynamic_debug isn't
a normally enabled distribution CONFIG_ option.

About the patch:

Wouldn't dev_printk_emit now would have a single caller and
could be made static?

Don't __dev_printk and __netdev_printk need EXPORT_SYMBOLs?

cheers, Joe

^ permalink raw reply

* Re: [PATCH 1/2] dst: take into account policy update on check()
From: Nicolas Dichtel @ 2012-09-07 15:13 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: vyasevich, davem, sri, linux-sctp, netdev
In-Reply-To: <1347030598.2484.777.camel@edumazet-glaptop>

Le 07/09/2012 17:09, Eric Dumazet a écrit :
> On Fri, 2012-09-07 at 16:47 +0200, Nicolas Dichtel wrote:
>> Le 07/09/2012 16:35, Eric Dumazet a écrit :
>>>
>>> Hmm... cant we reuse rt_genid ?
>>>
>>> (When changing flow_cache_genid, change &net->ipv4.rt_genid)
>>
>> And so adding a new field in net->ipv6?
>
> or move net->ipv4.rt_genid to net->rt_genid
>
> Having separate field for IPv4/IPv6 is of little interest IMHO
>
Ok, I will wait feedback from other people and repost a patch after.

^ permalink raw reply

* Re: [PATCH 1/2] dst: take into account policy update on check()
From: Eric Dumazet @ 2012-09-07 15:21 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: vyasevich, davem, sri, linux-sctp, netdev
In-Reply-To: <504A0F1F.5060504@6wind.com>

On Fri, 2012-09-07 at 17:13 +0200, Nicolas Dichtel wrote:
> Le 07/09/2012 17:09, Eric Dumazet a écrit :
> > On Fri, 2012-09-07 at 16:47 +0200, Nicolas Dichtel wrote:
> >> Le 07/09/2012 16:35, Eric Dumazet a écrit :
> >>>
> >>> Hmm... cant we reuse rt_genid ?
> >>>
> >>> (When changing flow_cache_genid, change &net->ipv4.rt_genid)
> >>
> >> And so adding a new field in net->ipv6?
> >
> > or move net->ipv4.rt_genid to net->rt_genid
> >
> > Having separate field for IPv4/IPv6 is of little interest IMHO
> >
> Ok, I will wait feedback from other people and repost a patch after.

By the way, the get_random_bytes() calls in rt_cache_invalidate() and in
rt_genid_init() are no longer needed, since we dont use jhash anymore
(no more route cache)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index dc9549b..d6b2b1c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -448,26 +448,12 @@ static inline bool rt_is_expired(const struct rtable *rth)
 }
 
 /*
- * Perturbation of rt_genid by a small quantity [1..256]
- * Using 8 bits of shuffling ensure we can call rt_cache_invalidate()
- * many times (2^24) without giving recent rt_genid.
- * Jenkins hash is strong enough that litle changes of rt_genid are OK.
- */
-static void rt_cache_invalidate(struct net *net)
-{
-	unsigned char shuffle;
-
-	get_random_bytes(&shuffle, sizeof(shuffle));
-	atomic_add(shuffle + 1U, &net->ipv4.rt_genid);
-}
-
-/*
  * delay < 0  : invalidate cache (fast : entries will be deleted later)
  * delay >= 0 : invalidate & flush cache (can be long)
  */
 void rt_cache_flush(struct net *net, int delay)
 {
-	rt_cache_invalidate(net);
+	atomic_inc(&net->ipv4.rt_genid);
 }
 
 static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst,
@@ -2533,8 +2519,7 @@ static __net_initdata struct pernet_operations sysctl_route_ops = {
 
 static __net_init int rt_genid_init(struct net *net)
 {
-	get_random_bytes(&net->ipv4.rt_genid,
-			 sizeof(net->ipv4.rt_genid));
+	atomic_set(&net->ipv4.rt_genid, 0);
 	get_random_bytes(&net->ipv4.dev_addr_genid,
 			 sizeof(net->ipv4.dev_addr_genid));
 	return 0;

^ permalink raw reply related

* RE: changing usbnet's API to better deal with cdc-ncm
From: Alexey ORISHKO @ 2012-09-07 15:23 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Bjørn Mork, Ming Lei, netdev@vger.kernel.org,
	linux-usb@vger.kernel.org
In-Reply-To: <1800340.RWjbMaZGSN@linux-lqwf.site>

> -----Original Message-----
> From: Oliver Neukum [mailto:oneukum@suse.de]
> Sent: Friday, September 07, 2012 3:09 PM

> >
> > Until we do something with network device framework in order to get
> > access to upper layer Tx queue we need to utilize timer.
> 
> Could you explain your reasoning? From what you say we must reduce the
> number of transfers, thus use them efficiently, but why by means of a
> timer?
> 

What was omitted in the previous mail is the fact that in addition to
reducing amount of transfers we need to fill in NTB to the maximum size.
It's quite important especially for embedded systems.

As an example, on device (modem) side, DMA job for max NTB is initially
set. 
- If device receives full NTB, only one interrupt (per NTB) is
generated at the completion of DMA job and NCM function can immediately
parse incoming NTB frame. 
- In case of "skinny" (not full) NTB, device gets INT for the short
packet, then original DMA job for full NTB shall be cancelled, then DMA
job to get short packet shall be set and after that we get INT for its
completion. Only at this point all data is received and NTB parsing
can be done by NCM function. All above takes quite more time than first
case.

There is a temptation to send full NTBs even with a single IP packet,
But it will lead to wasted USB bandwidth and reduced ability to send
real data for other functions in the device or other devices on the
same root hub. Most important it will also harm IN direction.

The challenge is to ensure that an acceptable timeout value is used. Too
long and latency is introduced. Too short and too many padded NTBs will
go out and that reduces the available throughput. The ideal timer value
depends on the throughput available in the network. Something that is not
really explicitly known to the NCM layer nor to the layer above.

Alternate methods exist to achieve the same result without using a timer.
But an optimal implementation requires that the amount of IP packets "in
progress" or queued up is known to NCM so NCM can decide to send short or
padded NTB or aggregate and send one or more full NTBs plus short or
padded NTB. 

An implementation where NCM only knows if there is more data available or
not can be shown to have side-effects that are not easily circumvented.
And likewise shown to limit throughput compared to a timer-based solution.   

Regards,
Alexey

^ permalink raw reply

* [PATCH 1/10] drivers/net/wireless/ath/ath9k/ar9003_mac.c: removes unnecessary semicolon
From: Peter Senna Tschudin @ 2012-09-07 15:24 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: kernel-janitors, Julia.Lawall, Jouni Malinen,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	John W. Linville, linux-wireless, ath9k-devel, netdev,
	linux-kernel

From: Peter Senna Tschudin <peter.senna@gmail.com>

removes unnecessary semicolon

Found by Coccinelle: http://coccinelle.lip6.fr/

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>

---
 drivers/net/wireless/ath/ath9k/ar9003_mac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -531,7 +531,7 @@ int ath9k_hw_process_rxdesc_edma(struct
 				rxs->rs_status |= ATH9K_RXERR_PHY;
 				rxs->rs_phyerr = phyerr;
 			}
-		};
+		}
 	}
 
 	if (rxsp->status11 & AR_KeyMiss)

^ permalink raw reply

* Re: [PATCH net-next v2] ipv4/route: arg delay is useless in rt_cache_flush()
From: Eric Dumazet @ 2012-09-07 15:24 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: davem, netdev
In-Reply-To: <1347014729-28461-1-git-send-email-nicolas.dichtel@6wind.com>

On Fri, 2012-09-07 at 12:45 +0200, Nicolas Dichtel wrote:
> Since route cache deletion (89aef8921bfbac22f), delay is no
> more used. Remove it.
> 
> v2: remove ctl in ipv4_sysctl_rtcache_flush()
> 

Ideally, this v2:....: should be after the --- marker

> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
>  include/net/route.h     |  2 +-
>  net/ipv4/arp.c          |  2 +-
>  net/ipv4/devinet.c      |  6 +++---
>  net/ipv4/fib_frontend.c | 20 ++++++++++----------
>  net/ipv4/fib_rules.c    |  2 +-
>  net/ipv4/fib_trie.c     |  6 +++---
>  net/ipv4/route.c        | 19 +++----------------
>  7 files changed, 22 insertions(+), 35 deletions(-)

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* Re: [PATCH 0/5] dev_<level> and dynamic_debug cleanups
From: Jason Baron @ 2012-09-07 15:35 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrew Morton, netdev, Greg Kroah-Hartman, David S. Miller,
	Jim Cromie, Kay Sievers, linux-kernel
In-Reply-To: <1347030721.13424.22.camel@joe2Laptop>

On Fri, Sep 07, 2012 at 08:12:01AM -0700, Joe Perches wrote:
> On Fri, 2012-09-07 at 10:52 -0400, Jason Baron wrote:
> > On Thu, Sep 06, 2012 at 11:43:46AM -0700, Joe Perches wrote:
> > > On Thu, 2012-09-06 at 13:51 -0400, Jason Baron wrote:
> > > > On Sun, Aug 26, 2012 at 04:25:25AM -0700, Joe Perches wrote:
> > > > > The recent commit to fix dynamic_debug was a bit unclean.
> > > > > Neaten the style for dynamic_debug.
> > > > > Reduce the stack use of message logging that uses netdev_printk
> > > > > Add utility functions dev_printk_emit and dev_vprintk_emit for /dev/kmsg.
> > > > > 
> > > > > Joe Perches (5):
> > > > >   dev_dbg/dynamic_debug: Update to use printk_emit, optimize stack
> > > > >   netdev_printk/dynamic_netdev_dbg: Directly call printk_emit
> > > > >   netdev_printk/netif_printk: Remove a superfluous logging colon
> > > > >   dev: Add dev_vprintk_emit and dev_printk_emit
> > > > >   device and dynamic_debug: Use dev_vprintk_emit and dev_printk_emit
> > > > > 
> > > > 
> > > > Looks Good.
> > > > 
> > > > The one thing that is bothering me though, is that for
> > > > __dynamic_dev_dbg(), __dynamic_netdev_dbg(), we are copying much of the core
> > > > logic of __dev_printk(), __netdev_printk(), respectively. I would prefer
> > > > have this in one place. Can we add a 'prefix' argument to __dev_printk(),
> > > > and __netdev_printk() that dynamic debug can use, but is simply empty
> > > > for dev_printk() and netdev_printk().
> > > 
> > > I don't think that's an improvement actually.
> > > Why don't you try it.
> > > 
> > 
> > Ok, below is what I was thinking. It winds up being more deletions than
> > insertions.
> > 
> > Thanks,
> > 
> > -Jason
> > 
> > dynamic debug: remove duplicate __netdev_printk() and  __dev_printk() logic 
> > 
> > Add an option prefix string argument to __netdev_printk() and __dev_printk().
> > In this way dynamic debug does not have to contain duplicate logic.
> > 
> > Signed-off-by: Jason Baron <jbaron@redhat.com>
> > ---
> >  drivers/base/core.c       |   13 +++++++------
> >  include/linux/device.h    |    3 +++
> >  include/linux/netdevice.h |    3 +++
> >  lib/dynamic_debug.c       |   32 ++++++++------------------------
> >  net/core/dev.c            |   11 ++++++-----
> >  5 files changed, 27 insertions(+), 35 deletions(-)
> > 
> > diff --git a/drivers/base/core.c b/drivers/base/core.c
> > index 65f82e3..7b4ee6d 100644
> > --- a/drivers/base/core.c
> > +++ b/drivers/base/core.c
> > @@ -1937,15 +1937,16 @@ int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
> >  }
> >  EXPORT_SYMBOL(dev_printk_emit);
> >  
> > -static int __dev_printk(const char *level, const struct device *dev,
> > -			struct va_format *vaf)
> > +int __dev_printk(const char *level, const struct device *dev,
> > +		 char *prefix, struct va_format *vaf)
> >  {
> >  	if (!dev)
> >  		return printk("%s(NULL device *): %pV", level, vaf);
> >  
> >  	return dev_printk_emit(level[1] - '0', dev,
> > -			       "%s %s: %pV",
> > -			       dev_driver_string(dev), dev_name(dev), vaf);
> > +			       "%s%s %s: %pV",
> > +			       prefix, dev_driver_string(dev),
> > +			       dev_name(dev), vaf);
> >  }
> >  
> >  int dev_printk(const char *level, const struct device *dev,
> > @@ -1960,7 +1961,7 @@ int dev_printk(const char *level, const struct device *dev,
> >  	vaf.fmt = fmt;
> >  	vaf.va = &args;
> >  
> > -	r = __dev_printk(level, dev, &vaf);
> > +	r = __dev_printk(level, dev, "", &vaf);
> >  
> >  	va_end(args);
> >  
> > @@ -1980,7 +1981,7 @@ int func(const struct device *dev, const char *fmt, ...)	\
> >  	vaf.fmt = fmt;						\
> >  	vaf.va = &args;						\
> >  								\
> > -	r = __dev_printk(kern_level, dev, &vaf);		\
> > +	r = __dev_printk(kern_level, dev, "", &vaf);		\
> >  								\
> >  	va_end(args);						\
> >  								\
> > diff --git a/include/linux/device.h b/include/linux/device.h
> > index 2da4589..573b15e 100644
> > --- a/include/linux/device.h
> > +++ b/include/linux/device.h
> > @@ -891,6 +891,9 @@ extern const char *dev_driver_string(const struct device *dev);
> >  
> >  #ifdef CONFIG_PRINTK
> >  
> > +extern int __dev_printk(const char *level, const struct device *dev,
> > +			char *prefix, struct va_format *vaf);
> > +
> >  extern int dev_vprintk_emit(int level, const struct device *dev,
> >  			    const char *fmt, va_list args);
> >  extern __printf(3, 4)
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index 5f49cc0..63f6165 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -2720,6 +2720,9 @@ static inline const char *netdev_name(const struct net_device *dev)
> >  	return dev->name;
> >  }
> >  
> > +extern int __netdev_printk(const char *level, const struct net_device *dev,
> > +			   char *prefix, struct va_format *vaf);
> > +
> >  extern __printf(3, 4)
> >  int netdev_printk(const char *level, const struct net_device *dev,
> >  		  const char *format, ...);
> > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> > index e7f7d99..83bf601 100644
> > --- a/lib/dynamic_debug.c
> > +++ b/lib/dynamic_debug.c
> > @@ -578,6 +578,7 @@ int __dynamic_dev_dbg(struct _ddebug *descriptor,
> >  	struct va_format vaf;
> >  	va_list args;
> >  	int res;
> > +	char buf[PREFIX_SIZE];
> >  
> >  	BUG_ON(!descriptor);
> >  	BUG_ON(!fmt);
> > @@ -587,16 +588,9 @@ int __dynamic_dev_dbg(struct _ddebug *descriptor,
> >  	vaf.fmt = fmt;
> >  	vaf.va = &args;
> >  
> > -	if (!dev) {
> > -		res = printk(KERN_DEBUG "(NULL device *): %pV", &vaf);
> > -	} else {
> > -		char buf[PREFIX_SIZE];
> > -
> > -		res = dev_printk_emit(7, dev, "%s%s %s: %pV",
> > -				      dynamic_emit_prefix(descriptor, buf),
> > -				      dev_driver_string(dev), dev_name(dev),
> > -				      &vaf);
> > -	}
> > +	res = __dev_printk(KERN_DEBUG, dev,
> > +			   dynamic_emit_prefix(descriptor, buf),
> > +			   &vaf);
> >  
> >  	va_end(args);
> >  
> > @@ -612,6 +606,7 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
> >  	struct va_format vaf;
> >  	va_list args;
> >  	int res;
> > +	char buf[PREFIX_SIZE];
> >  
> >  	BUG_ON(!descriptor);
> >  	BUG_ON(!fmt);
> > @@ -621,20 +616,9 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
> >  	vaf.fmt = fmt;
> >  	vaf.va = &args;
> >  
> > -	if (dev && dev->dev.parent) {
> > -		char buf[PREFIX_SIZE];
> > -
> > -		res = dev_printk_emit(7, dev->dev.parent,
> > -				      "%s%s %s %s: %pV",
> > -				      dynamic_emit_prefix(descriptor, buf),
> > -				      dev_driver_string(dev->dev.parent),
> > -				      dev_name(dev->dev.parent),
> > -				      netdev_name(dev), &vaf);
> > -	} else if (dev) {
> > -		res = printk(KERN_DEBUG "%s: %pV", netdev_name(dev), &vaf);
> > -	} else {
> > -		res = printk(KERN_DEBUG "(NULL net_device): %pV", &vaf);
> > -	}
> > +	res = __netdev_printk(KERN_DEBUG, dev,
> > +			      dynamic_emit_prefix(descriptor, buf),
> > +			      &vaf);
> >  
> >  	va_end(args);
> >  
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 8ad42fd..5fef0f6 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -6422,15 +6422,16 @@ const char *netdev_drivername(const struct net_device *dev)
> >  	return empty;
> >  }
> >  
> > -static int __netdev_printk(const char *level, const struct net_device *dev,
> > -			   struct va_format *vaf)
> > +int __netdev_printk(const char *level, const struct net_device *dev,
> > +		    char *prefix, struct va_format *vaf)
> >  {
> >  	int r;
> >  
> >  	if (dev && dev->dev.parent) {
> >  		r = dev_printk_emit(level[1] - '0',
> >  				    dev->dev.parent,
> > -				    "%s %s %s: %pV",
> > +				    "%s%s %s %s: %pV",
> > +				    prefix,
> >  				    dev_driver_string(dev->dev.parent),
> >  				    dev_name(dev->dev.parent),
> >  				    netdev_name(dev), vaf);
> > @@ -6455,7 +6456,7 @@ int netdev_printk(const char *level, const struct net_device *dev,
> >  	vaf.fmt = format;
> >  	vaf.va = &args;
> >  
> > -	r = __netdev_printk(level, dev, &vaf);
> > +	r = __netdev_printk(level, dev, "", &vaf);
> >  
> >  	va_end(args);
> >  
> > @@ -6475,7 +6476,7 @@ int func(const struct net_device *dev, const char *fmt, ...)	\
> >  	vaf.fmt = fmt;						\
> >  	vaf.va = &args;						\
> >  								\
> > -	r = __netdev_printk(level, dev, &vaf);			\
> > +	r = __netdev_printk(level, dev, "", &vaf);		\
> >  								\
> >  	va_end(args);						\
> >  								\
> 
> 'Morning Jason.
> 
> Funny.  Crossed emails.
> 
> I still don't think this is better.
> 
> This does add an effectively unused "" to non-dynamic debug builds.
> ie: the more common paths are encumbered as dynamic_debug isn't
> a normally enabled distribution CONFIG_ option.

Yeah, not sure - I know Fedora enables it.

> 
> About the patch:
> 
> Wouldn't dev_printk_emit now would have a single caller and
> could be made static?
> 

Yes, I believe so.

> Don't __dev_printk and __netdev_printk need EXPORT_SYMBOLs?
> 

The usage in lib/dynamic_debug.c can't be built as a module. So not required.

If nobody else thinks this patch is better, let's at least add a comment in
__dev_printk() and __netdev_printk() to fix dynamic debug, if these are changed.

Thanks,

-Jason

^ permalink raw reply

* Re: [PATCH] iproute2: Fix various manpage formatting nits
From: Stephen Hemminger @ 2012-09-07 16:05 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: netdev
In-Reply-To: <m2txvbjo0p.fsf@igel.home>

On Thu, 06 Sep 2012 15:09:58 +0200
Andreas Schwab <schwab@linux-m68k.org> wrote:

> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v3 2/3] iproute2: add support for tcp_metrics
From: Stephen Hemminger @ 2012-09-07 16:09 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: David Miller, netdev
In-Reply-To: <1346792597-2427-3-git-send-email-ja@ssi.bg>

Could you resubmit this as two pieces. I can take the libgenl stuff
now (and the l2tp code). The tcp metrics support in iproute2 should be
resent after the kernel support for that makes it to Linus's tree. (ie 3.7 merge window).

^ permalink raw reply

* Re: [PATCH 2/2] iproute: Add route showdump command (v2)
From: Stephen Hemminger @ 2012-09-07 16:14 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: Stephen Hemminger, Linux Netdev List
In-Reply-To: <50121FB0.6060200@parallels.com>

On Fri, 27 Jul 2012 08:57:20 +0400
Pavel Emelyanov <xemul@parallels.com> wrote:

> Some time ago the save+restore commands were added to ip route (git
> id f4ff11e3, Add ip route save/restore). These two save the raw rtnl
> stream into a file and restore one (reading it from stdin).
> 
> The problem is that there's no way to get the contents of the dump
> file in a human readable form. The proposal is to add a command that
> reads the rtnl stream from stdin and prints the data in a way the 
> usual "ip route list" does?
> 
> changes since v1:
> 
> * Take the magic at the beginning of the dump file into account
> * Check for stdin (the dump is taken from) is not a tty
> 
> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>

Applied this and the magic number change.

^ permalink raw reply

* Re: [PATCH 04/10] net/macb: Fix a race in macb_start_xmit()
From: Nicolas Ferre @ 2012-09-07 16:34 UTC (permalink / raw)
  To: Havard Skinnemoen, David Miller, netdev
  Cc: linux-arm-kernel, plagnioj, jamie, linux-kernel, patrice.vilchez
In-Reply-To: <CACiLriTSddM-5pnpii9c+4dA++OrsKovGLabegdwSRLchuSnAA@mail.gmail.com>

On 09/06/2012 05:49 PM, Havard Skinnemoen :
> On Wed, Sep 5, 2012 at 11:30 PM, David Miller <davem@davemloft.net> wrote:
>> From: Nicolas Ferre <nicolas.ferre@atmel.com>
>> Date: Wed, 5 Sep 2012 10:19:11 +0200
>>
>>> From: Havard Skinnemoen <havard@skinnemoen.net>
>>>
>>> Fix a race in macb_start_xmit() where we unconditionally set the TSTART bit.
>>> If an underrun just happened (we do this with interrupts disabled, so it might
>>> not have been handled yet), the controller starts transmitting from the first
>>> entry in the ring, which is usually wrong.
>>> Restart the controller after error handling.
>>>
>>> Signed-off-by: Havard Skinnemoen <havard@skinnemoen.net>
>>> [nicolas.ferre@atmel.com: split patch in topics]
>>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>>
>> Accumulating special case code and checks into the hot path of TX packet
>> processing is extremely unwise.
>>
>> Instead, when you handle the TX error conditions and reset the chip you
>> should first ensure that there are no flows of control in the transmit
>> function of your driver by using the appropriate locking et al. facilities.
> 
> IIRC, the hardware resets the ring pointers when an error happens, and
> if we set TSTART right after that happens, the hardware will happily
> transmit whatever is sitting in the beginning of the ring. This is
> what I was trying to avoid.
> 
> The details are a bit hazy as it's been a while since I looked at
> this, so it could be that simply letting it happen and using a bigger
> hammer during reset processing might work just as well. Just want to
> make sure y'all understand that we're talking about a race against
> hardware, not against interrupt handlers, threads or anything that can
> be solved by locking :)

Yes, you are right Havard.

I will see if we can let the transmitter go just before being
interrupted by the pending error.

It is true that there are several cases here:
- tx immediately stopped again by the USED bit of a non initialized
descriptor. We thus have to cleanup the error frame but also take care
about the newly queued packet...
- beginning of transmission of a not-related fragment that has just been
queued by the start_xmit; just before catching the pending error IRQ. We
may have to consider the consequences of this!

So, stay tuned ;-)

Best regards,
-- 
Nicolas Ferre

^ permalink raw reply

* [PATCH 2/4] netdev: make pci_error_handlers const
From: Stephen Hemminger @ 2012-09-07 16:33 UTC (permalink / raw)
  To: Linas Vepstas, Bjorn Helgaas, David Miller
  Cc: linux-pci, linux-kernel, netdev
In-Reply-To: <20120907163313.614852012@vyatta.com>

[-- Attachment #1: pci-errhandle-netdev.patch --]
[-- Type: text/plain, Size: 13205 bytes --]

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
Depends on first patch that changes PCI core.

 drivers/net/ethernet/atheros/atl1c/atl1c_main.c      |    2 +-
 drivers/net/ethernet/atheros/atl1e/atl1e_main.c      |    2 +-
 drivers/net/ethernet/broadcom/bnx2.c                 |    2 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c     |    2 +-
 drivers/net/ethernet/broadcom/tg3.c                  |    2 +-
 drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c      |    2 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c      |    2 +-
 drivers/net/ethernet/emulex/benet/be_main.c          |    2 +-
 drivers/net/ethernet/intel/e100.c                    |    2 +-
 drivers/net/ethernet/intel/e1000/e1000_main.c        |    2 +-
 drivers/net/ethernet/intel/e1000e/netdev.c           |    2 +-
 drivers/net/ethernet/intel/igb/igb_main.c            |    2 +-
 drivers/net/ethernet/intel/igbvf/netdev.c            |    2 +-
 drivers/net/ethernet/intel/ixgb/ixgb_main.c          |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c        |    2 +-
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c    |    2 +-
 drivers/net/ethernet/mellanox/mlx4/main.c            |    2 +-
 drivers/net/ethernet/neterion/s2io.c                 |    2 +-
 drivers/net/ethernet/neterion/vxge/vxge-main.c       |    2 +-
 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c |    2 +-
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c |    2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c     |    2 +-
 drivers/net/ethernet/qlogic/qlge/qlge_main.c         |    2 +-
 23 files changed, 23 insertions(+), 23 deletions(-)

--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c	2012-09-07 09:27:24.503069260 -0700
@@ -2685,7 +2685,7 @@ static void atl1c_io_resume(struct pci_d
 	netif_device_attach(netdev);
 }
 
-static struct pci_error_handlers atl1c_err_handler = {
+static const struct pci_error_handlers atl1c_err_handler = {
 	.error_detected = atl1c_io_error_detected,
 	.slot_reset = atl1c_io_slot_reset,
 	.resume = atl1c_io_resume,
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c	2012-09-07 09:27:24.503069260 -0700
@@ -2489,7 +2489,7 @@ static void atl1e_io_resume(struct pci_d
 	netif_device_attach(netdev);
 }
 
-static struct pci_error_handlers atl1e_err_handler = {
+static const struct pci_error_handlers atl1e_err_handler = {
 	.error_detected = atl1e_io_error_detected,
 	.slot_reset = atl1e_io_slot_reset,
 	.resume = atl1e_io_resume,
--- a/drivers/net/ethernet/broadcom/bnx2.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/broadcom/bnx2.c	2012-09-07 09:27:24.507069220 -0700
@@ -8742,7 +8742,7 @@ static void bnx2_io_resume(struct pci_de
 	rtnl_unlock();
 }
 
-static struct pci_error_handlers bnx2_err_handler = {
+static const struct pci_error_handlers bnx2_err_handler = {
 	.error_detected	= bnx2_io_error_detected,
 	.slot_reset	= bnx2_io_slot_reset,
 	.resume		= bnx2_io_resume,
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c	2012-09-07 09:27:24.511069180 -0700
@@ -12171,7 +12171,7 @@ static void bnx2x_io_resume(struct pci_d
 	rtnl_unlock();
 }
 
-static struct pci_error_handlers bnx2x_err_handler = {
+static const struct pci_error_handlers bnx2x_err_handler = {
 	.error_detected = bnx2x_io_error_detected,
 	.slot_reset     = bnx2x_io_slot_reset,
 	.resume         = bnx2x_io_resume,
--- a/drivers/net/ethernet/broadcom/tg3.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/broadcom/tg3.c	2012-09-07 09:27:24.511069180 -0700
@@ -16397,7 +16397,7 @@ done:
 	rtnl_unlock();
 }
 
-static struct pci_error_handlers tg3_err_handler = {
+static const struct pci_error_handlers tg3_err_handler = {
 	.error_detected	= tg3_io_error_detected,
 	.slot_reset	= tg3_io_slot_reset,
 	.resume		= tg3_io_resume
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c	2012-09-07 09:27:24.515069139 -0700
@@ -3036,7 +3036,7 @@ static void t3_io_resume(struct pci_dev
 	t3_resume_ports(adapter);
 }
 
-static struct pci_error_handlers t3_err_handler = {
+static const struct pci_error_handlers t3_err_handler = {
 	.error_detected = t3_io_error_detected,
 	.slot_reset = t3_io_slot_reset,
 	.resume = t3_io_resume,
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c	2012-09-07 09:27:24.515069139 -0700
@@ -3453,7 +3453,7 @@ static void eeh_resume(struct pci_dev *p
 	rtnl_unlock();
 }
 
-static struct pci_error_handlers cxgb4_eeh = {
+static const struct pci_error_handlers cxgb4_eeh = {
 	.error_detected = eeh_err_detected,
 	.slot_reset     = eeh_slot_reset,
 	.resume         = eeh_resume,
--- a/drivers/net/ethernet/emulex/benet/be_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/emulex/benet/be_main.c	2012-09-07 09:27:24.515069139 -0700
@@ -4104,7 +4104,7 @@ err:
 	dev_err(&adapter->pdev->dev, "EEH resume failed\n");
 }
 
-static struct pci_error_handlers be_eeh_handlers = {
+static const struct pci_error_handlers be_eeh_handlers = {
 	.error_detected = be_eeh_err_detected,
 	.slot_reset = be_eeh_reset,
 	.resume = be_eeh_resume,
--- a/drivers/net/ethernet/intel/e100.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/intel/e100.c	2012-09-07 09:27:24.515069139 -0700
@@ -3157,7 +3157,7 @@ static void e100_io_resume(struct pci_de
 	}
 }
 
-static struct pci_error_handlers e100_err_handler = {
+static const struct pci_error_handlers e100_err_handler = {
 	.error_detected = e100_io_error_detected,
 	.slot_reset = e100_io_slot_reset,
 	.resume = e100_io_resume,
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c	2012-09-07 09:27:24.515069139 -0700
@@ -192,7 +192,7 @@ static pci_ers_result_t e1000_io_error_d
 static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev);
 static void e1000_io_resume(struct pci_dev *pdev);
 
-static struct pci_error_handlers e1000_err_handler = {
+static const struct pci_error_handlers e1000_err_handler = {
 	.error_detected = e1000_io_error_detected,
 	.slot_reset = e1000_io_slot_reset,
 	.resume = e1000_io_resume,
--- a/drivers/net/ethernet/intel/e1000e/netdev.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c	2012-09-07 09:27:24.519069099 -0700
@@ -6472,7 +6472,7 @@ static void __devexit e1000_remove(struc
 }
 
 /* PCI Error Recovery (ERS) */
-static struct pci_error_handlers e1000_err_handler = {
+static const struct pci_error_handlers e1000_err_handler = {
 	.error_detected = e1000_io_error_detected,
 	.slot_reset = e1000_io_slot_reset,
 	.resume = e1000_io_resume,
--- a/drivers/net/ethernet/intel/igb/igb_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/intel/igb/igb_main.c	2012-09-07 09:27:24.519069099 -0700
@@ -217,7 +217,7 @@ static pci_ers_result_t igb_io_error_det
 static pci_ers_result_t igb_io_slot_reset(struct pci_dev *);
 static void igb_io_resume(struct pci_dev *);
 
-static struct pci_error_handlers igb_err_handler = {
+static const struct pci_error_handlers igb_err_handler = {
 	.error_detected = igb_io_error_detected,
 	.slot_reset = igb_io_slot_reset,
 	.resume = igb_io_resume,
--- a/drivers/net/ethernet/intel/igbvf/netdev.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c	2012-09-07 09:27:24.519069099 -0700
@@ -2833,7 +2833,7 @@ static void __devexit igbvf_remove(struc
 }
 
 /* PCI Error Recovery (ERS) */
-static struct pci_error_handlers igbvf_err_handler = {
+static const struct pci_error_handlers igbvf_err_handler = {
 	.error_detected = igbvf_io_error_detected,
 	.slot_reset = igbvf_io_slot_reset,
 	.resume = igbvf_io_resume,
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c	2012-09-07 09:27:24.519069099 -0700
@@ -115,7 +115,7 @@ static pci_ers_result_t ixgb_io_error_de
 static pci_ers_result_t ixgb_io_slot_reset (struct pci_dev *pdev);
 static void ixgb_io_resume (struct pci_dev *pdev);
 
-static struct pci_error_handlers ixgb_err_handler = {
+static const struct pci_error_handlers ixgb_err_handler = {
 	.error_detected = ixgb_io_error_detected,
 	.slot_reset = ixgb_io_slot_reset,
 	.resume = ixgb_io_resume,
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c	2012-09-07 09:27:24.519069099 -0700
@@ -7677,7 +7677,7 @@ static void ixgbe_io_resume(struct pci_d
 	netif_device_attach(netdev);
 }
 
-static struct pci_error_handlers ixgbe_err_handler = {
+static const struct pci_error_handlers ixgbe_err_handler = {
 	.error_detected = ixgbe_io_error_detected,
 	.slot_reset = ixgbe_io_slot_reset,
 	.resume = ixgbe_io_resume,
--- a/drivers/net/ethernet/neterion/s2io.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/neterion/s2io.c	2012-09-07 09:27:24.519069099 -0700
@@ -484,7 +484,7 @@ static DEFINE_PCI_DEVICE_TABLE(s2io_tbl)
 
 MODULE_DEVICE_TABLE(pci, s2io_tbl);
 
-static struct pci_error_handlers s2io_err_handler = {
+static const struct pci_error_handlers s2io_err_handler = {
 	.error_detected = s2io_io_error_detected,
 	.slot_reset = s2io_io_slot_reset,
 	.resume = s2io_io_resume,
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c	2012-09-07 09:27:24.519069099 -0700
@@ -4799,7 +4799,7 @@ static void __devexit vxge_remove(struct
 			     __LINE__);
 }
 
-static struct pci_error_handlers vxge_err_handler = {
+static const struct pci_error_handlers vxge_err_handler = {
 	.error_detected = vxge_io_error_detected,
 	.slot_reset = vxge_io_slot_reset,
 	.resume = vxge_io_resume,
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c	2012-09-07 09:27:24.519069099 -0700
@@ -2795,7 +2795,7 @@ static const struct dev_pm_ops pch_gbe_p
 };
 #endif
 
-static struct pci_error_handlers pch_gbe_err_handler = {
+static const struct pci_error_handlers pch_gbe_err_handler = {
 	.error_detected = pch_gbe_io_error_detected,
 	.slot_reset = pch_gbe_io_slot_reset,
 	.resume = pch_gbe_io_resume
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c	2012-09-07 09:27:24.523069059 -0700
@@ -3336,7 +3336,7 @@ netxen_free_vlan_ip_list(struct netxen_a
 { }
 #endif
 
-static struct pci_error_handlers netxen_err_handler = {
+static const struct pci_error_handlers netxen_err_handler = {
 	.error_detected = netxen_io_error_detected,
 	.slot_reset = netxen_io_slot_reset,
 	.resume = netxen_io_resume,
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c	2012-09-07 09:27:24.523069059 -0700
@@ -4522,7 +4522,7 @@ static void
 qlcnic_restore_indev_addr(struct net_device *dev, unsigned long event)
 { }
 #endif
-static struct pci_error_handlers qlcnic_err_handler = {
+static const struct pci_error_handlers qlcnic_err_handler = {
 	.error_detected = qlcnic_io_error_detected,
 	.slot_reset = qlcnic_io_slot_reset,
 	.resume = qlcnic_io_resume,
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c	2012-09-07 09:27:24.523069059 -0700
@@ -4847,7 +4847,7 @@ static void qlge_io_resume(struct pci_de
 	netif_device_attach(ndev);
 }
 
-static struct pci_error_handlers qlge_err_handler = {
+static const struct pci_error_handlers qlge_err_handler = {
 	.error_detected = qlge_io_error_detected,
 	.slot_reset = qlge_io_slot_reset,
 	.resume = qlge_io_resume,
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c	2012-09-07 09:27:24.523069059 -0700
@@ -3256,7 +3256,7 @@ static void ixgbevf_io_resume(struct pci
 }
 
 /* PCI Error Recovery (ERS) */
-static struct pci_error_handlers ixgbevf_err_handler = {
+static const struct pci_error_handlers ixgbevf_err_handler = {
 	.error_detected = ixgbevf_io_error_detected,
 	.slot_reset = ixgbevf_io_slot_reset,
 	.resume = ixgbevf_io_resume,
--- a/drivers/net/ethernet/mellanox/mlx4/main.c	2012-09-07 09:21:37.154557681 -0700
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c	2012-09-07 09:27:24.523069059 -0700
@@ -2301,7 +2301,7 @@ static pci_ers_result_t mlx4_pci_slot_re
 	return ret ? PCI_ERS_RESULT_DISCONNECT : PCI_ERS_RESULT_RECOVERED;
 }
 
-static struct pci_error_handlers mlx4_err_handler = {
+static const struct pci_error_handlers mlx4_err_handler = {
 	.error_detected = mlx4_pci_err_detected,
 	.slot_reset     = mlx4_pci_slot_reset,
 };

^ permalink raw reply

* Re: [PATCH] NFC: remove pointless conditional before kfree_skb()
From: Samuel Ortiz @ 2012-09-07 16:48 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: lauro.venancio-430g2QfJUUCGglJvpFV4uA,
	aloisio.almeida-430g2QfJUUCGglJvpFV4uA,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <CAPgLHd80nD+uYpMMC+sLjcErRcLbGpAVMw7PktrAoxJB8NwHsg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Wei,

On Tue, Aug 28, 2012 at 09:02:40PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> 
> Remove pointless conditional before kfree_skb().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> ---
>  net/nfc/hci/shdlc.c | 3 +--
>  net/nfc/hci/core.c  | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)
Thanks, patch applied to my nfc-next branch.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] net: Small bug on rxhash calculation
From: David Miller @ 2012-09-07 16:57 UTC (permalink / raw)
  To: chema; +Cc: netdev, edumazet, chema
In-Reply-To: <CAEb0MffEfboq_VmPFCtzGHe-SQ4Dd1O6Hptrc_jHVnp7itKyQg@mail.gmail.com>

From: Chema Gonzalez <chema@berkeley.edu>
Date: Wed, 5 Sep 2012 23:35:40 -0700

> -       if (keys.ports) {
> -               if ((__force u16)keys.port16[1] < (__force u16)keys.port16[0])
> -                       swap(keys.port16[0], keys.port16[1]);
> +       if (keys.ports)

This patch was corrupted by your email client, it transformed TAB characters
into spaces, making your patch completely useless to us.

Please fix this, send a test patch to yourself, and make sure that the patch
you receive in that test email will apply cleanly and properly.

Only after you are able to get such an email test patch to work should
you submit it here again.

Thanks.

^ permalink raw reply

* Re: [PATCH net 0/5] net/mlx4: Fixes to mlx4_core driver.
From: David Miller @ 2012-09-07 16:58 UTC (permalink / raw)
  To: yevgenyp; +Cc: netdev
In-Reply-To: <1346921452-2035-1-git-send-email-yevgenyp@mellanox.com>

From: Yevgeny Petrilin <yevgenyp@mellanox.com>
Date: Thu,  6 Sep 2012 11:50:47 +0300

> Add security check / enforcement for flow steering rules set for VMs:
> Since VFs may be mapped to VMs which aren't trusted entities, flow
> steering rules attached through the wrapper on behalf of VFs must be
> checked to make sure that their L2 specification relate to MAC address
> assigned to that VF, and add L2 specification if its missing.
> 
> Fixing bad handling of command failures, can lead to crash.
> 
> Fixing wrong promiscuous mode entries management.

All applied, thanks.

^ permalink raw reply

* Re: [PATCH] udp: increment UDP_MIB_INERRORS if copy failed
From: David Miller @ 2012-09-07 16:59 UTC (permalink / raw)
  To: eric.dumazet; +Cc: sbohrer, netdev
In-Reply-To: <1346924084.2484.12.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 06 Sep 2012 11:34:44 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> In UDP recvmsg(), we miss an increase of UDP_MIB_INERRORS if the copy
> of skb to userspace failed for whatever reason.
> 
> Reported-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied to 'net', since this significantly helps diagnose problems.

^ permalink raw reply

* Re: |PATCH] seeq: Add missing spinlock init
From: David Miller @ 2012-09-07 16:59 UTC (permalink / raw)
  To: khali; +Cc: netdev
In-Reply-To: <20120906124705.2631ae01@endymion.delvare>

From: Jean Delvare <khali@linux-fr.org>
Date: Thu, 6 Sep 2012 12:47:05 +0200

> It doesn't seem this spinlock was properly initialized.
> 
> Signed-off-by: Jean Delvare <khali@linux-fr.org>

Applied.

^ permalink raw reply

* Re: [PATCH] NFC: fix possible memory leak
From: Samuel Ortiz @ 2012-09-07 17:01 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: lauro.venancio-430g2QfJUUCGglJvpFV4uA,
	aloisio.almeida-430g2QfJUUCGglJvpFV4uA,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <CAPgLHd_sD6NYc=Dj4yJpHY0yLBuDmQx=upQY=XQLi-9kTycK-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Wei,

On Sun, Sep 02, 2012 at 09:21:46PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> 
> nfc_llcp_build_tlv() malloced the memory and should be free in
> nfc_llcp_build_gb() after used, and the same in the error handling
> case, otherwise it will cause memory leak.
> 
> spatch with a semantic match is used to found this problem.
> (http://coccinelle.lip6.fr/)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> ---
>  net/nfc/llcp/llcp.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
Patch applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: MBIM
From: Dan Williams @ 2012-09-07 17:02 UTC (permalink / raw)
  To: Bjørn Mork
  Cc: Oliver Neukum, alexey.orishko-0IS4wlFg1OjSUeElwK9/Pw,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <87392u1afl.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>

On Fri, 2012-09-07 at 10:53 +0200, Bjørn Mork wrote:
> Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org> writes:
> > On Thursday 06 September 2012 10:17:46 Bjørn Mork wrote:
> >> Not really related, but I am still worrying how MBIM is going to fit
> >> into the usbnet model where you have a strict relation between one
> >> netdev and one USB interface.  Do you see any way usbnet could be
> >> extended to manage a list of netdevs?
> >> 
> >> All the netdev related functions doing
> >> 
> >>         struct usbnet           *dev = netdev_priv(net);
> >> 
> >> would still work.  But all the USB related functions using dev->net to
> >> get the netdev would fail.  Maybe this will be too difficult to
> >> implement within the usbnet framework at all?
> >
> > It depends on how much support we get from upper layers.
> > You can give two IPs to an ethernet card as well.
> 
> Yes, of course.  But I don't think that fits the MBIM model, where
> multiple independent connections (Internet, VoIP, MMS, VPN1, VPN2, etc)
> to different APNs will be multiplexed over the same USB endpoints.  And

Not just multiple APNs each with different IP addressing... but QoS too.
Each WWAN bearer you create may have different QoS settings.  That
bearer may also have *both* IPv4 and IPv6 addresses.  We also may want
to put the interface that bearer is tied to into a different network
namespace or container or something like that, so that the process that
requested the specific QoS doesn't have to share it with other apps,
possibly malicious ones.  Can't do that if they are all on the same
kernel network interface, AFAIK.

Dan

> to make this not fly at all: Some of these may be IPv4, some IPv6 and
> some dual stack.  You cannot support that on a single netdev.  Mixing
> them all together on the host will not do.  When the driver sees an IPv6
> multicast packet (RS, ND, whatever) on the netdev, which MBIM session
> should it forward that packet too?
> 
> If I understand MBIM correctly, we will see device configurations with
> _one_ CDC data interface carrying all data traffic for multiple device
> functions.  A MBIM driver must de-multiplex this, and each IP function
> should be routed to its own netdev IMHO.
> 
> > It would be best if you could come up with some preliminary code
> > at least.
> 
> Yup.  Finally got a device.  Will start playing.
> 
> 
> Bjørn
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH net-next 0/2] qmi_wwan changes intended for 3.7
From: Bjørn Mork @ 2012-09-07 17:36 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Bjørn Mork

Just a couple of minor improvements for 3.7.  The QMI
message size issue is not considered important enough for
stable.  It does not affect the primary device function
at all, and I consider it more of a feature enhancement
than a fix.


Bjørn Mork (2):
  net: qmi_wwan: increase max QMI message size to 4096
  net: qmi_wwan: use a single bind function for all device types

 drivers/net/usb/qmi_wwan.c |   47 ++++++++++++++++----------------------------
 1 file changed, 17 insertions(+), 30 deletions(-)

-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH net-next 1/2] net: qmi_wwan: increase max QMI message size to 4096
From: Bjørn Mork @ 2012-09-07 17:36 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Bjørn Mork
In-Reply-To: <1347039367-12399-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>

QMI requests exceeding 1500 bytes are possible and
device firmware does not handle fragmented messages
very well.  It is therefore necessary to increase
the maximum message size from the current 512 bytes.

The protocol message size limit is not documented
in any publicly known source, but the out of tree
driver from CodeAurora use 4 kB.  This is therefore
chosen as the new arbitrary default until the real
limit is known.

This should allow any QMI message to be transmitted
without fragmentation, fixing known issues with GPS
assistance data upload.

Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
---
 drivers/net/usb/qmi_wwan.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 328397c..516653f 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -108,7 +108,7 @@ static int qmi_wwan_register_subdriver(struct usbnet *dev)
 	atomic_set(&info->pmcount, 0);
 
 	/* register subdriver */
-	subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc, 512, &qmi_wwan_cdc_wdm_manage_power);
+	subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc, 4096, &qmi_wwan_cdc_wdm_manage_power);
 	if (IS_ERR(subdriver)) {
 		dev_err(&info->control->dev, "subdriver registration failed\n");
 		rv = PTR_ERR(subdriver);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH net-next 2/2] net: qmi_wwan: use a single bind function for all device types
From: Bjørn Mork @ 2012-09-07 17:36 UTC (permalink / raw)
  To: netdev; +Cc: linux-usb, Bjørn Mork
In-Reply-To: <1347039367-12399-1-git-send-email-bjorn@mork.no>

Refactoring the bind code lets us use a common driver_info struct
for all supported devices, simplifying the code a bit.  The
real advantage is that devices using the CDC ECM interface
layout now also can be added dynamically using the new_id sysfs
interface.  This simplifies testing of new devices.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 drivers/net/usb/qmi_wwan.c |   45 ++++++++++++++++----------------------------
 1 file changed, 16 insertions(+), 29 deletions(-)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 516653f..8492333 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -139,10 +139,18 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
 
 	BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) < sizeof(struct qmi_wwan_state)));
 
-	/* require a single interrupt status endpoint for subdriver */
+	/* control and data is shared? */
+	if (intf->cur_altsetting->desc.bNumEndpoints == 3) {
+		info->control = intf;
+		info->data = intf;
+		goto shared;
+	}
+
+	/* else require a single interrupt status endpoint on control intf */
 	if (intf->cur_altsetting->desc.bNumEndpoints != 1)
 		goto err;
 
+	/* and a number of CDC descriptors */
 	while (len > 3) {
 		struct usb_descriptor_header *h = (void *)buf;
 
@@ -231,8 +239,9 @@ next_desc:
 	if (status < 0)
 		goto err;
 
+shared:
 	status = qmi_wwan_register_subdriver(dev);
-	if (status < 0) {
+	if (status < 0 && info->control != info->data) {
 		usb_set_intfdata(info->data, NULL);
 		usb_driver_release_interface(driver, info->data);
 	}
@@ -241,20 +250,6 @@ err:
 	return status;
 }
 
-/* Some devices combine the "control" and "data" functions into a
- * single interface with all three endpoints: interrupt + bulk in and
- * out
- */
-static int qmi_wwan_bind_shared(struct usbnet *dev, struct usb_interface *intf)
-{
-	struct qmi_wwan_state *info = (void *)&dev->data;
-
-	/*  control and data is shared */
-	info->control = intf;
-	info->data = intf;
-	return qmi_wwan_register_subdriver(dev);
-}
-
 static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf)
 {
 	struct qmi_wwan_state *info = (void *)&dev->data;
@@ -330,20 +325,12 @@ static const struct driver_info	qmi_wwan_info = {
 	.manage_power	= qmi_wwan_manage_power,
 };
 
-static const struct driver_info	qmi_wwan_shared = {
-	.description	= "WWAN/QMI device",
-	.flags		= FLAG_WWAN,
-	.bind		= qmi_wwan_bind_shared,
-	.unbind		= qmi_wwan_unbind,
-	.manage_power	= qmi_wwan_manage_power,
-};
-
 #define HUAWEI_VENDOR_ID	0x12D1
 
 /* map QMI/wwan function by a fixed interface number */
 #define QMI_FIXED_INTF(vend, prod, num) \
 	USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
-	.driver_info = (unsigned long)&qmi_wwan_shared
+	.driver_info = (unsigned long)&qmi_wwan_info
 
 /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
 #define QMI_GOBI1K_DEVICE(vend, prod) \
@@ -367,15 +354,15 @@ static const struct usb_device_id products[] = {
 	/* 2. Combined interface devices matching on class+protocol */
 	{	/* Huawei E392, E398 and possibly others in "Windows mode" */
 		USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17),
-		.driver_info        = (unsigned long)&qmi_wwan_shared,
+		.driver_info        = (unsigned long)&qmi_wwan_info,
 	},
 	{	/* Pantech UML290 */
 		USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
-		.driver_info        = (unsigned long)&qmi_wwan_shared,
+		.driver_info        = (unsigned long)&qmi_wwan_info,
 	},
 	{	/* Pantech UML290 - newer firmware */
 		USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
-		.driver_info        = (unsigned long)&qmi_wwan_shared,
+		.driver_info        = (unsigned long)&qmi_wwan_info,
 	},
 
 	/* 3. Combined interface devices matching on interface number */
@@ -457,7 +444,7 @@ static int qmi_wwan_probe(struct usb_interface *intf, const struct usb_device_id
 	 */
 	if (!id->driver_info) {
 		dev_dbg(&intf->dev, "setting defaults for dynamic device id\n");
-		id->driver_info = (unsigned long)&qmi_wwan_shared;
+		id->driver_info = (unsigned long)&qmi_wwan_info;
 	}
 
 	return usbnet_probe(intf, id);
-- 
1.7.10.4

^ 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