diff options
author | Patrick McHardy <kaber@trash.net> | 2007-06-13 15:05:22 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 01:14:38 -0400 |
commit | c17d8874f9959070552fddf1b4e1d73c0c144c0f (patch) | |
tree | ea5a61e37f71218f8cb69033293a55631511b470 /net/8021q/vlan.h | |
parent | 9ba2cd656021e7f70038ba9d551224e04d0bfcef (diff) |
[VLAN]: Convert name-based configuration functions to struct netdevice *
Move the device lookup and checks to the ioctl handler under the RTNL and
change all name-based interfaces to take a struct net_device * instead.
This allows to use them from a netlink interface, which identifies devices
based on ifindex not name. It also avoids races between the ioctl interface
and the (upcoming) netlink interface since now all changes happen under the
RTNL.
As a nice side effect this greatly simplifies error handling in the helper
functions and fixes a number of incorrect error codes like -EINVAL for
device not found.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan.h')
-rw-r--r-- | net/8021q/vlan.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h index 1976cdba8f72..b83739017e9d 100644 --- a/net/8021q/vlan.h +++ b/net/8021q/vlan.h | |||
@@ -62,11 +62,14 @@ int vlan_dev_set_mac_address(struct net_device *dev, void* addr); | |||
62 | int vlan_dev_open(struct net_device* dev); | 62 | int vlan_dev_open(struct net_device* dev); |
63 | int vlan_dev_stop(struct net_device* dev); | 63 | int vlan_dev_stop(struct net_device* dev); |
64 | int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd); | 64 | int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd); |
65 | int vlan_dev_set_ingress_priority(char* dev_name, __u32 skb_prio, short vlan_prio); | 65 | void vlan_dev_set_ingress_priority(const struct net_device *dev, |
66 | int vlan_dev_set_egress_priority(char* dev_name, __u32 skb_prio, short vlan_prio); | 66 | u32 skb_prio, short vlan_prio); |
67 | int vlan_dev_set_vlan_flag(char* dev_name, __u32 flag, short flag_val); | 67 | int vlan_dev_set_egress_priority(const struct net_device *dev, |
68 | int vlan_dev_get_realdev_name(const char* dev_name, char* result); | 68 | u32 skb_prio, short vlan_prio); |
69 | int vlan_dev_get_vid(const char* dev_name, unsigned short* result); | 69 | int vlan_dev_set_vlan_flag(const struct net_device *dev, |
70 | u32 flag, short flag_val); | ||
71 | void vlan_dev_get_realdev_name(const struct net_device *dev, char *result); | ||
72 | void vlan_dev_get_vid(const struct net_device *dev, unsigned short *result); | ||
70 | void vlan_dev_set_multicast_list(struct net_device *vlan_dev); | 73 | void vlan_dev_set_multicast_list(struct net_device *vlan_dev); |
71 | 74 | ||
72 | #endif /* !(__BEN_VLAN_802_1Q_INC__) */ | 75 | #endif /* !(__BEN_VLAN_802_1Q_INC__) */ |