diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-10-04 00:52:56 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-10-04 00:52:56 +0000 |
commit | 153f77ea55e24ad85f2095b1697636723b718ca2 (patch) | |
tree | 67cb008316638f14def1b489be9e7d3090023963 | |
parent | d527cdf7a9dfcfcb2c3ebcc91972b8a5c98844db (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@
-rw-r--r-- | sys/arch/alpha/alpha/disksubr.c | 49 | ||||
-rw-r--r-- | sys/arch/alpha/include/disklabel.h | 6 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/disksubr.c | 38 | ||||
-rw-r--r-- | sys/arch/amd64/include/disklabel.h | 6 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/disksubr.c | 49 | ||||
-rw-r--r-- | sys/arch/hppa/include/disklabel.h | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/disksubr.c | 38 | ||||
-rw-r--r-- | sys/arch/i386/include/disklabel.h | 6 | ||||
-rw-r--r-- | sys/arch/macppc/include/disklabel.h | 7 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/disksubr.c | 38 | ||||
-rw-r--r-- | sys/dev/ata/ata_wdc.c | 26 | ||||
-rw-r--r-- | sys/dev/ata/wd.c | 49 |
12 files changed, 12 insertions, 306 deletions
diff --git a/sys/arch/alpha/alpha/disksubr.c b/sys/arch/alpha/alpha/disksubr.c index d9f12456d95..956a3c6a3be 100644 --- a/sys/arch/alpha/alpha/disksubr.c +++ b/sys/arch/alpha/alpha/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.53 2006/09/16 14:56:11 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.54 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -220,7 +220,6 @@ readdoslabel(bp, strat, lp, osdep, partoffp, cylp, spoofonly) int spoofonly; { struct dos_partition *dp = osdep->u._i386.dosparts, *dp2; - struct dkbad *db, *bdp = &DKBAD(osdep); char *msg = NULL, *cp; int dospartoff, cyl, i, ourpart = -1; dev_t dev; @@ -389,53 +388,7 @@ donot: /* next, dig out disk label */ msg = readbsdlabel(bp, strat, cyl, dospartoff + I386_LABELSECTOR, -1, lp, spoofonly); - if (msg) - return (msg); - - /* obtain bad sector table if requested and present */ - if (bdp && (lp->d_flags & D_BADSECT)) { - /* - * get a new buffer and initialize it as callers trust the - * buffer given to us, to point at the disklabel sector. - */ - dev = bp->b_dev; - bp = geteblk((int)lp->d_secsize); - bp->b_dev = dev; - i = 0; - do { - /* read a bad sector table */ - bp->b_flags = B_BUSY | B_READ; - bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i; - if (lp->d_secsize > DEV_BSIZE) - bp->b_blkno *= lp->d_secsize / DEV_BSIZE; - else - bp->b_blkno /= DEV_BSIZE / lp->d_secsize; - bp->b_bcount = lp->d_secsize; - bp->b_cylinder = lp->d_ncylinders - 1; - (*strat)(bp); - - /* if successful, validate, otherwise try another */ - if (biowait(bp)) - msg = "bad sector table I/O error"; - else { - db = (struct dkbad *)(bp->b_data); -#define DKBAD_MAGIC 0x4321 - if (db->bt_mbz == 0 && - db->bt_flag == DKBAD_MAGIC) { - msg = NULL; - *bdp = *db; - break; - } else - msg = "bad sector table corrupted"; - } - } while ((bp->b_flags & B_ERROR) && (i += 2) < 10 && - i < lp->d_nsectors); - - /* Give back the bad block buffer. */ - bp->b_flags |= B_INVAL; - brelse(bp); - } return (msg); } #endif diff --git a/sys/arch/alpha/include/disklabel.h b/sys/arch/alpha/include/disklabel.h index d0d2763be8e..a78d7d69cef 100644 --- a/sys/arch/alpha/include/disklabel.h +++ b/sys/arch/alpha/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.15 2006/07/09 21:00:17 krw Exp $ */ +/* $OpenBSD: disklabel.h,v 1.16 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */ /* @@ -86,7 +86,6 @@ struct dos_partition { #define DPSECT(s) ((s) & 0x3f) #define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2)) -#include <sys/dkbad.h> struct cpu_disklabel { int labelsector; union { @@ -94,11 +93,8 @@ struct cpu_disklabel { } _alpha; struct { struct dos_partition dosparts[NDOSPART]; - struct dkbad bad; } _i386; } u; }; -#define DKBAD(x) ((x)->u._i386.bad) - #endif /* _MACHINE_DISKLABEL_H_ */ diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c index a7a3e77ad73..ff9c477ba7c 100644 --- a/sys/arch/amd64/amd64/disksubr.c +++ b/sys/arch/amd64/amd64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.14 2006/09/16 14:56:11 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.15 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -69,7 +69,6 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) int spoofonly; { struct dos_partition *dp = osdep->dosparts, *dp2; - struct dkbad *bdp = &DKBAD(osdep); struct buf *bp = NULL; struct disklabel *dlp; char *msg = NULL, *cp; @@ -281,41 +280,6 @@ donot: goto done; } - /* obtain bad sector table if requested and present */ - if (bdp && (lp->d_flags & D_BADSECT)) { - struct dkbad *db; - - i = 0; - do { - /* read a bad sector table */ - bp->b_flags = B_BUSY | B_READ; - bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i; - if (lp->d_secsize > DEV_BSIZE) - bp->b_blkno *= lp->d_secsize / DEV_BSIZE; - else - bp->b_blkno /= DEV_BSIZE / lp->d_secsize; - bp->b_bcount = lp->d_secsize; - bp->b_cylinder = lp->d_ncylinders - 1; - (*strat)(bp); - - /* if successful, validate, otherwise try another */ - if (biowait(bp)) { - msg = "bad sector table I/O error"; - } else { - db = (struct dkbad *)(bp->b_data); -#define DKBAD_MAGIC 0x4321 - if (db->bt_mbz == 0 - && db->bt_flag == DKBAD_MAGIC) { - msg = NULL; - *bdp = *db; - break; - } else - msg = "bad sector table corrupted"; - } - } while ((bp->b_flags & B_ERROR) && (i += 2) < 10 && - i < lp->d_nsectors); - } - done: if (bp) { bp->b_flags |= B_INVAL; diff --git a/sys/arch/amd64/include/disklabel.h b/sys/arch/amd64/include/disklabel.h index f325b8048a6..a326912037d 100644 --- a/sys/arch/amd64/include/disklabel.h +++ b/sys/arch/amd64/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.4 2006/07/01 16:50:32 krw Exp $ */ +/* $OpenBSD: disklabel.h,v 1.5 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp $ */ /* @@ -84,14 +84,10 @@ struct dos_mbr { #define DOSMBR_SIGNATURE (0xaa55) #define DOSMBR_SIGNATURE_OFF (0x1fe) -#include <sys/dkbad.h> struct cpu_disklabel { struct dos_partition dosparts[NDOSPART]; - struct dkbad bad; }; -#define DKBAD(x) ((x)->bad) - /* Isolate the relevant bits to get sector and cylinder. */ #define DPSECT(s) ((s) & 0x3f) #define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2)) diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c index 1ef84730264..6dda9bf1166 100644 --- a/sys/arch/hppa/hppa/disksubr.c +++ b/sys/arch/hppa/hppa/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.33 2006/09/16 14:56:11 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.34 2006/10/04 00:52:55 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -223,7 +223,6 @@ readdoslabel(bp, strat, lp, osdep, partoffp, cylp, spoofonly) int spoofonly; { struct dos_partition *dp = osdep->u._i386.dosparts, *dp2; - struct dkbad *db, *bdp = &DKBAD(osdep); char *msg = NULL, *cp; int dospartoff, cyl, i, ourpart = -1; dev_t dev; @@ -392,53 +391,7 @@ donot: /* next, dig out disk label */ msg = readbsdlabel(bp, strat, cyl, dospartoff + I386_LABELSECTOR, -1, lp, spoofonly); - if (msg) - return (msg); - /* obtain bad sector table if requested and present */ - if (bdp && (lp->d_flags & D_BADSECT)) { - /* - * get a new buffer and initialize it as callers trust the - * buffer given to us, to point at the disklabel sector. - */ - dev = bp->b_dev; - bp = geteblk((int)lp->d_secsize); - bp->b_dev = dev; - - i = 0; - do { - /* read a bad sector table */ - bp->b_flags = B_BUSY | B_READ; - bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i; - if (lp->d_secsize > DEV_BSIZE) - bp->b_blkno *= lp->d_secsize / DEV_BSIZE; - else - bp->b_blkno /= DEV_BSIZE / lp->d_secsize; - bp->b_bcount = lp->d_secsize; - bp->b_cylinder = lp->d_ncylinders - 1; - (*strat)(bp); - - /* if successful, validate, otherwise try another */ - if (biowait(bp)) - msg = "bad sector table I/O error"; - else { - db = (struct dkbad *)(bp->b_data); -#define DKBAD_MAGIC 0x4321 - if (db->bt_mbz == 0 && - db->bt_flag == DKBAD_MAGIC) { - msg = NULL; - *bdp = *db; - break; - } else - msg = "bad sector table corrupted"; - } - } while ((bp->b_flags & B_ERROR) && (i += 2) < 10 && - i < lp->d_nsectors); - - /* Give back the bad block buffer. */ - bp->b_flags |= B_INVAL; - brelse(bp); - } return (msg); } #endif diff --git a/sys/arch/hppa/include/disklabel.h b/sys/arch/hppa/include/disklabel.h index 8f9f32a2c68..c5652c1c816 100644 --- a/sys/arch/hppa/include/disklabel.h +++ b/sys/arch/hppa/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.12 2006/07/07 23:47:37 krw Exp $ */ +/* $OpenBSD: disklabel.h,v 1.13 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */ /* @@ -175,13 +175,11 @@ struct hpux_label { #define lifstob(s) ((s) * LIF_SECTSIZE) #define lifstodb(s) ((s) * LIF_SECTSIZE / DEV_BSIZE) -#include <sys/dkbad.h> struct cpu_disklabel { int labelsector; union { struct { struct dos_partition dosparts[NDOSPART]; - struct dkbad bad; } _i386; struct { struct lifvol lifvol; @@ -191,6 +189,4 @@ struct cpu_disklabel { } u; }; -#define DKBAD(x) ((x)->u._i386.bad) - #endif /* _MACHINE_DISKLABEL_H_ */ diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c index 4808c305d72..6de37cead8d 100644 --- a/sys/arch/i386/i386/disksubr.c +++ b/sys/arch/i386/i386/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.56 2006/09/19 11:06:33 jsg Exp $ */ +/* $OpenBSD: disksubr.c,v 1.57 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -65,7 +65,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *osdep, int spoofonly) { struct dos_partition *dp = osdep->dosparts, *dp2; - struct dkbad *bdp = &DKBAD(osdep); struct buf *bp = NULL; struct disklabel *dlp; char *msg = NULL, *cp; @@ -277,41 +276,6 @@ donot: goto done; } - /* obtain bad sector table if requested and present */ - if (bdp && (lp->d_flags & D_BADSECT)) { - struct dkbad *db; - - i = 0; - do { - /* read a bad sector table */ - bp->b_flags = B_BUSY | B_READ; - bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i; - if (lp->d_secsize > DEV_BSIZE) - bp->b_blkno *= lp->d_secsize / DEV_BSIZE; - else - bp->b_blkno /= DEV_BSIZE / lp->d_secsize; - bp->b_bcount = lp->d_secsize; - bp->b_cylinder = lp->d_ncylinders - 1; - (*strat)(bp); - - /* if successful, validate, otherwise try another */ - if (biowait(bp)) { - msg = "bad sector table I/O error"; - } else { - db = (struct dkbad *)(bp->b_data); -#define DKBAD_MAGIC 0x4321 - if (db->bt_mbz == 0 - && db->bt_flag == DKBAD_MAGIC) { - msg = NULL; - *bdp = *db; - break; - } else - msg = "bad sector table corrupted"; - } - } while ((bp->b_flags & B_ERROR) && (i += 2) < 10 && - i < lp->d_nsectors); - } - done: if (bp) { bp->b_flags |= B_INVAL; diff --git a/sys/arch/i386/include/disklabel.h b/sys/arch/i386/include/disklabel.h index 7510dde1d35..63f38be5bf6 100644 --- a/sys/arch/i386/include/disklabel.h +++ b/sys/arch/i386/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.28 2006/07/01 16:50:33 krw Exp $ */ +/* $OpenBSD: disklabel.h,v 1.29 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp $ */ /* @@ -84,14 +84,10 @@ struct dos_mbr { #define DOSMBR_SIGNATURE (0xaa55) #define DOSMBR_SIGNATURE_OFF (0x1fe) -#include <sys/dkbad.h> struct cpu_disklabel { struct dos_partition dosparts[NDOSPART]; - struct dkbad bad; }; -#define DKBAD(x) ((x)->bad) - /* Isolate the relevant bits to get sector and cylinder. */ #define DPSECT(s) ((s) & 0x3f) #define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2)) diff --git a/sys/arch/macppc/include/disklabel.h b/sys/arch/macppc/include/disklabel.h index c6b3e749b29..eae1308c265 100644 --- a/sys/arch/macppc/include/disklabel.h +++ b/sys/arch/macppc/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.7 2006/07/01 16:50:33 krw Exp $ */ +/* $OpenBSD: disklabel.h,v 1.8 2006/10/04 00:52:55 krw Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -78,8 +78,6 @@ struct dos_partition { #define DOSPTYP_OPENBSD 0xa6 /* OpenBSD partition type */ #define DOSPTYP_NETBSD 0xa9 /* NetBSD partition type */ -#include <sys/dkbad.h> - /* Isolate the relevant bits to get sector and cylinder. */ #define DPSECT(s) ((s) & 0x3f) #define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2)) @@ -139,9 +137,6 @@ struct cpu_disklabel { struct dos_partition dosparts[NDOSPART]; /* only store first entry and openbsd partition */ struct part_map_entry macparts[2]; - struct dkbad bad; }; -#define DKBAD(x) ((x)->bad) - #endif /* _MACHINE_DISKLABEL_H_ */ diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c index 35195b5e07b..cbdd5b90af4 100644 --- a/sys/arch/macppc/macppc/disksubr.c +++ b/sys/arch/macppc/macppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.22 2006/09/16 14:56:11 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.23 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -68,7 +68,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *osdep, int spoofonly) { struct dos_partition *dp = osdep->dosparts, *dp2; - struct dkbad *bdp = &DKBAD(osdep); struct buf *bp; struct disklabel *dlp; char *msg = NULL, *cp; @@ -370,41 +369,6 @@ found_disklabel: goto done; } - /* obtain bad sector table if requested and present */ - if (bdp && (lp->d_flags & D_BADSECT)) { - struct dkbad *db; - - i = 0; - do { - /* read a bad sector table */ - bp->b_flags = B_BUSY | B_READ; - bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i; - if (lp->d_secsize > DEV_BSIZE) - bp->b_blkno *= lp->d_secsize / DEV_BSIZE; - else - bp->b_blkno /= DEV_BSIZE / lp->d_secsize; - bp->b_bcount = lp->d_secsize; - bp->b_cylinder = lp->d_ncylinders - 1; - (*strat)(bp); - - /* if successful, validate, otherwise try another */ - if (biowait(bp)) { - msg = "bad sector table I/O error"; - } else { - db = (struct dkbad *)(bp->b_data); -#define DKBAD_MAGIC 0x4321 - if (db->bt_mbz == 0 - && db->bt_flag == DKBAD_MAGIC) { - msg = NULL; - *bdp = *db; - break; - } else - msg = "bad sector table corrupted"; - } - } while ((bp->b_flags & B_ERROR) && (i += 2) < 10 && - i < lp->d_nsectors); - } - done: bp->b_flags |= B_INVAL; brelse(bp); diff --git a/sys/dev/ata/ata_wdc.c b/sys/dev/ata/ata_wdc.c index 8f3463d0bca..38d14e9fd40 100644 --- a/sys/dev/ata/ata_wdc.c +++ b/sys/dev/ata/ata_wdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ata_wdc.c,v 1.28 2006/08/21 12:09:01 krw Exp $ */ +/* $OpenBSD: ata_wdc.c,v 1.29 2006/10/04 00:52:55 krw Exp $ */ /* $NetBSD: ata_wdc.c,v 1.21 1999/08/09 09:43:11 bouyer Exp $ */ /* @@ -237,30 +237,6 @@ again: nblks = 1; else nblks = xfer->c_bcount / ata_bio->lp->d_secsize; - /* Check for bad sectors and adjust transfer, if necessary. */ - if ((ata_bio->lp->d_flags & D_BADSECT) != 0) { - long blkdiff; - int i; - for (i = 0; (blkdiff = ata_bio->badsect[i]) != -1; - i++) { - blkdiff -= ata_bio->blkno; - if (blkdiff < 0) - continue; - if (blkdiff == 0) { - /* Replace current block of transfer. */ - ata_bio->blkno = - ata_bio->lp->d_secperunit - - ata_bio->lp->d_nsectors - i - 1; - } - if (blkdiff < nblks) { - /* Bad block inside transfer. */ - ata_bio->flags |= ATA_SINGLE; - nblks = 1; - } - break; - } - /* Transfer is okay now. */ - } if (ata_bio->flags & ATA_LBA) { sect = (ata_bio->blkno >> 0) & 0xff; cyl = (ata_bio->blkno >> 8) & 0xffff; 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) { |