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
This commit is contained in:
Jung-uk Kim 2007-11-16 16:39:27 +00:00
parent cbb1d39de7
commit d949071d71
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173675

View File

@ -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));
}