aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2006-06-12 04:30:42 +0000
committerWarner Losh <imp@FreeBSD.org>2006-06-12 04:30:42 +0000
commit4710853aac971ab3d28a56dd5cf8b492f0dcac9f (patch)
tree9cc81672cc2b756e98692a7df9119edf2398f816 /sys/dev
parent78878cef94e7d2a5f948881196616be46dc3eeac (diff)
Notes
Diffstat (limited to 'sys/dev')
-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 9b95e4fb8af5e..1e0ae77cc1180 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 52d77302c7c01..90f2068dc8f85 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 d7d3a8e0ae633..170558ead95ab 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 */
};