소스 검색

[realtek] Add ability to dump all internal registers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 년 전
부모
커밋
87b59677ba
1개의 변경된 파일27개의 추가작업 그리고 0개의 파일을 삭제
  1. 27
    0
      src/drivers/net/realtek.c

+ 27
- 0
src/drivers/net/realtek.c 파일 보기

@@ -48,6 +48,33 @@ FILE_LICENCE ( GPL2_OR_LATER );
48 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 80
  * EEPROM interface

Loading…
취소
저장