Commit e949b09b authored by Doug Goldstein's avatar Doug Goldstein Committed by David S. Miller

vlan: set sysfs device_type to 'vlan'

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: default avatarDoug Goldstein <cardoe@cardoe.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 23612632
...@@ -531,6 +531,10 @@ static const struct header_ops vlan_header_ops = { ...@@ -531,6 +531,10 @@ static const struct header_ops vlan_header_ops = {
.parse = eth_header_parse, .parse = eth_header_parse,
}; };
static struct device_type vlan_type = {
.name = "vlan",
};
static const struct net_device_ops vlan_netdev_ops; static const struct net_device_ops vlan_netdev_ops;
static int vlan_dev_init(struct net_device *dev) static int vlan_dev_init(struct net_device *dev)
...@@ -579,6 +583,8 @@ 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; dev->netdev_ops = &vlan_netdev_ops;
SET_NETDEV_DEVTYPE(dev, &vlan_type);
if (is_vlan_dev(real_dev)) if (is_vlan_dev(real_dev))
subclass = 1; subclass = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment