close() is no longer a SLICE method.
Close is simply an open with no-read and no-write once internal to SLICE (it still exports a close to the rest of the kernel)
This commit is contained in:
parent
4bc57bd94f
commit
26d3bf5f1b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35386
@ -43,7 +43,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fd.c,v 1.108 1998/04/17 22:36:31 des Exp $
|
||||
* $Id: fd.c,v 1.109 1998/04/19 23:31:41 julian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -318,7 +318,7 @@ static struct isa_device *fdcdevs[NFDC];
|
||||
static sl_h_IO_req_t fdsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t fdsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t fdsopen; /* downwards travelling open */
|
||||
static sl_h_close_t fdsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t fdsclose; */ /* downwards travelling close */
|
||||
static void fdsinit(void *);
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
@ -330,7 +330,7 @@ static struct slice_handler slicetype = {
|
||||
&fdsIOreq,
|
||||
&fdsioctl,
|
||||
&fdsopen,
|
||||
&fdsclose,
|
||||
/*&fdsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -2195,9 +2195,14 @@ fdsopen(void *private, int flags, int mode, struct proc *p)
|
||||
|
||||
sd = private;
|
||||
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
if((flags & (FREAD|FWRITE)) != 0) {
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
} else {
|
||||
return(fdclose(makedev(0,sd->minor), 0 , 0, p));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -2208,6 +2213,7 @@ fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
fdclose(makedev(0,sd->minor), 0 , 0, p);
|
||||
return ;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
#endif /* SLICE */
|
||||
#endif
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: $
|
||||
* $Id: disklabel.c,v 1.1 1998/04/19 23:31:03 julian Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ static sl_h_constructor_t dkl_constructor; /* constructor (from device) */
|
||||
static sl_h_IO_req_t dkl_IOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t dkl_ioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t dkl_open; /* downwards travelling open */
|
||||
static sl_h_close_t dkl_close; /* downwards travelling close */
|
||||
/*static sl_h_close_t dkl_close; */ /* downwards travelling close */
|
||||
static sl_h_claim_t dkl_claim; /* upwards travelling claim */
|
||||
static sl_h_revoke_t dkl_revoke;/* upwards travelling revokation */
|
||||
static sl_h_verify_t dkl_verify;/* things changed, are we stil valid? */
|
||||
@ -78,7 +78,7 @@ static struct slice_handler slicetype = {
|
||||
&dkl_IOreq,
|
||||
&dkl_ioctl,
|
||||
&dkl_open,
|
||||
&dkl_close,
|
||||
/*&dkl_close*/NULL,
|
||||
&dkl_revoke, /* revoke */
|
||||
&dkl_claim, /* claim */
|
||||
&dkl_verify, /* verify */
|
||||
@ -658,6 +658,7 @@ RR;
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
dkl_close(void *private, int flags, int mode, struct proc * p)
|
||||
{
|
||||
@ -701,6 +702,7 @@ RR;
|
||||
pd->savedoflags = newoflags;
|
||||
return ;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
static int
|
||||
dkl_ioctl(void *private, int cmd, caddr_t addr, int flag, struct proc * p)
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: $
|
||||
* $Id: mbr.c,v 1.1 1998/04/19 23:31:05 julian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -80,7 +80,7 @@ static sl_h_constructor_t mbr_constructor; /* constructor (from device) */
|
||||
static sl_h_IO_req_t mbr_IOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t mbr_ioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t mbr_open; /* downwards travelling open */
|
||||
static sl_h_close_t mbr_close; /* downwards travelling close */
|
||||
/*static sl_h_close_t mbr_close; */ /* downwards travelling close */
|
||||
static sl_h_claim_t mbr_claim; /* upwards travelling claim */
|
||||
static sl_h_revoke_t mbr_revoke;/* upwards travelling revokation */
|
||||
static sl_h_verify_t mbr_verify;/* things changed, are we stil valid? */
|
||||
@ -95,7 +95,7 @@ static struct slice_handler slicetype = {
|
||||
&mbr_IOreq,
|
||||
&mbr_ioctl,
|
||||
&mbr_open,
|
||||
&mbr_close,
|
||||
/*&mbr_close*/NULL,
|
||||
&mbr_revoke, /* revoke */
|
||||
&mbr_claim, /* claim */
|
||||
&mbr_verify, /* verify */
|
||||
@ -761,6 +761,7 @@ RR;
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
mbr_close(void *private, int flags, int mode, struct proc * p)
|
||||
{
|
||||
@ -801,6 +802,7 @@ RR;
|
||||
pd->savedoflags = newoflags;
|
||||
return ;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
static int
|
||||
mbr_ioctl(void *private, int cmd, caddr_t addr, int flag, struct proc * p)
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: slice_base.c,v 1.1 1998/04/19 23:31:12 julian Exp $
|
||||
* $Id: slice_base.c,v 1.2 1998/04/22 01:51:34 julian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -575,6 +575,31 @@ sliceopen(struct slice *slice, int flags, int mode,
|
||||
}
|
||||
slice->flags &= ~SLF_OPEN_STATE;
|
||||
slice->flags |= sl_flags;
|
||||
#if 1 /* it was basically a close */
|
||||
if ((slice->flags & SLF_OPEN_STATE) == SLF_CLOSED) {
|
||||
sh_p tp;
|
||||
|
||||
/*
|
||||
* If we had an upper handler, ask it to check if it's still
|
||||
* valid. it may decide to self destruct.
|
||||
*/
|
||||
if (slice->handler_up) {
|
||||
(*slice->handler_up->verify)(slice);
|
||||
}
|
||||
/*
|
||||
* If we don't have an upper handler, check if
|
||||
* maybe there is now a suitable environment for one.
|
||||
* We may end up with a different handler
|
||||
* from what we had above. Maybe we should clear the hint?
|
||||
* Maybe we should ask the lower one to re-issue the request?
|
||||
*/
|
||||
if (slice->handler_up == NULL) {
|
||||
if ((tp = slice_probeall(slice)) != NULL) {
|
||||
(*tp->constructor)(slice);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
reject:
|
||||
unlockslice(slice);
|
||||
if ((slice->flags & SLF_INVALID) == SLF_INVALID)
|
||||
@ -583,6 +608,7 @@ sliceopen(struct slice *slice, int flags, int mode,
|
||||
return (error);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
sliceclose(struct slice *slice, int flags, int mode,
|
||||
struct proc * p, enum slc_who who)
|
||||
@ -643,7 +669,7 @@ sliceclose(struct slice *slice, int flags, int mode,
|
||||
sl_unref(slice);
|
||||
return ;
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
/*
|
||||
* control behaviour of slices WRT sharing:
|
||||
|
@ -23,8 +23,9 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: $
|
||||
* $Id: slice_device.c,v 1.1 1998/04/19 23:31:14 julian Exp $
|
||||
*/
|
||||
#define DIAGNOSTIC 1
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -140,26 +141,7 @@ minor_to_slice(unsigned int minor)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Macro to check that the unit number is valid Often this isn't needed as
|
||||
* once the open() is performed, the unit number is pretty much safe.. The
|
||||
* exception would be if we implemented devices that could "go away". in
|
||||
* which case all these routines would be wise to check the number,
|
||||
* DIAGNOSTIC or not.
|
||||
*/
|
||||
#define CHECKUNIT() \
|
||||
do { /* the do-while is a safe way to do this grouping */ \
|
||||
if (slice == NULL) { \
|
||||
printf( __FUNCTION__ ": unit not attached\n", unit); \
|
||||
panic ("slice"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
#define CHECKUNIT_DIAG() CHECKUNIT()
|
||||
#else /* DIAGNOSTIC */
|
||||
#define CHECKUNIT_DIAG()
|
||||
#endif /* DIAGNOSTIC */
|
||||
|
||||
int
|
||||
slcdevioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc * p)
|
||||
@ -167,7 +149,6 @@ slcdevioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc * p)
|
||||
sl_p slice = minor_to_slice(minor(dev));
|
||||
int error = 0;
|
||||
|
||||
CHECKUNIT_DIAG();
|
||||
RR;
|
||||
|
||||
/*
|
||||
@ -246,8 +227,15 @@ slcdevclose(dev_t dev, int flags, int mode, struct proc * p)
|
||||
{
|
||||
sl_p slice = minor_to_slice(minor(dev));
|
||||
RR;
|
||||
CHECKUNIT_DIAG();
|
||||
sliceclose(slice, flags, mode, p, SLW_DEVICE);
|
||||
#ifdef DIAGNOSTIC
|
||||
if ((flags & (FWRITE | FREAD)) != 0) {
|
||||
printf("sliceclose called with non 0 flags\n");
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Close is just an open for non-read/nonwrite in this context.
|
||||
*/
|
||||
sliceopen(slice, 0, mode, p, SLW_DEVICE);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
* from: Utah Hdr: vn.c 1.13 94/04/02
|
||||
*
|
||||
* from: @(#)vn.c 8.6 (Berkeley) 4/1/94
|
||||
* $Id: vn.c,v 1.55 1998/02/20 13:27:36 bde Exp $
|
||||
* $Id: vn.c,v 1.56 1998/04/19 23:31:21 julian Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -113,7 +113,7 @@ static struct bdevsw vn_bdevsw =
|
||||
static sl_h_IO_req_t nvsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t nvsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t nvsopen; /* downwards travelling open */
|
||||
static sl_h_close_t nvsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t nvsclose; */ /* downwards travelling close */
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
"vn",
|
||||
@ -124,7 +124,7 @@ static struct slice_handler slicetype = {
|
||||
&nvsIOreq,
|
||||
&nvsioctl,
|
||||
&nvsopen,
|
||||
&nvsclose,
|
||||
/*&nvsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -913,6 +913,7 @@ nvsopen(void *private, int flags, int mode, struct proc *p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
nvsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -924,6 +925,7 @@ nvsclose(void *private, int flags, int mode, struct proc *p)
|
||||
makedev(0,vn->mynor) , flags, mode, p);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
nvsioctl( void *private, int cmd, caddr_t addr, int flag, struct proc *p)
|
||||
|
@ -43,7 +43,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fd.c,v 1.108 1998/04/17 22:36:31 des Exp $
|
||||
* $Id: fd.c,v 1.109 1998/04/19 23:31:41 julian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -318,7 +318,7 @@ static struct isa_device *fdcdevs[NFDC];
|
||||
static sl_h_IO_req_t fdsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t fdsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t fdsopen; /* downwards travelling open */
|
||||
static sl_h_close_t fdsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t fdsclose; */ /* downwards travelling close */
|
||||
static void fdsinit(void *);
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
@ -330,7 +330,7 @@ static struct slice_handler slicetype = {
|
||||
&fdsIOreq,
|
||||
&fdsioctl,
|
||||
&fdsopen,
|
||||
&fdsclose,
|
||||
/*&fdsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -2195,9 +2195,14 @@ fdsopen(void *private, int flags, int mode, struct proc *p)
|
||||
|
||||
sd = private;
|
||||
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
if((flags & (FREAD|FWRITE)) != 0) {
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
} else {
|
||||
return(fdclose(makedev(0,sd->minor), 0 , 0, p));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -2208,6 +2213,7 @@ fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
fdclose(makedev(0,sd->minor), 0 , 0, p);
|
||||
return ;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
#endif /* SLICE */
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
|
||||
* $Id: wd.c,v 1.158 1998/04/19 03:26:05 peter Exp $
|
||||
* $Id: wd.c,v 1.159 1998/04/19 23:31:44 julian Exp $
|
||||
*/
|
||||
|
||||
/* TODO:
|
||||
@ -82,6 +82,7 @@
|
||||
#ifdef DEVFS
|
||||
#ifdef SLICE
|
||||
#include <sys/device.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <dev/slice/slice.h>
|
||||
#else
|
||||
#include <sys/devfsext.h>
|
||||
@ -260,7 +261,7 @@ struct isa_driver wdcdriver = {
|
||||
static sl_h_IO_req_t wdsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t wdsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t wdsopen; /* downwards travelling open */
|
||||
static sl_h_close_t wdsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t wdsclose; */ /* downwards travelling close */
|
||||
static void wds_init(void*);
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
@ -272,7 +273,7 @@ static struct slice_handler slicetype = {
|
||||
&wdsIOreq,
|
||||
&wdsioctl,
|
||||
&wdsopen,
|
||||
&wdsclose,
|
||||
/*&wdsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -697,7 +698,11 @@ wds_init(void *arg)
|
||||
(*tp->constructor)(du->slice);
|
||||
}
|
||||
config_intrhook_disestablish(&du->ich);
|
||||
#if 0
|
||||
wdsclose(du, 0, 0, curproc);
|
||||
#else
|
||||
wdsopen(du, 0, 0, curproc); /* open to 0 flags == close */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2692,21 +2697,25 @@ wdsopen(void *private, int flags, int mode, struct proc *p)
|
||||
|
||||
du = private;
|
||||
|
||||
/* Finish flushing IRQs left over from wdattach(). */
|
||||
if ((flags & (FREAD|FWRITE)) != 0) {
|
||||
/* Finish flushing IRQs left over from wdattach(). */
|
||||
#ifdef CMD640
|
||||
if (wdtab[du->dk_ctrlr_cmd640].b_active == 2)
|
||||
wdtab[du->dk_ctrlr_cmd640].b_active = 0;
|
||||
if (wdtab[du->dk_ctrlr_cmd640].b_active == 2)
|
||||
wdtab[du->dk_ctrlr_cmd640].b_active = 0;
|
||||
#else
|
||||
if (wdtab[du->dk_ctrlr].b_active == 2)
|
||||
wdtab[du->dk_ctrlr].b_active = 0;
|
||||
if (wdtab[du->dk_ctrlr].b_active == 2)
|
||||
wdtab[du->dk_ctrlr].b_active = 0;
|
||||
#endif
|
||||
|
||||
du->dk_state = OPEN;
|
||||
du->dk_flags &= ~DKFL_BADSCAN;
|
||||
|
||||
du->dk_state = OPEN;
|
||||
du->dk_flags &= ~DKFL_BADSCAN;
|
||||
} else {
|
||||
du->dk_state = CLOSED;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
wdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -2716,6 +2725,7 @@ wdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
du->dk_state = CLOSED;
|
||||
return;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
static int
|
||||
wdsioctl( void *private, int cmd, caddr_t addr, int flag, struct proc *p)
|
||||
|
14
sys/isa/fd.c
14
sys/isa/fd.c
@ -43,7 +43,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fd.c,v 1.108 1998/04/17 22:36:31 des Exp $
|
||||
* $Id: fd.c,v 1.109 1998/04/19 23:31:41 julian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -318,7 +318,7 @@ static struct isa_device *fdcdevs[NFDC];
|
||||
static sl_h_IO_req_t fdsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t fdsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t fdsopen; /* downwards travelling open */
|
||||
static sl_h_close_t fdsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t fdsclose; */ /* downwards travelling close */
|
||||
static void fdsinit(void *);
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
@ -330,7 +330,7 @@ static struct slice_handler slicetype = {
|
||||
&fdsIOreq,
|
||||
&fdsioctl,
|
||||
&fdsopen,
|
||||
&fdsclose,
|
||||
/*&fdsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -2195,9 +2195,14 @@ fdsopen(void *private, int flags, int mode, struct proc *p)
|
||||
|
||||
sd = private;
|
||||
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
if((flags & (FREAD|FWRITE)) != 0) {
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
} else {
|
||||
return(fdclose(makedev(0,sd->minor), 0 , 0, p));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -2208,6 +2213,7 @@ fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
fdclose(makedev(0,sd->minor), 0 , 0, p);
|
||||
return ;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
#endif /* SLICE */
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fd.c,v 1.28 1998/04/17 22:37:00 des Exp $
|
||||
* $Id: fd.c,v 1.29 1998/04/20 13:50:58 kato Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -413,7 +413,7 @@ static struct isa_device *fdcdevs[NFDC];
|
||||
static sl_h_IO_req_t fdsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t fdsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t fdsopen; /* downwards travelling open */
|
||||
static sl_h_close_t fdsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t fdsclose; */ /* downwards travelling close */
|
||||
static void fdsinit(void *);
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
@ -425,7 +425,7 @@ static struct slice_handler slicetype = {
|
||||
&fdsIOreq,
|
||||
&fdsioctl,
|
||||
&fdsopen,
|
||||
&fdsclose,
|
||||
/*&fdsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -2628,9 +2628,14 @@ fdsopen(void *private, int flags, int mode, struct proc *p)
|
||||
|
||||
sd = private;
|
||||
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
if((flags & (FREAD|FWRITE)) != 0) {
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
} else {
|
||||
return(fdclose(makedev(0,sd->minor), 0 , 0, p));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -2641,6 +2646,7 @@ fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
fdclose(makedev(0,sd->minor), 0 , 0, p);
|
||||
return ;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
#endif /* SLICE */
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fd.c,v 1.28 1998/04/17 22:37:00 des Exp $
|
||||
* $Id: fd.c,v 1.29 1998/04/20 13:50:58 kato Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -413,7 +413,7 @@ static struct isa_device *fdcdevs[NFDC];
|
||||
static sl_h_IO_req_t fdsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t fdsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t fdsopen; /* downwards travelling open */
|
||||
static sl_h_close_t fdsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t fdsclose; */ /* downwards travelling close */
|
||||
static void fdsinit(void *);
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
@ -425,7 +425,7 @@ static struct slice_handler slicetype = {
|
||||
&fdsIOreq,
|
||||
&fdsioctl,
|
||||
&fdsopen,
|
||||
&fdsclose,
|
||||
/*&fdsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -2628,9 +2628,14 @@ fdsopen(void *private, int flags, int mode, struct proc *p)
|
||||
|
||||
sd = private;
|
||||
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
if((flags & (FREAD|FWRITE)) != 0) {
|
||||
return(Fdopen(makedev(0,sd->minor), 0 , 0, p));
|
||||
} else {
|
||||
return(fdclose(makedev(0,sd->minor), 0 , 0, p));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -2641,6 +2646,7 @@ fdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
fdclose(makedev(0,sd->minor), 0 , 0, p);
|
||||
return ;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
#endif /* SLICE */
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
|
||||
* $Id: wd.c,v 1.47 1998/04/13 08:35:37 kato Exp $
|
||||
* $Id: wd.c,v 1.48 1998/04/20 13:51:34 kato Exp $
|
||||
*/
|
||||
|
||||
/* TODO:
|
||||
@ -82,6 +82,7 @@
|
||||
#ifdef DEVFS
|
||||
#ifdef SLICE
|
||||
#include <sys/device.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <dev/slice/slice.h>
|
||||
#else
|
||||
#include <sys/devfsext.h>
|
||||
@ -286,7 +287,7 @@ struct isa_driver wdcdriver = {
|
||||
static sl_h_IO_req_t wdsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t wdsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t wdsopen; /* downwards travelling open */
|
||||
static sl_h_close_t wdsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t wdsclose; */ /* downwards travelling close */
|
||||
static void wds_init(void*);
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
@ -298,7 +299,7 @@ static struct slice_handler slicetype = {
|
||||
&wdsIOreq,
|
||||
&wdsioctl,
|
||||
&wdsopen,
|
||||
&wdsclose,
|
||||
/*&wdsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -779,7 +780,11 @@ wds_init(void *arg)
|
||||
(*tp->constructor)(du->slice);
|
||||
}
|
||||
config_intrhook_disestablish(&du->ich);
|
||||
#if 0
|
||||
wdsclose(du, 0, 0, curproc);
|
||||
#else
|
||||
wdsopen(du, 0, 0, curproc); /* open to 0 flags == close */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2955,21 +2960,25 @@ wdsopen(void *private, int flags, int mode, struct proc *p)
|
||||
|
||||
du = private;
|
||||
|
||||
/* Finish flushing IRQs left over from wdattach(). */
|
||||
if ((flags & (FREAD|FWRITE)) != 0) {
|
||||
/* Finish flushing IRQs left over from wdattach(). */
|
||||
#ifdef CMD640
|
||||
if (wdtab[du->dk_ctrlr_cmd640].b_active == 2)
|
||||
wdtab[du->dk_ctrlr_cmd640].b_active = 0;
|
||||
if (wdtab[du->dk_ctrlr_cmd640].b_active == 2)
|
||||
wdtab[du->dk_ctrlr_cmd640].b_active = 0;
|
||||
#else
|
||||
if (wdtab[du->dk_ctrlr].b_active == 2)
|
||||
wdtab[du->dk_ctrlr].b_active = 0;
|
||||
if (wdtab[du->dk_ctrlr].b_active == 2)
|
||||
wdtab[du->dk_ctrlr].b_active = 0;
|
||||
#endif
|
||||
|
||||
du->dk_state = OPEN;
|
||||
du->dk_flags &= ~DKFL_BADSCAN;
|
||||
|
||||
du->dk_state = OPEN;
|
||||
du->dk_flags &= ~DKFL_BADSCAN;
|
||||
} else {
|
||||
du->dk_state = CLOSED;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
wdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -2979,6 +2988,7 @@ wdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
du->dk_state = CLOSED;
|
||||
return;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
static int
|
||||
wdsioctl( void *private, int cmd, caddr_t addr, int flag, struct proc *p)
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
|
||||
*
|
||||
* $Id: sd.c,v 1.123 1998/04/17 22:37:10 des Exp $
|
||||
* $Id: sd.c,v 1.124 1998/04/19 23:32:36 julian Exp $
|
||||
*/
|
||||
|
||||
#include "opt_bounce.h"
|
||||
@ -36,6 +36,7 @@
|
||||
#include <sys/devfsext.h>
|
||||
#ifdef SLICE
|
||||
#include <sys/device.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <dev/slice/slice.h>
|
||||
#endif /* SLICE */
|
||||
#endif /* DEVFS */
|
||||
@ -141,7 +142,7 @@ static struct bdevsw sd_bdevsw =
|
||||
static sl_h_IO_req_t sdsIOreq; /* IO req downward (to device) */
|
||||
static sl_h_ioctl_t sdsioctl; /* ioctl req downward (to device) */
|
||||
static sl_h_open_t sdsopen; /* downwards travelling open */
|
||||
static sl_h_close_t sdsclose; /* downwards travelling close */
|
||||
/*static sl_h_close_t sdsclose; */ /* downwards travelling close */
|
||||
static void sds_init (void *arg);
|
||||
|
||||
static struct slice_handler slicetype = {
|
||||
@ -153,7 +154,7 @@ static struct slice_handler slicetype = {
|
||||
&sdsIOreq,
|
||||
&sdsioctl,
|
||||
&sdsopen,
|
||||
&sdsclose,
|
||||
/*&sdsclose*/NULL,
|
||||
NULL, /* revoke */
|
||||
NULL, /* claim */
|
||||
NULL, /* verify */
|
||||
@ -1283,9 +1284,14 @@ sdsopen(void *private, int flags, int mode, struct proc *p)
|
||||
|
||||
sd = private;
|
||||
|
||||
return(sdopen(makedev(0,sd->mynor), 0 , 0, p));
|
||||
if ((flags & (FREAD|FWRITE)) == 0) {
|
||||
return(sdclose(makedev(0,sd->mynor), 0 , 0, p));
|
||||
} else {
|
||||
return(sdopen(makedev(0,sd->mynor), 0 , 0, p));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
sdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
{
|
||||
@ -1296,6 +1302,7 @@ sdsclose(void *private, int flags, int mode, struct proc *p)
|
||||
sdclose(makedev(0,sd->mynor), 0 , 0, p);
|
||||
return;
|
||||
}
|
||||
#endif /* 0 */
|
||||
static int
|
||||
sdsioctl( void *private, int cmd, caddr_t addr, int flag, struct proc *p)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user