From 87002b03baabd2b8f6281ab6411ed88d24958de1 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Thu, 8 Dec 2011 04:11:17 +0000 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/macvlan.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'drivers/net/macvlan.c') 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 @@ #include #include #include +#include #include #include #include @@ -525,11 +526,8 @@ static int macvlan_vlan_rx_add_vid(struct net_device *dev, { struct macvlan_dev *vlan = netdev_priv(dev); struct net_device *lowerdev = vlan->lowerdev; - const struct net_device_ops *ops = lowerdev->netdev_ops; - if (ops->ndo_vlan_rx_add_vid) - return ops->ndo_vlan_rx_add_vid(lowerdev, vid); - return 0; + return vlan_vid_add(lowerdev, vid); } static 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, { struct macvlan_dev *vlan = netdev_priv(dev); struct net_device *lowerdev = vlan->lowerdev; - const struct net_device_ops *ops = lowerdev->netdev_ops; - if (ops->ndo_vlan_rx_kill_vid) - return ops->ndo_vlan_rx_kill_vid(lowerdev, vid); + vlan_vid_del(lowerdev, vid); return 0; } -- cgit v1.2.3