summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1996-05-06 16:47:28 +0000
committerpst <pst@FreeBSD.org>1996-05-06 16:47:28 +0000
commitae22f445c84c3ff5826c4c31d68b358eca48be65 (patch)
treef77d125caeb008464d38500b313f1126fc2231c6
parent189a7acd97b0dda15dbb8037095cc14f0860045f (diff)
downloadFreeBSD-src-ae22f445c84c3ff5826c4c31d68b358eca48be65.zip
FreeBSD-src-ae22f445c84c3ff5826c4c31d68b358eca48be65.tar.gz
Update qcamdriver to 1.1-release distribution.
- move the cdevsw structure back up front (sigh) - use __linux__ instead of LINUX
-rw-r--r--sys/i386/isa/qcam.c82
-rw-r--r--sys/i386/isa/qcamdefs.h2
-rw-r--r--sys/i386/isa/qcamio.c4
3 files changed, 46 insertions, 42 deletions
diff --git a/sys/i386/isa/qcam.c b/sys/i386/isa/qcam.c
index 526b178..a2fd292 100644
--- a/sys/i386/isa/qcam.c
+++ b/sys/i386/isa/qcam.c
@@ -61,9 +61,48 @@
running in a kernel that has eliminated the cdevsw table (yea!) */
#if defined(__FreeBSD__) && defined(nostrategy)
+
+#define CDEV_MAJOR 73
#define STATIC_CDEVSW static
-#define PRIVATE_CDEVSW
-#else
+
+static d_open_t qcam_open;
+static d_close_t qcam_close;
+static d_read_t qcam_read;
+static d_ioctl_t qcam_ioctl;
+
+static struct cdevsw qcam_cdevsw =
+ { qcam_open, qcam_close, qcam_read, nowrite,
+ qcam_ioctl, nostop, nullreset, nodevtotty,
+ noselect, nommap, nostrategy, "qcam",
+ NULL, -1 };
+
+static int qcam_probe(struct isa_device *devp);
+static int qcam_attach(struct isa_device *devp);
+
+struct isa_driver qcamdriver =
+ {qcam_probe, qcam_attach, "qcam"};
+
+/*
+ * Initialize the dynamic cdevsw hooks.
+ */
+static void
+qcam_drvinit (void *unused)
+{
+ static int qcam_devsw_installed = 0;
+ dev_t dev;
+
+ if (!qcam_devsw_installed) {
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev,&qcam_cdevsw, NULL);
+ qcam_devsw_installed++;
+ }
+}
+
+SYSINIT(qcamdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,qcam_drvinit,NULL)
+
+#endif /* new FreeBSD configuration system */
+
+#ifndef STATIC_CDEVSW
#define STATIC_CDEVSW
#endif
@@ -74,6 +113,8 @@ static struct qcam_softc qcam_softc[NQCAM];
#define QC_CONF_NODETECT 0x01 /* always assume camera is present */
#define QC_CONF_FORCEUNI 0x02 /* force unidirectional transfers */
+#define UNIT(dev) minor(dev)
+
static struct kern_devconf kdc_qcam_template = {
0, 0, 0, /* filled in by dev_attach() */
"qcam", /* kdc_name */
@@ -94,8 +135,6 @@ static struct kern_devconf kdc_qcam_template = {
DC_CLS_MISC /* class */
};
-#define UNIT(dev) minor(dev)
-
static void
qcam_registerdev (struct isa_device *id)
{
@@ -260,40 +299,6 @@ qcam_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return 0;
}
-#ifdef __FreeBSD__
-struct isa_driver qcamdriver =
- {qcam_probe, qcam_attach, "qcam"};
-
-#ifdef PRIVATE_CDEVSW /* new configuration system? */
-
-#define CDEV_MAJOR 73
-
-static struct cdevsw qcam_cdevsw =
- { qcam_open, qcam_close, qcam_read, nowrite,
- qcam_ioctl, nostop, nullreset, nodevtotty,
- noselect, nommap, nostrategy, "qcam",
- NULL, -1 };
-
-/*
- * Initialize the dynamic cdevsw hooks.
- */
-static void
-qcam_drvinit (void *unused)
-{
- static int qcam_devsw_installed = 0;
- dev_t dev;
-
- if (!qcam_devsw_installed) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&qcam_cdevsw, NULL);
- qcam_devsw_installed++;
- }
-}
-
-SYSINIT(qcamdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,qcam_drvinit,NULL)
-
-#endif /* new configuration system */
-
#ifdef QCAM_MODULE
#include <sys/exec.h>
@@ -358,5 +363,4 @@ qcam_mod (struct lkm_table *lkmtp, int cmd, int ver)
}
#endif /* QCAM_MODULE */
-#endif /* FreeBSD */
#endif /* NQCAM */
diff --git a/sys/i386/isa/qcamdefs.h b/sys/i386/isa/qcamdefs.h
index e026a62..ef80269 100644
--- a/sys/i386/isa/qcamdefs.h
+++ b/sys/i386/isa/qcamdefs.h
@@ -84,7 +84,7 @@ struct qcam_softc {
#define QC_MAXFRAMEBUFSIZE (QC_MAX_XSIZE*QC_MAX_YSIZE)
-#ifdef LINUX /* Linux is backwards from *BSD */
+#ifdef __linux__ /* Linux is backwards from *BSD */
#define read_data(P) inb((P))
#define read_data_word(P) inw((P))
diff --git a/sys/i386/isa/qcamio.c b/sys/i386/isa/qcamio.c
index 53cc4c7..c3eb615 100644
--- a/sys/i386/isa/qcamio.c
+++ b/sys/i386/isa/qcamio.c
@@ -63,7 +63,7 @@
#include "qcam.h"
#endif /* bsdi */
-#ifdef LINUX
+#ifdef __linux__
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
@@ -71,7 +71,7 @@
#include <asm/io.h>
#include "qcam-linux.h"
#include "qcam.h"
-#endif /* LINUX */
+#endif /* __linux__ */
#ifdef _SCO_DS
#include <limits.h>
OpenPOWER on IntegriCloud