Update qcamdriver to 1.1-release distribution.
- move the cdevsw structure back up front (sigh) - use __linux__ instead of LINUX
This commit is contained in:
parent
189a7acd97
commit
ae22f445c8
@ -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 */
|
||||
|
@ -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))
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user