From 20971d752c9fe30b7e67b7e8053e5587320f878d Mon Sep 17 00:00:00 2001 From: sos Date: Tue, 21 Aug 2001 11:35:47 +0000 Subject: Finally commit some of the minor things I've collected over the last month(s): Add tagged queueing support for new IBM drives. Add support for Yet Another Promise ATA 100 chip. Flush disk cache on close. Dont flush the disk cache on BIO_ORDERED anymore. Cleanup the tests for DMA on ATAPI devices. Allow to share ALL irq's even the std irg 14 & 15. Fix calculation bug in end of media code on CD's. Add REZERO on opening a CDR/CDRW. Cleanup ataioctl a bit. --- sys/dev/ata/ata-all.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'sys/dev/ata/ata-all.c') diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 01ebc46..023f73a 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -287,10 +287,9 @@ ata_resume(device_t dev) static int ataioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) { - struct ata_cmd *iocmd = (struct ata_cmd *)addr; device_t device; - int error = 0; + int error; if (cmd != IOCATA) return ENOTTY; @@ -304,15 +303,16 @@ ataioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) switch (iocmd->cmd) { case ATAATTACH: { /* should enable channel HW on controller that can SOS XXX */ - if (!(error = ata_probe(device))) + error = ata_probe(device); + if (!error) error = ata_attach(device); - break; + return error; } case ATADETACH: { error = ata_detach(device); /* should disable channel HW on controller that can SOS XXX */ - break; + return error; } case ATAREINIT: { @@ -329,7 +329,7 @@ ataioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) tsleep((caddr_t)&s, PRIBIO, "atachm", hz/4); error = ata_reinit(scp); splx(s); - break; + return error; } case ATAGMODE: { @@ -346,7 +346,7 @@ ataioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) iocmd->u.mode.mode[SLAVE] = scp->mode[SLAVE]; else iocmd->u.mode.mode[SLAVE] = -1; - break; + return 0; } case ATASMODE: { @@ -368,7 +368,7 @@ ataioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) } else iocmd->u.mode.mode[SLAVE] = -1; - break; + return 0; } case ATAGPARM: { @@ -394,13 +394,10 @@ ataioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) if (scp->dev_param[SLAVE]) bcopy(scp->dev_param[SLAVE], &iocmd->u.param.params[SLAVE], sizeof(struct ata_params)); - break; + return 0; } - - default: - error = ENOTTY; } - return error; + return ENOTTY; } static int -- cgit v1.1