Source-Changes-HG archive

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

[src/thorpej_scsipi]: src/sys/dev/i2o Sync thorpej_scsipi with trunk.



details:   https://anonhg.NetBSD.org/src/rev/071a1041b39e
branches:  thorpej_scsipi
changeset: 477337:071a1041b39e
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Nov 22 17:34:19 2000 +0000

description:
Sync thorpej_scsipi with trunk.

diffstat:

 sys/dev/i2o/Makefile   |     7 +
 sys/dev/i2o/TODO       |    29 +
 sys/dev/i2o/files.i2o  |    13 +
 sys/dev/i2o/i2o.h      |   823 ++++++++++++++++++++++++
 sys/dev/i2o/iop.c      |  1635 ++++++++++++++++++++++++++++++++++++++++++++++++
 sys/dev/i2o/iopreg.h   |    50 +
 sys/dev/i2o/iopsp.c    |   673 +++++++++++++++++++
 sys/dev/i2o/iopspvar.h |    73 ++
 sys/dev/i2o/iopvar.h   |   213 ++++++
 sys/dev/i2o/lsu_iop.c  |   470 +++++++++++++
 10 files changed, 3986 insertions(+), 0 deletions(-)

diffs (truncated from 4026 to 300 lines):

diff -r 7e6ef7fb7787 -r 071a1041b39e sys/dev/i2o/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/i2o/Makefile      Wed Nov 22 17:34:19 2000 +0000
@@ -0,0 +1,7 @@
+#      $NetBSD: Makefile,v 1.2.2.2 2000/11/22 17:34:19 bouyer Exp $
+
+INCSDIR= /usr/include/dev/i2o
+
+INCS=  i2o.h iopvar.h
+
+.include <bsd.kinc.mk>
diff -r 7e6ef7fb7787 -r 071a1041b39e sys/dev/i2o/TODO
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/i2o/TODO  Wed Nov 22 17:34:19 2000 +0000
@@ -0,0 +1,29 @@
+$NetBSD: TODO,v 1.1.2.2 2000/11/22 17:34:19 bouyer Exp $
+
+iop
+
+o Rid us of kvtop()
+o Overhaul message allocation and queueing
+o ioctl interface
+o Asynchronous event notification
+o Reconfiguration
+o Useful statistics
+o Runtime tunables
+o Immediate transfer via the SGL for small payloads, if useful
+o Reset without reboot (for f/w upload/download/affix)
+
+lsu_iop
+
+o Handle removable and non-direct access devices
+o Timeouts
+
+iopsp
+
+o Timeouts & aborts for async commands
+o Hook in and test rescan; need to handle changed TIDs
+o Queueing, perhaps one initiator per target (not very useful ATM)
+
+misc
+
+o iopctl
+o Support for LAN class devices
diff -r 7e6ef7fb7787 -r 071a1041b39e sys/dev/i2o/files.i2o
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/i2o/files.i2o     Wed Nov 22 17:34:19 2000 +0000
@@ -0,0 +1,13 @@
+#      $NetBSD: files.i2o,v 1.1.2.2 2000/11/22 17:34:20 bouyer Exp $
+
+defopt opt_i2o.h       I2OVERBOSE I2ODEBUG
+
+device iop {tid = -1}
+file   dev/i2o/iop.c           iop             needs-flag
+
+attach lsu at iop with lsu_iop
+file   dev/i2o/lsu_iop.c       lsu_iop
+
+device iopsp: scsi
+attach iopsp at iop
+file   dev/i2o/iopsp.c         iopsp
diff -r 7e6ef7fb7787 -r 071a1041b39e sys/dev/i2o/i2o.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/i2o/i2o.h Wed Nov 22 17:34:19 2000 +0000
@@ -0,0 +1,823 @@
+/*     $NetBSD: i2o.h,v 1.1.2.2 2000/11/22 17:34:20 bouyer Exp $       */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Andrew Doran.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * I2O structures and constants, as presented by the I2O specification
+ * revision 1.5 (obtainable from http://www.i2osig.org/).  Currently, only
+ * what's useful to us is defined in this file.
+ */
+
+#ifndef        _I2O_I2O_H_
+#define        _I2O_I2O_H_
+
+/*
+ * ================= Miscellenous definitions =================
+ */
+
+/* Macros to assist in building message headers */
+#define        I2O_MSGFLAGS(s)         (I2O_VERSION_11 | (sizeof(struct s) << 14))
+#define        I2O_MSGFUNC(t, f)       ((t) | (I2O_TID_HOST << 12) | ((f) << 24))
+
+/* Common message function codes with no payload or an undefined payload */
+#define        I2O_UTIL_NOP                    0x00
+#define        I2O_EXEC_IOP_CLEAR              0xbe
+#define        I2O_EXEC_SYS_QUIESCE            0xc3
+#define        I2O_EXEC_SYS_ENABLE             0xd1
+#define        I2O_PRIVATE_MESSAGE             0xff
+
+/* Device class codes */
+#define        I2O_CLASS_EXECUTIVE                     0x00
+#define        I2O_CLASS_DDM                           0x01
+#define        I2O_CLASS_RANDOM_BLOCK_STORAGE          0x10
+#define        I2O_CLASS_SEQUENTIAL_STORAGE            0x11
+#define        I2O_CLASS_LAN                           0x20
+#define        I2O_CLASS_WAN                           0x30
+#define        I2O_CLASS_FIBRE_CHANNEL_PORT            0x40
+#define        I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL      0x41
+#define        I2O_CLASS_SCSI_PERIPHERAL               0x51
+#define        I2O_CLASS_ATE_PORT                      0x60
+#define        I2O_CLASS_ATE_PERIPHERAL                0x61
+#define        I2O_CLASS_FLOPPY_CONTROLLER             0x70
+#define        I2O_CLASS_FLOPPY_DEVICE                 0x71
+#define        I2O_CLASS_BUS_ADAPTER_PORT              0x80
+
+#define        I2O_CLASS_ANY                           0xffffffff
+
+/* Reply status codes */
+#define        I2O_STATUS_SUCCESS                      0x00
+#define        I2O_STATUS_ABORT_DIRTY                  0x01
+#define        I2O_STATUS_ABORT_NO_DATA_XFER           0x02
+#define        I2O_STATUS_ABORT_PARTIAL_XFER           0x03
+#define        I2O_STATUS_ERROR_DIRTY                  0x04
+#define        I2O_STATUS_ERROR_NO_DATA_XFER           0x05
+#define        I2O_STATUS_ERROR_PARTIAL_XFER           0x06
+#define        I2O_STATUS_PROCESS_ABORT_DIRTY          0x08
+#define        I2O_STATUS_PROCESS_ABORT_NO_DATA_XFER   0x09
+#define        I2O_STATUS_PROCESS_ABORT_PARTIAL_XFER   0x0a
+#define        I2O_STATUS_TRANSACTION_ERROR            0x0b
+#define        I2O_STATUS_PROGRESS_REPORT              0x80
+
+/* Message versions */
+#define        I2O_VERSION_10                  0x00
+#define        I2O_VERSION_11                  0x01
+#define        I2O_VERSION_20                  0x02
+
+/* Commonly used TIDs */
+#define        I2O_TID_IOP                     0
+#define        I2O_TID_HOST                    1
+#define        I2O_TID_NONE                    4095
+
+/* SGL flags.  This list covers only a fraction of the possibilities. */
+#define        I2O_SGL_DATA_OUT                0x04000000
+#define        I2O_SGL_SIMPLE                  0x10000000
+#define        I2O_SGL_END_BUFFER              0x40000000
+#define        I2O_SGL_END                     0x80000000
+
+/* Serial number formats */
+#define        I2O_SNFMT_UNKNOWN               0
+#define        I2O_SNFMT_BINARY                1
+#define        I2O_SNFMT_ASCII                 2
+#define        I2O_SNFMT_UNICODE               3
+#define        I2O_SNFMT_LAN_MAC               4
+#define        I2O_SNFMT_WAN_MAC               5
+
+/*
+ * ================= Common structures =================
+ */
+
+/*
+ * Standard I2O message frame.  All message frames begin with this.
+ *
+ * Bits  Field          Meaning
+ * ----  -------------  ----------------------------------------------------
+ * 0-2   msgflags       Message header version. Must be 001 (little endian).
+ * 3     msgflags      Reserved.
+ * 4-7   msgflags       Offset to SGLs expressed as # of 32-bit words.
+ * 8-15  msgflags       Control flags.
+ * 16-31 msgflags       Message frame size expressed as # of 32-bit words.
+ * 0-11  msgfunc       TID of target.
+ * 12-23 msgfunc        TID of initiator.
+ * 24-31 msgfunc        Function (i.e., type of message).
+ */
+struct i2o_msg {
+       u_int32_t       msgflags;
+       u_int32_t       msgfunc;
+       u_int32_t       msgictx;        /* Initiator context */
+       u_int32_t       msgtctx;        /* Transaction context */
+
+       /* Message payload */
+
+} __attribute__ ((__packed__));
+
+#define        I2O_MSGFLAGS_STATICMF           0x0100
+#define        I2O_MSGFLAGS_64BIT              0x0200
+#define        I2O_MSGFLAGS_MULTI              0x1000
+#define        I2O_MSGFLAGS_CANT_PROCESS       0x2000
+#define        I2O_MSGFLAGS_LAST_REPLY         0x4000
+#define        I2O_MSGFLAGS_REPLY              0x8000
+
+/*
+ * Standard reply frame.  msgflags, msgfunc, msgictx and msgtctx have the
+ * same meaning as in `struct i2o_msg'.
+ *
+ * Bits  Field          Meaning
+ * ----  -------------  ----------------------------------------------------
+ * 0-15  status         Detailed status code.  Specific to device class.
+ * 16-23 status         Reserved.
+ * 24-31 status         Request status code.
+ */
+struct i2o_reply {
+       u_int32_t       msgflags;
+       u_int32_t       msgfunc;
+       u_int32_t       msgictx;
+       u_int32_t       msgtctx;
+       u_int16_t       detail;
+       u_int8_t        reserved;
+       u_int8_t        reqstatus;
+
+       /* Reply payload */
+
+} __attribute__ ((__packed__));
+
+/*
+ * Hardware resource table.  Not documented here.
+ */
+struct i2o_hrt_entry {
+       u_int32_t       adapterid;
+       u_int32_t       controllingtid;
+       u_int8_t        businfo[8];
+} __attribute__ ((__packed__));
+
+struct i2o_hrt {
+       u_int16_t       nentries;
+       u_int8_t        entrysize;
+       u_int8_t        hrtversion;
+       u_int32_t       changeindicator;
+       struct i2o_hrt_entry    entry[1];
+} __attribute__ ((__packed__));
+
+/*
+ * Logical configuration table entry.  Bitfields are broken down as follows:
+ *
+ * Bits   Field           Meaning
+ * -----  --------------  ---------------------------------------------------
+ *  0-11  classid         Class ID.
+ * 12-15  classid         Class version.
+ *  0-11  usertid         User TID
+ * 12-23  usertid         Parent TID.
+ * 24-31  usertid         BIOS info.
+ */
+struct i2o_lct_entry {
+       u_int16_t       entrysize;
+       u_int16_t       localtid;               /* Bits 0-12 only */
+       u_int32_t       changeindicator;
+       u_int32_t       deviceflags;
+       u_int16_t       classid;
+       u_int16_t       orgid;
+       u_int32_t       subclassinfo;
+       u_int32_t       usertid;
+       u_int8_t        identitytag[8];
+       u_int32_t       eventcaps;
+} __attribute__ ((__packed__));
+
+/*
+ * Logical configuration table header.
+ */
+struct i2o_lct {
+       u_int16_t       tablesize;
+       u_int8_t        boottid;
+       u_int8_t        lctversion;
+       u_int32_t       iopflags;
+       u_int32_t       changeindicator;
+       struct i2o_lct_entry    entry[1];
+} __attribute__ ((__packed__));
+
+/*
+ * IOP system table entry.  Bitfields are broken down as follows:
+ *
+ * Bits   Field           Meaning
+ * -----  --------------  ---------------------------------------------------
+ *  0-11  iopid           IOP ID.



Home | Main Index | Thread Index | Old Index