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.13-1.16, 1.18-1.21 (via p...
details: https://anonhg.NetBSD.org/src/rev/c835421da5f0
branches: netbsd-1-4
changeset: 470017:c835421da5f0
user: he <he%NetBSD.org@localhost>
date: Sat Jan 08 22:43:46 2000 +0000
description:
Pull up revisions 1.13-1.16,1.18-1.21 (via patch, 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/isp_netbsd.h | 203 +++++++++++++++++++----------------------------
1 files changed, 83 insertions(+), 120 deletions(-)
diffs (300 lines):
diff -r c72de6a7227f -r c835421da5f0 sys/dev/ic/isp_netbsd.h
--- a/sys/dev/ic/isp_netbsd.h Sat Jan 08 22:43:15 2000 +0000
+++ b/sys/dev/ic/isp_netbsd.h Sat Jan 08 22:43:46 2000 +0000
@@ -1,40 +1,34 @@
-/* $NetBSD: isp_netbsd.h,v 1.12 1999/03/26 22:39:45 mjacob Exp $ */
-/* release_03_25_99 */
+/* $NetBSD: isp_netbsd.h,v 1.12.2.1 2000/01/08 22:43:46 he Exp $ */
/*
* NetBSD Specific definitions for the Qlogic ISP Host Adapter
- *
- *---------------------------------------
- * Copyright (c) 1997, 1998 by Matthew Jacob
- * NASA/Ames Research Center
+ * Matthew Jacob <mjacob%nas.nasa.gov@localhost>
+ */
+/*
+ * 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.
*/
-
#ifndef _ISP_NETBSD_H
#define _ISP_NETBSD_H
@@ -62,25 +56,40 @@
#include <vm/vm_param.h>
#include <vm/pmap.h>
+#include "opt_isp.h"
+
#define ISP_PLATFORM_VERSION_MAJOR 0
-#define ISP_PLATFORM_VERSION_MINOR 993
+#define ISP_PLATFORM_VERSION_MINOR 997
#define ISP_SCSI_XFER_T struct scsipi_xfer
struct isposinfo {
struct device _dev;
struct scsipi_link _link;
+ struct scsipi_link _link_b;
struct scsipi_adapter _adapter;
int blocked;
+ union {
+ int _seed;
+ u_int16_t _discovered[2];
+ } un;
+#define seed un._seed
+#define discovered un._discovered
TAILQ_HEAD(, scsipi_xfer) waitq;
};
+
#define MAXISPREQUEST 256
+#ifdef ISP2100_FABRIC
+#define ISP2100_SCRLEN 0x400
+#else
+#define ISP2100_SCRLEN 0x100
+#endif
#include <dev/ic/ispreg.h>
#include <dev/ic/ispvar.h>
#include <dev/ic/ispmbox.h>
+#define IDPRINTF(lev, x) if (isp->isp_dblev >= lev) printf x
#define PRINTF printf
-#define IDPRINTF(lev, x) if (isp->isp_dblev >= lev) printf x
#define MEMZERO bzero
#define MEMCPY(dst, src, count) bcopy((src), (dst), (count))
@@ -90,14 +99,21 @@
#define MemoryBarrier()
#endif
+#define DMA_MSW(x) (((x) >> 16) & 0xffff)
+#define DMA_LSW(x) (((x) & 0xffff))
+
#if defined(SCSIDEBUG)
#define DFLT_DBLEVEL 3
-#else
-#if defined(DEBUG)
+#define CFGPRINTF printf
+#elif defined(DEBUG)
#define DFLT_DBLEVEL 2
-#else
+#define CFGPRINTF printf
+#elif defined(DIAGNOSTIC)
#define DFLT_DBLEVEL 1
-#endif
+#define CFGPRINTF printf
+#else
+#define DFLT_DBLEVEL 0
+#define CFGPRINTF if (0) printf
#endif
#define ISP_LOCKVAL_DECL int isp_spl_save
@@ -112,10 +128,13 @@
#define XS_ISP(xs) (xs)->sc_link->adapter_softc
#define XS_LUN(xs) ((int) (xs)->sc_link->scsipi_scsi.lun)
#define XS_TGT(xs) ((int) (xs)->sc_link->scsipi_scsi.target)
+#define XS_CHANNEL(xs) \
+ (((int) (xs)->sc_link->scsipi_scsi.channel == SCSI_CHANNEL_ONLY_ONE) ? \
+ 0 : (xs)->sc_link->scsipi_scsi.channel)
#define XS_RESID(xs) (xs)->resid
#define XS_XFRLEN(xs) (xs)->datalen
#define XS_CDBLEN(xs) (xs)->cmdlen
-#define XS_CDBP(xs) (xs)->cmd
+#define XS_CDBP(xs) ((caddr_t) (xs)->cmd)
#define XS_STS(xs) (xs)->status
#define XS_TIME(xs) (xs)->timeout
#define XS_SNSP(xs) (&(xs)->sense.scsi_sense)
@@ -144,7 +163,7 @@
#define XS_ERR(xs) (xs)->error
#define XS_NOERR(xs) (xs)->error == XS_NOERROR
-#define XS_CMD_DONE(xs) (xs)->flags |= ITSDONE, scsipi_done(xs)
+#define XS_CMD_DONE(xs) (xs)->flags |= ITSDONE , scsipi_done(xs)
#define XS_IS_CMD_DONE(xs) (((xs)->flags & ITSDONE) != 0)
/*
@@ -153,112 +172,56 @@
#define XS_CANTAG(xs) (((xs)->flags & SCSI_POLL) != 0)
/*
- * This is our default tag (ordered).
+ * This is our default tag (simple).
*/
#define XS_KINDOF_TAG(xs) \
- (((xs)->flags & SCSI_URGENT)? REQFLAG_HTAG : REQFLAG_STAG)
+ (((xs)->flags & SCSI_URGENT) ? REQFLAG_HTAG : REQFLAG_OTAG)
-#define CMD_COMPLETE COMPLETE
-#define CMD_EAGAIN TRY_AGAIN_LATER
-#define CMD_QUEUED SUCCESSFULLY_QUEUED
-
+/*
+ * These get turned into NetBSD midlayer codes
+ */
+#define CMD_COMPLETE 100
+#define CMD_EAGAIN 101
+#define CMD_QUEUED 102
+#define CMD_RQLATER 103
#define isp_name isp_osinfo._dev.dv_xname
+#define isp_unit isp_osinfo._dev.dv_unit
+#define SCSI_QFULL 0x28
#define SYS_DELAY(x) delay(x)
#define WATCH_INTERVAL 30
#define FC_FW_READY_DELAY (12 * 1000000)
+#define DEFAULT_LOOPID(x) 108
+#define DEFAULT_WWN(x) (0x1000beed00000000LL + (x)->isp_osinfo.seed)
extern void isp_attach __P((struct ispsoftc *));
extern void isp_uninit __P((struct ispsoftc *));
-static inline void isp_prtstst(ispstatusreq_t *sp)
-{
- char buf[128];
- sprintf(buf, "states->");
- if (sp->req_state_flags & RQSF_GOT_BUS)
- sprintf(buf, "%s%s", buf, "GOT_BUS ");
- if (sp->req_state_flags & RQSF_GOT_TARGET)
- sprintf(buf, "%s%s", buf, "GOT_TGT ");
- if (sp->req_state_flags & RQSF_SENT_CDB)
- sprintf(buf, "%s%s", buf, "SENT_CDB ");
- if (sp->req_state_flags & RQSF_XFRD_DATA)
- sprintf(buf, "%s%s", buf, "XFRD_DATA ");
- if (sp->req_state_flags & RQSF_GOT_STATUS)
- sprintf(buf, "%s%s", buf, "GOT_STS ");
- if (sp->req_state_flags & RQSF_GOT_SENSE)
- sprintf(buf, "%s%s", buf, "GOT_SNS ");
- if (sp->req_state_flags & RQSF_XFER_COMPLETE)
- sprintf(buf, "%s%s", buf, "XFR_CMPLT ");
- sprintf(buf, "%s%s", buf, "\n");
- sprintf(buf, "%s%s", buf, "status->");
- if (sp->req_status_flags & RQSTF_DISCONNECT)
- sprintf(buf, "%s%s", buf, "Disconnect ");
- if (sp->req_status_flags & RQSTF_SYNCHRONOUS)
- sprintf(buf, "%s%s", buf, "Sync_xfr ");
- if (sp->req_status_flags & RQSTF_PARITY_ERROR)
- sprintf(buf, "%s%s", buf, "Parity ");
- if (sp->req_status_flags & RQSTF_BUS_RESET)
- sprintf(buf, "%s%s", buf, "Bus_Reset ");
- if (sp->req_status_flags & RQSTF_DEVICE_RESET)
- sprintf(buf, "%s%s", buf, "Device_Reset ");
- if (sp->req_status_flags & RQSTF_ABORTED)
- sprintf(buf, "%s%s", buf, "Aborted ");
- if (sp->req_status_flags & RQSTF_TIMEOUT)
- sprintf(buf, "%s%s", buf, "Timeout ");
- if (sp->req_status_flags & RQSTF_NEGOTIATION)
- sprintf(buf, "%s%s", buf, "Negotiation ");
- sprintf(buf, "%s%s", buf, "\n");
-}
+#define ISP_UNSWIZZLE_AND_COPY_PDBP(isp, dest, src) \
+ bcopy(src, dest, sizeof (isp_pdb_t))
+#define ISP_SWIZZLE_ICB(a, b)
+#ifdef __sparc__
+#define ISP_SWIZZLE_REQUEST(a, b) \
+ ISP_SBUSIFY_ISPHDR(a, &(b)->req_header); \
+ ISP_SBUSIFY_ISPREQ(a, b)
+#define ISP_UNSWIZZLE_RESPONSE(a, b) \
+ ISP_SBUSIFY_ISPHDR(a, &(b)->req_header)
+#else
+#define ISP_SWIZZLE_REQUEST(a, b)
+#define ISP_UNSWIZZLE_RESPONSE(a, b)
+#endif
+#define ISP_SWIZZLE_SNS_REQ(a, b)
+#define ISP_UNSWIZZLE_SNS_RSP(a, b, c)
-static inline const char *isp2100_fw_statename(int state)
-{
- static char buf[16];
- switch(state) {
- case FW_CONFIG_WAIT: return "Config Wait";
- case FW_WAIT_AL_PA: return "Waiting for AL_PA";
- case FW_WAIT_LOGIN: return "Wait Login";
- case FW_READY: return "Ready";
- case FW_LOSS_OF_SYNC: return "Loss Of Sync";
- case FW_ERROR: return "Error";
- case FW_REINIT: return "Re-Init";
- case FW_NON_PART: return "Nonparticipating";
- default:
- sprintf(buf, "?0x%x?", state);
- return buf;
- }
-}
+#define INLINE inline
+#include <dev/ic/isp_inline.h>
-static inline const char *isp2100_pdb_statename(int pdb_state)
-{
- static char buf[16];
- switch(pdb_state) {
- case PDB_STATE_DISCOVERY: return "Port Discovery";
- case PDB_STATE_WDISC_ACK: return "Waiting Port Discovery ACK";
- case PDB_STATE_PLOGI: return "Port Login";
- case PDB_STATE_PLOGI_ACK: return "Wait Port Login ACK";
- case PDB_STATE_PRLI: return "Process Login";
- case PDB_STATE_PRLI_ACK: return "Wait Process Login ACK";
- case PDB_STATE_LOGGED_IN: return "Logged In";
- case PDB_STATE_PORT_UNAVAIL: return "Port Unavailable";
- case PDB_STATE_PRLO: return "Process Logout";
- case PDB_STATE_PRLO_ACK: return "Wait Process Logout ACK";
- case PDB_STATE_PLOGO: return "Port Logout";
- case PDB_STATE_PLOG_ACK: return "Wait Port Logout ACK";
- default:
- sprintf(buf, "?0x%x?", pdb_state);
- return buf;
- }
-}
-
-/*
- * Keep these off for now...
- */
-#define ISP_NO_FASTPOST_SCSI 1
-#define ISP_NO_FASTPOST_FC 1
-
+#if !defined(ISP_DISABLE_FW) && !defined(ISP_COMPILE_FW)
+#define ISP_COMPILE_FW 1
+#endif
#endif /* _ISP_NETBSD_H */
Home |
Main Index |
Thread Index |
Old Index