Commit 9b361c13 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

vlan: add helper which can be called to see if device is used by vlan

also, remove unused vlan_info definition from header

CC: Patrick McHardy <kaber@trash.net>
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c7517e9
...@@ -74,8 +74,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) ...@@ -74,8 +74,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
/* found in socket.c */ /* found in socket.c */
extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
struct vlan_info;
static inline int is_vlan_dev(struct net_device *dev) static inline int is_vlan_dev(struct net_device *dev)
{ {
return dev->priv_flags & IFF_802_1Q_VLAN; return dev->priv_flags & IFF_802_1Q_VLAN;
...@@ -101,6 +99,8 @@ extern int vlan_vids_add_by_dev(struct net_device *dev, ...@@ -101,6 +99,8 @@ extern int vlan_vids_add_by_dev(struct net_device *dev,
const struct net_device *by_dev); const struct net_device *by_dev);
extern void vlan_vids_del_by_dev(struct net_device *dev, extern void vlan_vids_del_by_dev(struct net_device *dev,
const struct net_device *by_dev); const struct net_device *by_dev);
extern bool vlan_uses_dev(const struct net_device *dev);
#else #else
static inline struct net_device * static inline struct net_device *
__vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id) __vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
...@@ -151,6 +151,11 @@ static inline void vlan_vids_del_by_dev(struct net_device *dev, ...@@ -151,6 +151,11 @@ static inline void vlan_vids_del_by_dev(struct net_device *dev,
const struct net_device *by_dev) const struct net_device *by_dev)
{ {
} }
static inline bool vlan_uses_dev(const struct net_device *dev)
{
return false;
}
#endif #endif
/** /**
......
...@@ -368,3 +368,9 @@ void vlan_vids_del_by_dev(struct net_device *dev, ...@@ -368,3 +368,9 @@ void vlan_vids_del_by_dev(struct net_device *dev,
vlan_vid_del(dev, vid_info->vid); vlan_vid_del(dev, vid_info->vid);
} }
EXPORT_SYMBOL(vlan_vids_del_by_dev); EXPORT_SYMBOL(vlan_vids_del_by_dev);
bool vlan_uses_dev(const struct net_device *dev)
{
return rtnl_dereference(dev->vlan_info) ? true : false;
}
EXPORT_SYMBOL(vlan_uses_dev);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment