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.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 0f9f6f38f255..7bc7bd9b5ded 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -130,6 +130,12 @@ struct dsa_switch {
130 int index; 130 int index;
131 131
132 /* 132 /*
133 * Give the switch driver somewhere to hang its private data
134 * structure.
135 */
136 void *priv;
137
138 /*
133 * Tagging protocol understood by this switch 139 * Tagging protocol understood by this switch
134 */ 140 */
135 enum dsa_tag_protocol tag_protocol; 141 enum dsa_tag_protocol tag_protocol;
@@ -213,7 +219,7 @@ struct dsa_switch_driver {
213 * Probing and setup. 219 * Probing and setup.
214 */ 220 */
215 char *(*probe)(struct device *dsa_dev, struct device *host_dev, 221 char *(*probe)(struct device *dsa_dev, struct device *host_dev,
216 int sw_addr); 222 int sw_addr, void **priv);
217 int (*setup)(struct dsa_switch *ds); 223 int (*setup)(struct dsa_switch *ds);
218 int (*set_addr)(struct dsa_switch *ds, u8 *addr); 224 int (*set_addr)(struct dsa_switch *ds, u8 *addr);
219 u32 (*get_phy_flags)(struct dsa_switch *ds, int port); 225 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
@@ -342,7 +348,7 @@ struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
342 348
343static inline void *ds_to_priv(struct dsa_switch *ds) 349static inline void *ds_to_priv(struct dsa_switch *ds)
344{ 350{
345 return (void *)(ds + 1); 351 return ds->priv;
346} 352}
347 353
348static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst) 354static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)