svn commit: r318690 - head/sys/dev/etherswitch/arswitch

Adrian Chadd adrian at FreeBSD.org
Tue May 23 03:48:44 UTC 2017


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);


More information about the svn-src-all mailing list