Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Implement a function to kill off all commands...



details:   https://anonhg.NetBSD.org/src/rev/688f5246a303
branches:  trunk
changeset: 476273:688f5246a303
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 11 21:39:53 1999 +0000

description:
Implement a function to kill off all commands pending for a given
scsipi_link.

diffstat:

 sys/dev/scsipi/scsipi_base.c |  20 +++++++++++++++++++-
 sys/dev/scsipi/scsipiconf.h  |   3 ++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diffs (51 lines):

diff -r be1e1cb88d72 -r 688f5246a303 sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c      Sat Sep 11 21:25:26 1999 +0000
+++ b/sys/dev/scsipi/scsipi_base.c      Sat Sep 11 21:39:53 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipi_base.c,v 1.22 1999/06/16 07:35:31 pk Exp $      */
+/*     $NetBSD: scsipi_base.c,v 1.23 1999/09/11 21:39:53 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -188,6 +188,24 @@
 }
 
 /*
+ * Kill off all pending xfers for a scsipi_link.
+ *
+ * Must be called at splbio().
+ */
+void
+scsipi_kill_pending(sc_link)
+       struct scsipi_link *sc_link;
+{
+       struct scsipi_xfer *xs;
+
+       while ((xs = TAILQ_FIRST(&sc_link->pending_xfers)) != NULL) {
+               xs->flags |= ITSDONE;
+               xs->error = ENODEV;
+               scsipi_done(xs);
+       }
+}
+
+/*
  * Look at the returned sense and act on the error, determining
  * the unix error number to pass back.  (0 = report no error)
  *
diff -r be1e1cb88d72 -r 688f5246a303 sys/dev/scsipi/scsipiconf.h
--- a/sys/dev/scsipi/scsipiconf.h       Sat Sep 11 21:25:26 1999 +0000
+++ b/sys/dev/scsipi/scsipiconf.h       Sat Sep 11 21:39:53 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipiconf.h,v 1.30 1999/04/08 11:29:01 bouyer Exp $   */
+/*     $NetBSD: scsipiconf.h,v 1.31 1999/09/11 21:39:53 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -393,6 +393,7 @@
 void   scsipi_user_done __P((struct scsipi_xfer *));
 int    scsipi_interpret_sense __P((struct scsipi_xfer *));
 void   scsipi_wait_drain __P((struct scsipi_link *));
+void   scsipi_kill_pending __P((struct scsipi_link *));
 #ifdef SCSIVERBOSE
 void   scsipi_print_sense __P((struct scsipi_xfer *, int));
 void   scsipi_print_sense_data __P((struct scsipi_sense_data *, int));



Home | Main Index | Thread Index | Old Index