aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/8021q/vlan_netlink.c')
-rw-r--r--net/8021q/vlan_netlink.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index e9c91dcecc9b..343146e1bceb 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -100,6 +100,25 @@ static int vlan_changelink(struct net_device *dev,
100 return 0; 100 return 0;
101} 101}
102 102
103static int vlan_get_tx_queues(struct net *net,
104 struct nlattr *tb[],
105 unsigned int *num_tx_queues,
106 unsigned int *real_num_tx_queues)
107{
108 struct net_device *real_dev;
109
110 if (!tb[IFLA_LINK])
111 return -EINVAL;
112
113 real_dev = __dev_get_by_index(net, nla_get_u32(tb[IFLA_LINK]));
114 if (!real_dev)
115 return -ENODEV;
116
117 *num_tx_queues = real_dev->num_tx_queues;
118 *real_num_tx_queues = real_dev->real_num_tx_queues;
119 return 0;
120}
121
103static int vlan_newlink(struct net_device *dev, 122static int vlan_newlink(struct net_device *dev,
104 struct nlattr *tb[], struct nlattr *data[]) 123 struct nlattr *tb[], struct nlattr *data[])
105{ 124{
@@ -216,6 +235,7 @@ struct rtnl_link_ops vlan_link_ops __read_mostly = {
216 .maxtype = IFLA_VLAN_MAX, 235 .maxtype = IFLA_VLAN_MAX,
217 .policy = vlan_policy, 236 .policy = vlan_policy,
218 .priv_size = sizeof(struct vlan_dev_info), 237 .priv_size = sizeof(struct vlan_dev_info),
238 .get_tx_queues = vlan_get_tx_queues,
219 .setup = vlan_setup, 239 .setup = vlan_setup,
220 .validate = vlan_validate, 240 .validate = vlan_validate,
221 .newlink = vlan_newlink, 241 .newlink = vlan_newlink,