summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index d29feccaefab..6cb602dd970c 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -321,12 +321,14 @@ static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port)
321typedef int dsa_fdb_dump_cb_t(const unsigned char *addr, u16 vid, 321typedef int dsa_fdb_dump_cb_t(const unsigned char *addr, u16 vid,
322 bool is_static, void *data); 322 bool is_static, void *data);
323struct dsa_switch_ops { 323struct dsa_switch_ops {
324#if IS_ENABLED(CONFIG_NET_DSA_LEGACY)
324 /* 325 /*
325 * Legacy probing. 326 * Legacy probing.
326 */ 327 */
327 const char *(*probe)(struct device *dsa_dev, 328 const char *(*probe)(struct device *dsa_dev,
328 struct device *host_dev, int sw_addr, 329 struct device *host_dev, int sw_addr,
329 void **priv); 330 void **priv);
331#endif
330 332
331 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds, 333 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
332 int port); 334 int port);
@@ -474,11 +476,20 @@ struct dsa_switch_driver {
474 const struct dsa_switch_ops *ops; 476 const struct dsa_switch_ops *ops;
475}; 477};
476 478
479#if IS_ENABLED(CONFIG_NET_DSA_LEGACY)
477/* Legacy driver registration */ 480/* Legacy driver registration */
478void register_switch_driver(struct dsa_switch_driver *type); 481void register_switch_driver(struct dsa_switch_driver *type);
479void unregister_switch_driver(struct dsa_switch_driver *type); 482void unregister_switch_driver(struct dsa_switch_driver *type);
480struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev); 483struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
481 484
485#else
486static inline void register_switch_driver(struct dsa_switch_driver *type) { }
487static inline void unregister_switch_driver(struct dsa_switch_driver *type) { }
488static inline struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev)
489{
490 return NULL;
491}
492#endif
482struct net_device *dsa_dev_to_net_device(struct device *dev); 493struct net_device *dsa_dev_to_net_device(struct device *dev);
483 494
484/* Keep inline for faster access in hot path */ 495/* Keep inline for faster access in hot path */