]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
vlan: set sysfs device_type to 'vlan'
authorDoug Goldstein <cardoe@cardoe.com>
Sun, 21 Oct 2012 19:53:57 +0000 (19:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Nov 2012 03:02:23 +0000 (22:02 -0500)
Sets the sysfs device_type to 'vlan' for udev. This makes it easier for
applications that query network information via udev to identify vlans
instead of using strrchr().

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/8021q/vlan_dev.c

index 6da96d43317511a188dfd8d1518bfb0f11f6151d..4a6d31a082b9e534eadc3fa2873313fa07cc7869 100644 (file)
@@ -531,6 +531,10 @@ static const struct header_ops vlan_header_ops = {
        .parse   = eth_header_parse,
 };
 
+static struct device_type vlan_type = {
+       .name   = "vlan",
+};
+
 static const struct net_device_ops vlan_netdev_ops;
 
 static int vlan_dev_init(struct net_device *dev)
@@ -579,6 +583,8 @@ static int vlan_dev_init(struct net_device *dev)
 
        dev->netdev_ops = &vlan_netdev_ops;
 
+       SET_NETDEV_DEVTYPE(dev, &vlan_type);
+
        if (is_vlan_dev(real_dev))
                subclass = 1;