summaryrefslogtreecommitdiffstats
path: root/sys/scsi/uk.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/scsi/uk.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/scsi/uk.c')
-rw-r--r--sys/scsi/uk.c52
1 files changed, 22 insertions, 30 deletions
diff --git a/sys/scsi/uk.c b/sys/scsi/uk.c
index 0cf4cf6..53302e2 100644
--- a/sys/scsi/uk.c
+++ b/sys/scsi/uk.c
@@ -2,7 +2,7 @@
* Driver for a device we can't identify.
* by Julian Elischer (julian@tfs.com)
*
- * $Id: uk.c,v 1.10 1995/11/29 10:49:07 julian Exp $
+ * $Id: uk.c,v 1.11 1995/11/29 14:41:07 julian Exp $
*
* If you find that you are adding any code to this file look closely
* at putting it in "scsi_driver.c" instead.
@@ -10,34 +10,41 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <scsi/scsi_all.h>
-#include <scsi/scsiconf.h>
-#ifdef JREMOD
#include <sys/conf.h>
#include <sys/kernel.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /*DEVFS*/
-#define CDEV_MAJOR 31
-#endif /*JREMOD*/
+#include <scsi/scsi_all.h>
+#include <scsi/scsiconf.h>
+static d_open_t ukopen;
+static d_close_t ukclose;
+static d_ioctl_t ukioctl;
+
+#define CDEV_MAJOR 31
+struct cdevsw uk_cdevsw =
+ { ukopen, ukclose, noread, nowrite, /*31*/
+ ukioctl, nostop, nullreset, nodevtotty,/* unknown */
+ seltrue, nommap, NULL, "uk" ,NULL, -1 };
+
SCSI_DEVICE_ENTRIES(uk)
struct scsi_device uk_switch =
{
- NULL,
- NULL,
- NULL,
- NULL,
- "uk",
- 0,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uk",
+ 0,
{0, 0},
SDEV_ONCE_ONLY, /* Only one open allowed */
0,
"Unknown",
ukopen,
- 0,
+ 0,
T_UNKNOWN,
0,
0,
@@ -47,11 +54,6 @@ struct scsi_device uk_switch =
0,
};
-#ifdef JREMOD
-struct cdevsw uk_cdevsw =
- { ukopen, ukclose, noread, nowrite, /*31*/
- ukioctl, nostop, nullreset, nodevtotty,/* unknown */
- seltrue, nommap, NULL }; /* scsi */
static uk_devsw_installed = 0;
@@ -60,22 +62,12 @@ static void uk_drvinit(void *unused)
dev_t dev;
if( ! uk_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&uk_cdevsw,NULL);
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev,&uk_cdevsw, NULL);
uk_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*/
- "/", "uk", major(dev), 0, DV_CHR, 0, 0, 0600);
- }
-#endif
}
}
SYSINIT(ukdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,uk_drvinit,NULL)
-#endif /* JREMOD */
OpenPOWER on IntegriCloud