Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 May 2017 03:48:43 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318690 - head/sys/dev/etherswitch/arswitch
Message-ID:  <201705230348.v4N3mhN1073158@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Tue May 23 03:48:42 2017
New Revision: 318690
URL: https://svnweb.freebsd.org/changeset/base/318690

Log:
  [arswitch] add phy debugging to the internal PHY read/write functions.

Modified:
  head/sys/dev/etherswitch/arswitch/arswitch_phy.c

Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitch_phy.c	Tue May 23 00:13:27 2017	(r318689)
+++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c	Tue May 23 03:48:42 2017	(r318690)
@@ -151,10 +151,20 @@ arswitch_readphy_internal(device_t dev, 
 	data = arswitch_readreg_lsb(dev, a) &
 	    AR8X16_MDIO_CTRL_DATA_MASK;
 	ARSWITCH_UNLOCK(sc);
+
+	DPRINTF(sc, ARSWITCH_DBG_PHYIO,
+	    "%s: phy=0x%08x, reg=0x%08x, ret=0x%08x\n",
+	    __func__, phy, reg, data);
+
 	return (data);
 
 fail:
 	ARSWITCH_UNLOCK(sc);
+
+	DPRINTF(sc, ARSWITCH_DBG_PHYIO,
+	    "%s: phy=0x%08x, reg=0x%08x, fail; err=%d\n",
+	    __func__, phy, reg, err);
+
 	return (-1);
 }
 
@@ -194,6 +204,11 @@ arswitch_writephy_internal(device_t dev,
 	}
 	if (timeout < 0)
 		err = EIO;
+
+	DPRINTF(sc, ARSWITCH_DBG_PHYIO,
+	    "%s: phy=0x%08x, reg=0x%08x, data=0x%08x, err=%d\n",
+	    __func__, phy, reg, data, err);
+
 out:
 	DEVERR(dev, err, "arswitch_writephy()=%d: phy=%d.%02x\n", phy, reg);
 	ARSWITCH_UNLOCK(sc);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705230348.v4N3mhN1073158>