summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-12-08 09:33:00 +0000
committerphk <phk@FreeBSD.org>1999-12-08 09:33:00 +0000
commit551bfa2f51cfd055117aec7f1a0f17294cfbc260 (patch)
tree50da86bbbf154ce5c4d4932b562730a10096f3ab /sys/i386/isa
parent224ba89395ce157c152e89a1113bab7205c0dcf9 (diff)
downloadFreeBSD-src-551bfa2f51cfd055117aec7f1a0f17294cfbc260.zip
FreeBSD-src-551bfa2f51cfd055117aec7f1a0f17294cfbc260.tar.gz
Remove BAD144 support, it has already been disabled for some time.
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/wd.c100
1 files changed, 7 insertions, 93 deletions
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index f5b27fb..870145b 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -41,17 +41,14 @@
* o Bump error count after timeout.
* o Satisfy ATA timing in all cases.
* o Finish merging berry/sos timeout code (bump error count...).
- * o Merge/fix TIH/NetBSD bad144 code.
* o Don't use polling except for initialization. Need to
* reorganize the state machine. Then "extra" interrupts
* shouldn't happen (except maybe one for initialization).
- * o Fix disklabel, boot and driver inconsistencies with
- * bad144 in standard versions.
* o Support extended DOS partitions.
* o Support swapping to DOS partitions.
- * o Handle bad sectors, clustering, disklabelling, DOS
- * partitions and swapping driver-independently. Use
- * i386/dkbad.c for bad sectors. Swapping will need new
+ * o Handle clustering, disklabelling, DOS
+ * partitions and swapping driver-independently.
+ * Swapping will need new
* driver entries for polled reinit and polled write).
*/
@@ -68,7 +65,6 @@
#include "opt_ide_delay.h"
#include <sys/param.h>
-#include <sys/dkbad.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/conf.h>
@@ -159,7 +155,6 @@ struct disk {
#define DKFL_LABELLING 0x00080 /* readdisklabel() in progress */
#define DKFL_32BIT 0x00100 /* use 32-bit i/o mode */
#define DKFL_MULTI 0x00200 /* use multi-i/o mode */
-#define DKFL_BADSCAN 0x00400 /* report all errors */
#define DKFL_USEDMA 0x00800 /* use DMA for data transfers */
#define DKFL_DMA 0x01000 /* using DMA on this transfer-- DKFL_SINGLE
* overrides this
@@ -582,35 +577,6 @@ wdstrategy(register struct buf *bp)
if (dscheck(bp, du->dk_slices) <= 0)
goto done;
- /*
- * Check for *any* block on this transfer being on the bad block list
- * if it is, then flag the block as a transfer that requires
- * bad block handling. Also, used as a hint for low level disksort
- * clustering code to keep from coalescing a bad transfer into
- * a normal transfer. Single block transfers for a large number of
- * blocks associated with a cluster I/O are undesirable.
- *
- * XXX the old disksort() doesn't look at B_BAD. Coalescing _is_
- * desirable. We should split the results at bad blocks just
- * like we should split them at MAXTRANSFER boundaries.
- */
- if (dsgetbad(bp->b_dev, du->dk_slices) != NULL) {
- long *badsect = dsgetbad(bp->b_dev, du->dk_slices)->bi_bad;
- int i;
- int nsecs = howmany(bp->b_bcount, DEV_BSIZE);
- /* XXX pblkno is too physical. */
- daddr_t nspblkno = bp->b_pblkno
- - du->dk_slices->dss_slices[dkslice(bp->b_dev)].ds_offset;
- int blkend = nspblkno + nsecs;
-
- for (i = 0; badsect[i] != -1 && badsect[i] < blkend; i++) {
- if (badsect[i] >= nspblkno) {
- bp->b_flags |= B_BAD;
- break;
- }
- }
- }
-
/* queue transfer on drive, activate drive and controller if idle */
s = splbio();
@@ -756,16 +722,6 @@ wdstart(int ctrlr)
du->dk_flags |= DKFL_SINGLE;
}
- if (du->dk_flags & DKFL_SINGLE
- && dsgetbad(bp->b_dev, du->dk_slices) != NULL) {
- /* XXX */
- u_long ds_offset =
- du->dk_slices->dss_slices[dkslice(bp->b_dev)].ds_offset;
-
- blknum = transbad144(dsgetbad(bp->b_dev, du->dk_slices),
- blknum - ds_offset) + ds_offset;
- }
-
wdtab[ctrlr].b_active = 1; /* mark controller active */
/* if starting a multisector transfer, or doing single transfers */
@@ -1049,10 +1005,7 @@ oops:
goto outt;
}
- if (du->dk_flags & DKFL_BADSCAN) {
- bp->b_error = EIO;
- bp->b_flags |= B_ERROR;
- } else if (du->dk_status & WDCS_ERR) {
+ if (du->dk_status & WDCS_ERR) {
if (++wdtab[unit].b_errcnt < RETRIES) {
wdtab[unit].b_active = 0;
} else {
@@ -1192,8 +1145,6 @@ wdopen(dev_t dev, int flags, int fmt, struct proc *p)
if (wdtab[du->dk_ctrlr_cmd640].b_active == 2)
wdtab[du->dk_ctrlr_cmd640].b_active = 0;
- du->dk_flags &= ~DKFL_BADSCAN;
-
/* spin waiting for anybody else reading the disk label */
while (du->dk_flags & DKFL_LABELLING)
tsleep((caddr_t)&du->dk_flags, PZERO - 1, "wdopen", 1);
@@ -1263,9 +1214,6 @@ wdopen(dev_t dev, int flags, int fmt, struct proc *p)
&du->dk_dd);
/* XXX check value returned by wdwsetctlr(). */
wdwsetctlr(du);
- if (msg == NULL && du->dk_dd.d_flags & D_BADSECT)
- msg = readbad144(dkmodpart(dev, RAW_PART),
- &du->dk_dd, &du->dk_bad);
du->dk_flags &= ~DKFL_LABELLING;
if (msg != NULL) {
log(LOG_WARNING, "wd%d: cannot find label (%s)\n",
@@ -1661,8 +1609,7 @@ again:
}
/*
* Fake minimal drive geometry for reading the MBR.
- * readdisklabel() may enlarge it to read the label and the
- * bad sector table.
+ * readdisklabel() may enlarge it to read the label.
*/
du->dk_dd.d_secsize = DEV_BSIZE;
du->dk_dd.d_nsectors = 17;
@@ -1854,16 +1801,7 @@ wdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
error = dsioctl(dev, cmd, addr, flags, &du->dk_slices);
if (error != ENOIOCTL)
return (error);
- switch (cmd) {
- case DIOCSBADSCAN:
- if (*(int *)addr)
- du->dk_flags |= DKFL_BADSCAN;
- else
- du->dk_flags &= ~DKFL_BADSCAN;
- return (0);
- default:
- return (ENOTTY);
- }
+ return (ENOTTY);
}
int
@@ -1889,7 +1827,7 @@ wddump(dev_t dev)
long num; /* number of sectors to write */
int lunit, part;
long blkoff, blknum;
- long blkchk, blkcnt, blknext;
+ long blkcnt, blknext;
u_long ds_offset;
u_long nblocks;
static int wddoingadump = 0;
@@ -1969,30 +1907,6 @@ wddump(dev_t dev)
* sector is bad, then reduce reduce the transfer to
* avoid any bad sectors.
*/
- if (du->dk_flags & DKFL_SINGLE
- && dsgetbad(dev, du->dk_slices) != NULL) {
- for (blkchk = blknum; blkchk < blknum + blkcnt; blkchk++) {
- daddr_t blknew;
- blknew = transbad144(dsgetbad(dev, du->dk_slices),
- blkchk - ds_offset) + ds_offset;
- if (blknew != blkchk) {
- /* Found bad block. */
- blkcnt = blkchk - blknum;
- if (blkcnt > 0) {
- blknext = blknum + blkcnt;
- goto out;
- }
- blkcnt = 1;
- blknext = blknum + blkcnt;
-#if 1 || defined(WDDEBUG)
- printf("bad block %ld -> %ld\n",
- (long)blknum, (long)blknew);
-#endif
- break;
- }
- }
- }
-out:
/* Compute disk address. */
cylin = blknum / secpercyl;
OpenPOWER on IntegriCloud