mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
USB: usbnet reports minidriver name through ethtool
Update "usbnet" so that ethtool reports the name of the minidriver in use (e.g. asix, cdc_ether, dm9601, rndis_host) instead of "usbnet". This is a better match to how other network drivers work, resolving a minor open issue. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
ddda086240
commit
296c024292
2 changed files with 6 additions and 3 deletions
|
@ -734,8 +734,7 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
|
||||||
{
|
{
|
||||||
struct usbnet *dev = netdev_priv(net);
|
struct usbnet *dev = netdev_priv(net);
|
||||||
|
|
||||||
/* REVISIT don't always return "usbnet" */
|
strncpy (info->driver, dev->driver_name, sizeof info->driver);
|
||||||
strncpy (info->driver, driver_name, sizeof info->driver);
|
|
||||||
strncpy (info->version, DRIVER_VERSION, sizeof info->version);
|
strncpy (info->version, DRIVER_VERSION, sizeof info->version);
|
||||||
strncpy (info->fw_version, dev->driver_info->description,
|
strncpy (info->fw_version, dev->driver_info->description,
|
||||||
sizeof info->fw_version);
|
sizeof info->fw_version);
|
||||||
|
@ -1115,10 +1114,12 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
|
||||||
struct driver_info *info;
|
struct driver_info *info;
|
||||||
struct usb_device *xdev;
|
struct usb_device *xdev;
|
||||||
int status;
|
int status;
|
||||||
|
const char *name;
|
||||||
|
|
||||||
|
name = udev->dev.driver->name;
|
||||||
info = (struct driver_info *) prod->driver_info;
|
info = (struct driver_info *) prod->driver_info;
|
||||||
if (!info) {
|
if (!info) {
|
||||||
dev_dbg (&udev->dev, "blacklisted by %s\n", driver_name);
|
dev_dbg (&udev->dev, "blacklisted by %s\n", name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
xdev = interface_to_usbdev (udev);
|
xdev = interface_to_usbdev (udev);
|
||||||
|
@ -1138,6 +1139,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
|
||||||
dev = netdev_priv(net);
|
dev = netdev_priv(net);
|
||||||
dev->udev = xdev;
|
dev->udev = xdev;
|
||||||
dev->driver_info = info;
|
dev->driver_info = info;
|
||||||
|
dev->driver_name = name;
|
||||||
dev->msg_enable = netif_msg_init (msg_level, NETIF_MSG_DRV
|
dev->msg_enable = netif_msg_init (msg_level, NETIF_MSG_DRV
|
||||||
| NETIF_MSG_PROBE | NETIF_MSG_LINK);
|
| NETIF_MSG_PROBE | NETIF_MSG_LINK);
|
||||||
skb_queue_head_init (&dev->rxq);
|
skb_queue_head_init (&dev->rxq);
|
||||||
|
|
|
@ -29,6 +29,7 @@ struct usbnet {
|
||||||
/* housekeeping */
|
/* housekeeping */
|
||||||
struct usb_device *udev;
|
struct usb_device *udev;
|
||||||
struct driver_info *driver_info;
|
struct driver_info *driver_info;
|
||||||
|
const char *driver_name;
|
||||||
wait_queue_head_t *wait;
|
wait_queue_head_t *wait;
|
||||||
struct mutex phy_mutex;
|
struct mutex phy_mutex;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue