summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2007-11-16 16:39:27 +0000
committerjkim <jkim@FreeBSD.org>2007-11-16 16:39:27 +0000
commita13649155f0db147a5837bf75569500eee2fade1 (patch)
tree407ac9f9b89d58a0bea8eb1a602235269c444168 /sys
parent8c5faca0dcd1324f05dc9dae4fd2f16203aa63f8 (diff)
downloadFreeBSD-src-a13649155f0db147a5837bf75569500eee2fade1.zip
FreeBSD-src-a13649155f0db147a5837bf75569500eee2fade1.tar.gz
Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.
The register layout is little different from memory-mapped stats in the previous generation chips. In fact, it is bad because registers in this range are cleared after reading them. Reviewed by: scottl MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/bge/if_bge.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index a662cf0..ab84a5f 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -4295,6 +4295,9 @@ bge_add_sysctls(struct bge_softc *sc)
#endif
+ if (BGE_IS_5705_PLUS(sc))
+ return;
+
tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", CTLFLAG_RD,
NULL, "BGE Statistics");
schildren = children = SYSCTL_CHILDREN(tree);
@@ -4417,16 +4420,12 @@ bge_sysctl_stats(SYSCTL_HANDLER_ARGS)
{
struct bge_softc *sc;
uint32_t result;
- int base, offset;
+ int offset;
sc = (struct bge_softc *)arg1;
offset = arg2;
- if (BGE_IS_5705_PLUS(sc))
- base = BGE_MAC_STATS;
- else
- base = BGE_MEMWIN_START + BGE_STATS_BLOCK;
- result = CSR_READ_4(sc, base + offset + offsetof(bge_hostaddr,
- bge_addr_lo));
+ result = CSR_READ_4(sc, BGE_MEMWIN_START + BGE_STATS_BLOCK + offset +
+ offsetof(bge_hostaddr, bge_addr_lo));
return (sysctl_handle_int(oidp, &result, 0, req));
}
OpenPOWER on IntegriCloud