netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>,
	Russell King - ARM Linux <linux@armlinux.org.uk>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next 3/4] net: phy: marvell10g: use genphy_c45_an_config_an
Date: Sat, 16 Feb 2019 20:52:33 +0100	[thread overview]
Message-ID: <2ad2dd35-45f5-9720-d2ae-0ee104a7d782@gmail.com> (raw)
In-Reply-To: <0423e795-0215-053f-57ff-386242a6d7ce@gmail.com>

From: Andrew Lunn <andrew@lunn.ch>
Use new function genphy_c45_config_aneg() in mv3310_config_aneg().

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[hkallweit1@gmail.com: patch splitted]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/marvell10g.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 4a6ae63ab..03fa50087 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -274,13 +274,7 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	if (phydev->autoneg == AUTONEG_DISABLE)
 		return genphy_c45_pma_setup_forced(phydev);
 
-	linkmode_and(phydev->advertising, phydev->advertising,
-		     phydev->supported);
-
-	ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
-			     ADVERTISE_ALL | ADVERTISE_100BASE4 |
-			     ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM,
-			     linkmode_adv_to_mii_adv_t(phydev->advertising));
+	ret = genphy_c45_an_config_an(phydev);
 	if (ret < 0)
 		return ret;
 	if (ret > 0)
@@ -294,20 +288,6 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	if (ret > 0)
 		changed = true;
 
-	/* 10G control register */
-	if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
-			      phydev->advertising))
-		reg = MDIO_AN_10GBT_CTRL_ADV10G;
-	else
-		reg = 0;
-
-	ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
-				     MDIO_AN_10GBT_CTRL_ADV10G, reg);
-	if (ret < 0)
-		return ret;
-	if (ret > 0)
-		changed = true;
-
 	if (changed)
 		ret = genphy_c45_restart_aneg(phydev);
 
-- 
2.20.1



  parent reply	other threads:[~2019-02-16 19:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-16 19:49 [PATCH net-next 0/4] net: phy: add and use genphy_c45_an_config_an Heiner Kallweit
2019-02-16 19:50 ` [PATCH net-next 1/4] net: phy: add helper linkmode_adv_to_mii_10gbt_adv_t Heiner Kallweit
2019-02-17  2:38   ` Florian Fainelli
2019-02-16 19:51 ` [PATCH net-next 2/4] net: phy: add genphy_c45_an_config_an Heiner Kallweit
2019-02-17  2:44   ` Florian Fainelli
2019-02-17  4:18     ` Andrew Lunn
2019-02-17  8:14       ` Heiner Kallweit
2019-02-16 19:52 ` Heiner Kallweit [this message]
2019-02-17  2:47   ` [PATCH net-next 3/4] net: phy: marvell10g: use genphy_c45_an_config_an Florian Fainelli
2019-02-17  4:22     ` Andrew Lunn
2019-02-16 19:53 ` [PATCH net-next 4/4] net: phy: marvell10g: check for newly set aneg in mv3310_config_aneg Heiner Kallweit
2019-02-17  2:49   ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ad2dd35-45f5-9720-d2ae-0ee104a7d782@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).