* [PATCH] ethtool: Add register dump support for all r8169 driver cards
@ 2008-03-27 0:36 Andrew Paprocki
2008-09-14 2:12 ` Jeff Garzik
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Paprocki @ 2008-03-27 0:36 UTC (permalink / raw)
To: netdev; +Cc: Francois Romieu, Jeff Garzik
[-- Attachment #1: Type: text/plain, Size: 264 bytes --]
This adds all MAC versions currently found in the r8169 to the RealTek
table and modifies the dump logic to handle card versions >= RTL8169
instead of specifically looking at the few previously supported cards.
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
[-- Attachment #2: 0001-ethtool-Add-register-dump-support-for-all-r8169-driver-cards.txt --]
[-- Type: text/plain, Size: 8013 bytes --]
Subject: [PATCH] ethtool: Add register dump support for all r8169 driver cards
This adds all MAC versions currently found in the r8169 to the RealTek
table and modifies the dump logic to handle card versions >= RTL8169
instead of specifically looking at the few previously supported cards.
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
---
realtek.c | 110 +++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 64 insertions(+), 46 deletions(-)
diff --git a/realtek.c b/realtek.c
index c56b3f5..11ed835 100644
--- a/realtek.c
+++ b/realtek.c
@@ -5,8 +5,9 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#define HW_REVID(b30, b29, b28, b27, b26, b23, b22) \
- (b30<<30 | b29<<29 | b28<<28 | b27<<27 | b26<<26 | b23<<23 | b22<<22)
+#define HW_REVID(b31, b30, b29, b28, b27, b26, b23, b22) \
+ (b31<<31 | b30<<30 | b29<<29 | b28<<28 | \
+ b27<<27 | b26<<26 | b23<<23 | b22<<22)
enum chip_type {
RTLNONE,
@@ -22,34 +23,48 @@ enum chip_type {
RTL8139Cp,
RTL8101,
RTL8169,
- RTL8169s,
- RTL8110
+ RTL8169S,
+ RTL8110S,
+ RTL8169_8110SB,
+ RTL8169_8110SCd,
+ RTL8169_8110SCe,
+ RTL8168_8111Bb,
+ RTL8168_8111Bef,
+ RTL8101Ebc,
+ RTL8100E1,
+ RTL8100E2,
};
enum {
- chip_type_mask = HW_REVID(1, 1, 1, 1, 1, 1, 1)
+ chip_type_mask = HW_REVID(1, 1, 1, 1, 1, 1, 1, 1)
};
static struct chip_info {
const char *name;
u32 id_mask;
} rtl_info_tbl[] = {
- { "RTL-8139", HW_REVID(1, 0, 0, 0, 0, 0, 0) },
- { "RTL-8139-K", HW_REVID(1, 1, 0, 0, 0, 0, 0) },
- { "RTL-8139A", HW_REVID(1, 1, 1, 0, 0, 0, 0) },
- { "RTL-8139A-G", HW_REVID(1, 1, 1, 0, 0, 1, 0) },
- { "RTL-8139B", HW_REVID(1, 1, 1, 1, 0, 0, 0) },
- { "RTL-8130", HW_REVID(1, 1, 1, 1, 1, 0, 0) },
- { "RTL-8139C", HW_REVID(1, 1, 1, 0, 1, 0, 0) },
- { "RTL-8100", HW_REVID(1, 1, 1, 1, 0, 1, 0) },
- { "RTL-8100B/8139D", HW_REVID(1, 1, 1, 0, 1, 0, 1) },
- { "RTL-8139C+", HW_REVID(1, 1, 1, 0, 1, 1, 0) },
- { "RTL-8101", HW_REVID(1, 1, 1, 0, 1, 1, 1) },
- { "RTL-8168B/8111B", HW_REVID(0, 1, 1, 1, 0, 0, 0) },
- { "RTL-8101E", HW_REVID(0, 1, 1, 0, 1, 0, 0) },
- { "RTL-8169", HW_REVID(0, 0, 0, 0, 0, 0, 0) },
- { "RTL-8169s", HW_REVID(0, 0, 0, 0, 1, 0, 0) },
- { "RTL-8110", HW_REVID(0, 0, 1, 0, 0, 0, 0) },
+ { "RTL-8139", HW_REVID(0, 1, 0, 0, 0, 0, 0, 0) },
+ { "RTL-8139-K", HW_REVID(0, 1, 1, 0, 0, 0, 0, 0) },
+ { "RTL-8139A", HW_REVID(0, 1, 1, 1, 0, 0, 0, 0) },
+ { "RTL-8139A-G", HW_REVID(0, 1, 1, 1, 0, 0, 1, 0) },
+ { "RTL-8139B", HW_REVID(0, 1, 1, 1, 1, 0, 0, 0) },
+ { "RTL-8130", HW_REVID(0, 1, 1, 1, 1, 1, 0, 0) },
+ { "RTL-8139C", HW_REVID(0, 1, 1, 1, 0, 1, 0, 0) },
+ { "RTL-8100", HW_REVID(0, 1, 1, 1, 1, 0, 1, 0) },
+ { "RTL-8100B/8139D", HW_REVID(0, 1, 1, 1, 0, 1, 0, 1) },
+ { "RTL-8139C+", HW_REVID(0, 1, 1, 1, 0, 1, 1, 0) },
+ { "RTL-8101", HW_REVID(0, 1, 1, 1, 0, 1, 1, 1) },
+ { "RTL-8169", HW_REVID(0, 0, 0, 0, 0, 0, 0, 0) },
+ { "RTL-8169S", HW_REVID(0, 0, 0, 0, 0, 0, 1, 0) },
+ { "RTL-8110S", HW_REVID(0, 0, 0, 0, 0, 1, 0, 0) },
+ { "RTL-8169/8110SB", HW_REVID(0, 0, 0, 1, 0, 0, 0, 0) },
+ { "RTL-8169/8110SCd", HW_REVID(0, 0, 0, 1, 1, 0, 0, 0) },
+ { "RTL-8169/8110SCe", HW_REVID(1, 0, 0, 1, 1, 0, 0, 0) },
+ { "RTL-8168/8111Bb", HW_REVID(0, 0, 1, 1, 0, 0, 0, 0) },
+ { "RTL-8168/8111Bef", HW_REVID(0, 0, 1, 1, 1, 0, 0, 0) },
+ { "RTL-8101Ebc", HW_REVID(0, 0, 1, 1, 0, 1, 0, 0) },
+ { "RTL-8100E(1)", HW_REVID(0, 0, 1, 1, 0, 0, 1, 0) },
+ { "RTL-8100E(2)", HW_REVID(0, 0, 1, 1, 1, 0, 1, 0) },
{ }
};
@@ -89,7 +104,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
ci++;
}
if (v != ci->id_mask) {
- fprintf(stderr, "unknown RealTek chip\n");
+ fprintf(stderr, "Unknown RealTek chip (mask: 0x%08x)\n", v);
return 91;
}
for (i = 0; i < ARRAY_SIZE(rtl_info_tbl); i++) {
@@ -101,7 +116,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
fprintf(stdout,
"RealTek %s registers:\n"
- "------------------------------\n",
+ "--------------------------------------------------------\n",
ci->name);
fprintf(stdout,
@@ -118,10 +133,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
data[0x08 >> 2],
data[0x0c >> 2]);
- if (board_type == RTL8139Cp ||
- board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type == RTL8139Cp || board_type >= RTL8169) {
fprintf(stdout,
"0x10: Dump Tally Counter Command 0x%08x 0x%08x\n",
data[0x10 >> 2],
@@ -157,9 +169,8 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
data[0x2C >> 2]);
}
- if (board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type != RTL8168_8111Bb && board_type != RTL8168_8111Bef) {
+ if (board_type >= RTL8169) {
fprintf(stdout,
"0x30: Flash memory read/write 0x%08x\n",
data[0x30 >> 2]);
@@ -168,6 +179,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
"0x30: Rx buffer addr (C mode) 0x%08x\n",
data[0x30 >> 2]);
}
+ }
v = data8[0x36];
fprintf(stdout,
@@ -194,9 +206,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
v & (1 << 2) ? "on" : "off",
v & (1 << 4) ? ", RESET" : "");
- if (board_type != RTL8169 &&
- board_type != RTL8169s &&
- board_type != RTL8110) {
+ if (board_type < RTL8169) {
fprintf(stdout,
"0x38: Current Address of Packet Read (C mode) 0x%04x\n"
"0x3A: Current Rx buffer address (C mode) 0x%04x\n",
@@ -231,9 +241,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
data8[0x51],
data8[0x52]);
- if (board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type >= RTL8169) {
fprintf(stdout,
"0x53: Config 2 0x%02x\n"
"0x54: Config 3 0x%02x\n"
@@ -272,20 +280,21 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
"0x5C: Multiple Interrupt Select 0x%04x\n",
data[0x5c >> 2] & 0xffff);
- if (board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type >= RTL8169) {
+ fprintf(stdout,
+ "0x60: PHY access 0x%08x\n",
+ data[0x60 >> 2]);
+
+ if (board_type != RTL8168_8111Bb && board_type != RTL8168_8111Bef) {
fprintf(stdout,
- "0x60: PHY access 0x%08x\n"
"0x64: TBI control and status 0x%08x\n",
- data[0x60 >> 2],
data[0x64 >> 2]);
-
fprintf(stdout,
"0x68: TBI Autonegotiation advertisement (ANAR) 0x%04x\n"
"0x6A: TBI Link partner ability (LPAR) 0x%04x\n",
data[0x68 >> 2] & 0xffff,
data[0x68 >> 2] >> 16);
+ }
fprintf(stdout,
"0x6C: PHY status 0x%02x\n",
@@ -465,10 +474,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
}
}
- if (board_type == RTL8139Cp ||
- board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type == RTL8139Cp || board_type >= RTL8169) {
v = data[0xE0 >> 2] & 0xffff;
fprintf(stdout,
"0xE0: C+ Command 0x%04x\n",
@@ -512,6 +518,18 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
fprintf(stdout,
"0xFC: External MII register 0x%08x\n",
data[0xFC >> 2]);
+ } else if (board_type >= RTL8169 &&
+ board_type != RTL8168_8111Bb &&
+ board_type != RTL8168_8111Bef) {
+ fprintf(stdout,
+ "0xF0: Func Event 0x%08x\n"
+ "0xF4: Func Event Mask 0x%08x\n"
+ "0xF8: Func Preset State 0x%08x\n"
+ "0xFC: Func Force Event 0x%08x\n",
+ data[0xF0 >> 2],
+ data[0xF4 >> 2],
+ data[0xF8 >> 2],
+ data[0xFC >> 2]);
}
}
--
1.4.4.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH] ethtool: Add register dump support for all r8169 driver cards
@ 2008-03-26 12:19 Andrew Paprocki
2008-03-26 21:44 ` Francois Romieu
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Paprocki @ 2008-03-26 12:19 UTC (permalink / raw)
To: netdev; +Cc: Jeff Garzik
[-- Attachment #1: Type: text/plain, Size: 264 bytes --]
This adds all MAC versions currently found in the r8169 to the RealTek
table and modifies the dump logic to handle card versions >= RTL8169
instead of specifically looking at the few previously supported cards.
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
[-- Attachment #2: 0001-ethtool-Add-register-dump-support-for-all-r8169-driver-cards.txt --]
[-- Type: text/plain, Size: 7282 bytes --]
Subject: [PATCH] ethtool: Add register dump support for all r8169 driver cards
This adds all MAC versions currently found in the r8169 to the RealTek
table and modifies the dump logic to handle card versions >= RTL8169
instead of specifically looking at the few previously supported cards.
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
---
realtek.c | 98 ++++++++++++++++++++++++++++++++++--------------------------
1 files changed, 55 insertions(+), 43 deletions(-)
diff --git a/realtek.c b/realtek.c
index c56b3f5..7e750da 100644
--- a/realtek.c
+++ b/realtek.c
@@ -5,8 +5,9 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#define HW_REVID(b30, b29, b28, b27, b26, b23, b22) \
- (b30<<30 | b29<<29 | b28<<28 | b27<<27 | b26<<26 | b23<<23 | b22<<22)
+#define HW_REVID(b31, b30, b29, b28, b27, b26, b23, b22) \
+ (b31<<31 | b30<<30 | b29<<29 | b28<<28 | \
+ b27<<27 | b26<<26 | b23<<23 | b22<<22)
enum chip_type {
RTLNONE,
@@ -22,34 +23,48 @@ enum chip_type {
RTL8139Cp,
RTL8101,
RTL8169,
- RTL8169s,
- RTL8110
+ RTL8169S,
+ RTL8110S,
+ RTL8169_8110SB,
+ RTL8169_8110SCd,
+ RTL8169_8110SCe,
+ RTL8168_8111Bb,
+ RTL8168_8111Bef,
+ RTL8101Ebc,
+ RTL8100E1,
+ RTL8100E2,
};
enum {
- chip_type_mask = HW_REVID(1, 1, 1, 1, 1, 1, 1)
+ chip_type_mask = HW_REVID(1, 1, 1, 1, 1, 1, 1, 1)
};
static struct chip_info {
const char *name;
u32 id_mask;
} rtl_info_tbl[] = {
- { "RTL-8139", HW_REVID(1, 0, 0, 0, 0, 0, 0) },
- { "RTL-8139-K", HW_REVID(1, 1, 0, 0, 0, 0, 0) },
- { "RTL-8139A", HW_REVID(1, 1, 1, 0, 0, 0, 0) },
- { "RTL-8139A-G", HW_REVID(1, 1, 1, 0, 0, 1, 0) },
- { "RTL-8139B", HW_REVID(1, 1, 1, 1, 0, 0, 0) },
- { "RTL-8130", HW_REVID(1, 1, 1, 1, 1, 0, 0) },
- { "RTL-8139C", HW_REVID(1, 1, 1, 0, 1, 0, 0) },
- { "RTL-8100", HW_REVID(1, 1, 1, 1, 0, 1, 0) },
- { "RTL-8100B/8139D", HW_REVID(1, 1, 1, 0, 1, 0, 1) },
- { "RTL-8139C+", HW_REVID(1, 1, 1, 0, 1, 1, 0) },
- { "RTL-8101", HW_REVID(1, 1, 1, 0, 1, 1, 1) },
- { "RTL-8168B/8111B", HW_REVID(0, 1, 1, 1, 0, 0, 0) },
- { "RTL-8101E", HW_REVID(0, 1, 1, 0, 1, 0, 0) },
- { "RTL-8169", HW_REVID(0, 0, 0, 0, 0, 0, 0) },
- { "RTL-8169s", HW_REVID(0, 0, 0, 0, 1, 0, 0) },
- { "RTL-8110", HW_REVID(0, 0, 1, 0, 0, 0, 0) },
+ { "RTL-8139", HW_REVID(0, 1, 0, 0, 0, 0, 0, 0) },
+ { "RTL-8139-K", HW_REVID(0, 1, 1, 0, 0, 0, 0, 0) },
+ { "RTL-8139A", HW_REVID(0, 1, 1, 1, 0, 0, 0, 0) },
+ { "RTL-8139A-G", HW_REVID(0, 1, 1, 1, 0, 0, 1, 0) },
+ { "RTL-8139B", HW_REVID(0, 1, 1, 1, 1, 0, 0, 0) },
+ { "RTL-8130", HW_REVID(0, 1, 1, 1, 1, 1, 0, 0) },
+ { "RTL-8139C", HW_REVID(0, 1, 1, 1, 0, 1, 0, 0) },
+ { "RTL-8100", HW_REVID(0, 1, 1, 1, 1, 0, 1, 0) },
+ { "RTL-8100B/8139D", HW_REVID(0, 1, 1, 1, 0, 1, 0, 1) },
+ { "RTL-8139C+", HW_REVID(0, 1, 1, 1, 0, 1, 1, 0) },
+ { "RTL-8101", HW_REVID(0, 1, 1, 1, 0, 1, 1, 1) },
+ { "RTL-8169", HW_REVID(0, 0, 0, 0, 0, 0, 0, 0) },
+ { "RTL-8169S", HW_REVID(0, 0, 0, 0, 0, 0, 1, 0) },
+ { "RTL-8110S", HW_REVID(0, 0, 0, 0, 0, 1, 0, 0) },
+ { "RTL-8169/8110SB", HW_REVID(0, 0, 0, 1, 0, 0, 0, 0) },
+ { "RTL-8169/8110SCd", HW_REVID(0, 0, 0, 1, 1, 0, 0, 0) },
+ { "RTL-8169/8110SCe", HW_REVID(1, 0, 0, 1, 1, 0, 0, 0) },
+ { "RTL-8168/8111Bb", HW_REVID(0, 0, 1, 1, 0, 0, 0, 0) },
+ { "RTL-8168/8111Bef", HW_REVID(0, 0, 1, 1, 1, 0, 0, 0) },
+ { "RTL-8101Ebc", HW_REVID(0, 0, 1, 1, 0, 1, 0, 0) },
+ { "RTL-8100E(1)", HW_REVID(0, 0, 1, 1, 0, 0, 1, 0) },
+ { "RTL-8100E(2)", HW_REVID(0, 0, 1, 1, 1, 0, 1, 0) },
{ }
};
@@ -84,12 +99,13 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
ci = &rtl_info_tbl[0];
while (ci->name) {
+ fprintf(stderr, "Chip [0x%08x]: %s\n", ci->id_mask, ci->name);
if (v == ci->id_mask)
break;
ci++;
}
if (v != ci->id_mask) {
- fprintf(stderr, "unknown RealTek chip\n");
+ fprintf(stderr, "Unknown RealTek chip (mask: 0x%08x)\n", v);
return 91;
}
for (i = 0; i < ARRAY_SIZE(rtl_info_tbl); i++) {
@@ -101,7 +117,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
fprintf(stdout,
"RealTek %s registers:\n"
- "------------------------------\n",
+ "----------------------------------------------------------\n",
ci->name);
fprintf(stdout,
@@ -118,10 +134,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
data[0x08 >> 2],
data[0x0c >> 2]);
- if (board_type == RTL8139Cp ||
- board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type == RTL8139Cp || board_type >= RTL8169) {
fprintf(stdout,
"0x10: Dump Tally Counter Command 0x%08x 0x%08x\n",
data[0x10 >> 2],
@@ -157,9 +170,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
data[0x2C >> 2]);
}
- if (board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type >= RTL8169) {
fprintf(stdout,
"0x30: Flash memory read/write 0x%08x\n",
data[0x30 >> 2]);
@@ -194,9 +205,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
v & (1 << 2) ? "on" : "off",
v & (1 << 4) ? ", RESET" : "");
- if (board_type != RTL8169 &&
- board_type != RTL8169s &&
- board_type != RTL8110) {
+ if (board_type < RTL8169) {
fprintf(stdout,
"0x38: Current Address of Packet Read (C mode) 0x%04x\n"
"0x3A: Current Rx buffer address (C mode) 0x%04x\n",
@@ -231,9 +240,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
data8[0x51],
data8[0x52]);
- if (board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type >= RTL8169) {
fprintf(stdout,
"0x53: Config 2 0x%02x\n"
"0x54: Config 3 0x%02x\n"
@@ -272,9 +279,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
"0x5C: Multiple Interrupt Select 0x%04x\n",
data[0x5c >> 2] & 0xffff);
- if (board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type >= RTL8169) {
fprintf(stdout,
"0x60: PHY access 0x%08x\n"
"0x64: TBI control and status 0x%08x\n",
@@ -465,10 +470,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
}
}
- if (board_type == RTL8139Cp ||
- board_type == RTL8169 ||
- board_type == RTL8169s ||
- board_type == RTL8110) {
+ if (board_type == RTL8139Cp || board_type >= RTL8169) {
v = data[0xE0 >> 2] & 0xffff;
fprintf(stdout,
"0xE0: C+ Command 0x%04x\n",
@@ -512,6 +514,16 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
fprintf(stdout,
"0xFC: External MII register 0x%08x\n",
data[0xFC >> 2]);
+ } else if (board_type >= RTL8169) {
+ fprintf(stdout,
+ "0xF0: Func Event 0x%08x\n"
+ "0xF4: Func Event Mask 0x%08x\n"
+ "0xF8: Func Preset State 0x%08x\n"
+ "0xFC: Func Force Event 0x%08x\n",
+ data[0xF0 >> 2],
+ data[0xF4 >> 2],
+ data[0xF8 >> 2],
+ data[0xFC >> 2]);
}
}
--
1.4.4.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] ethtool: Add register dump support for all r8169 driver cards
2008-03-26 12:19 Andrew Paprocki
@ 2008-03-26 21:44 ` Francois Romieu
2008-03-26 22:11 ` Andrew Paprocki
0 siblings, 1 reply; 7+ messages in thread
From: Francois Romieu @ 2008-03-26 21:44 UTC (permalink / raw)
To: Andrew Paprocki; +Cc: netdev, Jeff Garzik
Andrew Paprocki <andrew@ishiboo.com> :
[...]
> diff --git a/realtek.c b/realtek.c
> index c56b3f5..7e750da 100644
> --- a/realtek.c
> +++ b/realtek.c
[...]
> @@ -157,9 +170,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
> data[0x2C >> 2]);
> }
>
> - if (board_type == RTL8169 ||
> - board_type == RTL8169s ||
> - board_type == RTL8110) {
> + if (board_type >= RTL8169) {
> fprintf(stdout,
> "0x30: Flash memory read/write 0x%08x\n",
> data[0x30 >> 2]);
Please revert: this register is reserved in the 8168.
[...]
> @@ -272,9 +279,7 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
> "0x5C: Multiple Interrupt Select 0x%04x\n",
> data[0x5c >> 2] & 0xffff);
>
> - if (board_type == RTL8169 ||
> - board_type == RTL8169s ||
> - board_type == RTL8110) {
> + if (board_type >= RTL8169) {
> fprintf(stdout,
> "0x60: PHY access 0x%08x\n"
> "0x64: TBI control and status 0x%08x\n",
PHY access and PHY status are ok for the 8168. TBI and PM registers are not.
[...]
> @@ -512,6 +514,16 @@ realtek_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
> fprintf(stdout,
> "0xFC: External MII register 0x%08x\n",
> data[0xFC >> 2]);
> + } else if (board_type >= RTL8169) {
> + fprintf(stdout,
> + "0xF0: Func Event 0x%08x\n"
> + "0xF4: Func Event Mask 0x%08x\n"
> + "0xF8: Func Preset State 0x%08x\n"
> + "0xFC: Func Force Event 0x%08x\n",
> + data[0xF0 >> 2],
> + data[0xF4 >> 2],
> + data[0xF8 >> 2],
> + data[0xFC >> 2]);
The 8168 should not be included here.
--
Ueimor
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ethtool: Add register dump support for all r8169 driver cards
2008-03-26 21:44 ` Francois Romieu
@ 2008-03-26 22:11 ` Andrew Paprocki
2008-03-26 22:11 ` Francois Romieu
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Paprocki @ 2008-03-26 22:11 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, Jeff Garzik
On Wed, Mar 26, 2008 at 5:44 PM, Francois Romieu <romieu@fr.zoreil.com> wrote:
> Please revert: this register is reserved in the 8168.
>
> PHY access and PHY status are ok for the 8168. TBI and PM registers are not.
>
> The 8168 should not be included here.
I'll update this shortly and re-send again. Do you have 8168 docs
showing the differences between it and the 8169? I peeked at this code
because I'm trying to track down a 8110SC problem where the network
hangs (sender hangs on sk_stream_wait_memory). Any useful docs on
these chips would help. Thanks, -Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ethtool: Add register dump support for all r8169 driver cards
2008-03-26 22:11 ` Andrew Paprocki
@ 2008-03-26 22:11 ` Francois Romieu
2008-03-27 0:11 ` Andrew Paprocki
0 siblings, 1 reply; 7+ messages in thread
From: Francois Romieu @ 2008-03-26 22:11 UTC (permalink / raw)
To: Andrew Paprocki; +Cc: netdev, Jeff Garzik
Andrew Paprocki <andrew@ishiboo.com> :
[...]
> I'll update this shortly and re-send again. Do you have 8168 docs
> showing the differences between it and the 8169 ?
edward_hsu@realtek.com.tw may help.
> I peeked at this code because I'm trying to track down a 8110SC
> problem where the network hangs (sender hangs on sk_stream_wait_memory).
> Any useful docs on these chips would help.
I am not sure that the 8110/8169 documentation will be of much help but
you can still give it a try.
Can you elaborate on the kind of hang ? Which kernel do you use ?
--
Ueimor
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ethtool: Add register dump support for all r8169 driver cards
2008-03-26 22:11 ` Francois Romieu
@ 2008-03-27 0:11 ` Andrew Paprocki
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Paprocki @ 2008-03-27 0:11 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, Jeff Garzik
On Wed, Mar 26, 2008 at 6:11 PM, Francois Romieu <romieu@fr.zoreil.com> wrote:
> Can you elaborate on the kind of hang ? Which kernel do you use ?
Thanks for the contact, I'll give that a try. The hang I'm
experiencing is after performing a very simple test. I set up the
8110SC box to netcat /dev/zero to the port of another machine which is
just running netcat and piping it to /dev/null. After anywhere from a
few minutes to an hour of this traffic, all network traffic
mysteriously hangs. SysRq dump shows netcat waiting inside
sk_stream_memory_free(). netstat on the interface shows the Send-Q is
really high, around 180000. If I ping other hosts, it lags for a long
time and comes back with ping times like 35,500ms. If I ifconfig eth0
down / up, everything goes back to normal and I can reproduce the
problem again by repeating the steps.
I've tried both the in-kernel driver as well as the Realtek 6.005.00
driver in 2.6.24.4 (I patched the Realtek driver to work with the API
changes) both with and without NAPI enabled. I've reproduced this
problem on more than one board, with different hosts acting as the
/dev/null sink and with different switches being used inbetween them
(1000mbit and 100mbit).
If you have any suggestions, I'm not sure where I should continue looking.
If it helps at all, this is the SysRq dump for the nc and ping
processes while the computer was in this state:
nc S 7fffffff 0 2131 659
cf3800a0 00000086 cf308880 7fffffff 00000000 cf255e60 c047db5e 0000000a
cf0024a0 00000010 00000020 00000004 00000286 c04377c3 cf308880 cf308880
7fffffff c043c97e 00000000 cf2a9050 c0228505 cec9ea38 cec9ea38 cc474860
Call Trace:
[<c047db5e>] schedule_timeout+0x13/0x97
[<c04377c3>] release_sock+0xc/0x74
[<c043c97e>] sk_stream_wait_memory+0x15e/0x176
[<c0228505>] autoremove_wake_function+0x0/0x35
[<c045a64b>] tcp_sendmsg+0x830/0x9fa
[<c021e438>] __do_softirq+0x35/0x75
[<c0435553>] sock_aio_write+0xbc/0xc8
[<c0253959>] pipe_read+0x330/0x33c
[<c024e569>] do_sync_write+0xc6/0x109
[<c0228505>] autoremove_wake_function+0x0/0x35
[<c026e19f>] inotify_inode_queue_event+0xc8/0xd0
[<c024ed00>] vfs_write+0x9e/0x111
[<c024f197>] sys_write+0x41/0x67
[<c0203b4e>] syscall_call+0x7/0xb
=======================
ping S 7fffffff 0 7005 599
cf380220 00000082 00000000 7fffffff cc45fd84 cc45fd70 c047db5e bfe5a571
cc45ff44 c046a7ba 00000000 00000000 cc45fda8 00000202 00000000 00000000
cf0df040 c043c664 00000000 7fffffff 00000001 cf2a9ab0 c0228505 cec9e4b8
Call Trace:
[<c047db5e>] schedule_timeout+0x13/0x97
[<c046a7ba>] raw_sendmsg+0x5bd/0x673
[<c043c664>] skb_recv_datagram+0x118/0x194
[<c0228505>] autoremove_wake_function+0x0/0x35
[<c046a034>] raw_recvmsg+0x71/0x143
[<c0437271>] sock_common_recvmsg+0x3e/0x54
[<c0435d2a>] sock_recvmsg+0xce/0xe7
[<c0435dfe>] sock_sendmsg+0xbb/0xd3
[<c0228505>] autoremove_wake_function+0x0/0x35
[<c043692c>] sys_recvfrom+0xd8/0x12d
[<c0391c91>] rtl8169_rx_interrupt+0x378/0x405
[<c022c877>] getnstimeofday+0x2b/0xac
[<c022a6eb>] enqueue_hrtimer+0xd7/0xe2
[<c0436e37>] sys_socketcall+0x1b0/0x242
[<c0203b4e>] syscall_call+0x7/0xb
Thanks,
-Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-09-14 2:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-27 0:36 [PATCH] ethtool: Add register dump support for all r8169 driver cards Andrew Paprocki
2008-09-14 2:12 ` Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2008-03-26 12:19 Andrew Paprocki
2008-03-26 21:44 ` Francois Romieu
2008-03-26 22:11 ` Andrew Paprocki
2008-03-26 22:11 ` Francois Romieu
2008-03-27 0:11 ` Andrew Paprocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).