From 14fe98b3f1b59e9fa08ba7c643c56dca93e64ee2 Mon Sep 17 00:00:00 2001 From: sos Date: Thu, 12 Sep 2002 14:32:33 +0000 Subject: Rearrange where to get the ATAPI magic sequence. Submitted by: Benjamin Close --- sys/dev/ata/ata-all.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 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 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) -- cgit v1.1