diff options
author | imp <imp@FreeBSD.org> | 2006-06-12 04:30:42 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-06-12 04:30:42 +0000 |
commit | 44b1052f6867f54d64d089ade81611219a15210b (patch) | |
tree | 9cc81672cc2b756e98692a7df9119edf2398f816 /sys/dev/ed/if_ed.c | |
parent | 038d1db25e8295b3ba31b6a2800fef9fc23e23e7 (diff) | |
download | FreeBSD-src-44b1052f6867f54d64d089ade81611219a15210b.zip FreeBSD-src-44b1052f6867f54d64d089ade81611219a15210b.tar.gz |
MFp4:
o Implement a bunch of sysctl's to report the information
that's now always reported. Mvoe reporting of that info
to bootverbose, but maybe it can go away entirely.
dev.ed.X.type: string name
dev.ed.X.TxMem: amount of memory used for tx side of the card
dev.ed.X.RxMem: amount of memory used for rx side of the card
dev.ed.X.Mem: Total amount of mem on card.
o Better comments about where NE-2000 (and clones) gets their MAC
address from.
Diffstat (limited to 'sys/dev/ed/if_ed.c')
-rw-r--r-- | sys/dev/ed/if_ed.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 9b95e4fb..1e0ae77 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include <sys/mbuf.h> #include <sys/kernel.h> #include <sys/socket.h> +#include <sys/sysctl.h> #include <sys/syslog.h> #include <sys/bus.h> @@ -330,7 +331,25 @@ ed_attach(device_t dev) ether_ifattach(ifp, sc->enaddr); /* device attach does transition from UNCONFIGURED to IDLE state */ - if (bootverbose || 1) { + sc->tx_mem = sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE; + sc->rx_mem = (sc->rec_page_stop - sc->rec_page_start) * ED_PAGE_SIZE; + SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + 0, "type", CTLTYPE_STRING | CTLFLAG_RD, sc->type_str, 0, + "Type of chip in card"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + 1, "TxMem", CTLTYPE_STRING | CTLFLAG_RD, &sc->tx_mem, 0, + "Memory set aside for transmitting packets"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + 2, "RxMem", CTLTYPE_STRING | CTLFLAG_RD, &sc->rx_mem, 0, + "Memory set aside for receiving packets"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + 3, "Mem", CTLTYPE_STRING | CTLFLAG_RD, &sc->mem_size, 0, + "Total Card Memory"); + if (bootverbose) { if (sc->type_str && (*sc->type_str != 0)) device_printf(dev, "type %s ", sc->type_str); else |