summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-all.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2002-07-22 18:35:01 +0000
committersos <sos@FreeBSD.org>2002-07-22 18:35:01 +0000
commitdacb15ae37d0a379f5da8f8a654055b7a28ca7cc (patch)
tree52daf8e8e817a60bd92139ca58025aac21034b34 /sys/dev/ata/ata-all.c
parentd1de8b21e3190c8aecc980999a4af733d05a518b (diff)
downloadFreeBSD-src-dacb15ae37d0a379f5da8f8a654055b7a28ca7cc.zip
FreeBSD-src-dacb15ae37d0a379f5da8f8a654055b7a28ca7cc.tar.gz
Update the tags handling a bit, which makes support for the
older IBM DTTA series of drives possible. Update error handling a bit now we are here.
Diffstat (limited to 'sys/dev/ata/ata-all.c')
-rw-r--r--sys/dev/ata/ata-all.c49
1 files changed, 15 insertions, 34 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index c3c252d..24ed916 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -611,38 +611,23 @@ ata_intr(void *data)
return;
break;
#endif
- case ATA_WAIT_INTR:
- case ATA_WAIT_INTR | ATA_CONTROL:
- wakeup((caddr_t)ch);
- break;
-
- case ATA_WAIT_READY:
- case ATA_WAIT_READY | ATA_CONTROL:
- break;
-
- case ATA_IDLE:
- if (ch->flags & ATA_QUEUED) {
- ch->active = ATA_ACTIVE;
- if (ata_service(ch) == ATA_OP_CONTINUES)
- return;
- }
- /* FALLTHROUGH */
-
default:
-#ifdef ATA_DEBUG
- {
- static int intr_count = 0;
+ if (ch->active & ATA_WAIT_INTR)
+ wakeup((caddr_t)ch);
+ }
- if (intr_count++ < 10)
- ata_printf(ch, -1, "unwanted interrupt #%d active=%02x s=%02x\n",
- intr_count, ch->active, ch->status);
+ if (ch->active & ATA_CONTROL) {
+ ATA_FORCELOCK_CH(ch, ATA_CONTROL);
+ return;
}
-#endif
- break;
+
+ if ((ch->flags & ATA_QUEUED) &&
+ ATA_INB(ch->r_altio, ATA_ALTSTAT) & ATA_S_SERVICE) {
+ ATA_FORCELOCK_CH(ch, ATA_ACTIVE);
+ if (ata_service(ch) == ATA_OP_CONTINUES)
+ return;
}
- ch->active &= ATA_CONTROL;
- if (ch->active & ATA_CONTROL)
- return;
+ ATA_UNLOCK_CH(ch);
ch->running = NULL;
ata_start(ch);
return;
@@ -700,8 +685,8 @@ ata_start(struct ata_channel *ch)
}
}
#endif
- splx(s);
ATA_UNLOCK_CH(ch);
+ splx(s);
}
void
@@ -843,12 +828,10 @@ ata_reinit(struct ata_channel *ch)
ATA_FORCELOCK_CH(ch, ATA_CONTROL);
ch->running = NULL;
devices = ch->devices;
- ata_printf(ch, -1, "resetting devices .. ");
+ ata_printf(ch, -1, "resetting devices ..\n");
ata_reset(ch);
if ((misdev = devices & ~ch->devices)) {
- if (misdev)
- printf("\n");
#ifdef DEV_ATADISK
if (misdev & ATA_ATA_MASTER && ch->device[MASTER].driver)
ad_detach(&ch->device[MASTER], 0);
@@ -886,8 +869,6 @@ ata_reinit(struct ata_channel *ch)
if (ata_getparam(&ch->device[SLAVE], ATA_C_ATAPI_IDENTIFY))
newdev &= ~ATA_ATAPI_SLAVE;
}
- if (!misdev && newdev)
- printf("\n");
#ifdef DEV_ATADISK
if (newdev & ATA_ATA_MASTER && !ch->device[MASTER].driver)
ad_attach(&ch->device[MASTER]);
OpenPOWER on IntegriCloud