diff options
author | Scott Feldman <sfeldma@gmail.com> | 2015-03-16 00:07:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-16 00:14:42 -0400 |
commit | 4170604feec780d00e7511c24fa0f6e5c2e4ed75 (patch) | |
tree | ce9292b2cc29cd37785bfa4a1fcb1a2cda7eb574 /include/net | |
parent | 7993d44ea1f7b17dd17863ab139d2c9df17dfe51 (diff) |
switchdev: add swdev ops
As discussed at netconf, introduce swdev_ops as first step to move switchdev
ops from ndo to swdev. This will keep switchdev from cluttering up ndo ops
space.
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/switchdev.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 1a9382febcc3..e5de53f92482 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
@@ -14,6 +14,44 @@ | |||
14 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
15 | #include <linux/notifier.h> | 15 | #include <linux/notifier.h> |
16 | 16 | ||
17 | struct fib_info; | ||
18 | |||
19 | /** | ||
20 | * struct switchdev_ops - switchdev operations | ||
21 | * | ||
22 | * int (*swdev_parent_id_get)(struct net_device *dev, | ||
23 | * struct netdev_phys_item_id *psid); | ||
24 | * Called to get an ID of the switch chip this port is part of. | ||
25 | * If driver implements this, it indicates that it represents a port | ||
26 | * of a switch chip. | ||
27 | * | ||
28 | * int (*swdev_port_stp_update)(struct net_device *dev, u8 state); | ||
29 | * Called to notify switch device port of bridge port STP | ||
30 | * state change. | ||
31 | * | ||
32 | * int (*swdev_fib_ipv4_add)(struct net_device *dev, __be32 dst, | ||
33 | * int dst_len, struct fib_info *fi, | ||
34 | * u8 tos, u8 type, u32 nlflags, u32 tb_id); | ||
35 | * Called to add/modify IPv4 route to switch device. | ||
36 | * | ||
37 | * int (*swdev_fib_ipv4_del)(struct net_device *dev, __be32 dst, | ||
38 | * int dst_len, struct fib_info *fi, | ||
39 | * u8 tos, u8 type, u32 tb_id); | ||
40 | * Called to delete IPv4 route from switch device. | ||
41 | */ | ||
42 | struct swdev_ops { | ||
43 | int (*swdev_parent_id_get)(struct net_device *dev, | ||
44 | struct netdev_phys_item_id *psid); | ||
45 | int (*swdev_port_stp_update)(struct net_device *dev, u8 state); | ||
46 | int (*swdev_fib_ipv4_add)(struct net_device *dev, __be32 dst, | ||
47 | int dst_len, struct fib_info *fi, | ||
48 | u8 tos, u8 type, u32 nlflags, | ||
49 | u32 tb_id); | ||
50 | int (*swdev_fib_ipv4_del)(struct net_device *dev, __be32 dst, | ||
51 | int dst_len, struct fib_info *fi, | ||
52 | u8 tos, u8 type, u32 tb_id); | ||
53 | }; | ||
54 | |||
17 | enum netdev_switch_notifier_type { | 55 | enum netdev_switch_notifier_type { |
18 | NETDEV_SWITCH_FDB_ADD = 1, | 56 | NETDEV_SWITCH_FDB_ADD = 1, |
19 | NETDEV_SWITCH_FDB_DEL, | 57 | NETDEV_SWITCH_FDB_DEL, |