aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2011-12-07 23:11:17 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-08 19:52:42 -0500
commit87002b03baabd2b8f6281ab6411ed88d24958de1 (patch)
tree0e5730c0d1ba887488ba420d4ea89a230f272c51 /drivers/net/macvlan.c
parent8e586137e6b63af1e881b328466ab5ffbe562510 (diff)
net: introduce vlan_vid_[add/del] and use them instead of direct [add/kill]_vid ndo calls
This patch adds wrapper for ndo_vlan_rx_add_vid/ndo_vlan_rx_kill_vid functions. Check for NETIF_F_HW_VLAN_FILTER feature is done in this wrapper. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r--drivers/net/macvlan.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 2511bc5c34f3..f2f820c4b40a 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -26,6 +26,7 @@
26#include <linux/etherdevice.h> 26#include <linux/etherdevice.h>
27#include <linux/ethtool.h> 27#include <linux/ethtool.h>
28#include <linux/if_arp.h> 28#include <linux/if_arp.h>
29#include <linux/if_vlan.h>
29#include <linux/if_link.h> 30#include <linux/if_link.h>
30#include <linux/if_macvlan.h> 31#include <linux/if_macvlan.h>
31#include <net/rtnetlink.h> 32#include <net/rtnetlink.h>
@@ -525,11 +526,8 @@ static int macvlan_vlan_rx_add_vid(struct net_device *dev,
525{ 526{
526 struct macvlan_dev *vlan = netdev_priv(dev); 527 struct macvlan_dev *vlan = netdev_priv(dev);
527 struct net_device *lowerdev = vlan->lowerdev; 528 struct net_device *lowerdev = vlan->lowerdev;
528 const struct net_device_ops *ops = lowerdev->netdev_ops;
529 529
530 if (ops->ndo_vlan_rx_add_vid) 530 return vlan_vid_add(lowerdev, vid);
531 return ops->ndo_vlan_rx_add_vid(lowerdev, vid);
532 return 0;
533} 531}
534 532
535static int macvlan_vlan_rx_kill_vid(struct net_device *dev, 533static int macvlan_vlan_rx_kill_vid(struct net_device *dev,
@@ -537,10 +535,8 @@ static int macvlan_vlan_rx_kill_vid(struct net_device *dev,
537{ 535{
538 struct macvlan_dev *vlan = netdev_priv(dev); 536 struct macvlan_dev *vlan = netdev_priv(dev);
539 struct net_device *lowerdev = vlan->lowerdev; 537 struct net_device *lowerdev = vlan->lowerdev;
540 const struct net_device_ops *ops = lowerdev->netdev_ops;
541 538
542 if (ops->ndo_vlan_rx_kill_vid) 539 vlan_vid_del(lowerdev, vid);
543 return ops->ndo_vlan_rx_kill_vid(lowerdev, vid);
544 return 0; 540 return 0;
545} 541}
546 542