usb gadget: fix ethernet link reports to ethtool
authorJonathan McDowell <noodles@earth.li>
Thu, 26 Mar 2009 07:45:27 +0000 (00:45 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 17 Apr 2009 17:50:23 +0000 (10:50 -0700)
commit237e75bf1e558f7330f8deb167fa3116405bef2c
tree2757c37e072468cebf5dbf86ab32e7b0ac603f02
parent9f76208c33984ab777eace5d07a4e36e88703e02
usb gadget: fix ethernet link reports to ethtool

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