diff options
author | Mahesh Bandewar <maheshb@google.com> | 2014-12-06 18:53:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-09 16:10:06 -0500 |
commit | 5933fea7aa7237ba52d67c069c39ad5c3ab7a036 (patch) | |
tree | d3e2a240606e79cc961337001297e8609ecc1220 /drivers/net | |
parent | 764e433b3c43d47e2d19e4bd32fec093421b9cff (diff) |
ipvlan: move the device check function into netdevice.h
Move the port check [ipvlan_dev_master()] and device check
[ipvlan_dev_slave()] functions to netdevice.h and rename them
netif_is_ipvlan_port() and netif_is_ipvlan() resp. to be
consistent with macvlan api naming.
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ipvlan/ipvlan.h | 10 | ||||
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 10 |
2 files changed, 5 insertions, 15 deletions
diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h index c44d29eca6c0..2729f64b3e7e 100644 --- a/drivers/net/ipvlan/ipvlan.h +++ b/drivers/net/ipvlan/ipvlan.h | |||
@@ -107,16 +107,6 @@ static inline struct ipvl_port *ipvlan_port_get_rtnl(const struct net_device *d) | |||
107 | return rtnl_dereference(d->rx_handler_data); | 107 | return rtnl_dereference(d->rx_handler_data); |
108 | } | 108 | } |
109 | 109 | ||
110 | static inline bool ipvlan_dev_master(struct net_device *d) | ||
111 | { | ||
112 | return d->priv_flags & IFF_IPVLAN_MASTER; | ||
113 | } | ||
114 | |||
115 | static inline bool ipvlan_dev_slave(struct net_device *d) | ||
116 | { | ||
117 | return d->priv_flags & IFF_IPVLAN_SLAVE; | ||
118 | } | ||
119 | |||
120 | void ipvlan_adjust_mtu(struct ipvl_dev *ipvlan, struct net_device *dev); | 110 | void ipvlan_adjust_mtu(struct ipvl_dev *ipvlan, struct net_device *dev); |
121 | void ipvlan_set_port_mode(struct ipvl_port *port, u32 nval); | 111 | void ipvlan_set_port_mode(struct ipvl_port *port, u32 nval); |
122 | void ipvlan_init_secret(void); | 112 | void ipvlan_init_secret(void); |
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index a66ff8197008..4f4099d5603d 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
@@ -446,11 +446,11 @@ static int ipvlan_link_new(struct net *src_net, struct net_device *dev, | |||
446 | if (!phy_dev) | 446 | if (!phy_dev) |
447 | return -ENODEV; | 447 | return -ENODEV; |
448 | 448 | ||
449 | if (ipvlan_dev_slave(phy_dev)) { | 449 | if (netif_is_ipvlan(phy_dev)) { |
450 | struct ipvl_dev *tmp = netdev_priv(phy_dev); | 450 | struct ipvl_dev *tmp = netdev_priv(phy_dev); |
451 | 451 | ||
452 | phy_dev = tmp->phy_dev; | 452 | phy_dev = tmp->phy_dev; |
453 | } else if (!ipvlan_dev_master(phy_dev)) { | 453 | } else if (!netif_is_ipvlan_port(phy_dev)) { |
454 | err = ipvlan_port_create(phy_dev); | 454 | err = ipvlan_port_create(phy_dev); |
455 | if (err < 0) | 455 | if (err < 0) |
456 | return err; | 456 | return err; |
@@ -560,7 +560,7 @@ static int ipvlan_device_event(struct notifier_block *unused, | |||
560 | struct ipvl_port *port; | 560 | struct ipvl_port *port; |
561 | LIST_HEAD(lst_kill); | 561 | LIST_HEAD(lst_kill); |
562 | 562 | ||
563 | if (!ipvlan_dev_master(dev)) | 563 | if (!netif_is_ipvlan_port(dev)) |
564 | return NOTIFY_DONE; | 564 | return NOTIFY_DONE; |
565 | 565 | ||
566 | port = ipvlan_port_get_rtnl(dev); | 566 | port = ipvlan_port_get_rtnl(dev); |
@@ -651,7 +651,7 @@ static int ipvlan_addr6_event(struct notifier_block *unused, | |||
651 | struct net_device *dev = (struct net_device *)if6->idev->dev; | 651 | struct net_device *dev = (struct net_device *)if6->idev->dev; |
652 | struct ipvl_dev *ipvlan = netdev_priv(dev); | 652 | struct ipvl_dev *ipvlan = netdev_priv(dev); |
653 | 653 | ||
654 | if (!ipvlan_dev_slave(dev)) | 654 | if (!netif_is_ipvlan(dev)) |
655 | return NOTIFY_DONE; | 655 | return NOTIFY_DONE; |
656 | 656 | ||
657 | if (!ipvlan || !ipvlan->port) | 657 | if (!ipvlan || !ipvlan->port) |
@@ -723,7 +723,7 @@ static int ipvlan_addr4_event(struct notifier_block *unused, | |||
723 | struct ipvl_dev *ipvlan = netdev_priv(dev); | 723 | struct ipvl_dev *ipvlan = netdev_priv(dev); |
724 | struct in_addr ip4_addr; | 724 | struct in_addr ip4_addr; |
725 | 725 | ||
726 | if (!ipvlan_dev_slave(dev)) | 726 | if (!netif_is_ipvlan(dev)) |
727 | return NOTIFY_DONE; | 727 | return NOTIFY_DONE; |
728 | 728 | ||
729 | if (!ipvlan || !ipvlan->port) | 729 | if (!ipvlan || !ipvlan->port) |