summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-11-23 20:17:42 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2025-09-29 10:14:56 +0100
commit024df99d592211a33b69171b8d444b2d34b29b72 (patch)
tree3d518f6dae1da52b4943eacc5e113d32425108d3
parent72ebc9abe4552d0816ab5a738f5f06bcd9598039 (diff)
net: phylink: pass PHY interface mode into MAC LPI methods
Ass the PHY interface mode into mac_disable_tx_lpi() and mac_enable_tx_lpi() methods. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/phy/phylink.c5
-rw-r--r--include/linux/phylink.h15
2 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 575c5555d6ba..8c92168a3fdd 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1486,7 +1486,7 @@ static void phylink_deactivate_lpi(struct phylink *pl)
phylink_dbg(pl, "disabling LPI\n");
- pl->mac_ops->mac_disable_tx_lpi(pl->config);
+ pl->mac_ops->mac_disable_tx_lpi(pl->config, pl->cur_interface);
phylink_pcs_disable_eee(pl->pcs);
}
@@ -1507,7 +1507,8 @@ static void phylink_activate_lpi(struct phylink *pl)
phylink_pcs_enable_eee(pl->pcs);
- err = pl->mac_ops->mac_enable_tx_lpi(pl->config, pl->mac_tx_lpi_timer,
+ err = pl->mac_ops->mac_enable_tx_lpi(pl->config, pl->cur_interface,
+ pl->mac_tx_lpi_timer,
pl->mac_tx_clk_stop);
if (!err) {
pl->mac_enable_tx_lpi = true;
diff --git a/include/linux/phylink.h b/include/linux/phylink.h
index 30659b615fca..157f157b3fe6 100644
--- a/include/linux/phylink.h
+++ b/include/linux/phylink.h
@@ -208,8 +208,10 @@ struct phylink_mac_ops {
struct phy_device *phy, unsigned int mode,
phy_interface_t interface, int speed, int duplex,
bool tx_pause, bool rx_pause);
- void (*mac_disable_tx_lpi)(struct phylink_config *config);
- int (*mac_enable_tx_lpi)(struct phylink_config *config, u32 timer,
+ void (*mac_disable_tx_lpi)(struct phylink_config *config,
+ phy_interface_t interface);
+ int (*mac_enable_tx_lpi)(struct phylink_config *config,
+ phy_interface_t interface, u32 timer,
bool tx_clk_stop);
};
@@ -418,15 +420,18 @@ void mac_link_up(struct phylink_config *config, struct phy_device *phy,
/**
* mac_disable_tx_lpi() - disable LPI generation at the MAC
* @config: a pointer to a &struct phylink_config.
+ * @interface: current link &typedef phy_interface_t mode
*
* Disable generation of LPI at the MAC, effectively preventing the MAC
* from indicating that it is idle.
*/
-void mac_disable_tx_lpi(struct phylink_config *config);
+void mac_disable_tx_lpi(struct phylink_config *config,
+ phy_interface_t interface);
/**
* mac_enable_tx_lpi() - configure and enable LPI generation at the MAC
* @config: a pointer to a &struct phylink_config.
+ * @interface: current link &typedef phy_interface_t mode
* @timer: LPI timeout in microseconds.
* @tx_clk_stop: allow xMII transmit clock to be stopped during LPI
*
@@ -439,8 +444,8 @@ void mac_disable_tx_lpi(struct phylink_config *config);
*
* Returns: 0 on success. Please consult with rmk before returning an error.
*/
-int mac_enable_tx_lpi(struct phylink_config *config, u32 timer,
- bool tx_clk_stop);
+int mac_enable_tx_lpi(struct phylink_config *config, phy_interface_t interface,
+ u32 timer, bool tx_clk_stop);
#endif
struct phylink_pcs_ops;