From 563ac84861110c3f6c6ca5c4657eee6e13f2ceb6 Mon Sep 17 00:00:00 2001 From: Andreas Schulz Date: Sat, 5 Mar 1994 21:41:51 +0000 Subject: [PATCH] Added more status bytes for the mitsumi drive. This is only an ugly hack in the moment for testing purposes and to get the drive going again. 0x20 means empty drive. 0x30 means closed drive with CDROM inserted. 0x80 means drive pulled out, but door closed. 0xa0 means drive pulled out and door open. Luckily none of these values are the same as that reported for Ethernet cards ( 0 for WD8003E, 0x40 for WD8013EPC, 0x60 for NE2000). The bad part is, the probe code gets the WD8003E so hosed, that it is no longer usable after it. No problem with the WD8013EPC. --- sys/dev/mcd/mcd.c | 9 +++++++-- sys/i386/isa/mcd.c | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c index b333d685d3c..db52bca7d97 100644 --- a/sys/dev/mcd/mcd.c +++ b/sys/dev/mcd/mcd.c @@ -39,7 +39,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.10 1994/02/22 08:44:28 rgrimes Exp $ + * $Id: mcd.c,v 1.11 1994/03/05 03:54:19 jkh Exp $ */ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -604,7 +604,12 @@ mcd_probe(struct isa_device *dev) return 0; /* Timeout */ } status = inb(port+MCD_DATA); - if (status != MCDEXISTS) +/* 0x20 == empty drive */ +/* 0x30 == MCDEXISTS == drive closed with CDROM inserted */ +/* 0x80 == drive pulled out but door closed */ +/* 0xa0 == drive pulled out and door open */ + if (status != 0x20 && status != MCDEXISTS && status != 0x80 && + status != 0xa0) return 0; /* Not actually a Mitsumi drive here */ /* Get version information */ outb(port+MCD_DATA, MCD_CMDCONTINFO); diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c index b333d685d3c..db52bca7d97 100644 --- a/sys/i386/isa/mcd.c +++ b/sys/i386/isa/mcd.c @@ -39,7 +39,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.10 1994/02/22 08:44:28 rgrimes Exp $ + * $Id: mcd.c,v 1.11 1994/03/05 03:54:19 jkh Exp $ */ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -604,7 +604,12 @@ mcd_probe(struct isa_device *dev) return 0; /* Timeout */ } status = inb(port+MCD_DATA); - if (status != MCDEXISTS) +/* 0x20 == empty drive */ +/* 0x30 == MCDEXISTS == drive closed with CDROM inserted */ +/* 0x80 == drive pulled out but door closed */ +/* 0xa0 == drive pulled out and door open */ + if (status != 0x20 && status != MCDEXISTS && status != 0x80 && + status != 0xa0) return 0; /* Not actually a Mitsumi drive here */ /* Get version information */ outb(port+MCD_DATA, MCD_CMDCONTINFO);