Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/thorpej_scsipi]: src/sys/dev/ic Gives a single-bit flag for T_TAGOFF.
details: https://anonhg.NetBSD.org/src/rev/d9d41b8ba8f8
branches: thorpej_scsipi
changeset: 477350:d9d41b8ba8f8
user: bouyer <bouyer%NetBSD.org@localhost>
date: Sat Dec 16 19:40:29 2000 +0000
description:
Gives a single-bit flag for T_TAGOFF.
Report tagged-queuing support to upper layer, so that tagged queuing is
really used. Report QUEUE FULL events to upper layer. Bup per-target
openings to 256 as the driver supports it. Fix handling of T_SYNCOFF.
diffstat:
sys/dev/ic/ncr53c9x.c | 63 +++++++++++++----------------------------------
sys/dev/ic/ncr53c9xreg.h | 2 +-
sys/dev/ic/ncr53c9xvar.h | 4 +-
3 files changed, 21 insertions(+), 48 deletions(-)
diffs (152 lines):
diff -r 92c5ac8659ff -r d9d41b8ba8f8 sys/dev/ic/ncr53c9x.c
--- a/sys/dev/ic/ncr53c9x.c Fri Dec 15 07:48:32 2000 +0000
+++ b/sys/dev/ic/ncr53c9x.c Sat Dec 16 19:40:29 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr53c9x.c,v 1.36.2.7 2000/12/13 15:50:04 bouyer Exp $ */
+/* $NetBSD: ncr53c9x.c,v 1.36.2.8 2000/12/16 19:40:29 bouyer Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -234,7 +234,7 @@
adapt->adapt_dev = &sc->sc_dev;
adapt->adapt_nchannels = 1;
adapt->adapt_openings = 256;
- adapt->adapt_max_periph = 32;
+ adapt->adapt_max_periph = 256;
adapt->adapt_ioctl = ncr53c9x_ioctl;
/* adapt_request initialized by front-end */
/* adapt_minphys initialized by front-end */
@@ -436,9 +436,8 @@
struct ncr53c9x_tinfo *ti = &sc->sc_tinfo[r];
/* XXX - config flags per target: low bits: no reselect; high bits: no synch */
- ti->flags = ((sc->sc_cfflags & (1<<(r+16))) ? T_TAGOFF : 0) |
- ((sc->sc_minsync && !(sc->sc_cfflags & (1<<(r+8))))
- ? T_SYNCHOFF : 0) |
+ ti->flags = ((sc->sc_minsync && !(sc->sc_cfflags & (1<<(r+8))))
+ ? 0 : T_SYNCHOFF) |
((sc->sc_cfflags & (1<<r)) ? T_RSELECTOFF : 0) |
T_NEED_TO_RESET;
#ifdef DEBUG
@@ -864,10 +863,14 @@
ti->period = 0;
ti->offset = 0;
+ if ((sc->sc_cfflags & (1<<(xm->xm_target+16))) == 0 &&
+ (xm->xm_mode & PERIPH_CAP_TQING))
+ ti->flags &= ~T_TAGOFF;
+ else
+ ti->flags |= T_TAGOFF;
+
if ((xm->xm_mode & PERIPH_CAP_SYNC) != 0 &&
- sc->sc_minsync != 0 &&
- (sc->sc_cfflags &
- (1 << (xm->xm_target + 8))) == 0) {
+ (ti->flags & T_SYNCHOFF) == 0) {
ti->flags |= T_NEGOTIATE;
ti->period = sc->sc_minsync;
}
@@ -901,6 +904,8 @@
xm.xm_period = ti->period;
xm.xm_offset = ti->offset;
}
+ if ((ti->flags & (T_RSELECTOFF|T_TAGOFF)) == 0)
+ xm.xm_mode |= PERIPH_CAP_TQING;
scsipi_async_event(&sc->sc_channel, ASYNC_EVENT_XFER_MODE, &xm);
}
@@ -944,37 +949,12 @@
int flag;
struct proc *p;
{
- struct ncr53c9x_softc *sc = (void *)chan->chan_adapter->adapt_dev;
+ /* struct ncr53c9x_softc *sc = (void *)chan->chan_adapter->adapt_dev; */
int s, error = 0;
s = splbio();
switch (cmd) {
- case SCBUSACCEL: {
- struct scbusaccel_args *sp = (struct scbusaccel_args *)arg;
- struct ncr53c9x_tinfo *ti = &sc->sc_tinfo[sp->sa_target];
-
- if (sp->sa_lun != 0)
- break;
-
- if ((sp->sa_flags & SC_ACCEL_SYNC) != 0) {
- /* If this adapter can't do sync; drop it */
- if (sc->sc_minsync == 0)
- break;
-
- /*
- * Check whether target is already clamped at
- * non-sync operation on user request.
- */
- if ((ti->flags & T_SYNCHOFF) != 0)
- break;
-
- printf("%s: target %d: sync negotiation\n",
- sc->sc_dev.dv_xname, sp->sa_target);
- ti->flags |= T_NEGOTIATE;
- }
- break;
- }
default:
error = ENOTTY;
break;
@@ -1155,17 +1135,6 @@
callout_stop(&ecb->xs->xs_callout);
- if (ecb->stat == SCSI_QUEUE_FULL) {
- /*
- * Set current throttle -- we should reset
- * this periodically
- */
- periph->periph_openings = li->used - 1;
- printf("\n%s: QFULL -- throttling to %d commands\n",
- sc->sc_dev.dv_xname, periph->periph_openings);
-
- }
-
/*
* Now, if we've come here with no error code, i.e. we've kept the
* initial XS_NOERROR, and the status code signals that we should
@@ -1188,6 +1157,10 @@
} else {
xs->resid = ecb->dleft;
}
+ if (xs->status == SCSI_QUEUE_FULL) {
+ printf("queue full\n");
+ xs->error = XS_BUSY;
+ }
}
#ifdef NCR53C9X_DEBUG
diff -r 92c5ac8659ff -r d9d41b8ba8f8 sys/dev/ic/ncr53c9xreg.h
--- a/sys/dev/ic/ncr53c9xreg.h Fri Dec 15 07:48:32 2000 +0000
+++ b/sys/dev/ic/ncr53c9xreg.h Sat Dec 16 19:40:29 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr53c9xreg.h,v 1.6.2.1 2000/11/20 11:40:48 bouyer Exp $ */
+/* $NetBSD: ncr53c9xreg.h,v 1.6.2.2 2000/12/16 19:40:29 bouyer Exp $ */
/*
* Copyright (c) 1994 Peter Galbavy. All rights reserved.
diff -r 92c5ac8659ff -r d9d41b8ba8f8 sys/dev/ic/ncr53c9xvar.h
--- a/sys/dev/ic/ncr53c9xvar.h Fri Dec 15 07:48:32 2000 +0000
+++ b/sys/dev/ic/ncr53c9xvar.h Sat Dec 16 19:40:29 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr53c9xvar.h,v 1.18.2.4 2000/12/08 09:12:24 bouyer Exp $ */
+/* $NetBSD: ncr53c9xvar.h,v 1.18.2.5 2000/12/16 19:40:30 bouyer Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -175,7 +175,7 @@
#define T_SYNCMODE 0x08 /* SYNC mode has been negotiated */
#define T_SYNCHOFF 0x10 /* SYNC mode for is permanently off */
#define T_RSELECTOFF 0x20 /* RE-SELECT mode is off */
-#define T_TAGOFF 0x30 /* TAG QUEUEs are off */
+#define T_TAGOFF 0x40 /* TAG QUEUEs are off */
u_char period; /* Period suggestion */
u_char offset; /* Offset suggestion */
u_char nextag; /* Next available tag */
Home |
Main Index |
Thread Index |
Old Index