Browse Source

[realtek] Add ability to dump all internal registers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
87b59677ba
1 changed files with 27 additions and 0 deletions
  1. 27
    0
      src/drivers/net/realtek.c

+ 27
- 0
src/drivers/net/realtek.c View File

48
  *    http://www.datasheetarchive.com/indexdl/Datasheet-028/DSA00494723.pdf
48
  *    http://www.datasheetarchive.com/indexdl/Datasheet-028/DSA00494723.pdf
49
  */
49
  */
50
 
50
 
51
+/******************************************************************************
52
+ *
53
+ * Debugging
54
+ *
55
+ ******************************************************************************
56
+ */
57
+
58
+/**
59
+ * Dump all registers (for debugging)
60
+ *
61
+ * @v rtl		Realtek device
62
+ */
63
+static __attribute__ (( unused )) void realtek_dump ( struct realtek_nic *rtl ){
64
+	uint8_t regs[256];
65
+	unsigned int i;
66
+
67
+	/* Do nothing unless debug output is enabled */
68
+	if ( ! DBG_LOG )
69
+		return;
70
+
71
+	/* Dump registers (via byte accesses; may not work for all registers) */
72
+	for ( i = 0 ; i < sizeof ( regs ) ; i++ )
73
+		regs[i] = readb ( rtl->regs + i );
74
+	DBGC ( rtl, "REALTEK %p register dump:\n", rtl );
75
+	DBGC_HDA ( rtl, 0, regs, sizeof ( regs ) );
76
+}
77
+
51
 /******************************************************************************
78
 /******************************************************************************
52
  *
79
  *
53
  * EEPROM interface
80
  * EEPROM interface

Loading…
Cancel
Save