diff options
| author | KATO Takenori <kato@FreeBSD.org> | 1997-04-04 15:22:59 +0000 |
|---|---|---|
| committer | KATO Takenori <kato@FreeBSD.org> | 1997-04-04 15:22:59 +0000 |
| commit | 1964ed8cde107a2905bf664fd8b98318d0ed5e0f (patch) | |
| tree | 0d7b35a9be9bcf36aeec189129d27de74b34d225 | |
| parent | 9fa50de4c4aacf56dc38aea953d345789d232533 (diff) | |
Notes
| -rw-r--r-- | sys/pc98/pc98/wd.c | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c index 453960b4dd10..9c151d6c25a7 100644 --- a/sys/pc98/pc98/wd.c +++ b/sys/pc98/pc98/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.20 1997/03/13 17:00:27 kato Exp $ + * $Id: wd.c,v 1.21 1997/03/24 12:29:48 bde Exp $ */ /* TODO: @@ -1537,12 +1537,55 @@ wdcommand(struct disk *du, u_int cylinder, u_int head, u_int sector, wdc = du->dk_port; if (du->cfg_flags & WDOPT_SLEEPHACK) { + /* OK, so the APM bios has put the disk into SLEEP mode, + * how can we tell ? Uhm, we can't. There is no + * standardized way of finding out, and the only way to + * wake it up is to reset it. Bummer. + * + * All the many and varied versions of the IDE/ATA standard + * explicitly tells us not to look at these registers if + * the disk is in SLEEP mode. Well, too bad really, we + * have to find out if it's in sleep mode before we can + * avoid reading the registers. + * + * I have reason to belive that most disks will return + * either 0xff or 0x00 in all but the status register + * when in SLEEP mode, but I have yet to see one return + * 0x00, so we don't check for that yet. + * + * The check for WDCS_BUSY is for the case where the + * bios spins up the disk for us, but doesn't initialize + * it correctly /phk + */ if (old_epson_note) { - if(epson_inb(wdc + wd_status) == WDCS_BUSY) - wdunwedge(du); + if(epson_inb(wdc + wd_precomp) + epson_inb(wdc + wd_cyl_lo) + + epson_inb(wdc + wd_cyl_hi) + epson_inb(wdc + wd_sdh) + + epson_inb(wdc + wd_sector) + + epson_inb(wdc + wd_seccnt) == 6 * 0xff) { + if (bootverbose) + printf("wd(%d,%d): disk aSLEEP\n", + du->dk_ctrlr, du->dk_unit); + wdunwedge(du); + } else if(epson_inb(wdc + wd_status) == WDCS_BUSY) { + if (bootverbose) + printf("wd(%d,%d): disk is BUSY\n", + du->dk_ctrlr, du->dk_unit); + wdunwedge(du); + } } else { - if(inb(wdc + wd_status) == WDCS_BUSY) - wdunwedge(du); + if(inb(wdc + wd_precomp) + inb(wdc + wd_cyl_lo) + + inb(wdc + wd_cyl_hi) + inb(wdc + wd_sdh) + + inb(wdc + wd_sector) + inb(wdc + wd_seccnt) == 6 * 0xff) { + if (bootverbose) + printf("wd(%d,%d): disk aSLEEP\n", + du->dk_ctrlr, du->dk_unit); + wdunwedge(du); + } else if(inb(wdc + wd_status) == WDCS_BUSY) { + if (bootverbose) + printf("wd(%d,%d): disk is BUSY\n", + du->dk_ctrlr, du->dk_unit); + wdunwedge(du); + } } } |
