diff options
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/dev/fd.c | 20 | ||||
-rw-r--r-- | sys/arch/sparc/dev/fdvar.h | 4 |
2 files changed, 17 insertions, 7 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index 4cc44f86d89..053e75d6e0c 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -52,6 +52,7 @@ #include <sys/disk.h> #include <sys/buf.h> #include <sys/uio.h> +#include <sys/mtio.h> #include <sys/syslog.h> #include <sys/queue.h> @@ -939,7 +940,7 @@ fdchwintr(fdc) fdcresult(fdc); fdc->sc_istate = ISTATE_IDLE; ienab_bis(IE_FDSOFT); - return 1; + goto done; case ISTATE_IDLE: case ISTATE_SPURIOUS: auxregbisc(0, AUXIO_FDS); /* Does this help? */ @@ -947,12 +948,12 @@ fdchwintr(fdc) fdc->sc_istate = ISTATE_SPURIOUS; printf("fdc: stray hard interrupt... "); ienab_bis(IE_FDSOFT); - return 1; + goto done; case ISTATE_DMA: break; default: printf("fdc: goofed ...\n"); - return 1; + goto done; } read = bp->b_flags & B_READ; @@ -995,7 +996,9 @@ fdchwintr(fdc) break; } } - return 1; +done: + sc->sc_intrcnt.ev_count++; + return (1); } #endif @@ -1397,6 +1400,7 @@ fdioctl(dev, cmd, addr, flag) int flag; { struct fd_softc *fd = fdcd.cd_devs[FDUNIT(dev)]; + struct mtop *mtop; struct disklabel buffer; int error; @@ -1437,7 +1441,13 @@ fdioctl(dev, cmd, addr, flag) &fd->sc_dk.dk_cpulabel); return error; - case DIOCEJECT: + case MTIOCTOP: + mtop = (struct mtop *)addr; + if (mtop->mt_op != MTOFFL) + return EIO; +#ifdef COMPAT_SUNOS + case SUNOS_FDIOCEJECT: +#endif auxregbisc(AUXIO_FDS, AUXIO_FEJ); delay(10); auxregbisc(AUXIO_FEJ, AUXIO_FDS); diff --git a/sys/arch/sparc/dev/fdvar.h b/sys/arch/sparc/dev/fdvar.h index a538f2f1d5a..f74d37ce41d 100644 --- a/sys/arch/sparc/dev/fdvar.h +++ b/sys/arch/sparc/dev/fdvar.h @@ -62,7 +62,7 @@ struct fdcio { /* * Statictics. */ - struct evcnt fdcio_intrcnt; + struct evcnt fdcio_intrcnt; }; #endif /* LOCORE */ @@ -72,5 +72,5 @@ struct fdcio { #define ISTATE_SENSEI 2 /* Do SENSEI on next HW interrupt */ #define ISTATE_DMA 3 /* Pseudo-DMA in progress */ -#define FDIOCEJECT _IO('f', 24) +#define SUNOS_FDIOCEJECT _IO('f', 24) |