summaryrefslogtreecommitdiffstats
path: root/src/drivers/net
diff options
context:
space:
mode:
authorMichael Brown2014-03-14 13:46:23 +0100
committerMichael Brown2014-03-20 13:36:14 +0100
commit87b59677ba4ae9f1bcb0f685eaa18bb756c48a19 (patch)
treecdf3c73718ce6f1746a25592ad7cfb8bdacc8895 /src/drivers/net
parent[efi] Disable SNP devices when running iPXE as the application (diff)
downloadipxe-87b59677ba4ae9f1bcb0f685eaa18bb756c48a19.tar.gz
ipxe-87b59677ba4ae9f1bcb0f685eaa18bb756c48a19.tar.xz
ipxe-87b59677ba4ae9f1bcb0f685eaa18bb756c48a19.zip
[realtek] Add ability to dump all internal registers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net')
-rw-r--r--src/drivers/net/realtek.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/drivers/net/realtek.c b/src/drivers/net/realtek.c
index 41f4ec23b..7c6f86895 100644
--- a/src/drivers/net/realtek.c
+++ b/src/drivers/net/realtek.c
@@ -50,6 +50,33 @@ FILE_LICENCE ( GPL2_OR_LATER );
/******************************************************************************
*
+ * Debugging
+ *
+ ******************************************************************************
+ */
+
+/**
+ * Dump all registers (for debugging)
+ *
+ * @v rtl Realtek device
+ */
+static __attribute__ (( unused )) void realtek_dump ( struct realtek_nic *rtl ){
+ uint8_t regs[256];
+ unsigned int i;
+
+ /* Do nothing unless debug output is enabled */
+ if ( ! DBG_LOG )
+ return;
+
+ /* Dump registers (via byte accesses; may not work for all registers) */
+ for ( i = 0 ; i < sizeof ( regs ) ; i++ )
+ regs[i] = readb ( rtl->regs + i );
+ DBGC ( rtl, "REALTEK %p register dump:\n", rtl );
+ DBGC_HDA ( rtl, 0, regs, sizeof ( regs ) );
+}
+
+/******************************************************************************
+ *
* EEPROM interface
*
******************************************************************************