Source-Changes-HG archive

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

[src/thorpej_scsipi]: src/sys/dev/scsipi Add an asynchronous event for the ad...



details:   https://anonhg.NetBSD.org/src/rev/06a93fbfea4b
branches:  thorpej_scsipi
changeset: 477279:06a93fbfea4b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Oct 19 21:04:27 1999 +0000

description:
Add an asynchronous event for the adapter to notify the midlayer that
xfer mode parameters have changed for an I_T Nexus.

diffstat:

 sys/dev/scsipi/scsipi_base.c |  33 ++++++++++++++++++++++++++++++++-
 sys/dev/scsipi/scsipiconf.h  |  15 ++++++++++++++-
 2 files changed, 46 insertions(+), 2 deletions(-)

diffs (100 lines):

diff -r c0f87ebe87e9 -r 06a93fbfea4b sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c      Tue Oct 19 20:10:43 1999 +0000
+++ b/sys/dev/scsipi/scsipi_base.c      Tue Oct 19 21:04:27 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipi_base.c,v 1.26.2.1 1999/10/19 17:39:35 thorpej Exp $     */
+/*     $NetBSD: scsipi_base.c,v 1.26.2.2 1999/10/19 21:04:27 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -71,6 +71,8 @@
 
 void   scsipi_async_event_max_openings __P((struct scsipi_channel *,
            struct scsipi_max_openings *));
+void   scsipi_async_event_xfer_mode __P((struct scsipi_channel *,
+           struct scsipi_xfer_mode *));
 
 struct pool scsipi_xfer_pool;
 
@@ -1586,6 +1588,11 @@
                scsipi_async_event_max_openings(chan,
                    (struct scsipi_max_openings *)arg);
                break;
+
+       case ASYNC_EVENT_XFER_MODE:
+               scsipi_async_event_xfer_mode(chan,
+                   (struct scsipi_xfer_mode *)arg);
+               break;
        }
        splx(s);
 }
@@ -1671,6 +1678,30 @@
 }
 
 /*
+ * scsipi_async_event_xfer_mode:
+ *
+ *     Update the xfer mode for all periphs sharing the
+ *     specified I_T Nexus.
+ */
+void
+scsipi_async_event_xfer_mode(chan, xm)
+       struct scsipi_channel *chan;
+       struct scsipi_xfer_mode *xm;
+{
+       struct scsipi_periph *periph;
+       int lun;
+
+       for (lun = 0; lun < chan->chan_nluns; lun++) {
+               periph = scsipi_lookup_periph(chan, xm->xm_target, lun);
+               if (periph == NULL)
+                       continue;
+               scsipi_adapter_request(chan, ADAPTER_REQ_GET_XFER_MODE, periph);
+               periph->periph_mode &= periph->periph_cap;
+               scsipi_print_xfer_mode(periph);
+       }
+}
+
+/*
  * scsipi_adapter_addref:
  *
  *     Add a reference to the adapter pointed to by the provided
diff -r c0f87ebe87e9 -r 06a93fbfea4b sys/dev/scsipi/scsipiconf.h
--- a/sys/dev/scsipi/scsipiconf.h       Tue Oct 19 20:10:43 1999 +0000
+++ b/sys/dev/scsipi/scsipiconf.h       Tue Oct 19 21:04:27 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipiconf.h,v 1.32.2.1 1999/10/19 17:39:38 thorpej Exp $      */
+/*     $NetBSD: scsipiconf.h,v 1.32.2.2 1999/10/19 21:04:27 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -92,9 +92,13 @@
  *     ASYNC_EVENT_MAX_OPENINGS        scsipi_max_openings * -- max
  *                                     openings, device specified in
  *                                     parameters
+ *
+ *     ASYNC_EVENT_XFER_MODE           scsipi_xfer_mode * -- xfer mode
+ *                                     parameters changed for I_T Nexus
  */
 typedef enum {
        ASYNC_EVENT_MAX_OPENINGS,       /* set max openings on periph */
+       ASYNC_EVENT_XFER_MODE,          /* xfer mode update for I_T */
 } scsipi_async_event_t;
 
 /*
@@ -108,6 +112,15 @@
        int     mo_openings;            /* openings value */
 };
 
+/*
+ * scsipi_xfer_mode:
+ *
+ *     Argument for an ASYNC_EVENT_XFER_MODE event.
+ */
+struct scsipi_xfer_mode {
+       int     xm_target;              /* target, for I_T Nexus */
+};
+
 
 /*
  * scsipi_adapter_req_t:



Home | Main Index | Thread Index | Old Index