summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-06-12 04:30:42 +0000
committerimp <imp@FreeBSD.org>2006-06-12 04:30:42 +0000
commit44b1052f6867f54d64d089ade81611219a15210b (patch)
tree9cc81672cc2b756e98692a7df9119edf2398f816
parent038d1db25e8295b3ba31b6a2800fef9fc23e23e7 (diff)
downloadFreeBSD-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.
-rw-r--r--sys/dev/ed/if_ed.c21
-rw-r--r--sys/dev/ed/if_ed_novell.c6
-rw-r--r--sys/dev/ed/if_edvar.h2
3 files changed, 26 insertions, 3 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
diff --git a/sys/dev/ed/if_ed_novell.c b/sys/dev/ed/if_ed_novell.c
index 52d7730..90f2068 100644
--- a/sys/dev/ed/if_ed_novell.c
+++ b/sys/dev/ed/if_ed_novell.c
@@ -289,8 +289,10 @@ ed_Novell_read_mac(struct ed_softc *sc)
uint8_t romdata[16];
/*
- * Pull the MAC address out of the roms that are on the isa
- * version of these cards.
+ * Most ne1000/ne2000 compatible cards have their MAC address
+ * located in the first few words of the address space. This seems
+ * universally true for ISA and PCI implementations, but PC Card
+ * devices seem to have more variance.
*/
ed_pio_readmem(sc, 0, romdata, 16);
for (n = 0; n < ETHER_ADDR_LEN; n++)
diff --git a/sys/dev/ed/if_edvar.h b/sys/dev/ed/if_edvar.h
index d7d3a8e..170558e 100644
--- a/sys/dev/ed/if_edvar.h
+++ b/sys/dev/ed/if_edvar.h
@@ -106,6 +106,8 @@ struct ed_softc {
u_char rec_page_start; /* first page of RX ring-buffer */
u_char rec_page_stop; /* last page of RX ring-buffer */
u_char next_packet; /* pointer to next unread RX packet */
+ u_int tx_mem; /* Total amount of RAM for tx */
+ u_int rx_mem; /* Total amount of RAM for rx */
struct ifmib_iso_8802_3 mibdata; /* stuff for network mgmt */
};
OpenPOWER on IntegriCloud