net: phylink: add .pcs_link_down PCS OP
Subsystems (4)
RFC PATCH 1/1 net: phylink: add .pcs_link_down PCS OP
Permit for PCS driver to define specific operation to torn down the link between the MAC and the PCS.
This might be needed for some PCS that reset counter or require special reset to correctly work if the link needs to be restored later.
On phylink_link_down() call, the additional phylink_pcs_link_down() will be called before .mac_link_down to torn down the link.
PCS driver will need to define .pcs_link_down to make use of this.
--- drivers/net/phy/phylink.c | 8 ++++++++ include/linux/phylink.h | 2 ++ 2 files changed, 10 insertions(+)
drivers/net/phy/phylink.c +8 -0
@@ -927,6 +927,12 @@ static void phylink_pcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode, pcs->ops->pcs_link_up (pcs, neg_mode, interface, speed, duplex); } +static void phylink_pcs_link_down (struct phylink_pcs *pcs) +{ +if (pcs && pcs->ops->pcs_link_down) + pcs->ops->pcs_link_down (pcs); +} +static void phylink_pcs_disable_eee (struct phylink_pcs *pcs) {if (pcs && pcs->ops->pcs_disable_eee)
@@ -1566,6 +1572,8 @@ static void phylink_link_down(struct phylink *pl)phylink_deactivate_lpi (pl); +phylink_pcs_link_down (pl->pcs); + pl->mac_ops->mac_link_down (pl->config, pl->act_link_an_mode, pl->cur_interface);phylink_info (pl,"Link is Down\n" );
include/linux/phylink.h +2 -0
@@ -484,6 +484,7 @@ struct phylink_pcs {* @pcs_an_restart: restart 802.3z BaseX autonegotiation. * @pcs_link_up: program the PCS for the resolved link configuration * (where necessary). +* @pcs_link_down: torn down link between MAC and PCS. * @pcs_disable_eee: optional notification to PCS that EEE has been disabled * at the MAC. * @pcs_enable_eee: optional notification to PCS that EEE will be enabled at
@@ -511,6 +512,7 @@ struct phylink_pcs_ops {void (*pcs_an_restart)(struct phylink_pcs *pcs);void (*pcs_link_up)(struct phylink_pcs *pcs,unsigned int neg_mode,phy_interface_t interface,int speed,int duplex); +void (*pcs_link_down)(struct phylink_pcs *pcs);void (*pcs_disable_eee)(struct phylink_pcs *pcs);void (*pcs_enable_eee)(struct phylink_pcs *pcs);int (*pcs_pre_init)(struct phylink_pcs *pcs);
Signature · 1 line
2.50.0
Russell King (Oracle)
maintainerQuoted 10 lines · Christian Marangi
Permit for PCS driver to define specific operation to torn down the link between the MAC and the PCS.
This might be needed for some PCS that reset counter or require special reset to correctly work if the link needs to be restored later.
On
phylink_link_down()call, the additionalphylink_pcs_link_down()will be called before .mac_link_down to torn down the link.PCS driver will need to define .pcs_link_down to make use of this.
I don't accept new stuff without a user. Please provide the user as well. Thanks.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!