Skip to content

Commit

Permalink
amd-xgbe-phy: Print out the auto-negotiation method used
Browse files Browse the repository at this point in the history
Add a netdev_info statement detailing whether auto-negotiation was
completed through parallel detection or through the auto-negotiation
protocol.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lendacky, Thomas authored and David S. Miller committed Jul 31, 2014
1 parent 5c10e5c commit b668a3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/phy/amd-xgbe-phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ static void amd_xgbe_an_state_machine(struct work_struct *work)
struct phy_device *phydev = priv->phydev;
enum amd_xgbe_phy_an cur_state;
int sleep;
unsigned int an_supported = 0;

while (1) {
mutex_lock(&priv->an_mutex);
Expand All @@ -866,6 +867,7 @@ static void amd_xgbe_an_state_machine(struct work_struct *work)
switch (priv->an_state) {
case AMD_XGBE_AN_START:
priv->an_state = amd_xgbe_an_start(phydev);
an_supported = 0;
break;

case AMD_XGBE_AN_EVENT:
Expand All @@ -874,13 +876,19 @@ static void amd_xgbe_an_state_machine(struct work_struct *work)

case AMD_XGBE_AN_PAGE_RECEIVED:
priv->an_state = amd_xgbe_an_page_received(phydev);
an_supported++;
break;

case AMD_XGBE_AN_INCOMPAT_LINK:
priv->an_state = amd_xgbe_an_incompat_link(phydev);
break;

case AMD_XGBE_AN_COMPLETE:
netdev_info(phydev->attached_dev, "%s successful\n",
an_supported ? "Auto negotiation"
: "Parallel detection");
/* fall through */

case AMD_XGBE_AN_NO_LINK:
case AMD_XGBE_AN_EXIT:
goto exit_unlock;
Expand Down

0 comments on commit b668a3a

Please sign in to comment.