Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Roll platform version. Keep a bitmap of 'discover...
details: https://anonhg.NetBSD.org/src/rev/c6a7dfd9182d
branches: trunk
changeset: 477182:c6a7dfd9182d
user: mjacob <mjacob%NetBSD.org@localhost>
date: Thu Oct 14 02:33:38 1999 +0000
description:
Roll platform version. Keep a bitmap of 'discovered' devices for SCSI adapters
so we'll know when it's time to switch from 'slow' command mode to normal.
Change some settings for configuration printfs and debug levels. Redo the
internal ispscsicmd return definitions and let isp_cmd translate them as
approrpriate to NetBSD values. Remove the inline functions from here- they're
now in isp_inline.h. Put in the start of the correct SWIZZLE/UNSWIZZLE
functions.
diffstat:
sys/dev/ic/isp_netbsd.h | 129 +++++++++++++++--------------------------------
1 files changed, 42 insertions(+), 87 deletions(-)
diffs (190 lines):
diff -r 759087f18a1a -r c6a7dfd9182d sys/dev/ic/isp_netbsd.h
--- a/sys/dev/ic/isp_netbsd.h Thu Oct 14 02:31:11 1999 +0000
+++ b/sys/dev/ic/isp_netbsd.h Thu Oct 14 02:33:38 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.h,v 1.17 1999/09/30 23:06:19 thorpej Exp $ */
+/* $NetBSD: isp_netbsd.h,v 1.18 1999/10/14 02:33:38 mjacob Exp $ */
/* release_6_5_99 */
/*
* NetBSD Specific definitions for the Qlogic ISP Host Adapter
@@ -60,7 +60,7 @@
#include "opt_isp.h"
#define ISP_PLATFORM_VERSION_MAJOR 0
-#define ISP_PLATFORM_VERSION_MINOR 996
+#define ISP_PLATFORM_VERSION_MINOR 997
#define ISP_SCSI_XFER_T struct scsipi_xfer
struct isposinfo {
@@ -68,10 +68,16 @@
struct scsipi_link _link;
struct scsipi_link _link_b;
struct scsipi_adapter _adapter;
- int seed;
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
@@ -85,6 +91,9 @@
#define PRINTF printf
#define IDPRINTF(lev, x) if (isp->isp_dblev >= lev) printf x
+#ifdef DIAGNOSTIC
+#else
+#endif
#define MEMZERO bzero
#define MEMCPY(dst, src, count) bcopy((src), (dst), (count))
@@ -99,11 +108,14 @@
#if defined(SCSIDEBUG)
#define DFLT_DBLEVEL 3
+#define CFGPRINTF printf
#else
-#if defined(DEBUG)
-#define DFLT_DBLEVEL 2
+#if defined(DIAGNOSTIC) || defined(DEBUG)
+#define DFLT_DBLEVEL 1
+#define CFGPRINTF printf
#else
-#define DFLT_DBLEVEL 1
+#define DFLT_DBLEVEL 0
+#define CFGPRINTF if (0) printf
#endif
#endif
@@ -168,10 +180,13 @@
#define XS_KINDOF_TAG(xs) \
(((xs)->xs_control & XS_CTL_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
@@ -179,7 +194,6 @@
#define SCSI_QFULL 0x28
-
#define SYS_DELAY(x) delay(x)
#define WATCH_INTERVAL 30
@@ -191,82 +205,23 @@
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 ");
- printf("%s\n", buf);
-}
+#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;
- }
-}
#endif /* _ISP_NETBSD_H */
Home |
Main Index |
Thread Index |
Old Index