summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/usbnet.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-10-02 05:15:26 +0000
committerDavid S. Miller <davem@davemloft.net>2009-10-05 00:43:33 -0700
commit225794f8c33fd32721ae1cd3576db99810351d7b (patch)
treeeb5ddc217354292080984a3d848f5932814da943 /drivers/net/usb/usbnet.c
parente1e499eef2200c2a7120c9ebf297d48b195cf887 (diff)
usbnet: Set device type for wlan and wwan devices
For usbnet devices with FLAG_WLAN and FLAG_WWAN set the proper device type so that uevent contains the correct value. This then allows an easy identification of the actual underlying technology of the Ethernet device. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r--drivers/net/usb/usbnet.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 8124cf16259..378da8c938f 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1210,6 +1210,14 @@ static const struct net_device_ops usbnet_netdev_ops = {
// precondition: never called in_interrupt
+static struct device_type wlan_type = {
+ .name = "wlan",
+};
+
+static struct device_type wwan_type = {
+ .name = "wwan",
+};
+
int
usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
{
@@ -1325,6 +1333,12 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
SET_NETDEV_DEV(net, &udev->dev);
+
+ if ((dev->driver_info->flags & FLAG_WLAN) != 0)
+ SET_NETDEV_DEVTYPE(net, &wlan_type);
+ if ((dev->driver_info->flags & FLAG_WWAN) != 0)
+ SET_NETDEV_DEVTYPE(net, &wwan_type);
+
status = register_netdev (net);
if (status)
goto out3;