From 8f349de23e784b788cf0a84dcd049012afb9519d Mon Sep 17 00:00:00 2001 From: Alexander Yurchenko Date: Thu, 19 Mar 2009 13:25:19 +0000 Subject: Make ips_timeout to be usable not only with scsi xfers. --- sys/dev/pci/ips.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index 56e4ff73200..2d4730e794a 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.74 2009/03/19 10:04:47 grange Exp $ */ +/* $OpenBSD: ips.c,v 1.75 2009/03/19 13:25:18 grange Exp $ */ /* * Copyright (c) 2006, 2007, 2009 Alexander Yurchenko @@ -1687,21 +1687,21 @@ ips_timeout(void *arg) struct scsi_xfer *xs = ccb->c_xfer; int s; - /* - * Command never completed. Cleanup and recover. - */ s = splbio(); - sc_print_addr(xs->sc_link); - printf("timeout"); - DPRINTF(IPS_D_ERR, (", command %d", ccb->c_id)); - printf("\n"); + if (xs) + sc_print_addr(xs->sc_link); + else + printf("%s: ", sc->sc_dev.dv_xname); + printf("timeout\n"); + /* + * Command never completed. Fake hardware status byte + * to indicate timeout. + * XXX: need to remove command from controller. + */ + ccb->c_stat = IPS_STAT_TIMO; + ips_done(sc, ccb); ips_ccb_put(sc, ccb); - - xs->error = XS_TIMEOUT; - xs->flags |= ITSDONE; - scsi_done(xs); - splx(s); } -- cgit v1.2.3