net: phylink: in-band pause mode advertisement update for PCS

Re-code the pause in-band advertisement update in light of the addition
of PCS support, so that we perform the minimum required; only the PCS
configuration function needs to be called in this case, followed by the
request to trigger a restart of negotiation if the programmed
advertisement changed.

We need to change the pcs_config() signature to pass whether resolved
pause should be passed to the MAC for setups such as mvneta and mvpp2
where doing so overrides the MAC manual flow controls.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Russell King
2020-07-21 12:04:36 +01:00
committed by David S. Miller
parent 1e1bf14a89
commit 1571e700fd
2 changed files with 56 additions and 6 deletions

View File

@@ -286,7 +286,8 @@ struct phylink_pcs_ops {
struct phylink_link_state *state);
int (*pcs_config)(struct phylink_config *config, unsigned int mode,
phy_interface_t interface,
const unsigned long *advertising);
const unsigned long *advertising,
bool permit_pause_to_mac);
void (*pcs_an_restart)(struct phylink_config *config);
void (*pcs_link_up)(struct phylink_config *config, unsigned int mode,
phy_interface_t interface, int speed, int duplex);
@@ -317,9 +318,11 @@ void pcs_get_state(struct phylink_config *config,
* @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
* @interface: interface mode to be used
* @advertising: adertisement ethtool link mode mask
* @permit_pause_to_mac: permit forwarding pause resolution to MAC
*
* Configure the PCS for the operating mode, the interface mode, and set
* the advertisement mask.
* the advertisement mask. @permit_pause_to_mac indicates whether the
* hardware may forward the pause mode resolution to the MAC.
*
* When operating in %MLO_AN_INBAND, inband should always be enabled,
* otherwise inband should be disabled.