summaryrefslogtreecommitdiffstats
path: root/sys/pci/meteor.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-12-08 11:19:42 +0000
committerjulian <julian@FreeBSD.org>1995-12-08 11:19:42 +0000
commit1900eea896e2aaeae8a9fa8affa5fded2068c9b4 (patch)
tree5150d199464d64c1021f91b2c2f112d48546a8bf /sys/pci/meteor.c
parentaaf9d7f10ecc63adae1dc4f55cfd31a2926c605a (diff)
downloadFreeBSD-src-1900eea896e2aaeae8a9fa8affa5fded2068c9b4.zip
FreeBSD-src-1900eea896e2aaeae8a9fa8affa5fded2068c9b4.tar.gz
Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are in the same file as their devsw structure. I've also added DEVFS support for nearly every device in the system, however many of the devices have 'incorrect' names under DEVFS because I couldn't quickly work out the correct naming conventions. (but devfs won't be coming on line for a month or so anyhow so that doesn't matter) If you "OWN" a device which would normally have an entry in /dev then search for the devfs_add_devsw() entries and munge to make them right.. check out similar devices to see what I might have done in them in you can't see what's going on.. for a laugh compare conf.c conf.h defore and after... :) I have not doen DEVFS entries for any DISKSLICE devices yet as that will be a much more complicated job.. (pass 5 :) pass 4 will be to make the devsw tables of type (cdevsw * ) rather than (cdevsw) seems to work here.. complaints to the usual places.. :)
Diffstat (limited to 'sys/pci/meteor.c')
-rw-r--r--sys/pci/meteor.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c
index b964503..f12173b 100644
--- a/sys/pci/meteor.c
+++ b/sys/pci/meteor.c
@@ -60,6 +60,9 @@
#include <sys/signalvar.h>
#include <sys/devconf.h>
#include <sys/mman.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /* DEVFS */
#include <machine/clock.h>
#include <vm/vm.h>
@@ -74,14 +77,6 @@
#endif
#include <machine/ioctl_meteor.h>
-#ifdef JREMOD
-#include <sys/conf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif /* DEVFS */
-#define CDEV_MAJOR 67
-#endif /* JREMOD */
-
extern int meteor_intr __P((void *arg));
@@ -148,6 +143,9 @@ typedef struct {
#define METEOR_SINGLE_ODD 0x00200000
#define METEOR_SINGLE_MASK 0x00300000
u_char saa7196_i2c[NUM_SAA7196_I2C_REGS]; /* saa7196 register values */
+#ifdef DEVFS
+ void *devfs_token;
+#endif
} meteor_reg_t;
meteor_reg_t meteor[NMETEOR];
@@ -175,6 +173,20 @@ struct pci_device met_device = {
DATA_SET (pcidevice_set, met_device);
+static d_open_t meteor_open;
+static d_close_t meteor_close;
+static d_read_t meteor_read;
+static d_write_t meteor_write;
+static d_ioctl_t meteor_ioctl;
+static d_mmap_t meteor_mmap;
+
+#define CDEV_MAJOR 67
+struct cdevsw meteor_cdevsw =
+ { meteor_open, meteor_close, meteor_read, meteor_write, /*67*/
+ meteor_ioctl, nostop, nullreset, nodevtotty,/* Meteor */
+ seltrue, meteor_mmap, NULL, "meteor", NULL, -1 };
+
+
static u_long saa7116_pci_default[NUM_SAA7116_PCI_REGS] = {
/* PCI Memory registers */
/* BITS Type Description */
@@ -630,6 +642,10 @@ static void met_attach(pcici_t tag, int unit)
mtr->rows = 480;
mtr->depth = 2; /* two bytes per pixel */
mtr->frames = 1; /* one frame */
+#ifdef DEVFS
+ mtr->devfs_token = devfs_add_devsw( "/", "meteor", &meteor_cdevsw, unit,
+ DV_CHR, 0, 0, 0600);
+#endif
}
static void
@@ -1265,12 +1281,6 @@ meteor_mmap(dev_t dev, int offset, int nprot)
}
-#ifdef JREMOD
-struct cdevsw meteor_cdevsw =
- { meteor_open, meteor_close, meteor_read, meteor_write, /*67*/
- meteor_ioctl, nostop, nullreset, nodevtotty,/* Meteor */
- seltrue, meteor_mmap, NULL };
-
static meteor_devsw_installed = 0;
static void meteor_drvinit(void *unused)
@@ -1278,23 +1288,12 @@ static void meteor_drvinit(void *unused)
dev_t dev;
if( ! meteor_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&meteor_cdevsw,NULL);
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev,&meteor_cdevsw, NULL);
meteor_devsw_installed = 1;
-#ifdef DEVFS
- {
- int x;
-/* default for a simple device with no probe routine (usually delete this) */
- x=devfs_add_devsw(
-/* path name devsw minor type uid gid perm*/
- "/", "meteor", major(dev), 0, DV_CHR, 0, 0, 0600);
- }
-#endif
}
}
SYSINIT(meteordev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,meteor_drvinit,NULL)
-#endif /* JREMOD */
-
#endif /* NMETEOR > 0 */
OpenPOWER on IntegriCloud