diff options
author | sos <sos@FreeBSD.org> | 2002-02-12 13:21:51 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2002-02-12 13:21:51 +0000 |
commit | 5eb6e3401041b59125f797a03291b0487b8f5422 (patch) | |
tree | 5d03820ed8c164e56dc1b0490641cbeb46287faf /sys/dev/ata/ata-all.c | |
parent | c53dc644164c836f50fb434d0d9cc9ee4da682bc (diff) | |
download | FreeBSD-src-5eb6e3401041b59125f797a03291b0487b8f5422.zip FreeBSD-src-5eb6e3401041b59125f797a03291b0487b8f5422.tar.gz |
Fix buglets in the ATAPI resume code.
This also fixes an old bug where some ATAPI devices went into
funny mode on an 'atacontrol reinit' command.
Diffstat (limited to 'sys/dev/ata/ata-all.c')
-rw-r--r-- | sys/dev/ata/ata-all.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 2851c3c..f742261 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -854,22 +854,30 @@ ata_reinit(struct ata_channel *ch) #ifdef DEV_ATADISK if (newdev & ATA_ATA_MASTER && !ch->device[MASTER].driver) ad_attach(&ch->device[MASTER]); - else if (ch->devices & ATA_ATA_MASTER && ch->device[MASTER].driver) - ad_reinit((struct ad_softc *)ch->device[MASTER].driver); + else if (ch->devices & ATA_ATA_MASTER && ch->device[MASTER].driver) { + ata_getparam(&ch->device[MASTER], ATA_C_ATA_IDENTIFY); + ad_reinit(&ch->device[MASTER]); + } if (newdev & ATA_ATA_SLAVE && !ch->device[SLAVE].driver) ad_attach(&ch->device[SLAVE]); - else if (ch->devices & (ATA_ATA_SLAVE) && ch->device[SLAVE].driver) - ad_reinit((struct ad_softc *)ch->device[SLAVE].driver); + else if (ch->devices & (ATA_ATA_SLAVE) && ch->device[SLAVE].driver) { + ata_getparam(&ch->device[SLAVE], ATA_C_ATA_IDENTIFY); + ad_reinit(&ch->device[SLAVE]); + } #endif #if defined(DEV_ATAPICD) || defined(DEV_ATAPIFD) || defined(DEV_ATAPIST) if (newdev & ATA_ATAPI_MASTER && !ch->device[MASTER].driver) atapi_attach(&ch->device[MASTER]); - else if (ch->devices & (ATA_ATAPI_MASTER) && ch->device[MASTER].driver) - atapi_reinit(ch->device[MASTER].driver); + else if (ch->devices & (ATA_ATAPI_MASTER) && ch->device[MASTER].driver) { + ata_getparam(&ch->device[MASTER], ATA_C_ATAPI_IDENTIFY); + atapi_reinit(&ch->device[MASTER]); + } if (newdev & ATA_ATAPI_SLAVE && !ch->device[SLAVE].driver) atapi_attach(&ch->device[SLAVE]); - else if (ch->devices & (ATA_ATAPI_SLAVE) && ch->device[SLAVE].driver) - atapi_reinit(ch->device[SLAVE].driver); + else if (ch->devices & (ATA_ATAPI_SLAVE) && ch->device[SLAVE].driver) { + ata_getparam(&ch->device[SLAVE], ATA_C_ATAPI_IDENTIFY); + atapi_reinit(&ch->device[SLAVE]); + } #endif printf("done\n"); ch->active = ATA_IDLE; |