summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-16 12:41:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-16 12:41:47 +0000
commit9e1f6f59f3fc5398bd74131cd238c31399b5c1ee (patch)
tree7cbff239f75e46eb90679ae879ffb1bbdc7f036a /sys/dev/ic
parentf734b3e8cc107eccf53fdce270a92909172b8535 (diff)
latest pdq from matt thomas
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/pdq.c11
-rw-r--r--sys/dev/ic/pdq_ifsubr.c4
-rw-r--r--sys/dev/ic/pdqreg.h26
-rw-r--r--sys/dev/ic/pdqvar.h8
4 files changed, 36 insertions, 13 deletions
diff --git a/sys/dev/ic/pdq.c b/sys/dev/ic/pdq.c
index 71793542bf8..bb0b72bd052 100644
--- a/sys/dev/ic/pdq.c
+++ b/sys/dev/ic/pdq.c
@@ -1,5 +1,4 @@
-/* $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 $ */
+/* $NetBSD: pdq.c,v 1.9 1996/10/13 01:37:26 christos Exp $ */
/*-
* Copyright (c) 1995,1996 Matt Thomas <matt@3am-software.com>
@@ -170,13 +169,13 @@ pdq_print_fddi_chars(
const char hexchars[] = "0123456789abcdef";
printf(
-#if !defined(__bsdi__) && !(defined(__NetBSD__) || defined(__OpenBSD__))
+#if !defined(__bsdi__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
PDQ_OS_PREFIX
#else
": "
#endif
"DEC %s FDDI %s Controller\n",
-#if !defined(__bsdi__) && !(defined(__NetBSD__) || defined(__OpenBSD__))
+#if !defined(__bsdi__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
PDQ_OS_PREFIX_ARGS,
#endif
pdq_descriptions[pdq->pdq_type],
@@ -539,6 +538,7 @@ pdq_queue_commands(
pdq_os_addr_fill(pdq, addr, 61);
break;
}
+ default:
}
/*
* At this point the command is done. All that needs to be done is to
@@ -759,7 +759,7 @@ pdq_process_received_data(
dataptr[PDQ_RX_FC_OFFSET+5],
dataptr[PDQ_RX_FC_OFFSET+6]);
/* rx->rx_badcrc++; */
- } else if (status.rxs_fsc == 0 | status.rxs_fsb_e == 1) {
+ } else if (status.rxs_fsc == 0 || status.rxs_fsb_e == 1) {
/* rx->rx_frame_status_errors++; */
} else {
/* hardware fault */
@@ -1244,6 +1244,7 @@ pdq_run(
}
case PDQS_RING_MEMBER: {
}
+ default:
}
}
diff --git a/sys/dev/ic/pdq_ifsubr.c b/sys/dev/ic/pdq_ifsubr.c
index df191ed37a8..21034bcc129 100644
--- a/sys/dev/ic/pdq_ifsubr.c
+++ b/sys/dev/ic/pdq_ifsubr.c
@@ -1,4 +1,3 @@
-/* $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 $ */
/*-
@@ -364,7 +363,8 @@ pdq_ifattach(
ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_NOTRAILERS|IFF_MULTICAST;
-#if (defined(__FreeBSD__) && BSD >= 199506) || defined(__NetBSD__) || defined(__OpenBSD__)
+#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/pdqreg.h b/sys/dev/ic/pdqreg.h
index a8850f08b19..ced981cbb04 100644
--- a/sys/dev/ic/pdqreg.h
+++ b/sys/dev/ic/pdqreg.h
@@ -1,5 +1,4 @@
-/* $OpenBSD: pdqreg.h,v 1.3 1996/05/26 00:27:04 deraadt Exp $ */
-/* $NetBSD: pdqreg.h,v 1.4 1996/05/20 00:26:23 thorpej Exp $ */
+/* $NetBSD: pdqreg.h,v 1.6 1996/08/28 16:01:29 cgd Exp $ */
/*-
* Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com>
@@ -36,6 +35,7 @@
#ifndef _PDQREG_H
#define _PDQREG_H
+#if !defined(__NetBSD__) || defined(__OpenBSD__)
#include <stddef.h>
#if defined(PDQTEST) && !defined(PDQ_NDEBUG)
#include <assert.h>
@@ -43,6 +43,28 @@
#else
#define PDQ_ASSERT(x) do { } while(0)
#endif
+#else /* __NetBSD__ */
+/*
+ * Including user-land headers in kernel code is not allowed in NetBSD
+ */
+#define offsetof(type, member) ((size_t)(&((type *)0)->member))
+
+/*
+ * Can't directly use "assert", because apparenltly cpp won't expand it
+ * unless it has an argument, which loses.
+ */
+#ifdef PDQ_NDEBUG
+#define PDQ_ASSERT(e) ((void)0)
+#else
+#ifdef __STDC__
+#define PDQ_ASSERT(e) ((e) ? (void)0 : \
+ __assert("PDQ ", __FILE__, __LINE__, #e))
+#else
+#define PDQ_ASSERT(e) ((e) ? (void)0 : \
+ __assert("PDQ ", __FILE__, __LINE__, "e"))
+#endif
+#endif
+#endif /* __NetBSD__ || __OpenBSD__ */
#define PDQ_RING_SIZE(array) ((sizeof(array) / sizeof(array[0])))
#define PDQ_ARRAY_SIZE(array) ((sizeof(array) / sizeof(array[0])))
diff --git a/sys/dev/ic/pdqvar.h b/sys/dev/ic/pdqvar.h
index cbde2877bc1..510ebd630b0 100644
--- a/sys/dev/ic/pdqvar.h
+++ b/sys/dev/ic/pdqvar.h
@@ -1,5 +1,4 @@
-/* $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 $ */
+/* $NetBSD: pdqvar.h,v 1.8 1996/07/10 18:55:05 cgd Exp $ */
/*-
* Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com>
@@ -61,7 +60,8 @@ enum _pdq_type_t {
#if defined(PDQTEST)
#include <pdq_os_test.h>
-#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__) \
+ || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/systm.h>
@@ -84,7 +84,7 @@ enum _pdq_type_t {
#define PDQ_OS_USEC_DELAY(n) DELAY(n)
#define PDQ_OS_MEMZERO(p, n) bzero((caddr_t)(p), (n))
#if (defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__alpha__)
-#define PDQ_OS_VA_TO_PA(pdq, p) (vtophys(p) | (pdq->pdq_type == PDQ_DEFTA ? 0 : 0x40000000))
+#define PDQ_OS_VA_TO_PA(pdq, p) (vtophys((vm_offset_t)p) | (pdq->pdq_type == PDQ_DEFTA ? 0 : 0x40000000))
#else
#define PDQ_OS_VA_TO_PA(pdq, p) vtophys(p)
#endif