summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2005-01-23 06:28:49 +0000
committermjacob <mjacob@FreeBSD.org>2005-01-23 06:28:49 +0000
commit79cde53b1fb0492fd282b2f16b8976ccaadf3d93 (patch)
tree65cb7ed0de2793b4383c95fd7b36a753fdaf0c56 /sys/dev/isp
parent4358fbbb7e2b1c1c2993239697dd04e13408c9a8 (diff)
downloadFreeBSD-src-79cde53b1fb0492fd282b2f16b8976ccaadf3d93.zip
FreeBSD-src-79cde53b1fb0492fd282b2f16b8976ccaadf3d93.tar.gz
Add some macros for inserting tag ids.
MFC after: 2 weeks
Diffstat (limited to 'sys/dev/isp')
-rw-r--r--sys/dev/isp/isp_target.h66
1 files changed, 52 insertions, 14 deletions
diff --git a/sys/dev/isp/isp_target.h b/sys/dev/isp/isp_target.h
index 2156da1..dff513d 100644
--- a/sys/dev/isp/isp_target.h
+++ b/sys/dev/isp/isp_target.h
@@ -244,24 +244,40 @@ typedef struct {
#define AT_NOCAP 0x16 /* Requested capability not available */
#define AT_BDR_MSG 0x17 /* Bus Device Reset msg received */
#define AT_CDB 0x3D /* CDB received */
-
/*
* Macros to create and fetch and test concatenated handle and tag value macros
*/
-#define AT_MAKE_TAGID(tid, aep) \
- tid = ((aep)->at_handle << 16); \
- if ((aep)->at_flags & AT_TQAE) \
- (tid) |= ((aep)->at_tag_val + 1)
+#define AT_MAKE_TAGID(tid, inst, aep) \
+ tid = aep->at_handle; \
+ if (aep->at_flags & AT_TQAE) { \
+ tid |= (aep->at_tag_val << 16); \
+ tid |= (1 << 24); \
+ } \
+ tid |= (inst << 25)
+
+#define CT_MAKE_TAGID(tid, inst, ct) \
+ tid = ct->ct_fwhandle; \
+ if (ct->ct_flags & CT_TQAE) { \
+ tid |= (ct->ct_tag_val << 16); \
+ tid |= (1 << 24); \
+ } \
+ tid |= (inst << 25)
+
+#define AT_HAS_TAG(val) ((val) & (1 << 24))
+#define AT_GET_TAG(val) (((val) >> 16) & 0xff)
+#define AT_GET_INST(val) (((val) >> 25) & 0x7f)
+#define AT_GET_HANDLE(val) ((val) & 0xffff)
-#define CT_MAKE_TAGID(tid, ct) \
- tid = ((ct)->ct_fwhandle << 16); \
- if ((ct)->ct_flags & CT_TQAE) \
- (tid) |= ((ct)->ct_tag_val + 1)
+#define IN_MAKE_TAGID(tid, inst, inp) \
+ tid = inp->in_seqid; \
+ tid |= (inp->in_tag_val << 16); \
+ tid |= (1 << 24); \
+ tid |= (inst << 25)
-#define AT_HAS_TAG(val) ((val) & 0xffff)
-#define AT_GET_TAG(val) AT_HAS_TAG(val) - 1
-#define AT_GET_HANDLE(val) ((val) >> 16)
+#define TAG_INSERT_INST(tid, inst) \
+ tid &= ~(0x1ffffff); \
+ tid |= (inst << 25)
/*
* Accept Target I/O Entry structure, Type 2
@@ -300,6 +316,30 @@ typedef struct {
#define ATIO2_EX_WRITE 0x1
#define ATIO2_EX_READ 0x2
+/*
+ * Macros to create and fetch and test concatenated handle and tag value macros
+ */
+#define AT2_MAKE_TAGID(tid, inst, aep) \
+ tid = aep->at_rxid; \
+ tid |= (inst << 16)
+
+#define CT2_MAKE_TAGID(tid, inst, ct) \
+ tid = ct->ct_rxid; \
+ tid |= (inst << 16)
+
+#define AT2_HAS_TAG(val) 1
+#define AT2_GET_TAG(val) ((val) & 0xffff)
+#define AT2_GET_INST(val) ((val) >> 16)
+#define AT2_GET_HANDLE AT2_GET_TAG
+
+#define IN_FC_MAKE_TAGID(tid, inst, inp) \
+ tid = inp->in_seqid; \
+ tid |= (inst << 16)
+
+#define FC_TAG_INSERT_INST(tid, inst) \
+ tid &= ~0xffff; \
+ tid |= (inst << 16)
+
/*
* Continue Target I/O Entry structure
@@ -506,7 +546,6 @@ typedef struct {
#define ISP_TDQE(isp, msg, idx, arg) \
if (isp->isp_dblev & ISP_LOGTDEBUG2) isp_print_qentry(isp, msg, idx, arg)
-#ifdef ISP_TARGET_FUNCTIONS
/*
* The functions below are for the publicly available
* target mode functions that are internal to the Qlogic driver.
@@ -552,5 +591,4 @@ int isp_endcmd(struct ispsoftc *, void *, u_int32_t, u_int16_t);
*/
int isp_target_async(struct ispsoftc *, int, int);
-#endif
#endif /* _ISP_TARGET_H */
OpenPOWER on IntegriCloud