aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 462e9741b210..fdbd6082945d 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -20,12 +20,14 @@
20#include <linux/of.h> 20#include <linux/of.h>
21#include <linux/ethtool.h> 21#include <linux/ethtool.h>
22#include <linux/net_tstamp.h> 22#include <linux/net_tstamp.h>
23#include <linux/phy.h>
23#include <net/devlink.h> 24#include <net/devlink.h>
24#include <net/switchdev.h> 25#include <net/switchdev.h>
25 26
26struct tc_action; 27struct tc_action;
27struct phy_device; 28struct phy_device;
28struct fixed_phy_status; 29struct fixed_phy_status;
30struct phylink_link_state;
29 31
30enum dsa_tag_protocol { 32enum dsa_tag_protocol {
31 DSA_TAG_PROTO_NONE = 0, 33 DSA_TAG_PROTO_NONE = 0,
@@ -199,6 +201,7 @@ struct dsa_port {
199 u8 stp_state; 201 u8 stp_state;
200 struct net_device *bridge_dev; 202 struct net_device *bridge_dev;
201 struct devlink_port devlink_port; 203 struct devlink_port devlink_port;
204 struct phylink *pl;
202 /* 205 /*
203 * Original copy of the master netdev ethtool_ops 206 * Original copy of the master netdev ethtool_ops
204 */ 207 */
@@ -354,6 +357,27 @@ struct dsa_switch_ops {
354 struct fixed_phy_status *st); 357 struct fixed_phy_status *st);
355 358
356 /* 359 /*
360 * PHYLINK integration
361 */
362 void (*phylink_validate)(struct dsa_switch *ds, int port,
363 unsigned long *supported,
364 struct phylink_link_state *state);
365 int (*phylink_mac_link_state)(struct dsa_switch *ds, int port,
366 struct phylink_link_state *state);
367 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
368 unsigned int mode,
369 const struct phylink_link_state *state);
370 void (*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
371 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
372 unsigned int mode,
373 phy_interface_t interface);
374 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
375 unsigned int mode,
376 phy_interface_t interface,
377 struct phy_device *phydev);
378 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
379 struct phylink_link_state *state);
380 /*
357 * ethtool hardware statistics. 381 * ethtool hardware statistics.
358 */ 382 */
359 void (*get_strings)(struct dsa_switch *ds, int port, 383 void (*get_strings)(struct dsa_switch *ds, int port,
@@ -595,5 +619,6 @@ static inline int call_dsa_notifiers(unsigned long val, struct net_device *dev,
595int dsa_port_get_phy_strings(struct dsa_port *dp, uint8_t *data); 619int dsa_port_get_phy_strings(struct dsa_port *dp, uint8_t *data);
596int dsa_port_get_ethtool_phy_stats(struct dsa_port *dp, uint64_t *data); 620int dsa_port_get_ethtool_phy_stats(struct dsa_port *dp, uint64_t *data);
597int dsa_port_get_phy_sset_count(struct dsa_port *dp); 621int dsa_port_get_phy_sset_count(struct dsa_port *dp);
622void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);
598 623
599#endif 624#endif