netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fwd: [PATCH 01/22] usb gadget: fix ethernet link reports to ethtool
@ 2009-04-17 19:45 David Brownell
  2009-04-21  8:57 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: David Brownell @ 2009-04-17 19:45 UTC (permalink / raw)
  To: Network development list

Hmm, I should probably try to cc netdev on some of these
patches.  They're fairly infrequent any more, but...

Likewise, it'd be good to get cc'd from netdev on patches
that affect drivers/usb/gadget ... I was very recently
surprised to see a "phonet" driver just appear.

- Dave


----------  Forwarded Message  ----------

Subject: [PATCH 01/22] usb gadget: fix ethernet link reports to ethtool
Date: Friday 17 April 2009
From: "Greg Kroah-Hartman" <gregkh@suse.de>
To: linux-usb@vger.kernel.org

From: Jonathan McDowell <noodles@earth.li>

The g_ether USB gadget driver currently decides whether or not there's a
link to report back for eth_get_link based on if the USB link speed is
set. The USB gadget speed is however often set even before the device is
enumerated. It seems more sensible to only report a "link" if we're
actually connected to a host that wants to talk to us. The patch below
does this for me - tested with the PXA27x UDC driver.

Signed-off-by: Jonathan McDowell <noodles@earth.li>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/gadget/u_ether.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 96d65ca..4007770 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -175,12 +175,6 @@ static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p)
 	strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info);
 }
 
-static u32 eth_get_link(struct net_device *net)
-{
-	struct eth_dev	*dev = netdev_priv(net);
-	return dev->gadget->speed != USB_SPEED_UNKNOWN;
-}
-
 /* REVISIT can also support:
  *   - WOL (by tracking suspends and issuing remote wakeup)
  *   - msglevel (implies updated messaging)
@@ -189,7 +183,7 @@ static u32 eth_get_link(struct net_device *net)
 
 static struct ethtool_ops ops = {
 	.get_drvinfo = eth_get_drvinfo,
-	.get_link = eth_get_link
+	.get_link = ethtool_op_get_link,
 };
 
 static void defer_kevent(struct eth_dev *dev, int flag)
-- 
1.6.2


-------------------------------------------------------

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 01/22] usb gadget: fix ethernet link reports to ethtool
  2009-04-17 19:45 Fwd: [PATCH 01/22] usb gadget: fix ethernet link reports to ethtool David Brownell
@ 2009-04-21  8:57 ` David Miller
  2009-04-21  9:15   ` David Brownell
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2009-04-21  8:57 UTC (permalink / raw)
  To: david-b; +Cc: netdev

From: David Brownell <david-b@pacbell.net>
Date: Fri, 17 Apr 2009 12:45:14 -0700

> Hmm, I should probably try to cc netdev on some of these
> patches.  They're fairly infrequent any more, but...
> 
> Likewise, it'd be good to get cc'd from netdev on patches
> that affect drivers/usb/gadget ... I was very recently
> surprised to see a "phonet" driver just appear.

David, want me to add this patch to net-2.6?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 01/22] usb gadget: fix ethernet link reports to ethtool
  2009-04-21  8:57 ` David Miller
@ 2009-04-21  9:15   ` David Brownell
  2009-04-21  9:15     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: David Brownell @ 2009-04-21  9:15 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Tuesday 21 April 2009, David Miller wrote:
> From: David Brownell <david-b@pacbell.net>
> Date: Fri, 17 Apr 2009 12:45:14 -0700
> 
> > Hmm, I should probably try to cc netdev on some of these
> > patches.  They're fairly infrequent any more, but...
> > 
> > Likewise, it'd be good to get cc'd from netdev on patches
> > that affect drivers/usb/gadget ... I was very recently
> > surprised to see a "phonet" driver just appear.
> 
> David, want me to add this patch to net-2.6?

No, it's already gone to Linus and merged.  This was just a FYI.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 01/22] usb gadget: fix ethernet link reports to ethtool
  2009-04-21  9:15   ` David Brownell
@ 2009-04-21  9:15     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-04-21  9:15 UTC (permalink / raw)
  To: david-b; +Cc: netdev

From: David Brownell <david-b@pacbell.net>
Date: Tue, 21 Apr 2009 02:15:21 -0700

> On Tuesday 21 April 2009, David Miller wrote:
>> From: David Brownell <david-b@pacbell.net>
>> Date: Fri, 17 Apr 2009 12:45:14 -0700
>> 
>> > Hmm, I should probably try to cc netdev on some of these
>> > patches.  They're fairly infrequent any more, but...
>> > 
>> > Likewise, it'd be good to get cc'd from netdev on patches
>> > that affect drivers/usb/gadget ... I was very recently
>> > surprised to see a "phonet" driver just appear.
>> 
>> David, want me to add this patch to net-2.6?
> 
> No, it's already gone to Linus and merged.  This was just a FYI.

Ok, thanks David.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-21  9:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17 19:45 Fwd: [PATCH 01/22] usb gadget: fix ethernet link reports to ethtool David Brownell
2009-04-21  8:57 ` David Miller
2009-04-21  9:15   ` David Brownell
2009-04-21  9:15     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).