summaryrefslogtreecommitdiff
path: root/sys/dev/ata/wd.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-10-04 00:52:56 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-10-04 00:52:56 +0000
commit153f77ea55e24ad85f2095b1697636723b718ca2 (patch)
tree67cb008316638f14def1b489be9e7d3090023963 /sys/dev/ata/wd.c
parentd527cdf7a9dfcfcb2c3ebcc91972b8a5c98844db (diff)
Zap bad144 bad sector info in disklabels. Sparsely used if at all for
a few obsolete and easily replaced disk models. And didn't work anyway according to Bob, who has tried. ok beck@
Diffstat (limited to 'sys/dev/ata/wd.c')
-rw-r--r--sys/dev/ata/wd.c49
1 files changed, 1 insertions, 48 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index 48c961964a5..f4e68197bf2 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.49 2006/08/21 12:09:01 krw Exp $ */
+/* $OpenBSD: wd.c,v 1.50 2006/10/04 00:52:55 krw Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -166,7 +166,6 @@ struct wd_softc {
#define sc_drive sc_wdc_bio.drive
#define sc_mode sc_wdc_bio.mode
#define sc_multi sc_wdc_bio.multi
-#define sc_badsect sc_wdc_bio.badsect
int wdprobe(struct device *, void *, void *);
void wdattach(struct device *, struct device *, void *);
@@ -201,10 +200,6 @@ struct dkdriver wddkdriver = { wdstrategy };
cdev_decl(wd);
bdev_decl(wd);
-#ifdef DKBAD
-void bad144intern(struct wd_softc *);
-#endif
-
#define wdlock(wd) disk_lock(&(wd)->sc_dk)
#define wdunlock(wd) disk_unlock(&(wd)->sc_dk)
#define wdlookup(unit) (struct wd_softc *)device_lookup(&wd_cd, (unit))
@@ -831,8 +826,6 @@ wdgetdisklabel(dev_t dev, struct wd_softc *wd, struct disklabel *lp,
wdgetdefaultlabel(wd, lp);
- wd->sc_badsect[0] = -1;
-
if (wd->drvp->state > RECAL)
wd->drvp->drive_flags |= DRIVE_RESET;
errstring = readdisklabel(WDLABELDEV(dev),
@@ -856,10 +849,6 @@ wdgetdisklabel(dev_t dev, struct wd_softc *wd, struct disklabel *lp,
if (wd->drvp->state > RECAL)
wd->drvp->drive_flags |= DRIVE_RESET;
-#ifdef DKBAD
- if ((lp->d_flags & D_BADSECT) != 0)
- bad144intern(wd);
-#endif
}
int
@@ -880,16 +869,6 @@ wdioctl(dev_t dev, u_long xfer, caddr_t addr, int flag, struct proc *p)
}
switch (xfer) {
-#ifdef DKBAD
- case DIOCSBAD:
- if ((flag & FWRITE) == 0)
- return EBADF;
- DKBAD(wd->sc_dk.dk_cpulabel) = *(struct dkbad *)addr;
- wd->sc_dk.dk_label->d_flags |= D_BADSECT;
- bad144intern(wd);
- goto exit;
-#endif
-
case DIOCRLDINFO:
wdgetdisklabel(dev, wd, wd->sc_dk.dk_label,
wd->sc_dk.dk_cpulabel, 0);
@@ -1166,32 +1145,6 @@ again:
return 0;
}
-#ifdef DKBAD
-/*
- * Internalize the bad sector table.
- */
-void
-bad144intern(struct wd_softc *wd)
-{
- struct dkbad *bt = &DKBAD(wd->sc_dk.dk_cpulabel);
- struct disklabel *lp = wd->sc_dk.dk_label;
- int i = 0;
-
- WDCDEBUG_PRINT(("bad144intern\n"), DEBUG_XFERS);
-
- for (; i < NBT_BAD; i++) {
- if (bt->bt_bad[i].bt_cyl == 0xffff)
- break;
- wd->sc_badsect[i] =
- bt->bt_bad[i].bt_cyl * lp->d_secpercyl +
- (bt->bt_bad[i].bt_trksec >> 8) * lp->d_nsectors +
- (bt->bt_bad[i].bt_trksec & 0xff);
- }
- for (; i < NBT_BAD+1; i++)
- wd->sc_badsect[i] = -1;
-}
-#endif
-
int
wd_get_params(struct wd_softc *wd, u_int8_t flags, struct ataparams *params)
{