summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-all.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2001-08-21 11:35:47 +0000
committersos <sos@FreeBSD.org>2001-08-21 11:35:47 +0000
commit20971d752c9fe30b7e67b7e8053e5587320f878d (patch)
tree0ea5b67cdaaf8444abee34c257d2015a352c1a6d /sys/dev/ata/ata-all.c
parent569bf91b79a1c9607f84cc3c6b51ee7fede1b215 (diff)
downloadFreeBSD-src-20971d752c9fe30b7e67b7e8053e5587320f878d.zip
FreeBSD-src-20971d752c9fe30b7e67b7e8053e5587320f878d.tar.gz
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.
Diffstat (limited to 'sys/dev/ata/ata-all.c')
-rw-r--r--sys/dev/ata/ata-all.c23
1 files changed, 10 insertions, 13 deletions
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
OpenPOWER on IntegriCloud