aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-09-24 20:05:18 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-28 17:14:08 -0400
commitb2f2af21e37f6d12bd735c27da8942331aa9b3d7 (patch)
tree7273e1535a2000d8fb2c651e0e058e39018504b2 /include/net
parentf7f1de51edbdd53b09061d12758cacd9901c363e (diff)
net: dsa: allow enabling and disable switch ports
Whenever a per-port network device is used/unused, invoke the switch driver port_enable/port_disable callbacks to allow saving as much power as possible by disabling unused parts of the switch (RX/TX logic, memory arrays, PHYs...). We supply a PHY device argument to make sure the switch driver can act on the PHY device if needed (like putting/taking the PHY out of deep low power mode). Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/dsa.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index d8054fb4a4df..4f664fe0e42c 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -224,6 +224,14 @@ struct dsa_switch_driver {
224 */ 224 */
225 int (*suspend)(struct dsa_switch *ds); 225 int (*suspend)(struct dsa_switch *ds);
226 int (*resume)(struct dsa_switch *ds); 226 int (*resume)(struct dsa_switch *ds);
227
228 /*
229 * Port enable/disable
230 */
231 int (*port_enable)(struct dsa_switch *ds, int port,
232 struct phy_device *phy);
233 void (*port_disable)(struct dsa_switch *ds, int port,
234 struct phy_device *phy);
227}; 235};
228 236
229void register_switch_driver(struct dsa_switch_driver *type); 237void register_switch_driver(struct dsa_switch_driver *type);