summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-11-18 23:23:32 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-11-18 23:23:32 +0000
commitd52c8024e7c17c269dfa3418932ab4031e417d29 (patch)
treeb7e6caa07b7c382874f5340dbda4ae08014f1628 /sys/arch
parentc49ddbccb7f1d6943f89f0857bfb74212da5201b (diff)
Remove the duplicated code in ssh_checkintr() - checked against mvme68k.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme88k/dev/ssh.c191
1 files changed, 1 insertions, 190 deletions
diff --git a/sys/arch/mvme88k/dev/ssh.c b/sys/arch/mvme88k/dev/ssh.c
index fa8fee9c051..694c9f9d904 100644
--- a/sys/arch/mvme88k/dev/ssh.c
+++ b/sys/arch/mvme88k/dev/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.17 2003/11/18 09:34:13 miod Exp $ */
+/* $OpenBSD: ssh.c,v 1.18 2003/11/18 23:23:31 miod Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -1382,195 +1382,6 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
rp->ssh_dcntl |= SSH_DCNTL_STD;
return (0);
}
-
- sshreset (sc);
- *status = -1;
- return 0; /* sshreset has cleaned up */
- }
-
- if (sstat0 & SSH_SSTAT0_M_A) { /* Phase mismatch */
-
-#ifdef DEBUG
- printf("%s: Phase mismatch - expecting %x got %x\n",
- sc->sc_dev.dv_xname, rp->ssh_dcmd & 0x07,
- rp->ssh_sstat2 & 0x07);
- ++sshphmm;
-#endif
- if (acb == NULL) {
- printf("%s: Phase mismatch with no active command- expecting %x got %x\n",
- sc->sc_dev.dv_xname,
- *((long *)&rp->ssh_dcmd) & 0x07000000,
- rp->ssh_sstat2 & 0x07);
- goto bad_phase;
- }
-
- if (acb->iob_len) {
- int adjust;
- adjust = ((dfifo - (dbc & 0x7f)) & 0x7f);
- if (sstat1 & SSH_SSTAT1_ORF)
- ++adjust;
- if (sstat1 & SSH_SSTAT1_OLF)
- ++adjust;
- /* XXX what's with this ssh_dcmd here? nivas */
- acb->iob_curlen = *((long *)&rp->ssh_dcmd) & 0xffffff;
- acb->iob_curlen += adjust;
- acb->iob_curbuf = *((long *)&rp->ssh_dnad) - adjust;
-#ifdef DEBUG
- if (ssh_debug & 0x100) {
- int i;
- printf ("Phase mismatch: curbuf %lx curlen %lx dfifo %x dbc %x sstat1 %x adjust %x sbcl %x starts %d acb %p\n",
- acb->iob_curbuf, acb->iob_curlen, dfifo,
- dbc, sstat1, adjust, rp->ssh_sbcl, sshstarts, acb);
- if (acb->ds.chain[1].datalen) {
- for (i = 0; acb->ds.chain[i].datalen; ++i)
- printf("chain[%d] addr %p len %lx\n",
- i, acb->ds.chain[i].databuf,
- acb->ds.chain[i].datalen);
- }
- }
-#endif
-#if 0
- dma_cachectl(acb, sizeof(*acb), DMA_CACHE_SYNC);
-#endif
- }
-#ifdef DEBUG
- SSH_TRACE('m',rp->ssh_sbcl,(rp->ssh_dsp>>8),rp->ssh_dsp);
- if (ssh_debug & 9)
- printf ("Phase mismatch: %x dsp +%lx dcmd %lx\n",
- rp->ssh_sbcl,
- rp->ssh_dsp - sc->sc_scriptspa,
- *((long *)&rp->ssh_dcmd));
-#endif
- if ((rp->ssh_sbcl & SSH_REQ) == 0) {
- printf ("Phase mismatch: REQ not asserted! %02x dsp %lx\n",
- rp->ssh_sbcl, rp->ssh_dsp);
-#if defined(DEBUG) && defined(DDB)
- Debugger();
-#endif
- goto bad_phase;
- }
-#if XXX
- switch (rp->ssh_sbcl & 7)
-#endif
- switch (rp->ssh_sstat2 & 7) {
- case 0: /* data out */
- case 1: /* data in */
- case 2: /* command */
- case 3: /* status */
- case 6: /* message out */
- case 7: /* message in */
- rp->ssh_dsp = sc->sc_scriptspa + Ent_switch;
- break;
- default:
- goto bad_phase;
- }
- return 0;
- }
-
- if (sstat0 & SSH_SSTAT0_STO) { /* SCSI bus time out */
-
- if (acb == NULL) {
- printf("%s: SCSI bus timeout with no active command?\n",
- sc->sc_dev.dv_xname);
- /*Debugger();*/
- }
-
- printf ("STO: scripts %x dsp %x dcmd %x dsps %x\n", sc->sc_scriptspa,
- rp->ssh_dsp, *((long *)&rp->ssh_dcmd), rp->ssh_dsps);
-
- if ((istat & SSH_ISTAT_CON) == 0) {
- printf("selection of %x timeout\n", rp->ssh_sdid);
- } else if ((rp->ssh_ctest0 & SSH_CTEST0_BTD) == 0) {
- printf("No SCSI activity for 250ms(ctest0 %x %x dsps %x)\n",
- rp->ssh_ctest0,
- rp->ssh_ctest0,
- rp->ssh_dsps);
- } else {
- printf("Waited > 250ms for disconnect\n");
- }
-
-#ifdef DEBUG
- printf ("scripts %x dsp %x dcmd %x\n", sc->sc_scriptspa,
- rp->ssh_dsp, *((long *)&rp->ssh_dcmd));
-
- printf("msg %x status %x\n", acb->msg[0], acb->stat[0]);
-
- if (rp->ssh_sbcl & SSH_BSY) {
- printf ("ACK! ssh was busy at timeout: rp %p script %p dsa %p\n",
- rp, &scripts, &acb->ds);
- printf(" sbcl %x sdid %x istat %x dstat %x sstat0 %x\n",
- rp->ssh_sbcl, rp->ssh_sdid, istat, dstat, sstat0);
- if (!(rp->ssh_sbcl & SSH_BSY)) {
- printf ("Yikes, it's not busy now!\n");
-#if 0
- *status = -1;
- if (sc->nexus_list.tqh_first)
- rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect;
- return 1;
-#endif
- }
-
- /*
- * I am not sure if DCNTL_STD can be used to restart.
- * The manual discusses this bit only for manual start
- * mode and single step mode, which we are not using.
- * I will give it a shot... nivas
- */
-
- if (kludge_city) {
- dummy = rp->ssh_dsp;
- rp->ssh_dsp = dummy;
- } else {
- rp->ssh_dcntl |= SSH_DCNTL_STD;
- }
- return (0);
-#ifdef DDB
- Debugger();
-#endif
- }
-#endif
- if (rp->ssh_sbcl & SSH_BSY) {
- if (!(rp->ssh_sbcl & SSH_BSY)) {
- printf ("Yikes, it's not busy now!\n");
- *status = -1;
- if (sc->nexus_list.tqh_first)
- rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect;
- return 1;
- }
-
- rp->ssh_dcntl |= SSH_DCNTL_STD;
-
- return 0;
- }
-
- *status = -1;
- if (acb)
- acb->xs->error = XS_SELTIMEOUT;
- if (sc->nexus_list.tqh_first)
- rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect;
- return 1;
- }
-
- if (acb)
- target = acb->xs->sc_link->target;
- else
- target = 7;
-
- if (sstat0 & SSH_SSTAT0_UDC) {
-#ifdef DEBUG
- if (acb == NULL)
- printf("%s: Unexpected disconnect with no active command?\n",
- sc->sc_dev.dv_xname);
- printf ("%s: target %d disconnected unexpectedly\n",
- sc->sc_dev.dv_xname, target);
-#endif
-#if 0
- sshabort (sc, rp, "sshchkintr");
-#endif
- *status = STS_BUSY;
- if (sc->nexus_list.tqh_first)
- rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect;
- return (acb != NULL);
}
if (sstat0 == 0 && dstat & SSH_DSTAT_SIR) {