mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-09 16:12:21 +00:00
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>
This commit is contained in:
parent
f7f1de51ed
commit
b2f2af21e3
2 changed files with 22 additions and 0 deletions
|
@ -224,6 +224,14 @@ struct dsa_switch_driver {
|
|||
*/
|
||||
int (*suspend)(struct dsa_switch *ds);
|
||||
int (*resume)(struct dsa_switch *ds);
|
||||
|
||||
/*
|
||||
* Port enable/disable
|
||||
*/
|
||||
int (*port_enable)(struct dsa_switch *ds, int port,
|
||||
struct phy_device *phy);
|
||||
void (*port_disable)(struct dsa_switch *ds, int port,
|
||||
struct phy_device *phy);
|
||||
};
|
||||
|
||||
void register_switch_driver(struct dsa_switch_driver *type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue