From 5879dcdb05b9c66c5679c363a7a760e5813ee5e7 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Thu, 20 Aug 1998 06:10:42 +0000 Subject: [PATCH] Moved `nx' functions to the one place where they are used (su.c). They shouldn't be used there either. They should have gone away about 3 years ago when the statically initialized devswitches went away, but su.c unfortunately still frobs the cdevswitch in the old way. --- sys/kern/subr_xxx.c | 79 +---------------------------------------- sys/scsi/su.c | 85 +++++++++++++++++++++++++++++++++++++++++++-- sys/sys/conf.h | 15 +------- sys/sys/linedisc.h | 15 +------- 4 files changed, 85 insertions(+), 109 deletions(-) diff --git a/sys/kern/subr_xxx.c b/sys/kern/subr_xxx.c index 6145679f52e..e803032bdae 100644 --- a/sys/kern/subr_xxx.c +++ b/sys/kern/subr_xxx.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)subr_xxx.c 8.1 (Berkeley) 6/10/93 - * $Id: subr_xxx.c,v 1.9 1997/09/14 02:50:28 peter Exp $ + * $Id: subr_xxx.c,v 1.10 1998/06/07 17:11:38 dfr Exp $ */ /* @@ -208,80 +208,3 @@ nullclose(dev, flags, fmt, p) return (0); } - -/* - * Unconfigured devswitch functions (for unconfigured drivers). - * XXX may belong elsewhere. - */ - -int -nxopen(dev, flags, fmt, p) - dev_t dev; - int flags; - int fmt; - struct proc *p; -{ - - return (ENXIO); -} - -/* - * XXX all nx functions except nxopen() should probably go away. They - * probably can't be called for non-open devices. - */ - -int -nxclose(dev, flags, fmt, p) - dev_t dev; - int flags; - int fmt; - struct proc *p; -{ - - printf("nxclose(0x%x) called\n", dev); - return (ENXIO); -} - -int -nxread(dev, uio, ioflag) - dev_t dev; - struct uio *uio; - int ioflag; -{ - - printf("nxread(0x%x) called\n", dev); - return (ENXIO); -} - -int -nxwrite(dev, uio, ioflag) - dev_t dev; - struct uio *uio; - int ioflag; -{ - - printf("nxwrite(0x%x) called\n", dev); - return (ENXIO); -} - -int -nxioctl(dev, cmd, data, flags, p) - dev_t dev; - u_long cmd; - caddr_t data; - int flags; - struct proc *p; -{ - - printf("nxioctl(0x%x) called\n", dev); - return (ENXIO); -} - -int -nxdump(dev) - dev_t dev; -{ - - printf("nxdump(0x%x) called\n", dev); - return (ENXIO); -} diff --git a/sys/scsi/su.c b/sys/scsi/su.c index 587305a2521..785e83155c8 100644 --- a/sys/scsi/su.c +++ b/sys/scsi/su.c @@ -44,7 +44,7 @@ * SUCH DAMAGE. *End copyright * - * $Id: su.c,v 1.19 1998/06/07 17:12:54 dfr Exp $ + * $Id: su.c,v 1.20 1998/07/04 22:30:25 julian Exp $ * * Tabstops 4 * XXX devfs entries for this device should be handled by generic scsiconfig @@ -89,8 +89,20 @@ static struct cdevsw su_cdevsw = */ #define OLD_DEV(NEWDEV, OLDDEV) ((OLDDEV) | ((NEWDEV) & 0x080000FF)) -/* bnxio, cnxio: non existent device entries - */ +/* cnxio: non existent device entries. */ + +static d_open_t nxopen; +static d_close_t nxclose; +static d_read_t nxread; +static d_write_t nxwrite; +static d_ioctl_t nxioctl; +#define nxstop nostop /* one void return is as good as another */ +#define nxreset noreset /* one unused function is as good as another */ +#define nxdevtotty nodevtotty /* one NULL return is as good as another */ +#define nxmmap nommap /* one -1 return is as good as another */ +#define nxstrategy nostrategy /* one NULL value is as good as another */ +static d_dump_t nxdump; +#define nxpsize nopsize /* one NULL value is as good as another */ static struct cdevsw cnxio = { nxopen, @@ -263,6 +275,73 @@ supoll(dev_t dev, int events, struct proc *p) return (*devswp->d_poll)(base, events, p); } +static int +nxopen(dev, flags, fmt, p) + dev_t dev; + int flags; + int fmt; + struct proc *p; +{ + + return (ENXIO); +} + +static int +nxclose(dev, flags, fmt, p) + dev_t dev; + int flags; + int fmt; + struct proc *p; +{ + + printf("nxclose(0x%x) called\n", dev); + return (ENXIO); +} + +static int +nxread(dev, uio, ioflag) + dev_t dev; + struct uio *uio; + int ioflag; +{ + + printf("nxread(0x%x) called\n", dev); + return (ENXIO); +} + +static int +nxwrite(dev, uio, ioflag) + dev_t dev; + struct uio *uio; + int ioflag; +{ + + printf("nxwrite(0x%x) called\n", dev); + return (ENXIO); +} + +static int +nxioctl(dev, cmd, data, flags, p) + dev_t dev; + u_long cmd; + caddr_t data; + int flags; + struct proc *p; +{ + + printf("nxioctl(0x%x) called\n", dev); + return (ENXIO); +} + +static int +nxdump(dev) + dev_t dev; +{ + + printf("nxdump(0x%x) called\n", dev); + return (ENXIO); +} + static su_devsw_installed = 0; static void diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 0c65dc051e4..904e71e6783 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.5 (Berkeley) 1/9/95 - * $Id: conf.h,v 1.42 1998/06/25 11:27:56 phk Exp $ + * $Id: conf.h,v 1.43 1998/07/04 22:30:26 julian Exp $ */ #ifndef _SYS_CONF_H_ @@ -195,19 +195,6 @@ d_close_t nullclose; #define nullstop nostop /* one void return is as good as another */ #define nullreset noreset /* one unused function is as good as another */ -d_open_t nxopen; -d_close_t nxclose; -d_read_t nxread; -d_write_t nxwrite; -d_ioctl_t nxioctl; -#define nxstop nostop /* one void return is as good as another */ -#define nxreset noreset /* one unused function is as good as another */ -#define nxdevtotty nodevtotty /* one NULL return is as good as another */ -#define nxmmap nommap /* one -1 return is as good as another */ -#define nxstrategy nostrategy /* one NULL value is as good as another */ -d_dump_t nxdump; -#define nxpsize nopsize /* one NULL value is as good as another */ - l_read_t l_noread; l_write_t l_nowrite; diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h index 0c65dc051e4..904e71e6783 100644 --- a/sys/sys/linedisc.h +++ b/sys/sys/linedisc.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.5 (Berkeley) 1/9/95 - * $Id: conf.h,v 1.42 1998/06/25 11:27:56 phk Exp $ + * $Id: conf.h,v 1.43 1998/07/04 22:30:26 julian Exp $ */ #ifndef _SYS_CONF_H_ @@ -195,19 +195,6 @@ d_close_t nullclose; #define nullstop nostop /* one void return is as good as another */ #define nullreset noreset /* one unused function is as good as another */ -d_open_t nxopen; -d_close_t nxclose; -d_read_t nxread; -d_write_t nxwrite; -d_ioctl_t nxioctl; -#define nxstop nostop /* one void return is as good as another */ -#define nxreset noreset /* one unused function is as good as another */ -#define nxdevtotty nodevtotty /* one NULL return is as good as another */ -#define nxmmap nommap /* one -1 return is as good as another */ -#define nxstrategy nostrategy /* one NULL value is as good as another */ -d_dump_t nxdump; -#define nxpsize nopsize /* one NULL value is as good as another */ - l_read_t l_noread; l_write_t l_nowrite;