aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r--net/8021q/vlan.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 917ecb93ea28..8970ba139d73 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -18,6 +18,8 @@
18 * 2 of the License, or (at your option) any later version. 18 * 2 of the License, or (at your option) any later version.
19 */ 19 */
20 20
21#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22
21#include <linux/capability.h> 23#include <linux/capability.h>
22#include <linux/module.h> 24#include <linux/module.h>
23#include <linux/netdevice.h> 25#include <linux/netdevice.h>
@@ -132,8 +134,6 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
132 vlan_gvrp_uninit_applicant(real_dev); 134 vlan_gvrp_uninit_applicant(real_dev);
133 135
134 rcu_assign_pointer(real_dev->vlgrp, NULL); 136 rcu_assign_pointer(real_dev->vlgrp, NULL);
135 if (ops->ndo_vlan_rx_register)
136 ops->ndo_vlan_rx_register(real_dev, NULL);
137 137
138 /* Free the group, after all cpu's are done. */ 138 /* Free the group, after all cpu's are done. */
139 call_rcu(&grp->rcu, vlan_rcu_free); 139 call_rcu(&grp->rcu, vlan_rcu_free);
@@ -149,13 +149,13 @@ int vlan_check_real_dev(struct net_device *real_dev, u16 vlan_id)
149 const struct net_device_ops *ops = real_dev->netdev_ops; 149 const struct net_device_ops *ops = real_dev->netdev_ops;
150 150
151 if (real_dev->features & NETIF_F_VLAN_CHALLENGED) { 151 if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
152 pr_info("8021q: VLANs not supported on %s\n", name); 152 pr_info("VLANs not supported on %s\n", name);
153 return -EOPNOTSUPP; 153 return -EOPNOTSUPP;
154 } 154 }
155 155
156 if ((real_dev->features & NETIF_F_HW_VLAN_FILTER) && 156 if ((real_dev->features & NETIF_F_HW_VLAN_FILTER) &&
157 (!ops->ndo_vlan_rx_add_vid || !ops->ndo_vlan_rx_kill_vid)) { 157 (!ops->ndo_vlan_rx_add_vid || !ops->ndo_vlan_rx_kill_vid)) {
158 pr_info("8021q: Device %s has buggy VLAN hw accel\n", name); 158 pr_info("Device %s has buggy VLAN hw accel\n", name);
159 return -EOPNOTSUPP; 159 return -EOPNOTSUPP;
160 } 160 }
161 161
@@ -205,8 +205,6 @@ int register_vlan_dev(struct net_device *dev)
205 grp->nr_vlans++; 205 grp->nr_vlans++;
206 206
207 if (ngrp) { 207 if (ngrp) {
208 if (ops->ndo_vlan_rx_register && (real_dev->features & NETIF_F_HW_VLAN_RX))
209 ops->ndo_vlan_rx_register(real_dev, ngrp);
210 rcu_assign_pointer(real_dev->vlgrp, ngrp); 208 rcu_assign_pointer(real_dev->vlgrp, ngrp);
211 } 209 }
212 if (real_dev->features & NETIF_F_HW_VLAN_FILTER) 210 if (real_dev->features & NETIF_F_HW_VLAN_FILTER)
@@ -344,13 +342,12 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event)
344 case NETDEV_CHANGENAME: 342 case NETDEV_CHANGENAME:
345 vlan_proc_rem_dev(dev); 343 vlan_proc_rem_dev(dev);
346 if (vlan_proc_add_dev(dev) < 0) 344 if (vlan_proc_add_dev(dev) < 0)
347 pr_warning("8021q: failed to change proc name for %s\n", 345 pr_warn("failed to change proc name for %s\n",
348 dev->name); 346 dev->name);
349 break; 347 break;
350 case NETDEV_REGISTER: 348 case NETDEV_REGISTER:
351 if (vlan_proc_add_dev(dev) < 0) 349 if (vlan_proc_add_dev(dev) < 0)
352 pr_warning("8021q: failed to add proc entry for %s\n", 350 pr_warn("failed to add proc entry for %s\n", dev->name);
353 dev->name);
354 break; 351 break;
355 case NETDEV_UNREGISTER: 352 case NETDEV_UNREGISTER:
356 vlan_proc_rem_dev(dev); 353 vlan_proc_rem_dev(dev);
@@ -374,7 +371,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
374 if ((event == NETDEV_UP) && 371 if ((event == NETDEV_UP) &&
375 (dev->features & NETIF_F_HW_VLAN_FILTER) && 372 (dev->features & NETIF_F_HW_VLAN_FILTER) &&
376 dev->netdev_ops->ndo_vlan_rx_add_vid) { 373 dev->netdev_ops->ndo_vlan_rx_add_vid) {
377 pr_info("8021q: adding VLAN 0 to HW filter on device %s\n", 374 pr_info("adding VLAN 0 to HW filter on device %s\n",
378 dev->name); 375 dev->name);
379 dev->netdev_ops->ndo_vlan_rx_add_vid(dev, 0); 376 dev->netdev_ops->ndo_vlan_rx_add_vid(dev, 0);
380 } 377 }