aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2014-09-15 13:00:27 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-15 17:24:20 -0400
commitb4d2394d01bc642e95b2cba956d908423c1bef77 (patch)
tree348e36396eda758e021a8473b330c19cd571e76f /include/net/dsa.h
parent5075314e4e4b559cc37675ad8a721a89bccd6284 (diff)
dsa: Replace mii_bus with a generic host device
This change makes it so that instead of passing and storing a mii_bus we instead pass and store a host_dev. From there we can test to determine the exact type of device, and can verify it is the correct device for our switch. So for example it would be possible to pass a device pointer from a pci_dev and instead of checking for a PHY ID we could check for a vendor and/or device ID. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index a55c4e6a4f0f..c779e9bba1b3 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -34,7 +34,7 @@ struct dsa_chip_data {
34 /* 34 /*
35 * How to access the switch configuration registers. 35 * How to access the switch configuration registers.
36 */ 36 */
37 struct device *mii_bus; 37 struct device *host_dev;
38 int sw_addr; 38 int sw_addr;
39 39
40 /* Device tree node pointer for this specific switch chip 40 /* Device tree node pointer for this specific switch chip
@@ -134,9 +134,9 @@ struct dsa_switch {
134 struct dsa_switch_driver *drv; 134 struct dsa_switch_driver *drv;
135 135
136 /* 136 /*
137 * Reference to mii bus to use. 137 * Reference to host device to use.
138 */ 138 */
139 struct mii_bus *master_mii_bus; 139 struct device *master_dev;
140 140
141 /* 141 /*
142 * Slave mii_bus and devices for the individual ports. 142 * Slave mii_bus and devices for the individual ports.
@@ -178,7 +178,7 @@ struct dsa_switch_driver {
178 /* 178 /*
179 * Probing and setup. 179 * Probing and setup.
180 */ 180 */
181 char *(*probe)(struct mii_bus *bus, int sw_addr); 181 char *(*probe)(struct device *host_dev, int sw_addr);
182 int (*setup)(struct dsa_switch *ds); 182 int (*setup)(struct dsa_switch *ds);
183 int (*set_addr)(struct dsa_switch *ds, u8 *addr); 183 int (*set_addr)(struct dsa_switch *ds, u8 *addr);
184 184
@@ -213,6 +213,7 @@ struct dsa_switch_driver {
213 213
214void register_switch_driver(struct dsa_switch_driver *type); 214void register_switch_driver(struct dsa_switch_driver *type);
215void unregister_switch_driver(struct dsa_switch_driver *type); 215void unregister_switch_driver(struct dsa_switch_driver *type);
216struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
216 217
217static inline void *ds_to_priv(struct dsa_switch *ds) 218static inline void *ds_to_priv(struct dsa_switch *ds)
218{ 219{