diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-01-16 01:13:58 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:54:33 -0500 |
commit | aa7907407adf1358ee39be0e98beaf4c129a78d6 (patch) | |
tree | 60aee203e46b1e28dea95532ea0d0951a9f7545e /drivers/usb | |
parent | a8d4211f33a9573f7b1bdcfd9c9c48631d1515ee (diff) |
USB: gadget: Add DEVTYPE support for Ethernet functions
The problem with Ethernet based networking devices is to clearly
identify what's their usage. Special interfaces like bridges, WiFi,
Bluetooth, WiMAX or WWAN are already using DEVTYPE identification.
This patch marks the Ethernet functions of gadgets from the device
type "gadget". Automatic setup of these interfaces can now happen
from userspace without the need of hardcoding the network interface
name.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/u_ether.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 2fc02bd9584..84ca195c2d1 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c | |||
@@ -746,6 +746,10 @@ static const struct net_device_ops eth_netdev_ops = { | |||
746 | .ndo_validate_addr = eth_validate_addr, | 746 | .ndo_validate_addr = eth_validate_addr, |
747 | }; | 747 | }; |
748 | 748 | ||
749 | static struct device_type gadget_type = { | ||
750 | .name = "gadget", | ||
751 | }; | ||
752 | |||
749 | /** | 753 | /** |
750 | * gether_setup - initialize one ethernet-over-usb link | 754 | * gether_setup - initialize one ethernet-over-usb link |
751 | * @g: gadget to associated with these links | 755 | * @g: gadget to associated with these links |
@@ -808,6 +812,7 @@ int __init gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN]) | |||
808 | 812 | ||
809 | dev->gadget = g; | 813 | dev->gadget = g; |
810 | SET_NETDEV_DEV(net, &g->dev); | 814 | SET_NETDEV_DEV(net, &g->dev); |
815 | SET_NETDEV_DEVTYPE(net, &gadget_type); | ||
811 | 816 | ||
812 | status = register_netdev(net); | 817 | status = register_netdev(net); |
813 | if (status < 0) { | 818 | if (status < 0) { |