diff options
| author | cgd <cgd@NetBSD.org> | 1993-07-28 02:20:34 +0000 |
|---|---|---|
| committer | cgd <cgd@NetBSD.org> | 1993-07-28 02:20:34 +0000 |
| commit | 7b2afa7fe60c67207bcef15b1437087df15dcf87 (patch) | |
| tree | 981e19773e585ac7a43bfd299c11be8113943d1c /sys/dev | |
| parent | cbdb50c1c11d33748cd09151cabed2cf1e14b241 (diff) | |
incorporate changes from 0-9-base to 0-9-ALPHA
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ata/wd.c | 4 | ||||
| -rw-r--r-- | sys/dev/eisa/aha1742.c | 4 | ||||
| -rw-r--r-- | sys/dev/isa/if_ed.c | 126 | ||||
| -rw-r--r-- | sys/dev/isa/if_edreg.h | 25 | ||||
| -rw-r--r-- | sys/dev/isa/ultra14f.c | 4 | ||||
| -rw-r--r-- | sys/dev/isa/wd.c | 4 | ||||
| -rw-r--r-- | sys/dev/isa/wt.c | 6 | ||||
| -rw-r--r-- | sys/dev/scsipi/st.c | 4 |
8 files changed, 77 insertions, 100 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index 241b456ecb9..b70865ad26f 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.24 1993/07/08 08:22:17 deraadt Exp $ + * $Id: wd.c,v 1.25 1993/07/28 02:21:37 cgd Exp $ */ /* Note: This code heavily modified by tih@barsoom.nhh.no; use at own risk! */ @@ -75,7 +75,7 @@ #include "vm/vm.h" #ifndef WDCNDELAY -#define WDCNDELAY 200000 /* delay = 25us; so 5s for a controller state change */ +#define WDCNDELAY 400000 /* delay = 25us; so 10s for a controller state change */ #endif #define WDCDELAY 25 diff --git a/sys/dev/eisa/aha1742.c b/sys/dev/eisa/aha1742.c index 8212e4db92f..3c51832395c 100644 --- a/sys/dev/eisa/aha1742.c +++ b/sys/dev/eisa/aha1742.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: aha1742.c,v 1.13 1993/07/17 16:20:24 mycroft Exp $ + * $Id: aha1742.c,v 1.14 1993/07/28 02:21:11 cgd Exp $ */ #include "ahb.h" @@ -1016,12 +1016,10 @@ cheat = ecb; ahb_free_ecb(unit,ecb,flags); } xs->error = XS_DRIVER_STUFFUP; - splx(s); return(HAD_ERROR); } } while (!(xs->flags & ITSDONE)); - splx(s); scsi_debug = 0; ahb_debug = 0; if(xs->error) diff --git a/sys/dev/isa/if_ed.c b/sys/dev/isa/if_ed.c index 72ac95a05e9..37021d573dc 100644 --- a/sys/dev/isa/if_ed.c +++ b/sys/dev/isa/if_ed.c @@ -14,60 +14,7 @@ */ /* - * Modification history - * - * $Log: if_ed.c,v $ - * Revision 1.2 1993/07/12 13:13:41 deraadt - * moved bfdttach point to same place as other drivers, from greenman - * - * Revision 1.1 1993/07/03 12:19:45 cgd - * add support for David Greenman's "ed" driver. - * - * 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. - * - * Revision 1.10 93/06/25 19:23:19 davidg - * fixed bug that caused erroneous 'Invalid irq configuration' message when - * no board is present (during autoconfiguration). - * - * Revision 1.9 93/06/23 03:48:14 davidg - * fixed minor typo introduced when cleaning up probe routine - * - * Revision 1.8 93/06/23 03:37:19 davidg - * cleaned up/added some comments. Also improved readability of a part of - * the probe routine. - * - * Revision 1.7 93/06/22 04:45:01 davidg - * (no additional changes) Second beta release - * - * Revision 1.6 93/06/22 04:40:35 davidg - * minor definition fix to ed_reset() - * - * Revision 1.5 93/06/22 04:37:39 davidg - * fixed some comments - * - * Revision 1.4 93/06/22 04:34:34 davidg - * added support to use the LLC0 'link-level control' flag - * to disable the tranceiver for AUI operation on 3Com boards. - * The default for this flag can be set in the kernel config - * file - 'flags 0x01' sets the flag (disables the tranceiver). - * - * Revision 1.3 93/06/17 03:57:28 davidg - * fixed some printf's - * - * Revision 1.2 93/06/17 03:26:49 davidg - * fixed 3c503 code to determine 8/16bit board - * changed attach printf to work with Interim-0.1.5 and NetBSD - * - * Revision 1.1 93/06/14 22:21:24 davidg - * Beta release of device driver for SMC/WD80x3 and 3C503 ethernet boards. - * - * + * $Id: if_ed.c,v 1.3 1993/07/28 02:21:17 cgd Exp $ */ #include "ed.h" @@ -75,12 +22,13 @@ #include "bpfilter.h" #include "param.h" +#include "systm.h" +#include "select.h" #include "errno.h" #include "ioctl.h" #include "mbuf.h" #include "socket.h" #include "syslog.h" -#include "select.h" #include "net/if.h" #include "net/if_dl.h" @@ -308,11 +256,26 @@ type_WD80x3: } #if ED_DEBUG - printf("type=%s width=%d memsize=%d\n",sc->type_str,memwidth,memsize); + 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 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 * XXX - we could also check the IO address register. But why * bother...if we get past this, it *has* to be correct. @@ -343,7 +306,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; @@ -633,7 +596,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 @@ -789,10 +752,8 @@ ed_stop(unit) * to 'n' (about 5ms). It shouldn't even take 5us on modern * DS8390's, but just in case it's an old one. */ - while ((inb(sc->nic_addr + ED_P0_ISR) & ED_ISR_RST) == 0) { - if (--n == 0) - break; - } + while (((inb(sc->nic_addr + ED_P0_ISR) & ED_ISR_RST) == 0) && --n); + } /* @@ -941,10 +902,12 @@ ed_init(unit) * If this is a 3Com board, the tranceiver must be software enabled * (there is no settable hardware default). */ - if ((sc->vendor == ED_VENDOR_3COM) && (ifp->if_flags & IFF_LLC0)) { - outb(sc->asic_addr + ED_3COM_CR, 0); - } else { - outb(sc->asic_addr + ED_3COM_CR, ED_3COM_CR_XSEL); + if (sc->vendor == ED_VENDOR_3COM) { + if (ifp->if_flags & IFF_LLC0) { + outb(sc->asic_addr + ED_3COM_CR, 0); + } else { + outb(sc->asic_addr + ED_3COM_CR, ED_3COM_CR_XSEL); + } } /* @@ -1447,13 +1410,24 @@ edintr(unit) } /* - * return NIC CR to standard state before looping back - * to top: page 0, remote DMA complete, start - * (toggling the TXP bit off, even if was just set in the - * transmit routine, is *okay* - it is 'edge' triggered - * from low to high) + * return NIC CR to standard state: page 0, remote DMA complete, + * start (toggling the TXP bit off, even if was just set + * in the transmit routine, is *okay* - it is 'edge' + * triggered from low to high) */ outb(sc->nic_addr + ED_P0_CR, ED_CR_RD2|ED_CR_STA); + + /* + * If the Network Talley Counters overflow, read them to + * reset them. It appears that old 8390's won't + * clear the ISR flag otherwise - resulting in an + * infinite loop. + */ + if (isr & ED_ISR_CNT) { + (void) inb(sc->nic_addr + ED_P0_CNTR0); + (void) inb(sc->nic_addr + ED_P0_CNTR1); + (void) inb(sc->nic_addr + ED_P0_CNTR2); + } } } @@ -1567,10 +1541,12 @@ ed_ioctl(ifp, command, data) * of the tranceiver for 3Com boards. The LLC0 flag disables * the tranceiver if set. */ - if ((sc->vendor == ED_VENDOR_3COM) && (ifp->if_flags & IFF_LLC0)) { - outb(sc->asic_addr + ED_3COM_CR, 0); - } else { - outb(sc->asic_addr + ED_3COM_CR, ED_3COM_CR_XSEL); + if (sc->vendor == ED_VENDOR_3COM) { + if (ifp->if_flags & IFF_LLC0) { + outb(sc->asic_addr + ED_3COM_CR, 0); + } else { + outb(sc->asic_addr + ED_3COM_CR, ED_3COM_CR_XSEL); + } } break; diff --git a/sys/dev/isa/if_edreg.h b/sys/dev/isa/if_edreg.h index 27412738735..b6d1583df83 100644 --- a/sys/dev/isa/if_edreg.h +++ b/sys/dev/isa/if_edreg.h @@ -1,16 +1,7 @@ /* * National Semiconductor DS8390 NIC register definitions * - * $Log: if_edreg.h,v $ - * Revision 1.1 1993/07/03 12:21:07 cgd - * add support for David Greenman "ed" driver - * - * Revision 1.2 93/06/23 03:03:05 davidg - * added some additional definitions for the 83C584 bus interface - * chip (SMC/WD boards) - * - * Revision 1.1 93/06/23 03:01:07 davidg - * Initial revision + * $Id: if_edreg.h,v 1.2 1993/07/28 02:21:23 cgd Exp $ * */ @@ -564,7 +555,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 diff --git a/sys/dev/isa/ultra14f.c b/sys/dev/isa/ultra14f.c index 310f9deb9e6..4160bd5589e 100644 --- a/sys/dev/isa/ultra14f.c +++ b/sys/dev/isa/ultra14f.c @@ -15,7 +15,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: ultra14f.c,v 1.12 1993/07/17 11:00:11 deraadt Exp $ + * $Id: ultra14f.c,v 1.13 1993/07/28 02:21:32 cgd Exp $ */ #include <sys/types.h> @@ -310,7 +310,7 @@ uha_send_mbox( int unit ,struct mscp *mscp) { int port = uha_data[unit].baseport; - int spincount = FUDGE(delaycount) * 1; /* 1ms should be enough */ + int spincount = FUDGE(delaycount) * 1000; /* 1s should be enough */ int s = splbio(); while( ((inb(port + UHA_LINT) & (UHA_LDIP)) diff --git a/sys/dev/isa/wd.c b/sys/dev/isa/wd.c index 241b456ecb9..b70865ad26f 100644 --- a/sys/dev/isa/wd.c +++ b/sys/dev/isa/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.24 1993/07/08 08:22:17 deraadt Exp $ + * $Id: wd.c,v 1.25 1993/07/28 02:21:37 cgd Exp $ */ /* Note: This code heavily modified by tih@barsoom.nhh.no; use at own risk! */ @@ -75,7 +75,7 @@ #include "vm/vm.h" #ifndef WDCNDELAY -#define WDCNDELAY 200000 /* delay = 25us; so 5s for a controller state change */ +#define WDCNDELAY 400000 /* delay = 25us; so 10s for a controller state change */ #endif #define WDCDELAY 25 diff --git a/sys/dev/isa/wt.c b/sys/dev/isa/wt.c index 447e3840b2c..a9674182a6e 100644 --- a/sys/dev/isa/wt.c +++ b/sys/dev/isa/wt.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)wt.c 7.1 (Berkeley) 5/9/91 - * $Id: wt.c,v 1.4 1993/07/19 16:58:20 cgd Exp $ + * $Id: wt.c,v 1.5 1993/07/28 02:21:40 cgd Exp $ */ /* @@ -445,9 +445,7 @@ errxit: bp->b_flags |= B_ERROR; } /* Reading file marks or writing end of tape return 0 bytes */ } else { - /* XXX (cgd) - for broken 386bsd physio only: - * bp->b_flags |= B_ERROR; - */ + bp->b_flags |= B_ERROR; wtflags &= ~(TPWO|TPRO); } } diff --git a/sys/dev/scsipi/st.c b/sys/dev/scsipi/st.c index ef542e8d824..5e761d6c053 100644 --- a/sys/dev/scsipi/st.c +++ b/sys/dev/scsipi/st.c @@ -13,7 +13,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: st.c,v 1.14 1993/07/19 11:30:54 cgd Exp $ + * $Id: st.c,v 1.15 1993/07/28 02:22:41 cgd Exp $ */ /* @@ -701,6 +701,8 @@ stioctl(dev_t dev, int cmd, caddr_t arg, int mode) return ENXIO; switch(cmd) { + default: + return EINVAL; case MTIOCGET: g = (struct mtget *)arg; bzero(g, sizeof *g); |
