summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-11-06 02:13:14 +0000
committerpeter <peter@FreeBSD.org>1998-11-06 02:13:14 +0000
commit96449795b9fdcf07983e9687ffbae1a7d575835b (patch)
tree2c1590c1db60fe7ef1979252d3d6906a65aee8f4 /sys
parentd9ae635b989af2fa9c0bbbb969f3f2a4bce21506 (diff)
downloadFreeBSD-src-96449795b9fdcf07983e9687ffbae1a7d575835b.zip
FreeBSD-src-96449795b9fdcf07983e9687ffbae1a7d575835b.tar.gz
If this is going to have checks for kernel versions, it might as well
do it so that it works. This code should run on 2.2.x now.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/de/if_de.c30
-rw-r--r--sys/dev/de/if_devar.h14
-rw-r--r--sys/pci/if_de.c30
-rw-r--r--sys/pci/if_devar.h14
4 files changed, 58 insertions, 30 deletions
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c
index 8b74e43..74047d7 100644
--- a/sys/dev/de/if_de.c
+++ b/sys/dev/de/if_de.c
@@ -1,5 +1,5 @@
/* $NetBSD: if_de.c,v 1.80 1998/09/25 18:06:53 matt Exp $ */
-/* $Id: if_de.c,v 1.88 1998/10/13 09:05:57 peter Exp $ */
+/* $Id: if_de.c,v 1.89 1998/10/14 08:31:26 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -39,11 +39,6 @@
*/
#define TULIP_HDR_DATA
-#ifdef __FreeBSD__
-#include "opt_inet.h"
-#include "opt_ipx.h"
-#endif
-
#ifdef __NetBSD__
#include "opt_inet.h"
#include "opt_ns.h"
@@ -62,6 +57,21 @@
#include <sys/device.h>
#endif
+#if defined(__FreeBSD__)
+/* In case somebody is trying to run this on an older 2.2 or 3.0 */
+#ifndef __FreeBSD_version /* defined in sys/param.h on current code */
+#if __FreeBSD__ >= 3
+#define __FreeBSD_version 300000
+#else
+#define __FreeBSD_version 200000
+#endif
+#endif
+#if __FreeBSD_version >= 300000
+#include "opt_inet.h"
+#include "opt_ipx.h"
+#endif
+#endif
+
#if defined(__NetBSD__)
#include "rnd.h"
#if NRND > 0
@@ -113,14 +123,6 @@
#include <pci/dc21040reg.h>
#define DEVAR_INCLUDE "pci/if_devar.h"
#endif
-/* In case somebody is trying to run this on an older 2.2 or 3.0 */
-#ifndef __FreeBSD_version /* defined in sys/param.h on current code */
-#if __FreeBSD__ >= 3
-#define __FreeBSD_version 300000
-#else
-#define __FreeBSD_version 200000
-#endif
-#endif
#endif /* __FreeBSD__ */
#if defined(__bsdi__)
diff --git a/sys/dev/de/if_devar.h b/sys/dev/de/if_devar.h
index 1f4b577..b0ec384 100644
--- a/sys/dev/de/if_devar.h
+++ b/sys/dev/de/if_devar.h
@@ -1,5 +1,5 @@
/* $NetBSD: if_devar.h,v 1.31 1998/09/29 22:40:52 matt Exp $ */
-/* $Id: if_devar.h,v 1.10 1998/10/13 09:05:58 peter Exp $ */
+/* $Id: if_devar.h,v 1.11 1998/10/14 08:31:27 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -62,8 +62,16 @@ typedef bus_addr_t tulip_csrptr_t;
#define TULIP_PCI_CSRSIZE 8
#define TULIP_PCI_CSROFFSET 0
+#if !defined(__FreeBSD__) || __FreeBSD_version < 300000
+typedef u_long uintptr_t;
+#endif
+
#if !defined(__NetBSD__)
+#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
typedef pci_port_t tulip_csrptr_t;
+#else
+typedef u_int16_t tulip_csrptr_t;
+#endif
#define TULIP_CSR_READ(sc, csr) (inl((sc)->tulip_csrs.csr))
#define TULIP_CSR_WRITE(sc, csr, val) outl((sc)->tulip_csrs.csr, val)
@@ -943,7 +951,11 @@ static void tulip_softintr(void);
#if defined(__FreeBSD__)
typedef void ifnet_ret_t;
+#if __FreeBSD_version >= 300000
typedef u_long ioctl_cmd_t;
+#else
+typedef int ioctl_cmd_t;
+#endif
#if defined(TULIP_HDR_DATA)
static tulip_softc_t *tulips[TULIP_MAX_DEVICES];
#endif
diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c
index 8b74e43..74047d7 100644
--- a/sys/pci/if_de.c
+++ b/sys/pci/if_de.c
@@ -1,5 +1,5 @@
/* $NetBSD: if_de.c,v 1.80 1998/09/25 18:06:53 matt Exp $ */
-/* $Id: if_de.c,v 1.88 1998/10/13 09:05:57 peter Exp $ */
+/* $Id: if_de.c,v 1.89 1998/10/14 08:31:26 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -39,11 +39,6 @@
*/
#define TULIP_HDR_DATA
-#ifdef __FreeBSD__
-#include "opt_inet.h"
-#include "opt_ipx.h"
-#endif
-
#ifdef __NetBSD__
#include "opt_inet.h"
#include "opt_ns.h"
@@ -62,6 +57,21 @@
#include <sys/device.h>
#endif
+#if defined(__FreeBSD__)
+/* In case somebody is trying to run this on an older 2.2 or 3.0 */
+#ifndef __FreeBSD_version /* defined in sys/param.h on current code */
+#if __FreeBSD__ >= 3
+#define __FreeBSD_version 300000
+#else
+#define __FreeBSD_version 200000
+#endif
+#endif
+#if __FreeBSD_version >= 300000
+#include "opt_inet.h"
+#include "opt_ipx.h"
+#endif
+#endif
+
#if defined(__NetBSD__)
#include "rnd.h"
#if NRND > 0
@@ -113,14 +123,6 @@
#include <pci/dc21040reg.h>
#define DEVAR_INCLUDE "pci/if_devar.h"
#endif
-/* In case somebody is trying to run this on an older 2.2 or 3.0 */
-#ifndef __FreeBSD_version /* defined in sys/param.h on current code */
-#if __FreeBSD__ >= 3
-#define __FreeBSD_version 300000
-#else
-#define __FreeBSD_version 200000
-#endif
-#endif
#endif /* __FreeBSD__ */
#if defined(__bsdi__)
diff --git a/sys/pci/if_devar.h b/sys/pci/if_devar.h
index 1f4b577..b0ec384 100644
--- a/sys/pci/if_devar.h
+++ b/sys/pci/if_devar.h
@@ -1,5 +1,5 @@
/* $NetBSD: if_devar.h,v 1.31 1998/09/29 22:40:52 matt Exp $ */
-/* $Id: if_devar.h,v 1.10 1998/10/13 09:05:58 peter Exp $ */
+/* $Id: if_devar.h,v 1.11 1998/10/14 08:31:27 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@@ -62,8 +62,16 @@ typedef bus_addr_t tulip_csrptr_t;
#define TULIP_PCI_CSRSIZE 8
#define TULIP_PCI_CSROFFSET 0
+#if !defined(__FreeBSD__) || __FreeBSD_version < 300000
+typedef u_long uintptr_t;
+#endif
+
#if !defined(__NetBSD__)
+#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
typedef pci_port_t tulip_csrptr_t;
+#else
+typedef u_int16_t tulip_csrptr_t;
+#endif
#define TULIP_CSR_READ(sc, csr) (inl((sc)->tulip_csrs.csr))
#define TULIP_CSR_WRITE(sc, csr, val) outl((sc)->tulip_csrs.csr, val)
@@ -943,7 +951,11 @@ static void tulip_softintr(void);
#if defined(__FreeBSD__)
typedef void ifnet_ret_t;
+#if __FreeBSD_version >= 300000
typedef u_long ioctl_cmd_t;
+#else
+typedef int ioctl_cmd_t;
+#endif
#if defined(TULIP_HDR_DATA)
static tulip_softc_t *tulips[TULIP_MAX_DEVICES];
#endif
OpenPOWER on IntegriCloud