summaryrefslogtreecommitdiffstats
path: root/sys/scsi/ssc.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/ssc.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/ssc.c')
-rw-r--r--sys/scsi/ssc.c67
1 files changed, 31 insertions, 36 deletions
diff --git a/sys/scsi/ssc.c b/sys/scsi/ssc.c
index d94def1..2a0988b 100644
--- a/sys/scsi/ssc.c
+++ b/sys/scsi/ssc.c
@@ -49,38 +49,49 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*End copyright
- * $Id: ssc.c,v 1.6 1995/11/29 14:41:03 julian Exp $
+ * $Id: ssc.c,v 1.7 1995/12/05 19:36:33 bde Exp $
*/
#include <sys/types.h>
+#include <sys/param.h>
#include <sys/conf.h>
-#include <scsi/scsiconf.h>
#include <sys/scsiio.h>
-
+#include <sys/kernel.h>
#include <sys/errno.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <sys/buf.h>
#include <sys/systm.h>
-
-#ifdef JREMOD
-#include <sys/kernel.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /*DEVFS*/
+#include <scsi/scsiconf.h>
+
+static d_open_t sscopen;
+static d_close_t sscclose;
+static d_ioctl_t sscioctl;
+
+extern d_open_t suopen;
+extern d_close_t suclose;
+extern d_ioctl_t suioctl;
+
#define CDEV_MAJOR 49
-#endif /*JREMOD*/
+struct cdevsw ssc_cdevsw =
+ { sscopen, sscclose, noread, nowrite, /*49*/
+ sscioctl, nostop, nullreset, nodevtotty,
+ noselect, nxmmap, nostrategy, "ssc", NULL, -1 };
static dev_t sscdev = NODEV;
-int sscopen(dev_t dev, int flag, int type, struct proc *p)
+static int
+sscopen(dev_t dev, int flag, int type, struct proc *p)
{
if (sscdev != NODEV)
return suopen(sscdev, flag, type, p);
return 0;
}
-int sscclose(dev_t dev, int fflag, int type, struct proc *p)
+static int
+sscclose(dev_t dev, int fflag, int type, struct proc *p)
{
if (sscdev != NODEV)
@@ -88,7 +99,8 @@ int sscclose(dev_t dev, int fflag, int type, struct proc *p)
return 0;
}
-int sscioctl(dev_t dev, int cmd, caddr_t data, int fflag, struct proc *p)
+static int
+sscioctl(dev_t dev, int cmd, caddr_t data, int fflag, struct proc *p)
{
if (cmd == SCIOCADDR)
{
@@ -121,42 +133,25 @@ int sscioctl(dev_t dev, int cmd, caddr_t data, int fflag, struct proc *p)
* good reason other than I'm not sure how you would use them.
*/
-
-#ifdef JREMOD
-struct cdevsw ssc_cdevsw =
- { sscopen, sscclose, noread, nowrite, /*49*/
- sscioctl, nostop, nullreset, nodevtotty,/* scsi super */
- noselect, nommap, nostrategy };
-
static ssc_devsw_installed = 0;
+static void *ssc_devfs_token;
-static void ssc_drvinit(void *unused)
+static void
+ssc_drvinit(void *unused)
{
dev_t dev;
- dev_t dev_chr;
if( ! ssc_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&ssc_cdevsw,NULL);
- dev_chr = dev;
-#if defined(BDEV_MAJOR)
- dev = makedev(BDEV_MAJOR,0);
- bdevsw_add(&dev,&ssc_bdevsw,NULL);
-#endif /*BDEV_MAJOR*/
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev,&ssc_cdevsw, NULL);
ssc_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*/
- "/", "ssc", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
- }
+ ssc_devfs_token = devfs_add_devsw(
+ "/scsi", "ssc", &ssc_cdevsw, 0,
+ DV_CHR, 0, 0, 0600);
#endif
}
}
SYSINIT(sscdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ssc_drvinit,NULL)
-#endif /* JREMOD */
-
OpenPOWER on IntegriCloud