summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-02-25 17:14:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-02-25 17:14:13 +0000
commit988cd00d071aa43cb10dd2cd43b766a628cd55ca (patch)
tree1d151e03a929ead90357d549c35f6b60f980ed82
parent7869e5be75eff6e43b7478df8fb03f35b0a4130b (diff)
Fix autosetting of d_type and d_typename that I introduced in rev
1.36. Checking wdp_config for WD_CFG_FIXED is incorrect. Default to ESDI/IDE if WD_CAP_LBA is set in wdp_capabilities instead. Also, set d_typename for non-IDE/ESDI to "ST506/MFM/RLL" not "ST506/MFM/RLL di" (the latter caused by truncation to 16 characters).
-rw-r--r--sys/dev/isa/wd.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/isa/wd.c b/sys/dev/isa/wd.c
index 444ee71f62f..d6fad600284 100644
--- a/sys/dev/isa/wd.c
+++ b/sys/dev/isa/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.38 1998/10/04 01:46:42 millert Exp $ */
+/* $OpenBSD: wd.c,v 1.39 1999/02/25 17:14:12 millert Exp $ */
/* $NetBSD: wd.c,v 1.150 1996/05/12 23:54:03 mycroft Exp $ */
/*
@@ -549,18 +549,16 @@ wdgetdisklabel(dev, wd, lp, clp, spoofonly)
lp->d_ncylinders = d_link->sc_params.wdp_cylinders;
lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors;
- if (d_link->sc_params.wdp_config == WD_CFG_FIXED) {
- strncpy(lp->d_typename, "ST506/MFM/RLL disk", 16);
- lp->d_type = DTYPE_ST506;
- } else {
- strncpy(lp->d_typename, "ESDI/IDE disk", 16);
- lp->d_type = DTYPE_ESDI;
- }
strncpy(lp->d_packname, d_link->sc_params.wdp_model, 16);
- if ((d_link->sc_params.wdp_capabilities & WD_CAP_LBA))
+ if ((d_link->sc_params.wdp_capabilities & WD_CAP_LBA)) {
lp->d_secperunit = d_link->sc_params.wdp_lbacapacity;
- else
+ strncpy(lp->d_typename, "ESDI/IDE disk", 16);
+ lp->d_type = DTYPE_ESDI;
+ } else {
lp->d_secperunit = lp->d_secpercyl * lp->d_ncylinders;
+ strncpy(lp->d_typename, "ST506/MFM/RLL", 16);
+ lp->d_type = DTYPE_ST506;
+ }
lp->d_rpm = 3600;
lp->d_interleave = 1;