Date: Thu, 21 Sep 1995 22:31:16 +0400 (MSD) From: "Serge V.Vakulenko" <vak@crox.net.kiae.su> To: current@freebsd.org Subject: [patch] more stable version of wdreset() Message-ID: <Pine.BSF.3.91.950921222404.867B-100000@crox.net.kiae.su>
next in thread | raw e-mail | index | archive | help
This patch is intended to solve the problem of broken IDE disks probing in the FreeBSD-current. For IDE disks it works the same the 2.0.5 did. For detecting ATAPI drives it tests for the ATAPI signature in cyl_hi/cyl_lo registers. Serge --- wd-c.c Thu Sep 21 21:55:31 1995 +++ wd.c Thu Sep 21 21:56:28 1995 @@ -1907,13 +1907,18 @@ outb(wdc + wd_ctlr, WDCTL_IDS | WDCTL_RST); DELAY(10 * 1000); outb(wdc + wd_ctlr, WDCTL_IDS); - if (wdwait(du, 0, TIMEOUT) != 0) - return (1); - du->dk_status = inb(wdc + wd_status); - du->dk_error = inb(wdc + wd_error); - if ((du->dk_status & ~(WDCS_READY | WDCS_SEEKCMPLT)) != 0 || - du->dk_error != 0x01) - return (1); + if (wdwait(du, WDCS_READY | WDCS_SEEKCMPLT, TIMEOUT) == 0) { + /* IDE drive found */ + du->dk_error = inb(wdc + wd_error); + if (du->dk_error != 0x01) + return (1); + } else { + /* no IDE drive, test for ATAPI signature */ + int lo = inb(wdc + wd_cyl_lo); + int hi = inb(wdc + wd_cyl_hi); + if (lo != 0x14 || hi != 0xeb) + return (1); + } outb(wdc + wd_ctlr, WDCTL_4BIT); return (0); } --- Serge Vakulenko <vak@cronyx.msk.su> Cronyx Ltd., Moscow Unix consulting and custom programming phone: +7 (095) 939-23-23 FreeBSD support fax: +7 (095) 939-03-00 Relcom network development
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.950921222404.867B-100000>