summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-06-10 07:34:41 +0000
committerderaadt <deraadt@openbsd.org>1996-06-10 07:34:41 +0000
commit5511f557b18147ee1baaa4ca745fd1ec404113eb (patch)
tree6cddb1c2e83caad567b671f1fca8a0bdb55d9198
parenttty_attach() (diff)
downloadwireguard-openbsd-5511f557b18147ee1baaa4ca745fd1ec404113eb.tar.xz
wireguard-openbsd-5511f557b18147ee1baaa4ca745fd1ec404113eb.zip
sync to 0607
-rw-r--r--sys/dev/pci/if_de.c7
-rw-r--r--sys/dev/pci/if_le_pci.c4
-rw-r--r--sys/dev/pci/ncr.c15
-rw-r--r--sys/dev/tc/asc.c63
-rw-r--r--sys/dev/tc/devlist2h.awk6
5 files changed, 62 insertions, 33 deletions
diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c
index 0b3b79beca7..78e9d19ff82 100644
--- a/sys/dev/pci/if_de.c
+++ b/sys/dev/pci/if_de.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: if_de.c,v 1.10 1996/05/26 00:27:41 deraadt Exp $ */
-/* $NetBSD: if_de.c,v 1.22 1996/05/13 00:03:09 mycroft Exp $ */
+/* $OpenBSD: if_de.c,v 1.11 1996/06/10 07:34:41 deraadt Exp $ */
+/* $NetBSD: if_de.c,v 1.22.4.1 1996/06/03 20:32:07 cgd Exp $ */
/*-
* Copyright (c) 1994, 1995 Matt Thomas (matt@lkg.dec.com)
@@ -420,7 +420,8 @@ static void tulip_addr_filter(tulip_softc_t *sc);
#if defined(__NetBSD__) && defined(__alpha__)
/* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */
-#define vtophys(va) (vtophys(va) | 0x40000000)
+#define vtophys(va) __alpha_bus_XXX_dmamap(sc->tulip_bc, (void *)(va))
+
#endif
static int
diff --git a/sys/dev/pci/if_le_pci.c b/sys/dev/pci/if_le_pci.c
index 27c932d32aa..3c89f62d516 100644
--- a/sys/dev/pci/if_le_pci.c
+++ b/sys/dev/pci/if_le_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le_pci.c,v 1.6 1996/05/14 22:23:38 thorpej Exp $ */
+/* $NetBSD: if_le_pci.c,v 1.6.4.1 1996/06/03 20:32:13 cgd Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -76,7 +76,7 @@
#ifdef __alpha__ /* XXX */
/* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */
-#define vtophys(va) (vtophys(va) | 0x40000000)
+#define vtophys(va) __alpha_bus_XXX_dmamap(lesc->sc_bc, (void *)(va))
#endif
int le_pci_match __P((struct device *, void *, void *));
diff --git a/sys/dev/pci/ncr.c b/sys/dev/pci/ncr.c
index 55dfddbb607..5374a996ec9 100644
--- a/sys/dev/pci/ncr.c
+++ b/sys/dev/pci/ncr.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ncr.c,v 1.9 1996/05/26 00:27:45 deraadt Exp $ */
-/* $NetBSD: ncr.c,v 1.35 1996/05/13 00:03:26 mycroft Exp $ */
+/* $OpenBSD: ncr.c,v 1.10 1996/06/10 07:34:47 deraadt Exp $ */
+/* $NetBSD: ncr.c,v 1.35.4.1 1996/06/03 20:32:17 cgd Exp $ */
/**************************************************************************
**
@@ -212,7 +212,7 @@ extern PRINT_ADDR();
#if defined(__NetBSD__) && defined(__alpha__)
/* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */
-#define vtophys(va) (vtophys(va) | 0x40000000)
+#define vtophys(va) __alpha_bus_XXX_dmamap(np->sc_bc, (void *)(va))
#endif
/*==========================================================
@@ -1295,7 +1295,8 @@ static void ncb_profile (ncb_p np, ccb_p cp);
static void ncr_script_copy_and_bind
(struct script * script, ncb_p np);
static void ncr_script_fill (struct script * scr);
-static int ncr_scatter (struct dsb* phys,u_long vaddr,u_long datalen);
+static int ncr_scatter (ncb_p np, struct dsb* phys,u_long vaddr,
+ u_long datalen);
static void ncr_setmaxtags (tcb_p tp, u_long usrtags);
static void ncr_setsync (ncb_p np, ccb_p cp, u_char sxfer);
static void ncr_settags (tcb_p tp, lcb_p lp);
@@ -1329,7 +1330,7 @@ static void ncr_attach (pcici_t tag, int unit);
#if 0
static char ident[] =
- "\n$NetBSD: ncr.c,v 1.35 1996/05/13 00:03:26 mycroft Exp $\n";
+ "\n$NetBSD: ncr.c,v 1.35.4.1 1996/06/03 20:32:17 cgd Exp $\n";
#endif
u_long ncr_version = NCR_VERSION * 11
@@ -4044,7 +4045,7 @@ static INT32 ncr_start (struct scsi_xfer * xp)
**----------------------------------------------------
*/
- segments = ncr_scatter (&cp->phys, (vm_offset_t) xp->data,
+ segments = ncr_scatter (np, &cp->phys, (vm_offset_t) xp->data,
(vm_size_t) xp->datalen);
if (segments < 0) {
@@ -6602,7 +6603,7 @@ static void ncr_opennings (ncb_p np, lcb_p lp, struct scsi_xfer * xp)
*/
static int ncr_scatter
- (struct dsb* phys, vm_offset_t vaddr, vm_size_t datalen)
+ (ncb_p np, struct dsb* phys, vm_offset_t vaddr, vm_size_t datalen)
{
u_long paddr, pnext;
diff --git a/sys/dev/tc/asc.c b/sys/dev/tc/asc.c
index 0e8e4b385e6..052ef1eedc4 100644
--- a/sys/dev/tc/asc.c
+++ b/sys/dev/tc/asc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: asc.c,v 1.19 1996/05/20 09:46:21 jonathan Exp $ */
+/* $NetBSD: asc.c,v 1.19.2.2 1996/06/04 21:21:44 mhitch Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -469,7 +469,7 @@ struct cfattach asc_ca = {
extern struct cfdriver asc_cd;
struct cfdriver asc_cd = {
- NULL, "as", DV_DULL
+ NULL, "asc", DV_DULL
};
@@ -500,6 +500,8 @@ struct pmax_driver ascdriver = {
};
+extern struct cfdriver ioasic_cd; /* XXX */
+
/*
* Match driver based on name
*/
@@ -509,14 +511,19 @@ ascmatch(parent, match, aux)
void *match;
void *aux;
{
- struct confargs *ca = aux;
+ struct ioasicdev_attach_args *d = aux;
+ struct tc_attach_args *t = aux;
void *ascaddr;
/*if (parent->dv_cfdata->cf_driver == &ioasic_cd) */
- if (!TC_BUS_MATCHNAME(ca, "asc") && !TC_BUS_MATCHNAME(ca, "PMAZ-AA "))
+ if (strncmp(d->iada_modname, "asc", TC_ROM_LLEN) &&
+ strncmp(d->iada_modname, "PMAZ-AA ", TC_ROM_LLEN))
return (0);
- ascaddr = (void*)ca->ca_addr;
+ if (parent->dv_cfdata->cf_driver == &ioasic_cd)
+ ascaddr = (void*)d->iada_addr;
+ else
+ ascaddr = (void*)t->ta_addr;
if (badaddr(ascaddr + ASC_OFFSET_53C94, 4))
return (0);
@@ -524,15 +531,14 @@ ascmatch(parent, match, aux)
return (1);
}
-extern struct cfdriver ioasic_cd; /* XXX */
-
void
ascattach(parent, self, aux)
struct device *parent;
struct device *self;
void *aux;
{
- register struct confargs *ca = aux;
+ register struct ioasicdev_attach_args *d = aux;
+ register struct tc_attach_args *t = aux;
register asc_softc_t asc = (asc_softc_t) self;
register asc_regmap_t *regs;
int id, s, i;
@@ -541,7 +547,11 @@ ascattach(parent, self, aux)
void *ascaddr;
int unit;
- ascaddr = (void*)MACH_PHYS_TO_UNCACHED(ca->ca_addr);
+ if (asc->sc_dev.dv_parent->dv_cfdata->cf_driver == &ioasic_cd) {
+ ascaddr = (void*)MACH_PHYS_TO_UNCACHED(d->iada_addr);
+ } else {
+ ascaddr = (void*)MACH_PHYS_TO_UNCACHED(t->ta_addr);
+ }
unit = asc->sc_dev.dv_unit;
/*
@@ -648,7 +658,12 @@ ascattach(parent, self, aux)
(void) pmax_add_scsi(&ascdriver, unit);
/* tie pseudo-slot to device */
- BUS_INTR_ESTABLISH(ca, asc_intr, asc);
+ if (asc->sc_dev.dv_parent->dv_cfdata->cf_driver == &ioasic_cd)
+ ioasic_intr_establish(parent, d->iada_cookie, TC_IPL_BIO,
+ asc_intr, asc);
+ else
+ tc_intr_establish(parent, t->ta_cookie, TC_IPL_BIO,
+ asc_intr, asc);
printf(": target %d\n", id);
@@ -1043,17 +1058,9 @@ again:
printf("asc: DMA_OUT, fifo resid %d, len %d, flags 0x%x\n",
fifo, len, state->flags);
len += fifo;
-/*XXX*/ goto abort;
} else if (state->flags & DMA_IN) {
- u_char *cp;
-
printf("asc_intr: IN: dmalen %d len %d fifo %d\n",
state->dmalen, len, fifo); /* XXX */
- len += fifo;
- cp = state->dmaBufAddr + (state->dmalen - len);
- while (fifo-- > 0)
- *cp++ = regs->asc_fifo;
-/*XXX*/ goto abort;
} else
printf("asc_intr: dmalen %d len %d fifo %d\n",
state->dmalen, len, fifo); /* XXX */
@@ -1475,6 +1482,17 @@ asc_dma_in(asc, status, ss, ir)
state->buflen -= len;
}
+ /*
+ * If this is the first input (DMA_IN_PROGRESS == 0), make sure
+ * the FIFO is empty. There shouldn't be any input yet.
+ */
+ if (!(state->flags & DMA_IN_PROGRESS) &&
+ (regs->asc_flags & ASC_FLAGS_FIFO_CNT) != 0) {
+ printf("asc_dma_in: FIFO count %x flags %x\n",
+ regs->asc_flags, state->flags);
+ while ((regs->asc_flags & ASC_FLAGS_FIFO_CNT) != 0)
+ regs->asc_fifo;
+ }
/* setup to start reading the next chunk */
len = state->buflen;
#ifdef DEBUG
@@ -1642,6 +1660,15 @@ asc_dma_out(asc, status, ss, ir)
state->buflen -= len;
}
+ /*
+ * Flush the fifo - sometimes there seems to be something left
+ * in the fifo. Since the dma output has not been started,
+ * the fifo is supposed to be empty.
+ */
+ if (regs->asc_flags & ASC_FLAGS_FIFO_CNT) {
+ while (regs->asc_flags & ASC_FLAGS_FIFO_CNT)
+ regs->asc_fifo;
+ }
/* setup for this chunk */
len = state->buflen;
#ifdef DEBUG
diff --git a/sys/dev/tc/devlist2h.awk b/sys/dev/tc/devlist2h.awk
index 5caea9ad296..c0b69a79943 100644
--- a/sys/dev/tc/devlist2h.awk
+++ b/sys/dev/tc/devlist2h.awk
@@ -1,6 +1,6 @@
#! /usr/bin/awk -f
-# $OpenBSD: devlist2h.awk,v 1.1 1996/04/18 23:48:20 niklas Exp $
-# $NetBSD: devlist2h.awk,v 1.2 1996/03/05 23:15:05 cgd Exp $
+# $OpenBSD: devlist2h.awk,v 1.2 1996/06/10 07:34:58 deraadt Exp $
+# $NetBSD: devlist2h.awk,v 1.2.4.1 1996/06/05 18:34:36 cgd Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
# All rights reserved.
@@ -64,7 +64,7 @@ $1 == "device" {
devices[ndevices, 1] = $2; # C identifier for device
gsub("-", "_", devices[ndevices, 1]);
- devices[ndevices, 2] = $3; /* driver name */
+ devices[ndevices, 2] = $3; # driver name
printf("\n") > hfile
printf("#define\tTC_DEVICE_%s\t\"%s\"\n", devices[ndevices, 1],