Commit 95347842 authored by Russell King's avatar Russell King Committed by David S. Miller

net: axienet: use resolved link config in mac_link_up()

Convert the Xilinx AXI ethernet driver to use the finalised link
parameters in mac_link_up() rather than the parameters in mac_config().
Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30c4a5b0
...@@ -1440,6 +1440,22 @@ static void axienet_mac_an_restart(struct phylink_config *config) ...@@ -1440,6 +1440,22 @@ static void axienet_mac_an_restart(struct phylink_config *config)
static void axienet_mac_config(struct phylink_config *config, unsigned int mode, static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
const struct phylink_link_state *state) const struct phylink_link_state *state)
{
/* nothing meaningful to do */
}
static void axienet_mac_link_down(struct phylink_config *config,
unsigned int mode,
phy_interface_t interface)
{
/* nothing meaningful to do */
}
static void axienet_mac_link_up(struct phylink_config *config,
struct phy_device *phy,
unsigned int mode, phy_interface_t interface,
int speed, int duplex,
bool tx_pause, bool rx_pause)
{ {
struct net_device *ndev = to_net_dev(config->dev); struct net_device *ndev = to_net_dev(config->dev);
struct axienet_local *lp = netdev_priv(ndev); struct axienet_local *lp = netdev_priv(ndev);
...@@ -1448,7 +1464,7 @@ static void axienet_mac_config(struct phylink_config *config, unsigned int mode, ...@@ -1448,7 +1464,7 @@ static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
emmc_reg = axienet_ior(lp, XAE_EMMC_OFFSET); emmc_reg = axienet_ior(lp, XAE_EMMC_OFFSET);
emmc_reg &= ~XAE_EMMC_LINKSPEED_MASK; emmc_reg &= ~XAE_EMMC_LINKSPEED_MASK;
switch (state->speed) { switch (speed) {
case SPEED_1000: case SPEED_1000:
emmc_reg |= XAE_EMMC_LINKSPD_1000; emmc_reg |= XAE_EMMC_LINKSPD_1000;
break; break;
...@@ -1467,33 +1483,17 @@ static void axienet_mac_config(struct phylink_config *config, unsigned int mode, ...@@ -1467,33 +1483,17 @@ static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
axienet_iow(lp, XAE_EMMC_OFFSET, emmc_reg); axienet_iow(lp, XAE_EMMC_OFFSET, emmc_reg);
fcc_reg = axienet_ior(lp, XAE_FCC_OFFSET); fcc_reg = axienet_ior(lp, XAE_FCC_OFFSET);
if (state->pause & MLO_PAUSE_TX) if (tx_pause)
fcc_reg |= XAE_FCC_FCTX_MASK; fcc_reg |= XAE_FCC_FCTX_MASK;
else else
fcc_reg &= ~XAE_FCC_FCTX_MASK; fcc_reg &= ~XAE_FCC_FCTX_MASK;
if (state->pause & MLO_PAUSE_RX) if (rx_pause)
fcc_reg |= XAE_FCC_FCRX_MASK; fcc_reg |= XAE_FCC_FCRX_MASK;
else else
fcc_reg &= ~XAE_FCC_FCRX_MASK; fcc_reg &= ~XAE_FCC_FCRX_MASK;
axienet_iow(lp, XAE_FCC_OFFSET, fcc_reg); axienet_iow(lp, XAE_FCC_OFFSET, fcc_reg);
} }
static void axienet_mac_link_down(struct phylink_config *config,
unsigned int mode,
phy_interface_t interface)
{
/* nothing meaningful to do */
}
static void axienet_mac_link_up(struct phylink_config *config,
struct phy_device *phy,
unsigned int mode, phy_interface_t interface,
int speed, int duplex,
bool tx_pause, bool rx_pause)
{
/* nothing meaningful to do */
}
static const struct phylink_mac_ops axienet_phylink_ops = { static const struct phylink_mac_ops axienet_phylink_ops = {
.validate = axienet_validate, .validate = axienet_validate,
.mac_pcs_get_state = axienet_mac_pcs_get_state, .mac_pcs_get_state = axienet_mac_pcs_get_state,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment