diff options
author | sos <sos@FreeBSD.org> | 2002-09-12 14:32:33 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2002-09-12 14:32:33 +0000 |
commit | 14fe98b3f1b59e9fa08ba7c643c56dca93e64ee2 (patch) | |
tree | 6d8c4d804ce8412825589bd1ba9970c107a67941 /sys/dev/ata | |
parent | ff0e7d967c26d21f64b71b65de7788b855ccb182 (diff) | |
download | FreeBSD-src-14fe98b3f1b59e9fa08ba7c643c56dca93e64ee2.zip FreeBSD-src-14fe98b3f1b59e9fa08ba7c643c56dca93e64ee2.tar.gz |
Rearrange where to get the ATAPI magic sequence.
Submitted by: Benjamin Close <cisbjc@cs.unisa.edu.au>
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-all.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index a7a7628..b807a31 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -759,11 +759,12 @@ ata_reset(struct ata_channel *ch) if (stat0 & ATA_S_BUSY) { ATA_OUTB(ch->r_io, ATA_DRIVE, ATA_D_IBM | ATA_MASTER); DELAY(10); + + /* check for ATAPI signature while its still there */ + lsb = ATA_INB(ch->r_io, ATA_CYL_LSB); + msb = ATA_INB(ch->r_io, ATA_CYL_MSB); stat0 = ATA_INB(ch->r_io, ATA_STATUS); if (!(stat0 & ATA_S_BUSY)) { - /* check for ATAPI signature while its still there */ - lsb = ATA_INB(ch->r_io, ATA_CYL_LSB); - msb = ATA_INB(ch->r_io, ATA_CYL_MSB); if (bootverbose) ata_printf(ch, ATA_MASTER, "ATAPI %02x %02x\n", lsb, msb); if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) @@ -773,11 +774,12 @@ ata_reset(struct ata_channel *ch) if (stat1 & ATA_S_BUSY) { ATA_OUTB(ch->r_io, ATA_DRIVE, ATA_D_IBM | ATA_SLAVE); DELAY(10); + + /* check for ATAPI signature while its still there */ + lsb = ATA_INB(ch->r_io, ATA_CYL_LSB); + msb = ATA_INB(ch->r_io, ATA_CYL_MSB); stat1 = ATA_INB(ch->r_io, ATA_STATUS); if (!(stat1 & ATA_S_BUSY)) { - /* check for ATAPI signature while its still there */ - lsb = ATA_INB(ch->r_io, ATA_CYL_LSB); - msb = ATA_INB(ch->r_io, ATA_CYL_MSB); if (bootverbose) ata_printf(ch, ATA_SLAVE, "ATAPI %02x %02x\n", lsb, msb); if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) |