diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2007-02-21 11:01:11 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2007-02-21 11:01:11 +0000 |
commit | d416e035bc192bb2d7566e0f08b3b1d7f64deaed (patch) | |
tree | 734583e04121b7e13e7329e31115650772a66ca8 /sys/arch/hp300 | |
parent | 44745f069c1adadf5f3f6db147caa3447656be7f (diff) |
remove part of buf abuse and store errcnt in softc (instead of b_errcnt); more work can be done to lower buf abuse even more; miod@ testing and ok
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r-- | sys/arch/hp300/dev/hd.c | 14 | ||||
-rw-r--r-- | sys/arch/hp300/dev/hdvar.h | 3 |
2 files changed, 9 insertions, 8 deletions
diff --git a/sys/arch/hp300/dev/hd.c b/sys/arch/hp300/dev/hd.c index 9d3ecb0eb78..114ca4d7aec 100644 --- a/sys/arch/hp300/dev/hd.c +++ b/sys/arch/hp300/dev/hd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hd.c,v 1.41 2006/08/12 13:53:44 krw Exp $ */ +/* $OpenBSD: hd.c,v 1.42 2007/02/21 11:01:10 mickey Exp $ */ /* $NetBSD: rd.c,v 1.33 1997/07/10 18:14:08 kleink Exp $ */ /* @@ -734,7 +734,7 @@ hdfinish(rs, bp) struct buf *dp = &rs->sc_tab; int s; - dp->b_errcnt = 0; + rs->sc_errcnt = 0; dp->b_actf = bp->b_actf; bp->b_resid = 0; s = splbio(); @@ -809,12 +809,12 @@ again: if (hddebug & HDB_ERROR) printf("%s: hdstart: cmd %x adr %lx blk %d len %d ecnt %ld\n", rs->sc_dev.dv_xname, rs->sc_ioc.c_cmd, rs->sc_ioc.c_addr, - bp->b_blkno, rs->sc_resid, rs->sc_tab.b_errcnt); + bp->b_blkno, rs->sc_resid, rs->sc_errcnt); rs->sc_stats.hdretries++; #endif rs->sc_flags &= ~HDF_SEEK; hdreset(rs); - if (rs->sc_tab.b_errcnt++ < HDRETRY) + if (rs->sc_errcnt++ < HDRETRY) goto again; printf("%s: hdstart err: err: cmd 0x%x sect %ld blk %d len %d\n", rs->sc_dev.dv_xname, rs->sc_ioc.c_cmd, rs->sc_ioc.c_addr, @@ -911,7 +911,7 @@ hdinterrupt(arg) #ifdef DEBUG rs->sc_stats.hdretries++; #endif - if (rs->sc_tab.b_errcnt++ < HDRETRY) { + if (rs->sc_errcnt++ < HDRETRY) { if (restart) hdstart(rs); return; @@ -1004,7 +1004,7 @@ hderror(unit) * HDRETRY as defined, the range is 1 to 32 seconds. */ if (sp->c_fef & FEF_IMR) { - int hdtimo = HDWAITC << rs->sc_tab.b_errcnt; + int hdtimo = HDWAITC << rs->sc_errcnt; #ifdef DEBUG printf("%s: internal maintenance, %d second timeout\n", rs->sc_dev.dv_xname, hdtimo); @@ -1019,7 +1019,7 @@ hderror(unit) * threshold. By default, this will only report after the * retry limit has been exceeded. */ - if (rs->sc_tab.b_errcnt < hderrthresh) + if (rs->sc_errcnt < hderrthresh) return(1); /* diff --git a/sys/arch/hp300/dev/hdvar.h b/sys/arch/hp300/dev/hdvar.h index dfe8917d3c2..5a2c01e4513 100644 --- a/sys/arch/hp300/dev/hdvar.h +++ b/sys/arch/hp300/dev/hdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hdvar.h,v 1.8 2005/11/18 00:09:15 miod Exp $ */ +/* $OpenBSD: hdvar.h,v 1.9 2007/02/21 11:01:10 mickey Exp $ */ /* $NetBSD: rdvar.h,v 1.6 1997/01/30 09:14:19 thorpej Exp $ */ /* @@ -66,6 +66,7 @@ struct hd_softc { short sc_type; char *sc_addr; int sc_resid; + int sc_errcnt; struct hpibqueue sc_hq; /* hpib job queue entry */ struct hd_iocmd sc_ioc; struct hd_rscmd sc_rsc; |