summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1993-07-20 23:16:50 +0000
committerdg <dg@FreeBSD.org>1993-07-20 23:16:50 +0000
commit420c68008a0dfb309483480b10fa2643114de5e9 (patch)
tree262e9ce959b87a21625a50c2ac3fab8f5db36904 /sys/dev/ed
parent170ec22c9a8a1ae2071ac55773410e16098f41a4 (diff)
downloadFreeBSD-src-420c68008a0dfb309483480b10fa2643114de5e9.zip
FreeBSD-src-420c68008a0dfb309483480b10fa2643114de5e9.tar.gz
Added config file override for memory size and added flags to force
8bit or 16bit operation, and a flag to disable transmitter double buffering. See the updated "ed.relnotes" file for information about how to set the flags. This should be considered the first "production" release. It still needs a manual page, though.
Diffstat (limited to 'sys/dev/ed')
-rw-r--r--sys/dev/ed/if_ed.c55
-rw-r--r--sys/dev/ed/if_edreg.h18
2 files changed, 54 insertions, 19 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index a539d0d..b804b25 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -16,15 +16,19 @@
/*
* Modification history
*
- * $Log: if_ed.c,v $
- * Revision 1.6 1993/07/20 01:39:24 jkh
- * Fixed to allow iosiz config parameter to override what was (for me,
- * incorrectly) probed. This allows you more flexibility in getting weird
- * WD 80x3 clones to work.
- *
- * Revision 1.5 1993/06/27 10:28:28 davidg
- * fixed bugs in the probe routine uncovered by the previous fix.
- *
+ * $Log: if_ed.c,v $
+ * Revision 1.14 93/07/20 15:24:25 davidg
+ * ommision for force 16bit case fixed from last patch
+ *
+ * Revision 1.13 93/07/20 15:13:55 davidg
+ * Added config file override for memsize by using 'iosiz'. Also added
+ * config flags overrides to force 8/16bit mode and disable the use of
+ * double xmit buffers.
+ *
+ * Revision 1.12 93/07/07 06:27:44 davidg
+ * moved call to bpfattach to after this drivers attach printf -
+ * improves readability of startup messages.
+ *
* Revision 1.11 93/06/27 03:07:01 davidg
* fixed bugs in the 3Com part of the probe routine that were uncovered by
* the previous fix.
@@ -305,13 +309,24 @@ type_WD80x3:
}
#if ED_DEBUG
- printf("type=%s width=%d memsize=%d id_msize=%d\n",sc->type_str,memwidth,memsize,isa_dev->id_msize);
+ printf("type=%s memwidth=%d memsize=%d id_msize=%d\n",
+ sc->type_str,memwidth,memsize,isa_dev->id_msize);
for (i=0; i<8; i++)
printf("%x -> %x\n", i, inb(sc->asic_addr + i));
#endif
- /* Allow id_msize to override */
- if (isa_dev->id_msize)
+ /*
+ * Allow the user to override the autoconfiguration
+ */
+ if (isa_dev->id_msize)
memsize = isa_dev->id_msize;
+ /*
+ * (note that if the user specifies both of the following flags
+ * that '8bit' mode intentionally has precedence)
+ */
+ if (isa_dev->id_flags & ED_FLAGS_FORCE_16BIT_MODE)
+ memwidth = 16;
+ if (isa_dev->id_flags & ED_FLAGS_FORCE_8BIT_MODE)
+ memwidth = 8;
/*
* Check 83C584 interrupt configuration register if this board has one
@@ -344,7 +359,7 @@ type_WD80x3:
/*
* allocate one xmit buffer if < 16k, two buffers otherwise
*/
- if (memsize < 16384) {
+ if ((memsize < 16384) || (isa_dev->id_msize & ED_FLAGS_NO_DOUBLE_BUFFERING)) {
sc->smem_ring = sc->smem_start + (ED_PAGE_SIZE * ED_TXBUF_SIZE);
sc->txb_cnt = 1;
sc->rec_page_start = ED_TXBUF_SIZE;
@@ -634,7 +649,7 @@ type_3Com:
#if 0
printf("Starting write\n");
for (i = 0; i < 8192; ++i)
- bzerow(sc->smem_start, 8192);
+ bzero(sc->smem_start, 8192);
printf("Done.\n");
#endif
#if 0
@@ -710,10 +725,6 @@ ed_attach(isa_dev)
*/
if_attach(ifp);
-#if NBPFILTER > 0
- bpfattach(&sc->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
-
/*
* Search down the ifa address list looking for the AF_LINK type entry
*/
@@ -744,6 +755,14 @@ ed_attach(isa_dev)
ether_sprintf(sc->arpcom.ac_enaddr), sc->type_str,
sc->memwidth, ((sc->vendor == ED_VENDOR_3COM) &&
(ifp->if_flags & IFF_LLC0)) ? "tranceiver disabled" : "");
+
+ /*
+ * If BPF is in the kernel, call the attach for it
+ */
+#if NBPFILTER > 0
+ bpfattach(&sc->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
+#endif
+
}
/*
diff --git a/sys/dev/ed/if_edreg.h b/sys/dev/ed/if_edreg.h
index f44ea59..b9a76fa 100644
--- a/sys/dev/ed/if_edreg.h
+++ b/sys/dev/ed/if_edreg.h
@@ -2,6 +2,10 @@
* National Semiconductor DS8390 NIC register definitions
*
* $Log: if_edreg.h,v $
+ * Revision 1.3 93/07/20 15:25:25 davidg
+ * added config flags for forcing 8/16bit mode and disabling double
+ * xmit buffers.
+ *
* Revision 1.2 93/06/23 03:03:05 davidg
* added some additional definitions for the 83C584 bus interface
* chip (SMC/WD boards)
@@ -561,7 +565,19 @@ struct ed_ring {
/*
* this sets the default for enabling/disablng the tranceiver
*/
-#define ED_FLAGS_DISABLE_TRANCEIVER 0x01
+#define ED_FLAGS_DISABLE_TRANCEIVER 0x01
+
+/*
+ * This forces the board to be used in 8/16bit mode even if it
+ * autoconfigs differently
+ */
+#define ED_FLAGS_FORCE_8BIT_MODE 0x02
+#define ED_FLAGS_FORCE_16BIT_MODE 0x04
+
+/*
+ * This disables the use of double transmit buffers.
+ */
+#define ED_FLAGS_NO_DOUBLE_BUFFERING 0x08
/*
* Definitions for Western digital/SMC WD80x3 series ASIC
OpenPOWER on IntegriCloud