Skip to content

Commit 225794f

Browse files
holtmanndavem330
authored andcommitted
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>
1 parent e1e499e commit 225794f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/net/usb/usbnet.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,14 @@ static const struct net_device_ops usbnet_netdev_ops = {
12101210

12111211
// precondition: never called in_interrupt
12121212

1213+
static struct device_type wlan_type = {
1214+
.name = "wlan",
1215+
};
1216+
1217+
static struct device_type wwan_type = {
1218+
.name = "wwan",
1219+
};
1220+
12131221
int
12141222
usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
12151223
{
@@ -1325,6 +1333,12 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
13251333
dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
13261334

13271335
SET_NETDEV_DEV(net, &udev->dev);
1336+
1337+
if ((dev->driver_info->flags & FLAG_WLAN) != 0)
1338+
SET_NETDEV_DEVTYPE(net, &wlan_type);
1339+
if ((dev->driver_info->flags & FLAG_WWAN) != 0)
1340+
SET_NETDEV_DEVTYPE(net, &wwan_type);
1341+
13281342
status = register_netdev (net);
13291343
if (status)
13301344
goto out3;

0 commit comments

Comments
 (0)