diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2015-02-24 16:15:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-25 17:03:38 -0500 |
commit | b73adef67765b72f2a0d01ef15aff9d784dc85da (patch) | |
tree | 829c9c90cffe94d00a1a7ee568c9464fdcf0efae /net/dsa/dsa_priv.h | |
parent | d87d6f44d7c1254fd9560a5191659cb00882db56 (diff) |
net: dsa: integrate with SWITCHDEV for HW bridging
In order to support bridging offloads in DSA switch drivers, select
NET_SWITCHDEV to get access to the port_stp_update and parent_get_id
NDOs that we are required to implement.
To facilitate the integratation at the DSA driver level, we implement 3
types of operations:
- port_join_bridge
- port_leave_bridge
- port_stp_update
DSA will resolve which switch ports that are currently bridge port
members as some Switch hardware/drivers need to know about that to limit
the register programming to just the relevant registers (especially for
slow MDIO buses).
We also take care of setting the correct STP state when slave network
devices are brought up/down while being bridge members.
Finally, when a port is leaving the bridge, we make sure we set in
BR_STATE_FORWARDING state, otherwise the bridge layer would leave it
disabled as a result of having left the bridge.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa_priv.h')
-rw-r--r-- | net/dsa/dsa_priv.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index 7eb1a6acd46c..d5f1f9b862ea 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h | |||
@@ -45,6 +45,8 @@ struct dsa_slave_priv { | |||
45 | int old_link; | 45 | int old_link; |
46 | int old_pause; | 46 | int old_pause; |
47 | int old_duplex; | 47 | int old_duplex; |
48 | |||
49 | struct net_device *bridge_dev; | ||
48 | }; | 50 | }; |
49 | 51 | ||
50 | /* dsa.c */ | 52 | /* dsa.c */ |
@@ -57,6 +59,8 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent, | |||
57 | int port, char *name); | 59 | int port, char *name); |
58 | int dsa_slave_suspend(struct net_device *slave_dev); | 60 | int dsa_slave_suspend(struct net_device *slave_dev); |
59 | int dsa_slave_resume(struct net_device *slave_dev); | 61 | int dsa_slave_resume(struct net_device *slave_dev); |
62 | int dsa_slave_netdevice_event(struct notifier_block *unused, | ||
63 | unsigned long event, void *ptr); | ||
60 | 64 | ||
61 | /* tag_dsa.c */ | 65 | /* tag_dsa.c */ |
62 | extern const struct dsa_device_ops dsa_netdev_ops; | 66 | extern const struct dsa_device_ops dsa_netdev_ops; |