summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-21 22:27:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-21 22:27:58 +0000
commit83da6a9e5a8ac85f7f65661f4c2b7abdd92e4dd8 (patch)
treeed31830e32d863b7e6bd46b9574811c7a54d583f /sys/dev/ic
parent4209c6e4b597ecaeeec78b546c6234e31154f98c (diff)
check for __OpenBSD__, prep for tossing __NetBSD__?
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/aic7xxx.c58
-rw-r--r--sys/dev/ic/aic7xxxvar.h12
-rw-r--r--sys/dev/ic/pdq.c6
-rw-r--r--sys/dev/ic/pdq_ifsubr.c6
-rw-r--r--sys/dev/ic/pdqvar.h12
-rw-r--r--sys/dev/ic/smc93cx6.c6
-rw-r--r--sys/dev/ic/smc93cx6var.h10
7 files changed, 55 insertions, 55 deletions
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index 6e866ac6e89..d8a77c6052c 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.c,v 1.8 1996/07/02 20:18:51 deraadt Exp $
+ * $Id: aic7xxx.c,v 1.9 1996/08/21 22:27:32 deraadt Exp $
*/
/*
* TODO:
@@ -115,7 +115,7 @@
#include <sys/param.h>
#include <sys/systm.h>
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#include <machine/bus.h>
#include <machine/intr.h>
@@ -126,7 +126,7 @@
#include <sys/proc.h>
#include <scsi/scsi_all.h>
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <scsi/scsi_debug.h>
#endif
#include <scsi/scsiconf.h>
@@ -145,7 +145,7 @@
#include <dev/aic7xxx/aic7xxx_reg.h>
#endif /* defined(__FreeBSD__) */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <dev/ic/aic7xxxreg.h>
#include <dev/ic/aic7xxxvar.h>
@@ -242,7 +242,7 @@ static struct scsi_device ahc_dev =
\
UNPAUSE_SEQUENCER(ahc);
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
/*
* Is device which is pointed by sc_link connected on second scsi bus ?
*/
@@ -291,7 +291,7 @@ static void ahc_scsirate __P((struct ahc_data* ahc, u_char *scsirate,
#if defined(__FreeBSD__)
static timeout_t
ahc_timeout;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
static void ahc_timeout __P((void *));
#endif
static void ahc_busy_target __P((struct ahc_data *ahc,
@@ -310,7 +310,7 @@ char *ahc_name(ahc)
return (name);
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct cfdriver ahc_cd = {
NULL, "ahc", DV_DULL
};
@@ -389,7 +389,7 @@ struct ahc_data *
ahc_alloc(unit, iobase, type, flags)
int unit;
u_long iobase;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
void
ahc_construct(ahc, bc, ioh, type, flags)
struct ahc_data *ahc;
@@ -427,7 +427,7 @@ ahc_construct(ahc, bc, ioh, type, flags)
#endif
#if defined(__FreeBSD__)
ahc->baseport = iobase;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc->sc_bc = bc;
ahc->sc_ioh = ioh;
#endif
@@ -455,7 +455,7 @@ void
#if defined(__FreeBSD__)
ahc_reset(iobase)
u_long iobase;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc_reset(devname, bc, ioh)
char *devname;
bus_chipset_tag_t bc;
@@ -470,7 +470,7 @@ ahc_reset(devname, bc, ioh)
hcntrl = (inb(HCNTRL + iobase) & IRQMS) | INTEN;
outb(HCNTRL + iobase, CHIPRST | PAUSE);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
hcntrl = (bus_io_read_1(bc, ioh, HCNTRL) & IRQMS) | INTEN;
bus_io_write_1(bc, ioh, HCNTRL, CHIPRST | PAUSE);
@@ -481,7 +481,7 @@ ahc_reset(devname, bc, ioh)
wait = 1000;
#if defined(__FreeBSD__)
while (--wait && !(inb(HCNTRL + iobase) & CHIPRSTACK))
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
while (--wait && !(bus_io_read_1(bc, ioh, HCNTRL) & CHIPRSTACK))
#endif
DELAY(1000);
@@ -489,14 +489,14 @@ ahc_reset(devname, bc, ioh)
#if defined(__FreeBSD__)
printf("ahc at 0x%lx: WARNING - Failed chip reset! "
"Trying to initialize anyway.\n", iobase);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
printf("%s: WARNING - Failed chip reset! "
"Trying to initialize anyway.\n", devname);
#endif
}
#if defined(__FreeBSD__)
outb(HCNTRL + iobase, hcntrl | PAUSE);
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
bus_io_write_1(bc, ioh, HCNTRL, hcntrl | PAUSE);
#endif
}
@@ -575,7 +575,7 @@ ahc_scsirate(ahc, scsirate, period, offset, channel, target )
}
}
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
int
ahcprint(aux, name)
void *aux;
@@ -608,7 +608,7 @@ ahc_attach(ahc)
ahc->sc_link.adapter_unit = ahc->unit;
ahc->sc_link.adapter_targ = ahc->our_id;
ahc->sc_link.fordriver = 0;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc->sc_link.adapter_target = ahc->our_id;
#endif
ahc->sc_link.adapter_softc = ahc;
@@ -624,7 +624,7 @@ ahc_attach(ahc)
ahc->sc_link_b.adapter_targ = ahc->our_id_b;
ahc->sc_link_b.adapter_bus = 1;
ahc->sc_link_b.fordriver = (void *)SELBUSB;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc->sc_link_b.adapter_target = ahc->our_id_b;
#endif
}
@@ -666,7 +666,7 @@ ahc_attach(ahc)
scsi_attachdevs(scbus);
scbus = NULL; /* Upper-level SCSI code owns this now */
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
/*
* XXX - Update MI SCSI code
*
@@ -912,7 +912,7 @@ void ahc_add_waiting_scb(ahc, scb)
*/
#if defined(__FreeBSD__)
void
-#elif defined (__NetBSD__)
+#elif defined (__NetBSD__) || defined(__OpenBSD__)
int
#endif
ahc_intr(arg)
@@ -932,7 +932,7 @@ ahc_intr(arg)
if (!(intstat & INT_PEND))
#if defined(__FreeBSD__)
return;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
return 0;
#endif
@@ -1443,7 +1443,7 @@ pagein_done:
#endif
#if defined(__FreeBSD__)
sc->op_code = REQUEST_SENSE;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
sc->opcode = REQUEST_SENSE;
#endif
sc->byte2 = xs->sc_link->lun << 5;
@@ -1558,7 +1558,7 @@ pagein_done:
#if defined(__FreeBSD__)
xs->flags |= SCSI_RESID_VALID;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
/* XXX - Update to do this right */
#endif
#ifdef AHC_DEBUG
@@ -1804,7 +1804,7 @@ clear:
ahc_unbusy_target(ahc, xs->sc_link->target,
#if defined(__FreeBSD__)
((long)xs->sc_link->fordriver & SELBUSB)
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
IS_SCSIBUS_B(ahc, xs->sc_link)
#endif
? 'B' : 'A');
@@ -1862,7 +1862,7 @@ clear:
ahc_run_waiting_queues(ahc);
}
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
return 1;
#endif
}
@@ -1884,7 +1884,7 @@ ahc_done(ahc, scb)
* Put the results of the operation
* into the xfer and call whoever started it
*/
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (xs->error != XS_NOERROR) {
/* Don't override the error value. */
} else if (scb->flags & SCB_ABORTED) {
@@ -1900,7 +1900,7 @@ ahc_done(ahc, scb)
/* All went correctly OR errors expected */
xs->error = XS_NOERROR;
}
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
/*
* Since NetBSD doesn't have error ignoring operation mode
* (SCSI_ERR_OK in FreeBSD), we don't have to care this case.
@@ -2275,7 +2275,7 @@ ahcminphys(bp)
if (bp->b_bcount > ((AHC_NSEG - 1) * PAGE_SIZE)) {
bp->b_bcount = ((AHC_NSEG - 1) * PAGE_SIZE);
}
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
minphys(bp);
#endif
}
@@ -2303,7 +2303,7 @@ ahc_scsi_cmd(xs)
mask = (0x01 << (xs->sc_link->target
#if defined(__FreeBSD__)
| ((u_long)xs->sc_link->fordriver & 0x08)));
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
| (IS_SCSIBUS_B(ahc, xs->sc_link) ? SELBUSB : 0) ));
#endif
SC_DEBUG(xs->sc_link, SDEV_DB2, ("ahc_scsi_cmd\n"));
@@ -2356,7 +2356,7 @@ ahc_scsi_cmd(xs)
scb->tcl = ((xs->sc_link->target << 4) & 0xF0) |
#if defined(__FreeBSD__)
((u_long)xs->sc_link->fordriver & 0x08) |
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
(IS_SCSIBUS_B(ahc,xs->sc_link)? SELBUSB : 0)|
#endif
(xs->sc_link->lun & 0x07);
diff --git a/sys/dev/ic/aic7xxxvar.h b/sys/dev/ic/aic7xxxvar.h
index 60ee73ad7c8..d3be3ce189c 100644
--- a/sys/dev/ic/aic7xxxvar.h
+++ b/sys/dev/ic/aic7xxxvar.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxxvar.h,v 1.6 1996/06/27 21:15:49 shawn Exp $
+ * $Id: aic7xxxvar.h,v 1.7 1996/08/21 22:27:36 deraadt Exp $
*/
#ifndef _AIC7XXX_H_
@@ -40,7 +40,7 @@
#include "ahc.h" /* for NAHC from config */
#endif
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
/*
* convert FreeBSD's <sys/queue.h> symbols to NetBSD's
*/
@@ -66,7 +66,7 @@
outsb((ahc)->baseport+(port), valp, size)
#define AHC_OUTSL(ahc, port, valp, size) \
outsl((ahc)->baseport+(port), valp, size)
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#define AHC_INB(ahc, port) \
bus_io_read_1((ahc)->sc_bc, (ahc)->sc_ioh, port)
#define AHC_INSB(ahc, port, valp, size) \
@@ -203,7 +203,7 @@ struct scb {
struct ahc_data {
#if defined(__FreeBSD__)
int unit;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct device sc_dev;
void *sc_ih;
bus_chipset_tag_t sc_bc;
@@ -281,7 +281,7 @@ char *ahc_name __P((struct ahc_data *ahc));
void ahc_reset __P((u_long iobase));
struct ahc_data *ahc_alloc __P((int unit, u_long io_base, ahc_type type, ahc_flag flags));
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#define ahc_name(ahc) (ahc)->sc_dev.dv_xname
@@ -293,7 +293,7 @@ int ahc_init __P((struct ahc_data *));
int ahc_attach __P((struct ahc_data *));
#if defined(__FreeBSD__)
void ahc_intr __P((void *arg));
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
int ahc_intr __P((void *arg));
#endif
diff --git a/sys/dev/ic/pdq.c b/sys/dev/ic/pdq.c
index ccdb5b526a0..71793542bf8 100644
--- a/sys/dev/ic/pdq.c
+++ b/sys/dev/ic/pdq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdq.c,v 1.4 1996/06/18 10:22:28 deraadt Exp $ */
+/* $OpenBSD: pdq.c,v 1.5 1996/08/21 22:27:39 deraadt Exp $ */
/* $NetBSD: pdq.c,v 1.5.4.1 1996/06/08 00:17:44 cgd Exp $ */
/*-
@@ -170,13 +170,13 @@ pdq_print_fddi_chars(
const char hexchars[] = "0123456789abcdef";
printf(
-#if !defined(__bsdi__) && !defined(__NetBSD__)
+#if !defined(__bsdi__) && !(defined(__NetBSD__) || defined(__OpenBSD__))
PDQ_OS_PREFIX
#else
": "
#endif
"DEC %s FDDI %s Controller\n",
-#if !defined(__bsdi__) && !defined(__NetBSD__)
+#if !defined(__bsdi__) && !(defined(__NetBSD__) || defined(__OpenBSD__))
PDQ_OS_PREFIX_ARGS,
#endif
pdq_descriptions[pdq->pdq_type],
diff --git a/sys/dev/ic/pdq_ifsubr.c b/sys/dev/ic/pdq_ifsubr.c
index 9435e716c18..df191ed37a8 100644
--- a/sys/dev/ic/pdq_ifsubr.c
+++ b/sys/dev/ic/pdq_ifsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdq_ifsubr.c,v 1.3 1996/05/26 00:27:03 deraadt Exp $ */
+/* $OpenBSD: pdq_ifsubr.c,v 1.4 1996/08/21 22:27:41 deraadt Exp $ */
/* $NetBSD: pdq_ifsubr.c,v 1.5 1996/05/20 00:26:21 thorpej Exp $ */
/*-
@@ -46,7 +46,7 @@
#include <sys/malloc.h>
#if defined(__FreeBSD__)
#include <sys/devconf.h>
-#elif defined(__bsdi__) || defined(__NetBSD__)
+#elif defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#endif
@@ -364,7 +364,7 @@ pdq_ifattach(
ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_NOTRAILERS|IFF_MULTICAST;
-#if (defined(__FreeBSD__) && BSD >= 199506) || defined(__NetBSD__)
+#if (defined(__FreeBSD__) && BSD >= 199506) || defined(__NetBSD__) || defined(__OpenBSD__)
ifp->if_watchdog = pdq_ifwatchdog;
#else
ifp->if_watchdog = ifwatchdog;
diff --git a/sys/dev/ic/pdqvar.h b/sys/dev/ic/pdqvar.h
index aa476e8818e..cbde2877bc1 100644
--- a/sys/dev/ic/pdqvar.h
+++ b/sys/dev/ic/pdqvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdqvar.h,v 1.5 1996/06/18 10:22:29 deraadt Exp $ */
+/* $OpenBSD: pdqvar.h,v 1.6 1996/08/21 22:27:42 deraadt Exp $ */
/* $NetBSD: pdqvar.h,v 1.6.4.1 1996/06/08 00:17:49 cgd Exp $ */
/*-
@@ -61,7 +61,7 @@ enum _pdq_type_t {
#if defined(PDQTEST)
#include <pdq_os_test.h>
-#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/systm.h>
@@ -73,7 +73,7 @@ enum _pdq_type_t {
#include <vm/vm_kern.h>
#define PDQ_USE_MBUFS
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
#define PDQ_OS_PREFIX "%s: "
#define PDQ_OS_PREFIX_ARGS pdq->pdq_os_name
#else
@@ -83,7 +83,7 @@ enum _pdq_type_t {
#define PDQ_OS_PAGESIZE NBPG
#define PDQ_OS_USEC_DELAY(n) DELAY(n)
#define PDQ_OS_MEMZERO(p, n) bzero((caddr_t)(p), (n))
-#if defined(__NetBSD__) && defined(__alpha__)
+#if (defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__alpha__)
#define PDQ_OS_VA_TO_PA(pdq, p) (vtophys(p) | (pdq->pdq_type == PDQ_DEFTA ? 0 : 0x40000000))
#else
#define PDQ_OS_VA_TO_PA(pdq, p) vtophys(p)
@@ -125,7 +125,7 @@ typedef volatile pdq_uint32_t *pdq_bus_memaddr_t;
typedef pdq_bus_memaddr_t pdq_bus_memoffset_t;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <machine/bus.h>
#include <machine/intr.h>
#define PDQ_OS_PTR_FMT "%p"
@@ -195,7 +195,7 @@ typedef struct {
struct isadev sc_id; /* ISA device */
struct intrhand sc_ih; /* interrupt vectoring */
struct atshutdown sc_ats; /* shutdown routine */
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
struct device sc_dev; /* base device */
void *sc_ih; /* interrupt vectoring */
void *sc_ats; /* shutdown hook */
diff --git a/sys/dev/ic/smc93cx6.c b/sys/dev/ic/smc93cx6.c
index 6b5ac52ec21..3a6fb005188 100644
--- a/sys/dev/ic/smc93cx6.c
+++ b/sys/dev/ic/smc93cx6.c
@@ -18,7 +18,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: smc93cx6.c,v 1.2 1996/06/27 21:15:50 shawn Exp $
+ * $Id: smc93cx6.c,v 1.3 1996/08/21 22:27:43 deraadt Exp $
*/
/*
@@ -58,7 +58,7 @@
#if defined(__FreeBSD__)
#include <machine/clock.h>
#include <i386/scsi/93cx6.h>
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include <machine/bus.h>
#include <dev/ic/smc93cx6var.h>
#endif
@@ -91,7 +91,7 @@ read_seeprom(sd, buf, start_addr, count)
#if defined(__FreeBSD__)
u_int start_addr;
int count;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
bus_io_size_t start_addr;
bus_io_size_t count;
#endif
diff --git a/sys/dev/ic/smc93cx6var.h b/sys/dev/ic/smc93cx6var.h
index 017d6aee071..cfd805b8ea4 100644
--- a/sys/dev/ic/smc93cx6var.h
+++ b/sys/dev/ic/smc93cx6var.h
@@ -20,18 +20,18 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: smc93cx6var.h,v 1.2 1996/06/27 21:15:50 shawn Exp $
+ * $Id: smc93cx6var.h,v 1.3 1996/08/21 22:27:45 deraadt Exp $
*/
#include <sys/param.h>
-#if !defined(__NetBSD__)
+#if !(defined(__NetBSD__) || defined(__OpenBSD__))
#include <sys/systm.h>
#endif
struct seeprom_descriptor {
#if defined(__FreeBSD__)
u_long sd_iobase;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
bus_chipset_tag_t sd_bc;
bus_io_handle_t sd_ioh;
bus_io_size_t sd_offset;
@@ -63,7 +63,7 @@ struct seeprom_descriptor {
#if defined(__FreeBSD__)
#define SEEPROM_INB(sd) inb(sd->sd_iobase)
#define SEEPROM_OUTB(sd, value) outb(sd->sd_iobase, value)
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
#define SEEPROM_INB(sd) \
bus_io_read_1(sd->sd_bc, sd->sd_ioh, sd->sd_offset)
#define SEEPROM_OUTB(sd, value) \
@@ -73,7 +73,7 @@ struct seeprom_descriptor {
#if defined(__FreeBSD__)
int read_seeprom __P((struct seeprom_descriptor *sd,
u_int16_t *buf, u_int start_addr, int count));
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
int read_seeprom __P((struct seeprom_descriptor *sd,
u_int16_t *buf, bus_io_size_t start_addr, bus_io_size_t count));
#endif