summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormjacob <mjacob@cvs.openbsd.org>2003-03-03 18:37:26 +0000
committermjacob <mjacob@cvs.openbsd.org>2003-03-03 18:37:26 +0000
commit96f2762bebc918bfcfaa59d0ebbea500fc3ce9b8 (patch)
tree720f3d9cf5fd1a92be635ad287379ce2f82ef33f /sys
parent5b95c024f385e32951e81d28f000d573848342a9 (diff)
Get rid of ISP_DMA_ADDR_T and uses ISP_DAC_SUPPORTED to define the
width of a dma address type- this also allows us to define macros that set upper words of a dma address. Remove STRNCAT. Add (untested) 10160 support.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ispvar.h39
1 files changed, 24 insertions, 15 deletions
diff --git a/sys/dev/ic/ispvar.h b/sys/dev/ic/ispvar.h
index 3b72723e736..8b4e83495df 100644
--- a/sys/dev/ic/ispvar.h
+++ b/sys/dev/ic/ispvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ispvar.h,v 1.21 2002/08/17 17:40:26 mjacob Exp $ */
+/* $OpenBSD: ispvar.h,v 1.22 2003/03/03 18:37:25 mjacob Exp $ */
/*
* Soft Definitions for for Qlogic ISP SCSI adapters.
*
@@ -89,8 +89,10 @@ struct ispmdvec {
/*
* 'Types'
*/
-#ifndef ISP_DMA_ADDR_T
-#define ISP_DMA_ADDR_T u_int32_t
+#ifdef ISP_DAC_SUPPORTED
+typedef u_int64_t isp_dma_addr_t;
+#else
+typedef u_int32_t isp_dma_addr_t;
#endif
/*
@@ -307,7 +309,7 @@ typedef struct {
* Scratch DMA mapped in area to fetch Port Database stuff, etc.
*/
caddr_t isp_scratch;
- ISP_DMA_ADDR_T isp_scdma;
+ isp_dma_addr_t isp_scdma;
#ifdef ISP_FW_CRASH_DUMP
u_int16_t *isp_dump_data;
#endif
@@ -429,8 +431,8 @@ typedef struct ispsoftc {
*/
caddr_t isp_rquest;
caddr_t isp_result;
- ISP_DMA_ADDR_T isp_rquest_dma;
- ISP_DMA_ADDR_T isp_result_dma;
+ isp_dma_addr_t isp_rquest_dma;
+ isp_dma_addr_t isp_result_dma;
} ispsoftc_t;
#define SDPARAM(isp) ((sdparam *) (isp)->isp_param)
@@ -538,7 +540,8 @@ typedef struct ispsoftc {
#define ISP_HA_SCSI_1240 0x8
#define ISP_HA_SCSI_1080 0x9
#define ISP_HA_SCSI_1280 0xa
-#define ISP_HA_SCSI_12160 0xb
+#define ISP_HA_SCSI_10160 0xb
+#define ISP_HA_SCSI_12160 0xc
#define ISP_HA_FC 0xf0
#define ISP_HA_FC_2100 0x10
#define ISP_HA_FC_2200 0x20
@@ -549,12 +552,14 @@ typedef struct ispsoftc {
#define IS_1240(isp) (isp->isp_type == ISP_HA_SCSI_1240)
#define IS_1080(isp) (isp->isp_type == ISP_HA_SCSI_1080)
#define IS_1280(isp) (isp->isp_type == ISP_HA_SCSI_1280)
+#define IS_10160(isp) (isp->isp_type == ISP_HA_SCSI_10160)
#define IS_12160(isp) (isp->isp_type == ISP_HA_SCSI_12160)
#define IS_12X0(isp) (IS_1240(isp) || IS_1280(isp))
+#define IS_1X160(isp) (IS_10160(isp) || IS_12160(isp))
#define IS_DUALBUS(isp) (IS_12X0(isp) || IS_12160(isp))
-#define IS_ULTRA2(isp) (IS_1080(isp) || IS_1280(isp) || IS_12160(isp))
-#define IS_ULTRA3(isp) (IS_12160(isp))
+#define IS_ULTRA2(isp) (IS_1080(isp) || IS_1280(isp) || IS_1X160(isp))
+#define IS_ULTRA3(isp) (IS_1X160(isp))
#define IS_FC(isp) ((isp)->isp_type & ISP_HA_FC)
#define IS_2100(isp) ((isp)->isp_type == ISP_HA_FC_2100)
@@ -566,8 +571,13 @@ typedef struct ispsoftc {
/*
* DMA cookie macros
*/
+#ifdef ISP_DAC_SUPPORTRED
+#define DMA_WD3(x) (((x) >> 48) & 0xffff)
+#define DMA_WD2(x) (((x) >> 32) & 0xffff)
+#else
#define DMA_WD3(x) 0
#define DMA_WD2(x) 0
+#endif
#define DMA_WD1(x) (((x) >> 16) & 0xffff)
#define DMA_WD0(x) (((x) & 0xffff))
@@ -703,7 +713,7 @@ int isp_control(struct ispsoftc *, ispctl_t, void *);
* we had better let the OS determine login policy.
*
* ISPASYNC_PROMENADE has an argument that is a pointer to an integer which
- * is an index into the portdb in the softc ('target'). Whether that entrie's
+ * is an index into the portdb in the softc ('target'). Whether that entry's
* valid tag is set or not says whether something has arrived or departed.
* The name refers to a favorite pastime of many city dwellers- watching
* people come and go, talking of Michaelangelo, and so on..
@@ -772,17 +782,16 @@ void isp_prt(struct ispsoftc *, int level, const char *, ...);
*
* INLINE - platform specific define for 'inline' functions
*
- * ISP_DMA_ADDR_T - platform specific dma address coookie- basically
- * the largest integer that can hold the 32 or
- * 64 bit value appropriate for the QLogic's DMA
- * addressing. Defaults to u_int32_t.
+ * ISP_DAC_SUPPORTED - Is DAC (Dual Address Cycle) is supported?
+ * Basically means whether or not DMA for PCI
+ * PCI cards (Ultra2 or better or FC) works
+ * above 4GB.
*
* ISP2100_SCRLEN - length for the Fibre Channel scratch DMA area
*
* MEMZERO(dst, src) platform zeroing function
* MEMCPY(dst, src, count) platform copying function
* SNPRINTF(buf, bufsize, fmt, ...) snprintf
- * STRNCAT(dstbuf, size, srcbuf) strncat
* USEC_DELAY(usecs) microsecond spindelay function
* USEC_SLEEP(isp, usecs) microsecond sleep function
*