diff options
author | Michael Brown | 2014-03-04 17:30:06 +0100 |
---|---|---|
committer | Michael Brown | 2014-03-04 17:30:06 +0100 |
commit | ac5c2e851b14b153860c98eb01a5add982c91380 (patch) | |
tree | 7cf248d3eb006d546bcb38a6d3d4f1ba1f3f7de6 /src/drivers/net/realtek.c | |
parent | [bzimage] Report exact initrd length via bzImage header (diff) | |
download | ipxe-ac5c2e851b14b153860c98eb01a5add982c91380.tar.gz ipxe-ac5c2e851b14b153860c98eb01a5add982c91380.tar.xz ipxe-ac5c2e851b14b153860c98eb01a5add982c91380.zip |
[realtek] Include link status register details in debug messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/realtek.c')
-rw-r--r-- | src/drivers/net/realtek.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/drivers/net/realtek.c b/src/drivers/net/realtek.c index 867efbcd..1e2cbdf4 100644 --- a/src/drivers/net/realtek.c +++ b/src/drivers/net/realtek.c @@ -415,11 +415,35 @@ static void realtek_check_link ( struct net_device *netdev ) { if ( rtl->have_phy_regs ) { phystatus = readb ( rtl->regs + RTL_PHYSTATUS ); link_up = ( phystatus & RTL_PHYSTATUS_LINKSTS ); - DBGC ( rtl, "REALTEK %p PHY status is %02x\n", rtl, phystatus ); + DBGC ( rtl, "REALTEK %p PHY status is %02x (%s%s%s%s%s%s, " + "Link%s, %sDuplex)\n", rtl, phystatus, + ( ( phystatus & RTL_PHYSTATUS_ENTBI ) ? "TBI" : "GMII" ), + ( ( phystatus & RTL_PHYSTATUS_TXFLOW ) ? + ", TxFlow" : "" ), + ( ( phystatus & RTL_PHYSTATUS_RXFLOW ) ? + ", RxFlow" : "" ), + ( ( phystatus & RTL_PHYSTATUS_1000MF ) ? + ", 1000Mbps" : "" ), + ( ( phystatus & RTL_PHYSTATUS_100M ) ? + ", 100Mbps" : "" ), + ( ( phystatus & RTL_PHYSTATUS_10M ) ? + ", 10Mbps" : "" ), + ( ( phystatus & RTL_PHYSTATUS_LINKSTS ) ? + "Up" : "Down" ), + ( ( phystatus & RTL_PHYSTATUS_FULLDUP ) ? + "Full" : "Half" ) ); } else { msr = readb ( rtl->regs + RTL_MSR ); link_up = ( ! ( msr & RTL_MSR_LINKB ) ); - DBGC ( rtl, "REALTEK %p media status is %02x\n", rtl, msr ); + DBGC ( rtl, "REALTEK %p media status is %02x (Link%s, " + "%dMbps%s%s%s%s%s)\n", rtl, msr, + ( ( msr & RTL_MSR_LINKB ) ? "Down" : "Up" ), + ( ( msr & RTL_MSR_SPEED_10 ) ? 10 : 100 ), + ( ( msr & RTL_MSR_TXFCE ) ? ", TxFlow" : "" ), + ( ( msr & RTL_MSR_RXFCE ) ? ", RxFlow" : "" ), + ( ( msr & RTL_MSR_AUX_STATUS ) ? ", AuxPwr" : "" ), + ( ( msr & RTL_MSR_TXPF ) ? ", TxPause" : "" ), + ( ( msr & RTL_MSR_RXPF ) ? ", RxPause" : "" ) ); } /* Report link state */ |