Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/dev/ic Pull up revisions 1.16-1.20 (requested by mj...



details:   https://anonhg.NetBSD.org/src/rev/a886cbea5740
branches:  netbsd-1-4
changeset: 470012:a886cbea5740
user:      he <he%NetBSD.org@localhost>
date:      Sat Jan 08 22:40:58 2000 +0000

description:
Pull up revisions 1.16-1.20 (requested by mjacob):
  Untangle Qlogic firmware copyright problems and update firmware.
  Untangle some MD support issues for said firmware. Add 1280 (Dual
  LVD), 1240 (Dual Ultra), 2200 (2nd Generation Qlogic FC chipset).
  Fix some synchronous negotiation problems for parallel SCSI.
  Firm up some Fabric Support issues.

diffstat:

 sys/dev/ic/ispmbox.h |  686 ++++++++++----------------------------------------
 1 files changed, 135 insertions(+), 551 deletions(-)

diffs (truncated from 871 to 300 lines):

diff -r 9380a943c93d -r a886cbea5740 sys/dev/ic/ispmbox.h
--- a/sys/dev/ic/ispmbox.h      Sat Jan 08 22:40:27 2000 +0000
+++ b/sys/dev/ic/ispmbox.h      Sat Jan 08 22:40:58 2000 +0000
@@ -1,38 +1,34 @@
-/* $NetBSD: ispmbox.h,v 1.15 1999/03/26 22:39:45 mjacob Exp $ */
-/* release_03_25_99 */
+/* $NetBSD: ispmbox.h,v 1.15.2.1 2000/01/08 22:40:58 he Exp $ */
 /*
- * Mailbox and Queue Entry Definitions for for Qlogic ISP SCSI adapters.
- *
- *---------------------------------------
- * Copyright (c) 1997, 1998 by Matthew Jacob
- * NASA/Ames Research Center
+ * Copyright (C) 1997, 1998, 1999 National Aeronautics & Space Administration
  * All rights reserved.
- *---------------------------------------
  *
  * 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 immediately at the beginning of the file, without modification,
- *    this list of conditions, and the following disclaimer.
+ *    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. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
+ *    derived from this software without specific prior written permission
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+/*
+ * Mailbox and Queue Entry Definitions for for Qlogic ISP SCSI adapters.
+ * <mjacob%nas.nasa.gov@localhost>
  */
 #ifndef        _ISPMBOX_H
 #define        _ISPMBOX_H
@@ -83,7 +79,7 @@
 #define MBOX_GET_SBUS_PARAMS           0x0027
 #define MBOX_GET_TARGET_PARAMS         0x0028
 #define MBOX_GET_DEV_QUEUE_PARAMS      0x0029
-                                       /*  2a */
+#define        MBOX_GET_RESET_DELAY_PARAMS     0x002a
                                        /*  2b */
                                        /*  2c */
                                        /*  2d */
@@ -94,13 +90,13 @@
 #define MBOX_SET_RETRY_COUNT           0x0032
 #define MBOX_SET_TAG_AGE_LIMIT         0x0033
 #define MBOX_SET_CLOCK_RATE            0x0034
-#define MBOX_SET_ACTIVE_NEG_STATE      0x0035
+#define MBOX_SET_ACT_NEG_STATE         0x0035
 #define MBOX_SET_ASYNC_DATA_SETUP_TIME 0x0036
 #define MBOX_SET_SBUS_CONTROL_PARAMS   0x0037
 #define                MBOX_SET_PCI_PARAMETERS 0x0037
 #define MBOX_SET_TARGET_PARAMS         0x0038
 #define MBOX_SET_DEV_QUEUE_PARAMS      0x0039
-                                       /*  3a */
+#define        MBOX_SET_RESET_DELAY_PARAMS     0x003a
                                        /*  3b */
                                        /*  3c */
                                        /*  3d */
@@ -114,6 +110,9 @@
 #define                FW_FEATURE_LVD_NOTIFY   0x2
 #define                FW_FEATURE_FAST_POST    0x1
 
+#define        MBOX_ENABLE_TARGET_MODE         0x55
+#define                ENABLE_TARGET_FLAG      0x8000
+
 /* These are for the ISP2100 FC cards */
 #define        MBOX_GET_LOOP_ID                0x20
 #define        MBOX_EXEC_COMMAND_IOCB_A64      0x54
@@ -130,6 +129,10 @@
 #define        MBOX_GET_PORT_NAME              0x6a
 #define        MBOX_GET_LINK_STATUS            0x6b
 #define        MBOX_INIT_LIP_RESET             0x6c
+#define        MBOX_SEND_SNS                   0x6e
+#define        MBOX_FABRIC_LOGIN               0x6f
+#define        MBOX_SEND_CHANGE_REQUEST        0x70
+#define        MBOX_FABRIC_LOGOUT              0x71
 #define        MBOX_INIT_LIP_LOGIN             0x72
 
 #define        ISP2100_SET_PCI_PARAM           0x00ff
@@ -185,19 +188,34 @@
        u_int32_t       ds_count;
 } ispds_t;
 
+#define        _ISP_SWAP8(a, b)        {       \
+       u_int8_t tmp;                   \
+       tmp = a;                        \
+       a = b;                          \
+       b = tmp;                        \
+}
+
+/*
+ * These elements get swizzled around for SBus instances.
+ */
 typedef struct {
-#if BYTE_ORDER == BIG_ENDIAN
-       u_int8_t        rqs_entry_count;
-       u_int8_t        rqs_entry_type;
-       u_int8_t        rqs_flags;
-       u_int8_t        rqs_seqno;
-#else
        u_int8_t        rqs_entry_type;
        u_int8_t        rqs_entry_count;
        u_int8_t        rqs_seqno;
        u_int8_t        rqs_flags;
+} isphdr_t;
+/*
+ * There are no (for all intents and purposes) non-sparc SBus machines
+ */
+#ifdef __sparc__
+#define        ISP_SBUSIFY_ISPHDR(isp, hdrp)                                   \
+    if ((isp)->isp_bustype == ISP_BT_SBUS) {                           \
+       _ISP_SWAP8((hdrp)->rqs_entry_count, (hdrp)->rqs_entry_type);    \
+       _ISP_SWAP8((hdrp)->rqs_flags, (hdrp)->rqs_seqno);               \
+    }
+#else
+#define        ISP_SBUSIFY_ISPHDR(a, b)
 #endif
-} isphdr_t;
 
 /* RQS Flag definitions */
 #define        RQSFLAG_CONTINUATION    0x01
@@ -212,7 +230,7 @@
 #define        RQSTYPE_MARKER          0x04
 #define        RQSTYPE_CMDONLY         0x05
 #define        RQSTYPE_ATIO            0x06    /* Target Mode */
-#define        RQSTYPE_CTIO0           0x07    /* Target Mode */
+#define        RQSTYPE_CTIO            0x07    /* Target Mode */
 #define        RQSTYPE_SCAM            0x08
 #define        RQSTYPE_A64             0x09
 #define        RQSTYPE_A64_CONT        0x0a
@@ -237,13 +255,8 @@
 typedef struct {
        isphdr_t        req_header;
        u_int32_t       req_handle;
-#if BYTE_ORDER == BIG_ENDIAN
-       u_int8_t        req_target;
-       u_int8_t        req_lun_trn;
-#else
        u_int8_t        req_lun_trn;
        u_int8_t        req_target;
-#endif
        u_int16_t       req_cdblen;
 #define        req_modifier    req_cdblen      /* marker packet */
        u_int16_t       req_flags;
@@ -254,17 +267,31 @@
        ispds_t         req_dataseg[ISP_RQDSEG];
 } ispreq_t;
 
+/*
+ * A request packet can also be a marker packet.
+ */
+#define SYNC_DEVICE    0
+#define SYNC_TARGET    1
+#define SYNC_ALL       2
+
+/*
+ * There are no (for all intents and purposes) non-sparc SBus machines
+ */
+#ifdef __sparc__
+#define        ISP_SBUSIFY_ISPREQ(isp, rqp)                                    \
+    if ((isp)->isp_bustype == ISP_BT_SBUS) {                           \
+       _ISP_SWAP8((rqp)->req_target, (rqp)->req_lun_trn);              \
+    }
+#else
+#define        ISP_SBUSIFY_ISPREQ(a, b)
+#endif
+
 #define        ISP_RQDSEG_T2   3
 typedef struct {
        isphdr_t        req_header;
        u_int32_t       req_handle;
-#if BYTE_ORDER == BIG_ENDIAN
-       u_int8_t        req_target;
-       u_int8_t        req_lun_trn;
-#else
        u_int8_t        req_lun_trn;
        u_int8_t        req_target;
-#endif
        u_int16_t       req_scclun;
        u_int16_t       req_flags;
        u_int16_t       _res2;
@@ -299,13 +326,8 @@
 typedef struct {
        isphdr_t        req_header;
        u_int32_t       req_handle;
-#if    BYTE_ORDER == BIG_ENDIAN
-       u_int8_t        req_target;
-       u_int8_t        req_lun_trn;
-#else
        u_int8_t        req_lun_trn;
        u_int8_t        req_target;
-#endif
        u_int16_t       req_cdblen;
        u_int16_t       req_flags;
        u_int16_t       _res1;
@@ -323,32 +345,13 @@
 
 typedef struct {
        isphdr_t        req_header;
-       u_int32_t       _res1;
-#if    BYTE_ORDER == BIG_ENDIAN
-       u_int8_t        req_target;
-       u_int8_t        req_lun_trn;
-       u_int8_t        _res2;
-       u_int8_t        req_modifier;
-#else
-       u_int8_t        req_lun_trn;
-       u_int8_t        req_target;
-       u_int8_t        req_modifier;
-       u_int8_t        _res2;
-#endif
-} ispmarkreq_t;
-
-#define SYNC_DEVICE    0
-#define SYNC_TARGET    1
-#define SYNC_ALL       2
-
-typedef struct {
-       isphdr_t        req_header;
        u_int32_t       req_handle;
        u_int16_t       req_scsi_status;
        u_int16_t       req_completion_status;
        u_int16_t       req_state_flags;
        u_int16_t       req_status_flags;
        u_int16_t       req_time;
+#define        req_response_len        req_time        /* FC only */
        u_int16_t       req_sense_len;
        u_int32_t       req_resid;
        u_int8_t        _res1[8];
@@ -436,66 +439,67 @@
 /*
  * Initialization Control Block
  *
- * Version One format.
+ * Version One (prime) format.
  */
-typedef struct {
-#if BYTE_ORDER == BIG_ENDIAN
-       u_int8_t        _reserved0;
-       u_int8_t        icb_version;
-#else
+typedef struct isp_icb {
        u_int8_t        icb_version;
        u_int8_t        _reserved0;
-#endif
-        u_int16_t      icb_fwoptions;
-        u_int16_t      icb_maxfrmlen;
+       u_int16_t       icb_fwoptions;
+       u_int16_t       icb_maxfrmlen;
        u_int16_t       icb_maxalloc;
        u_int16_t       icb_execthrottle;
-#if BYTE_ORDER == BIG_ENDIAN
-       u_int8_t        icb_retry_delay;
-       u_int8_t        icb_retry_count;
-#else
        u_int8_t        icb_retry_count;
        u_int8_t        icb_retry_delay;
-#endif
-        u_int8_t       icb_nodename[8];
+       u_int8_t        icb_portname[8];
        u_int16_t       icb_hardaddr;
-#if BYTE_ORDER == BIG_ENDIAN
-       u_int8_t        _reserved1;
        u_int8_t        icb_iqdevtype;
-#else
-       u_int8_t        icb_iqdevtype;
-       u_int8_t        _reserved1;
-#endif
-        u_int8_t       icb_portname[8];
+       u_int8_t        icb_logintime;
+       u_int8_t        icb_nodename[8];
        u_int16_t       icb_rqstout;



Home | Main Index | Thread Index | Old Index