提交 f37db85d 编写于 作者: F Florian Fainelli 提交者: David S. Miller

net: dsa: Set a "dsa" device_type

Provide a device_type information for slave network devices created by
DSA, this is useful for user-space application to easily locate/search
for devices of a specific kind.
Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4110b282
...@@ -961,6 +961,10 @@ static const struct switchdev_ops dsa_slave_switchdev_ops = { ...@@ -961,6 +961,10 @@ static const struct switchdev_ops dsa_slave_switchdev_ops = {
.switchdev_port_obj_dump = dsa_slave_port_obj_dump, .switchdev_port_obj_dump = dsa_slave_port_obj_dump,
}; };
static struct device_type dsa_type = {
.name = "dsa",
};
static void dsa_slave_adjust_link(struct net_device *dev) static void dsa_slave_adjust_link(struct net_device *dev)
{ {
struct dsa_slave_priv *p = netdev_priv(dev); struct dsa_slave_priv *p = netdev_priv(dev);
...@@ -1149,6 +1153,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent, ...@@ -1149,6 +1153,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
slave_dev->priv_flags |= IFF_NO_QUEUE; slave_dev->priv_flags |= IFF_NO_QUEUE;
slave_dev->netdev_ops = &dsa_slave_netdev_ops; slave_dev->netdev_ops = &dsa_slave_netdev_ops;
slave_dev->switchdev_ops = &dsa_slave_switchdev_ops; slave_dev->switchdev_ops = &dsa_slave_switchdev_ops;
SET_NETDEV_DEVTYPE(slave_dev, &dsa_type);
netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one, netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one,
NULL); NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册