Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/amiga/dev/siop.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/amiga/dev/siop.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.58 retrieving revision 1.58.28.1 diff -u -p -r1.58 -r1.58.28.1 --- src/sys/arch/amiga/dev/siop.c 2007/10/17 19:53:17 1.58 +++ src/sys/arch/amiga/dev/siop.c 2009/01/19 13:15:56 1.58.28.1 @@ -1,4 +1,4 @@ -/* $NetBSD: siop.c,v 1.58 2007/10/17 19:53:17 garbled Exp $ */ +/* $NetBSD: siop.c,v 1.58.28.1 2009/01/19 13:15:56 skrll Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -70,10 +70,12 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.58 2007/10/17 19:53:17 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.58.28.1 2009/01/19 13:15:56 skrll Exp $"); #include #include +#include +#include #include #include #include @@ -109,6 +111,7 @@ int siop_checkintr(struct siop_softc *, void siopreset(struct siop_softc *); void siopsetdelay(int); void siop_scsidone(struct siop_acb *, int); +void siop_timeout(void *); void siop_sched(struct siop_softc *); void siop_poll(struct siop_softc *, struct siop_acb *); void siopintr(struct siop_softc *); @@ -419,6 +422,9 @@ siop_scsidone(struct siop_acb *acb, int #endif return; } + + callout_stop(&xs->xs_callout); + periph = xs->xs_periph; sc = (void *)periph->periph_channel->chan_adapter->adapt_dev; @@ -556,8 +562,8 @@ siopinitialize(struct siop_softc *sc) * malloc sc_acb to ensure that DS is on a long word boundary. */ - MALLOC(sc->sc_acb, struct siop_acb *, - sizeof(struct siop_acb) * SIOP_NACB, M_DEVBUF, M_NOWAIT); + sc->sc_acb = malloc(sizeof(struct siop_acb) * SIOP_NACB, + M_DEVBUF, M_NOWAIT); if (sc->sc_acb == NULL) panic("siopinitialize: ACB malloc failed!"); @@ -598,6 +604,28 @@ siopinitialize(struct siop_softc *sc) } void +siop_timeout(void *arg) +{ + struct siop_acb *acb; + struct scsipi_periph *periph; + struct siop_softc *sc; + int s; + + acb = arg; + periph = acb->xs->xs_periph; + sc = device_private(periph->periph_channel->chan_adapter->adapt_dev); + scsipi_printaddr(periph); + printf("timed out\n"); + + s = splbio(); + + acb->xs->error = XS_TIMEOUT; + siopreset(sc); + + splx(s); +} + +void siopreset(struct siop_softc *sc) { siop_regmap_p rp; @@ -842,6 +870,8 @@ siop_start(struct siop_softc *sc, int ta } #endif if (sc->nexus_list.tqh_first == NULL) { + callout_reset(&acb->xs->xs_callout, + mstohz(acb->xs->timeout) + 1, siop_timeout, acb); if (rp->siop_istat & SIOP_ISTAT_CON) printf("%s: siop_select while connected?\n", sc->sc_dev.dv_xname); @@ -1352,7 +1382,7 @@ siop_checkintr(struct siop_softc *sc, u_ sc->sc_dev.dv_xname, rp->siop_sfbr, acb->msg[1], rp->siop_sbcl); /* what should be done here? */ DCIAS(kvtop(&acb->msg[1])); - rp->siop_dsp = sc->sc_scriptspa + Ent_switch; + rp->siop_dsp = sc->sc_scriptspa + Ent_clear_ack; return (0); } if (dstat & SIOP_DSTAT_SIR && rp->siop_dsps == 0xff0a) {