diff options
author | mjacob <mjacob@FreeBSD.org> | 2000-06-27 19:22:13 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2000-06-27 19:22:13 +0000 |
commit | c32e4a88bf9c5ea1a87ce5600166d4c82309a603 (patch) | |
tree | cf44b3ad4605aa51c3ef1e079f481e43b8d6f378 /sys/dev/isp/isp_freebsd.h | |
parent | 51596cce555d8b265d5e459b11b255ec0d0dc723 (diff) | |
download | FreeBSD-src-c32e4a88bf9c5ea1a87ce5600166d4c82309a603.zip FreeBSD-src-c32e4a88bf9c5ea1a87ce5600166d4c82309a603.tar.gz |
Clean up private storage so that we can use the spriv_field0 to
store a bitmask of whether we've set a value into ccb->ccb_h.status,
whether we're in the watchdog routine for this command now, whether
we've set a grace period for this command and whether this command is
actually done.
See comments of rev 1.45 of isp.c for more complete information.
Diffstat (limited to 'sys/dev/isp/isp_freebsd.h')
-rw-r--r-- | sys/dev/isp/isp_freebsd.h | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index da763ec..37f6c56 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -186,20 +186,42 @@ extern int isp_debug; #define XS_SNS_IS_VALID(ccb) ((ccb)->ccb_h.status |= CAM_AUTOSNS_VALID) #define XS_IS_SNS_VALID(ccb) (((ccb)->ccb_h.status & CAM_AUTOSNS_VALID) != 0) -#define XS_INITERR(ccb) \ - (ccb)->ccb_h.status &= ~CAM_STATUS_MASK, \ - (ccb)->ccb_h.status |= CAM_REQ_INPROG, \ - (ccb)->ccb_h.spriv_field0 = CAM_REQ_INPROG -#define XS_SETERR(ccb, v) (ccb)->ccb_h.spriv_field0 = v -#define XS_ERR(ccb) (ccb)->ccb_h.spriv_field0 +#define ISP_SPRIV_ERRSET 0x1 +#define ISP_SPRIV_INWDOG 0x2 +#define ISP_SPRIV_GRACE 0x4 +#define ISP_SPRIV_DONE 0x8 + +#define XS_CMD_S_WDOG(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_INWDOG +#define XS_CMD_C_WDOG(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_INWDOG +#define XS_CMD_WDOG_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_INWDOG) + +#define XS_CMD_S_GRACE(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_GRACE +#define XS_CMD_C_GRACE(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_GRACE +#define XS_CMD_GRACE_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_GRACE) + +#define XS_CMD_S_DONE(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_DONE +#define XS_CMD_C_DONE(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_DONE +#define XS_CMD_DONE_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_DONE) + +#define XS_CMD_S_CLEAR(sccb) (sccb)->ccb_h.spriv_field0 = 0 + + +#define XS_SETERR(ccb, v) (ccb)->ccb_h.status &= ~CAM_STATUS_MASK, \ + (ccb)->ccb_h.status |= v, \ + (ccb)->ccb_h.spriv_field0 |= ISP_SPRIV_ERRSET + +#define XS_INITERR(ccb) XS_SETERR(ccb, CAM_REQ_INPROG), \ + XS_CMD_S_CLEAR(ccb) + +#define XS_ERR(ccb) ((ccb)->ccb_h.status & CAM_STATUS_MASK) + #define XS_NOERR(ccb) \ - ((ccb)->ccb_h.spriv_field0 == CAM_REQ_INPROG) + (((ccb)->ccb_h.spriv_field0 & ISP_SPRIV_ERRSET) == 0 || \ + ((ccb)->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) -extern void isp_done(struct ccb_scsiio *); -#define XS_CMD_DONE(sccb) isp_done(sccb) +#define XS_CMD_DONE isp_done -#define XS_IS_CMD_DONE(ccb) \ - (((ccb)->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) +extern void isp_done(struct ccb_scsiio *); /* * Can we tag? @@ -217,7 +239,6 @@ extern void isp_done(struct ccb_scsiio *); #define CMD_EAGAIN 1 #define CMD_QUEUED 2 #define CMD_RQLATER 3 -#define STOP_WATCHDOG(f, s) extern void isp_attach(struct ispsoftc *); extern void isp_uninit(struct ispsoftc *); |